{"version":3,"sources":["locales/translations.ts","utils/LocaleHE.js","utils/date-utils.ts","api/odata/ODataFilter.ts","styles/colors/bookitColors.ts","utils/userProfileSettings.ts","app/slice/selectors.ts","app/components/BasicTable/types/FilterParam.ts","api/HttpClient.ts","app/components/BasicIcons/FontAwesome/index.tsx","app/components/Forms/FormsLayout/FormRightSection/index.tsx","app/components/Forms/FormsLayout/StyledForm/index.tsx","api/SettingsApi.ts","app/slice/workers/doPrefetchConfigurableColumns.ts","app/slice/saga.ts","app/slice/index.ts","app/components/BasicButtons/Button/index.tsx","app/components/Typography/index.tsx","utils/url-utils.ts","app/slice/types.ts","utils/loadable.tsx","app/Layout/FrontendLayout/slice/type.ts","app/components/BasicButtons/IconButton/index.tsx","app/Layout/FrontendLayout/slice/saga.ts","app/Layout/FrontendLayout/slice/index.ts","app/components/basic/Wrappers/Box/index.tsx","app/Layout/FrontendLayout/slice/selectors.ts","types/AppSettings.ts","utils/typeUtils.ts","utils/globalSettings/GlobalSettings.ts","types/KnownModules.ts","utils/mobileDetect.ts","app/components/BasicPickers/AutocompletePicker/index.tsx","app/components/BasicPickers/BaseOptionsPicker/highlightSearchTerm.tsx","app/components/BasicTooltips/Tooltip/index.tsx","api/odata/generated/enums/AvailabilityTypes.ts","enums/ServiceTypes.ts","app/components/Typography/BasicTypography.tsx","enums/AssetAttributes.ts","styles/typography/bookitTypography.ts","utils/redux-injectors.ts","app/components/BasicPickers/Utils/autoCompletePickerUtils.ts","utils/enumKeys.ts","utils/string-utils.ts","app/hooks/useEffectOnMount.ts","app/pages/ReservationDetails/Details/slice/types.ts","app/hooks/useAsyncAwaitedState.ts","app/hooks/useSystemDate.ts","app/components/ExternalLink/index.tsx","app/Layout/FrontendLayout/components/CoverWrapper/index.tsx","app/components/LinearProgress/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/Head.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/ShortHead.tsx","app/Layout/FrontendLayout/components/PageWrapper/styled/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/ButtonsPanel.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/TopButtonsPanel.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/FormSkeleton.tsx","app/Layout/FrontendLayout/components/PageWrapper/index.tsx","utils/assertExhaustive.tsx","app/pages/OtherServiceDetails/Details/slice/selectors.ts","app/pages/ReservationDetails/Details/slice/selectors.ts","app/components/Forms/FormTextField.tsx","enums/ConfigurableTypes.ts","utils/@reduxjs/toolkit.tsx","app/components/Forms/Schemas/index.ts","app/components/BasicButtons/TopActionButton/index.tsx","app/hooks/useSidePanelOpen.tsx","app/components/DialogConfirm/index.tsx","app/pages/Samples/RequestSamplesPage/slice/types.ts","app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn.ts","app/pages/Samples/RequestSamplesPage/slice/selectors.ts","app/components/BasicIcons/InfoIcon/index.tsx","enums/RepetitiveOptions.ts","utils/globalSettings/AllowedSettings.ts","app/components/BasicPickers/BaseOptionsPicker/index.tsx","app/components/Forms/FormRender/FormRenderer.tsx","app/components/DatePeriods/index.tsx","app/Layout/FrontendLayout/components/Snackbar/types.ts","app/pages/CalendarPage/Scheduler/components/event_text/handlebars.ts","app/pages/CalendarPage/Scheduler/components/event_text/ExtractPathsVisitor.ts","app/pages/CalendarPage/Scheduler/slice/selectors.ts","api/odata/generated/enums/RequiredTypes.ts","api/odata/generated/enums/DisplayTypes.ts","app/components/CustomForm/CustomFormUtils.ts","types/CustomDate.ts","app/components/pickers/AutocompletePickers/UserPicker/index.tsx","app/hooks/usePromise.ts","types/PresetDatesRange.ts","app/pages/Samples/RequestSamplesPage/slice/saga.ts","app/pages/Samples/RequestSamplesPage/slice/index.ts","utils/entity-utils.ts","app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker/index.tsx","app/components/pickers/MultiSelectPickers/AssetsPicker/index.tsx","types/AuthenticatedUser.ts","app/pages/Samples/SamplePlatesPage/slice/index.ts","app/components/Forms/FormRichTextField.tsx","app/pages/AssetPopUp/OpenAssetDetails/index.tsx","enums/RestrictDurationUnitTypes.ts","app/pages/CalendarPage/Scheduler/utils/index.ts","app/components/LoadingIndicator/index.tsx","app/pages/OtherServiceDetails/Details/slice/types.ts","app/pages/OtherServiceDetails/Details/slice/saga.ts","app/pages/OtherServiceDetails/Details/slice/index.ts","app/pages/Samples/SamplesListPage/slice/index.ts","app/components/BasicTable/withSavedHistory.tsx","app/components/BasicInputs/BaseTextField/index.tsx","app/components/DropDown/index.tsx","app/components/BasicTable/CellRenderers/DateRenderer/index.tsx","enums/Article.ts","app/components/Forms/FormConnectedFilters/slice/selectors.ts","app/components/pickers/MultiSelectPickers/OnlineServicesPicker/index.tsx","enums/commentReferenceTypes.ts","app/components/Forms/FormLabelText.tsx","enums/TrainingState.ts","api/OtherServicesApi.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/selectors.ts","app/components/BasicInputs/TextControlField/index.tsx","app/components/Forms/FormNumberField.tsx","app/components/PopupImportExport/Actions/Types.ts","api/odata/generated/enums/PurchaseOrderOptions.ts","app/components/BasicTable/Filters/AssetRangeFilter/index.tsx","app/components/BasicTable/types/ColumnWithDeps.ts","app/components/BasicTable/Comparers/index.ts","app/components/BasicTable/index.tsx","app/hooks/useIsMobile.ts","api/ReservationsApi.ts","app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes.ts","app/components/ReactActions/useStyles.tsx","app/components/ReactActions/StyledMenuItem.tsx","app/components/ReactActions/HoverActions.tsx","app/components/ReactActions/ClickableActions.tsx","app/components/ReactActions/index.tsx","app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton/index.tsx","utils/messages.ts","app/components/BasicTable/BasicFilter/AppliedFilterComponent.tsx","app/pages/Samples/EditableTable/EditableCell/index.tsx","app/components/BasicTable/Filters/BooleanPickerFilter/index.tsx","app/components/BasicButtons/ActionButton/index.tsx","app/hooks/useAsyncGetOnMount.ts","app/permissions/WorkOrders/allowedroles.tsx","app/permissions/WorkOrders/workOrdersPermissionUtils.ts","app/components/pickers/AutocompletePickers/BudgetPicker/index.tsx","app/components/BasicTable/components/BooleanRender/index.tsx","app/components/Forms/FormBookitDatePicker/index.tsx","app/pages/ReservationDetails/Details/components/useGlobalSettingsHook.ts","app/components/pickers/AutocompletePickers/OfflineServiceTypePicker/index.tsx","app/components/BasicTable/Filters/DatesRangeFilter/index.tsx","app/components/BasicTable/RowActions.tsx","app/pages/ArticlesPage/slice/selectors.ts","app/pages/ReservationDetails/Details/components/utils.ts","app/components/DatePicker/utils/pickerDateValidate.tsx","app/components/DateTimeLabel/index.tsx","app/components/BasicInputs/Check/styles.ts","app/components/BasicInputs/Check/index.tsx","enums/enums.ts","enums/DraftReservationTypes.ts","api/odata/generated/enums/AllowReservationCollaboratorsTypes.ts","app/pages/ReservationDetails/Details/slice/mapSettingsFromServices.ts","app/pages/ReservationDetails/Details/slice/ConvertModelToUpdateEntity.ts","app/pages/ReservationDetails/Details/slice/ConvertModelToInsertEntity.ts","app/pages/ReservationDetails/Details/slice/saga.ts","app/pages/ReservationDetails/Details/slice/TryDisableRemoveableEquipments.ts","app/pages/ReservationDetails/Details/slice/ConvertDtoToModel.ts","app/pages/ReservationDetails/Details/slice/getReservationSettings.ts","app/pages/ReservationDetails/Details/slice/index.ts","app/components/BasicInputs/GhostInput/index.tsx","enums/BudgetFields.ts","app/components/BasicChip/index.tsx","app/components/LargeFilesUpload/slice/saga.ts","app/components/LargeFilesUpload/slice/index.ts","api/CommentsApi.ts","app/components/Forms/FormConnectedFilters/slice/types.ts","app/components/Forms/FormConnectedFilters/slice/saga.ts","app/components/Forms/FormConnectedFilters/slice/index.ts","styles/constantVariables.ts","app/components/pickers/AutocompletePickers/ExtraddlPicker/index.tsx","app/components/BasicPickers/AutocompleteMultiPicker/index.tsx","app/components/BasicPickers/BaseURLPicker/index.tsx","app/pages/SavedViewsPage/SavedViewPage/slice/types.ts","app/pages/SavedViewsPage/SavedViewPage/slice/saga.ts","app/pages/SavedViewsPage/SavedViewPage/slice/index.ts","api/WorkOrderApi.ts","enums/EmptySlotAdminClick.ts","app/components/BasicTable/useProfileSetting/index.ts","app/components/LargeFilesUpload/Components/useUploadToNewComment.ts","app/components/Forms/Switch.tsx","app/pages/SavedViewsPage/SavedViewPage/slice/selectors.ts","app/components/Forms/FormBookitDateTimePicker/index.tsx","app/components/BasicTable/Filters/ExtraDDLFilter/index.tsx","app/components/BasicPickers/AutocompleteMultiPickerEx/index.tsx","app/pages/Samples/RequestSamplesPage/slice/path.ts","app/components/AssetThumbImage/getAssetImageSrc.tsx","app/components/BasicTable/useProfileSetting/parseProfileUrl.ts","enums/WorkingHoursTypes.ts","app/pages/CalendarPage/Scheduler/slice/saga.ts","app/pages/CalendarPage/Scheduler/slice/index.ts","app/components/BasicTable/UnconfigurableTable/FilterHandler.tsx","app/components/Forms/FormUserPicker.tsx","app/components/BasicAlert/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/saga.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/index.ts","app/pages/Samples/EditableTable/Fields/TextField/index.tsx","app/components/Messages/slice/type.ts","app/pages/AssetPopUp/IAsset.tsx","app/components/BasicTable/components/UserProfileLink/index.tsx","app/components/PopupImportExport/Actions/index.ts","app/components/PopupImportExport/Actions/Api.ts","app/pages/Samples/SamplesListPage/slice/selectors.ts","app/components/BasicTable/Filters/index.tsx","app/components/TextField/index.tsx","app/components/Forms/FormCheckbox.tsx","app/components/BasicTable/BasicFilter/AddFilterButton.tsx","app/components/BasicTable/BasicFilter/AppliedFiltersContainer/index.tsx","app/components/BasicTable/BasicFilter/index.tsx","app/components/Forms/FormControls/FormControl/index.tsx","app/components/BookitDatePicker/DateInput.tsx","app/components/DatePicker/utils/toEndDateDisplayValue.tsx","app/components/DatePicker/utils/truncateTime.tsx","utils/DateFormattingUtils/longFormatters.ts","utils/DateFormattingUtils/getFormatTokens.ts","app/components/BookitDatePicker/utils/types.ts","app/components/BookitDatePicker/StyledPicker.tsx","app/components/pickers/StaticOptionsPickers/DaysByMonthPicker/index.tsx","app/components/pickers/StaticOptionsPickers/MonthOfYearPicker/index.tsx","app/components/pickers/StaticOptionsPickers/YearsPicker/index.tsx","app/components/BookitDatePicker/DateDropDown/index.tsx","app/components/pickers/StaticOptionsPickers/HoursPicker/index.tsx","app/components/pickers/StaticOptionsPickers/MinutesPicker/index.tsx","app/components/pickers/StaticOptionsPickers/AmPmPicker/index.tsx","app/components/BookitDatePicker/TimeDropDown/index.tsx","app/hooks/useIsomorphicLayoutEffect.ts","app/hooks/useEventListener.ts","app/components/BookitDatePicker/utils/useDateTimeChange.ts","app/components/BookitDatePicker/KeyboardRifmInput/index.tsx","app/components/BookitDatePicker/KeyboardInput.tsx","app/components/BookitDatePicker/TimeOptionPicker/index.tsx","app/components/BookitDatePicker/index.tsx","app/hooks/useKeyUpOutside.ts","utils/logLevel.ts","types/DatesRange.ts","app/hooks/useExpandedSideBarState.ts","types/SiteMapSettings.ts","types/IRepetitiveDto.ts","styles/shadows/bookitShadow.ts","api/savedViewsApi.ts","app/components/pickers/AutocompletePickers/WorkOrderTypePicker/index.tsx","app/components/pickers/AutocompletePickers/InventoryBatchesPicker/index.tsx","app/pages/CalendarPage/Scheduler/utils/parseType.tsx","api/odata/generated/enums/TimelineGroupBy.ts","app/pages/CalendarPage/parseCalendarPageParams.tsx","app/components/BasicTable/CellRenderers/AlignRight.tsx","enums/CustomFormType.ts","app/components/pickers/AutocompletePickers/UserGroupPicker/index.tsx","app/components/BasicTable/Filters/UserFilter/index.tsx","app/components/BasicTable/components/DescriptionCell/index.tsx","app/pages/CalendarPage/GetCalendarPagePath.tsx","app/pages/Samples/EditableTable/Fields/NumberField/index.tsx","app/pages/ServiceRequestsKanbanPage/slice/selectors.ts","app/components/pickers/ServiceGroupPicker/index.tsx","app/components/Forms/FormServiceGroupPicker.tsx","app/components/Forms/FormControls/FormControlLabel/index.tsx","app/components/Forms/FormControls/FormHelperText/index.tsx","utils/number-utils.ts","app/pages/ArticlesPage/slice/saga.ts","app/pages/ArticlesPage/slice/index.ts","app/components/PrintToPDF/slice/saga.ts","app/components/PrintToPDF/slice/index.ts","app/pages/ServiceRequestsKanbanPage/slice/saga.ts","app/pages/ServiceRequestsKanbanPage/slice/index.ts","app/permissions/Asset/assetPermissions.ts","app/components/BasicTable/Hooks/aggregations.js","app/components/BasicTable/Hooks/utils.js","app/components/BasicTable/Hooks/useSummary.js","app/components/BasicTable/components/TableCard/index.tsx","app/components/BasicTable/components/TabsToolbar/index.tsx","app/components/BasicTable/components/FloatingActions.tsx","app/components/BasicTable/components/CustomTableToolbar/index.tsx","app/components/BasicTable/ControlledTable/RenderRow.tsx","app/components/BasicTable/components/CustomEmptyTable/index.tsx","app/components/BasicTable/ControlledTable/TableCell.tsx","app/components/BasicTable/ControlledTable/RenderGroupedRow.tsx","app/components/BasicTable/ImportButton/index.tsx","app/components/BasicTable/ControlledTable/index.tsx","app/components/BasicTable/components/TableSkeleton/index.tsx","app/components/BasicInputs/Toggle/index.tsx","app/components/BasicToggle/index.tsx","app/components/basic/Wrappers/FlexWrappers/flexRow.tsx","app/components/PrintToPDF/slice/selectors.ts","app/components/Comments/index.tsx","app/components/CalendarButton/index.tsx","app/components/Forms/FormFundingTypePicker.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/isMember.tsx","app/components/BasicInputs/Select/index.tsx","app/components/BasicTable/BasicFilter/SavedListsDropDown/index.tsx","app/components/BasicPickers/EnumPicker/index.tsx","types/IConnectedFiltersDto.ts","app/components/PrintToPDF/PrintPDFSection.tsx","app/components/BasicTable/Filters/NumberFieldFilter/index.tsx","app/components/pickers/AutocompletePickers/BuildingPicker/index.tsx","app/components/pickers/AutocompletePickers/CampusPicker/index.tsx","app/components/pickers/AutocompletePickers/RoomPicker/index.tsx","app/components/BasicTable/BasicFilter/TableToolbar/TableToolbarHeader.tsx","app/components/BasicTable/BasicFilter/TableToolbar/index.tsx","app/components/pickers/AutocompletePickers/AssetPicker/index.tsx","app/components/BasicTable/UnconfigurableTable/UnconfigurableTable.tsx","app/Layout/FrontendLayout/components/TopBar/styled/index.tsx","app/components/Forms/FormsLayout/wrappers/index.tsx","app/components/Forms/FormsLayout/FormSectionTitle.tsx","app/slice/globalDbSettingsSelectors.ts","app/components/Forms/FormAssetsPicker.tsx","app/components/pickers/AutocompletePickers/ResrevationStatusMultiPicker/index.tsx","app/components/BasicTable/Filters/ResrvationStatusMultiFilter/index.tsx","app/components/BasicTable/Filters/UpcomingReservationfilter/index.tsx","app/components/BasicTable/Filters/WorkflowBookingFilter/index.tsx","app/components/pickers/AutocompletePickers/ReservationByIdWithPartsPicker/index.tsx","app/components/BasicTable/Filters/ReservationByIdWithPartsFilter/index.tsx","app/components/BasicTable/BasicFilter/FilterDisplay/InstrumentsFilterDisplay/index.tsx","app/pages/ReservationHistoryPage/Filter.tsx","app/components/Forms/FormRepetitive/slice/saga.ts","app/components/Forms/FormRepetitive/slice/index.ts","enums/ServiceGroupRegistrationStatus.ts","app/components/BasicTable/ConfigurableColumns.ts","enums/RemindBefore.ts","app/components/pickers/AutocompletePickers/UserMultiPicker/index.tsx","app/components/BasicTable/BasicFilter/utils.ts","app/components/Forms/FormEquipmentsPicker.tsx","api/odata/generated/entities/IAssetDto.ts","app/components/Forms/FormBudgetPicker.tsx","api/odata/generated/enums/ServiceRequestMilestoneStatuses.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types.ts","api/odata/ODataParamsBuilder.ts","app/components/BasicList/StyledList/index.tsx","styles/colors/info.ts","styles/MUIExtend/themeOverrides.ts","styles/theme.tsx","app/components/BasicTable/Filters/BuildingPickerFilter/index.tsx","api/utils.ts","app/components/pickers/AutocompletePickers/LocationPicker/index.tsx","app/components/pickers/MultiSelectPickers/ServiceGroupsPicker/index.tsx","app/hooks/useGlobalServiceGroupsFilter.ts","app/components/BasicTable/CellRenderers/AssetRenderer/index.tsx","app/components/ButtonConfirm/index.tsx","app/pages/InvoiceDetails/InvoiceDetailsSidePanel/index.tsx","app/components/Forms/ValidationSchemaProvider.tsx","app/pages/Samples/components/RunTypePicker/index.tsx","app/components/BasicTable/CellRenderers/BooleanRenderer/index.tsx","enums/OnlineServiceTypeEnum.ts","app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker/index.tsx","app/components/pickers/AutocompletePickers/RegionPicker/index.tsx","app/hooks/useResponseModel.ts","app/pages/AssetPopUp/AttributeRenderers/index.tsx","app/pages/AssetPopUp/IAssetRow.tsx","app/pages/AssetPopUp/AssetLocationLastUpdate.tsx","app/components/BasicTable/components/DoubleRenderer/index.tsx","app/pages/AssetPopUp/components/AssetComments.tsx","app/pages/AssetPopUp/getAssetEditLink.ts","app/pages/AssetPopUp/Rows.tsx","app/pages/AssetPopUp/components/Utils.ts","app/pages/AssetPopUp/components/TopAssetActionsDropDown.tsx","app/pages/AssetPopUp/CreateAnAssetRelatedEvent.tsx","app/pages/AssetPopUp/components/AssetDetailsFiles.tsx","app/pages/AssetPopUp/components/RenderAssetRows.tsx","app/pages/AssetPopUp/components/MismatchCoreMessage.tsx","app/pages/AssetPopUp/components/AssetDetailsTabContent.tsx","app/pages/AssetPopUp/components/AssetBookingRules.tsx","app/pages/AssetPopUp/components/TableFilters.tsx","app/pages/AssetPopUp/components/GetTableCount.ts","app/pages/AssetPopUp/components/AssetTrainingSessions.tsx","app/pages/AssetPopUp/components/AssetArcticlesTable.tsx","app/pages/AssetPopUp/components/AssetWorkOrders.tsx","app/pages/AssetPopUp/components/BadgeCounter.tsx","app/pages/AssetPopUp/components/AssetMobileDropDownTabs/index.tsx","app/pages/AssetPopUp/components/AssetDetailsTabs.tsx","app/pages/AssetPopUp/components/types.ts","app/pages/AssetPopUp/index.tsx","app/components/BasicLinks/Link/index.tsx","app/components/BasicButtons/ActionIconButton/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/PageActions/SwitchActions.tsx","app/pages/Actions/GlobalSelectedActions/OpenWorkOrder.tsx","app/components/CommentsContainer/styles.ts","app/components/CommentsContainer/FileButton.tsx","app/components/LargeFilesUpload/slice/selectoes.ts","app/components/LargeFilesUpload/Upload/index.ts","app/components/LargeFilesUpload/Upload/Api.ts","app/components/LargeFilesUpload/Components/FileCard.tsx","app/components/LargeFilesUpload/Components/SelectFile.tsx","app/components/LargeFilesUpload/index.tsx","app/components/CommentsContainer/index.tsx","app/pages/OtherServiceDetails/Details/components/AddService.tsx","app/pages/OtherServiceDetails/Details/components/InventoryBatchChip.tsx","app/pages/OtherServiceDetails/Details/components/QuickServiceItem.tsx","app/pages/Actions/PageTopActions/AddConsumable/index.tsx","app/pages/OtherServiceDetails/Details/components/AddServiceFromSelection.tsx","app/pages/OtherServiceDetails/Details/components/BookQuickServices.tsx","enums/ReservationOrDowntimeEnum.ts","app/components/BookitDatePicker/BookitDateTimePicker.tsx","app/pages/AssetsInventory/Details/slice/selectors.ts","enums/MultipleInstrumentReservations.ts","app/pages/CalendarPage/Scheduler/slice/types.ts","app/components/BasicTable/Filters/ServiceMultiFilter/index.tsx","app/pages/NotFoundPage/P.ts","app/pages/NotFoundPage/index.tsx","styles/MUIExtend/autocompleteStyles.ts","app/components/BasicTable/initFilterData.ts","enums/InvoiceStatuses.ts","app/components/Forms/FormRepetitive/slice/types.ts","app/components/pickers/DatePeriodsPicker/index.tsx","app/components/pickers/AutocompletePickers/UnitTypePicker/index.tsx","app/components/AssetThumbImage/index.tsx","app/components/Forms/FormAutocompleteOptions.tsx","app/components/Forms/FormAutocompleteMultiOptions.tsx","api/ExternalApi.ts","app/components/CustomForm/CustomFormFields/CustomFormDropDown.tsx","styles/colors/types.ts","app/pages/CalendarPage/Scheduler/utils/formatSchedulerDateOrUndefined.tsx","api/odata/generated/enums/FileTypes.ts","utils/fileStoreHelper.ts","api/odata/generated/enums/Roles.ts","app/pages/Samples/RequestSamplesPage/slice/prepareServiceRequestRowModel.ts","app/pages/LocationsPage/Details/index.tsx","enums/CatRateTypes.ts","app/components/Forms/Schemas/InvoiceChildRowBaseSchema/index.ts","enums/allowCreateInvoicesBy.ts","app/pages/AddPaymentPage/index.tsx","app/pages/AddPaymentPage/PaymentSchema.ts","api/ChargeApi.ts","app/components/Forms/FormCatRateTypePicker.tsx","app/components/pickers/AutocompletePickers/OfflineServicePicker/index.tsx","app/components/Forms/FormOfflineServicePicker.tsx","app/components/Forms/FormSampleTypePicker.tsx","app/components/Forms/FormServiceUserGroupPicker.tsx","app/pages/AddChargePage/index.tsx","app/pages/AddChargePage/ChargeSchema.ts","app/pages/LabelTypesPage/LabelTypeEdit/Loadable.ts","app/pages/ArticlesPage/Hooks/useAllowedToChangeStatus.tsx","app/pages/ArticlesPage/ArticleDetails/index.tsx","app/components/Forms/FormAssetPicker.tsx","app/pages/ArticlesPage/utils.ts","app/components/Forms/FormCustomPicker.tsx","app/pages/ArticlesPage/ArticlePickers/index.tsx","app/pages/ArticlesPage/ArticleFormPickers/index.tsx","app/pages/ArticlesPage/NewArticleDetailsForm/index.tsx","app/pages/ArticlesPage/ArticleComments.tsx","app/pages/ArticlesPage/EditArticleDetailsForm/index.tsx","app/pages/UserAttributes/UserAttributesDetailsPage/Details/Actions/UserAttributesActions.tsx","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/types.ts","api/UserAttributesApi.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/saga.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/index.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/selectors.ts","app/pages/UserAttributes/UserAttributesDetailsPage/Details/UserAttributesForm/index.tsx","app/pages/UserAttributes/UserAttributesDetailsPage/Details/index.tsx","api/odata/generated/enums/Priorities.ts","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema.ts","app/components/pickers/StaticOptionsPickers/PriorityPicker/index.tsx","app/components/Forms/FormPriorityPicker.tsx","app/components/Forms/FormServiceRequestStatusPicker.tsx","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/components/Form/index.tsx","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/components/AddSubTicket/index.tsx","app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/index.tsx","app/pages/OtherServiceDetails/StockRenewal/StockRenewalForm.tsx","app/pages/OtherServiceDetails/StockRenewal/index.tsx","app/pages/OtherServiceDetails/RenewStock/RenewStockForm.tsx","app/pages/OtherServiceDetails/RenewStock/index.tsx","app/pages/OtherServiceDetails/InventoryBatch/InventoryBatchForm.tsx","app/pages/OtherServiceDetails/InventoryBatch/index.tsx","app/pages/ArticlesPage/ArticleAssociationForm/index.tsx","app/Layout/FrontendLayout/components/SidePanel/SidePanelRenderer.tsx","app/components/pickers/AutocompletePickers/AssetCatGroupPicker/index.tsx","app/components/pickers/AutocompletePickers/InstitutePicker/index.tsx","app/components/pickers/AutocompletePickers/AssetCatPicker/index.tsx","app/components/pickers/AutocompletePickers/DepartmentPicker/index.tsx","app/components/BasicTable/Filters/RoomPickerFilter/index.tsx","app/components/pickers/AutocompletePickers/InstituteTypePicker/index.tsx","app/components/Description/index.tsx","app/components/BasicCards/index.tsx","app/components/BasicTable/TableFilterBuilder/index.ts","app/pages/Animals/InternalIdLoginPage/slice/saga.ts","app/pages/Animals/InternalIdLoginPage/slice/index.ts","app/components/Forms/FormUsersPicker.tsx","app/components/pickers/AutocompletePickers/SubLocationListPicker/index.tsx","app/components/ReservationEditButton/index.tsx","app/components/BasicPickers/BaseOptionsMultiPicker/index.tsx","app/slice/router-selectors.ts","enums/BudgetExperimentStatuses.ts","app/components/pickers/AutocompletePickers/SuperGroupPicker/index.tsx","app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils.ts","app/pages/Actions/GlobalSelectedActions/AddWorkOrder.tsx","app/components/BasicTable/Filters/RegionFilter/index.tsx","app/components/pickers/AutocompletePickers/MyAssetAvailabilityTypeMultiPicker/index.tsx","app/components/BasicButtons/FilterIconButton/index.tsx","app/components/ReservationCreateButton/index.tsx","app/pages/Actions/GlobalSelectedActions/OpenReservation.tsx","app/pages/CalendarPage/SchedulerWithFiltersProps.tsx","app/pages/CalendarPage/getDefaultFilter.tsx","app/pages/CalendarPage/getRequiredFilter.tsx","app/pages/CalendarPage/CalendarPageDefaultRedir.tsx","app/pages/CalendarPage/index.tsx","app/components/BooleanPicker/index.tsx","app/components/DialogAlert/slice/index.ts","app/components/ErrorBoundary/index.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/TitlePage.tsx","app/components/CommentsContainer/commentParser.tsx","app/pages/ReservationDetails/Details/slice/combineOfflineServiceTypes.ts","app/pages/ReservationDetails/Details/slice/getBudgetVisible.ts","app/components/pickers/AutocompletePickers/TrainingSessionPicker/index.tsx","app/components/pickers/StaticOptionsPickers/RemindBeforePicker/index.tsx","app/components/pickers/AutocompletePickers/WorkflowBookingPicker/index.tsx","enums/GlobalEnums.ts","app/components/BasicTable/styles.ts","app/components/BasicTable/useMemoFilters.ts","app/components/ValueLabel/index.tsx","app/components/BasicTabs/TabPanel/index.tsx","app/components/Forms/FormAutocomplete.tsx","app/components/Forms/FormAutocompleteMulti.tsx","app/components/CustomForm/CustomFormFields/CustomFormUserSelection.tsx","app/components/Forms/FormRepetitive/slice/selectors.ts","app/components/pickers/AutocompletePickers/SampleTypePicker.index.tsx","app/components/Forms/FormOfflineServiceTypePicker.tsx","app/pages/Regions/RegionLink.tsx","app/components/Forms/FromRadioGroup.tsx","app/components/CustomForm/CustomFormFields/CustomFormAnswerQuestions.tsx","app/components/CustomForm/CustomFormFields/CustomFormCheckBox.tsx","app/components/CustomForm/CustomFormFields/CustomFormDate.tsx","app/components/CustomForm/CustomFormFields/CustomFormDisclimer.tsx","app/components/CustomForm/CustomFormFields/CustomFormEmail.tsx","app/components/CustomForm/CustomFormFields/CustomFormNumberText.tsx","app/components/CustomForm/CustomFormFields/CustomFormParagraph.tsx","app/components/CustomForm/CustomFormFields/CustomFormPositiveNumber.tsx","app/components/CustomForm/CustomFormFields/CustomFormRadioGroup.tsx","app/components/CustomForm/CustomFormFields/CustomFormRichText.tsx","app/components/CustomForm/CustomFormFields/CustomFormShortText.tsx","app/components/CustomForm/CustomFormFields.tsx","app/components/BookitlabLogo/messages.ts","app/pages/CalendarPage/Scheduler/utils/syncSchedulerEvents.tsx","api/fileStoreApi.ts","app/hooks/usePrevious.tsx","api/odata/generated/entities/IUserFilterDto.ts","api/odata/generated/enums/SamplePlatePositionNamingTypes.ts","api/CustomFormApi.ts","app/components/CustomForm/CustomFormContent/index.tsx","app/components/CustomForm/CusomFormControl/Form/index.tsx","app/components/CustomForm/CusomFormControl/index.tsx","app/components/pickers/AutocompletePickers/ServiceRequestStatusMultiPicker/index.tsx","app/components/RadioGroup/index.tsx","api/BillingActionsApi.ts","app/permissions/Reservations/reservationPermissions.ts","app/pages/OnlineBudgetsStatusPage/slice/types.ts","app/components/DateLabel.tsx/index.tsx","api/PaymentApi.ts","app/components/Forms/FormsLayout/FormRow/index.tsx","app/pages/Samples/SamplePlatesPage/slice/selectors.ts","app/components/BasicTable/BasicFilter/FilterBox/index.tsx","app/components/DownloadFileButton/index.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/Actions/TrainingActions.tsx","app/components/Forms/FormInputFile.tsx","app/components/Forms/Schemas/SchemaMethods.ts","app/components/pickers/AutocompletePickers/WorkOrdersPicker/index.tsx","app/components/Forms/FormRestrictedUserGroupPicker.tsx","app/pages/ServiceRequestsKanbanPage/Filter.ts","app/pages/Samples/EditableTable/TablePaginationActions.tsx","app/pages/Samples/EditableTable/index.tsx","app/components/pickers/AutocompletePickers/SamplePlatePositionsPicker/index.tsx","app/components/Forms/FormGradientPicker.tsx","app/pages/Samples/components/CreateSampleRunReservation/index.tsx","app/pages/Samples/RunDetailsPage/ImportComponents/PopupImport.tsx","app/pages/Samples/RunDetailsPage/ImportButton.tsx","app/pages/Samples/RunDetailsPage/Actions/index.ts","app/pages/Samples/RunDetailsPage/SelectedRowActions/GetSelectaedRowActions.tsx","app/pages/Samples/RunDetailsPage/AnalyticalSampleIDSuffix.tsx","app/pages/Samples/RunDetailsPage/CellPositionToNumber.tsx","app/pages/Samples/RunDetailsPage/index.tsx","api/EmailNotificationsApi.ts","app/pages/EmailNotificationsPage/index.tsx","app/pages/EmailNotificationsPage/SelectedRowActions/GetSelectedRowActions.tsx","app/components/BasicInputs/BaseInputs/StandardInput/styles.ts","app/components/BasicInputs/BaseInputs/StandardInput/index.tsx","app/components/BasicTable/withGlobalServiceGroupFilter.tsx","app/components/BasicTable/Filters/UserGroupFIlter/index.tsx","app/components/Admin/AdminActions/index.tsx","app/components/BasicLinks/ButtonLink/index.tsx","app/components/BasicTable/Filters/AssetCatGroupFilter/index.tsx","app/components/BasicTable/Filters/InstituteFilter/index.tsx","types/ResponseType.ts","app/components/BasicTable/Filters/AssetCatFilter/index.tsx","app/components/BasicTable/Filters/ServiceGroupFilter/index.tsx","app/components/BasicTable/Filters/DepartmentFilter/index.tsx","app/components/pickers/AutocompletePickers/ProjectPicker/index.tsx","app/components/BasicTable/Filters/ProjectFilter/index.tsx","app/components/pickers/AutocompletePickers/UserDisciplinePicker/index.tsx","app/components/pickers/AutocompletePickers/ServiceTypePicker/index.tsx","app/components/BookitlabLogo/index.tsx","app/components/BasicTable/Filters/InstituteTypeFilter/index.tsx","app/components/pickers/AutocompletePickers/InvoiceIdMultiPicker/index.tsx","app/components/LabelPrint/Printers/getQrUrl.ts","app/components/LabelPrint/Printers/Dymo.ts","app/components/LabelPrint/Printers/Zebra.ts","app/components/LabelPrint/Printers/index.ts","app/components/LabelPrint/slice/saga.ts","app/components/LabelPrint/slice/index.ts","app/components/pickers/AutocompletePickers/TrainingLevelPicker/index.tsx","app/components/pickers/AutocompletePickers/AssetMultiPicker/index.tsx","app/components/BasicTable/Filters/AssetMultiFilter/index.tsx","app/components/BasicTable/Filters/LocationPickerFilter/index.tsx","app/Layout/FrontendLayout/components/CustomerLogo/index.tsx","app/components/BasicTable/Filters/CampusPickerFilter/index.tsx","app/components/QrCodeExport/index.tsx","app/components/pickers/AutocompletePickers/AreassPicker/index.tsx","api/odata/generated/enums/EmailType.ts","app/components/BasicDialog/BasicDialogTitle.tsx","app/components/BasicButtons/BaseToggleButton/index.tsx","app/components/BasicButtons/BaseToggleButtonGroup/index.tsx","app/components/BasicTable/FilterContainer/index.tsx","app/pages/Actions/PageTopActions/AddReservation/index.tsx","app/components/BasicTable/Filters/ServiceGroupsFilter/index.tsx","app/components/BasicTable/Filters/SuperGroupFilter/index.tsx","app/components/pickers/AutocompletePickers/TagsPicker/index.tsx","app/components/pickers/AutocompletePickers/LoanablePicker/index.tsx","app/components/pickers/AutocompletePickers/StatusPicker/index.tsx","app/components/pickers/AutocompletePickers/LockersPicker/index.tsx","app/components/BasicTable/Filters/SubLocationListFilter/index.tsx","app/components/PrintToPDF/Components/PrintStyles.ts","app/components/PrintToPDF/index.tsx","enums/InstrumentListAssemblyTypes.ts","app/components/pickers/StaticOptionsPickers/AssemblyTypePicker/index.tsx","app/components/Forms/FormsLayout/StyledFormFieldsContainer/index.tsx","app/components/BasicTable/getFilterValue.tsx","app/Layout/FrontendLayout/components/PageWrapper/components/SkeletonIfLoading.tsx","app/components/Forms/FormControls/FormGroup/index.tsx","app/components/BasicTable/BasicFilter/FiltersButton/index.tsx","app/components/BasicTable/Filters/ProjectFilter/getBudgetsFilterSettings.tsx","app/components/pickers/AutocompletePickers/AvailabilityTypePicker/index.tsx","app/components/BasicTable/GlobalFilter.tsx","app/pages/WorkOrdersPage/Actions/NewWorkOrder/index.tsx","app/pages/Actions/GlobalSelectedActions/BringBackUp.tsx","app/pages/Actions/GlobalSelectedActions/DownWorkOrder.tsx","app/pages/Actions/GlobalSelectedActions/OpenCalendar.tsx","app/pages/Actions/GlobalSelectedActions/OpenWrokOrders.tsx","app/components/BasicTable/useConfigurableColumnsAdvanced.ts","app/components/Popover/index.tsx","app/components/BasicDialog/BasicDialogContentWithTitle.tsx","app/components/BasicDialog/index.tsx","app/components/BasicCheckBox/index.tsx","app/components/BasicTable/components/TableCardGrid/index.tsx","app/components/BasicTable/BasicFilter/TableToolbar/styled/index.tsx","api/odata/getPredicates.ts","app/components/BasicLinks/RouterLink/index.tsx","app/pages/ArticlesPage/ArticleDoiLink/index.tsx","app/components/pickers/StaticOptionsPickers/PaymentMethodEnumPicker/index.tsx","app/components/pickers/AutocompletePickers/SamplePlatePicker/index.tsx","app/components/pickers/AutocompletePickers/SamplePlatePositionPicker/index.tsx","app/pages/Samples/SamplesListPage/ImportButton.tsx","app/components/pickers/StaticOptionsPickers/PriceSheetMethodPicker/index.tsx","api/ServiceRequestsApi.ts","app/pages/MyAssetsPage/DefaultFilter.tsx","app/components/BasicTable/CellRenderers/DecimalRenderer/index.tsx","app/components/pickers/StaticOptionsPickers/ServiceTypeEnumPicker/index.tsx","app/pages/Samples/EditableTable/Fields/DateField/index.tsx","app/components/pickers/AutocompletePickers/ServiceRequestStatusPicker/index.tsx","app/components/DialogForm/index.tsx","app/pages/AddChargePage/AddChargeButton.tsx","app/components/BasicTable/withoutGlobalServiceGroupFilter.tsx","app/components/pickers/MultiSelectPickers/EquipmentReservationPicker/index.tsx","app/components/Forms/FormReservationEquipmentsPicker.tsx","app/components/Forms/FormReservationStatusPicker.tsx","app/pages/ReservationDetails/Details/components/ReservationCustomForm.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/BudgetListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/UserNameListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/UserGroupListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/StartTimeListener.tsx","app/pages/ReservationDetails/Details/components/FormFieldListeners/EndTimeListener.tsx","app/components/BasicChip/ChipChekBoxGroup.tsx","app/components/BasicChip/ChipLabelGroup.tsx","app/components/Forms/FormChipsGroup.tsx","app/pages/ReservationDetails/Details/components/ReservationOfflineServices.tsx","app/components/pickers/MultiSelectPickers/AccompaniedServicesPicker/index.tsx","app/components/Forms/FormAccompaniedServicesPicker.tsx","app/pages/ReservationDetails/Details/components/ReservationActions.tsx","app/pages/ReservationDetails/Details/components/TerminateReservation.tsx","app/components/Forms/FormTrainingSessionPicker.tsx","app/components/pickers/AutocompletePickers/ReservationBudgetExperimentPicker/index.tsx","app/components/Forms/ReservationBudgetExperimentPicker.tsx","app/pages/ReservationDetails/Details/ReservationForm/getReservationsLink.tsx","app/pages/TrainingSessionsPage/components/EditTrainingSessionsLink/index.tsx","app/pages/ReservationDetails/Details/components/TrainingSignUpAdminAlertContent/index.tsx","app/pages/ReservationDetails/Details/components/ReservationTimePicker/index.tsx","app/pages/ReservationDetails/Details/components/EquipmentsDataAssemblies/index.tsx","app/pages/ReservationDetails/Details/components/ReservationWorkOrders/index.tsx","app/components/Forms/FormWorkFlowBooking/index.tsx","app/pages/ReservationDetails/Details/components/ReadOnlyDetails/index.tsx","app/pages/ReservationDetails/Details/components/RequestDetails/index.tsx","app/pages/ReservationDetails/Details/ReservationForm/index.tsx","app/pages/ReservationDetails/Details/ReservationForm/handlers.tsx","app/pages/ReservationDetails/Details/ReservationForm/getReservationCollaboratorsFilter.tsx","app/pages/ReservationDetails/Details/components/ApproveTrainingRecords.tsx","app/pages/ReservationDetails/Details/components/TransferReservation.tsx","app/pages/ReservationDetails/Details/components/Modifications/index.tsx","app/pages/ReservationDetails/Details/components/Modifications/Columns.tsx","app/pages/ReservationDetails/Details/components/Modifications/Filter.tsx","app/pages/ReservationDetails/Details/components/CalculatePricing/index.tsx","app/pages/ReservationDetails/Details/index.tsx","enums/MinTimeAheadPeriodTypes.ts","api/RestrictionsApi.ts","enums/TrainingStatus.ts","app/pages/InstrumentRestrictionsPage/Details/components/UserOwnPermissions.tsx","api/UserPermissionsApi.ts","app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions.tsx","app/components/Copyright/messages.ts","app/components/Copyright/styled/index.tsx","app/components/Copyright/index.tsx","app/components/Messages/slice/selector.ts","app/pages/ReservationDetails/Details/useOpenReservationSidePanel.tsx","app/components/Messages/index.tsx","api/BarcodeScanApi.ts","app/pages/AssetsInventory/Details/slice/saga.ts","app/pages/AssetsInventory/Details/slice/index.ts","app/components/Messages/slice/saga.ts","app/components/Messages/slice/index.ts","app/components/EndUsageConfirm/EndUsageOfflineServices/index.tsx","app/components/EndUsageConfirm/index.tsx","app/components/BasicDialog/BasicDialogActions.tsx","app/components/Popper/index.tsx","app/components/Popper/PopperTitle.tsx","app/components/RichTextEditor/index.tsx","app/components/Forms/FormAdminUserPicker.tsx","app/components/BasicTable/Filters/DatesPeriodFilter/index.tsx","enums/WorkWeekDays.ts","app/pages/CalendarPage/Scheduler/utils/parseLength.tsx","app/pages/CalendarPage/Scheduler/utils/applyForceFullDayReservations.tsx","app/pages/CalendarPage/Scheduler/utils/adjustSchedulerEventTimes.tsx","app/hooks/useGlobalDomEvents.ts","app/components/BasicTable/BasicFilter/FiltersGroupDisplay/index.tsx","app/components/BasicTable/BasicFilter/FilterDisplay/index.tsx","app/components/LabelPrint/PrintSelectedAssetLabelsButton/index.tsx","app/components/BasicTable/useConfigurableColumns.ts","app/components/BasicTable/TablePaginationActions.tsx","app/components/BasicTable/ExportButton/index.tsx","app/components/BasicTable/SelectedActions/index.tsx","app/components/BasicTable/components/ConfigureColumnsButton.tsx","app/hooks/useLocationChange.ts","app/components/BasicTabs/TabsWrapper.tsx","app/components/CustomForm/CustomFormFields/CustomFormFileUpload.tsx","app/components/Forms/FormRepetitive/RepetitiveControl.tsx","app/components/CommentsContainer/IComment.ts","api/SamplesApi.ts","app/pages/Samples/RunDetailsPage/ImportComponents/ImportComponent.tsx","utils/redux-saga/index.ts","api/InvoiceTemplatesApi.ts","app/components/Forms/FormInventoryBatchPicker.tsx","enums/ReferenceType.ts","app/components/BasicDialog/BasicDialogContent.tsx","app/pages/ServiceRequestsKanbanPage/components/getServiceRequestTicketTitle.tsx","app/pages/ServiceRequestsKanbanPage/components/ParentTicketDetailsButton/index.tsx","app/components/Forms/FormsLayout/FormErrorSummury/index.tsx","app/pages/ArticlesExternalSearchPage/Loadable.ts","app/components/pickers/AutocompletePickers/BudgetExperimentsPicker/index.tsx","app/components/Forms/FormBudgetExperimentsPicker.tsx","app/components/Forms/FormConnectedFilters/FormFieldListeners/UserGroupListener.tsx","app/components/Forms/FormConnectedFilters/FormFieldListeners/UserNameListener.tsx","app/components/Forms/FormConnectedFilters/FormFieldListeners/BudgetListener.tsx","app/components/Forms/FormConnectedFilters/index.tsx","app/components/Forms/FormConnectedFilters/ConnectedFiltersControl.tsx","api/RegionsApi.ts","app/pages/Regions/RegionsDetailsPage/Details/slice/saga.ts","app/pages/Regions/RegionsDetailsPage/Details/slice/index.ts","app/pages/Regions/RegionsDetailsPage/Details/slice/selectors.ts","app/pages/Regions/RegionsDetailsPage/Details/index.tsx","app/components/PrintToPDF/Components/Dialog.tsx","app/components/PrintToPDF/Components/styles.ts","app/components/PrintToPDF/Components/CheckBox.tsx","app/components/PrintToPDF/Components/PopupPrintToPDFComponent.tsx","app/components/PrintToPDF/Components/PrintToPDFPopup.tsx","app/components/pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusPicker/index.tsx","app/components/Forms/FormServiceRequestMilestoneStatusPicker.tsx","app/pages/Samples/components/ServiceRequestMilestoneDetails/index.tsx","app/components/Forms/FormUnitTypePicker.tsx","app/components/Forms/FormServiceRequestMilestoneChargeServicePicker.tsx","app/pages/Samples/components/ServiceRequestMilestoneChargeDetails/index.tsx","app/components/RichTextEditor/RichEditorSerializer.tsx","app/components/RichTextEditor/RichEditor.tsx","app/components/RichTextEditor/styles.ts","app/components/Avatar/styles.ts","app/components/Avatar/index.tsx","app/pages/OtherServiceDetails/Details/OfflineForm/index.tsx","app/pages/OtherServiceDetails/Details/index.tsx","app/components/pickers/AutocompletePickers/PaymentMethodPicker/index.tsx","app/components/Forms/FormPaymentMethodPicker.tsx","app/components/BasicTable/ControlledTable/addRowSelect.tsx","app/components/BasicTable/ControlledTable/ConditionalSelectHeaderCheckbox.ts","enums/InvoiceFundingType.ts","enums/ScreenToShowOn.ts","app/components/BasicTable/Filters/InstrumentCatFilter/index.tsx","app/components/BasicTable/Filters/UserAssetContactMultiFilter/index.tsx","app/pages/UsersPage/PageActions/Actions.ts","app/pages/BillingPreviewPage/Actions/Apis.ts","app/components/BasicTable/CellRenderers/PercentageRenderer/index.tsx","app/components/LabelPrint/slice/selectors.ts","app/components/BasicTable/CellRenderers/DateTimeRenderer/index.tsx","app/pages/Actions/GlobalSelectedActions/OpenArticleDetails.tsx","app/components/BasicTable/CellRenderers/DurationRenderer/index.tsx","app/pages/LocationsPage/Details/ditails.ts","app/pages/Animals/InternalIdLoginPage/slice/selectors.ts","app/components/BasicTable/Filters/CustomPickerFilter/index.tsx","app/components/pickers/CustomPicker/index.tsx","app/pages/PublicAssets/slice/selectors.ts","app/components/BasicTable/Filters/ServiceTypeFilter/index.tsx","api/EmailApi.ts","app/hooks/useSendMail.ts","app/components/BasicTable/Filters/UserDisciplineFilter/index.tsx","app/pages/SavedViewsPage/AddToLists/index.tsx","app/components/BasicTable/CellRenderers/ListRenderer/index.tsx","app/components/pickers/AutocompletePickers/ReservationStatusPicker/index.tsx","app/components/Forms/FormRoomPicker.tsx","app/components/InfoIcon/index.tsx","app/components/PopupImportExport/Components/Dialog/index.tsx","app/components/PopupImportExport/Components/Types.ts","app/components/PopupImportExport/Data/index.ts","app/components/PopupImportExport/Components/SelectFile.tsx","app/components/PopupImportExport/Components/TypePicker.tsx","app/components/PopupImportExport/Components/AutomaticAssetImportNamingPicker.tsx","app/components/PopupImportExport/Components/ImageList.tsx","app/components/PopupImportExport/Components/SelectImageFiles.tsx","app/components/PopupImportExport/Components/step1.tsx","app/components/PopupImportExport/Components/step2_4.tsx","app/components/PopupImportExport/Components/NamePicker.tsx","app/components/PopupImportExport/Components/Table/index.tsx","app/components/PopupImportExport/Components/step3.tsx","app/components/PopupImportExport/Components/step5.tsx","app/components/PopupImportExport/index.tsx","app/components/BasicTable/Filters/CampusFilter/index.tsx","app/components/pickers/AutocompletePickers/ServiceUserGroupPicker/index.tsx","app/components/pickers/AutocompletePickers/UserGroupMultiPicker/index.tsx","app/pages/PublicAssets/slice/saga.ts","app/pages/PublicAssets/slice/index.ts","app/components/InvoiceRowReferenceLinks/index.tsx","app/components/Forms/FormLocationPicker.tsx","app/components/PopupImport/index.tsx","app/components/BasicTable/Filters/TagsFilter/index.tsx","app/components/BasicTable/Filters/LoanableFilter/index.tsx","app/components/BasicTable/Filters/StatusFilter/index.tsx","app/components/BasicTable/Filters/LockersFilter/index.tsx","app/components/BasicTable/Filters/AssemblyTypesFilter/index.tsx","app/components/BasicTable/Filters/AreasFilter/index.tsx","app/components/BasicTable/Filters/OnlineServiceTypeFilter/index.tsx","app/components/BasicTable/Filters/MyAssetAvailabilityTypeMultiPickerFilter/index.tsx","app/components/pickers/AutocompletePickers/TrainingStatePicker/index.tsx","app/components/BasicTable/Filters/TrainingStatePickerFilter/index.tsx","app/components/pickers/AutocompletePickers/ReservationOrDowntimePicker/index.tsx","app/components/BasicTable/Filters/ReservationOrDowntimePickerFilter/index.tsx","app/components/BasicTable/Filters/WithReservationsOnlyFilter/index.tsx","app/pages/CalendarPage/Filter.tsx","app/components/pickers/AutocompletePickers/SamplePlateTypePicker/index.tsx","app/components/Forms/FromSamplePlateTypePicker.tsx","app/components/Forms/FormsLayout/FormFieldsSection/index.tsx","app/components/Forms/FormsLayout/FormLeftSection/index.tsx","app/components/BasicTable/BasicFilter/TableToolbar/RefreshIcon.tsx","app/components/BasicTable/Filters/NumbersRangeFilter/index.tsx","app/components/BasicTable/Filters/AvailabilityTypeBookableFilter/index.tsx","app/pages/TrainingSessionsPage/PrimaryAction.ts","app/pages/WorkOrdersPage/PrimaryAction.ts","app/pages/OtherServiceDetails/Details/components/InventoryBatchList.tsx","app/components/BasicInputs/Radio/index.tsx","app/components/Forms/FormParagraph.tsx","app/components/pickers/AutocompletePickers/CatRateTypePicker/index.tsx","app/components/BasicTable/CellRenderers/ImageRenderer/index.tsx","app/components/BasicPickers/BaseURLMultiPicker/index.tsx","app/components/BasicTable/CellRenderers/EquipmentIdRenderer/index.tsx","app/components/BasicTable/CellRenderers/OperationTypeIdRenderer/index.tsx","app/components/BasicTable/CellRenderers/AssetImageRenderer/index.tsx","enums/InternalServiceRequestStatuses.ts","app/pages/ReservationHistoryPage/PrimaryAction.ts","app/pages/OtherServiceDetails/OtherServiceDetailsPage/index.tsx","app/components/BasicTable/Filters/ServiceFilter/index.tsx","app/components/BasicIcons/SvgIcons/I-cursor.svg","app/components/BasicIcons/SvgIcons/check.svg","app/components/BasicIcons/SvgIcons/times.svg","app/components/BasicIcons/SvgIcons/chevron-down.svg","app/components/BasicIcons/SvgIcons/chevron-up.svg","app/components/BasicIcons/SvgIcons/notavailable.svg","app/components/BasicIcons/SvgIcons/notAllowed.svg","app/components/BasicIcons/SvgIcons/checked.svg","app/components/BasicIcons/SvgIcons/unchecked.svg","app/components/BasicIcons/SvgIcons/undeterminate.svg","app/components/BasicIcons/SvgIcons/index.tsx","app/components/pickers/AutocompletePickers/RoomTSPicker/index.tsx","app/components/BasicTable/Filters/RoomTSFilter/index.tsx","app/components/pickers/MultiSelectPickers/TrainingProgramsMultiPicker/index.tsx","app/components/BasicTable/Filters/TrainingProgramsMultiFilter/index.tsx","app/pages/TrainingSessionsPage/Filter.tsx","app/components/pickers/AutocompletePickers/ActiveSampleTypesPicker/index.tsx","app/components/pickers/AutocompletePickers/RelevantBudgetPicker/index.tsx","app/pages/ServiceRequestListPage/CreateNewRequest/index.tsx","app/Layout/FrontendLayout/components/SidePanel/wrappers/index.tsx","app/Layout/FrontendLayout/components/SidePanel/SidePanelPopup.tsx","app/Layout/FrontendLayout/components/SidePanel/index.tsx","app/components/BasicInputs/BaseInputs/FilledInput/index.tsx","api/TermsOfUseAgreementApi.ts","utils/ExportToExcel.ts","app/components/BasicTable/getNextFilter.tsx","app/components/pickers/AutocompletePickers/InvoiceStatusPicker/index.tsx","app/Layout/FrontendLayout/components/TopBar/components/openMenuButton/index.tsx","app/components/BasicTable/CellRenderers/UserRenderer/index.tsx","app/pages/CalendarPage/Scheduler/components/ViewTypeLengthDropDown/index.tsx","app/pages/CalendarPage/Scheduler/components/ExportToPDF.tsx","app/components/BasicTable/Filters/DatePickerFilter/index.tsx","app/components/BasicTable/Filters/TextFieldFilter/index.tsx","app/pages/ReservationHistoryPage/MyListFilter.tsx","app/pages/Documents/DocumentsTable.tsx","app/components/BasicTable/components/NoTableData/index.tsx","app/components/BasicTable/components/TableError/index.tsx","app/components/BasicTable/CellRenderers/DefaultRenderer/index.tsx","app/pages/Documents/Columns.tsx","app/components/BasicTable/CellRenderers/FileNameRenderer/index.tsx","app/pages/TrainingSessionsPage/Columns.tsx","app/components/BasicTable/CellRenderers/UsedSlotsRenderer/index.tsx","app/components/BasicTable/CellRenderers/TrainingStateRenderer/index.tsx","app/pages/TrainingSessionsPage/RowActions/ReservationLink.tsx","app/pages/TrainingSessionsPage/TrainingSessionsTable.tsx","app/pages/ArticlesPage/ArticlesTable.tsx","app/pages/ArticlesPage/PrimaryAction.ts","app/pages/WorkOrdersPage/WorkOrdersTable.tsx","app/components/ScannerView/index.tsx","api/AssetDetailsApi.ts","app/pages/QuizDetailsPage/QuizDetails/index.tsx","app/components/pickers/AutocompletePickers/WorkOrderTypeStatusPicker/index.tsx","app/pages/Actions/GlobalSelectedActions/OpenTimeline.tsx","app/pages/Samples/SamplePlatesPage/slice/saga.ts","app/components/PopupImportExport/Actions/Import.tsx","app/pages/MyAssetsPage/Columns.tsx","app/components/BasicTable/Filters/ServiceTypeEnumFilter/index.tsx","app/pages/Actions/GlobalSelectedActions/CloneEquipments.tsx","app/components/BasicTable/Filters/AssetFilter/index.tsx","app/pages/ReservationHistoryPage/Columns.tsx","app/components/BasicTable/CellRenderers/BookedByRenderer/index.tsx","app/pages/ReservationHistoryPage/ReservationHistoryTable.tsx","app/pages/InvoiceBatches/InvoiceBatchesComments.tsx","app/pages/OtherServiceDetails/OtherServiceDetailsPage/getQueryStringParameter.ts","app/pages/OnlineBudgetsStatusPage/Filter.tsx","app/components/InfiniteScroll/index.tsx","enums/JoinStatus.ts","app/components/BasicTable/CellRenderers/RegionRenderer/index.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/EventContent.tsx","app/pages/CalendarPage/Scheduler/utils/formatSchedulerTime.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/EventHeader.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/TrainingSessionStatus.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/TrainingSessionEventConent.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/ReservationStatusIcon.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/ReservationEventContent.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/OfflineEventContent.tsx","app/pages/CalendarPage/Scheduler/components/EventRender/index.tsx","app/pages/CalendarPage/Scheduler/servicesToSections.ts","app/pages/CalendarPage/Scheduler/serverListUtils.tsx","app/pages/CalendarPage/Scheduler/renderServiceLabel.tsx","app/pages/CalendarPage/Scheduler/utils/timelineEventsSortIteratee.ts","app/pages/CalendarPage/Scheduler/components/NoServices/index.tsx","app/hooks/useComparedHooks.ts","app/pages/CalendarPage/Scheduler/components/EventRender/EventTimelineContent.tsx","app/pages/CalendarPage/Scheduler/components/event_text/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/TooltipLine/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/TrainingSessionTooltip/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/OfflineTooltip/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/ReservationTooltip/index.tsx","app/pages/CalendarPage/Scheduler/components/Tooltips/index.tsx","app/hooks/useDidUpdate.ts","app/pages/CalendarPage/Scheduler/updateView.tsx","app/pages/CalendarPage/Scheduler/deleteTempReservations.tsx","app/pages/CalendarPage/Scheduler/resetEventEdits.tsx","app/pages/CalendarPage/Scheduler/findParentTarget.tsx","app/pages/CalendarPage/Scheduler/transformToSerializableEvent.tsx","app/components/PrintToPDF/Scheduler/ExportMethods.ts","app/components/PrintToPDF/Scheduler/index.tsx","app/pages/CalendarPage/Scheduler/index.tsx","app/pages/CalendarPage/Scheduler/utils/getEvent.tsx","app/pages/CalendarPage/Scheduler/utils/adjustMonthTimelineLength.tsx","app/pages/CalendarPage/Scheduler/createTimelineView.tsx","app/pages/CalendarPage/Scheduler/createUnitsView.tsx","app/pages/CalendarPage/Scheduler/getServiceIdFromServiceClickEvent.tsx","app/components/pickers/AutocompletePickers/InvoiceTemplatePicker/index.tsx","app/pages/InvoiceDetails/Slice/saga.ts","app/pages/InvoiceDetails/Slice/index.ts","app/pages/InvoiceDetails/Slice/selector.ts","app/pages/InvoiceDetails/InvoiceComments/index.tsx","app/pages/InvoiceDetails/InvoiceInReview/styles.ts","app/pages/InvoiceDetails/InvoiceInReview/index.tsx","app/pages/InvoiceDetails/ReadOnly/styles.ts","app/pages/InvoiceDetails/InvoiceRemarks/index.tsx","app/pages/InvoiceDetails/ReadOnly/index.tsx","app/pages/InvoiceDetails/ReadOnly/Rows.tsx","app/pages/InvoiceDetails/Tables/Details/Columns.tsx","app/components/BasicTable/Filters/SampleTypeFilter/index.tsx","app/pages/InvoiceDetails/Tables/Filter.tsx","app/pages/InvoiceDetails/Tables/Details/getDefaultFilters.ts","app/pages/InvoiceDetails/Tables/Details/index.tsx","app/pages/InvoiceDetails/Tables/InvoiceHistory/index.tsx","app/pages/InvoiceDetails/Tables/InvoiceHistory/Columns.tsx","app/pages/InvoiceDetails/Tables/InvoiceHistory/Filter.tsx","app/pages/InvoiceDetails/Tables/PayHistory/index.tsx","app/pages/InvoiceDetails/Tables/PayHistory/columns.tsx","app/pages/InvoiceDetails/Tables/PayHistory/Filter.tsx","app/pages/InvoiceDetails/Tables/Payments/index.tsx","app/pages/InvoiceDetails/Tables/Payments/Columns.tsx","app/pages/InvoiceDetails/Tables/RowHistory/index.tsx","app/pages/InvoiceDetails/Tables/RowHistory/Columns.tsx","app/pages/InvoiceDetails/Tables/RowHistory/Filter.tsx","app/pages/InvoiceDetails/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/Actions/WorkOrderActions.tsx","app/components/Forms/FormWorkOrderTypePicker.tsx","app/components/Forms/FormWorkOrderTypeStatusPicker.tsx","app/components/Forms/FormRemindBeforePicker.tsx","app/components/pickers/AutocompletePickers/SymptomCodesPicker/index.tsx","app/components/Forms/FormSymptomCodesPicker.tsx","app/components/pickers/AutocompletePickers/RepairCodesPicker/index.tsx","app/components/Forms/FormRepairCodesPicker.tsx","app/components/pickers/AutocompletePickers/ReasonTypePicker/index.tsx","app/components/Forms/FormReasonTypePicker.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/CreationDetails/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/FormUnlimitedDowntime.tsx","app/components/pickers/AutocompletePickers/CustomFormPicker/index.tsx","app/components/Forms/FormCustomFormPicker.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderComments.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderLinks/AddCalibrationWorkOrder.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderLinks/HoverLinkItem.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/WorkOrderLinks/WorkOrderLinks.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/index.tsx","app/pages/WorkOrders/WorkOrderDetailsPage/Details/WorkOrderForm/validationSchema.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Details/index.tsx","app/components/pickers/StaticOptionsPickers/ScreenToShowOnPicker/index.tsx","app/components/pickers/StaticOptionsPickers/InvoiceStatusWithStaticOptionsPicker/index.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/types.ts","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/saga.ts","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/index.ts","app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/selectors.ts","app/components/pickers/MultiSelectPickers/EmailAttachmentTypePicker/EATBaseURLMultiPicker/index.tsx","app/components/pickers/MultiSelectPickers/EmailAttachmentTypePicker/index.tsx","app/components/Forms/FormEmailAttachmentTypePicker.tsx","app/components/Forms/FormInvoiceStatusPicker.tsx","app/components/Forms/FormScreenToShowOnPicker.tsx","app/components/Forms/FormPaymentMethodEnumPicker.tsx","app/components/pickers/MultiSelectPickers/EmailRecipientTypesPicker/ERTBaseURLMultiPicker/index.tsx","app/components/pickers/MultiSelectPickers/EmailRecipientTypesPicker/index.tsx","app/components/Forms/FormEmailRecipientTypesPicker.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/BillingActionsForm/index.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/Actions/BillingActions_Actions.tsx","app/pages/BillingActions/BillingActionsDetailsPage/Details/index.tsx","app/pages/CoreSelectionPage/Table/getFilters.tsx","app/pages/CoreSelectionPage/Table/getDefaultFilters.ts","app/components/pickers/AutocompletePickers/PermissionLevelPicker/index.tsx","app/components/Forms/FormPermissionLevelPicker/index.tsx","app/components/pickers/AutocompletePickers/TimeSlotTypePicker/index.tsx","app/components/Forms/FormTimeSlotTypePicker/index.tsx","app/components/Forms/FormUserGroupsPicker/index.tsx","app/pages/CoreSelectionPage/SelectedBulkActions/UpdateUserGroupPermissions/UpdateGroupPermissions.tsx","app/pages/CoreSelectionPage/SelectedBulkActions/UpdateUserGroupPermissions/index.tsx","app/pages/CoreSelectionPage/SelectedBulkActions/GetSelectedActions.tsx","app/pages/CoreSelectionPage/Table/CoreSelectionTable.tsx","app/pages/CoreSelectionPage/Table/Columns.tsx","app/pages/CoreSelectionPage/slice/index.ts","app/pages/CoreSelectionPage/slice/selectors.ts","app/pages/CoreSelectionPage/CoreSelection.tsx","app/components/CheckBoxGroup/index.tsx","app/components/Forms/FormCheckBoxGroup.tsx","app/components/pickers/StaticOptionsPickers/EveryDaysPicker/index.tsx","app/components/Forms/FormEveryDaysPicker.tsx","app/components/pickers/StaticOptionsPickers/RepeatMonthlyBy/index.tsx","app/components/Forms/FormRepeatMonthlyByPicker.tsx","app/components/pickers/StaticOptionsPickers/RepeatPeriodPicker/index.tsx","app/components/Forms/FormRepeatPeriodPicker.tsx","app/components/pickers/StaticOptionsPickers/RepetitiveOptionsPicker/index.tsx","app/components/Forms/FormRepetitiveOptionsPicker.tsx","app/components/Forms/Schemas/RepititiveSchema.ts","app/components/Forms/FormRepetitive/index.tsx","api/UserTrainingApi.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/types.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/saga.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/index.ts","app/pages/UserTrainings/TrainingDetailsPage/Details/slice/selectors.ts","app/components/pickers/AutocompletePickers/TrainingReservationsPicker/index.tsx","app/components/Forms/FormTrainingReservationsPicker.tsx","app/components/Forms/FormTrainingLevelPicker.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/UserTrainingForm/UserTrainingComments/index.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/UserTrainingForm/index.tsx","app/pages/UserTrainings/TrainingDetailsPage/Details/index.tsx","app/pages/CalendarPage/FiltersComponent.tsx","app/pages/CalendarPage/Scheduler/components/MultiToggle/index.tsx","app/components/FullScreenButton/index.tsx","app/pages/CalendarPage/Scheduler/components/FullScreenSchedulerButton/index.tsx","app/pages/CalendarPage/Scheduler/components/CalendarDatePicker/index.tsx","app/pages/CalendarPage/Scheduler/components/TimelineGroupByPicker/index.tsx","app/pages/CalendarPage/Scheduler/components/CalendarHeader/index.tsx","app/pages/CalendarPage/Scheduler/components/useRefreshInterval.ts","app/pages/PriceSheetPeriodDetails/Details/slice/types.ts","api/PriceSheetApi.ts","app/pages/PriceSheetPeriodDetails/Details/slice/saga.ts","app/pages/PriceSheetPeriodDetails/Details/slice/index.ts","app/pages/PriceSheetPeriodDetails/Details/slice/selectors.ts","app/components/Forms/FormPriceSheetMethodPicker.tsx","app/pages/PriceSheetPeriodDetails/Details/PricePeriodsForm/index.tsx","app/pages/PriceSheetPeriodDetails/Details/index.tsx","app/pages/CalendarMessages/CalendarMessagesDetails/Details/Actions/CalendarMessagesActions.tsx","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/types.ts","api/CalendarMessagesApi.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/saga.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/index.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/selectors.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Details/CalendarMessagesForm/index.tsx","app/pages/CalendarMessages/CalendarMessagesDetails/Details/index.tsx","app/pages/MyAssetsPage/AssetsSelection/Filter.tsx","app/pages/MyAssetsPage/AssetsSelection/AssetsSelectionTable.tsx","app/pages/MyAssetsPage/AssetsSelection/slice/index.ts","app/pages/MyAssetsPage/AssetsSelection/slice/selectors.ts","app/pages/MyAssetsPage/AssetsSelection/RecentAssets.tsx","app/pages/MyAssetsPage/AssetsSelection/AssetsSelection.tsx","app/pages/MyAssetsPage/AssetsSelection/useAddNewActions.ts","app/components/pickers/StaticOptionsPickers/BarcodeLogStatusPicker/index.tsx","app/components/BasicTable/Filters/BarcodeLogStatusFilter/index.tsx","app/pages/AssetsInventoryLog/InventoryLog/GetFilters.tsx","app/pages/AssetsInventoryLog/InventoryLog/InventoryLogTable.tsx","app/pages/AssetsInventoryLog/InventoryLog/GetColumns.tsx","app/pages/AssetsInventoryLog/InventoryLog/index.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/Actions/SavedViewActions.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/SavedViewForm.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/validationSchema.ts","app/pages/SavedViewsPage/SavedViewPage/Details/index.tsx","app/pages/SavedViewsPage/SavedViewPage/Details/Actions/RightTopActions.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/PopUpListItems/index.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/HtmlTextBox/index.tsx","app/components/Forms/FormColorPicker.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/PreviewButton.tsx","app/pages/InvoiceTemplates/InvoiceTemplatePopUp/index.tsx","app/components/BasicInputs/FileUpload/styles.ts","app/components/BasicInputs/FileUpload/FileView.tsx","app/components/BasicInputs/FileUpload/FileInput.tsx","app/components/BasicInputs/FileUpload/FilesPreview.tsx","app/components/BasicInputs/FileUpload/FileUpload.tsx","app/components/pickers/StaticOptionsPickers/EmailTypePicker/index.tsx","app/components/BasicTable/Filters/EmailTypeFilter/index.tsx","app/pages/EmailNotificationsPage/Filter.tsx","app/components/CustomForm/CustomFormSkeleton/index.tsx","app/components/CustomForm/QuizCustomForm.tsx","app/pages/QuizPage/StartQuiz/index.tsx","app/components/BasicChip/StatusChip.tsx","app/pages/WorkOrdersPage/Columns.tsx","utils/export.ts","app/pages/Samples/SamplesListPage/slice/saga.ts","app/pages/MyAssetsPage/Actions/Api.ts","app/pages/MyAssetsPage/SelectedRowActions/GetSelectedActions.tsx","app/pages/OtherServiceDetails/ReportConsumables/ConsumablesForm.tsx","app/pages/OtherServiceDetails/ReportConsumables/index.tsx","app/pages/ArticlesPage/AricleDatasetLink/index.tsx","app/pages/ArticlesPage/Columns.tsx","app/pages/Samples/EditableTable/Fields/StyledSelect.tsx","app/pages/Samples/components/TmtType/index.tsx","app/components/BasicTabs/BasicTab/index.tsx","app/components/BasicTabs/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/EventsCount/index.tsx","api/assetQuickSearchApi.ts","app/components/AssetQuickSearch/slice/saga.ts","app/components/AssetQuickSearch/slice/index.ts","app/components/AssetQuickSearch/slice/selectors.ts","app/components/ListItemLink/index.tsx","app/components/AssetQuickSearch/AssetListItem/index.tsx","app/components/AssetQuickSearch/RecentWrappers/wrappers.tsx","app/components/AssetQuickSearch/RecentAssetsList/index.tsx","app/components/AssetQuickSearch/RecentItem/index.tsx","app/components/AssetQuickSearch/RecentSearchTermsList/index.tsx","app/components/AssetQuickSearch/MenuSearchItem/index.tsx","app/components/AssetQuickSearch/MenuSearchResultList/index.tsx","app/components/AssetQuickSearch/AssetSearchResultsByType/index.tsx","app/components/AssetQuickSearch/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/messages.ts","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/UserMenu/UserMenuButton.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/UserMenu/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/SwitchSites/index.tsx","app/Layout/FrontendLayout/components/TopBar/ProfileMenu/index.tsx","app/Layout/FrontendLayout/components/TopBar/components/ToggleSideMenuButton.tsx","app/Layout/FrontendLayout/components/TopBar/TopToolbar/index.tsx","app/components/GlobalServiceGroupFilter/TopGroupButton/index.tsx","app/components/GlobalServiceGroupFilter/CoreDashboardButton/index.tsx","app/components/GlobalServiceGroupFilter/styles.ts","app/components/GlobalServiceGroupFilter/CoreSelectionButton/index.tsx","app/Layout/FrontendLayout/components/TopBar/SubTopToolbar/index.tsx","app/Layout/FrontendLayout/components/TopBar/index.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/MenuItemComponent.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/HoverMenu.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/MenuItem.tsx","styles/CssVariables/styledVariables.ts","app/Layout/FrontendLayout/components/SideBar/SideBarMenu/index.tsx","app/components/BookitlabLogo/BookitlabShortLogo.tsx","app/Layout/FrontendLayout/components/SideBar/UserProfileMobile/index.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarHeader/index.tsx","app/Layout/FrontendLayout/components/SideBar/styles.ts","app/Layout/FrontendLayout/components/SideBar/SideBarFooter/index.tsx","app/Layout/FrontendLayout/components/SideBar/SideBarQuickAction/index.tsx","app/Layout/FrontendLayout/components/SideBar/index.tsx","app/Layout/FrontendLayout/SideBarDrawer.tsx","app/Layout/FrontendLayout/styled/index.tsx","app/Layout/FrontendLayout/components/AdminPanel/index.tsx","app/Layout/FrontendLayout/index.tsx","app/hooks/useRequiredRedirectToCoreSelection.ts","app/pages/Samples/components/SamplesTable/index.tsx","app/pages/Samples/RequestSamplesPage/components/ServiceRequestCustomForm/index.tsx","app/pages/Samples/components/EventBudgetPicker/index.tsx","app/pages/Samples/components/ReadonlyField/index.tsx","app/pages/Samples/components/Utils/index.ts","api/odata/generated/enums/InternalServiceRequestStatus.ts","app/pages/Samples/components/ServiceRequestSubmissionDetails/index.tsx","app/pages/Samples/RequestSamplesPage/components/SubmitServiceRequestButton/index.tsx","app/pages/Samples/RequestSamplesPage/components/CancelServiceRequestButton/index.tsx","app/pages/Samples/components/ServiceRequestAddons/index.tsx","app/pages/Samples/components/ServiceRequestAddons/utils.ts","app/components/pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusMenuPicker/index.tsx","app/pages/Samples/components/ServiceRequestMilestones/index.tsx","app/pages/Samples/components/ServiceRequestMilestonesSection/index.tsx","app/pages/Samples/RequestSamplesPage/components/CloneServiceRequestButton/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/AddServiceRequestRowButton/index.tsx","app/pages/Samples/components/ServiceRequestRowEditableCell/index.tsx","app/pages/Samples/EditableTable/Fields/DropDownList/index.tsx","app/pages/Samples/EditableTable/Fields/DropDownList/IWithAsyncOptions.tsx","app/pages/Samples/EditableTable/Fields/DropDownList/useAsyncOptions.tsx","app/pages/Samples/EditableTable/Fields/getCellComponent.tsx","app/pages/Samples/EditableTable/Fields/getReadonlyCell.tsx","app/pages/Samples/components/ServiceRequestRowsTable/getCustomFormTableColumns.tsx","app/pages/Samples/components/ServiceRequestRowStatusPicker/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/getTableColumns.tsx","api/odata/generated/enums/InternalServiceRequestRowStatus.ts","app/pages/Samples/components/ServiceRequestRowsTable/components/ServiceRequestComments/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/ServiceRequestRowsImport/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/BulkUpdate/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/components/ColumnsSelect/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/index.tsx","app/pages/Samples/RequestSamplesPage/components/QuoteSentToUserAlert/index.tsx","app/pages/Samples/RequestSamplesPage/components/SendQuoteButton/index.tsx","app/pages/Samples/components/ServiceRequestRowsTable/getServiceRequestRowSchema.ts","app/pages/Samples/RequestSamplesPage/components/DownloadAllFiles/index.tsx","app/pages/Samples/components/ServiceRequestReservations/index.tsx","app/components/pickers/AutocompletePickers/GradientsPicker/index.tsx","app/pages/Samples/components/CreateRequestReservation/index.tsx","app/pages/Samples/RequestSamplesPage/index.tsx","app/components/PrintToPDF/getPrintPDFSections.tsx","app/pages/Samples/RequestSamplesPage/utils/validationSchema.ts","app/pages/EmailNotificationsPage/getNotificationsLogPageLocation.tsx","app/pages/Samples/RequestSamplesPage/getServiceRequestTitle.tsx","app/pages/ServiceRequestsKanbanPage/components/ServiceRequestCard/index.tsx","app/pages/ServiceRequestsKanbanPage/components/Kanban/index.tsx","app/Layout/FrontendLayout/components/ContentBox/index.tsx","app/pages/ServiceRequestsKanbanPage/index.tsx","styles/global-styles.ts","app/pages/NotFoundPage/Loadable.tsx","app/Layout/FrontendLayout/Loadable.ts","locales/i18n.ts","app/pages/AnimalTypesPage/Loadable.ts","app/components/DialogAlert/messages.ts","app/components/DialogAlert/slice/selectors.ts","app/components/DialogAlert/index.tsx","app/Layout/FrontendLayout/components/Snackbar/Loadable.ts","app/pages/Animals/InternalIdLoginPage/Loadable.ts","app/pages/AnimalsListPage/Loadable.ts","app/Layout/PosLayout/index.tsx","app/pages/Animals/AnimalCaseConsumablesPage/Loadable.ts","app/components/basic/Wrappers/FlexWrappers/flexColumn.tsx","app/Layout/LoginLayout/index.tsx","app/pages/Animals/AnimalsHomePage/Loadable.ts","app/pages/Animals/PrivateAnimalRoute/index.tsx","app/pages/Animals/CreateNewCasePage/Loadable.ts","app/pages/Samples/SamplesListPage/Loadable.ts","app/pages/Samples/RunDetailsPage/Loadable.ts","app/pages/Samples/RequestSamplesPage/Loadable.ts","app/pages/TrainingSessionsPage/Loadable.ts","app/pages/Buildings/Loadable.ts","app/pages/ReservationHistoryPage/Loadable.ts","app/pages/AddNewReportPage/Loadable.ts","app/pages/TrainingWaitingListPage/Loadable.ts","store/history.ts","app/pages/EmailNotificationsPage/Loadable.ts","app/pages/ExperimentTemplates/Loadable.ts","app/pages/UsersHistoryPage/Loadable.ts","app/pages/UserTrainingsPage/Loadable.ts","app/pages/NotAvailablePage/Loadable.ts","app/components/Routers/RestrictedRoute/index.tsx","app/pages/UsersPage/loadable.ts","app/pages/Animals/AnimalExtendedBillingReportPage/Loadable.ts","app/pages/UserTrainingHistoryPage/Loadable.ts","app/pages/OtherServicesPage/Loadable.ts","app/pages/BudgetsPage/Loadable.ts","app/pages/ServiceRequestListPage/Loadable.ts","app/pages/WorkOrdersPage/Loadable.ts","app/pages/Documents/Loadable.ts","app/pages/QuizPage/Loadable.ts","app/pages/QuizDetailsPage/Loadable.ts","app/pages/UserTrainings/TrainingDetailsPage/Loadable.ts","app/pages/Samples/SampleModificationsPage/Loadable.ts","app/pages/UsageHistoryPage/Loadable.ts","app/pages/Samples/RunsListPage/Loadable.ts","app/pages/Animals/AnimalCaseEditPage/AnimalCasesHistory/Loadable.ts","app/pages/SendEmailToUsers/Loadable.ts","app/pages/ChargesPage/Loadable.ts","app/pages/MyAssetsPage/Loadable.ts","app/pages/LocationsPage/loadable.ts","app/pages/LocationsPage/BuildingPage/loadable.ts","app/pages/LocationsPage/CampusesPage/loadable.ts","app/pages/LocationsPage/AreasPage/loadable.ts","app/pages/LocationsPage/LocationListPage/loadable.ts","app/pages/LocationsPage/SubLocationListPage/loadable.ts","app/pages/InvoiceBatches/Loadable.ts","app/pages/CategoriesPage/Loadable.ts","app/pages/CategoryGroupsPage/Loadable.ts","app/pages/BillingPreviewPage/Loadable.ts","app/pages/OnlineBudgetsStatusPage/slice/selectors.ts","app/pages/OnlineBudgetsStatusPage/slice/saga.ts","app/pages/OnlineBudgetsStatusPage/slice/index.ts","app/pages/OnlineBudgetsStatusPage/ChargeOnlineBudgetsButton/index.tsx","app/pages/OnlineBudgetsStatusPage/GenerateInvoicesButton/index.tsx","app/pages/OnlineBudgetsStatusPage/PayButton/index.tsx","app/pages/OnlineBudgetsStatusPage/GenerateInvoicesAndSendToSap/index.tsx","app/pages/AddPaymentPage/AddPaymentButton.tsx","app/pages/OnlineBudgetsStatusPage/useRowActions.tsx","app/pages/OnlineBudgetsStatusPage/index.tsx","app/pages/OnlineBudgetsStatusPage/columns.tsx","app/pages/OnlineBudgetsStatusPage/pageActions.tsx","app/pages/OnlineBudgetsStatusPage/getDefaultFitlers.ts","app/pages/InvoiceDetails/Loadable.ts","app/pages/WorkOrders/WorkOrderDetailsPage/Loadable.ts","app/pages/InvoiceBillingPage/Loadable.ts","app/pages/BillingActions/BillingActionsPage/Loadable.ts","app/pages/BillingActions/BillingActionsDetailsPage/Loadable.ts","app/pages/LocationsPage/LocationTypesPage/loadable.ts","app/pages/LocationsPage/SubLocationTypesPage/loadable.ts","app/pages/SavedViewsPage/SavedViewPage/Loadable.ts","app/pages/SavedViewsPage/SavedViewsPage/Loadable.ts","app/pages/LabelTypesPage/Loadable.ts","app/pages/AssetDetailsPage/Loadable.ts","app/components/LabelPrint/LabelPrintDialog/Loadable.ts","app/pages/KioskProjects/Loadable.ts","app/pages/KioskProjects/KioskProjectConsumablesPage/Loadable.ts","app/pages/KioskProjects/PrivateKioskProjectsRoute/Loadable.ts","app/components/SessionTimeout/SessionTimeout.ts","app/components/SessionTimeout/DialogAlert.tsx","app/components/SessionTimeout/index.tsx","app/pages/QuizSubmissionsPage/Loadable.ts","app/pages/QuizzesPage/Loadable.ts","app/pages/AdHocReportListPage/Loadable.ts","app/pages/RoomsPage/Loadable.ts","app/pages/CalendarMessages/CalendarMessagesPage/Loadable.ts","app/pages/CoresDirectoryPage/Loadable.ts","app/pages/Samples/SamplePlatesPage/Loadable.ts","app/Layout/FrontendLayout/components/HeadTitle/useTabTitle.ts","app/Layout/FrontendLayout/components/HeadTitle/index.tsx","app/pages/InstrumentRestrictionsPage/Loadable.ts","app/pages/LabelTypeDetailsPage/Loadable.ts","app/pages/ConfigurableColumnExportImport/Loadable.ts","app/components/Routers/ShortURLRoute/index.tsx","app/components/Routers/ServerBarcodesRoute/index.tsx","app/pages/NewMessagePage/Loadable.ts","app/pages/OtherServiceDetails/OtherServiceDetailsPage/Loadable.ts","app/pages/InvoiceTemplates/InvoiceTemplatesPage/Loadable.ts","app/pages/ExpensesPage/Loadable.ts","app/pages/PriceSheetPeriodsPage/Loadable.ts","app/pages/PriceSheetPeriodDetails/PriceSheetPeriodDetailsPage/Loadable.ts","app/pages/ArticlesPage/Loadable.ts","app/Layout/AccountLayout/Loadable.ts","app/pages/Account/Register/Loadable.ts","app/pages/CalendarPage/Loadable.tsx","app/hocs/withSaveAsLastVisitedPage.tsx","app/pages/ReservationDetails/ReservationDetailsPage/Loadable.ts","app/pages/HomePage/Loadable.tsx","app/pages/SystemPage/Loadable.tsx","app/pages/DashboardPage/Loadable.ts","app/pages/CoreSelectionPage/Loadable.ts","app/pages/CoreHomePage/Loadable.ts","app/pages/CoreStatsPage/Loadable.ts","app/pages/ReportingPage/Loadable.ts","app/pages/BookitLabDashboardPage/Loadable.ts","app/components/RedirectWithSearch/index.tsx","app/pages/MyAssetsPage/AssetsSelection/Loadable.ts","app/pages/TermsOfUseAgreementPage/Loadable.ts","app/Layout/FrontendLayout/components/Snackbar/SnackWrapper.tsx","app/pages/ActiveUserGroupPage/Loadable.ts","app/pages/CannedReports/Loadable.ts","app/pages/UserAttributes/UserAttributesPage/Loadable.ts","app/pages/OtherServiceDetails/ReportConsumables/ReportConsumablesPage/Loadable.ts","app/pages/LoginPage/Loadable.ts","app/pages/CalendarMessages/CalendarMessagesDetails/Loadable.ts","app/pages/ServiceRequestsKanbanPage/Loadable.ts","app/pages/OfflineServiceTypesPage/Loadable.ts","app/pages/Animals/AnimalCaseEditPage/Loadable.ts","app/AllIcons.ts","app/Layout/PublicAssetsLayout/index.tsx","app/pages/PublicAssets/Loadable.ts","app/pages/NotAllowedPage/Loadable.ts","app/pages/PlayGround/Loadable.ts","app/pages/AssetsInventory/Loadable.ts","app/pages/AssetsInventoryLog/Loadable.ts","app/pages/ServiceRequestAuditTrailHistoryPage/Loadable.ts","app/pages/FloorsPage/Loadable.ts","app/pages/SubscriptionTypesPage/Loadable.ts","app/pages/BudgetExperimentsPage/Loadable.ts","app/pages/Regions/RegionsPage/Actions/AddRegion/index.tsx","app/pages/Regions/RegionsPage/index.tsx","app/pages/Regions/RegionsPage/Columns.tsx","app/pages/Regions/RegionsPage/Actions/GetPageActions.tsx","app/pages/Regions/RegionsDetailsPage/index.tsx","app/pages/SuperGroups/SuperGroupsPage/Actions/AddSuperGroup/index.tsx","app/pages/SuperGroups/SuperGroupsPage/index.tsx","app/pages/SuperGroups/SuperGroupsPage/Columns.tsx","app/pages/SuperGroups/SuperGroupsPage/Actions/GetPageActions.tsx","app/pages/SuperGroups/SuperGroupsPage/Filters.tsx","app/pages/JoinAdGroup/Loadable.ts","app/pages/JoinAdGroup/JoinConfirmPage/Loadable.ts","app/index.tsx","store/BarcodeScanner.ts","reportWebVitals.ts","app/components/MobileBarcodeScanner/index.tsx","index.tsx","store/configureStore.ts","store/reducers.ts"],"names":["translations","convertLanguageJsonToObject","json","objToConvertTo","current","Object","keys","forEach","key","currentLookupKey","obj","_index","require","__esModule","default","formatLongHE","date","formats","full","long","medium","short","defaultWidth","time","dateTime","log","getLogger","dateUtils","dateFnsUtils","DateIOFormats","dayOfMonth","fullDate","fullDateWithWeekday","fullDateTime","fullDateTime12h","fullDateTime24h","fullTime","fullTime12h","fullTime24h","hours12h","hours24h","keyboardDate","keyboardDateTime","keyboardDateTime12h","keyboardDateTime24h","minutes","month","monthAndDate","monthAndYear","monthShort","weekday","weekdayShort","normalDate","normalDateWithWeekday","seconds","shortDate","year","isToday","differenceInSeconds","differenceInMinutes","differenceInHours","differenceInDays","differenceInWeeks","differenceInMonths","differenceInQuarters","differenceInYears","differenceInCalendarDays","add","addMilliseconds","addSeconds","addMinutes","addHours","addDays","addWeeks","addMonths","addQuarters","addYears","startOfMinute","startOfHour","startOfDay","startOfMonth","startOfQuarter","startOfYear","endOfHour","endOfDay","endOfMonth","endOfQuarter","endOfYear","endOfTomorrow","startOfTomorrow","startOfYesterday","endOfYesterday","startOfToday","lastDayOfMonth","getDaysInMonth","getDayOfYear","getYear","getMonth","getHours","getMinutes","getDate","setDate","setMonth","setYear","setHours","setMinutes","intervalToDuration","this","DateFnsUtils","s","split","x","y","undefined","toUpperCase","toLowerCase","locale","cultureName","systemFirstDayOfWeek","dateFnsCultureName","getLocale","options","weekStartsOn","console","error","culture","a","result","code","formatLong","v","parseISO","firstWeekContainsDate","localeFirstWeekContainsDate","toInteger","defaultFirstWeekContainsDate","localeWeekStartsOn","defaultWeekStartsOn","f","d","dateOrStringToDate","format","err","truncatedString","length","substr","isNaN","getTime","parse","formatDistanceToNow","addSuffix","timeFormat","dateFormat","representation","gfs","Date","formatDate","formatISO","convertedDate","value","fdow","startOfWeek","Array","from","map","e","i","startDate","endDate","months","getFullYear","firstDayOfWeek","endOfWeek","getDay","week","setWeek","day","setDay","values","set","FirstDayOfWeek","getWeekOfMonth","hoursMinutes","parseInt","CustomDate","toDate","meridiem","ampm","val","hours","ODataOperators","quoteODataValue","toString","escapeODataValue","isArray","join","Id","Error","replaceAll","withisInversed","condition","isInversed","Condition","field","operator","field1","c1","start","push","GreaterThanEqual","end","LessThanEqual","c","GreaterThan","LessThan","res","fieldName","name","String","Equals","NotEquals","Contains","ContainsM","resCM","Between","between","Intersection","intersection","Any","hasAny","NotAny","notAny","In","InM","inM","Includes","Excludes","AnyIn","anyIn","HasNoAny","haNoAny","All","all","AllIn","allIn","ODataFilterBuilder","predicates","globalServiceGroupFilter","stringColumns","stringSearch","isOptionalServiceGroup","filter","stringValue","p","concat","bookitColors","base","black","white","grayscale","blackRegular","blackComponents","graySubtitles","grayComponents","grayComponentsLight","grayBorders","graySelection","graybgComponents","grayBackground","grayBackgroundLight","overlays","overlayBlack","overlayWhite","primary","dark","hover","regular","components","componentsLight","borders","disabled","bgHover","background","bgLight","secondary","violet","danger","success","warning","UserProfile","settings","savedSettings","sett","find","index","Key","defaultSetting","Value","Enabled","Selected","UserName","Name","AdGroup","DefaultGroups","IsMultiple","StaffEnabled","comparator","selectSlice","state","appSettings","initialState","selectAppSettings","createSelector","selectKnownModules","Modules","selectKnownModule","knownModules","includes","selectDateFnsLocale","Globalization","Locale","selectUseAmPm","UseAmPm","selectSystemFirstDayOfWeek","selectWebVersion","WebVersion","selectUploadFileSizeLimit","UploadFileSizeLimit","selectMinimizedBookitlabLogo","MinimizedBookitlabLogo","defaultForbiddenFileExtensions","selectForbiddenFileExtensions","ForbiddenFileExtensions","selectLastCodeUpdate","LastCodeUpdate","selectAppTimeZone","TimeZone","selectPublicUrl","PublicBaseUrl","appendTrailingSlash","selectRegisterUserGroup","DefaultRegistrationGroup","selectOffsetDate","timeZone","systemOffset","TimezoneOffsetMinutes","correctDate","currentDateOffset","getTimezoneOffset","selectEmailFromAddress","UserRegistersToSpecificCores","UserRegistersToSpecificCoresType","UserRegistersToSpecificCores_NA","EmailFromAddress","selectExistingImages","ExistingImages","selectAuthenticatedUserObject","authenticatedUser","selectAuthenticatedUser","AuthenticatedUser","constructAuthenticatedUser","selectAssetFieldSettings","pickBy","AssetFieldSettings","IsPublic","selectAssetPopupSettings","assetFieldSettings","entries","Visible","DisplayName","selectIsFullScreen","isFullScreen","selectLoading","currentLanguage","isAuthenticated","loadingAppSettings","loadingSiteMapSettings","loadingUserProfileSettings","loadingSystemSettings","loadingAuthenticatedUser","selectLoadingUser","selectNotifications","notifications","selectGlobalSettingsObj","systemSettings","selectglobalSettings","GlobalSettings","selectGlobalSetting","globalSettingsObj","trim","AllowedSettings","selectImageExist","image","existingImages","some","selectGlobalSettingBool","selectSiteMapSettings","siteMapSettings","selectSiteMapProvider","siteMapProvider","SiteMapProvider","selectEventsCount","eventsCount","selectEventsCountLoading","loadingEventsCount","selectUserProfileSettings","userProfileSettings","selectUserProfileSetting","GetSettingByKey","selectIsSubBarCollapsed","isExpanded","subBarCollapsed","selectIsAuthenticated","updatedUserProfileSettings","selectIsExpandedSideBar","updatedExpandState","isMobile","expanded","GetSideBarExpanded","selectGlobalServiceGroupFilter","topServiceGroupsIsHidden","selectShowGlobalServiceGroupFilter","showGlobalServiceGroupFilter","selectShowGlobalServiceGroupsAsList","showGlobalServiceGroupsAsList","selectBarcodeScanTarget","barcodeScanTarget","selectShowAllCores","showAllCores","selectReservationStatuses","KnownModules","UserGroupCoordRole","AllowWorkflowBooking","MultipleTentativeReservationsUnderWorkflowBooking","DraftReservationsEnabled","t","GetListItem","ReservationStatus","list","Approved","Pending","PendingCoord","Cancelled","CancelledByAdmin","Tentative","Draft","URLSearchParamsCI","params","URLSearchParams","append","delete","get","other","b","GetRawValue","setisInversedForUrl","isInversedPrefix","findIsfilterInversed","search","startsWith","isFilterInversed","definedVal","hasprefix","substring","GetNumberOrUndefined","rawValue","number","GetStringOrUndefined","getStringUnionOrUndefined","unionArray","toLocaleLowerCase","GetBooleanOrUndefined","GetDateOrUndefined","type","parseQueryStringDate","GetPartialEntity","id","GetEnum","enumObject","enumToEntityArray","numValue","tryParseInt","item","GetBooleanEntity","Yes","No","initPickerValue","additionalOptions","additionalItem","option","Promise","resolve","failureResult","data","verifiedData","initExPickerValue","sourceUrl","withoutServiceGroups","initMultiExPickerValue","separator","serviceGroups","ids","additionalItems","every","initMultiPickerValue","getPeriodTypeNameOrUndefined","lowered","namedValue","ALL_PERIOD_TYPES","num","getDefaultFilterDatePeriod","periodTypeFieldName","customStartFieldName","customEndFieldName","periodType","isNullOrUndefined","PresetDatesRange","Custom","fromType","presetDatesRangeToQueryString","formatQueryStringDate","getDefaultFilterNumberPeriod","NumebersRangeToQueryString","startFieldName","endFieldName","formatQueryStringDateValue","serializeValue","defaultSerializer","arrayToQueryString","stringValues","arrayByNameEntityNumberToQueryString","getStringEntityArray","allSearch","splitFilterValue","allEntities","getNumberEntityArray","getNumberEntityArrayFromString","assetRangeSerializer","fieldname","isAssetRangeType","unitType","getAssetRange","valOrNull","parseFloat","getSplitNumberArray","indexOf","joinArray","axios","defaults","baseURL","process","timeout","isStatusOK","status","httpClient","cancelToken","CancelToken","url","response","config","put","post","patch","payload","requests","r","rootedPathWithSearch","toRootedURL","pathName","method","atomicityGroup","URL","window","location","origin","headers","uniqueId","body","responses","urls","batch","file","formData","FormData","responseType","Accept","Icon","React","ref","icon","color","colorExtend","info","props","iconName","theme","useTheme","defColor","getColor","WithTitle","children","title","FormRightSection","isCover","DetectIsMobile","sidePanelExpanded","useSelector","selectExpandedSidePanel","sidePanelOpen","selectSidePanelOpen","showShortView","className","clsx","shortView","StyledForm","onSubmit","avoidStyles","sectionStyle","noPadding","skipShortView","StyledFormFieldsContainer","SettingsApi","$select","names","enumStringKeys","$filter","doPrefetchConfigurableColumns","select","authSet","ScreensId","CoresDirectory","ReservationHistory","UserTraining","m","Instruments","UpcomingTrainingSessions","ServiceRequests","MyAssets","Alerts","MaintenanceAssets","noAuthSet","PublicAssets","screenId","GetCachedConfigurableColumnsData","ConfigurableTypes","ColumnScreenConfig","getAppSettings","getAuthenticatedUser","doSetIsAuthenticated","setLanguage","getSiteMapSource","doNavigate","getEventsCount","getUserProfileSettings","getSystemSettings","getLoginSystemSettings","updateUserProfileSettings","doUpdateExpandedState","doLoadGlobalServiceGroupFilter","doSaveGlobalServiceGroupFilter","doSaveUserProfileSetting","doSaveFilter","doSavePageSize","doSaveCardsMode","doUpdateMyListSelected","doBarcodeScan","handleFullScreenChange","doEnterFullScreen","doExitFullScreen","doSetBarcodeScannigTarget","doShowAllCores","doCollapseSubBar","doAgreeTermOfUse","getAppSettingsFromSaga","action","call","actions","appSettingsLoaded","changeLanguage","loadSystemSettings_Success","noAuthSettings","loadError","message","user","LoginType","LoginTypes","Password","getAuthenticatedUser_Success","Roles","LargeAnimalsOperatingRoomTechnician","internalIdLoginActions","setIsAuthenticated","replace","getAuthenticatedUser_Error","IsAuthenticatedChanged","language","l","i18next","setLocale","languageChanged","siteMap","loadSiteMapSettings_Success","debug","loadSiteMapSettings_Error","href","count","loadEventsCount_Success","loadEventsCount_Error","delay","loadUserProfile_Success","loadUserProfile_Error","loadSystemSettings_Error","loadLoginSystemSettings_Success","loadLoginSystemSettings_Error","withDelay","GetSettingByKeyOrDefault","assign","model","requestURL","updateUserProfile_Success","updateUserProfile_Error","updateExpandedState_Success","updateExpandedState_Error","loadGlobalServiceGroupFilter_Success","selection","addNotification","variant","SwitchedTo","httpPaload","equals","navigate","updateMyList","MIN_LENGTH_DEFAULT","MinBarcodeLength","minBarcodeLengthString","scannTarget","ScanTarget","BarcodeScanModalBody","scanResult","parseBarcode","BarcodeNotFoundEx","ScanTemplateResult","Asset","Internal","External","InternalCode","getRoomByExternalBarcode","roomId","roomid","barcode","$top","document","fullscreenElement","enterFullScreen_Success","exitFullScreen_Success","selector","documentElement","querySelector","fullScreenElement","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","fullScreenExitFunction","exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen","barcodeScannigTarget_Success","setShowAllCores","setCollapseSubBar","TermsOfUseAgreementApi","agreeTermsOfUseAgreement","ErrorMessages","takeLatest","loadAppSettings","loadSiteMapSettings","loadEventsCount","loadUserProfileSettings","updateExpandedState","loadGlobalServiceGroupFilter","saveGlobalServiceGroupFilter","saveUserProfileSetting","saveFilter","loadSystemSettings","loadLoginSystemSettings","savePageSize","updateMyListSelected_Local","BARCODE_SCANNED","saveCardsMode","fullScreenChannel","eventChannel","emitter","addEventListener","removeEventListener","takeEvery","takeLeading","enterFullScreen","exitFullScreen","setBarcodeScannigTarget","collapseSubBar","agreeTermOfUse","notificationsCount","slice","createSlice","reducers","Language","findIndex","splice","addNotifications","removeNotification","array","keyFn","upsert","itemIndex","updatedItem","userNodes","ChildNodes","flat","element","reactUrl","pathname","Url","ss","LoginScreenCompanyLogo","LoginScreenCompanyLogoLink","LoginScreenCompanyLogoHeight","ShowForgotPassword","Help_Login","updateExpandedState_Local","saveGlobalServiceGroupFilter_Success","setShowGlobalServiceGroupsAsList","enterFullScreen_Error","exitFullScreen_Error","barcodeScannigTarget_Error","appSettingsActions","useAppSettingsSlice","useInjectReducer","reducer","useInjectSaga","saga","Button","processing","size","component","to","dispatch","useDispatch","appActions","absolutePath","path","handleClick","onClick","toto","toLocationDescriptor","disableRipple","disableFocusRipple","disableTouchRipple","event","capitalize","startIcon","endIcon","H1","H2","H3","H4","Body","bold","bodyVarian","Caption","captionVarian","Uppercase","Tips","tipsVarian","InputLabel","inputLabelVarian","InputValue","inputValueVarian","ButtonLabel","buttonLabeVarian","isAbsoluteURL","urlString","schema","query","cpath","tryCleanASPRoot","rootedpath","isRooted","basePath","trimEnd","trimStart","combine","toQueryString","buildURL","endsWith","useAbsolute","toPath","publicUrl","getExportParameters","$format","getExportForImportParameters","openExportLinkOld","open","openExportLink","cd","filename","fileDownload","odataUrlPrefix","getReturnURL","defaultReturnURL","returnURLKey","downloadFile","decodeURIComponent","defaultFileName","getFileName","defaultName","anonimusUrls","parseBarcodeURL","assetScanned","regExpTemplate","AssetBarcodeRelativeUrlTemplate","toCompareUrl","internalCode","regObject","RegExp","exec","groups","resUrl","parseAssetUrl","subLocationScanned","SubLocationBarcodeRelativeUrlTemplate","subLocationId","locationId","RoomId","locationid","sublocationid","SubLocation","LocationId","SubLocationId","parseSubLocationUrl","locationScanned","LocationBarcodeRelativeUrlTemplate","Location","parseLocationUrl","roomScanned","RoomBarcodeRelativeUrlTemplate","Room","parseRoomUrl","external","lazyLoad","importFunc","selectorFunc","opts","fallback","lazyFactory","then","module","LazyComponent","lazy","RenderPageType","IconButton","shape","target","stopPropagation","doOpenSidePanel","doOpenAdminPanel","layoutSaga","selectHasNotSavedChanges","isChangesNotSaved","setContinueState","continue","setConfirmOpen","resetSidePanel","setTuggleOpenState","selectAdminPanelOpen","resetAdminPanel","setAdminPanelUrl","setAdminPanelOpen","openSidePanel","openAdminPanel","sidePanelState","pageType","pageProps","coverOpen","coverExpanded","confirmState","confirmOpen","approved","rejected","showLocalConfirm","continueToLink","hasAnyNotSavedChanges","doRefreshTable","continueState","continueOnApprove","hideNavigation","actionTableProcessing","upsnackbarIndex","isMobileView","adminPanelState","adminPanelOpen","toggleSidePanel","setPageType","setPageProps","setExpanded","resetConfirmState","setConfirmApproved","setConfirmRejected","setContinueToLink","setNotSavedChanges","setRefreshTable","setActionTableProcessing","setLocalConfirm","setContinueOnApprove","setHideNavigation","resetContinueState","setUpSnackBarIndex","setIsMobileView","setIsCoverOpen","setIsCoverExpanded","layoutActions","useLayoutSlice","Box","layout","selectSidePanelState","selectPageType","selectPageTypeProps","selectConfirmOpen","selectConfirmApproved","selectConfirmRejected","selectDoRefreshTable","selectContinueState","selectContinueToLink","selectHideNavigation","selectSnackBarIndex","selectIsMobileView","selectActionTableProcessing","selectProcessingIndicator","methodName","selectIsCoverOpen","selectIsCoverExpanded","selectAdminPanelUrl","EnumAssetTypes","IsBudgetFieldEnabled","setting","BudgetField","BudgetFieldSettings","bf","Disabled","IsModuleEnabled","IsAssetFieldEnabled","AssetField","AssetAvailabilityType","AssetAttributes","AssetTypes","IsAssetFieldIsPublic","IsAssetImageExist","imageName","imageSize","getOffsetDate","GetAssetTypeFrom","availability","AvailabilityTypes","NotAvailable","AvailableNotBookable","FreelyBookable","LoanableEquipment","ServiceRelated","ServiceGroup","SuperGroup","RequestRelated","TrainingProgram","LectureRoom","isEmptyOrWhitespace","toUndefinedIfEmptyOrWhitespace","toLowerCaseSafely","notUndefined","toNumberOrNull","keyValue","TryGet","GetString","typeEnum","getDefault","checkIsMobile","useIsMobile","GetBrowserInfo","rdd","AutocompletePicker","label","loadData","filterOptions","onChange","mini","isOpen","disableClearable","style","fullWidth","noOptionsText","required","ariaLabel","propsLoading","loading","freeSolo","handleInputChange","additionalSearchTerm","renderOptionName","getOptionLabelName","inputProps","autoFocus","autoHighlight","autoComplete","autoSelect","blurOnSelect","clearOnEscape","includeInputInList","selectOnFocus","disableListWrap","filterSelectedOptions","disableCloseOnSelect","openOnFocus","setSomeOpen","ListboxProps","useTranslation","classes","autocompleteStyles","extClasses","autocompleteExtendStyles","timerRef","firstOpen","setOpen","setOptions","searchTerm","setSearchTerm","hasSelected","setSelected","firstMounted","setFirstMounted","useEffectOnMount","handleSelectText","setSelectionRange","clearTimeout","setLoading","doload","active","rawResponse","extractDataFromResponse","optionsData","loadDataAndPrepareOptions","Autocomplete","onOpen","onPickerOpen","onClose","reason","details","multiple","onInputChange","newInputValue","getOptionSelected","getOptionDisabled","getOptionLabel","NA","renderOption","text","highlight","matches","match","parts","part","highlightSearchTerm","inputValue","root","tag","tagSizeSmall","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","paper","listbox","noOptions","groupLabel","groupUl","extendRoot","onBlur","popupIcon","closeIcon","renderInput","BaseTextField","placeholder","AllValues","helperText","onFocus","setTimeout","InputProps","CircularProgress","position","right","top","InfoIcon","infoIcon","infoWidthPlus","infoWidthMinus","Tooltip","themeColor","headTitle","arrow","interactive","popper","ServiceType","BasicTypography","italic","typographyComponentMapping","boldS","fontFamily","fontSize","fontStyle","lineHeight","fontWeight","letterSpacing","bodyS","tipsRegular","inputLabelM","inputLabelXS","inputValueS","buttonM","buttonS","bookitTypography","h1","h2","h3","h4","subtitle1","subtitle2","boldL","boldM","bodyL","bodyM","captionBold","captionRegular","uppercase","textTransform","tipsBold","inputValueM","useReducer","useSaga","MAX_TOP","getAutoCompleteLoadDataFn","idPropertyName","DisplaynamePropertyName","basePredicates","expand","transformModel","useSearchOrPredicate","queryString","maxTop","dynamicPredicates","$orderby","uniq","$expand","undefinedIfIsEmpty","more","limit","unshift","nonSelectableOptions","ShowingFirstXRecords","maxRecordsLimit","isNumber","onlyStringReducer","nums","reduce","enumToDescriptedArray","enumeration","Number","description","tryGetName","tFunction","GetTFunction","i18n","isInitialized","getFixedT","ns","defaultNS","toEntityEnumArray","prefixKey","OriginalName","GetOptionsFilterFunction","items","customSearch","enumToArray","removeHtml","tryParseWithoutNaN","tryParse","tryParseFloat","tryParseBool","isNumericPositive","test","effect","FundingTypes","RecurringReservationUpdateOptions","ReservationRepeatPeriods","ReservationRepeatMonthlyTypes","getSingleReservationStatus","useAsyncExtendedState","useState","setState","useMemo","nextState","initialNextState","mounted","partialState","initialExtendState","useSystemDate","appTimeZone","currentTimezoneOffser","getOffset","useCallback","newDate","parsedDate","getOffsetDateOrNull","localDate","withoutOffset","withOffset","ExternalLink","LinkBehavior","Link","useInlineUrl","rest","history","useHistory","useStyles","emptyLink","localPath","handleLocalPathClick","showIcon","externalLinkRoot","link","CopyURL","clipboardWrite","URLCopied","makeStyles","whiteSpace","cursor","externalLinkIcon","display","clipboardWriteEnabled","navigator","permissions","clipboard","writeText","copyResult","CoverWrapper","height","Dialog","maxWidth","coverShortRoot","hideBackdrop","scroll","disableAutoFocus","LinearProgress","styled","visible","TitleRoot","paddingTop","flexDirection","alignItems","width","gap","justifyContent","alignSelf","padding","spacing","flex","Head","closable","useSidePanel","closePanel","pageName","titlePage","pageLink","titleTooltip","disableExpandToggle","expandPanel","subTitlePage","leftTopActions","rightTopActions","showProcessing","useSwithActions","switchState","rightTopActionsLength","rightActionsLoading","actionsLength","SkeletonIfLoading","cover","aria-label","ShowLess","TitlePage","buttonsLenth","tooltip","Skeleton","backgroundColor","ReactActions","ot","ind","keepOpen","SwitchActions","getProps","Close","ShortTitleRoot","ShortHead","toPageLink","rightTopActionsAsMenu","useShortView","hideMenu","topIconsLength","absolutePageLink","toExpandPanel","CloseSidePanel","TopButtonsContainer","ButtonsPanel","leftActions","rightActions","leftActionsMaxLength","MoreOptionsMobile","iconVariant","paddingInline","TopButtonsPanel","maxLeftTopButtonsLength","leftActionsLoading","getRandomWidth","Math","random","toFixed","ButtonsSkeleton","FormSkeleton","overflow","fullPage","PageWrapperRoot","minWidth","overflowY","boxShadow","palette","common","borderRadius","marginBottom","bookitShadows","shadowBorderTop","flexShrink","flexGrow","PageWrapper","closeSidePanel","confirm","closeCover","useSwitchActions","topProcessing","hideTitleBar","coverClosed","isCoverOpen","collapsedBar","showGroups","isCovered","isCoverClosed","setIsCoverClosed","covered","baseRootUsePanelHeight","baseRootUsePanelShortHeight","baseRootHeight","subBarExpanded","baseNavigationHeight","contentRoot","contentMobRoot","assertExhaustive","offlineServiceState","selectProcessing","selectInitConsumablesProcessing","consumablesProcessing","selectService","detailsState","selectServiceHasError","hasErrors","selectServiceCompleted","completed","selectConnectedInitState","connectedDataState","selectServiceChangeState","serviceChangeResultState","selectFieldHandler","valueHandler","selectCreditState","creditState","selectCredit","selectCreditProcessing","selectCreditCompleted","selectHasCharges","hasCharges","selectConsumablesState","consumablesState","selectSavedReservationService","savedReservationService","selectConsumablesData","selectConsumablesHasErrors","selectConsumablesCompleted","selectConsumablesValueHandler","consumablesValueHandler","selectSelectedServiceType","selectedServiceTypes","selectEditCreatableService","editCreatableService","selectBarcodeScanned","barcodeScanned","selectRefreshConsumableServices","refeshOfflineServices","selectStockRenewalsState","stockRenewalState","selectStockRenewalProcessing","selectStockRenewalData","selectStockRenewalHasErrors","selectStockRenewalCompleted","selectStockRenewalValueHandler","stockRenewalValueHandler","selectRenewStockState","renewStockState","selectRenewStockProcessing","selectRenewStockData","selectRenewStockHasErrors","selectRenewStockCompleted","selectRenewStockValueHandler","renewStockValueHandler","selectIsEdit","isEdit","selectInventoryBatchState","inventoryBatchState","selectInventoryBatchProcessing","selectInventoryBatchData","selectInventoryBatchHasErrors","selectInventoryBatchCompleted","selectInventoryBatchValueHandler","inventoryBatchValueHandler","selectInventoryBatchIsEdit","batchIsEdit","selectInventoryBatchEditable","inventoryBatchEditable","selectCreatableService","getCreatableService","reservation","selectReservationState","selectReservation","selectReservationProcessing","selectReservationHasError","selectReservationCompleted","selectReservationData","selectReservationSettings","reservationSettingsState","selectEquipmentsSettings","equipmentsSettingsState","selectConfirmAssistedReservations","confirmAssistedReservations","selectUserTrainingData","trainingsData","selectRequestedValueFor","requestedValueFor","selectEquipmentChangeState","requestedValue","equipmentChangeResultState","selectEquipmentChangeCompleted","isChangeCompleted","selectAsyncChangeLoading","asyncChangeLoading","selectTransferState","transferState","selectTransferProcessing","transferProcessing","selectTransferStepCompleted","transferStepCompleted","selectTransferToUser","User","selectTransferReservation","ReservtionId","selectTransferWaitingApproval","WaitingTransferApproval","selectSavedOfflineServices","savedOfflineServices","selectRefreshOfflineServices","refeshOfflineService","selectTerminateState","terminationState","selectTerminateProcessing","terminatProcessing","selectTerminateCompleted","terminateCompleted","selectCloneReservations","cloneReservation","selectReservationDtoState","reservationDtoState","selectSavedForLater","SaveForLater","selectIsCreditSubmited","submitCredit","selectByApprovalErrors","ByApprovalErrors","selectUserCanRequestApproval","userCanRequestApproval","selectRefreshWorkOrderLink","refreshWorkOrderLink","selectReservationNotFound","notFound","FormTextField","useField","meta","ExportTypes","createSliceOriginal","EntityNumberSchema","Yup","ensure","EntityStringSchema","CheckEntityShema","defined","checked","inventoryBatchesSchema","of","ServiceGroupEntitySchema","ServiceGroupId","ServiceTypeId","Active","HideProjects","IntQuantityOnly","UnitTypeID","nullable","UnitTypeName","AllowToUser","Inventory","DefaultQuantity","notRequired","ReservationOverlappingInventory","IsAdmin","AllowedBudgets","StaffOnly","BudgetsTurnedOn","NotLessThanZero","TrackInventory","InventoryBatchesEnabled","InventoryBatches","BudgetEntitySechema","BudgetExperimentEntitySechema","InstituteProjectEntitySechema","PaymentMethodEntitySchema","UserEntitySchema","OnlineServiceEntitySchema","OfflineServiceTypeEntitySchema","FeeTypeEntitySchema","UserGroupEntitySchema","ServiceTypeSchema","TopActionButton","customIcon","noChangeOnMobile","isIconButton","starticon","endicon","useSidePanelState","onConfirm","onReject","confirmRejected","confirmApproved","continueToOther","continueLink","setCover","setCoverClosed","onCloseCover","showConfirm","openPanel","renderPageType","renderPageProps","DialogConfirm","confirmButtonLabel","cancelButtonLabel","onCancel","subtitle","confirmTitle","managedState","dialogRootClassName","disableBackdropClick","handleClose","handleConfirm","btnActions","Confirm","Cancel","isopen","PaperProps","ColumnTypesArray","ServiceRequestTableColumn","columnDto","isAdmin","IsColumn","Options","ColumnType","isRequired","Label","Index","Required","ParentId","SizeLimit","Description","DisplayType","CopyPrevValues","CustomRoles","UserSelectionType","FixedRoles","Parent","Children","isColumnRequired","createOptions","parentFieldName","getParentFieldName","parent","getFieldName","columnId","ServiceRequestTableColumnsCollection","columnsData","VisibleToAdminOnly","columnsObj","columns","column","keyBy","AssignParent","requestSamples","selectRequestSamples","selectServiceRequestStatuses","ServiceRequestStatuses","selectServiceRequestRowStatues","ServiceRequestRowStatuses","selectSubmitting","submitting","selectServiceRequestStatusesByInternalId","serviceRequestInternalStatus","InternalStatusId","selectServiceRequestId","serviceRequestId","selectRequestDetails","RequestDetails","selectCommentIsInternal","CommentIsInternal","selectRequestDetailsData","selectServiceRequestCustomForm","FormValues","selectServiceRequestCustomTable","Rows","selectServiceRequestFormData","formValues","rows","selectRequestDetailsFieldsState","fieldsState","selectServiceRequestDetailsFieldState","Service","selectStatus","Status","selectCreatedFor","CreatedFor","selectIsServiceRequestAdmin","isOwner","isEditable","Administrators","IsAdminOf","ServiceId","Sample","internalStatusId","selectSamplesTableState","SamplesTableState","selectSamplesData","RequestSamples","selectImportState","ImportState","selectSelectedSamples","SamplesSelected","selectCustomForm","CustomForm","selectCustomFormFields","FormFields","selectServiceRequestCustomFormColumns","customForm","selectServiceRequestCustomFormFields","selectServiceRequestMilestones","Milestones","selectServiceRequestMilestoneProcessing","milestoneProcessing","selectServiceRequestSidePanel","SidePanel","ServiceRequestRows","fromDtoValue","formValueDto","tryFormatIso","DisplayValue","selectServiceRequestRowInsertStatus","createServiceRequestRowStatus","styles","createStyles","zIndex","left","RepetitiveOptions","RepeatPeriod","RepeatMonthlyBy","GetRepetitiveOptions","dayName","getDayText","weekName","WorkWeekDays","getWeekNumberOfMonth","weekDays","getLongDaysArray","RepeatWeeklyOn","RepeatMonthlyOn","RepeatEveryWeekDay","BaseOptionsPicker","getOptions","createFilterOptions","ignoreAccents","ignoreCase","stringify","FormikField","fullRow","hide","minRow","FormikSection","fields","order","avoidRenderSection","titleSection","FormListener","onFormChange","useFormikContext","setFieldValue","isValid","dirty","setFieldTouched","validateField","setFieldError","validate","SubmittingHandler","resetSubmitting","setSubmitting","FieldHandler","run","fieldKey","fieldValue","shouldValidate","resetFieldState","additionalFunc","useFieldChangeHandler","changeField","FieldValue","setValue","resetValueKey","getFieldMeta","getPeriodTypesEntity","valueType","getPeriods","getPeriodTypesEntityById","SnackBarActionType","SnackBarMessageType","Handlebar","sanitizeHtml","customFormAst","template","compileHandlebarsTemplate","ast","ReplaceMutatingVisitor","accept","replacementStatement","_replacementStatement","_path","mutating","mustache","original","ExtractPathsVisitor","paths","scheduler","selectScheduler","selectEvents","events","selectSchedulerOfflineHours","viewState","offlineHours","selectTrainingSessions","trainingSessions","selectSchedulerViewState","selectSchedulerDateTs","selectSchedulerViewType","viewType","selectNonWorkingHours","nonWorkingHours","selectSchedulerTempEvents","tempReservations","selectLoadedServices","selectedServices","selectSchedulerServicesLimit","services","globalSettings","limitKey","limitString","selectSchedulerFilters","filters","selectWithReservationsOnly","selectSchedulerServicesLimitReached","limitNumber","selectSchedulerSelectedServices","selectSchedulerDerivedServices","derivedServices","selectMappedReservations","mapEvents","reservation_id","start_date","StartTime","end_date","EndTime","EquipmentColor","service_id","EquipmentId","service_name","EquipmentName","selectMappedOfflineHours","offline","alert_id","AlertId","offline_id","selectMappedTrainingSessions","ReservationId","trainingsession_id","selectMapped","selectSchedulerParseEvents","mappedEvents","TrainingSignUp","readonly","notClickable","canEditReservation","Online","UserId","BookedById","Restricted","allowedToViewAlert","ReportedBy","_no_resize_end","_no_resize_start","_no_drag_move","selectSchedulerServices","WithReservationsOnly","servicesWithEvents","Set","service","has","filterServicesByEvents","serviceGroupIds","filterServicesByServiceGroups","selectSchedulerPreviousViewState","previousViewState","selectMultipleModeState","MultipleInstrumentReservations","selectSelectedSavedView","multipleInstrumentsSetting","currentSelected","userProfile","NotAllowed","instrumentMultipleEnabled","GetSettingValueBy","Multiple","AllowedDefaultMultiple","selectSchedulerViewStartDate","getViewStartDate","viewLength","customStart","selectSchedulerViewEndDate","getViewEndDate","customDays","selectSchedulerViewCustomStart","selectNotUseLocation","notUseLocation","selectEmptySlotAdminClick","emptySlotAdminClick","selectSchedulerNewEventServices","tempReservation","getSingleServiceEventServices","selectTwoDaysTimelineButtonEnabled","GetBoolean","selectCustomDaysTimelineButtonEnabled","selectSelectedReservationEvents","selectedReservationEvents","selectDefaultCustomDaysTimelineValue","daysString","selectIncludeCustomFormInSchedulerReservationTooltip","IncludeCustomFormInSchedulerReservationTooltip","selectSchedulerReservationBodyTemplate","SchedulerReservationBodyTemplate","selectSchedulerReservationTooltipTemplate","SchedulerReservationTooltipTemplate","selectCalendarReservationColumns","EquipmentAssemblies","schedulerReservationBodyTemplate","schedulerReservationTooltipTemplate","equipmentAssemblies","allowWorkflowBooking","includeCustomFormInSchedulerReservationTooltip","pathExtractor","reservationHistorySelectArray","union","selectSchedulerLoadingEvents","loadingEvents","selectTimelineGroupBy","groupBy","selectExportToPDF","exportToPDF","RequiredTypes","DisplayTypes","formFileSchema","Size","PostedFile","formValueSchema","FormFieldId","Readonly","SourceValueId","AlertTypeId","CustomFormId","CustomFormName","RequestId","ExperimentItemId","BudgetExperimentId","ServiceGroupUserId","ParseFormFieldEnums","formFields","ff","DeserializeValue","formField","formValue","Type","ddlValue","getDropDownInitValue","SerializeValue","objects","members","object","member","instanceOfIFormValueType","fileValue","getSerializableIsRequired","getFieldSchema","fileSize","notAllowedExt","when","RequiredFieldToCompare","DependencyFieldId","is","context","exclusive","min","files","blockedTypes","lookup","allowedExt","getCustomFormDateSchema","email","max","singleResult","multipleResult","RequiredValueToCompare","comparedValue","getParentValue","isDependencyVisible","DependencyValue","valueTocompare","parentValue","DependencyMultiple","DependencyVisibility","vp","pv","vf","hasOwnProperty","getFieldsVisibilities","visibleOnCompletion","visibilities","visibleOnComletion","AlwaysVisible","VisibleToUserOnDoneRequest","isVisible","useCustomFormSchema","getCustomFormInitialValues","startQuiz","initialValues","orderFields","next","serializeValues","serialized","serializeCustomFormRowValue","getCustomFormColumnSchema","baseSchema","integer","getCustomFormColumnBaseSchema","noExpandURlTypes","fullActiveUrl","adminsUrl","relevantUrl","budgetExperimentsUrl","initUserData","urlType","$skip","initUrl","UserPicker","servicegroups","withGroupFilter","selectArray","AllUsers","ServicesFilter","budgetExperimentEnabled","userGroupId","budgetId","defaultBudgetEnabled","isDefaultSelected","HideProject","AdminServicesFilter","serviceItems","groupIds","groupsF","servF","initAssigneeAdminUsers","AssignedToCoreAdmin","AssignedToInstrumentAdmin","AssignedToLabTech","reject","usePromise","asyncFunction","isCancelled","useRef","isUnmounted","callAsyncFunction","promise","cancel","fulfillPromise","reset","stateWithReset","useEffect","shortDateTimeFormat","DatesRange","fromPreset","st","et","doInit","doLoadRequestDetails","doRefreshRequestDetails","doLoadFormValues","doSaveFormValue","doLoadSamples","doLoadServiceRequestRows","doLoadMilestones","doCreateSample","doUpdateServiceRequestSampleField","doUpdateServiceRequestRowValue","doImport","doDeleteSamples","doPatchRequestDetails","doUpdateStatus","doUpdateServiceRequestRowStatus","doUpdateBudget","doUpdateGradient","doUpdateOverheadMinutes","doUpdatePurchaseOrder","doUpdateExternalInternalNumber","doUpdateFundingType","doSubmit","putErrorMessages","doCancelServiceRequest","doInsertMilestoneCharge","doDeleteServiceRequestMilestoneCharge","doUpdateMilestoneCharge","doInsertMilestone","doDeleteMilestone","doUpdateMilestone","doCloseSidePanel","doCloneServiceRequest","doCreateServiceRequestRow","doLoadServiceRequestRowStatuses","requestSamplesSaga","statuses","initServiceRequestStatuses_Success","SampleManagementTables","SampleManagementTablesEnabled","requestDetails","loadRequestDetails_Success","omit","loadFormValues","pageIndex","pageSize","RequestMilestones","requestMilestones","MilestonesAddonsType","loadMilestones","InvoiceId","requestblockedbyinvoice","loadRequestDetails_Error","refreshRequestDetails_Success","valuesObject","loadFormValues_Success","warn","currentTableState","$count","sortBy","desc","TableFilterBuilder","customFilters","globalFilter","searchColumns","loadSamples_Success","loadSamples_Error","AnErrorOccurred","Forbidden","prepareServiceRequestRowModel","loadServiceRequestRows_Success","loadMilestones_Success","createSample_Success","createSample_Error","updateServiceRequestSampleField_Success","updateServiceRequestSampleField_Error","msg","innererror","serviceRequestValue","RowId","ColumnId","JSON","updateServiceRequestRowValue_Success","updateServiceRequestRowValue_Error","uploadFile","AllRowsImportedSuccessfully","OneOrMoreErrorOccurredDuringImportPleaseReviewOutputFile","import_Success","import_Error","deleteSamples","errors","successCount","tableState","loadSamples","XRecordsWereBeDeleted","patch_Success","patch_Error","axiosError","statusText","Reason","updateStatus_Success","StatusUpdatedTo","updateStatus_Error","ServiceRequestStatusUpdate_Error","serviceRequestRowId","updateServiceRequestRowStatus_Success","Budget","updateBudget_Success","BudgetUpdatedTo","refreshRequestDetails","updateBudget_Error","Gradient","updateGradient_Success","GradientUpdatedTo","updateGradient_Error","OverheadMinutes","updateOverheadMinutes_Success","OverheadTimeUpdatedTo","updateOverheadMinutes_Error","PurchaseOrder","updatePurchaseOrder_Success","PurchaseOrderUpdatedTo","updatePurchaseOrder_Error","ExternalInternalNumber","updateExternalInternalNumber_Success","ExternalInternalNumberUpdatedTo","updateExternalInternalNumber_Error","FundingTypeId","updateFundingType_Success","FundingTypeUpdatedTo","getSingleInvoiceFundingType","updateFundingType_Error","submitStep_success","StepHasBeenSubmitted","errorMessages","getErrorMessages","submitStep_Error","isAxiosError","dataErrorMessages","RequestCancelled","ServiceRequestId","ServiceRequestMilestoneId","charge","Amount","Rate","OfflineServiceType","Quantity","OfflineServiceTypeId","Remarks","UnitTypeId","UpdatedBy","Title","UnitType","Unit","insertMilestoneCharge_Success","InsertSuccess","insertMilestoneCharge_Error","serviceRequest","deleteMilestoneCharge_Success","DeleteSuccess","updateMilestoneCharge_Success","UpdateSuccess","updateMilestoneCharge_Error","CompletionDate","Assignees","u","Charged","ServiceRequestMilestoneCharges","TargetDate","insertMilestone_Success","insertMilestone_Error","deleteMilestone_Success","requestPayload","StatusId","ServiceRequestMilestoneStatuses","updateMilestone_Success","ServiceRequestDetails","resetRequestDetails","GetServiceRequestDetailsPath","NewRequestId","messages","getv2ControllerErrorMessages","messageKey","dto","serviceRequestModelToDto","createServiceRequestRow_Success","ServiceRequestRow_InsertSuccess","ServiceRequestRow_InsertError","ExceptionMessage","Message","loadServiceRequestRowStatuses_Success","init","loadRequestDetails","insertMilestoneCharge","updateMilestoneCharge","deleteMilestoneCharge","insertMilestone","updateMilestone","deleteMilestone","updateStatus","updateServiceRequestRowStatus","updateBudget","updatePurchaseOrder","updateExternalInternalNumber","updateFundingType","updateGradient","updateOverheadMinutes","submitStep","cancelServiceRequest","createSample","debounce","updateServiceRequestSampleField","updateServiceRequestRowValue","import","cloneServiceRequest","createServiceRequestRow","loadServiceRequestRows","takeLatestByKey","saveFormValues","initServiceRequestStatuses_Error","milestoneChargeProcessing","merge","prev","dataLength","loadServiceRequestRows_Error","deleteServiceRequestRows","deleteServiceRequestRows_Success","createServiceRequestRow_Error","milestone","updateMilestone_Error","remove","row","toggleImport","setHasFiles","HasFiles","requestSamplesActions","useRequestSamplesSlice","toEntity","otherData","InvoiceFundingType","initFundingTypeData","initval","FundingTypeIdPicker","bookable","bookableAndnotbookable","servicesRelated","initAssetsData","byService","serviceTypes","admin","types","AssetsFilterForWorkOrder","orederType","Groups","AssetCats","AssetsFilterForCalibrationWorkOrder","selectedIds","AssetsFilterForSavedView","topServiceGroups","AssetsPicker","defaultValue","restrictByAvType","showOnlyActiveAssets","avFilter","getAvFilter","innerLoadData","CustomRolePermissionLevel","CustomRoleAllowePages","CultureName","UserGroups","ActiveUserGroup","AdminEquipments","AdminServiceGroups","InstrumentEventsGroups","CreatableGroups","HasRegisterableServiceGroups","FormatedName","HasNotifications","HasOptOutCoreSelection","CalendarType","RequireUserGroupCoordApproval","HasSignedTermsOfUse","IsActiveDirectory","JoinStatus","CustomRoleUrls","HasAdminGroupPermissions","HasLabTechGroupPermissions","HasAdminServicePermissions","HasLabTechServicePermissions","pages","level","CustomRole","page","rootedPage","serviceGroupId","GroupAdministrators","IsLabTech","LabTech","serviceTypeId","serviceId","EquipmentAdministrator","CreateNewAssetsAdmin","InventoryAdmin","g","IsAllAdminGroupPermissions","IsAllServicesAdmin","IsAllLabTechGroupPermissions","IsAllServicesLabTech","isInRole","role","baseRoles","odjRoles","create","bulckCreate","update","visibleColumns","get_Success","get_Error","export","getPlateTypes_Success","plateTypes","showCreate","IsRack","SamplePlateType","showBulkCreate","hideCreate","hideBulkCreate","bulkCreate","bulkCreate_SetProgress","progress","create_Success","bulkCreate_Success","create_Error","bulkCreate_Error","hideUpdate","edit","LocationName","RoomName","SamplePlateTypeId","SamplePlateTypeName","ServiceGroupName","update_Success","update_Error","delete_Success","delete_Error","deactivatePlates","deactivatePlates_Success","deactivatePlates_Error","deletePlates","deletePlates_Success","deletePlates_Error","samplePlatesActions","useSamplePlatesSlice","samplePlatesSaga","FormRichTextField","hasMentions","onChangeMentions","additionalButtons","isInvoiceTemplateEditor","extendedMode","labelOnTop","helpers","RichTextField","formikValue","autofocus","controlsVisible","setControlsVisible","Boolean","AssetLink","openAsset","useOpenAssetPopUp","ShowAssetSidePanel","pick","openPanelWithCover","assetPopupProps","identifier","AssetDetails","OpenAssetPrimaryAction","toggle","serviceType","getAssetLinkIdentifier","getAssetIdentifier","RestrictDurationUnitTypes","getViewLength","viewMode","getViewType","parseViewMode","getSchedulerViewMode","viewlength","getSchedulerViewType","datets","days","getPeriodDisplayLabel","compact","isSameYear","isSameMonth","lengthTypeToPeriodType","lengthType","viewStateFromFilter","periodTypeUnion","schedulerPreset","SchedulerDatePositionArray","periodTypeToLengthType","preset","serializeSchedulerDate","getPeriodFromViewLength","timelineColumnWidth","MatchUnitSlotToEnd","startTime","endTime","amount","dateSt","slotLength","lastCorrectEnd","diffDuration","LimitMinutes","getMinutesDiff","LimitHours","getHoursDiff","LimitDays","getDaysDiff","LimitWeeks","LimitMonths","getMonthDiff","adjustToTimeSlot","workingHours","minDuration","weekStartDay","slots","mergeDateAndTime","DayOfWeek","startSlots","startOrdered","orderBy","correctEnd","weekEndDay","endSlots","endOrdered","Progress","inProgress","marginTop","marginLeft","ConvertDtoToConnectedModel","BookedBy","UserDisplayName","UserGroup","UserGroupName","BudgetID","InstituteProject","InstituteProjectId","InstituteProjectName","ServiceDate","BudgetExperiment","BudgetExperimentName","ExternalCustomer","ExternalCustomerId","ExternalCustomerName","FundingType","Reference","ConvertModelToInsertEntity","connectedModel","ServiceTypeID","DiscountFactor","UsageId","SyncReservation","SyncUsage","Units","InventoryBatchId","InventoryBatch","InventoryBatchName","InventoryBatchAmount","ConvertModelToUpdateEntity","ConvertModelToUpdateRenewStockEntity","autoGenerateBatch","DateReceived","RenewStockInventory","AutoGenerateNewBatches","getDefaultService","Mandatory","HasCharges","getDefaultBatch","shortDateFormat","ExpirationDate","Lot","OfflineServiceTypeName","PurchaseDate","PurchasePricePerUnit","ConvertConsumablesToInsertEntity","discountFactor","remarks","savedData","InsertedAt","ServiceRate","DepartmentId","InsertedBy","Institute","InstituteId","InstituteTypeId","globalFactor","serviceFactor","ConvertRenewStockToInsertEntity","ConvertInventoryBatchToEntity","doInitDetails","doInitServiceChangeStateData","doCreate","doUpdate","doSetAnyValue","doSetConsumableValue","doSetRenewalValue","doGetCredit","doGetTotalCredit","doInitConsumables","doCreateConsumables","doSetIsBarcodeScanned","doInitStockRenewal","doCreateStockRenewals","doInitRenewStock","doCreateRenewStock","doUpdateRenewStock","doInitInventoryBatch","doCreateInventoryBatch","doUpdateInventoryBatch","doSetRenewStockValue","doSetInventoryBatchValue","offlineServiceStateSaga","hasError","api","initOfflineService","uuid","WarningMessages","SuccessMessages","IsValid","getServiceType","connectedFiltersActions","extendSettingsState","Offline","saveState","initDetails_Success","editCreatable","parameters","ServiceTypes","ADGroup","Start","BudgetId","initServiceChangeStateData","initDetails_Error","getServiceChangeState","initServiceChangeStateData_Success","initServiceChangeStateData_Error","selectConnectedFiltersData","httpPayloads","insertOtherService","responseErrors","responseWarnings","responseSuccess","messageType","openSidepanelDetails","messageTypeProps","created","itemName","OfflineService","detailsType","OtherServiceDetails","detailsTypeProps","queryParams","initialService","saveCreatable","setReservationService","createService_Success","errormessage","createService_Error","updatedService","updateOtherService","results","respErrors","updateService_Success","updateService_Error","setAnyValueSuccess","setConsumableValueSuccess","setStockRenewalValueSuccess","calculateCredit","getCredit_Success","credit","TotalCost","balance","Balance","calculateTotalCredit","getTotalCredit_Success","initConsumableServices","ConnectedFiltersInit","reservationUserGroupGroupByBudgetUserGroup","initConsumables_Success","userGroup","initConsumables_Error","Services","insertConsumableServices","itemEndName","multiDetails","createConsumables_Success","createConsumables_Error","getAssetByInternalCode","Consumables","scanedBarcode","internalId","setSelectedServiceType","setBarcodeScanned","setBarcodeScanned_Success","initStockRenewalServices","initStockRenewal_Success","initStockRenewal_Error","insertStockRenewalServices","RenewStock","createStockRenewals_Success","createStockRenewals_Error","initRenewStockService","initRenewStock_Success","initRenewStock_Error","setEditCreatableService","createRenewStock_Success","preventRefreshTable","createRenewStock_Error","updateRenewStock_Success","updateRenewStock_Error","initInventoryBatch","initInventoryBatch_Success","initInventoryBatch_Error","insertInventoryBatch","initialBatch","setInventoryBatchEditable","createInventoryBatch_Success","createInventoryBatch_Error","updateInventoryBatch","updateInventoryBatch_Success","updateInventoryBatch_Error","setRenewStockValueSuccess","setInventoryBatchValueSuccess","initDetails","createService","updateService","setAnyValue","setConsumableValue","createConsumables","getCredit","getTotalCredit","initConsumables","setStockRenewalValue","setRenewStockValue","setInventoryBatchValue","initStockRenewal","createStockRenewals","initRenewStock","createRenewStock","updateRenewStock","createInventoryBatch","ConvertDtoToModel","resetDetailsState","resetValueHandler","resetServiceChangeState","getCredit_Error","resetCreditState","getTotalCredit_Error","resetTotalCreditState","resetConsumableValueHandler","extendConsumablesData","resetConsumablesState","resetSelectedServiceType","setRefreshConsumableOfflineServices","resetStockRenewalValueHandler","resetStockRenewalState","resetRenewStockValueHandler","ConvertRenewStockToModel","resetRenewStockState","resetInventoryBatchValueHandler","resetInventoryBatchState","offlineServiceStateActions","useOfflineServiceStateSlice","SamplesList","SamplesListTableState","EditMode","ShowRunDialog","ImportStarted","ImportFinished","loadSamplesList","loadSamplesList_Success","loadSamplesList_Error","setSelectedSamples","loadAllFilteredSamples","loadAllFilteredSamples_Success","updateField","updateField_Success","updateField_Error","loadRunDetqails","loadRunDetqails_Success","RunDetails","runSelectedSamples","SelectedRunType","runType","runSelectedSamples_Success","updateRunSampleValue","Samples","rt","RUN_TYPES","k","RunType","prop","payloadWithoutId","TMT_Set","setShowRunDialog","setRunType","StandardRun","MassSpec","Labeling","setShowImportDialog","readImportFile","readImportFile_Success","record","sample","TargetPosition","TargetPlateId","TargetTubeLabel","TargetSampleType","TargetConcentration","TargetVolume","completeRun","aciton","completeRun_Success","completeRun_Error","updateRun","updateRun_Success","Instrument","SecondaryInstrument","ACQUISITION_TYPE","updateRun_Error","exportRun","toggleEditMode","samplesListActions","useSamplesListSlice","samplesListSaga","toURLSearchParams","queryStringSerializer","serializer","n","useFilters","savedFilterKey","GetFiltersDefinition","getDefaultFilter","reservedQueryStringParameterNames","getRequiredFilter","getSelectedViewFilter","enableSavedLists","savedListSettings","useCardsByDefault","getPartialResults","useSyncSearch","useSavedViewSlice","savedViewActions","useLocation","showFiltersFn","visibleFiltersFilter","rowsKey","useCardsKey","useProfileSetting","profileSettingKey","savedUrl","savedValue","updateSavedFilterValue","updateValue","parseProfileUrl","savedFilterValue","filterChange","setFilterChange","defaultSearch","getPresetFilter","isDefault","requiredSearch","savedViewId","SAVEDVIEW_SEARCH_KEY","selectSavedView","localizedFilters","getLocalizedFilters","visibleFilters","mapDefaultFilters","urlKey","depFilters","getDependencyFilters","setAppliedFilters","initFilterData","routerActions","defaultRows","setPageSize","defaultCardsMode","setCardsMode","removeEmptyFilters","newParams","savedFilter","allFilters","appliedFilters","setPageIndex","cardsMode","syncSearch","newState","currentSearch","getNextFilter","originalSearch","savedListSerializedKey","selectMyList","currentSearchString","handleFilterChange","setFilterValueCallback","getFilterValueCallback","getFilterValue","handelPageSizeChange","handelPageIndexChange","handleCardsModeChange","isCardsMode","defaultFilters","setDefaultFilters","getDefaultFilters","allfilters","setFilterValue","onModeChange","notNullable","notDefault","withSavedHistoryT","Component","onFilterChange","availableFilters","onPageSizeChanged","onPageIndexChanged","getIgnoredSearch","ignore","variantComponent","standard","StandardInput","filled","FilledInput","outlined","BaseField","FormHelperTextProps","hiddenLabel","InputLabelProps","inputRef","focused","multiline","rowsMax","rowsMin","SelectProps","inputMore","shrink","notched","displayRequired","native","requiredPlaseholder","helperTextId","inputLabelId","InputComponent","sizeClass","InputElement","aria-describedby","noLabel","LabelElement","htmlFor","withLabel","labelId","withStyles","DropDown","onMouseDown","menuChildren","menuProps","addChevron","onHandleClose","iconButton","disablePortal","anchorEl","setAnchorEl","marginThreshold","anchorOrigin","handleOpen","currentTarget","aria-controls","aria-haspopup","getContentAnchorEl","MenuListProps","dense","container","vertical","horizontal","transformOrigin","DateRenderer","ArticleStatus","selectConnectedFilters","connectedFilters","selectConnectedFieldHandler","connectedValueHandler","selectConnectedSettings","connectedSettings","adminUrl","reservableUrl","initOnlineServicesData","sourceurl","OnlineServiceMultiPicker","OnlineServiceSinglePicker","RestrictedByAdminFilter","ServiceGroupIds","IsAdminPanel","ServiceGroupFilter","CommentReferenceTypes","FormLabelText","html","StyledInfo","TrainingState","OtherServicesApi","otherService","otherServices","rowId","deleteService","deleteCustom","isBudgetsTurnedOn","offlineServiceTypeId","calculateCreditModel","getReservationOfflineServices","reservationId","repeat","deleteInventoryBatch","loadOfflineServiceData","selectWorkOrder","workOrder","selectWorkOrderProcessing","selectCreateWorkOrderProcessing","createState","selectUpdateWorkOrderProcessing","updateState","selectCreateWorkOrder","selectUpdateWorkOrder","selectCreateWorkOrderCompleted","selectUpdateWorkOrderCompleted","selectCreateWorkOrderHasError","selectUpdateWorkOrderHasError","selectSendEmailOnResOffline","sendEmailOnOffline","selectReservationOffline","reservationOffline","selectReservationOfflineData","selectReservationOfflineProcessing","selectReservationOfflineCompleted","selectReadonlyWorkOrder","readonlyState","selectUpdateAllRecurrent","updateAllRecurrent","selectOfflineEventStart","OfflineEventStart","selectOfflineEventEnd","OfflineEventEnd","selectSaveNewComments","doSaveNewComments","selectCreatedOrders","createdOrders","selectSavedLinkedOrders","savedLinkedOrders","selectLinksProcessing","calibrationsChanged","linksProcessing","selectDowntimeOverlaps","downtimeOverlaps","TextControlField","startIconComponent","endIconComponent","startAdornment","FormNumberField","noWarnOnNuN","customChange","ImportAdditionalData","ImportResult","PurchaseOrderOptions","entity","initAssetRangeData","initUnitTypeData","assetRangeCustomFilter","filterBySelectedUnit","SourceUnits","sourceFilter","unit","rate","ConversionRate","TargetId","TargetUnits","targetFilter","assetRangeDisplay","AssetRangeFilter","customData","stateValue","handleOnChange","PleaseSelectRangeUnitType","hasDeps","SortByComparer","ServiceGroupsComparer","columnsComparer","accessor","ColumnAccesorsComparer","REQUEST_CANCELLED_MESSAGE","defaultRowIdAccessor","BasicTable","additionalColumns","getRowId","useExport","rowActions","inlineRowActions","pageActions","screenName","selectedRowsActions","filterOpen","customParams","useImportLink","importLink","importHandler","needRefresh","ServiceGroupsOptional","topAlertMessage","expandedColumns","floatingTabSettings","useExportForImport","customEmptyTableSettings","exportForImportFilterKey","printing","tableContainerSyles","initComplete","dataState","setDataState","extendDataState","doRefresh","setTableState","handleChangeState","serviceGroupsCompared","useCustomCompareMemo","additionalColumnsCompared","columnsCompared","useConfigurableColumns","configurableColumns","handleConfigurableColumns","configCompleted","refreshConfigurableColumns","getDisplayColumns","calculateColumnAccessors","columnAccessors","getColumnAccessors","getAllAdditionalColumns","flatMap","deps","customFilter","useMemoFilters","fetchData","oDataParams","buildParams","getUrlAndParams","controlledPageCount","ceil","titleKey","cancelTokenSource","source","allAdditionalColumns","columnsConfig","isFetchReady","globalFilterValue","token","handleExportClick","TryGetExportColumns","exportColumnAccessors","tableParams","exporturl","getAllFilteredRows","allRowsSelected","setAllRowsSelected","toggleAllRowsSelected","handleRefresh","reloadConfigurableColumns","useRowSelect","selectedRowIds","refreshFromState","TableSkeleton","ControlledTable","compactTable","onChangeState","onExport","pageCount","initialPageSize","onDownloadTemplate","onSelectedRowsChange","subHeader","onRefresh","onConfigurableColumns","useGlobalFilter","imageSrcKey","allowCards","primaryAction","withToolBar","tabSectionSettings","isRowSelectable","onSelectedChange","hideMenuOnMobile","viewCardsCheck","cardSize","cardPosition","useConfigurable","customToolbarSettings","preventInnerClicks","getAllFilteredRowsCallback","hideFilters","baseTableActionsOnToolbar","screenNameVariant","customExpandMenu","customScreenName","showGlobalSearchIconOnToolbar","toggleGlobalSearchIcon","importMenuItems","isContentEditable","tablePaddingVariant","minCardHeight","useMobileOrientation","orientation","isLandscape","isPortrait","innerWidth","breakpoints","md","ReservationsApi","initReservation","insertReservation","updateReservation","getReservation","getReservationUserTrainingEquipments","hasAnyFirstReservations","getEquipmentsChangeState","getValidationState","getReservationSlots","validateDuration","validatePrerequisite","validatePermissions","changeStatus","getEquipmentsData","createTraining","reservations","HasFutureReservationsHttp","equipmentNames","transferReservation","sendTransferNotification","sendCancelTransferNotification","cancelTransferReservation","sendTerminateNotification","ReservationIds","hasUsage","resId","eqid","eqId","endUsage","sids","quantity","userCanBookEquipment","equipmentid","RenderTypes","AllowedToRender","renderType","asset","AllowedByRolePermissions","AvailableByServiceType","AvailableByAvailabilityType","Availability","AddToList","AddWorkOrder","OpenCalendar","OpenTimeline","OpenWorkOrder","OpenWorkOrders","NewReservation","DownWorkOrder","BringBackUp","ExportQRCodes","PrintAssetLabels","CloneEquipments","DownloadImages","ExportForImport","serType","availabilityType","avType","StyledMenuItem","button","MenuItem","HoverActions","popupState","usePopupState","popupId","buttons","anchorRef","bindHover","bindMenu","close","ClickableActions","bindTrigger","Menu","closeAfterTransition","hoverMenu","nonEmptyItems","SelectedRowsActionIconButton","snackBarMessageType","confirmBody","variantButton","updateDialogVariant","validConfirm","busy","setBusy","setShowConfirm","handleAction","resp","Notification","persist","showLinkMessage","linkUrl","linkText","respm","errmsg","sccmsg","wrnmsg","_t","IsEntity","IsEntityType","IsEntityArray","IsEntityString","IsEmptyArray","IsNotEmptyArray","PureAppliedFilterComponent","onRemove","onApply","direction","filterData","filterPredicates","depValue","depKey","predict","setPredict","handleChange","applyItem","handleRemoveClick","labelFunc","invalidLabel","canHaveInversed","inversionDisabled","toggleInversed","fieldName1","displayName","selected","dateTimeClear","NonRemovableFilter","margin","textOverflow","flexWrap","AppliedFilterComponent","prevProps","nextProps","predicetes","EditableCell","WrappedComponent","initialValue","updateMyData","BooleanPickerFilter","trueName","falseName","ActionButton","isSafary","placement","PopperProps","useAsyncGetWthEffect","load","defaultVal","setVal","allowedroles","InstrumentEventsAdmin","useWorkOrdersPermissions","roles","callback","hasPermissions","allowedToView","isMainOrInstrumentEventsAdmin","HasAdminGroupOnlyPermissions","HasAdminServiceOnlyPermissions","HasInstrumentEventsGroupPermissions","IsReadOnlyUser","CalendarOnly","initBudgetData","queryUrl","BudgetPicker","allActiveBudgets","BudgetByUserGroupFilter","loadBudgets","restrictedBudgetFilter","budgetLimitedByUsers","isBudgetsWithoutUserGroup","userDefaultBudgetEnabled","hideNonDefaultBudgets","fundingType","usrFilter","memberTimeFilter","fundingTypeId","startFilter","endFilter","groupFilter","servFilter","deffFilter","BooleanRender","FormBookitDatePicker","disableFuture","disablePast","inputVariant","clearable","fullScreen","truncateTime","minDate","maxDate","useGlobalSettingsHook","adminRoles","InstituteCoord","privateBudgetsRoles","HeadOfLab","userRoles","reservationRestricted","setReservationRestricted","budgetModuleEnabled","setBudgetModuleEnabled","priceSheetPricing","setPriceSheetPricing","billingEnabled","setBillingEnabled","purchaseOrderLengthSetting","setPurchaseOrderLengthSetting","userIsMainAdmin","setUserIsMainAdmin","userSettings","allowOngoingReservationModificationEnabled","setAllowOngoingReservationModificationEnabled","doNotAllowReservationUserChangeByStaff","setDoNotAllowReservationUserChangeByStaff","instituteProjectsEnabled","setInstituteProjectsEnabled","reservationTerminationEnabled","setReservationTerminationEnabled","draftReservationsEnabled","setDraftReservationsEnabled","MandatoryOfflineServicesOnTrainingSignUps","setMandatoryOfflineServicesOnTrainingSignUps","crossInstrumentTrainingEnabled","setCrossInstrumentTrainingEnabled","userAndGroupPermissionsEnabled","setUserAndGroupPermissionsEnabled","tutoringModulesEnabled","setTutoringModulesEnabled","accServicesEnabled","setAccServicesEnabled","allowUsersToViewTheirCharges","setAllowUsersToViewTheirCharges","showReferenceFieldInReservationDetails","setShowReferenceFieldInReservationDetails","offlineServiceWithReservation","setOfflineServiceWithReservation","multipleInstrumentsEnabled","setMultipleInstrumentsEnabled","trainingSessionEnabled","setTrainingSessionEnabled","reservationFormEnabled","setReservationFormEnabled","resMultipleFormsEnabled","setResMultipleFormsEnabled","assistedReservationsEnabled","setAssistedReservationsEnabled","showCalcPriceOnOfflineService","setShowCalcPriceOnOfflineService","showCalculatePrice","setShowCalculatePrice","allowPartialProjectCharges","setAllowPartialProjectCharges","allowPartialSingleProjectCharges","setAllowPartialSingleProjectCharges","budgetExperimentModuleEnabled","setBudgetExperimentModuleEnabled","fundingTypeBudgetEnabled","setFundingTypeBudgetEnabled","purchaseOrderBudgetEnabled","setPurchaseOrderBudgetEnabled","setIsBudgetsWithoutUserGroup","requestReservationEnabled","setRequestReservationEnabled","setIsBudgetLimitedByUsers","setHideNonDefaultBudgets","assemblyPartsEnabled","setAssemblyPartsEnabled","setUserDefaultBudgetEnabled","setDefaultBudgetEnabled","userGroupReservationRestricted","setUserGroupReservationRestricted","setReservationUserGroupGroupByBudgetUserGroup","onlyOwnUserGroupsAllowed","setOnlyOwnUserGroupsAllowed","allowAddRemoveOnEditReservation","setAllowAddRemoveOnEditReservation","allowToRemoveFromMultipleReservation","setAllowToRemoveFromMultipleReservation","hideReservationCollaborators","setHideReservationCollaborators","isConfidentialBudgetsEnabled","setIsConfidentialBudgetsEnabled","allowWorkflowBookingEnabled","setAllowWorkflowBookingEnabled","modifyReservationNameForUsers","setModifyReservationNameForUsers","loadCompleted","setLoadCompleted","BudgetFields","Confidential","MultipleInstruments_AddRemoveOnEditReservation","AllowToRemoveFromMultipleReservation","HideTrainingSessionsSettings","ModifyReservationNameForUsers","InstituteProjects","GetNullableByKey","TerminateReservation","AccServices","AllowOngoingReservationModification","DoNotAllowReservationUserChangeByStaff","HideReferenceFieldInReservationDetails","AllowUsersToViewCharges","HideAssistedReservationsSettings","BudgetLimited_ByUsers","Budgets","PriceSheetPricing","Billing","PurchaseOrderLengthSetting","intValue","OfflineServiceWithReservation","resRestrictedSetting","UserReservationsRestricted","UserOwnRestricted","resUserGroupRestrictedSetting","UserGroupRestricted","UserPermission","GroupPermissions","ReservationUserGroupGroupByBudgetUserGroup","CrossInstrumentTraining","ShowDefaultBudgetOnUserProfile","HideCalcPriceOnOfflineService","Invoices","Default","PurchaseOrderOption","Tutoring","TutoringHours","HideNonDefaultBudgets","SGACreateProjects","BudgetExperiments","DisableBillingEvents","AllowPartialMultipleProjectCharges","AllowPartialSingleProjectCharges","ReservationsCustomForm","MultipleCustomForms","HideReservationCollaborators","ServiceRequestReservations","billingModuleEnabled","resCustomFormEnabled","AssemblyPartsEnabled","confidentialBudgetsEnabled","ServiceRequestReservationEnabled","OfflineServiceTypePicker","UsageRelatedFilter","Ids","excludedIds","ReservationsRelatedFilter","equipmentGroups","optionalServiceTypes","hideProject","allServicesAllowed","budgetServiceGroupServicesAllowed","byAdmin","byUser","OfflineServiceRelatedFilter","relatedGroups","RenewStockRelatedFilter","InventoryBatchRelatedFilter","allPeriods","noFuturePeriods","DatesRangeFilter","periodValue","changedValue","periods","Forever","From","minutesStep","saveOnSelect","maskIfEmpty","To","StyledItemIcon","ListItemIcon","RowMenuActions","tooltipOpen","setTooltipOpen","popupProps","renderAsTitle","localizedText","RouterLink","RowActionsMenu","useRowActionsColumn","tablePlugins","actionColumns","Header","Action","disableSortBy","Cell","hooks","useInlineRowActionsColumn","selectArticles","articles","selectArticlesExternalSearchResults","externalSearchResults","selectArticlesExternalSearchForm","externalSearchFormDetails","selectArticlesExternalSearchPageIndex","externalSearchPageIndex","selectArticlesExternalSearchPageSize","externalSearchPageSize","selectArticlesExternalSearchPageData","selectArticleDetails","articleDetails","selectRefreshEditArticleAssociation","refreshEditArticleAssociation","selectArticleDetailsBusy","articleDetailsBusy","selectEditArticleAssociationBusy","editArticleAssociationBusy","selectArticleDetailsForm","ServiceGroupAssets","Assets","InstrumentAssets","updateFormValues","coming","orn","o","validateReservation","validateMinEnd","validateAccServices","allEquipments","allAcc","acc","getWorkFlowName","userName","getPrintPDFDefaultSections","serviceRequestEnabled","hasCustomForm","sections","ReservationDetails","ReservationConsumables","CustomFormDetails","AssociatedServiceRequestDetails","validateError","propss","utils","validateDate","currentDate","opDate","maxMonthDays","finalDate","maxDateMessage","minDateMessage","invalidDateMessage","strictCompareDates","validateTime","convertToMeridiem","getMeridiem","DateTimeLabel","withPadding","backgroundImage","checkedIcon","content","indeterminateIcon","Check","checkicon","uncheckicon","indetermicon","Checkbox","PriceSheetBy","BudgetType","AutomaticAssetNamings","SideBarQuickActionsEnum","DraftReservationTypes","AllowReservationCollaboratorsTypes","mapSettingsFromServices","equipments","accServices","HasHideProjects","HasConflictProjects","HasMultipleProjects","AllowPartialProjectCharges","HasPartialSingleProject","AllOffServicesAllowed","ReservationOfflineServicesEnabled","OfflineServicesVisible","AllowReservationCollaborators","AllowedToStartUsage","NotAllowedToStartUsage","budgetExperimentVisible","BudgetExperimentSettings","TrainingSignUpApproval","HideTrainingSession","HasAttendance","ForceTutoring","ForceFullDayReservations","IsEquipmentTutoring","NotAllowReservations","AllowOneAccSerOnly","IsAllAdmin","RestrictReservationToTimeSlots","DefaultReservationDuration","sort","MinOrderHours","MaxOrderHours","MaxOrderDuration","MinOrderGap","RestrictDurationUnitsAmount","RestrictDurationUnitType","DefaultAccServiceId","Billable","IsLoanDesc","LoanTypeId","AllowModification","AllowExtendReservation","AllowUsersToShortenReservations","AllowedToTransfer","AllowedToTransferAll","EnforceReservationRestrictions","LimitlessReservationAllowed","BudgetVisible","getBudgetVisible","OfflineServiceTypes","combineOfflineServiceTypes","arr","HasAccServices","StaffUserVisibleAllways","StaffUserSelectionVisible","StaffUserVisibleOnPending","StaffUserRequiredAlwais","StaffUserSelectionRequired","StaffUserRequiredOnPending","StaffUserSelection","DraftForAll","DraftReservationsTypeId","DraftReservationTypes_AllUser","DraftApprovalRequred","DraftReservationTypes_ApprovalRequired","DraftSaveForLater","DraftReservationTypes_SaveForLater","combineOptionalEquipments","offlineServices","terminate","EquipmentsData","AccServiceIds","AssemblyId","SampleRunId","SampleIds","Collaborators","CollaboratedUsers","PartialAttendance","PartialAttendanceStart","PartialAttendanceEnd","FullDayReservation","Username","StaffUser","UserGroupId","TrainingSessionId","TrainingSession","TransferFromId","UserRequestedByApproval","TransferredTo","WorkflowBooking","RecurringUpdateOption","AllStartTimes","BudgetIds","OfflineServices","ServiceTypeName","UnitsName","Factor","TransferInProgress","Entered","RecordDate","UpdatedAt","CancelledAt","CustomFormValues","FieldId","Parts","TutorName","Terminated","SavedForLater","StartDate","EndDate","PartReservations","BudgetName","AssignToServiceRequestId","AssignToServiceRequestRowIds","AssignToServiceRequestSampleIds","Repeat","RecurringEvents","DoNotRepeat","RepeatsEveryType","RepeatsEveryPeriod","RepeatsEveryNum","RepeatsEveryDay","RepeatEndTime","RecurringEndDate","RepeatOption","Repeat_Period","RepeatsBy","RepeatsMonthlyBy","RepeatsOn","RepeatsOnDays","MandatoriesEquipments","OptionalsEquipments","doInitReservation","doInitReservationEdit","getReservationProperty","doUpdateSettigs","doUpdateEquipmentSettigs","doLoadValidationData","doSetStart","doSetEnd","doSetAny","doTransferReservation","doCancelTransferReservation","doTerminateReservation","reservationSaga","UpdateToNow","isChange","resourceChanged","BaseEquipment","extendEquipmentSettingsState","mandatories","End","sampleRunId","initReservation_Success","isChanged","userTrainigData","userTrainingsApprovalData","Equipments","CheckStatus","prevState","bid","CheckSession","initValidationData","warnings","initReservation_Error","doInitReservationEdit_Load_OfflineMandatory","OfflineMandatory","extendReservationSettings","SamplesAutomation","userTrainingEquipments","FatherId","setTrainingsData","fork","isCloned","calcCredit","customFormFiles","getFilesModel","FileTypes","ReservationFile","CustomFormTypeEnum","Reservation","FileStoreApi","saveFormFiles","fileRes","fileResponse","self","setCloneReservation","warnOnTrainingSession","FirstEquipmentId","ClickHere","afterLinkText","res_futureTrainingSession_LinkTitle","repetitiveActions","resetState","createReservation_Success","reservationIds","insertModel","insertedModel","createReservation_Error","reservationDto","reccurentUpdateOption","filesData","originalCustomFormFiles","currentCustomFormFiles","updateFormFiles","fileResponses","terminateReservation_error","Succes_ReservationTerminated","terminateReservation_success","offRes","offErrors","offResponse","offWarnings","initClonedReservation_Success","updateReservation_Success","updateReservation_Error","updateReservationSettings","newSettings","updateEquipmentSettingsState","CustomForms","StatusChange","IsForceTutoring","initValidationData_Success","initValidationData_Error","setStartSuccess","setEndSuccess","transferReservation_Error","transferReservation_Success","cancelTransfer_Error","cancelTransfer_Success","createReservation","setStartDate","setEndDate","cancelTransfer","terminateReservation","TryDisableRemoveableEquipments","noremoved","titleInfo","StaffMandatoryEquipment","generateTrainingSessionName","op","AssemblyParts","getReservationSettings","TrainingSessionOnly","SessionId","LastUpdateDate","LastUpdateAdmin","ParentAssemblyReservationId","TopAssemblyReservationId","HasOfflineServices","HasTrainingSession","NextReservationTime","CurrentReservation","FirstInitEquipments","FutureReservation","IsFuture","Ongoing","IsOngoing","PastReservation","IsPast","resetOperateState","resetAssisteTrainingData","resetEquipmentChangeState","getAnyValue","getAnyValueSuccess","resetRequestedFor","resetTransferState","setSavedOfflineServices","setRefreshOfflineServices","resetTerminateState","setAsyncChangeLoading","setSubmitCredit","setByApprovalErrors","setUserCanRequestApproval","setRefreshWorkOrderLink","reservationActions","useReservationSlice","GhostInput","valueHtml","valueText","labelBolder","ghosInputLabelBold","StyledChip","custombgcolor","main","customsize","customcolor","paddingBlock","opacity","pointerEvents","darken","fullwidth","customwidth","notremoved","labelSmall","clickable","sizeSmall","deleteIcon","customiconcolor","contrastText","fade","Chip","BookitChip","aria-disabled","onDelete","preventDefault","BookitChipWithCheck","BookitChipWithInfo","checkname","checkid","largeFilesUploadSaga","selectedFiles","canUpload","uploading","targetId","startedToUpload","currentNumberOfUploadedFiles","numberOfUploadedFiles","commentType","referenceId","setSeletedFiles","setCommentProperties","setCanUpload","addFile","removeFile","resetNumberOfUploadedFiles","useLargeFilesUploadSlice","CommentsApi","GetComments","reference","SendComment","typeId","Files","Text","IsInternal","form","delteUrl","mapSettings","isEditMode","budgetEnabled","resUGEnabled","isServiceAdmin","IsAllGroupOrLabTechAdmin","isRoleAdmin","isUserGroupCoordinator","UserGroupCoord","btExpEnabled","chargesViewAllowed","FinAdmin","InvoicesReader","hasConflictProjects","budgetVisible","fundingTypeVisible","userGroupVisible","userVisible","budgetExpirementVisible","instProjVisible","extCustomerVisible","purchaseOrderVisible","PurchaseOrderOptionId","Hidden","referenceVisible","endTimeVisible","startTimeVisible","doSetConnectedValue","doResetState","connectedFiltersSaga","setConnectedValueSuccess","currentData","updateSettingsState","resetConnectedState_success","setConnectedValue","resetConnectedState","toISOString","setSubmit","resetConnectedHandler","useConnectedFiltersSlice","DRAWER_WIDTH","DRAWER_MOBILE_WIDTH","SIDE_PANEL_WIDTH","COVER_WIDTH","initExtraDDLData","ExtraDDLPicker","AutocompleteMultiPicker","fullWdithOptions","renderTags","renderOptionLabel","renderOptions","onChipClick","setInputValue","newValue","getTagProps","Color","Fragment","BaseURLPicker","queryfilter","ConvertModelToEntity","Shared","doInitNewDetails","doUpdateViewAssets","doSelectSavedView","doPatch","doUseSavedView","savedViewSaga","loadNew","eid","initNewDetails_Success","initNewDetails_Error","initUpdateData","httpPayload","createSavedView","MyInstrumentList","SavedViewDetails","createView_Success","createView_Error","updateSavedView","updateView_Success","updateView_Error","newAssets","assets","el","view","groupId","shared","updateViewAssets_Success","updateViewAssets_Error","selectSavedView_Success","savedViewsApi","patch_success","useSavedView","useSavedView_success","initNewDetails","createView","updateView","updateViewAssets","savedViewUserName","SavedViewExtraData","UserNameDisplay","createdAt","CreatedAt","usages","UsageCount","resetCreateSavedViewState","resetUpdateSavedViewState","selectedSavedView","selectSavedView_Error","WorkOrderApi","initCreateData","insertWorkOrder","updateWorkOrder","offData","getNewWorkOrderStatus","deleteOrders","DowntimeOrders","assetIds","foo","nowDate","removefromLinks","linkedId","addToLinked","removeLinkedCalibration","addLinkedToCalibration","getLinkedToCalibration","getOverlappingDowntimes","updateWorkOrdersStatus","workOrderStatus","workOrdersIds","statusId","EmptySlotAdminClick","userProfileSetting","savedEnabled","updateEnabled","useUploadToNewComment","largeFileActions","onCommentAdded","comment","FormSwitch","boldLebel","maxLabelWidth","boldLabel","boxed","savedView","selectSavedViewProcessing","selectCreateSavedView","selectUpdateSavedView","selectUpdateUserName","selectExtraData","selectCreateSavedViewCompleted","selectUpdateSavedViewCompleted","selectCreateSavedViewHasError","selectUpdateSavedViewHasError","FormBookitDateTimePicker","labelInline","dateLabel","timeLabel","ExtraDDLFilter","AutocompleteMultiPickerEx","selectable","ServiceRequestDetailsPath","generatePath","getAssetImageThumbSrc","imageExist","defaultImage","getDefaultImage","getAssetImageSrc","part1","part2","isEmpty","PartOfDay","doChangeViewMode","doChangeViewModePartial","changeLocation","doGetEvents","doGetServices","doGetDerivedServices","doEdit","doEditTrainingSession","doEditReservation","doEditAlert","doReset","doUpdateMultipleMode","doUpdateEmptySlotClick","doGetEmptySlotAdminClick","doSetFilters","doResetWorkOrder","schedulerSaga","previous","isStateEqual","forceEvents","getEvents","setPreviousViewState","pickViewState","isEqual","applyStateSearchParams","periodFilterFieldName","groupByFilterFieldName","currentMode","previousMode","GetCalendarPagePath","eventsParams","splitFilter","eventFilters","training","ReservationOrDowntime","sharedFilter","servicesFilter","equipmentIdArray","withReservationsOnly","fetchedServices","reservations_fields","effects","fetchEvents","fetchTrainingSessions","noServicesSelected","loadWorkingHoursForFetchedEvents","fetchWorkingHours","fetchedEventsEffect","fetchedTrainingSessionsEffect","fetchWorkingHoursEffect","fetchedEvents","fetchedTrainingSessions","fetchedWorkingHours","getEvents_Success","offlineServicesFilter","getOfflineHours_Success","distinctEquipmentIds","getDerivedServices","getNonWorkingHours","nonWorking","getNonWorkingHours_Success","ReservationOrDowntimeEnum","ReservationsOnly","OffLine","DownTimeOnly","trainingFilterBuilder","serviceIdParameter","startParameter","prepareDateParameter","endParameter","batchResponse","getServiceDetails","getServices_Success","needMoreServiceProps","servicesResponse","requiredProps","actualProps","getDerivedServices_Success","trainingSession","un","tsid","reservationDetailsState","reservationSidePanelOpened","offStart","offEnd","workOrderActions","setOfflineEventStart","setOfflineEventEnd","WorkOrderDetails","requestedServices","defaultMulti","defaultMultiModeBehavior","equipmentChanged","equipment","payloadServiceIds","requestedServicesAssemblyIds","TopAssemblyId","useRequestedServices","Scheduler_AssemblyPartSelected_InfoMessage","reservationSidePanelServiceId","srid","srrid","ug","sample_run_id","alertQueryParams","down","offH","eStart","aType","alert_type","useSwithButtons","useSwitchButtons","updateMultiMode_Success","updateEmptySlotSettings_success","gsettings","defaultEmptySlotSetting","CalendarTimelineEmptySlotClickSettings","defaultEmptySlotClick","WhatToAdd","userEmptySlotAdminClick","userSetting","getPredicate","predicate","serviceRelatedFilters","filteredServices","serviceFilterValue","MaximumTimelineRowsLimit","maxTimelineServices","CalendarServicesPickerCapacity","maxCalendarServices","maxServices","changeViewMode","changeViewModePartial","createWorkOrder_Success","updateWorkOrder_Success","resetUpdateWorkOrderState","resetCreateWorkOrderState","getServices","setFilters","updateMultiMode","updateEmptySlotSettings","getEmptySlotAdminClick","TimelineGroupBy","withNoChangeLocation","changeGroupBy","getEvents_Error","getTrainingSessions_Success","multipleInstrumentsMode","setNotUseLocation","setSelectedReservationEvents","resetExportToPDF","schedulerActions","useSchedulerSlice","filterHandler","isSidePanel","saved","withoutReserved","withReserved","addReserved","filterSearch","filterValue","reserved","FormUserPicker","MessageText","div","css","showMore","minHeight","defaultIconMapping","BasicAlert","collapsedMinHeight","isShowMore","setIsShowMore","in","severity","iconMapping","show","doInitCreate","doInitUpdate","doSendReservationsOfflineEmail","doRemoveFromLinked","doAddToLinked","doRemoveLinkedCalibration","doaddLinkedCalibration","doSetCreatedOrders","doCheckDowntimeOverlaps","workOrderSaga","initWorkOrder_Success","initWorkOrder_Error","initUpdateWorkOrder_Success","initUpdateWorkOrder_Error","ConvertNewWorkOrdersToModel","submissionFormFiles","workOrderDetails","SubmissionFormFiles","savedLinkeCalibrations","idx","AlertTypeFile","AlertType","WorkOrderTypeId","setSaveNewComments","setOrderNumbers","WorkOrdersPageName","widx","addLinkedCalibration","WorkOrderType","hasResOffline","ReservationOffline","ReasonName","createWorkOrder_Error","staffFormFiles","StaffFormFiles","updateAll","UpdateAll","originalSubFormFiles","RecurringAssetId","RecurringGroupId","originalStaffFormFiles","AlertFile","Alert","AutoCreatedOrders","longDateTimeFormat","updateWorkOrder_Error","paload","deleted","insert","doNotNotifyUsers","allAffectedUsers","sendData","sendReservationsOfflineEmail_Success","sendReservationsOfflineEmail_Error","removeFromLinked_success","addToLink_success","removeLinkedCalibration_success","addLinkedCalibration_success","setOrderNumbers_success","checkDowntimeOverlaps_Success","initWorkOrder","initUpdateWorkOrder","createWorkOrder","sendReservationsOfflineEmail","removeFromLinked","checkDowntimeOverlaps","ConvertEntityToModel","ToDown","resetReservationsOfflineState","setUpdateAllRecurrent","LinkedAlerts","setSavedLinkedOrders","resetSavedLinkedOrders","setCalibrationChanged","useWorkOrderSlice","TextField","disableUnderline","mapToAssetDto","myAsset","AssetCatId","AvailabilityTypeId","AvailabilityTypeName","ServiceGroupAssetId","UserProfileLink","twoRows","UserFormatResult","Api","ConfigurableColumns","listId","configurableType","ListID","ConfigurableType","TemplateColumns","ScreenId","Iad","none","iad","ImportTemplate","Ext","ext","importImages","maxContentLength","ExportImportActions","Export","Import","ImportImages","samplesList","selectSamplesList","selectRunDetails","selectShowRunDialog","selectSamplesListEditMode","selectImportingRunDetails","selectImportingRunDetailsFinished","selectRunDetailsInstrument","selectRunDetailsSecondaryInstrument","selectRunDetailsGradient","selectRunDetailsCreatedDate","CreateDate","selectRunDetailsAcquision_type","StyledTextField","MatTextField","FormCheckbox","selectPaper","selectRoot","selectTitle","textAlign","selectContent","addButtonRoot","addCollapsContainer","AddFilterButton","filtersSelectionOpen","setInnput","disabledTitle","Popper","SelectFieldToFilterBy","SearchFilter","MenuList","mobHorizontal","tabIndex","handleFilterSelect","AppliedFiltersContainer","mobileRoot","mobileHorizontalRoot","maxHeight","dependencyProp","depFiltered","filt","filterValues","updateDepValues","BasicFilterGroup","appliedFiltersDirection","filterDefaultOpen","setVisibleFilters","handleAddFilterWithValue","currentState","handleApply","areSameFilter","handleRemoveFitler","available","applied","appliedFitltersCount","autoOpenAddFilter","SavedListsDropDown","serviceItem","savedListRelatedPickerName","hasInVisibleFilters","addFilter","serializedKey","listViewbyAsset","ButtonsContainer","MoreFilters","MoreFiltersDisabled","apply","ResetFilters_info","ResetFilters","FormControl","DateInput","openPicker","TextFieldComponent","validationError","togglePicker","TextComponent","innerInputProps","readOnly","InputAdornment","ev","nodeName","onKeyDown","toEndDateDisplayValue","truncatedDate","dir","dateLongFormatter","pattern","timeLongFormatter","longFormatters","P","dateTimeFormat","matchResult","datePattern","timePattern","formattingTokensRegExp","longFormattingTokensRegExp","getFormatTokens","formatString","tokens","firstCharacter","longFormatter","setInputViewDate","ddd","getValueDateOrTruncat","getMaskedDateValue","mask","singleValue","dateStartFrom","dateSeparator","getMaskedTimeValue","hour","minute","StyledPicker","PickerPopper","shadowXL","daysEntityArray","_","defaultDayValue","getDayEntityFromDate","DaysByMonthPicker","maxDay","monthDate","monthEntityArray","FullName","MonthId","defaultMonthValue","getMonthEntityFromDate","MonthOfYearPicker","MAX_YEAR","yearsEntityArray","defaultYearValue","getYearEntityFromDate","YearsPicker","DateDropDown","dayDisabled","monthDisabled","yearDisabled","onError","useUtils","dateTimeValue","dateSelected","setDateSelected","daySelected","setDaySelected","monthSelected","setMonthSelected","yearSelected","setYearSelected","innerError","setInnerError","isYearOpen","setIsYearOpen","isMonthOpen","setIsMonthOpen","isDayOpen","setIsDayOpen","someOpen","withCompletion","handleDayChange","handleMonthChange","handleYearChange","FormHelperText","hoursEntityArray12","hoursEntityArray24","defaultHourValue12","getMeridiemHours","defaultHourValue24","getHoursEntityFromDate","HoursPicker","useAmPm","minutesEntityArray","defaultMinutes","getMinutesEntityFromDate","MinutesPicker","AmPmEntityArray","defaultAmPm","getAmPmEntityFromDate","AmPmPicker","TimeDropDown","hoursDisabled","minutesDisabled","hoursSelected","setHoursSelected","minutesSelected","setMinutesSelected","ampmSelected","setAmpmSelected","isHourOpen","setIsHourOpen","isMinuteOpen","setIsMinuteOpen","isAmPmOpen","setIsAmPmOpen","ampmValue","handleHoursChange","handleMinutesChange","handleAmPmChange","ampmVal","useIsomorphicLayoutEffect","useLayoutEffect","useEventListener","eventName","handler","savedHandler","targetElement","eventListener","useDateTimeChange","refresh","valueRef","dateTimeMask","maskFormats","dateStartOf","userValue","isDeleleteButtonDownRef","wasZeroBefore","selectionStateChanged","eventValue","increment","isHourChanged","isMinutesChanged","isAmPmChanged","isDayChanged","isMonthChanged","isYearChanged","isNoOperation","selectionChanged","formattedValue","moveSelectionForward","finalTime","partChanged","maskFormat","prevValue","stayOnSelection","newTime","prevParts","prevHour","prevMinute","prevMeridiem","newVal","hourInt","prevHourInt","comb","minuteInt","prevMinuteInt","formatingTime","finalValue","isPrevZero","isSelectionChanged","zeroPress","startedFrom","dayVal","prevDayVal","dayInt","prevInt","monthVal","prevMonthVal","monthInt","prevMonthInt","yearVal","prevYearVal","yearInt","padEnd","formatingDate","oneLetterHour","handleKeyDown","evt","handleKeyUp","hasSingleChar","selectionStart","maskedValue","onSelectionChange","selectionEnd","KeyboardRifmInput","isPickerOpen","defTokens","first","dateStartWith","dateTokens","timeTokens","defaultDateTimeMask","inputMask","setHasError","errorMessage","setErrorMessage","setSelectionChanged","dateChange","onMouseUp","timeSelection","dateSelection","onKeyUp","arrows","dateArrowSelection","selStart","selEnd","nativeEvent","stopImmediatePropagation","KeyboardInput","displayDate","emptyLabel","getDisplayDate","innerInputValue","setInnerInputValue","changedValueRef","dateVal","getParsableDate","setValidationError","innerValidationError","textValue","TimeOptionPicker","hoursItems","minutesItems","ampmItems","hourRef","minuteRef","selectedId","scrollTo","hourScroll","step","minuteScroll","PickerOptions","List","disablePadding","ListItem","Divider","ap","gridAutoColumns","gridAutoRows","gridColumn","gridRow","borderBottom","borderTop","listStyle","scrollBehavior","BookitDatePicker","elementRef","closablePicker","closeTitle","readonlyInput","useTimeClockPicker","useTimeDropDowns","useDateDropDowns","dateInputProps","keyboardInputProps","dateValue","setDateValue","handleSave","contains","countState","inputDisplayValue","getInputViewDate","ClickAwayListener","mouseEvent","onClickAway","inpValue","transition","TransitionProps","Fade","Paper","TimePicker","disableToolbar","timeValue","DatePicker","Save","Clear","prefix","levelFormatter","nameFormatter","timestampFormatter","createPeriod","now","startFn","endFn","addFn","offset","useExpandedSideBarState","expandLocal","MainTabs","AssetsSubTab","AssetsSubTabUnionArray","NoAuthNodes","HasChildNodes","ResourceKey","reg_NewUserRegistration","RootNode","HideReact","isAdminNode","ParentNode","Hide","MainTab","SubTab","IsAdminSettings","GroupTab","node","searchItem","irurl","chitem","rurl","rpath","prurl","purl","rurl1","getCurrentMainNode","getUserNodes","parentNodes","childNodes","currentPathNameLowered","elementPathName","newSearch","getCurrentNodes","currentNode","findNode","HasCustomRoleUrlPermission","menuTab","filtered","nodeAccesibleByRole","it","subTab","findMainTabNode","subTabTitle","ShortWeekDays","getShortDaysArray","RepetitiveInit","untilDate","GetAutoCreateTitle","eventStart","AutoCreateEvent","AutoCreateFor","RepeatCustom","periodName","Days","Weeks","RepeatDaily","parseISOOrNull","GetIntervals","dates","originStart","originalEnd","nextWeek","dayWeek","newMonthDate","newDayWeek","calcDay","checkDate","counter","theDay","firstDay","lastDay","newDay","period","everyDayNum","nextDay","daysToAdd","newDayDate","mtheDay","mnextDay","mdaysToAdd","Months","RepeatsBy_DayOfMonth","monthDay","RepeatsBy_DayOfWeek","newMonth","box_shadow_s","box_shadow_m","shadowXS","shadowS","shadowM","shadowL","deleteSavedViews","viewIds","getMySavedViews","mySavedViewFilter","onlyMyView","initWOTypeData","initWOTypeDataParams","downtime","filteredWorkOrderTypes","calibration","grp","elem","cts","byGroups","byCats","WorkOrderTypePicker","convertInventoryBatchName","loadBaseData","InventoryBatchPicker","loadInventoryBatchesData","BatchesByServiceTypeFilter","withStockRenewed","TimelineGroupByUnionArray","parseCalendarPageParams","dashView","defaultviewType","parseType","presetPeriodToViewLength","getTimelineGroupBy","AlignRight","initUserGroupData","UserGroupPicker","RestrictedUserGroupPicker","RestrictedFilter","departmentId","instituteId","instituteTypeId","restricted","UserFilter","DescriptionCell","leaveDelay","leaveTouchDelay","GetSchedulerPagePath","calendarPageFullPath","useCalendarLink","selectGlobalDbSetting_EnableLegacyScheduler","openToBook","NumberField","withMinMax","withProps","serviceRequestsKanban","selectServiceRequestsKanban","selectServiceRequestsKanbanProcessingUpdate","processingUpdate","selectServiceRequestsKanbanProcessingInsert","processingInsert","selectServiceRequestsKanbanTickets","selectServiceRequestsKanbanSelectedStatuses","selectedStatuses","selectServiceRequestsKanbanData","tickets","dataList","section","selectShowAddSubTicket","showAddSubTicket","selectEdit","parentTicket","ticket","regPublicUrl","billableAdminUrl","initServiceGroupsData","ServiceGroupPicker","serviceGroupFilterUrl","FormServiceGroupPicker","FormControlLabel","withInfo","boxedChecked","boxedError","shiftRight","roundTwoPlacesAfterDecimalPoint","round","doShowDetails","doExternalSearch","doSaveArticleAssociation","articlesSaga","externalId","externalIdSource","showDetails_Success","externalSearch_Skip","searchForm","Source","externalSearch_Success","Count","Items","StatusCodes","TOO_MANY_REQUESTS","TooManyRequests","externalSearch_Error","isNew","fn","Queryable","AwaitingApproval","PublicationAwaitingApproval","Success","saveArticleAssociation_Success","mes","saveArticleAssociation_Error","showDetails","externalSearch","chnagePage","saveArticleAssociation","article","resetArticleAssociationState","someAction","clearArticleDetails","articlesActions","useArticlesSlice","doUpdateSections","doSaveSections","printPDFSaga","selectPrintPDFSections","updateSections","saveSections","isLoading","useSections","setPrinting","setUseSections","Sections","updateSection","clearLoading","tables","table","printPDFActions","usePrintPDFSlice","doGetItems","doGetMoreItems","doSetSelectedStatuses","doReorder","doInsert","selectorChangeSaga","monitorSelector","doShowEdit","doShowEditParent","serviceRequestsKanbanSaga","ENTITY_SET_URL","fetchTicketsByStatusId","fetchTicketsParams","skip","fetchTicketById","FETCH_SELECT_EXPAND","$orderBy","notificationMessageKey_getItems","bar","getItems_Success","getItems_Error","getMoreItems_Success","loadedIds","currentStatusIdentifiers","getItems","indexChanges","ServiceRequestStatusId","destinationSectionId","destinationIndex","reorder_Success","reorder_Error","sourceIndex","sourceSectionId","notificationMessageKey","AssignedTo_Id","AssignedTo","Priority","SamplesCount","ParentTicket","ParentTicketId","insert_Success","GenericInsertSuccessMessage","insert_Error","modelState","getModelStateErrors","GenericUpdateSuccessMessage","extractErrorMessages","previousValue","currentValue","takePattern","nextValue","take","openSidePanelProps","showEdit_Success","ServiceRequestTicketDetails","showEdit","showEdit_Error","getMoreItems","setSelectedStatuses","reorder","showEditParent","selectedStatusIds","fetchCount","sourceSection","destinationSection","removed","updateSamplesCount","serviceRequestsKanbanActions","useServiceRequestsKanbanSlice","originalSamplesCount","useAdminPermissions","allowedToEdit","allowedToAdd","HasCreateAdminGroupPermissions","allowedToEditOffline","allowedToAddOffline","allowedToEditBatch","allowedToEditGroup","allowedRoles","hasRolePermissions","sum","aggregatedValues","minMax","average","median","mid","floor","unique","uniqueCount","Map","getFirstDefined","args","flattenBy","recurse","emptyArray","emptyObject","resetGroupBy","setGroupBy","useSummary","stateReducers","visibleColumnsDeps","instance","useInstance","prepareRow","previousState","groupByColumns","col","nonGroupByColumns","isGrouped","groupedIndex","pluginName","defaultUserAggregations","flatRows","rowsById","allColumns","groupByFn","defaultGroupByFn","manualGroupBy","aggregations","userAggregations","plugins","autoResetGroupBy","disableGroupBy","defaultCanGroupBy","ensurePluginOrder","defaultColumnGroupBy","defaultGroupBy","columnDisableGroupBy","canGroupBy","Aggregated","existingGroupBy","aggregateRowsToValues","leafRows","groupedRows","depth","aggregateFn","aggregate","groupedValues","leafValues","columnValue","aggregateValue","aggregateValueFn","groupedFlatRows","groupedRowsById","onlyGroupedFlatRows","onlyGroupedRowsById","nonGroupedFlatRows","nonGroupedRowsById","groupUpRecursively","parentId","rowGroupsMap","aggregatedGroupedRows","groupByVal","subRows","groupByID","subRow","summaryRows","getAutoResetGroupBy","useGetLatest","useMountedLayoutEffect","preGroupedRows","preGroupedFlatRow","preGroupedRowsById","allCells","cell","isPlaceholder","isAggregated","resKey","TableCard","viewCheckBox","useSelect","hasAdditionalActions","hasInlineRowActions","someSelected","showTitleCell","contentEditable","useButtons","cells","sizeOfMobileCard","img","hasImg","imgSrc","showSelect","setShowSelect","isDisabled","render","CardMouseOver_info","backStyle","imageSrc","selectVisible","checkBox","showBullet","mobileSize","toggleRowSelected","useImage","topActions","hasTopActions","cardContentRows","TabsToolbar","leftTabs","selectedValue","selectedArray","rowsCount","getMultiMode","onAllRowsSelected","disableMultiMode","defaultMultiMode","rightTabActions","multiMode","setMultiMode","TabsContainer","Grow","Tabs","updateIndicator","selectionFollowsFocus","indicatorColor","tab","allPagesUnselected","Unselect","ClearSelection","CoreMultiSelect_info","CoreSelectAll","genericMemo","FloatingContainer","insetBlock","insetInline","bottom","SperActions","FloatingActions","selectedActions","totalRows","buttonActions","maxButtons","baseActions","sperActions","fixedContainer","fixedContainerMobile","isPopup","mobile","compactActions","CustomToolbarFunc","customRoot","tabsContant","buttonsContant","CustomToolbar","RenderRow","onRowClicked","canClickRow","TableRow","getRowProps","TableCell","getCellProps","CustomEmptyTable","TableHeaderCellLabel","RenderGroupedRow","ImportButton","handleImport","menuItems","showSingleImportButton","keepMounted","defaultGetSubRows","defaultCheckIfRowIsSelectable","tableRowsSize","getSubRows","manualPagination","manualSorting","enablePagination","alwaysShowTableHeader","baseSortBy","globalActions","filtersButtonAnchorEl","setFiltersButtonAnchorEl","useSortBy","useExpanded","usePagination","addRowSelect","columnsDefinition","columnDefaults","DefaultRenderer","useTable","manualSortBy","manualGlobalFilter","autoResetSelectedRows","autoResetPage","getTableProps","getTableBodyProps","headerGroups","reactTableRows","reactTablePage","gotoPage","setGlobalFilter","selectedFlatRows","isAllRowsSelected","setSortBy","isSomeSelected","accumulator","appliedFiltersLength","alreadySelected","setAlreadySelected","filterRef","handleFilterOpen","customProcesing","globalSearchOpen","selectGlobalSearchOpen","showGlobalFilter","defaultPageActions","dataCount","FilterIconButton","filterLength","innerRef","rowsPerPageOptions","sortedUniq","handleSortBy","sortAction","newSortBy","sortDescFirst","isSortedDesc","existingSortBy","existingIndex","hasDescDefined","sortByActual","topMessage","setTopMessage","setGlobalMessage","ShowNotRelatedServiceGroups_warning","autoHideDuration","isCards","setIsCards","print","onLoading","baseTableActions","ConfigureColumnsButton","ExportButton","selectedFilterRowProp","onDownloadTemplateClick","Table","Cards","table_id","tableHead","TableHead","headerGroup","getHeaderGroupProps","getHeaderProps","getSortByToggleProps","TableSortLabel","IconComponent","TableHeaderIcon","isSorted","hideSortIcon","TableContainer","TableToolbar","showMenu","showGlobalSearchIcon","toggleGlobalFilter","FilterContainer","BasicFilter","showFooter","tableButtonsRoot","tableButtonsRootShort","tableButtonsLeft","tableButtonWrap","tableButtonNoWrap","SelectedActions","GlobalFilter","FiltersButton","tableButtonsRight","tableButtonsRightShort","filterDisplayRoot","filterDisplayRootShort","FiltersGroupDisplay","openFilter","useCustomToolbar","useTabsSection","selectedTabValue","showClear","tableContent","tableContentShort","TableError","TableCardGrid","tableScrolling","withFooter","TableBody","rowIndex","summaryRow","tableFooter","tableFooterWithBorder","TablePagination","colSpan","rowsPerPage","labelRowsPerPage","MenuProps","menuPaper","onChangePage","onChangeRowsPerPage","newPageSize","ActionsComponent","TablePaginationActions","NoTableData","useFloatingActions","selectedFloatingActions","buttonFloatingActions","tableContainer","tableHeaderCell","borderRight","tableHeader","tableRowContainer","tableRowCell","tableRow","tableFooterContainer","shadow","useTableCardsStyle","card","cardVertical","cardHorizontal","cardSkelet","RenderTableRowsItems","aria-live","aria-busy","xs","RenderTableHeaderCells","RenderTableRows","TableCardsSkeleton","TableRowsSkeleton","sm","Toggle","Switch","BasicToggle","isChecked","setIsChecked","withInfoLabel","baseLabelStyle","FormGroup","control","FlexRowDiv","selectPrintPDF","printPDF","selectPrintPDFPrinting","selectPrintPDFisLoading","Comments","defaultComment","cannotComment","emailType","disableFileUpload","changed","setChanged","comments","finally","withMentions","Invoice","referenceName","CalendarButton","FormFundingTypePicker","isMember","selectedUser","selectedUserGroup","samePrimaryUserGroup","userGroups","Select","renderValue","classNames","ITEM_HEIGHT","displayEmpty","SavedLists","savedActions","selectedServiceGroups","fetchView","myViews","setMyViews","fetchViewState","fetchViewPromise","selectedView","displayedOptions","searchText","getViewDislpayName","renderedView","selectedChangeLocation","selectedViewChange","removeSelected","openDetailsList","FilterBox","InstrumentList","PleaseSelectView","MySavedLists","ListItemText","SharedLists","ManageLists","AddSavedView","EnumPicker","nameRender","EnumNamesArray","selectedOption","marginRight","withEnumOptions","PrintPDFSection","printPDFSections","componentRef","printClasses","forceChecked","PrintSection","sectionClass","NumberFieldFilter","assetBuildingUrl","publicBuildingUrl","LocationsUrl","initBuildingData","BuildingPicker","isAuth","assetCampusUrl","publicCampusUrl","initCampusData","CampusPicker","CampusByServiceGroupFilter","convertRoomWithBuildingName","BuildingName","assetRoomUrl","initRoomData","RoomPicker","RoomByBuildingFilter","TableToolbarHeader","FormSectionTitle","gutterBottom","memo","alertContent","showAlert","titleIcon","titleAsColumn","disableGutters","shortview","edge","titleAndIconMobile","RefreshIcon","RefreshContent","initAssetData","AssetPicker","UnconfigurableTable","onExportForImport","exportNotConfigurable","setData","setDataLength","setControlledPageCount","serializedCustomFilter","handleSelectedRowsChange","StyledTopBar","drawerWidth","sidePanelWidth","drawer","transitions","easing","sharp","duration","leavingScreen","enteringScreen","SubTopBar","attrs","easeInOut","ProfileSection","StyledUserMenu","Section","LeftSection","RightSection","RowSection","FormFieldsBox","SectionTitle","GetBooleanByKey","EnableLegacyScheduler","FormAssetsPicker","initReservationStatusMultiData","ReservationStatusMultiPicker","BaseOptionsMultiPicker","ResrvationStatusMultiFilter","Future","getInitUpcomingReservationfilterMultiData","UpcomingReservationfilter","AllReservations","WorkflowBookingFilter","WorkflowBookingPicker","initReservationByIdWithPartsData","ReservationByIdWithPartsPicker","ReservationByIdWithPartsFilter","InstrumentFilterChip","InstrumentsFilterDisplay","handleDelete","border","noWrap","chip","GetFilters","RG_DatePeriod","pushServicesFilter","initData","pushBookedByFilter","budgetsFilter","getBudgetsFilterSettings","pushAssetCatGroupFilter","pushAssetCatFilter","pushAssetAvailabilityFilter","initInstituteData","InstituteFilter","ExcludeStatus","UserGroupFilter","ReservationsRelatedToReservationId","refreshAfterInit","ReservationParts","OrderedBy","ReservationStartsOn","DatePickerFilter","ReservationEndsOn","Loanable","Duration","NumbersRangeFilter","Department","initDepartmentData","DepartmentFilter","InstituteType","initInstituteTypeData","InstituteTypeFilter","Model","TextFieldFilter","ModelNumber","pushRoomFilter","pushBuildingFilter","Discipline","UserDisciplineFilter","initUserDisciplineData","pushBudgetManagerFilter","pushCampusFilter","UpcomingReservations","pushWorkflowBookingFilter","AssetCatGroupName","initAssetCatGroupData","AssetCatGroupFilter","AvailabilityType","initAvailabilityTypeData","AvailabilityTypeBookableFilter","BudgetManager","AssetCategory","initAssetCatData","AssetCatFilter","RoomPickerFilter","Building","BuildingPickerFilter","includeAllMyManagedServicesOption","allMyManagedServicesOption","AllMyManagedServices","InstrumentServiceName","ServiceAdminFilter","ServiceReservationFilter","ServiceMultiFilter","pushServicesCalendarFilter","renderFilterDisplay","Campus","CampusFilter","initWorkflowBookingData","doSaveState","doSetRepetitiveValue","repetitiveSaga","saveState_success","setRepetitiveValueSuccess","setRepetitiveValue","repetitiveValueHandler","resetRepetitiveHandler","useRepetitiveSlice","ServiceGroupRegistrationStatus","configurableColumnsCache","force","param","getTableColumns","ConfigurableColumnsSetUp","j","hasCustomName","CustomName","ColumnExportConfig","RemindBefore","defaultUrl","initUserMultiData","UserMultiPicker","filterKey","FormOnlineServicesComboPicker","FormOnlineServicesSinglePicker","mapAssetsToServiceFilterDto","mapAssetsToServiceTypeFilterDto","FormBudgetPicker","ServiceRequestMilestoneStatusesUnionArray","toDown","AlertStart","AssignUsers","AssignedUsers","AlertDescription","Downtime","InstrumentWasDown","EventEnd","EventStart","OfflineRemarks","ReasonType","ReasonTypeId","ReasonTypeName","getSingleReminder","RemindMeBefore","WorkOrderTypeStatus","StatusName","RepairCodes","SymptomCodes","AlertTitle","AutoCreateTitle","StaffFormValues","fv","SubmissionFormValues","StuffCustomForm","HasAletForm","IsClosed","ClosedStatuses","ShowOnCalibrationHistory","NotEditable","entities","workModel","repeatAsset","times","repetitive","alert","offlineStart","offlineEnd","dur","alertStart","offend","parseRepetitive","assetGuid","Guid","ass","timesGuid","AssetId","MaxDate","RepeatAssets","RecurringAssetUniq","RecurringGroupUniq","AssetName","getAlertStart","remindBefore","doNotNotify","oneday","twodays","threedays","oneweek","onemonth","isExport","expaneded","customparams","getPredicates","bulletedStyles","overflowX","rowOverRule","SimpleList","BulletedList","infoColors","colorInfoFull","cyan","colorInfoDark","colorInfoHover","colorInfoRegular","colorInfoComponents","colorInfoComponentsLight","colorInfoBorders","colorInfoDisabled","colorInfoBgHover","colorInfoBg","colorInfoBgLight","MuiButtonOverride","textDecoration","contained","containedSizeSmall","containedSizeLarge","textSizeSmall","textSizeLarge","sizeLarge","iconSizeMedium","iconSizeLarge","iconSizeSmall","MuiIconButtonOverride","MuiToggleButtonGroupOverride","borderColor","grouped","groupedHorizontal","borderLeft","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","groupedVertical","MuiToggleButtonOverride","boxSizing","createBreakpoints","lato_Light","src","lato_Regular","lato_Bold","lato_Black","DefaultThemeSettings","typography","overrides","MuiCssBaseline","unicodeRange","BookitThemeSettings","mobileStepper","speedDial","appBar","modal","snackbar","light","textHover","accent","blackComponent","graySubtitle","backgroundHover","grayDividers","MuiTypography","colorError","colorPrimary","colorSecondary","colorTextPrimary","colorTextSecondary","MuiAppBar","colorDefault","MuiLink","MuiSelect","MuiInputBase","adornedStart","paddingLeft","adornedEnd","paddingRight","MuiFilledInput","borderBottomColor","underline","transform","shorter","easeOut","marginInline","borderBottomStyle","marginDense","paddingBottom","inputMarginDense","inputHiddenLabel","inputMultiline","inputAdornedStart","inputAdornedEnd","MuiFormHelperText","MuiFormGroup","MuiFormLabel","asterisk","MuiInputLabel","formControl","animated","MuiInputAdornment","positionStart","positionEnd","MuiSvgIcon","fontSizeSmall","MuiList","MuiListItem","MuiListItemText","MuiListItemIcon","MuiAvatar","MuiTableContainer","MuiTable","MuiTableHead","MuiTableBody","MuiTableRow","MuiTableCell","head","footer","MuiTableSortLabel","MuiTablePagination","caption","spacer","toolbar","menuItem","MuiTextField","MuiChip","MuiButton","MuiIconButton","MuiToggleButtonGroup","MuiToggleButton","MuiSwitch","verticalAlign","colorAdjust","switchBase","shortest","thumb","track","MuiFormControl","marginNormal","MuiFormControlLabel","WebkitTapHighlightColor","labelPlacementStart","labelPlacementTop","labelPlacementBottom","MuiCheckbox","MuiRadio","PrivateSwitchBase","MuiBadge","badge","MUIDataTableBodyCell","MUIDataTableBody","MUIDataTableHeadCell","contentWrapper","fixedHeader","toolButton","MUIDataTableToolbarSelect","paddingLe","MuiDialog","paperWidthXs","scrollPaper","paperWidthFalse","paperScrollPaper","paperFullWidth","MuiBackdrop","MuiAlert","MuiMenu","MuiMenuItem","MuiPickersDatePickerRoot","toolbarLandscape","dateLandscape","MuiPickerDTToolbar","MuiDrawer","up","paperAnchorDockedLeft","MuiPickersToolbar","MuiPickersToolbarButton","toolbarBtn","MuiPickersToolbarText","toolbarTxt","toolbarBtnSelected","MuiAutocomplete","MuiTabs","flexContainer","scrollable","indicator","MuiTab","wrapper","textColorInherit","MuiTooltip","darkTheme","grey","green","animalsThemeSettings","h5","h6","body1","body2","CreateTheme","baseTheme","createMuiTheme","getBaseTheme","handleBadRequest","ModelState","ms","initLocationData","LocationPicker","serviceGroup","initServiceGroupsMultiData","initFiltersServiceGroupsData","ServiceGroupByDivisionsFilter","ServiceGroupsPicker","useGlobalServiceGroupsFilter","applyGlobalServiceGroupsFilter","gloabalSettings","HideTopServiceGroupFilter","AssetRenderer","ButtonConfirm","confirmationDialogTitle","confirmationDialogBody","AreYouSure","InvoiceDetailsSidePanel","InvoiceDetailsSidePanelLink","InvoiceDetails","RequiredFieldsContext","createContext","requiredFields","ValidationSchemaProvider","skipValidation","describe","fieldValidationSchema","getIn","tests","Provider","useIsRequired","useContext","getRunTypeOptions","getRunTypeValue","runtype","RunTypePicker","BooleanRenderer","OnlineServiceType","getSingleOnlineServiceType","GetAvailableOnlineServiceTypes","roomsEnabled","Software","LocalApp","Relay","IpRelay","WebRelayTm","WebRelayX600m","UsageForm","LoanDesk","DoorAccess","NiDAQmx","KmTronicRelay","RaspberryPi","initOnlineServiceTypeData","getOnlineServiceTypeAssetFilter","enabledTypes","enabledUsageTypes","enabledRemoteTypes","OnlineServiceTypePicker","RoomUserRoleEnabled","filterUrl","initRegionData","RegionPicker","useResponseModel","ShortText","FullText","ImageGallery","imageRendering","backgroundSize","backgroundBlendMode","HtmlRenderer","fullText","setFullText","needButton","setNeedButton","clientHeight","scrollHeight","clientWidth","scrollWidth","ShowMore","ArrayRenderer","indx","AssetRowState","UsersRenderer","Email","OfficeTel","AssetLocationLastUpdate","assetId","fetchState","fetch","Updated","DoubleRender","AssetComments","staffonly","noTitle","getAssetEditLink","divisionId","getRows","PropName","Image","defaultImgSrc","defaultImgMobileSrc","defaultImg","pathSrc","setPathSrc","loadingImg","setLoadingImg","imageDimensions","setImageDimensions","checkImage","onload","onerror","cardImageMobile","backgroundRepeat","backgroundPosition","AssetDetailsImageRender","AssetImageSizeType","NoHeader","validToRender","editLink","DivisionId","ApprovalRequired","TrainingMandatory","MinimumReservationDurationH","MaximumReservationDurationH","ReservationMinimumGap","CarryOverTimeSlotGap","CarryOverTimeSlotTypeName","dependencies","AssetsInstituteBusiness","DivisionName","Accessories","AssetCatEnabled","SeeAllRelatedAssets","setProps","actionType","assetCatGroupId","AssetCat","GroupId","customPredicates","hideCoresToggle","AssetsSelection","InternalServiceAvaliable","assetCatId","NickName","OtherNames","Brand","RoomNumber","LocationsList","EquipmentExpert","ContactsPersonForEquipment","ExternalCompany","MainSpecificationRange","ElectricalSpecs","FunctionalCharacteristics","WebLink","RoutineActiveAnalysisCapable","Tags","Asset_ExtraDate0","Asset_ExtraDate1","Asset_ExtraDate2","Asset_ExtraDate3","Asset_ExtraDate4","Asset_ExtraDate5","Asset_ExtraDate6","Asset_ExtraDate7","Asset_ExtraDate8","Asset_ExtraDate9","Asset_ExtraText0","Asset_ExtraText1","Asset_ExtraText2","Asset_ExtraText3","Asset_ExtraText4","Asset_ExtraText5","Asset_ExtraText6","Asset_ExtraText7","Asset_ExtraText8","Asset_ExtraText9","Asset_ExtraText10","Asset_ExtraText11","Asset_ExtraText12","Asset_ExtraText13","Asset_ExtraText14","Asset_ExtraText15","Asset_ExtraInt0","Asset_ExtraInt1","Asset_ExtraInt2","Asset_ExtraInt3","Asset_ExtraInt4","Asset_ExtraDec0","Asset_ExtraDec1","Asset_ExtraDec2","Asset_ExtraDec3","Asset_ExtraDec4","Asset_ExtraBool0","Asset_ExtraBool1","Asset_ExtraBool2","Asset_ExtraBool3","Asset_ExtraBool4","Asset_ExtraUrl0","Asset_ExtraUrl1","Asset_ExtraUrl2","Asset_ExtraUrl3","Asset_ExtraUrl4","Asset_ExtraRichText0","Asset_ExtraRichText1","Asset_ExtraRichText2","Asset_ExtraRichText3","Asset_ExtraRichText4","Asset_ExtraDDL0","ExtraDDL0","Asset_ExtraDDL1","ExtraDDL1","Asset_ExtraDDL2","ExtraDDL2","Asset_ExtraDDL3","ExtraDDL3","Asset_ExtraDDL4","ExtraDDL4","Asset_ExtraDDL5","ExtraDDL5","Asset_ExtraDDL6","ExtraDDL6","Asset_ExtraDDL7","ExtraDDL7","Asset_ExtraDDL8","ExtraDDL8","Asset_ExtraDDL9","ExtraDDL9","Asset_ExtraDDL10","ExtraDDL10","Asset_ExtraDDL11","ExtraDDL11","Asset_ExtraDDL12","ExtraDDL12","Asset_ExtraDDL13","ExtraDDL13","Asset_ExtraDDL14","ExtraDDL14","Asset_ExtraDDL15","ExtraDDL15","BrandBarcodeNumber","ServiceContract","WarrantyEndDate","LifeDateView","ExportLicense","InternalEquipmentBarcodeNumber","AccountingId","State","SectionName","AssetClassification","AssetLocation","AssetContacts","AssetIdentifiers","AssetAdditionalInfo","AssetSectionLabel7","AssetSectionLabel8","AssetSectionLabel9","AssetSectionLabel10","Doi","doiURL","AssetDoiTooltip","RenderStatus","AssemblyStructure","AssetDetailsLink","Details","renderItem","childRes","Range","MinValue","MaxValue","CommentsAndAttachments","CommentsAreStaffonly","isBookable","isOnlineService","moveArrayItem","pos","ri","GetReservationEnabled","notAllowReservations","reservationEnabled","GetUsageEnabled","autoMode","AutoMode","LocalAppEnabled","GetAlertsEnabled","alertsEnabled","RemoveLastEmptySections","pop","GetRawSections","CheckEmptyRawSections","RemoveEmptySections","GetSections","noNameSection","GetRowsSections","leftRes","rightRes","checkSection","getSectionsFilter","resSections","imageSection","removeArrayItem","RowToSections","leftSections","rightSections","RowsToSections","fetchAssetBy","fetchAssetByInternal","Division","AssetCatGroup","AlertsEnabled","fetchAssetAdditionalData","buttonsData","ButtonOrLink","CreateAnAssetRelatedEvent","fetchAlertTypesPromise","fetchAlertTypesState","fetchAlertTypes","downtimeProps","mismatchCore","PleaseSelectAnEventType","Event","ExcludeAssetDocumentsColumns","AssetDetailsFiles","documentsColumns","getColumns","assetPredicate","groupPredicate","DocumentsTable","notFullWidth","noLabelRendersArray","asHtmlRenderArray","DefautltCell","RenderRows","cellData","RenderLeftSection","RenderRightSection","MismatchCore","MismatchCoreMessage","updateGlobalServiceGroup","sg","MismatchAssetCore_warning","SwitchToThisCore","AssetDetailsTabContent","AssetBookingRules","InstrumentRestrictions","initUser","showTable","assetPickerDisabled","withNoPadding","hideEquipmentFormTitle","withNoWrapper","BaseFilterValues","GetFilter","SetValue","GettableCount","AssetTrainingSessionsColumns","GetPredicates","serviceGroupPredicate","Trainer","updateCounters","AssetTrainingSessions","filterBy","rf","getTrainingFilters","trainingSessionsColumns","AddNew","ManageSessions","goToTrainingSessions","hasNextSession","trainingSessionPrimaryAction","TrainingSessionsTable","AssetArticlesTable","articlePrimaryAction","ArticlesTable","AssetWorkOrdersColumns","AssetCalibrationColumns","calibrationPredicate","GetWorkOrdersTableCount","AssetWorkOrders","workOrdersColumns","PageActions","allowToAddNew","NewWorkOrder","WorkOrder","initAsset","assetName","workOrderPrimaryAction","goToWorkOrders","WorkOrdersTable","ActiveIncidents","Badge","BadgeCounter","hasValue","DropDownTabsWrapper","AssetMobileDropDownTabs","tabs","tabsId","tabsPanelId","handleTabChange","selectedTab","tabPanels","getTabProps","ListItemSecondaryAction","TabPanel","scrollableContent","Content","AssetDetailsTabs","setSelectedTab","handleSelectedTabChange","tabsPanels","BasicTabs","selectedTabIndex","ExpandableRows","DefaultRows","DefaultAttributes","countersForTabs","Reservations","Schedule","WorkOrders","Calibrations","enabled","Publications","TrainingSessions","AssetPopUp","useRedirectToDash","addFromCalendar","setRows","selectColumns","setSelectColumns","expandColumns","setExpandColumns","setButtonsData","idChanged","setIdChanged","loadingAdditionalData","setLoadingAdditionalData","loadingButtonsAdditionalData","setLoadingButtonsAdditionalData","openEndUsage","setOpenEndUsage","endUsageProcessing","setEndUsageProcessing","assetCover","counters","setCounters","assetProps","isDashboardCore","assetFieldEnabled","tempCounters","updateCountersEnable","dict","loadAdditionalData","ad","AssetAssemblyStructure","Allowed_ByTraining","EndUsageIds","CanRequestAccess","ApprovalStatusId","CanBeCreatedFromLinkOnly","ReservationEnabled","loadButtonsAdditionalData","UsageEnabled","CanStartUsage","CanEndUsage","PlanedEventsEnabled","AlertInfo","NotifyExists","ShowFeed","loadCounters","GetTrainingSessionsTableCount","GetArticlesTableCount","enabledAssetProps","columnNamesFilter","setRequestParams","rn","addArrayItemByName","moveArrayItemByName","rs","assetProp","handleEndUsage","usageData","AssetDetailsApi","catch","getTopAssetActionsDropDown","isMismatchCore","canAddQuiz","useAssetsPermissions","NotificationIsAvailable","EditSettings","Settings","menu_AddNewTrainingSessions","NewTrainingSession","UntrainedToolTip","Calendar","Timeline","PrintSelectedAssetLabelsButton","PrintLabels","menu_ReservationsHistory","UsageHistory","Quizzes","TrainingQuiz","AlertsIcon","ScheduledEvents","RequestAnOtherService","CreateNewSampleRequest","ResCancelNotifications","ReservationNotification","NotifyToolTip","NoNotifyToolTip","EditRemainders","AddRemainders","CalendarPublicIntegrationFeed_Icon","OutlookGoogle","useTopAssetActionsDropDown","addWorkOrder","addReservation","ReservationCreateButton","PlaceAReservation","instruments","openPanelOrCover","addUsage","StartUsage","Use","StopUsage","Stop","addTakeDown","hasDownActive","noAlerts","hasActive","alertId","HasActiveDownAlertsAdmin_info","Up","TrendingUpRounded","HasNoAlertsAdmin_info","SampleRequests","ReportAConsumable","stid","ReportConsumables","LogConsumables","SwitchToCoreOpenItsBoard","CoreBoard","approvalStatus","RequestAccess","addRequestAccess","assetActionsDropDown","AssetDetailsTab_Details","commentsForStaff","BookingRules","AssetDetailsTab_WorkOrders","handleCloselClick","dataFound","ShowAssetFull","EndUsageConfirm","usageId","usageProcessing","Messages","err_Equipment_NotFound","NotFoundPage","tt","isPathAndQuery","ActionIconButton","SwitchTarget","updateX","openReservation","openWorkOrder","SwitchToReservationTitle","SwitchToDowntime","setSelectedOption","OpenWorkOrderButton","buttonName","orderId","bringBackUp","orderProps","panelProps","openOrder","menu_EditWorkOrder","WorkOrderLink","useOpenWorkOrderPopUp","panelState","useCommentStyles","commentSection","commentTextFiles","commentText","nameAndTime","nameTitleButtons","nameTitle","useContainerStyles","commentsContainer","sectionTitle","controlBox","addCommentBox","leftSide","rightSide","alertSpacing","flexBasis","itemCheck","fileSizeToString","dp","thresh","abs","units","FileButton","canRemove","onDeleteFile","openDelete","setOpenDelete","sendNotifications","msg_DeleteFile","Grid","rawName","suffix","shortenName","Delete","err_DeleteFileFailure","selectLargeFilesUpload","largeFilesUpload","selectLargeFilesCanUpload","selectLargeFilesUploading","selectLargeFilesStartedToUpload","selectLargeFilesUploadTargetId","selectLargeFilesUploadFilesNumber","selectLargeFilesUploadSelectedFiles","minChunkSize","UploadLargeFile","_pause","_busy","finished","fileId","uploadId","NeedCompleteMultipartUpload","uploadResponses","pause","DeleteUnfinishedLargeFiles","chunkSendResult","continueFrom","uploadEnd","CompletionResult","conscreateCancelToken","chunkSize","uploadChunk","Result","FileId","UploadId","ETag","PartNumber","CompleteMultipartUpload","finish","uploadChunck","fileName","chunck","EMPTY","chunk","FileCard","remorFile","canUplpoad","setInProgress","setProgress","setPart","setError","setShow","setPause","getFileSize","notificationActions","uploadLargeFile","closeHandler","deleteUnfinishedLargeFiles","upload","stopAndCancel","Card","CardContent","ErrorDueUpload","ReUploadFile","string","SelectFile","filesPlaceholder","downloadFileName","maxFilesCount","maxSize","maxFiles","onDrop","acceptedFiles","useDropzone","getRootProps","getInputProps","StyledDropboxContainer","borderWidth","borderStyle","outline","LargeFilesUpdate","AllowLargeFilesUpload","fh","MaxLargeFileSize","MaxUploadFileSize","DragTheFilesOrBrowse","Attachments","Template","AddComment","bindSubmitComment","formRef","scrollIntoView","behavior","block","inline","userSchema","Users","initial","handleSubmit","resetForm","validationSchema","formik","submitForm","getFieldHelpers","VisibleToUsers","fixedWidth","WriteAComment","isSubmitting","CommentCell","onEditComment","onDeleteComment","setHover","setEdit","setFiles","currentUserComment","CreatedBy","uploadedFiles","commentId","filesUpload","getComments","newComment","Avatar","onMouseEnter","onMouseLeave","Edit","CommentsContainer","emailBody","emailSubject","shouldSendEmail","setCount","sortedComments","writeCommentOpen","setWriteCommentOpen","sendMail","useSendMail","createEmail","DefaultEmailTemplateBody","DefaultEmailTemplateSubject","DefaultPageName","DefaultReferenceName","CommentsCount","Comments_EmptyMessage","Subject","renderToStaticMarkup","SaveToLog","Cc","Bcc","AddService","addService","getServiceTypes","fetchServiceTypes","setServiceTypes","fetchServiceTypeState","fetchServiceTypePromise","onClickCapture","ContentWrapper","NotFound","AddConsumable","InventoryBatchChip","renderService","onServiceClick","onAddBatchClick","renewStock","handleServiceChange","onRenewStockClick","batchRequested","savedCreatableRenewal","handleBatchListClose","availableBatches","currentBatch","handleChipSelect","InventoryBatchEmptyGenerateOn_info","InventoryBatchEmptyGenerateOff_info","InventoryBatch_notFound","handleBatchListOpen","InventoryBatchList","addNewBatchClick","onBatchClick","selectedBatch","showRenewStockButtons","createdRenewal","batchId","batches","QuickItem","QuickServiceItem","mandatory","handleRemove","createdEditable","minStep","maxStep","handleAddError","setQuantity","err_Quantity_required","IsAdminOfService","counterUpdated","setCounterUpdated","arrowTitle","RenewStockArrow_info","ReservationOfflineServiceEditArrow_info","ConsumableCreateArrow_info","ReservationOfflineServiceCreateArrow_info","serviceChange","change","withError","precision","err_LowQuantity","err_HighQuantity","OfflineServiceMandatory_info","valid","StyledBaseTextField","spin","AddCoverConsumable","onAddClick","AddServiceFromSelection","addServices","removeServices","addAndRemoveServices","newSelectedServices","updated","setUpdated","isBarcodeScanned","added","QuickServiceItems","BookQuickServices","refreshServices","refreshCosumables","offlineActions","initServicesFunc","onServiceRemove","onServicesRemove","onServiceUpdate","createServiceFromServiceType","createServicesFromServiceType","loadSeviceTypes","useAssetSelection","onAddAndRemoveServices","showScannerView","fetchServices","currentUser","serviceCreated","setServiceCreated","setServices","fetchServicesState","fetchServicesPromise","handleRemoveService","handleAddService","StokRenewed","handleAddServices","handleRemoveServices","newServices","handleAddAndRemoveServices","staticServices","addedServ","focusedService","hasServices","ScannerView","selParams","offTypeIds","BookitDateTimePicker","dateId","timeId","dateName","timeName","dateLabelInline","timeLabelInline","parsedValue","setTimeValue","setDateError","handleDateChange","displayValue","getSeconds","handleTimeChange","dateError","timeError","setTimeError","handleOnError","onDateError","onTimeError","noLabelInline","datePlaceholder","timePlaceholder","selectAssetInventory","assetInventory","selectRoomSelected","selectedRoomState","selectLocationSelected","selectedLocationState","selectSubLocationSelected","selectedSubLocationState","selectScanProcessing","scanProcessing","selectNoRoomAccessProcessing","noRoomAccessProcessing","selectInventoryLogFilters","logFilters","ViewLengthsArray","viewLengthOptions","shortName","viewTypeOptions","Wrapper","DivStyle","viewBox","fill","xmlns","clipPath","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","visibility","hasPopupIcon","hasClearIcon","clearIndicatorDirty","popperDisablePortal","disabledOpacity","filterByServiceGroups","initCompleted","ServiceGroups","InvoiceStatuses","RepetitiveFor","DATE_PERIODS","DatePeriodsPicker","getOptionsCallback","getUnitTypesData","UnitTypePicker","MAX_SIZE_DEFAULT","AssetThumbImage","hasImgeBroken","setHasImgeBroken","avatar","alt","getContrastText","FormAutocompleteOptions","FormAutocomplete","FormAutocompleteMultiOptions","FormAutocompleteMulti","ExternalApi","formFieldId","isMultiple","OptionsSourceType","deserializeOptions","optsArray","opt","CustomFormDropDown","externalLoadData","getBlackColorOption","getColorOption","serializeSchedulerDateOrUndefined","formType","updateOption","reccurentAssetId","recurrentGroupId","alertTypeId","operation","Values","rowValues","getArray","modelValue","LocationDetails","hasChanges","shallowEqual","DeatilsOperations","handleSubmitForm","submitFormRef","handleCancelClick","PageComponent","bindSubmitForm","handleSubmitCallResult","submitcall","LocationContent","ModelDetails","Update","IdSpec","onBeforeunload","CatRateTypes","InvoiceChildRowBaseSchema","PleaseSelectABudgetNumber","PleaseSelectServiceGroup","PleaseSelectADate","AllowCreateInvoicesBy","AddPayment","notifyActions","submitRef","refreshTable","sendResponse","closeApproved","closeRejected","paymentId","invoiceId","submit","payment","PaymentApi","UpdatePayment","success_EditInvoicePayment","err_EditInvoicePayment","err_InvoicePaymentAdd","budget","Method","setinitialValues","BudgetNumber","MethodId","PaymentMethodName","isMounted","PaymentSchema","optional","err_PaymentMethodRequired","PleaseEnterAnAmount","positive","InvalidValue","getPaymentSchema","PaymentSchemaWithBudgetNotRequired","getPaymentSchemaWithBudgetNotRequired","Paymentform","validateOnMount","inputMode","FormPaymentMethodPicker","PaymentMethod","Submit","Payment","AddPaymentInvoice","ChargeApi","Resource","OtherService","BaseRate","CatRateTypeId","FeeType","SampleTypeId","SampleType","ActualRate","FormCatRateTypePicker","CatRateTypePicker","OfflineServicePicker","FormOfflineServicePicker","FormSampleTypePicker","FormServiceUserGroupPicker","ServiceUserGroupPicker","AddCharge","insertedAt","setinsertedAt","insertedBy","setinsertedBy","userGroupByBudeget","Manual","setInitialValue","OnlineServiceId","OnlineService","CatRateType","SampleServiceId","SampleService","queryBudg","budgetRes","serviceGroupRes","budegtval","success_EditInvoiceLine","msg_addedChargeSuccessfully","budgetOnly","CreateInovicesBy","AlllowCreateInvoicesBy_BudgetsOnly","ChargeSchema","catRateType","Refund","Discount","negative","GetChargeSchema","ChargeForm","setAmount","bySystemSetting","manual","setValues","produce","Equipment","Charge","AddManualInvoiceLine","LabelTypePage","LabelTypeEdit","useAllowedToChangeStatus","readOnlyUser","ArticleDetails","selectedArticle","refreshDetails","isSaved","articleDetailsForm","allowedToChangeStatus","CreatedByMe","PublicationRecordApproved_info","useCanEdit","canEdit","canAdd","useCanAdd","firstLoad","setFirstLoad","ExternalId","ExternalIdSource","openExternalEntry","ArticleEdit","editArticle","ArticleForm","getValue","PublicationDetails","EditAssociationButton","Authors","EnteredBy","EnteredAt","ArticleDoiLink","doi","ArticleDataset","Dataset","ISSN","ORCID","ORCIDs","Year","RelatedUser","RelatedUserDisplayName","CalibrationRecord","Journal","ArticlePageNumber","PageNumber","ParticipatedLabs","ParticipatedInstruments","Abstract","EditArticle","EditAssociation","AssociateThisPublicationTitle","AssociateThisPublication","FormAssetPicker","assetSchema","assetsSchema","GetInstrumentFilter","sv","GetCalibrationRecordFilter","test_s","FormCustomPicker","CustomPickerFilter","ArticleWorkOrdersPicker","ArticleFormPicker","NewArticleDetailsForm","oldServiceGroups","setOldServiceGroups","setServiceGroups","setInstruments","canEditStatus","setCanEditStatus","ServiceGroupAsset","otherwise","handleCloseClick","instrumentFilter","CalibrationRecordFilter","handleFormChange","setTouched","ArticleContributionLevelId","FirstInstrumentAssetName","FirstServiceGroupAssetName","CalibrationRecordName","DepartmentName","InstituteName","InstituteTypeName","statusPickerData","AddPublication","validateOnBlur","ValueLabel","ArticlePleaseSelectEquipmentFirst","PleaseSelectWorkOrder","CalibrationRecord_info","PleaseSelectAUser","PleaseSelectAsset","ArticleComments","commentsFormRef","setchanged","newSavedComments","setNewSavedComments","newComments","setNewComments","Article","portalRef","Portal","ConvertNewToComment","EditArticleDetailsForm","editProcessing","detailsLoading","submitCommentRef","GetServiceGroupAsset","SaveFormButton","ConvertModelToEntityUserAttributesDetails","Attribute","AttributeLocalized","SSO","SSOAttribute","RegistrationForm","UserDetails","UserSidePanel","Order","ConvertEntityToModelUserAttributesDetails","UserAttributesApi","userAttributesDetailsSaga","initUserAttributesDetails_Success","initUserAttributesDetails_Error","initUpdateUserAttributesDetails_Success","initUpdateUserAttributesDetails_Error","menu_UserAttributes","UserAttributesDetails","createUserAttributesDetails_Success","createUserAttributesDetails_Error","updateUserAttributesDetails_Success","updateUserAttributesDetails_Error","initUserAttributesDetails","initUpdateUserAttributesDetails","createUserAttributesDetails","updateUserAttributesDetails","resetUpdateUserAttributesDetailsState","resetCreateUserAttributesDetailsState","userAttributesDetailsActions","selectUserAttributesDetails","userAttributesDetail","selectCreateUserAttributesDetails","selectCreateUserAttributesDetailsCompleted","selectUpdateUserAttributesDetails","selectUpdateUserAttributesDetailsCompleted","selectUserAttributesDetailsProcessing","UserAttributesForm","isNotEditableField","userAttributesDetailsSchema","sso","formikHelpers","UserAttributeDetails","MandatoryFieldsArePartOfTheRegistrationForm","hasUnsavedChanges","requestCreateCompleted","requestUpdateCompleted","createModel","editModel","baseModel","requestCompleted","setRequestCompleted","handleSaveClick","EditAttribute","AddNewAttribute","Priorities","getInitialValues","getTicketSchema","samplesAutomationEnabled","parentSamplesCount","samplesRequired","PriorityPicker","FormPriorityPicker","FormServiceRequestStatusPicker","ServiceRequestStatusPicker","Form","AssignedSamplesToThisTicket","AddSubTicket","ServiceRequest","SubSamplesCount","TotalSamplesCount","handleCancel","AddSubServiceRequestTicket","editState","editItem","enableAddSubTicket","handleAddSubTicketClick","ParentTicketDetailsButton","getServiceRequestTicketTitle","ServiceRequestTicket","ServiceRequestTickets","StockRenewalForm","innerFormRef","onAddServiceClick","fieldHandler","validateForms","resetFieldHandler","serviceChanged","setServiceChanged","recentMostBatchesChanged","setRecentMostBatchesChanged","allIsValid","setAllIsValid","servicesSelected","setServicesSelected","validateForm","otherServicesSchema","changeOfflineServices","stockRenwevalSchema","err_OfflineServiceTypeRequired","err_DateReceived_required","initServices","prepareService","StockRenewal","createServices","onRemoveService","onRemoveServices","onUpdateService","loadServiceTypes","validateOnChange","enableReinitialize","setErrors","ReportConsumablesMainInfo","ReceivedDateTimeLabel","AutoGenerateNewBatchesDisabled_info","AutoGenerateNewBatches_info","ReportedConsumables","staticService","initialServices","actionCompleted","stockRenewalServicesData","isReadOnlyUser","RoomOnly","assetsFilter","renewProps","batchProps","StockRenewals","RenewStockForm","batchChanged","setBatchChanged","serviceTypeSelected","setServiceTypeSelected","computedSchema","renewStockSchema","currVal","err_IntQuantityOnly","Batch","withMutation","NotAllowNegativeInventory_currentEqualsZero_err","NotAllowNegativeInventory_currentMoreThanZero_err","err_InventoryBatch_required","RenewStockInfo","Consumable","FormOfflineServiceTypePicker","PleaseSelectServices","FormInventoryBatchPicker","AddNewBatch","EditSelectedBatch","renewStockData","RenewStockOfConsumables","InventoryBatchForm","inventoryBatchSchema","BatchName","err_BatchName_required","BatchExpirationDate","BatchPurchaseDate","err_BatchPurchaseDate_required","BatchInventory","err_BatchInventory_required","BatchLot","BatchPurchasePricePerUnit","NotAllowNegativeInventory_err","BatchInfo","Inventory_ServiceType_Description","inventoryBatchData","CreateNewBatch","ArticleAssociationForm","SidePanelRenderer","TrainingDetails","QuizCreate","StartQuiz","QuizzDetails","QuizDetails","AddBillingAction","LabelType","RestrictionDetails","PricePeriodsDetails","ArticleNew","InvoiceTemplatePopUp","CoreSelection","CalendarMessagesDetails","ServiceRequestMilestone","ServiceRequestMilestoneDetails","ServiceRequestMilestoneCharge","ServiceRequestMilestoneChargeDetails","InvoiceBatchesComments","AssetInventoryLog","InventoryLog","RegionDetails","assetBaseUrl","AssetCatGroupPicker","noGlobalServiceGroupFilter","InstitutePicker","AssetCatPicker","DepartmentPicker","InstituteTypePicker","DEFAULT_WIDTH","tryCleanValue","titleValue","parsedTitle","htmlParse","maxChars","toCharsWidth","data-html","TruncatedDescriptionText","Styled","toCssWidth","BasicCard","cardContent","iconTitle","maxContentHeight","imgError","setImageError","imageUrl","loadImage","showHeader","contentHeight","mouseUp","setMouseUp","trimTitleText","trimmedTitle","trimSize","StyledCard","cardActive","cardInfo","cardSuccess","cardWarning","cardError","position_vertical","position_horizontal","cardSize_small","cardSize_medium","parentElement","ImageContainer","mobileSizeMedium","mobileSizeSmall","onLoadedMetadata","onLoad","BasicCardWithInfo","additionalFilters","multipleServiceGroups","filterSettingToCondition","extractValuePart","doLogin","doRedirectToLogin","internalIdLoginSaga","SESSIONSTORAGE_KEY","storeInternalIdLogin","sessionStorage","removeItem","setItem","loadInternalIdLogin","getItem","storedIdentity","init_success","isLargeAnimals","General","InternalId","login","redirectToLogin","logout","initialized","returnUrl","identity","clearError","useInternalIdLoginSlice","FormUsersPicker","initSubLocationListData","SubLocationListPicker","ReservationEditButton","useReservationEditBehavior","ReservationEditButtonLink","legacyURL","selectRouterSlice","router","selectRouterLocation","selectRouterSearch","selectRouterSearchParams","selectRouterPathname","BudgetExperimentStatuses","baseUrl","initSuperGroupData","SuperGroupPicker","WorkButton","getAssets","setAssets","workTypes","setWorkTypes","workTypeLoading","setWorkTypeLoading","assetLoading","setAssetLoading","handleAssetChange","getParamFromUrl","handleWorkTypeClick","AssetAlertType","sympt","aStatus","aStart","sid","AddEvent","wrap","QuickWorkOrderPleaseSelectAssets","wt","NoAlertTypesFoundForSelectedAssets","RegionFilter","onlineUrl","initMyAssetAvailabilityTypeMultiData","initMyAssetAvailabilityTypeOnlineMultiData","MyAssetAvailabilityTypeMultiPicker","filterLengs","badgeContent","showZero","openProps","ReservationLink","openDetails","useOpenReservationPopUp","getLink","useReservationLinkUrl","ClickToSeeReservationDetails","ctrlKey","resProps","SchedulerConnectedWithFilters","customDaysEnabled","twoDaysEnabled","new_state","setFilterOpen","handleFilterClose","handleSetPeriodFilter","updateSearchPeriod","handleViewTypeLengthChange","noChangeLocation","presetValue","searchComp","servicesLimit","limitReached","SchedulerServicesLimitReachedWarningMessage","CalendarHeader","onMultipleModeChange","onFilterClose","onFilterOpen","ErrorBoundary","fallBack","Scheduler","defaultDuration","presetPosition","onDataUpdated","onViewModeChange","onEdit","onCreate","reservationEditEvents","getFilters","MyListFilter","CalendarPageDefaultRedir","calendarPathUserProfileKey","defaultPathName","savedPathName","savedSearch","calendarPageDefaultPath","CalendarPagePaths","CalendarPage","viewStateSearchParams","parseViewState","searchParams","purlSearchParams","schedulerServices","selectedMultipleEvents","handleEdit","handleCreate","selectedEquipment","GetBooleanFilterOptions","BooleanPicker","hideAlert","useDialogAlertSlice","_log","errorInfo","TitleSection","ShortTitle","showCopy","setShowCopy","copied","setCopied","truncatedTitle","cliTruncate","iconSize","domNode","attribs","class","attributes","haidProject","group","combineMandatoryOfflineServices","RemainedSlots","MaxAttendees_NA","TrainingSessionPicker","PleaseSelectATRainingSession","ReservRelatedFilter","RemindBeforePicker","UserGroupsProviderTypes","tableRoot","filterPanel","tableButtonsLeftShort","divider","nonEmpty","singleValueToId","mapped","scrollablePanel","hidden","aria-labelledby","initValue","initids","getGetUserSelectionsAutocompleteFn","CustomFormUserSelection","selectRepetitive","selectRepetitiveData","selectRepetitiveFieldHandler","initSampleTypeData","SampleTypePicker","RegionLink","openRegion","useOpenRegionPopUp","initialModel","FormRadioGroup","submitCount","showError","touched","StyledFormControl","StyledFormLabel","StyledFormTitle","RadioGroup","StyledFormHelperText","FormLabel","CustomFormAnswerQuestions","QuizScore","Points","indexToAlpha","CustomFormCheckBox","CustomFormDate","CustomFormDisclimer","CustomFormEmail","CustomFormNumberText","CustomFormParagraph","FormParagraph","CustomFormPositiveNumberText","CustomFormRadioGroup","CustomFormRichText","CustomFormShortText","CustomFormField","CustomFormDisclaimer","CustomFormFileUpload","requireComponent","bookitlab","BookitLab","syncSchedulerEvents","_events","mappedEventIds","getState","min_date","max_date","mapfn","usePrevious","convertAuthToIUserFilterDto","SamplePlatePositionNamingTypes","CustomFormApi","customFormId","CustomFormContent","validationEnabled","sectionStyles","withTopSeparator","withBottomSeparator","isVisibleField","sortedActiveFormFields","styleSection","formName","formIsValid","setInitialValues","CustomFormControl","FormType","onLoadCompleted","onLoadStarted","originalFiles","setOriginalFiles","fetchCustomForm","loadValue","fieldId","InitFormFiles","resvalue","fetchFormValues","getFormValues","fetchFormState","fetchFormPromise","loadedValues","serializedvalues","vals","initServiceRequestStatusMultiData","ServiceRequestStatusMultiPicker","exclude","BillingActionsApi","insertBillingActionsDetails","updateBillingActionsDetails","deleteBillingActionsDetails","billingActionIds","getBillingActions","screen","getBillingActionById","billingActionId","getBillingActionInvoices","batchInvoiceIds","processEmailAction","billingActionsParams","invoiceIds","ProcessSftpUploadAction","processStatusAction","getRecipientsEmailAddresses","billingActionsRow","emailTypes","EmailRecipientTypes","ShowOn","specEmailAddresses","SpecificEmailAddresses","useReservationPermissions","IsAdminOrOwnerOf","PaymentMethods","DateLabel","ShouldCloseInvoice","FormRow","wrapOnMobile","shrinkClass","hideRow","selectSamplePlates","samplePlates","selectSamplePlatesData","selectSamplePlatesTableState","selectSamplePlatesCreate","selectBulkSamplePlatesCreate","selectSamplePlatesUpdate","DownloadFileButon","Error_FileNotAvailable","Download","TrainingActivationAllowedBySGAOnly","UpdateActiveTrainingWarningTitle","DeactivateTrainingMessage","ActivateButton","DeactivateTraining","Deactivate","FormInputFile","helper","fileInputProps","errorMesage","showPreview","saveFiles","TransformDate","ctx","isType","WorkOrderPicker","WorkOrdersCalibrationFilter","woTypeId","excludeIds","loadWorkOrders","FormRestrictedUserGroupPicker","StatusFilterId","IncludeStatus","EditableTable","getToggleAllRowsSelectedProps","getToggleRowSelectedProps","tableInstance","isSomeselected","handleExport","newPage","range","SamplePlatePositionsPicker","plateId","samplePlateId","loadDatax","plate","SamplePlateTypeRows","columnsCount","SamplePlateTypeColumns","SamplePlateTypeColumnsNaming","Alpha","fromCharCode","SamplePlateTypeRowsNaming","S2Value","TargetSamplePlatePositionsPicker","FormGradientPicker","EstimatedRuntimeMinutes","SampleOverhead","TotalOverhead","SecondaryEquipment","CreateSampleRunReservation","runDetails","save","setSave","formikRef","CreateReservation","InstrumentId","SecondaryInstrumentId","GradientId","srsid","getReservationDuration","handleCreateReservationButtonClick","DialogTitle","RunDetailsCreateReservation","SaveGradient_info","DialogContent","SampleRunGradient","DialogActions","totalMinutes","ImportSamplePlateForm","setFile","generatePlatesonImport","setGeneratePlatesonImport","handleFileChange","handleCheckboxChange","ImportRecords","ImportComponent","hideMessage","onDownloadTemplateButtonClick","GeneratePlatesOnImport","FormRoomPicker","FormLocationPicker","importStarted","importFinished","ImportTargetSamples","ExportForImportRunDetailsSamples","exportConfigurableColumns","samples_url","exportUrl","GetSelectedActions","validUpdate","Suffix","PopupSuffixComponent","handleSubmitk","AnalyticalSampleIDSuffix","AnalyticalSampleIDSuffix_info","Continue","AnalyticalSampleIDSuffixPopup","SuffixDialog","disableEscapeKeyDown","RUN_DETAILS_PAGE_PATH","RunDetailsPage","requestactions","instrument","secondaryInstrument","gradient","createdDate","acquision_type","showSuffixDialog","setShowSuffixDialog","samples","handleCompleteButtonClick","submitSuffixDialog","showCompleteDialog","runId","handleExportButtonClick","handleDownloadTemplateButtonClick","SampleId","TMT_Type","TMT_Label","SamplePlateId","UniquePlateNumber","PlatePosition","NumericalPlatePosition","charCodeAt","CellPositionToNumber","SamplePlatePicker","TargetSamplePlatePositionPicker","ExportForRobot","useConfigurableColumnsAdvanced","SampleRunsDetails","handleDownloadTemplateClick","DownloadTemplateRunDetailsSamples","hideImportButton","RunDetailsPageInstructions","ExportRunDetailsSamples","paddingX","EmailNotificationsApi","NOTIFICATIONS_LOG_PAGE_PATH","TTable","EmailNotificationsPage","withGlobalServiceGroupFilter","scopeOfMonth","DeleteEmailNotficationsMonth","EmailNotficationsScreenWarning","isMainAdmin","Timestamp","Recipient","RecipientName","EmailTo","EmailCc","EmailBcc","EmailMessage","Attachment","selectedRowActions","DeleteEmailNotificationsRows_info","DeleteRows","ConfirmDeleteEmailNotif_title","ConfirmDeleteEmailNotif_message","OK","postData","DeleteNotifications_success","DeleteNotifications_error","menu_EmailNotifications","WebkitBoxShadow","WebkitTextFillColor","caretColor","inputTypeSearch","forwardRef","inputComponent","Input","AdminActions","adminSettings","adminSettingsActions","ar","AssetsRelatedSetting","ButtonLink","StyledLink","GetResponseMessages","infoText","initProjectData","ProjectFilter","AllBudgets","UserDisciplinePicker","loadPublicData","UserDisciplinePublicPicker","initServiceTypeData","ServiceTypePicker","withServiceGroupFilter","BookitlabLogo","BookitlabLoginLogo","initInvoiceIdData","InvoiceIdMultiPicker","getQrUrl","urlTemplate","assetDetails","AssetBarcodeUrlTemplate","getAssetQrUrl","Handlebars","compile","getQrUrlH","generateLabel","labelXml","assetData","globalThis","dymo","framework","openLabelXml","objectMapping","getObjectMapping","objectName","writeData","splittedData","SubLocationName","setObjectText","staticObjectNames","getObjectNames","nameParts","assetPropertyName","properties","shift","Dymo","getPrinters","dymoLabelPrinterOption","printer","Device","initDymoFramework","getLabelWriterPrintersAsync","dymoPrinters","preview","labelType","blob","dataURItoBlob","Xml","download","Blob","getLabelXml","printParams","createLabelWriterPrintParamsXml","twinTurboRoll","TwinTurboRoll","errorDetails","dataURI","byteString","atob","mimeString","ab","ArrayBuffer","ia","Uint8Array","registerHelper","maxLength","fillString","padStart","DymoPrinter","Zebra","BrowserPrint","getLocalDevices","device_list","uid","noEscape","labels","zebra","Printer","stopWatching","send","getPrinterInterface","doGetPrinters","doGetLabelTypes","doGetObjects","doOpen","doPrint","labelPrintSaga","printers","DymoPrinterSupported","dymo_printers","getPrinters_Error","ZebraPrinterSupported","zebra_printers","serializablePayload","getPrinters_Success","labelTypes","getLabelTypes_Success","getLabelTypes_Error","loadObjects","assetResponse","roomResponse","locationlistsResponse","sublocationlistsResponse","samplePlatesResponse","consumableTypesResponse","getAssetDetails_Success","getAssetDetails_Failure","selectLabelPrint","getAssetDetails","getLabelTypes","DymoPrinterIsNotSupported","print_Error","ZebraPrinterIsNotSupported","printerInterface","RoomBarcodeUrlTemplate","LocationBarcodeUrlTemplate","SubLocationBarcodeUrlTemplate","SamplePlateBarcodeUrlTemplate","ConsumableTypeBarcodeUrlTemplate","QR","printAction","print_Success","printState","closeAssetLabelPrintDialog","selectedPrinter","selectedTemplate","download_Success","download_Error","preview_Success","preview_Error","labelPrintActions","useLabelPrintSlice","initTrainingLevelData","TrainingLevelPicker","TrainingLevelFilter","trainingLevelPermissionsEnabled","userPermissionsEnabled","eq","UseServiceGroupTrainingLevels","initAssetMultiData","AssetMultiFilter","AssetWorkOrderMultiFilter","LocationPickerFilter","objectFit","CustomerLogo","customerLink","setCustomerLink","customerImg","setCustomerImg","TopCustomerLogoLink","TopCustomerLogo","CompanyLogo","CampusPickerFilter","ExportQRCodesButton","ExportQR","initAreasData","AreasPicker","EmailType","EmailTypeUnionArray","titleStyles","titleContainer","titleBody","titleSubtitle","closeButton","BasicDialogTitle","disableTypography","BaseToggleButton","mainIcon","separated","ToggleButton","BaseToggleButtonGroupInner","otherOptions","toggleValue","setToggleValue","handleOtherChange","handleToggleValue","newViewType","ToggleButtonGroup","errorBorder","fullWidthButton","hasStartIcon","hasEndIcon","hasMainIcon","withTitle","Other","BaseToggleButtonGroup","filterRoot","scrollPaperCompact","useGlobalDOMEvents","keyup","Filters","PaperComponent","StyledDialogPaper","BackdropProps","invisible","clickAway","clickAwayFunc","AddReservation","serviceIdsRawValue","serviceIds","ServiceGroupsFilter","SuperGroupFilter","assetTagsUrl","publicAssetTagsUrl","initTagsData","intIds","strIds","TagsPicker","LoanTypeOptions","initLoanableData","LoanablePicker","initStatusData","StatusPicker","initLockersData","LockersPicker","SubLocationFilter","printtopdf","PrintToPDF","printPDFFisLoading","startPrinting","setStartPrinting","promiseResolveRef","handlePrint","useReactToPrint","documentTitle","printTitle","onAfterPrint","onBeforeGetContent","saveMarkedSections","StyledDiv","PrintToPDFPopup","preparing","AssemblyTypes","initAssemblyTypeData","AssemblyTypePicker","SceletonBox","allFiltersLength","loadBookableData","AvailabilityTypeBookablePicker","useRemoveSearch","useAsyncDebounce","Search","NewWorkOrderButton","loadingAsset","setLoadingAssets","useLocationChange","previus","bindPopover","getAssetIds","getEquipmentIds","fetchDownOrders","downOrders","setDownOrders","fetchOrdersState","fetchOrdersPromise","calendarLinkParams","calendarLink","alertslink","aid","downTime","BringBackUpOnWorkOrders","BringBackUpOnCalendar","bookMultiple","menu_WorkOrders","excludeFroExport","configurableColumnsExport","GetTargetColumns","columnsToRemove","ExcludeColumns","Popover","rootMobile","elevation","closeButtonTitle","BasicDialogContentWithTitle","titles","formContainer","MuiDialogContent","BasicDialog","dialogStyles","BasicDialogActions","BasicCheckBox","CardGrid","StyledToolbar","cp","doiId","tryGetDoiFromUrl","externalIdSourceType","linkURL","getSinglePaymentMethod","PaymentMethodEnumPicker","SamplePlatePositionPicker","SourceSamplePlatePositionPicker","onImportButtonClick","getSinglePriceSheetMethod","PriceSheetMethodPicker","SourceUrl","ServiceRequestsApi","UpdateStatuses","DeleteRequests","AddRequest","osid","purchaseOrder","updateAdminOnComment","DefaultFilter","DecimalRenderer","getSingleServiceTypeEnum","initServiceTypeEnumData","ServiceTypeEnumPicker","Workflow","Workflows","GetAvailableServiceTypes","DateField","DialogForm","FormContent","subTitle","AddChargeButton","singleAdminServiceGroup","ServiceGroupBudgetsAdmin","chargesProps","withoutGlobalServiceGroupFilter","initEquipmentsData","ReservationEquipmentsPicker","ReservationSingleEquipmentPicker","ReservationsEquipmentFilter","firstInitEquipments","mandatoryIds","FormReservationEquipmentsPicker","autoExpand","FormReservationStatusPicker","ReservationStatusPicker","ReservationCustomForm","customForms","customFormRef","mandatoryForms","optionalForms","isAsyncChangeLoading","selectedForms","formValuesForms","formId","BudgetListener","setUserGroup","initilized","setInitilized","UserNameListener","equipmentSettings","UserGroupListener","StartTimeListener","initialStart","initialEnd","changeHandler","prevStartTime","setPrevStartTime","prevEndTime","setPrevEndTime","isStartChanged","isEndChanged","prevEnd","EndTimeListener","setInitialized","newEnd","ChipCheckBoxGroup","isRow","ChipLabelGroup","FormChipCheckBoxGroup","setOnChanged","FormChipLabelGroup","ReservationOfflineServices","savedServices","savedServiceEditable","offActions","reservationSettings","hanleUpdateLocalServices","OfflineOptional","ServiceGroupServicesAllowed","fetchServiceType","sortFunc","ReservationOfflineServiceDefaultRemarks","servicesFiltered","responseDel","fetchAnyServices","potentialData","hasAnyServices","setHasAnyServices","fetchAnyServicesState","fetchAnyServicesPromise","AccompaniedServicesPicker","SingleAccompaniedServicesPicker","ReservationsAccServicesFilter","FormAccompaniedServicesPicker","CancelReservationButton","ApproveReservationButton","SaveForLaterButton","TransferButton","TerminateReservationButton","CreateTrainingButton","isLoaanDesc","onTerminate","settingActions","terminateProcessing","endUsageOfflineServiceIds","setEndUsageOfflineServiceIds","showConfirmEndUsage","setShowConfirmEndUsage","showEndUsage","setShowEndUsage","usageEndProcessing","setUsageEndProcessing","hasUsageProcessing","setHasUsageProcessing","HasUsage","OfflineServiceTypeIds","TerminateReservationMobile","TerminateReservationWithUsage","FormTrainingSessionPicker","budgetDtoFields","budgetExperimentDtoFields","getLoadData","getBudgetExperimentsValidForReservationPathInfo","getBudgetExpandClause","pp","userId","ReservationBudgetExperimentPicker","getDefaultBudgetExperiment","selectedExpirementId","FormReservationBudgetExperimentPicker","fetchDefaultBudgetExperimentState","fetchDefaultBudgetExperiment","setValueRef","serializedServices","deserializedServices","componentDidMount","BudgetTaskBudgetId","getReservationsLink","trainingSignUp","EditTrainingSessionLink","trainingSessionId","TrainingSignUpAdminAlertContent","attendees","getSessionSlots","Attendees","TrainingSessionsCountMessage","ManageSignUps","EditTrainingSession","trainingSesisonId","FormReservationTimePeriodPicker","StartTimePropertyName","startField","startMeta","EndTimePropertyName","endField","endMeta","endHelpers","getStoreValue","handleStartTimeChange","originalStartTime","originalEndTime","diff","adjustEndByStart","onStartTimeChange","handleEndTimeChange","onEndTimeChange","datePickerVariant","startTimeLabel","startTimeDisabled","endTimeLabel","endTimeDisabled","fetchAssemblies","sorted","Path","assembly","assemblyParts","EquipmentsDataAssemblies","reservedAssemblyParts","extendState","fetchAssembliesPromiseState","fetchAssembliesPromise","popperAnchor","equipmentsData","reservedAssemblyPart","RenderAssemblyParts","NoDataFound","PartsIncludedWithin","err_ErrorOccured","ReservationWorkOrders","onWorkTypeClick","refreshWorkOrders","equipmentIds","relatedAssets","relatedWorkOrders","workOrdersLink","workOrdersLinkTitle","ReservationAlertsLink","titleLink","StaffOnly_Icon","NoReservationAlerts","PleaseSelectAnAlertType","FormWorkFlowBooking","useWorkFlowPicker","entityVal","ReadOnlyDetails","DetailsWrapper","ReservationAdvancedDetails","LastUpdated","LastUpdatedBy","ReservationRequestDetails","relatedReservation","RequestWrapper","TotalRowsCount","TotalSamples","AssociatedRowsCount","SamplesAssociatedWithThisReservation","ReservationForm","repetitiveFormRef","onEquipmentClicked","onRestrictionsClick","onStatusChange","onOfflineServiceClick","editable","timeEnabled","waitingTransferApproval","transferToUser","terminationEnabled","transferForId","handleTerminate","allowEditMultipleEquipments","offlineServicesErrors","assistedTrainingData","allowOngoingModifications","requestedFor","equipmentChangeState","equipmentChangeCompleted","insertUpdateCompleted","savedForLater","isCreditSubmited","durationErrors","setDurationErrors","permissionErrors","setPermissionErrors","prerequisitErrors","setPrerequisitErrors","customFormErrors","setCustomFormErrors","otherErrors","setOtherErrors","otherWarnings","setOtherWarnings","otherInfo","setOtherInfo","otherSuccess","setOtherSuccess","customFormOnlyPrinted","mandatoryServices","ParentName","resetAllErrors","currentFormFiles","originalFormFiles","reserValueKey","saveRequestedValue","addPrerquisitErrors","PrerequisiteTrainings","ErrorMessage","pre","AllRestrictions","per","prerquisitErrorsHandler","nodes","addDurationErrors","durationErrorsHandler","addOtheMessages","setMessage","otheMessagesHandler","addCustomFormErrors","customFormErrorsHandler","addPermissionsErrors","permissionsErrorsHandler","userGroupChanged","setUserGroupChanged","bookedbyChanged","setBookedByChanged","staffChanged","setStaffChanged","accServiceChanged","setAccServiceChanged","budgetChanged","setBudgetChanged","statusChanged","setStatusChanged","startTimeChanged","setStartTimeChanged","endTimeChanged","setEndTimeChanged","tutoringChanged","setTutoringChanged","optionalChanged","setOptionalChanged","trainingSessionChanged","setTrainingSessionChanged","setOriginalFormFiles","setCurrentFormFiles","setFirstInitEquipments","currentStatus","setCurrentStatus","isTrainingSignUp","setIsTrainingSignUp","userProfileVisible","tutoringVisible","tutoringEnabled","tutoringAllowed","forceTutoring","hasValidTraining","RequiresAdminApproval","trainingSessionVisible","workflowBookingVisible","workflowBookingEnabled","trainingSignUpVisible","staffVisible","reservationCollaboratorsVisible","staffRequired","warningMessages","AvailableInstrumentsMessage","ReservationPendingApproval","Approve","res_wrn_NewPendingReservation","RequireGroupCoordApprovalMessage","res_wrn_NewPendingCoordReservation","res_wrn_DraftReservation","MakeFirm","Transfer","ReservationTransferMessage","TrainingSessionsRes_warning","infoMessages","TutoringAssistedReservation","AssistedReservationsPendingApprovalInfo","TransferReservation","TransferredToDetailsMessage","CancelTransfer","resIdTransferredFrom","TakeOverTransfer","NotUsingThisReservation","TerminateReservationInfo","ReleaseUnusedTimeButton","session","ReservationSidePanelAssemblyPart_ErrorMessage","successMessages","ReservationAssistedApproved","equipmentsChangeHandler","selectedEqs","extendStaffMandatoryEquipment","staff","extendMandatoryEquipments","initStaffReservation","staffEquipmentId","accid","singleClick","ft","terminated","staffUser","initTrainingSession","trainingSessionData","setStaffEquipmentRestricted","staffUserName","err_res_StaffUserEquipmentRestricted","staffChangeHandler","StaffEquipmentId","setEquipments","staffEquipment","mand","alleqs","staffUserChangeHandler","multipleEquipmentsChangeHandler","getMandatoryOfflineServices","warn_TrainingSessionsTimeSlot","SignUp","trainingSessionChangeHandler","TrainerName","TrainingSessionData","DefaultBudget","validations","resultValidation","PermissionErrors","UserCanRequestApproval","err_MultipleEquipmentsWithAndWithoutAccServices","reservationSchema","err_OnlineServiceFieldRequired","AssemblyPartReservationCanNotBeUpdatedDirectly","HideExperiments","res_err_BudgetExperimentRequired","err_UserFieldRequired","_errStartTimeRequired","_errEndTimeRequired","err_EndTimeLowerThanStartTime","valueOf","OrderStatus","ExperimentEln","Experiment","Attendance","PartialAttendanceStartDuration","PartialAttendanceEndDuration","AccompaniedService","CollaboratorUsers","BudgetIsRequired","err_AccompaniedService_required","StaffUserRequired","err_WorkflowBookingRequired","handleFullDayReservationChange","fullDayReservation","currentPeriod","adjusted","adjustSchedulerEventTimes","partialReservationDetailsState","messageList","reservationCollaboratorsFilter","getReservationCollaboratorsFilter","staffUserPickerPredicates","warningNodes","infoNodes","successNodes","PleaseSelectAnAccompaniedService","rotate","AddingsMandatoryEquipments","AddingsOptionalEquipments","ReservationName_Desc","FullDayReservation_Description","SponsorDepartment_Desc","ReservationUser_Desc","IsDefault","StaffUser_Info","PleaseSelectStaffUser","CollaboratorUsers_Info","ReservationTrainingApproval_Desc","TrainingSignUp_info","RepetitiveControl","RepetitiveReservation","ReservationSampleRunId_Desc","ApproveTrainingRecords","handleApproveOnce","handleEditAssisted","appSetActions","existingTrainings","servicesWithoutTraining","TrainingRecordId","showPopupAccordingToSetting","NotShowPopup","showPopup","handleEditClick","equId","equIds","fatherId","rid","handleNweCreateClick","handleCreateTrainings","TrainingLevelId","trdata","TrainingsCreatedSuccessfully","TrainingsAlreadyExist","ApproveOnce","menu_EditUserTraining","CreateDetailedTraining","ApproveForGood","AssistedReservationApprovalOptions","This_user_already_has_a_valid_training","CreateNewTrainingRecord_YesNo","handleTransfer","transferAllowedToGroup","adGroup","budgetExpirementModuleEnabled","trnsferSubmitted","trasferToUser","setTranferToUser","TransferReservation_info","TransferToUser","ReservationModifications","Field","OldValue","NewValue","Done","ModificationsHistory","Period","CreditContainer","CalculatePricing","creditProcessing","creditCompleted","Pricing_EstimatedCost","PricingConfirmationLabelEditText1","PricingConfirmationLabelText1","Pricing_Balance","Pricing_BalanceResult","onCloseReservation","printActions","repetitiveValues","reservationProcessing","confirmAssisted","transferStepWaiting","transferUser","transferredForId","reservationNotFound","setPrint","printExpanded","setPrintExpanded","handlePrintToPDF","handleClosePrintToPDF","confirmBeforeTransfer","setShowTransfer","setConfirmBeforeTransfer","showConfirmRecurring","setShowConfirmRecurring","showConfirmAssisted","setShowConfirmAssisted","createTrainingOpen","setCreateTrainingOpen","showTransfer","showCalculateCredit","setShowCalculateCredit","confirmCloned","setConfirmCloned","canceled","setCanceled","openModifications","setOpenModifications","userReadOnly","allowSortenReservation","timeEnabledForOwner","canBeCanceled","canBeApproved","canSaveForLater","reservationCanceled","calculateButtonVisible","not_restricted","noInstumentRestricted","confidential","workOrderSwithProps","eqids","cancelReservation","approveReservation","draftReservation","handleChangeStatus","setOfflineServicesErrors","handleSetError","AutoEndReservation_remarks","handleUpdateAllRecurrent","handleUpdateFollowing","Following","handleByApprovalConfirm","editAssisted","onTrainingClose","handleEquipmentClick","handleRestrictionsClick","restrictProps","handleOfflineServiceClick","otherProps","woProps","handleAddBatchClick","handleCalculateCredit","mactions","CancelReservation","ApproveReservation","CreateTraining","OfflineServicesError_info","CalculatePricing_info","res_SaveAndClone_info","SaveAndClone","CreateAndClone","relId","ShowRelatedReservations","PrintPdf","pageTitle","CloneReservation","menu_ReservationDetails","menu_NewReservation","ByApprovalAvailable","CancelMultipleReservations","UpdateMultipleReservations","WeeklyReservationConfirmationMessage","JustThisOne","CancelFollowing","UpdateFollowing","CancelAll","CloneReservationConfirm","Proceed","transfer","ByApprovalConfirmationModalTitle","ReservationConfirmByApproval","justifySelf","RestrictedNotAllowed","MinTimeAheadPeriodTypes","RestrictionsApi","TrainingStatus","PrerequisiteFor","UserOwnPermissions","onUserChange","permLoading","restrictedOption","handleUserChange","userIsAdmin","ShowRestrictionsFor","clearOnBlur","permRoot","Valid","contentRow","PermissionName","TimeSlotTypeName","TimeSlotTypeId","NoAdditionalRestrictionsFound","res_err_Permissions_StaffOnly","cardTitle","titleOverRule","rowTitle","rowText","cardActions","cardActionsButtons","restUrl","UserPermissionsApi","authuser","equipmentId","setEquipmentId","equipmentGroupId","setEquipmentGroupId","selectedService","setSelectedService","setSelectedUser","fetchRestrictions","restrictions","setRestriction","fetchRestrictionsState","fetchRestrictionsPromise","userRestrictions","setUserRestrictions","fetchUserRestrictions","username","fetchUserRestrictionsState","fetchUserRestrictionsPromise","fetchAsset","fetchAssetState","fetchAssetPromise","getStatus","validRender","PrerequisiteTrainingsIndicators","found","CoreWideRequirement","prerequisites","PrerequisiteEquipments","preq","usrrest","ImageName","userOnChange","assetOnChange","RenderContent","Permissions","Passed","Expired","PreApproved","PreApproved_info","MinReservationOrder","MaxReservationOrder","CarryOverTimeSlotTypeId","MinTimeAheadPeriodValue","MinTimeAheadMinutesSinceMidnight","MinimumTimeAhead","AdvancedReservation_info","ToBeBookedBy_info","Before","AdvancedReservation","MinTimeAheadPeriodType","OnTheSameDay","ToBeBookedBy","RestrictionsOverview","BypassQuotas","BypassQuotasForReservations","BypassUserQuotasAndGaps","BypassUserQuotasAndGapsD","BypassUserQuotasAndGapsD_Description","BypassUserQuotasAndGapsD_DescriptionCont","BypassMinResDurationD","BypassMinResDurationT","BypassMinResDurationD_DescriptionCont","AdditionalRestrictions","SpecificUserSlotPermissions_info","ReservationRestrictions","Prog4biz","BookitlabCopyrightNoticeTitle","SoftwareBy","SystemTime","TermsOfUse","CopyrightSection","Copyright","webVersion","lastUpdate","appOffset","appNow","setAppNow","interval","setInterval","clearInterval","align","disableVersionOnMobile","messagesState","selectMessages","selectMessagesAlreadyExist","useOpenReservationSidePanel","useMessageStyles","closeAllKey","pageToType","calendar","reservationStarted","usageReservation","secondaryPage","alreadyExists","hideIconVariant","preventDuplicate","maxSnack","MaxMessage","variantInfo","MessagesChildren","useSnackbar","enqueueSnackbar","closeSnackbar","useMessagesSlice","allMessages","clear","closeAllOptions","removableAnnouncment","gotIt","DashboardAnnouncement","CloseAll","GotIt","RenderMessge","Announcment","loadDesk","ReservationStartedMessage","AllUsagesEnded","InstrumentStillReservered","ReleaseUnusedReservation","YouHaveOngoingReservations","curr","ReservationStarted","UpdateOngoingReservations","UsageReservationMessage","IpRelay_reservationTimeForInstrument","IpRelay_LinkToUsage","CalendarMessage","LoanDeskMessage","ReservationStartedMessage_LoanDesk","WithSpace","Truncicated","getSize","parsed","moreTitle","MoreTitle","truncate","createElement","classList","innerText","appendChild","inner","innerHTML","parentNode","removeChild","MoreLink","MoreButton","TitleIfExists","MorePopUp","WebkitLineClamp","WebkitBoxOrient","BarcodeScanApi","sublocationId","doSetSelectedRoom","doSetSelectedLocation","doSetSelectedSubLocation","doSetNoRoomAccess","assetInventoryStateSaga","setSelectedRoom_Success","setSelectedLocation_Success","setSelectedSubLocation_Success","QRCodeBaseLength","minBarcodeAssetLengthString","MinAssetQRLength","setScanProcessing","scanManualBarcode_error","room","subLocation","Barcode","RoomDetails","scanManualBarcode_Success","roomResult","LocationListId","SubLocationDetails","roomSelected","setNoRoomAccess_error","setNoRoomAccess_success","setSelectedSubLocation","setSelectedLocation","setSelectedRoom","scanManualBarcode","setNoRoomAccess","setNoRoomAccessProcessing","setLogFilters","assetInventoryActions","useAssetInventorySlice","doeRefreshReservations","addReservations","addUsages","addLoanDesks","addCalendarMessages","doGotIt","messagesSaga","calendarUrl","func","funcs","getPageMessages","_action","reservationsInValue","_i","usagesInValue","LoanDeskInValue","LoanDesks","withNull","calendarInValue","calendars","refreshUsages","messagesActions","EndUsageOfflineServices","offlineIds","UsageOfflineServiceDefaultRemarks","titleVariant","setSelectedServices","setRemarks","setIds","setReset","setUsageData","confirmUsageEnd","setConfirmUsageEnd","usage","endUsageWithOffline","endUsageOfflineValid","ConfirmEndUsage_title","EndUsageConfirmTitle","EndUsageRoot","isProcessing","UsageEndOfflineService","ReasonRemarks","UsageEndRemarksPlaceholder","ConfirmServicesCorrectly","ConfirmEndUsage","ConfirmEndUsage_err","actionsStyles","rootMobileHorizontal","poperPaper","poperRoot","poperTitle","PopperTitle","poperTditle","RichTextEditor","HideCommentSharingForAllUsers","FormAdminUsersPicker","FormAdminSingleUsersPicker","applyForceFullDayReservations","forceFullDayReservations","truncatedEndTime","flow","partialRight","setItems","FilterChip","FilterDisplay","GetPresetDatesRangeDisplayString","getDisplay","setConfigurableColumns","loadConfigurableColumns","WrongColumnDefinition_info","fetchConfigState","getConfigurableColumns","setConfigurableColumnsExport","loadConfigurableColumnsExport","fetchExport","publicSub","redirUrl","ReturnUrl","setProcessing","handleExportForImportClick","handleExportForImport","rowsCallback","toBigQS","selectedRows","exportRows","MaxRecordsAllowedAssetImport","messageLongQS","err_ImportForExportFailed_longQS","deffMessage","err_ImportForExportFailed","showSingleExportButton","ExportButtonTooltip","ExportToXLSX","DownloadTemplate","allActions","ConfigurableColumnsLink","Columns","prevLocation","TabsWrapper","TabPanelWrapper","shrinkLabel","saveRepetitive","setInitData","RepetitiveData","newcomment","newFiles","buttonId","ImportRecordsDescription","ImportRecordsSteps","ToImportNewRecords","UploadTheUpdatedFile","patternOrChannel","keyfn","tasks","isKeyEmpty","task","InvoiceTemplatesApi","insertInvoiceTemplate","invoiceTemplate","HeaderFile","FooterFile","updateInvoiceTemplate","deleteInvoiceTemplates","invoiceTemplatesIds","getInvoiceTemplateById","ReferenceType","BasicDialogContent","StyledDialogContent","MainTicket","SummuryBox","ErrorsSummury","ArticlesExternalSearchPagePath","ArticlesExternalSearchPage","budgetExperimentsFilter","resStart","resEnd","BudgetExperimentsPicker","loadBudgetExperiments","FormBudgetExperimentsPicker","setUser","setBudget","forceDisabled","serviceSettings","selectedUserGroupo","selectedUserDto","setBudgetExperiment","serviceTypeEnum","fetchBudgetExperiment","budgetExperiments","budg","experiments","ConnectedFiltersForm","ConnectedFiltersData","startLabelInline","endLabelInline","orderForConsumables","budgetPickerInfo","connectedData","userChanged","setUserChanged","budgetExpirementChanged","setBudgetExpirementChanged","ConnectedFiltersSchema","err_UserGroupRequired","reserFieldHandler","updateDataState","editAllowed","createUpdateAllowed","ConnectedFiltersControl","saveConnectedFilters","RegionsApi","doInitRegion","doCreateRegion","doUpdateRegion","regionsSaga","initRegion_Success","initRegion_Error","Region","createRegion_Success","createRegion_Error","updateRegion_Success","updateRegion_Error","initRegion","createRegion","updateRegion","resetRegionState","regionsActions","selectRegions","regions","selectRegionsProcessing","selectRegionsData","selectRegionsHasErrors","selectDetailsCompleted","regionData","regionSchema","RegionNameIsRequired","menu_EditRegion","menu_AddNewRegion","AddRegion","RegionName","PopupPrintToPDFDialog","boxcontainer","selectFileBox","infoBox","CheckBox","PopupPrintToPDFComponent","convertItemsToFlags","checkboxes","setCheckboxes","handleCheckboxChecked","static","ServiceRequestMilestoneStatusPicker","FormServiceRequestMilestoneStatusPicker","toDto","updateCharge","handleSubmitButtonClick","toInitialValues","AddMilestone","Milestone","serviceRequestMilestoneSchema","newStatus","oneOf","FormUnitTypeTypePicker","FormServiceRequestMilestoneChargeServicePicker","selectedType","setSelectedType","insertCharge","serviceRequestMilestoneId","initUnitTypeValue","addServiceSchema","handle","enableAddonCharge","enableManualCharge","ChargeTypeToggle","entityValue","ELEMENT_TAGS","A","getAttribute","BLOCKQUOTE","H5","H6","IMG","LI","OL","PRE","UL","MENTION","TABLE","TBODY","THEAD","TR","TD","TH","TEXT_TAGS","CODE","DEL","strikethrough","EM","I","S","STRONG","U","DATA","plain","deserialize","nodeType","textContent","jsx","child","deserializeHtmlString","htmlString","currentSring","DOMParser","parseFromString","serializeItemHtmlString","leaf","leafHtmlString","elementHtmlString","EMPTY_SLATE_NODE","serializeHtmlString","emptyValue","HOTKEYS","RichTextWithMentions","useCodeButton","renderElement","renderLeaf","editor","withImages","withTables","withHtml","withHistory","withReact","createEditor","setInitValue","setTarget","setIndex","setSearch","users","setUsers","mention","setMention","mentions","setMentions","showControlPanel","stringVal","isLabTech","isGroupAdmin","unmounted","Transforms","insertNodes","at","move","distance","prevIndex","nextIndex","rect","ReactEditor","toDOMRange","getBoundingClientRect","pageYOffset","pageXOffset","header","headerControls","textWithControls","textWithInfo","withTopLabel","showControls","showControlsWithTop","editorClass","editorBodyStyle","debounceValue","isCollapsed","edges","wordBefore","Editor","before","beforeRange","beforeText","beforeMatch","after","afterRange","afterMatch","newMentions","getMentions","onMentionsChange","anchor","focus","EnterAUser","spellCheck","hotkey","isHotkey","toggleMark","data-cy","char","isMarkActive","removeMark","addMark","MarkButton","useSlate","BlockButton","isBlockActive","toggleBlock","LIST_TYPES","isActive","isList","unwrapNodes","setNodes","wrapNodes","marks","StartRichEditor","isInline","isVoid","ReactDOM","createPortal","insertData","getData","insertImage","uri","fnRemoteImage","isImageUrl","isUrl","imageExtensions","deleteBackward","deleteForward","insertBreak","isEditor","SlateElement","isElement","cellPath","Point","fragment","insertFragment","Element","Leaf","ImageElement","useSelected","useFocused","TrStyled","TdStyled","Mention","withPointer","initials","defaultText","OfflineForm","connectedFiltersFormRef","connectedInit","serviceChangeState","quantityChanged","setQuantityChanged","DefaultExperiment","otherServiceSchema","LogDateTimeLabel","offlineService","creditProccessing","handleCalculateClose","topButtons","OfflineServiceCharges","refType","refId","EditOfflineServiceTitle","AddNewOfflineService","ConsumableLog","PricingConfirmationOfflineEditText1","PricingConfirmationOfflineText1","PaymentMethodPicker","checkboxProps","headerProps","checkIfRowIsSelectable","shouldSelectPage","checkIfAllSelectableRowsSelected","isSelected","isSelectPage","getToggleAllPageRowsSelectedProps","indeterminate","getConditionalSelectHeaderCheckboxProps","checkProps","getConditionalSelectColumnCheckboxProps","getToggleRowExpandedProps","ScreenToShowOn","initInstrumentCatData","InstrumentCatFilter","UserAssetContactMultiFilter","GetMessagesArray","DoAction1","Failed","DoAction","insertUserAD","BillingPreviewApi","FormView1_UpdateItem","PercentageRenderer","labelPrint","DateTimeRenderer","TruncatedLabel","ArticleLink","openArticle","useOpenArticlePopUp","DurationRenderer","totalSeconds","internalIdLogin","selectInternalIdLogin","selectInternalIdLoginUserId","selectInternalIdLoginUserName","selectLoginType","initCustomPicker","CustomPicker","selectPublicAsset","publicAsset","selectSelectedUnitItem","selectSelectedUnitSearch","selectedData","dataSearch","selectMenuOpen","menuOpen","ServiceTypeFilter","EmailApi","err_SendEmailToUserFailed","AddToLists","getEquipments","setLoadingCompleted","hasUpdateError","updateAssets","CreateList","ListRenderer","localized","notLocalizedValue","onlyone","tooltipTitle","initReservationStatusData","NaN","PopupImportExportDialog","AutomaticAssetImportNaming","ImprotData","_ScreenId","needReloadTemplateColumns","_ImportAssetImageFiles","_AutoGenerateAssetNamesBasedOn","_UpdateQRCode","_ImportAdditionalData","File","Images","RowCount","AddOnly","book","Excel","Include","fi","hvalue","cn","tvalue","ExcelName","InitHeaderByTemplate","ValueType","Null","SharedString","Formula","RichText","Hyperlink","xlsx","ws","getWorksheet","rowCount","row1","getRow","eachCell","rc","tr","GetCellData","Papa","dynamicTyping","complete","LoadXlsx","LoadCsv","selectFileHandler","Init","TypePicker","AutomaticAssetImportNamingPicker","ByAssetCatModelNumber","ImageList","RemoveImage","removeImage","SelectImageFiles","importing","setImporting","setPaths","MaximumImagesPerOneUpload","MaxImageSize","MaxLoadedAssetImageMbSize","setImages","createObjectURL","AddImages","ClearImages","RecommendationsOfLoadImages","RecommendationsBodyOfLoadImages","InformationToLoadImages","LoadImages","ClearAll","selectImageBox","PopupImportExportStep1","filetype","setFiletype","fileIsSelected","setFileIsSelected","ImportAssetImageFiles","importAssetImageFiles","setImportAssetImageFiles","handleImportAssetImageFiles","handleFileTypeChange","AssetProperties","SelectFileBox","fileType","BulkImportTitle","ImportTenplateHandler","GetTheTemplate","InfoBox","nextName","cancelName","AutoGenerateAssetNamesBasedOn","autoGenerateAssetNamesBasedOn","setAutoGenerateAssetNamesBasedOn","UpdateQRCode","updateQRCode","setUpdateQRCode","app","showInternalCode","ImportAssetAutoNaming","handleImageChange","handleAutoNameingChange","handleUpdateQRCodeChange","ImportAssetAutoNaming_info","ImportAssetsUpdateQRcodes","ImportAssetsUpdateQRcodesInfo","SelectImageFilesBox","MaxFileSize","ImportFileType","DragTheImagesOrBrowse","AssetImgSupportedTypes","BulkCreateNewRecords","Bulk_CNR1","ExcelImportSpecificRequirements","Excel_ISR1","Excel_ISR2","CSVImportSpecificRequirements","CSV_ISR1","Buli_CNR2","UpdateExistingRecords","Update_ER1","Update_ER2","Update_ER3","PopupImportExportProgress","NamePicker","headerRow","StyledTableRow","HeaderColumn","setChecked","handleCheckChandge","HeaderColumnPicker","showPicker","setShowPicker","handleValueChandge","header1","header2","containerCenter","toggleBox","PopupImportExportStep3","toggle1","setToggle1","handleColumnCheckboxChange","handleColumnPickerChange","handleToggleChange1","ToggleBox","back","backName","toggle2","setToggle2","RecordsInTheFile","handleChange1","handleChange2","defaultChecked","FirstRowContainsColumnsName","UpdateAnyExistingRecords","UncheckColumnIfYouDontWantItToBeImported","OnlyFirst5RowsOfTheFileAreDisplayedForPreview","containerRows","rowData","RowData","PopupImportExportStep5","ImportSuccessfullyCompleted","NewRecordsImported","newRows","ExistingRecordsUpdated","existingRows","ErrorsDuringImport","handleDownloadImportErrorReport","DownloadImportErrorReport","DownloadDetailedImportResults","ImportCompletedWithErrors","failed","ImportHasFailed","ImportErrorFailedMessage","ImportAdditionalDetails","ImportBackToPage","PopupImportExport","budgetType","setStep","setColumns","importResult","setImportResult","resultData","setResultData","resultFileName","setResultFileName","setNewRows","setExistingRows","cancelFileUpload","cancelImport","LoadExcelfile","LoadTemplateColumns","cc","SetTemplateColumns","ColumnCount","GenericImport","importFileResult","ImportErrors","steps","Next","UploadingFile","CancelFileUpload","RowsFound","Back","ImportingData","CancelImport","ImportRowsFor","ImportColumns","initServiceUserGroupData","initUserGroupMultiData","UserGroupMultiPicker","dosetSelectedItem","dosetSelectedItems","dosetAssetPublicFilters","publicAssetSaga","setSelectedItem_Success","setSelectedItems_Success","currValue","setAssetPublicFilters_success","setSelectedItem","setSelectedItems","setAssetPublicFilters","setMenuOpen","toggleMenuOpen","setGlobalSearchOpen","toggleGlobalSearchOpen","publicAssetActions","usePublicAssetSlice","InvoiceRowReferenceLinks","references","menu_UsageDetails","SubscriptionId","SubscriptionDetails","OfflineServiceId","PopupImport","downloadTemplateprocessing","setDownloadTemplateProcessing","TagsFilter","LoanableFilter","StatusFilter","LockersFilter","AssetTypesFilter","AreasFilter","OnlineServiceTypeFilter","AvailabilityTypeAvailableMultiFilter","AvailabilityTypeAvailableOnlineMultiFilter","TrainingStatePicker","TrainingStatePickerFilter","ReservationOrDowntimePicker","ReservationOrDowntimePickerFilter","WithReservationsOnlyFilter","ShowAll","WithEventsOnly_info","WithEventsOnly","pushReservationsOnlyFilter","Available","UnderMinimum","Maximum","SignedUp","getTrainingStatePickerFilter","getReservationOrDowntimePickerFilter","SamplePlateTypePicker","FormSamplePlateTypePicker","FormFieldsSection","FormLeftSection","pageDescription","dataErrors","setDataErrors","dataWarnings","setDataWarnings","dataSuccess","setDataSuccess","dataInfos","setDataInfos","colapsedMinHeight","handleCloseError","handleCloseWarning","handleCloseInfo","handleCloseSuccess","succ","propsValue","hasReservation","myReservationId","batchDeletable","removedBatch","setRemovedBatch","removeBatchOpen","setRemoveBatchOpen","DeleteBatchInventory_title","DeleteBatchInventory_message","Radio","RadioIconUnchecked","RadioIconChecked","initCatRateTypeData","bysSystemSetting","ImageRenderer","BaseURLMultiPicker","useServiceIdAction","hrefPath","ID","ServiceIdRenderer","OperationTypeIdRenderer","AssetImageRenderer","InternalServiceRequestStatuses","reservationsPrimaryAction","OtherServiceDetailsPage","queryProps","getParams","OtherServiceEditLink","ServiceFilter","arrayValue","arguments","prototype","excluded","sourceKeys","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","SvgChevronUp","_ref","svgRef","titleId","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","strokeWidth","strokeMiterlimit","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","_ref18","_ref19","_ref20","_ref21","_ref22","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","_ref30","_ref31","_ref32","_ref33","_ref34","_ref35","_ref36","_ref37","_ref38","_ref39","_ref40","_ref41","_ref42","_ref43","_ref44","_ref45","strokeLinecap","strokeLinejoin","_ref46","_ref47","_ref48","_ref49","_ref50","_ref51","_ref52","_ref53","_ref54","_ref55","_ref56","_ref57","_ref58","_ref59","_ref60","_ref61","_ref62","_ref63","_ref64","_ref65","_ref66","_ref67","_ref68","_ref69","_ref70","_ref71","_ref72","SvgNotavailable","SvgNotAllowed","SvgIcon","ChevronUpIcon","NotAvailableSVG","htmlColor","NotAvailableIcon","NotAllowedSVG","NotAllowedIcon","initRoomTSData","RoomTSPicker","RoomTSFilter","initTrainingProgramMultiData","TrainingProgramsMultiPicker","applyGlobalServiceGroupFilter","TrainingProgramsMultiFilter","CustomDatePeriods","ShowOnlyWithAvailability","UpcomingSessionsOnly","ActiveSampleTypesPicker","RelevantBudgetPicker","selectedBudget","budgets","CreateNewRequest","chosenUser","setChosenUser","chosenFundingType","setFundingType","chosenPurchaseOrder","setPurchaseOrder","chosenBudget","setChosenBudget","setService","initActiveSampleTypesData","getServiceRequest","getService","showProject","ProjectIsRequired","purchaseOrderLength","purchaseOrderRequired","purchaseLengthInvalid","projectIsRequired","Requests_Created_Failure","Requests_Created_Success","propsSide","mt","RequiredLabServiceLabel","PleaseSelectUser","FundingTypeRequired","Reservation_Error_ShortPurchaseOrderLength","Reservation_Error_PurchaseOrderRequired","ServiceRequests_Ordering","SidePanelRoot","SidePanelPopper","SidePanelPopup","sidePanelRootExpanded","sidePanelRootCollapsed","backdropOpen","rootopen","rootclose","mobileroot","modifiers","keepTogether","preventOverflow","boundariesElement","flip","getTermsOfUseAgreement","versionId","ExportToExcel","sheetName","sheet","addWorksheet","workBook","workSheet","addRow","columnNames","GetObjectNames","AddWorkSheetHeader","GetObjectValues","SetWorkSheetHeader","AddWorkSheetData","writeBuffer","buffer","InvoiceStatusPicker","OpenMenuButton","UserRenderer","ViewTypeLengthDropDown","onTypeLengthChange","lengthOptions","haideCalendarViewType","customTimelineDays","customCalendarDays","titletext","itemText","vt","subheader","vl","ExportToPDF","debouncedOnChange","newProps","Reflect","deleteProperty","Documents","menu_Documents","dash_EmptyWidgetTitle","dash_EmptyWidgetBody","LoadingFailed","FileName","FileNameRenderer","DocumentType","FileType","AvailableToUsers","StaffUsersFiles","StaffOnlyFiles","PublicFiles","Signups","TrainingStateRenderer","TrainingResource","DurationH","MinimumAttendance","MaximumAttendance","TotalUsedSlots","UsedSlotsRenderer","HashSymbol","HasNextSession","NextSession","ReservationLinkAction","asLinkRendered","TrainingSessions_Calendar_SignedUp","TrainingSessions_Calendar_UnderMinimum","TrainingSessions_Calendar_Maximum","TrainingSessions_Calendar_Available","iconsize","AllTrainingSessions","globalServiceGroupsFilter","newPredicates","externalPredicates","Articles","menu_AllWorkOrders","StyledScanView","BarcodeScannViewDescription","getAssetById","expandable","downloadImages","downUrl","scanBarcode","logNoRoomAccess","quizSubmissionId","fetchDataPromiseState","fetchDataPromise","backToQuizess","BackToQuizzes","Quiz","QuizzYourScoreIsXoutofY","Score","MaxScore","CongratulationsYouHavePassedTheQuiz","YouAreNowCertified","TrainingLevelName","Level","QuizSuccessTestMessage","SorryThisDidNotWorkSoWell","QuizFailureTestMessage","WorkOrderTypeStatusPicker","onlyNew","doGet","doExport","doBulkCreate","doDelete","doDeactivatePlates","doDeletePlates","getLoadDataParams","someResult","genratePlatesFromBulk","LastId","firstId","FirstId","log10","Prefix","plates","samplePlate","ParseResultBlob","jsonBlobSize","jsonBlobSizeText","jsonBlob","InsertedRows","UpdatedRows","Errors","SystemErrorMessage","testmsg","suppliersLabel","RequireSupplierExternalId","SupplierExternalId","notShowTitle","Created","LifeDate","InstrumentCat","OperationType","AssetCatName","AssetType2Counter","Overdue","DueToday","ShortDescriptionOfInstrument","AreaMapId","RoomMapId","CoreName","Raac","MainSpecRange","BrandCode","Rank","ExtraDDL8Value","GasSource","SGA_Public","UnderOriginalWarranty","WarrantyEndDateVisibleAllUsers","canview","EquipmentExperts","AssemblyParent","AssemblyChilds","BookAppVersion","BookAppVersionUpdateDate","LateTime","EarlyLeaveTime","EarlyStartAllowedMinutes","InstrumentType","LocationTracking","LocationUpdatedAt","Divisions","DivisionAssetId","RegionId","ServiceTypeEnumFilter","CloneEquipmentSettings","menu_CloneEquipmentSettings","AssetPickerFilter","DurationT","AccService","CancelledBefore","BudgetTaskName","BookedByRenderer","NumberOfUsages","LastModifiedAt","WorkflowBookingName","BudgetInternalId","RemainingDurationD","UserEmail","BudgetRemarks","UserGroupMail","DivisionDescription","BudgetFund","AssetInternalCode","AssetRoom","AssetDescription","AssetModel","AssetModelNumber","TotalReservations","BudgetInitialCost","BudgetLeader","BudgetExternalUpdatedAt","BudgetExternalEndDate","BudgetIsOnline","BudgetEndDate","BudgetStartDate","BudgetHideExperiments","BudgetSubsProfCostCenter","BudgetSubsProfProjectNumber","FacilityProject","AssetCampus","BudgetSubsProfActivity","PartialAttendanceDuration","AssetCategoryGroup","BudgetHardLimit","BudgetSoftLimit","BudgetAmount","AssetBuilding","ServiceActivityCode","AssetBrandCode","Month","WeekNumber","UserDiscipline","ServiceGroupAdminEmail","BudgetBudget","BudgetPercent","Charges","ReservationHistoryTable","addColumns","InvoiceBatchesCommentsRenderer","ipid","servicedate","be","ecid","po","factor","adg","HasBalanceOrEstimatedCharges","Company","InfiniteScroll","scrollableTarget","FrontendLayout_MainContent_ID","loader","JoinStatusEnum","RegionRenderer","EventContent","dhx_event_move","dhx_event_click","containerWidth","offsetTopHeight","formatSchedulerTime","formatSchedulerDateTime","EventHeader","TrainingSessionStatus","stateid","TrainingSessionEventConent","TrainingSessionEventHeader","TrainingSessionEventBody","ReservationStatusIcon","reservationStatus","ReservationEventConent","ReservationEventBody","columnGap","rowGap","OfflineEventConent","renderEvent","header_content","body_content","container_width","getBackgroundColor","topEventHeight","getSlotsFromEvent","scroll_hour","originalEvent","getEvent","RenderFC","eventType","RenderEvent","ReactDOMServer","HTMLReactParser","eithSlotsHeight","startHeight","defaultColor","prepareSchedulerSections","r1","groupByOption","currentIndex","groupAssemblyParts","chain","assetCat","mapServiceToSection","scheduler_services_collection_name","getServerListService","serverList","getServerList","scheduleServiceTemplate","mobileView","containerProps","scheduleServiceContainerClassName","scheduleServicePaddingMobile","scheduleServicePadding","scheduleServiceIdAttributeName","imageProps","scheduleImageClassName","labelTextProps","scheduleServiceLabelTextMobile","scheduleServiceLabelText","TimelineServiceContent","timelineEventsSortIteratee","compareFn","valueA","valueB","NoServices","NothingToShowForThisScheduler_Title","NothingToShowForThisScheduler_Message","eqStrict","fromEquals","strictEqual","eqArray","eqDependencies","ReadonlyArray","Record","EventTimelineContent","bodyContent","event_text","timeline_event_text","TooltipLine","lablel","TrainingSessionTooltip","statusTextLocalizationKey","statusTextKey","footerTextLocalizationKey","statusClickTextKey","MaxAttendees","CampusName","TrainingSignedUp","MinAttendees","TrainingSessions_Calendar_ClickToView","TrainingSessions_Calendar_ClickToSignUp","OfflineTooltip","user_name","ReservationTooltip","reservationHtml","reservationTooltipTemplate","stripHtml","DraftReservationStatus","ApprovedByStaff","tooltip_text","HIDE_TOOLTIP","TooltipElement","SchedulerEventTooltip","tooltipElementProps","GetSchedulerEventTooltipProps","tooltip_text_fn","currentPosition","forceUpdate","currentView","getView","_mark_now","deleteTempReservations","schedulerRef","deleteEvent","resetEventEdits","updateEvent","findParentTarget","selectors","closest","std","getElementSizes","sizes","_els","add_export_methods","getTimeline","mode","matrix","dpi","zoom","rtl","_export_html","_send_to_export","exportToPNG","exportToICal","_serialize_plain","exportToExcel","templates","xml_format","_serialize_columns","_plain_export_copy","$text","date_to_str","version","skin","_ajax_to_export","_create_hidden_form","firstChild","server","_hidden_export_form","_get_export_size","scales","A5","A4","A3","A2","A1","A0","dataX","cSize","initialSizes","smartRendering","timeline","smart_rendering","nav_height","xy","scroll_width","style_width","_obj","style_height","timeline_scrollable","timeline_smart_rendering","getInitialSizes","setExportSizes","setCurrentView","setInitialSizes","PrintSchedulerToPDF","NEW_EVENT_TEXT","zoomEnabled","schedulerContainer","hasCustomStart","compiledSchedulerReservationBodyTemplate","compiledSchedulerReservationTooltipTemplate","permissionsError","role_err_Permissions","DefaultDuration","restrictTimeSlots","WorkingHours","restrictDuration","durationType","durationAmount","transformedEvent","transformToSerializableEvent","useCustomCompareCallback","attachEvent","detachEvent","handleBeforeDrag","handleBeforeEventChange","is_new","new_end","newSlot","onEmptyClick","handleEmptyClick","containerClassName","action_data","getActionData","eventDate","truncateSeconds","new_event","addEvent","initSchedulerEvents","attachEventSettings","old_mode","old_date","prevViewState","currentViewState","x_size","x_length","qst","qet","offsetStart","weeks","getWeekDiff","x_start","adjustMonthTimelineLength","new_viewMode","new_date","event_bar_date","openToReport","alertType","initDate","addEventNow","DHTMLX","getSchedulerInstance","timeline_tab","calendar_tab","section_custom","all_timed","treetimeline","daytimeline","multiselect","configOptions","multi_day","details_on_create","details_on_dblclick","start_on_monday","CurrentLocale","tryGetStartOnMonday","edit_on_create","hour_date","mark_now","now_date","time_step","touch","touch_drag","delay_render","drag_event_body","check_limits","scale_width","scale_height","hour_size_px","min_event_height","parse_date","event_class","select_id","event_bar_text","week_scale_date","unit_scale_text","hour_scale","week_date_class","today","orderedServerListData","setServerList","schedulerSectionsGroupByField","y_unit","y_property","column_width","event_min_dy","createTimelineView","x_unit","x_date","x_step","second_scale","week_timeline_start","week_start","get_week_timeline_end","month_start","sharedSettings","property","unitsName","createUnitsView","_key","_label","_date","destructor","handleServiceLabelClick","handleSchedulerClick","serviceContainer","serviceIdAttributeValue","getServiceIdFromServiceClickEvent","dom","capture","stringifiedServices","parsedServices","updateCollection","updateServerList","nonWorkingHoursRef","getUnits","timeSpans","deleteMarkedTimespan","highlights","timeSpan","spanId","addMarkedTimespan","startdate","hourSet","hasMount","useDidUpdate","setRange","newStart","showProgress","showNoDataPlaceholder","hideCalData","getTitle","hight","dhx_cal_container","InvoiceTemplatePicker","doGetInvoice","InvoiceDetailsSaga","invoice","setInvoice","getInvoice","InvoiceDetailActions","useInvoiceDetailsSlice","selectNotFound","selectActiveFilters","selectInvoice","InvoiceComments","InvoiceInReview","notifActions","SentToReview","yup","InvoiceInReviewMessage","InvoiceDetailsUrl","ReviewApproved","InvoiceApprovedMsg","Reject","EnterInvoiceRejectReason","InvoiceRejectReasonPrefix","ReviewRejected","InvoiceRemarks","UpdatedOK","UpdateFailed","openChangeStatus","openChangeInvoiceTemplate","currency","ISOCurrencySymbol","InvoiceBalance","attrib","InvoiceTemplate","InvoiceTemplateId","LastSentToBilling","justify","InvoiceNotFound","hasSubRows","SampleTypeFilter","ShowZeroAmountRows","showZeroAmountRows","DetailsTable","OpenEditRow","appsettings","openEdit","BudgetCat","BudgetCats","InstrumentsAndServices","Task","EquipmentService","Mixed","TimeSlotType","SubsProfPercentage","SubsidyProfit","RelevantToManualCharges","InsertedByDisplay","EditInvoiceLine","RowActions","DeletInvoiceRows","ConfirmDeleting","deleteInvoiceConfirmMessage","toggleAll","InvoicePaid","EditBudgetInvoiceRows","EditBudgetInvoiceRows_info","Change","ReferenceId","SubscriptionName","setIsGrouped","InvoiceCharges","menu_InvoiceCharges","GroupByReferenceDescription","DoNotGroupByReference","GroupByReference","InvoiceHistory","History","PayHistory","InvoiceRowId","PaymentTable","openEditPayment","EditInvoicePayment","PaymentDeleteConfirm","PaymentsDelete_success","PaymentsDelete_err","menu_InvoicePayments","RowHistory","deleteInvoiceOpen","setDeleteInvoiceOpen","allowedFees","AllowedFeeTypes","isChargesAllowed","pagelink","setfilterCallback","invoiceHistoryOpen","setInvoiceHistoryOpen","rowHistoryOpen","setRowHistoryOpen","payHistoryOpen","setPayHistoryOpen","updateStatusOpen","setUpdateStatusOpen","updateInvoiceTemplateOpen","setUpdateInvoiceTemplateOpen","updateInvoiceIdsOpen","setUpdateInvoiceIdsOpen","openNewCharge","chargProps","openNewPayment","paymentProps","deletable","setNewStatus","setInvoiceTemplate","setInvoiceIds","deleteInvoice","invoiceTemplateId","AddACharge","EditInvoiceStatus","EditInvoiceTemplate","CantDeleteInvoice","InvoiceRowsHistory","Preview","invoiceIdEntity","paymentPageActions","PaymentModificationsHistory","PayId","disableEnforceFocus","UpdateInvoiceStatus","UpdateInvoiceTemplate","handlePreview","InvoiceDeleteConfirmationMessage","ReopenOrderButton","DeleteOrderButton","FormWorkOrderTypePicker","FormWorkOrderTypeStatusPicker","FormRemindBeforePicker","SymptomCodesPicker","FormSymptomCodesPicker","RepairCodesPicker","AssetCatIds","ac","FormRepairCodesPicker","initReasonTypeData","ReasonTypePicker","FormReasonTypePicker","CreationDetails","WorkOrderAdvancedDetails","ReportedByDisplayName","ReportedDate","EventTypeStatus","ClosedAt","DoneDate","WorkStillInProgress","ClosedBy","DoneBy","FormUnlimitedDowntime","UnlimitedDowntime","EndDowntime","CustomFormPicker","FormCustomFormPicker","WorkOrderComments","doSaveComments","saveComments","referenceIds","AddCalibrationWorkOrder","workOrederIds","workOrederTypeId","saveLinkedOrders","setAsset","setWorkOrder","workOrderType","setWorkOrderType","fetchWorkOrderType","woId","handleWorkTypeChange","handleWorkOrderChange","LinkWorkOrder","AddCalibrationReference","PleaseSelectACalibration","HoverLinkedItem","linked","useHoverButton","onHoverClick","hoverIcon","HoverLinkedItems","onItemClcik","Linked","getLength","WorkOrderLinks","links","countLinks","LinkedWorkOrders","Collapse","unmountOnExit","WorkOrderForm","handleTypeChange","workOrderTypeFormRef","workOrderStaffFormRef","readonlyDetails","canView","onAssetClicked","setWorkOrderOfflineStartChangedValue","setWorkOrderOfflineEndChangedValue","onLinkedClick","bringUp","overlaps","unlimitedDowntime","setUnlimitedDowntime","typeChanged","setTypeChanged","downTimeChanged","setDownTimeChanged","remindBeforeChanged","setRemindBeforeChanged","setOriginalSubFormFiles","setOriginalStaffFormFiles","linkedWorkOrders","Links","workOrderSchema","err_AssetRequired","errEvent_Type_Required","typeError","AlertName","err_AlertNameRequired","errEvent_Type_Status_Required","EventDueDate","err_EventDueDateRequired","AlertStartTimeLabel","OfflineEventStartLabel","check","OfflineEventStartRequired","OfflineEventEndLabel","err_DownTimeEndGreaterThenStart","getWorkOrdersShema","DefaultSubject","DowntimeReasonTypeId","DowntimeDuration","DefaultRemaindBefore","remb","assignee","AssignedToCreator","changeLinkedOrders","orders","addedOrders","removedOrders","removeCalibrationOrder","addCalibrationOrder","handleOfflineEventStartChange","handleOfflineEventEndChange","InstrumentHasOverlappingDowntimeEvents","ShowAllDowntimeEventsOn","isInitialValid","LockedClosedRecord","EventDetails","PleaseSelectAnAssigneeUser","PleaseSelectAnAlertTypeStatus","ReportSymptoms","PleaseSelectAnAlertSymptomCode","RepairCodesEnabled","PleaseSelectAnAlertRepairCode","EventDueDateTimeLabel","RemindMeBefore_Description","PleaseSelectAReasonType","OfflineRemarksPlaceholder","SubmissionFormDetails","StaffFilledForm","PleaseSelectCustomForm","continueTo","sendOfflineEmail","sendOfflineProcessing","sendOfflineData","sendEmailCompleted","hasCreateProcessing","hasUpdateUpdateProcessing","hasCreateError","showDeleteRecurring","setShowDeleteRecurring","showSendEmail","setShowSendEmail","showCloseStatus","setShowCloseStatus","closedStatus","setClosedStatus","radioNotifyUsersValue","setRadioNotifyUsersValue","radioCancelAffectedReservationsValue","setRadioCancelAffectedReservationsValue","workOrderOfflineStartChangedValue","workOrderOfflineEndChangedValue","isCloseWorkOrderClicked","setIsCloseWorkOrderClicked","hasProcessing","IsAllInstrumentEventsGroupPermissions","viewPermissions","typeName","setTypeName","reservationSwithProps","subFormFiles","orderType","handleDeleteOrder","OnlyMainOrResourceWorkOrdersAdminCanDeleteCalibrationRecords","handleSendEmailClick","handleCancelSend","handleCloseOrder","handleOpenOrder","handleDeleteClick","handleDeleteAllNext","CloseIncident","CloseEvent","ReopenIncident","ReopenEvent","DeleteIncident","DeleteEvent","SendCustomEmail_short","SendCustomEmail","ViewCalendar_short","ViewCalendar","ShowAllRecurringEvents","notifyUsersRadioGroupOptions","Info","JustBookedUsers","AllAffectedUsers","AllAffectedUsers_info","cancelAffectedReservationsRadioGroupOptions","menu_AddNewWorkOrder","Add","WorkOrderRestrictedNotAllowed","UpdateDowntimeAdditionalActions","CreateDowntimeAdditionalActions","TheDowntimePeriodHasChangedNotifyUsers","NotifyUsers","isChangedStartDowntimeShorter","isChangedEndDowntimeShorter","isChangedDowntimeShorter","CancelAffectedReservations","UpdateDowntime","CreateDowntime","UpdateRecurringEventsTitle","EventRepeatConfirmationMessage","UpdateAllRecurringEvents","DeleteRecurringEvents","DeleteAllRecurringEvents","DeleteAllFutureRecurringEvents","YouAreClosingCalibrationRecord","RecordWillBeNotEditableAfterClosing","getSingleScreenToShowOn","ScreenToShowOnPicker","getSingleInvoiceStatusWithStaticOptions","InvoiceStatusWithStaticOptionsPicker","ConvertModelToEntityBillingActionsDetails","OperationName","IsSendEmail","IsSftpUpload","EmailAttachmentTypes","ChangeStatusTo","GeneratePayment","ConvertEntityToModelBillingActionsDetails","billingActionsDetailsSaga","initBillingActionsDetails_Success","initBillingActionsDetails_Error","initUpdateBillingActionsDetails_Success","initUpdateBillingActionsDetails_Error","createBillingActionsDetails_Success","createBillingActionsDetails_Error","BillingActionsPageName","updateBillingActionsDetails_Success","updateBillingActionsDetails_Error","initBillingActionsDetails","initUpdateBillingActionsDetails","createBillingActionsDetails","resetUpdateBillingActionsDetailsState","resetCreateBillingActionsDetailsState","billingActionsDetailsActions","selectBillingActionsDetails","billingActionsDetail","selectCreateBillingActionsDetails","selectCreateBillingActionsDetailsCompleted","selectUpdateBillingActionsDetails","selectUpdateBillingActionsDetailsCompleted","selectBillingActionsDetailsProcessing","EATBaseURLMultiPicker","EmailAttachmentTypePicker","FormEmailAttachmentTypePicker","FormInvoiceStatusPicker","FormScreenToShowOnPicker","FormPaymentMethodEnumPicker","ERTBaseURLMultiPicker","EmailRecipientTypesPicker","FormEmailRecipientTypesPicker","BillingActionsForm","isSftpEnabled","SAP_SFTP","budgetFieldFundingTypeEnabled","IsSendEmailChanged","setIsSendEmailChanged","IsSftpUploadChanged","setIsSftpUploadChanged","isMultipleEmails","billingActionsDetailsSchema","err_OperationNameRequired","err_ShowOn","FundingTypeIsRequired","BillingActionDetails","err_OperationNameUnique","AllInvoiceStatuses","EnterEmailsSeparatedByCommaWithoutSpaces","BillingActionsDetails","menu_EditAction","menu_AddNewAction","EditAction","AddNewAction","hasOwnedGroups","OnlyMyCores","onlyMyCores","ownedbyme","PermissionLevelPicker","FormPermissionLevelPicker","TimeSlotTypePicker","FormTimeSlotTypePicker","FormUserGroupsPicker","UpdateGroupPermissionsForm","AdGroups","PermissionLevel","err_SelectPermissionLevelException","err_TimeSlotTypeRequired","SetPermissionsOnSelectedServiceGroups","UpdateUserGroupPermissions","updtPermissionOpen","setUpdtPermissionOpen","submitted","setSubmitted","updatePermission","PermissionLevelId","CreateUpdateGroupPermissions","SetPermissions","CoreSelectionTable","updtFirstLogin","updtOptOut","redirectToDash","optOutCoreSelection","serviceGroupActions","savedServiceGroups","setOnlyMyCores","tabNumber","setTubNumber","showImportConfirm","setShowImportConfirm","userHelp","Help_ServiceGroupRegistration","multiCoresSelectionMode","setMultiCoresselectionMode","skipCoreSelectionScreen","SkipCoreSelectionScreen","setSelectedRowIds","loacalServiceGroups","setLoacalServiceGroups","showMyCoresOptions","handleRemoveGroup","oldGroups","handleRowsServiceGroupsChange","handleServiceGroupsChange","handleSingleGroupChange","onSelectChange","canSwitch","OnSelectNotRegisteredCore_error","primaryMultipleAction","cols","OwnedByMe","AdminEmail","OnlineServicesCount","OfflineServicesCount","RequestTypesCount","LimitServiceGroupLicenses","ServiceGroupAdminsLimit","AdminsTotal","LabTechsLimit","LabTechTotal","DeSelectServiceGroup","SelectServiceGroup","ViewServiceGroupDetails","_selectedRows","_rows","_onRefresh","_toggleAll","toggleSingle","DeleteSelectedCard_info","tabLeftActions","Tab","AllCores","_count","MyCores","tabRightActions","DontShowThisAgain","_ev","CoreSelectionOptOut_info","selectedBulkActions","DeleteSelectedGroups","SelectedServiceGroupsWillBeDeleted","err_ServiceGroupCanNotBeDeleted","DeactivateServiceGroup","ConfirmDeactivate","err_ServiceGroupCanNotBeDeactivated","allowedToUseBulkActions","acts","CreateNew","SelectDeffServiceGroups","CoresTabSetting","adds","ImportHandler","handleImportClose","menu_CoreSelection","Rejected","_toggleAllRowsSelected","selectCoreSelection","coreSelection","selectCoreSelectionFilters","noDashboardRedirectByClick","NoDashboardRedirectOnCoreSelection","isFirstLogin","updateIsFirstLogin","OptOutCoreSelection","updateIsOptOut","Private","CheckBoxGroup","labelPlacement","FormCheckBoxGroup","EveryDaysPicker","FormEveryDaysPicker","RepeatMonthlyByPicker","FormRepeatMonthlyByPicker","RepeatPeriodPicker","FormRepeatPeriodPicker","RepetitiveOptionsPicker","withParamsFilter","FormRepetitiveOptionsPicker","RepetitiveSchema","Until","err_RepeatUntilDateLessThanStart","err_AlertInvalidRecurringUntilDate","err_PepeatsOnDaysRequired","RepetitiveForm","recurringChanged","setRecurringChanged","repeatPeriodChanged","setRepeatPeriodChanged","repeatEndChanged","setRepeatEndChanged","leftSideSections","RepeatsEvery","UserTrainingApi","trainings","approve","ur","AllowBookingFromTrainingDate","ExpiredDate","MustOrderEveryDays","MustUseEveryDays","TrainerId","TrainingDate","TrainingLevel","UnhideServiceGroup","TrainingProgramId","TrainingProgramName","duUpdateTraining","doApproveRejectReservations","doActivate","trainingSaga","initCreateTraining_Success","initCreateTraining_Error","initUpdateTraining_Success","initUpdateTraining_Error","trainingsResponse","createTraining_Success","createTraining_Error","updateTraining_Success","updateTraining_Error","approveRejectReservations_success","approveRejectReservations_error","activateDeactivateTraining_success","activate","activateDeactivateTraining_error","initCreateTraining","initUpdateTraining","updateTraining","approveRejectReservations","activateDeactivateTraining","reservationsUpdateState","showApproveReservations","showRejectReservations","ApproveRejectRecords","ShowApproveReservationsMessage","ShowReviseToPendingMessage","resetCreateTrainingState","resetReservationsState","resetUpdateTrainingState","ReservationStart","ReservationEnd","setReservationsUpdateState","trainingActions","selectTraining","selectInitTrainingProcessing","selectCreateTraining","selectUpdateTraining","selectCreateTrainingCompleted","selectUpdateTrainingCompleted","selectCreateTrainingHasError","selectUpdateTrainingHasError","selectShowApproveReservatiions","selectShowRejectReservatiions","selectReservatiionsData","selectReservatiionsProcessing","selectReservatiionsUpdateCompleted","formatName","TrainingResevationsPicker","trainingDate","tDate","strDate","FormTrainingReservationsPicker","FormTrainingLevelPicker","UserTrainingComments","UserTrainingForm","TrainingLevelPermissions","usersShema","equipmentShema","err_UserNameRequired","ServiceType_Online","err_TrainingDateFieldRequired","err_TrainerIsRequired","activeDisabled","resDisbaled","setResDisbaled","allowBookingDisbaled","setAllowBookingDisbaled","setAllowBookingVisible","setEquipmentChanged","trDateChanged","setTrDateChanged","trLevelChanged","setTrLevelChanged","handleEquipmentChange","handleTrDateChange","handleTrLevelChange","ExpiredDays","UserTrainingTopMessage","NotActive","UserTraining_EquipmentInfo","UserTraining_UserInfo","UsersPlaceholder","DateOfTraining","LevelAchieved","TrainingLevelPlaceholder","TrainerPlaceholder","LinkedReservation","SelectLinkedReservation","TrainingRestrictions","TrainingExpiration","User_ExpiredDate_Description","User_MustOrderEveryDays_Description","EnterNumberOfDays","User_MustUseEveryDays_Description","HideInstrumentsFromUntrainedUsers","UnhideServiceGroup_Description","AllowBookingFromNow","showApprove","setShowApprove","showReject","setShowReject","approveReservations","rejectReservations","relatedReservations","updateResCompleted","editTraining","currenTrainingServiceGroupId","activateAllowed","handleActivateTraining","handleReject","handleApprove","handleResCancel","ActivateTraining","UserTrainingModificationHistory","menu_UserTraining","menu_AddNewUserTraining","RejectAllReservations","UserTraining_ReviseReservations","RejectAll","ApproveAllReservations","UserTraining_ApproveReservations","ApproveAll","FiltersComponent","MultiToggle","ToggleMultipleInstruments_info","onchange","FullScreenButton","OpenInFullScreen","FullScreenSchedulerButton","CalendarDatePicker","views","openTo","TimelineGroupByPicker","GroupReservationBy","showPeriodPicker","multipleMode","intervalRefreshingCalendar","IntervalRefreshingCalendar","calendarOnly","configuredRefreshInterval","refreshIntervalNumber","refreshInterval","useRefreshInterval","moveToDate","customDiff","addDateFn","lengths","EquipmentAssembliesEnabled","TimelineGroupByEnumsArray","secondaryPageActions","calendarActions","primaryPageActions","withoutHeader","otherControls","periodControls","Previous","Today","viewTypeControls","PriceSheetApi","doCreatePeriod","doUpdatePeriod","pricePeriodSaga","menu_PriceSheetPeriod","initialPeriod","createPeriod_Success","createPeriod_Error","updatedPeriod","updatePeriod_Success","updatePeriod_Error","updatePeriod","pricePeriodActions","selectPricePeriod","pricePeriod","selectDetails","selectDetailsHasError","FormPriceSheetMethodPicker","PricePeriodsForm","globalPriceSheetEnabled","priceEnabled","serviceGroupChanged","setServiceGroupChanged","startChanged","setStartChanged","endChanged","setEndChanged","pricPeriodsSchema","PriceSheetMethod","err_ServiceGroupRequired","err_PriceSheetMethod_isrequired","PricePeriodDetails","PriceSheetMethod_info","GlobalPriceSheetPeriods","priceSheetByEnabled","priceSheetBy","fullAdmin","PriceSheets","OpenPriceSheetInfo","periodId","gName","priceBy","EditPriceSheetPeriod","AddPriceSheetPeriod","PricePeriod","AddPricePeriod","ConvertModelToEntityCalendarMessagesDetails","PlantDate","DisplaySeconds","ConvertEntityToModelCalendarMessagesDetails","CalendarMessagesApi","calendarMessagesDetailsSaga","initCalendarMessagesDetails_Success","initCalendarMessagesDetails_Error","initUpdateCalendarMessagesDetails_Success","initUpdateCalendarMessagesDetails_Error","menu_CalendarMessages","createCalendarMessagesDetails_Success","createCalendarMessagesDetails_Error","updateCalendarMessagesDetails_Success","updateCalendarMessagesDetails_Error","initCalendarMessagesDetails","initUpdateCalendarMessagesDetails","createCalendarMessagesDetails","updateCalendarMessagesDetails","resetUpdateCalendarMessagesDetailsState","resetCreateCalendarMessagesDetailsState","calendarMessagesDetailsActions","selectCalendarMessagesDetails","calendarMessagesDetail","selectCreateCalendarMessagesDetails","selectCreateCalendarMessagesDetailsCompleted","selectUpdateCalendarMessagesDetails","selectUpdateCalendarMessagesDetailsCompleted","selectCalendarMessagesDetailsProcessing","CalendarMessagesForm","initValues","IsServiceGroupChanged","setIsServiceGroupChanged","IsEquipmentChanged","setIsEquipmentChanged","calendarMessagesDetailsSchema","Laboratory","Group","getDisabledInfo","AllServiceGroups","Announcement","AddNewAnnouncement","myAssetsDefaultFilters","AdvancedAssetSearchFilterAttributes","CreatedSince","ActiveAssets","Areas","LocationList","SubLocationsList","LocationNotUpdatedSince","ResourceServiceType","ShowAssemblyParts","UsageStatus","RangeWeight","RangekN","RangeTemperature","RangeArea","RangeVolume","RangeAmount","AssetsSelectionTable","primaryMultiAction","multiModeDisabled","useRecentAssets","RecentAssets","isShortView","emptyTable","canExportAssetRanges","POnumber","AssetAccessories","Contacts","Experts","Suppliers","ShortDescription","multiAssetSelectionMode","setMultiAssetSelectionMode","setCurrentMode","currentModeRef","loacalAssets","setLoacalAssets","localAssetsRef","getMyListFilter","selectedRws","selectedRowDefaultActions","isShowAllCores","handleRowsChange","handleSingleChange","oldAssets","AssetSearch","selectAssetsSelection","assetsSelection","selectAssetsSelectionFilters","RecentContent","collapseOpen","setCollapseOpen","fetchRecentAssets","recentAssets","setRecentAssets","fetchRecentAssetsState","fetchRecentAssetsPromise","recentShort","requestTypeIds","appSettingsAction","openRequest","setOpenRequest","requestId","setRequestId","selectedAssets","setSelectedAssets","schedActions","AssetCatGroupId","createOffline","addTrainingSession","startUsage","useAddNewActions","allowMultiToggle","allowAllCoresToggle","availabilityTypesArray","SelectConsumables","CreateRequest","CreateAWorkOrder","AddTrainingSession","InstrumentAssetSearch","noTableData","NoConsumablesHeadTitle","NoConsumablesTitle","primaryRecentAction","notAvailable","handleSearchAllCores","SearchAllCores","menu_MyInstrumentsAssets","Statuses","initLogStatusesData","BarcodeLogStatusPicker","BarcodeLogStatusFilter","AllStatuses","hideRoomFloor","HideRoomFloorTextBoxes","EntryDate","fromInitPreset","FloorName","ShowBarcodesWithoutAssetsOrRooms","InventoryLogTable","defaultFilter","BarCode","BarcodeScanLog","menu_AssetInventoryLog","defaultFilterSearch","dateFilter","SavedViewForm","viewOnly","ExtraData","savedViewSchema","err_SavedViewNameRequired","SavedViewName","err_savedViewAssetRequired","SavedViewAssets","SavedViewShared","SavedViewBookMultiple","getsavedViewSchema","TimesUsed","SavedViewAssetsPlaceholder","SavedViewBookMultiple_info","extraData","isServiceGroupAdmin","useView","notShown","BookableAsset","TakeDown","useLeftTopActions","menu_EditSavedView","menu_AddNewSavedView","PopUpListItems","invoiceTemplateRightSection","BillingAddress_info","BudgetActivityCode_info","BudgetCostCenter_info","BudgetExtraTextField1_info","BudgetExtraTextField2_info","BudgetExtraTextField3_info","BudgetExtraTextField4_info","BudgetExtraTextField5_info","BudgetProjectCode_info","BudgetProjectName_info","CoreCostCenter_info","CreditCode_info","InvoiceBalance_info","InvoiceCore_info","InvoiceCurrency_info","InvoiceCustomerEHF_info","InvoiceCustomerRef_info","InvoiceDate_info","InvoiceDepartment_info","InvoiceFromDate_info","InvoiceId_info","InvoiceInstitute_info","InvoiceInstituteType_info","InvoiceIdLink_info","InvoiceProcessedUser_info","InvoiceProcessedUserEmail_info","InvoiceProcessedUserGroup_info","InvoiceProcessedUserMobile_info","InvoiceProcessedUserPhone_info","InvoiceProjectNumber_info","InvoiceRemarks_info","ConfigureColumns","InvoiceLetters","InvoiceSummaryTable_info","InvoiceSummarServicesTable_info","InvoiceSummury_BudgetUserService_info","InvoiceSummaryByInvoiceRowsNonGrouped","InvoiceToDate_info","InvoiceTotalCost_info","InvoiceAdGroup_info","InvoiceUserGroupEmail_info","InvoiceVAT_template_info","BudgetInvoicingRemarks_info","LastRequestID_info","LetterDate_info","ProjectActivity_info","ProjectNumber_info","InvoiceUserGroup_info","HtmlTextBox","formikValues","Html","textBoxValue","setTextBoxValue","OnUpdate","invoiceTemplateHtmlTextBox","InvoiceTemplateHtmlSource","FormColorPicker","PreviewButton","handleInvoiceIdChange","InvoiceTemplatePopUpLink","TableHeaderColor","TableBodyColor","HeaderFileName","FooterFileName","testHex","InvoiceTemplatePopUpSchema","OnSubmit","invoiceTemplateHtml","valueToReplace","patrn","originalValue","html_replace","InvoiceTemplateUpdateSuccess","InvoiceTemplateAddedSuccessfully","leftSectionH6Image","rightSectionH5Title","InvoiceTemplateForm","classname","TemplateName","AllFundingTypes","uploadLabel","TemplateHeaderImage","ModifyInvoiceLetterTemplateHere","TemplateFooterImage","InvoiceLetterTableHeadColor","InvoiceLetterTableHeadColor_info","InvoiceLetterTableBodyColor","InvoiceLetterTableBodyColor_info","ReservedWordsForInvoiceLetterTemplateMsg","menu_InvoiceTemplates","AddInvoiceTemplate","uploadStyle","buttonRoot","buttonLabel","dividerRoot","previewContainer","previewIconAndText","previewIcon","previewText","previewTextSize","previewCloseButton","previewCloseButtonIcon","FileView","withShrinkLabel","prettyBytes","maximumFractionDigits","mimeType","fileUrl","webkitRelativePath","previewImg","downloadClick","FileInput","onFileChange","shrinkFile","FilesPreview","FileUpload","innerFiles","setInnerFiles","fileValues","setFileValues","updateFiles","deleteFileName","savedFiles","convertFilesToArray","gridRowGap","updatedFiles","addNewFiles","EmailTypePicker","EmailTypeFilter","NotificationType","CustomFormSkeleton","QuizCustomForm","fetchQuiz","quizId","ShuffleFields","Question","UsedAttempts","Submissions","SubmittedById","QuizTrainingPassingScore","UserCanStartQuiz","QuizNumberOfAttempts","fetchQuizPromiseState","fetchQuizPromise","setStartQuiz","quizSubmission","submitStatus","submitQuiz","submission","setSubmission","submissionId","resultQuiz","ContinueToQuiz","CancelYourSubmission","QuizDescription","QuizInstructions","QuizFiledAttemptsMessage","QuizFiledAttemptsInstrumentMessage","StatusChip","LastComment","LastCommentBy","LastCommentAt","AlertOfflineTime","writeCsvFile","exportCsv","stringData","csvContent","doLoadData","doUpdateField","doRunSelectedSamples","doCompleteRun","doUpdateRun","doLoadRunDetqails","doImportRunDetails","doLoadAllSelectedSamples","doExportRun","loadIds","httpUrl","allsamples","completeRunResponse","XSamplesWereProcessed","skippedSamplesCount","XSamplesWereSkipped","derivativesCount","runupdate","samples_response","readCsvFile","platesUrl","createPlate","createPlates","runSamples","tpid","records","tablestate","AnalyticalSampleId","Position","TubeLabel","Volume","Concentration","AssetsApi","allowedToImport","enabledByCores","ExportAssetRangesTooltip","ExportAssetRanges","AssetRanges","DownloadAssetImages","UpgradeLocalApp","ConsumablesForm","innerDiscountFactor","setDiscountFactor","innerRemarks","reportConsumableSchema","ConsumableProject_info","consumableServicesData","byGroup","AllowedServices","updatedRemarks","ArticleDatasetLink","dataset","ArticleServiceGroupsColumnId","ArticleInstrumentsColumnId","PubMedId","FileComment","checkRow","StyledSelect","TmtType","autoWidth","BasicTab","textColor","scrollButtons","centered","setTabIndex","tabsVertical","tabsHorizontal","scrollContent","EventsCount","eventsLoading","isMaintenanceAssetsEnabled","StyledSpanIcon","AssetQuickSearchApi","getAssetSearch","q","Results","TotalResultsLength","getRecentAssets","doShowSearchInput","doSetOpen","doSearchAssets","doSearchAllAssets","doGetRecentAssets","doGetRecentSearchTerms","assetQuickSearchSaga","getRecentSearchTerms","searchAssets_Success","searchAssets_Error","allCores","searchMenus","searchMenu","menuResult","setMenuSearchResults","setOnlineSearchResults","setOfflineSearchResults","setRequestSearchResults","setTotalSearchCount","online","request","totalRresults","searchAllAssets_Success","searchAllAssets_Error","getRecentAssets_Success","getRecentAssets_Error","getRecentSearchTerms_Success","getRecentSearchTerms_Error","menuNodes","childItems","ch","uniqBy","showSearchInput","searchAssets","searchAllAssets","showSearchInSidebar","showSearchResults","recentSearchTerms","searchResults","allSearchResults","onlineSearchResults","offlineSearchResults","requestSearchResults","totalSearchCount","menuItemsSearchResult","assetQuickSearchActions","useAssetQuickSearchSlice","selectAssetQuickSearch","assetQuickSearch","selectRecentAssets","selectRecentSearchTerms","selectAllSearchResults","selectSearchTerm","selectOpen","selectShowSearchInSidebar","selectOnlineSearchResults","selectOfflineSearchResults","selectRequestSearchResults","selectTotalSearchCount","selectMenuSearchResults","ListItemLink","DefaultQuickAssetSearchAction","getAssetDetailsLink","getCalendarLink","getTimelineLink","AssetListItem","useAssetPopup","truncateName","defaultLink","validKey","getSettingValue","showCalendarLinks","handleAssetClick","ShowFullDetails","QuickSearchSection","QuickSearchSectionTitle","QuickSearchSearchesItems","QuickSearchRecentItems","QuickSearchEmptySection","QuickSearchEmptyContent","QuickSearchSeeAll","QuickSearchMainTitleSection","QuickSearchAllInstrumentsSection","MenuSearchEmptyContent","RecentAssetsList","RecentItem","RecentSearchTermsList","recentSearchTermsState","RecentSearches","NoSearchTermFound","MenuSearchItem","convertUrl","LinkWithChildren","MenuSearchResultList","menuSearchState","RelatedScreens","NoRelatedScreensFound","AssetSearchResultsByType","onAllAssetsClick","onlineState","offlineState","requestState","menuItemsState","OnlineServiceLabel","InstrumentsFound","RequestServiceLabel","RequestsFound","OfflineServiceLabel","ConsumablesFound","showOnline","showOffline","showRequests","NothingFound","FullResults","AssetQuickSearch","searchAllCores","handleOpenAssets","showInSideBar","SearchAnAssets","inputRootMobile","AssetsSearch","SeeAllInstruments","menuButton","searchIcon","inputInput","paperTitleSection","reg_ChangePassword","main_master_LogOutLinkText","Help","OptOutNotifications","ServiceGroupRegistration","menu_GoogleCalendar","menu_OutlookCalendar","Notifications","UserMenuButton","UserMenu","googleCalendarModuleEnabled","GoogleCalendar","multipleAdGroupsModuleEnabled","MultipleAdGroups","serviceGroupRegistrationModuleEnabled","googleCalendar","outlookCalendar","Opt_Out","AllowUsersToOpt_Out","SwitchFromToAnotherUserGroup","SwitchFrom","SwitchSites","allowToSwitchToOtherSites","AllowToSwitchToOtherSites","externalTitleOne","ExternalSwitchTitle1","externalUrlOne","ExternalSwitchUrl1","externalTitleTwo","ExternalSwitchTitle2","externalUrlTwo","ExternalSwitchUrl2","externalSitesIcon","ExternalSitesIcon","buttonIcon","hasExternalOne","hasExternalTwo","useExternalLinks","SwitchToOtherSites","ProfileMenu","ToggleSideMenuButton","Separator","TopToolbar","TopGroupButton","firstServiceGroupName","CoreDashboardMenu","popoverPaper","mainContentAndScroll","mainContent","searchAndHeader","controlButtons","coresAndServices","coreCheks","scrollPaddings","ddlClasses","listItemText","useListStyles","setSelectedServiceGroups","availableServiceGroups","setAvailableServiceGroups","availableLoading","setAvailableLoading","Dashboard_ServiceGroupSelection","handleItemClick","handleSaveItemClick","Dashboard_ServiceGroupSwith","CoreSelectionButton","showInlineGroups","SubTopToolbar","serviceGroupsCount","singleCore","isAdminOfSingle","handleCollapse","OpenCore","TopBar","sidePanelCollapsed","appBarShift","sidePanelShift","MenuItemComponent","currentindex","onExternalClick","childRoot","focusVisible","createMenuItemRefs","rowInd","menuItemRefs","HoverSideMenu","handleChildClick","childActiveIndex","setChildActiveIndex","parentRowIndex","keyCode","bindFocus","anchorPosition","TransitionComponent","cindex","exact","focusVisibleClassName","SidbarMenuItem","PropTypes","bool","indexChanged","chIndex","mainTab","hasAdminSettings","closeOnClick","isExpandable","setChildIndex","sidebarExpanded","urlLink","setUrlLink","mainTabMenu","mainTabExpanded","mainTabShort","mainTabOpen","data-parent-id","verticalScrolling","NavWrapper","MainMenuItem","replaceIcon","SideBarMenu","routerPathName","selectedIndex","setSelectedIndex","mapItems","citem","chItem","groupTab","handleListItemClick","sideBarExpanded","sideBarCollapsed","sideBarListMobile","mainMenuItemExpanded","mainMenuItemCollapsed","BookitlabShortLogo","xmlnsXlink","enableBackground","xmlSpace","UserProfileMobile","assetSearchActions","SearchAssets","SideBarHeader","logoMinimized","sideBarHeaderOpen","sideBarHeaderMobile","headerButtonsMobile","sideBarHeader","sideBarFooter","SideBarFooter","SideBarQuickAction","actionOptions","defaultSystemAction","SideBarQuickActions","systemAction","coreSelected","baseAction","SidebarQuickAction","sideBarQickActionMobile","SideBarComponent","setCurrentNode","currentNodes","setCurrentNodes","SideBar","SideBarDrawer","handleDrawerClose","Drawer","ModalProps","sideBarMobile","sideBarMobileHorizontal","drawerOpen","drawerClose","LayoutRoot","Main","AdminPanelPopper","sideBarOpen","AdminPanel","iframeLoaded","setIframeLoaded","iframeRef","closeAdminPanel","FrontendLayout","isBudgets","globalCoreVisible","termsOfUseAgreementEnabled","TermsOfUseAgreement","joinAdGroupEnabled","JoinAdGroup","UserGroupsProviderType","isFirstActiveUserGroupSelected","usageKioskRoleEnabled","UsageKioskRoleEnabled","roomUserRoleEnabled","redirectToTermsOfUseAgreement","setRedirectToTermsOfUseAgreement","redirectToActiveUserGroup","setRedirectToActiveUserGroup","redirectToCoreSelection","setRedirectToCoreSelection","redirectToUsageKiosk","setRedirectToUsageKiosk","redirectToUsageRoom","setRedirectToUsageRoom","redirectToConsumableKiosk","setRedirectToConsumableKiosk","redirectToJoinAdGroup","setRedirectToJoinAdGroup","SQL","KioskAdmin","ConsumableKiosk","useRequiredRedirect","isRedirectToTermsOfUseAgreement","isRedirectToActiveUserGroup","isRedirectToCoreSelection","isRedirectToUsageKiosk","isRedirectToUsageRoom","isRedirectToConsumableKiosk","isRedirectToJoinAdGroup","handleRejectConfirm","handleApproveConfirm","layoutRootMobile","useselectable","mobileOpen","NotSavedChanges_message","NotSavedChanges_title","READONLY_COLUMNS","SamplesTable","samplesTableState","selectedSamples","CellTextField","BiologicalSampleId","SubjectId","TaxaId","Grouping","CellDateField","CellNumberField","customPageSize","handleCreateButtonClick","SourceRunIds","TargetRunIds","openExportUrl","readWriteOnly","exportColumns","downloadTemplateUrl","goToSamplesList","OpenInSamplesList","_refresh","handelDeleteSamplesClick","ThisCannotBeUndoneAreYouSure","AddSample","MoreActions","getActions","ServiceRequestCustomForm","allowUserUpload","fieldRequired","nextField","nextFullRow","prevField","prevFullRow","nextIsEmpty","EventBudgetPicker","eventPredicates","ReadonlyField","useServiceRequestStatusUpdate","serviceRequestStatusId","fieldState","InternalServiceRequestStatus","ServiceRequestSubmissionDetails","authUser","poLocal","setPoLocal","internalLocal","setInternalLocal","projectFieldVisibleToUser","ReturnedToUser","purchaseOrderMandatory","statusFieldState","handlePurchaseOrderSave","debouncedPoChange","handleExternalInternalNumberSave","debouncedInterChange","SubmittedBy","SubmittedAt","StatusAndBudget","SendQuoteToUser","handleFundingTypeChange","ShowInternalNumber","SubmitServiceRequestButton","getRowsErrors","submitEnabled","ServiceRequestSubmitButtonTooltip_Enabled","ServiceRequestSubmitButtonTooltip_Disabled","ServiceRequest_SubmitStepAlert","CancelServiceRequestButton","CancelRequest","ServiceRequestAddons","ServiceOrCharge","show_newAddonCharge","ServiceRequestInternalStatus","ServiceRequestAddonTypes","showAddonCharge","AddonType","InternalStatus","show_newManualCharge","showManualCharge","handleAddServiceClick","handleAddChargeClick","charges","AddOnServices","AddonCharges_Empty_AddEnabled","ServiceRequestMilestoneStatusMenuPicker","getChipColor","handleMenuItemClick","ServiceRequestMilestones","milestones","handleAddMilestoneClick","sidePanelProps","showActionsColumn","Records","Total","handleStatusChange","ServicesRow","backgroundClip","ServiceRequestMilestonesSection","tableContainerStyles","CloneServiceRequestButton","handleCloneButtonClick","Clone","AddServiceRequestRowButton","AddNewCustomTableRow","arrayHelpers","AddRows","ServiceRequestRowEditableCell","fieldProps","innerValue","setInnerValue","useDebounce","getDebounceValue","childColumn","getServiceRequestRowFieldName","getServiceRequestRowName","columnFieldName","columnType","SRSelect","withAsyncOptions","hocProps","asyncOptionProps","async","optionsPromise","fetchOptions","promiseState","debounced","trailing","maxWait","useAsyncOptions","getCellComponent","getReadonlyCell","getValueRenderer","getCustomFormTableColumns","fieldComponent","isFocused","getCell","originalRow","enableHide","ServiceRequestRowStatusPicker","handleBlur","ServiceREquestRowStatusCell","RowGap","ActionsCell","DeleteButton","CloneButton","handleCloneClick","InternalServiceRequestRowStatus","CommentsWrap","ServiceRequestRowComments","canUserEdit","ServiceRequestRowsImport","ImportSuccessMessage","convertImportResponse","ImportErrorMessage","UpdateColumnValueAcrossMultipleRows","DownloadImportTemplate","ExportRows","importResponse","mapValues","Completed","InsertDate","Serial","SourceLinkId","SourceRowId","UpdateDate","BulkUpdate","Column","formikContext","rowIdentifiers","postValue","rowids","GenericUpdateErrorMessage","ColumnsSelect","getHidableColumns","colvis_buttontext","toggleHideColumn","handleToggle","hiddenColumns","getHiddenColumnsKey","getHiddenColumns","localStorage","columnIds","ServiceRequestRowsTable","customFormColumns","changeState","tableColumns","dynamicColumns","staticColumns","cellProps","tableSectionStyles","serviceRequestTypeId","onCreateReservation","SRFormContent","autoResetExpanded","setHiddenColumns","ServiceRequestTable","RequestRows_error","SRTableBody","rowProps","EditableCellField","StyledTableCell","ServiceRequestRow","SRTablePagination","QuoteSentToUserAlert","approvedStatus","QuoteApproved","cancelledStatuses","Request_SendQuoteToUser_PendingMessage","Request_SendQuoteToUser_ApproveQuote","firstCancelledStatus","dialogOpen","setDialogOpen","Request_SendQuoteToUser_RejectQuote","ConfirmRejectDialog","RejectReasonEmpty_err","Confirm_RejectQuote_Title","Confirm_RejectQuote_TextLabel","SendQuoteButtonButton","SendQuote","getSchema","dynamicValuesSchema","DownloadAllFiles","SRReservationColumns","reservationsColumns","GradientsPicker","CreateRequestReservation","requestOverheadMinutes","serviceRequestRelatedEquipments","createOpen","equipmentsPredicates","overheadMinText","setOverheadMinText","selectedGradient","setSelectedGradient","setSelectedEquipment","handleOverheadSave","handleOverheadChange","validToCreate","openIn","ServiceRequestCreateRservation","ServiceRequestGradient","ServiceRequestGradient_info","RequestReservationTime_info","RequestReservationOverallOverheadTime","RequestReservationTime","PleaseSelectAnInstrument","PleaseSelectAnEquipmentAndSamples","OpenInSchedule","RequestSamplesPage","RequestDetailsPage","requestDetailsData","serviceRequestFormData","submittingRequest","ServiceRequestRelatedEquipments","sidePanel","reservationOpen","setReservationOpen","setSelectedRows","showCancelRequest","handleCreateResClose","handleCreateRowReservation","printSections","userProfileSettingsSections","ExportPDF_SubmissionsDetails","ExportPDF_RequestForm_Table","ExportPDF_Comments","ExportPDF_RequestRows_Table","ExportPDF_Milestones_Services","ExportPDF_ModificationHistory","getPrintPDFSections","customFormFields","customFormSchema","getRequestDetailsSchema","hasRowsErrors","setHasRowsErrors","PleaseSubmitRequestFirstInOrderToPrint","NotificationTypeId","openRowsSidePanel","NOT_FOUND","addonType","AddonCharges","getServiceRequestTitle","AllowUserUpload","CommentOnEditOnly","ServiceRequestCard","CardHeader","dragHandleProps","StyledCardContentRow","StyledFoo","PriorityIcon","priority","CardActions","getIcon","getIconColor","Kanban","onDragEnd","provided","destination","itemId","draggableId","droppableId","StyledGridContainer","StyledColumn","droppableProvided","droppableSnapshot","hasMore","scrollThreshold","sectionId","onLoadMore","CardsContainer","renderTitle","draggableProvided","draggableSnapshot","draggableRubric","draggableProps","FrontendLayoutContentBox","ServiceRequestsKanbanPagePath","ServiceRequestsKanban","SERVICE_REQUEST_KANBAN_IGNORED_STATUSES","ServiceRequestsKanbanPage","kanban","StyledServiceRequestStatusMultiPicker","GlobalStyle","createGlobalStyle","CustomStyle","en","backendOptions","loadPath","lngs","namespaces","AnimalTypesPage","use","Backend","initReactI18next","lng","fallbackLng","appendNamespaceToMissingKey","interpolation","escapeValue","backend","selectDialogAlert","dialogAlert","DialogAlert","useMediaQuery","DialogContentText","SnackbarManager","InternalIdLoginPage","AnimalsListPage","PosLayout","PosWrapper","AnimalCaseConsumablesPage","FlexColumnDiv","mainWrapper","LoginLayout","AppBar","Toolbar","LogoMenu","Container","AnimalsHomePage","PrivateAnimalRoute","encodeURIComponent","CreateNewCasePage","SamplesListPage","TrainingSessionsPage","BuildingsPage","HistoryPage","AddNewReportPage","TrainingWaitingListPage","createBrowserHistory","basename","ExperimentTemplatesPage","UsersHistoryPage","UsersHistory","UserTrainingPage","RestrictedRoute","allowedNode","accesibleByRole","UsersPage","AnimalExtendedBillingReportPage","UserTrainingHistoryPage","UserTrainingHistory","OtherServicesPage","BudgetsPage","ServiceRequestPage","ServiceRequestListPage","WorkOrdersPage","DocumentsPage","QuizPage","QuizDetailsPage","UserTrainingDetailsPage","TrainingDetailsPage","SampleModificationsPage","UsageHistoryPage","RunsListPage","AnimalCasesHistoryPage","SendEmailToUsersPage","SendEmailToUsers","ChargesPage","MyAssetsPage","Locations","LocationsPage","BuildingPage","CampusesPage","AreasPage","LocationListPage","SubLocationListPage","InvoiceBatches","InvoiceBatchesPage","CategoriesPage","CategoryGroupsPage","BillingPreviewPage","selectOnlineBudgetsStatus","onlineBudgetsStatus","selectOnlineBudgetsStatusSelected","selectPayState","pay","selectGenerateInvoicesState","generateInvoicesState","selectChargeOnlineBudgetsState","selectEndDate","selectIGenerateInvoicesAndSendToSapState","generateInvoicesAndSendToSap","doGetTableData","doGenerateInvoices","doChargeOnlineBudgets","doDownloadChargeOnlineBudgetsErrors","doPay","doGenerateSelectedInvoices","onlineBudgetsStatusSaga","getTableData_Success","getTableData_Error","Item","ServiceGroupsCsv","UserGroupsCsv","PeriodType","BudgetIncluded","invoiceBy","CoreInvoiceBy","InvoiceCreatedBy","InvoiceVat","CoreBy","ShowZeroAmountInvoices","ShowInvoicePartialEvents","Async","Recalculate","generateInvoices_Success","getTableData","generateInvoices_Error","processed","chargeOnlineBudgets_SetCurrentRecord","chargeOnlineBudgets_SetStatus","SuccessTransactionsCount","HostBudgetNumber","chargeOnlineBudgets_Error","chargeOnlineBudgets_Success","chargeOnlineBudgets_SetDialogOpen","ProcessingFinished","paymentDate","payments","balanceRow","Payments","pay_setStatus","pay_Finish","PaymentCreatedSuccess","GenerateInvoicesAndChargeOnlineBudgets_SetCurrentRecord","GenerateInvoicesAndChargeOnlineBudgets_SetProgress","GenerateSelectedInvoices_Error","GenerateSelectedInvoices_Success","chargeOnlineBudgets","generateInvoices","chargeOnlineBudgets_DownloadErrors","GenerateInvoicesAndChargeOnlineBudgets","needTableRefresh","setneedTableRefresh","currentRecord","pay_Open","pay_SetSelected","pay_Close","GenerateSelectedInvoices_SetDialogOpen","onlineBudgetsStatusActions","useOnlineBudgetsStatusSlice","ChargeOnlineBudgetsButton","handleDialogClose","confirmationMessage","SendBalanceToSap","ChargeBalanceOnline","DownloadErrors","GenerateInvoicesButton","GenerateInvoiceForEstimatedCharges","PayButton","totalUpaidBalance","UnpaidBalance","PayDescription","Pay","paymentMethod","TotalPayments","PaySelected","GenerateInvoicesAndSendToSap","GenerateInvoices","AddPaymentButton","useRowActions","accumulateInvoices","AccumulateNewChargesToExistingInvoice","invoices","tryParseInvoicesData","getBudget","getServiceGroup","getPaymentAmount","subActions","InvoiceStart","InvoiceEnd","InvoiceDetailsLink","SeeFullDetailsOfBalanceAndTransferChargesToAnotherBudget","BudgetDetailsBudgetTransfer","InvoiceBudgetBalanceKeyAccessor","OnlineBudgetsStatusPage","ByProjectUserGroup","IDNo","TotalInvoiced","ugid","showEstimated","TotlaPaid","OnlineBudgetStatusBalanceTooltip","OverallEstimatedBalanceTooltip","OverallEstimatedBalance","OnlineBudgetStatusEstimatedChargesTooltip","EstimatedCharges","useColumns","endDateString","memoedColumns","disableActionButtons","EndDateMustBeSetToTodayOrEarlier","WS_Billing","usePageActions","handleEndDateChange","OnlineBudgetsBillingUnfinishedUsagesRemark0","OnlineBudgetsBillingUnfinishedUsagesRemark1","OnlineBudgetsBillingUnfinishedUsagesRemark2","OnlineBudgetsBillingUnfinishedUsagesRemark4","OnlineBudgetsBillingUnfinishedUsagesRemark3","rowAccessor","OnlineBudgetsStatusTable","BillingByProjectsOrCores","OnlineBudgetsStatus","InvoiceDetailsPage","WorkOrderDetailsPage","BillingPage","BillingActions","BillingActionsPage","BillingActionsDetailsPage","LocationTypesPage","SubLocationTypesPage","SavedViewDetailsPage","SavedViews","SavedViewsPage","LabelTypesPage","AssetDetailsPage","LabelPrintDialog","KioskProjectsPage","KioskProjectConsumablesPage","PrivateKioskProjectsRoute","SESSIONTIMEOUT_ASHX_CACHE_BUST","checkFailCount","CheckSessionTimeout","loginUrl","appRoot","showWarning","redirectAction","onbeforeunload","currentUrl","Fulfilled","ExtendSessionTimeout","dataType","contentType","buttonText","onButtonClick","SessionTimeout","checkUrl","ignoreSession","Warning","SessionExpirationWarning","SubmissionsPage","QuizzesPage","AdHocReportListPage","Rooms","CalendarMessages","CalendarMessagesPage","CoresDirectoryPage","SamplePlatesPage","useTabTitle","loaded","setLoaded","selectorLoading","setTitle","favIconImg","FavIconImg","favIconTitle","FavIconTitle","favIcon","favLink","getElementById","HeadTitle","isDispatcherLoading","handleFavIconChange","handleTitleChange","titleTemplate","defaultTitle","htmlAttributes","lang","InstrumentRestrictionsPage","LabelTypeDetailsPage","ConfigurableColumnExportImportPage","ShortURLRoute","hash","rooted","ServerBarcodeRoute","NewMessagePage","InvoiceTemplates","InvoiceTemplatesPage","Expenses","ExpensesPage","PricePeriodsPagePage","PricePeriods","PriceSheetPeriodDetailsPage","ArticlesPagePath","ArticlesPage","AccountLayout","RegisterPage","updateY","withSaveAsLastVisitedPage","ReservationDetailsPage","HomePage","SystemPage","DashboardPage","DefaultDashboardPage","CoreSelectionPage","CoreHomePage","CoreHomeByRoutePage","CoreStatsPage","ReportingPage","BookitLabDashboadPage","RedirectWithSearch","preserveSearch","AssetSelectionPage","TermsOfUseAgreementPage","SnackWrapper","upSnackbarIndex","zindex301","ActiveUserGroupPage","CannedReportsPage","CannedReports","UserAttributes","UserAttributesPage","ReportConsumablesPage","LoginPage","CalendarMessagesDetailsPage","OfflineServiceTypesPage","AnimalCaseEditPage","library","faUserCircle","faChevronUp","faPencil","faLock","faUsers","faBell","faQuestionCircle","faSignOutAlt","faHome","faLayerGroup","faBookmark","faCalendarAlt","faDumbbell","faCommentAltDots","faBolt","faListUl","faChartBar","faChartColumn","faChartLine","faChartPie","faChartPieAlt","faMegaphone","faFileInvoiceDollar","faCog","faTimes","faCircle","faCircleSmall","faCircleCheck","faPrint","faSearch","faChevronDoubleUp","faChevronDoubleDown","faCheck","faCheckDouble","faInfo","faTriangleExclamation","faXmark","faChevronDown","faCircleXmark","faEllipsisV","faPlus","faFilter","faTable","faMinus","faFileImport","faGlobe","faLockOpen","faEdit","faTrash","faInfoCircle","faGripVertical","faBellSlash","faExclamationCircle","faTimesCircle","faArrowLeft","faTools","faPlay","faHistory","faAdd","faStream","faRulerTriangle","faThList","faClipboardListCheck","faPencilAlt","faCalendarPlus","faPause","faSave","faCalendars","faListTimeline","faCode","faBan","faFloppyDiskCircleArrowRight","faCalculator","faRefresh","faSquare","faClone","faClock","faChevronRight","faClipboardList","faEnvelope","faCalendar","faCheckCircle","faLink","faChevronDoubleRight","faChevronDoubleLeft","faChevronLeft","faList","faUser","faGripHorizontal","faArrowFromLeft","faVial","faStopwatch","faWrench","faArrowUpRightFromSquare","faExternalLink","faExternalLinkAlt","faClose","faDownload","faBold","faItalic","faUnderline","faH1","faH2","faQuoteRight","faListOl","faFileAlt","faAt","faBarcode","faChain","faPowerOff","faPlug","faMicroscope","faCalendarCheck","faCalendarExclamation","faCalendarTimes","faFileUpload","faSpinner","faMoneyCheckEdit","faLevelUpAlt","faPaperclip","faAbacus","faAlbum","faFile","faSync","faRectangleVerticalHistory","faUniversity","faShopSlash","faDollarSign","faExchange","faSms","faUserPlus","faUserShield","faWarning","faLocationCrosshairs","faCircleDollarToSlot","faCopy","faCodeBranch","faChevronsUp","faChevronsDown","faEquals","faFileSpreadsheet","faFilePdf","faNewspaper","faFileImage","faFlag","faBarcodeScan","faMap","faBars","faMagnifyingGlass","faGrid2","faScrewdriver","faBullhorn","faMoneyBill","faFileArrowUp","faEarthEurope","faScannerKeyboard","faChevronsLeft","faChevronsRight","faCircleNotch","faMapLocation","faScrewdriverWrench","faBandage","faHourglassHalf","fasInfinity","falCircleCheck","falTriangleExclamation","falCircleQuarters","falCircleExclamation","falMinimize","falMaximize","falTable","falCalendars","fadTelescope","fadInfinity","fadCalendarCheck","fadCalendarExclamation","fadCalendarTimes","fadCalendarPlus","farMaximize","farCommentQuestion","farcircleExclamation","farCircleCheck","fabGoogle","fabWindows","faShare","PublicAssetsLayout","PublicAssetsPage","NotAllowedPage","PlayGroundPage","AssetsInventoryPage","AssetsInventoryLogPage","ServiceRequestAuditTrailHistoryPage","Floors","SubscriptionTypesPage","BudgetExperimentsPage","Regions","GePageActions","responsemessage","menu_Regions","RegionDetailsPage","regionId","AddSuperGroup","SuperGroupsPage","menu_Divisions","JoinAdGroupPage","JoinConfirmPage","jss","jssPreset","App","userLoading","isLoginPage","isPublicPage","bookitTheme","defaultTheme","animalTheme","kioskTheme","dateFnsLocale","dateFnsLocales","StylesProvider","CssBaseline","barcodeScannerMiddleware","store","BARCODE_SCANNING","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","MobileBarcodeScanner","handleBarcodeScanned","mobileBarcodeScanCallback","sagaMiddleware","createSagaMiddleware","runSaga","middlewares","createRouterMiddleware","createReducer","injectedReducers","combineReducers","connectRouter","barcodeScanner","barcodeScannerReducer","enhancers","createInjectorsEnhancer","configureStore","middleware","getDefaultMiddleware","serializableCheck","ignoredPaths","ignoredActionPaths","devTools","configureAppStore","MOUNT_NODE","google","families","intervalBetweenKeyPress","scanningEndTimeout","ignoreOnInput","historyLength"],"mappings":";sGAEA,oEASO,IAAMA,EAA2D,GAQ3DC,EAA8B,SAA9BA,EACXC,GAGI,IAFJC,EAEG,uDAFcH,EACjBI,EACG,uCACHC,OAAOC,KAAKJ,GAAMK,SAAQ,SAAAC,GACxB,IAAMC,EAAmBL,EAAO,UAAMA,EAAN,Y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A,EAAOyjX,sBCFNC,GAAwBjkX,aACnC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO0jX,yBCRNC,GAAYlkX,aACvB,kBAAM,0DACN,SAAAO,GAAM,OAAIA,EAAO2jX,aCINC,GAA8BnkX,aACzC,kBAAM,oCACN,SAAAO,GAAM,OAAIA,EAAO4jX,+BCFNhV,GAA4BnvW,aACvC,kBAAM,6CACN,SAAAO,GAAM,OAAIA,EAAO4uW,6BCHNiV,GAA0BpkX,aACrC,kBAAM,mCACN,SAAAO,GAAM,OAAIA,EAAO6jX,2B,oBCDNC,GAAqBrkX,aAChC,kBAAM,yDACN,SAAAO,GAAM,OAAIA,EAAO8jX,sB,ugEC6XnBC,KAAQx7Y,IAENy7Y,gBACAC,eACAC,YACAC,UACAC,WACAC,UACAC,oBACAC,gBACAC,UACAC,gBACAC,cACAC,iBACAC,cACAC,oBACAC,UACAC,YACAC,cACAC,iBACAC,eACAC,cACAC,iBACAC,eACAC,uBACAC,SACAC,WACAC,YACAC,iBACAC,iBACAC,WACAC,YACAC,qBACAC,uBACAC,WACAC,iBACAC,UACAC,yBACAC,WACAC,iBACAC,iBACAC,eACAC,UACAC,YACAC,WACAC,WACAC,gBACAC,WACAC,cACAC,UACAC,WACAC,gBACAC,kBACAC,eACAC,uBACAC,iBACAC,eACAC,WACAC,UACAC,aACAC,SACAC,YACAC,mBACAC,YACAC,wBACAC,eACAC,kBACAC,WACAC,UACAC,eACAC,kBACAC,UACAC,SACAC,gCACAC,gBACAC,aACAC,YACAC,WACAC,WACAC,kBACAC,mBACAC,cACAC,cACAC,iBACAC,UACAC,wBACAC,uBACAC,iBACAC,UACAC,UACAC,oBACAC,mBACAC,UACAC,eACAC,YACAC,4BACAC,kBACAC,qBACAC,WACAC,cACAC,UACAC,YACAC,eACAC,QACAC,QACAC,gBACAC,YACAC,aACAC,QACAC,aACAC,WACAC,cACAC,UACAC,gBACAC,mBACAC,yBACAC,mBACAC,gBACAC,aACAC,oBACAC,gBACA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A,0BACA,6BACA,qBACA,0BACA,cACA,uBACA,0BACA,gBACA,WACA,mBACA,0BAEA,gBACA,wCACA,oBACA,aACA,YACA,YACA,SACA,gBACA,mBACA,kBACA,cACA,kBACA,kBACA,uBACA,gCACA,oBACA,wBACA,WACA,kBACA,2BACA,8BACA,iBACA,oBACA,sBACA,mBACA,WACA,cACA,uBACA,0BACA,0BACA,kBACA,oBACA,YACA,kCACA,oBACA,2BACA,wBACA,gBACA,2BACA,wBACA,eACA,uBACA,2BACA,iBACA6vC,KACAs9G,GACA,kBACA,uBAEA,iBACA,oBACA,wBACA,cACA,mCACA,eACA,qBACA,qBACA,eACA,WACA,sBACA,mBACA,gBACA,yBA/HJ,SAkIE,eAAC,IAAD,CAAkBt4X,MAAO6nY,EAAzB,SAGE,eAACp5B,EAAD,UAEE,gBAAC,IAAD,WACE,eAAC,IAAD,CACE1+V,KAAM,mBACNN,UAAWopX,KAEb,eAAC,IAAD,CACE9oX,KAAM,CAAC,sCACPN,UAAWypX,KAEb,eAAC,IAAD,CACEnpX,KAAM,wBACNN,UAAW2pX,KAEb,eAAC,IAAD,CACErpX,KAAM,wBACNN,UAAW4pX,KAEb,eAAC,IAAD,CACEtpX,KAAM,cACNN,UAAWspX,KAEb,eAAC,IAAD,CACEhpX,KAAM,iBACNN,UAAWwpX,KAEb,eAAC,IAAD,CACElpX,KAAM,cACNN,UAAWqpX,KAEb,eAAC,IAAD,CACE/oX,KAAM,6BACNN,UAAW6pX,KAEb,eAAC,IAAD,CACEjwB,OAAK,EACLt5V,KAAMqlI,wBACN3lI,UAAW6nN,KAEb,eAAC,IAAD,CACE+xI,OAAK,EACLt5V,KAAMqnN,2BACN3nN,UAAWsnN,KAEb,eAAC,IAAD,CACEsyI,OAAK,EACLt5V,KAAM,eACNN,UAAWu2W,IAEb,eAAC,IAAD,CACE3c,OAAK,EACLt5V,KAAM,WACNN,UAAWw3W,KAEb,eAAC,IAAD,CACE5d,OAAK,EACLt5V,KAAM,mBACNN,UAAW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AW,GAAD,OACLX,EADK,YAELY,aAAqB,CACtBC,kBAAmB,CACjBC,aAAc,CACZ,4CACA,kDAEFC,mBAAoB,CAClB,+CACA,0CACA,sCACA,iCACA,0BACA,iCACA,kCACA,sCAKRC,UAAUntY,EACV2sY,cDhCUS,GACRC,GAAa5gY,SAASktX,eAAe,QAE3C7sG,SACE,eAAC,aAAD,UACE,eAAC,WAAD,CAAgB3zQ,SAAU,KAA1B,SACE,gBAAC,WAAD,CAAUgyX,MAAOA,GAAjB,UACE,eAAC,KAAD,UACE,eAAC,KAAD,CAAe1qY,OAjBL,CAKlB6sY,OAAQ,CACNC,SAAU,CAAC,4CAWL,SACE,eAACjD,GAAD,QAGJ,eAAC,kBAAD,CACE7pY,OAAQ,CACN+sY,wBAAyB,GACzBC,mBAAoB,IACpBjkY,OAAOxJ,EACP0tY,eAAe,EACfC,cAAe,KAGnB,eAAC,GAAD,WAINN,IAaFhC,O","file":"static/js/main.1f73ad81.chunk.js","sourcesContent":["import { ConvertedToObjectType, TranslationJsonType } from './types';\r\n\r\n/**\r\n * This file is seperate from the './i18n.ts' simply to make the Hot Module Replacement work seamlessly.\r\n * Your components can import this file in 'messages.ts' files which would ruin the HMR if this isn't a separate module\r\n **/\r\n\r\n/**\r\n * This file is seperate from the './i18n.ts' simply to make the Hot Module Replacement work seamlessly.\r\n * Your components can import this file in 'messages.ts' files which would ruin the HMR if this isn't a separate module\r\n */\r\nexport const translations: ConvertedToObjectType<TranslationJsonType> = {} as any;\r\n\r\n/*\r\n * Converts the static JSON file into an object where keys are identical\r\n * but values are strings concatenated according to syntax.\r\n * This is helpful when using the JSON file keys and still having the intellisense support\r\n * along with type-safety\r\n */\r\nexport const convertLanguageJsonToObject = (\r\n  json: any,\r\n  objToConvertTo = translations,\r\n  current?: string,\r\n) => {\r\n  Object.keys(json).forEach(key => {\r\n    const currentLookupKey = current ? `${current}.${key}` : key;\r\n    if (typeof json[key] === 'object') {\r\n      objToConvertTo[key] = {};\r\n      convertLanguageJsonToObject(\r\n        json[key],\r\n        objToConvertTo[key],\r\n        currentLookupKey,\r\n      );\r\n    } else {\r\n      objToConvertTo[key] = currentLookupKey;\r\n    }\r\n  });\r\n};\r\n","// This module is copied from\r\n// node_modules\\date-fns\\locale\\he\\_lib\\formatLong\\index.js\r\n// and modified to solve the date separator problem for \"HE\".\r\n// Here the date separator \".\"  is replaced with \"/\" for short date case.\r\n\r\nvar _index = _interopRequireDefault(\r\n  require('date-fns/locale/_lib/buildFormatLongFn/index.js'),\r\n);\r\n\r\nfunction _interopRequireDefault(obj) {\r\n  return obj && obj.__esModule ? obj : { default: obj };\r\n}\r\n\r\nvar dateFormats = {\r\n  full: 'EEEE, d בMMMM y',\r\n  long: 'd בMMMM y',\r\n  medium: 'd בMMM y',\r\n  short: 'd/M/y',\r\n};\r\nvar timeFormats = {\r\n  full: 'H:mm:ss zzzz',\r\n  long: 'H:mm:ss z',\r\n  medium: 'H:mm:ss',\r\n  short: 'H:mm',\r\n};\r\nvar dateTimeFormats = {\r\n  full: \"{{date}} 'בשעה' {{time}}\",\r\n  long: \"{{date}} 'בשעה' {{time}}\",\r\n  medium: '{{date}}, {{time}}',\r\n  short: '{{date}}, {{time}}',\r\n};\r\nvar formatLong = {\r\n  date: (0, _index.default)({\r\n    formats: dateFormats,\r\n    defaultWidth: 'full',\r\n  }),\r\n  time: (0, _index.default)({\r\n    formats: timeFormats,\r\n    defaultWidth: 'full',\r\n  }),\r\n  dateTime: (0, _index.default)({\r\n    formats: dateTimeFormats,\r\n    defaultWidth: 'full',\r\n  }),\r\n};\r\n/*var _default = formatLong;\r\nexports.default = _default;\r\nmodule.exports = exports.default;*/\r\nexport const formatLongHE = formatLong;\r\n","import DateFnsUtils from '@date-io/date-fns';\r\nimport { IUtils } from '@date-io/core/IUtils';\r\nimport getWeekOfMonth from 'date-fns/getWeekOfMonth';\r\n\r\nimport {\r\n  parse,\r\n  parseISO,\r\n  formatDistanceToNow,\r\n  isToday,\r\n  startOfMonth,\r\n  endOfHour,\r\n  endOfTomorrow,\r\n  differenceInCalendarDays,\r\n  getDay,\r\n  getYear,\r\n  getMonth,\r\n  getHours,\r\n  getMinutes,\r\n  setWeek,\r\n  setDay,\r\n  getDate,\r\n  setDate,\r\n  setMonth,\r\n  setYear,\r\n  setHours,\r\n  setMinutes,\r\n  set,\r\n  intervalToDuration,\r\n  startOfTomorrow,\r\n  startOfYesterday,\r\n  endOfYesterday,\r\n  startOfToday,\r\n  lastDayOfMonth,\r\n  getDaysInMonth,\r\n  getDayOfYear,\r\n} from 'date-fns';\r\n\r\nimport {\r\n  differenceInSeconds,\r\n  differenceInMinutes,\r\n  differenceInHours,\r\n  differenceInDays,\r\n  differenceInWeeks,\r\n  differenceInMonths,\r\n  differenceInQuarters,\r\n  differenceInYears,\r\n} from 'date-fns';\r\nimport {\r\n  add,\r\n  addMilliseconds,\r\n  addSeconds,\r\n  addMinutes,\r\n  addHours,\r\n  addDays,\r\n  addWeeks,\r\n  addMonths,\r\n  addQuarters,\r\n  addYears,\r\n} from 'date-fns';\r\n\r\nimport {\r\n  endOfDay,\r\n  endOfMonth,\r\n  endOfQuarter,\r\n  endOfWeek,\r\n  endOfYear,\r\n  startOfHour,\r\n  startOfMinute,\r\n  startOfDay,\r\n  startOfQuarter,\r\n  startOfWeek,\r\n  startOfYear,\r\n} from 'date-fns';\r\nimport { CustomDate, DateType } from 'types/CustomDate';\r\nimport { formatLongHE } from 'utils/LocaleHE';\r\nimport { getLogger } from './logLevel';\r\nimport { toInteger } from 'lodash';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\n\r\nconst log = getLogger('DateUtils');\r\nclass DateUtils {\r\n  dateFnsUtils: IUtils<Date>;\r\n  constructor() {\r\n    this.dateFnsUtils = new DateFnsUtils();\r\n  }\r\n  /**\r\n   * he->he\r\n   * en-us->enUS\r\n   * @param s\r\n   * @returns\r\n   */\r\n  dateFnsCultureName(s: string): string {\r\n    let [x, y] = s.split('-');\r\n    y = y === undefined ? '' : y.toUpperCase();\r\n    return x.toLowerCase() + y;\r\n  }\r\n  CurrentLocale(): Locale {\r\n    return this.dateFnsUtils.locale;\r\n  }\r\n  public async setLocale(cultureName: string, systemFirstDayOfWeek: number) {\r\n    const x = this.dateFnsCultureName(cultureName);\r\n    try {\r\n      const locale = await this.getLocale(x);\r\n      this.dateFnsUtils.locale = locale;\r\n      this.dateFnsUtils.locale.options.weekStartsOn = systemFirstDayOfWeek;\r\n    } catch (err) {\r\n      console.error('setLocale', cultureName, err);\r\n    }\r\n  }\r\n  async getLocale(culture: string) {\r\n    const locale = await import(`date-fns/locale`);\r\n    var result = locale[culture];\r\n    if (result.code === 'he') {\r\n      result.formatLong = formatLongHE;\r\n    }\r\n    return result;\r\n  }\r\n  dateOrStringToDate(v: string | Date): Date {\r\n    const d = typeof v === 'string' ? this.parseISO(v as string) : (v as Date);\r\n    return d;\r\n  }\r\n  // format(v: Date | string | null | undefined, f: keyof DateIOFormats) {\r\n  //   if (v == null || v === undefined) {\r\n  //     return null;\r\n  //   }\r\n  //   try {\r\n  //     const d = this.dateOrStringToDate(v);\r\n  //     return this.dateFnsUtils.formatByString(d, this.defaultFormats[f]);\r\n  //   } catch (err) {\r\n  //     console.error(err);\r\n  //     return null;\r\n  //   }\r\n  // }\r\n  localeFirstWeekContainsDate(): number | null {\r\n    return (\r\n      this.dateFnsUtils.locale.options &&\r\n      this.dateFnsUtils.locale.options.firstWeekContainsDate\r\n    );\r\n  }\r\n  defaultFirstWeekContainsDate(): number {\r\n    return this.localeFirstWeekContainsDate() == null\r\n      ? 1\r\n      : toInteger(this.localeFirstWeekContainsDate());\r\n  }\r\n  firstWeekContainsDate(): number {\r\n    return this.dateFnsUtils.locale.options.firstWeekContainsDate == null\r\n      ? this.defaultFirstWeekContainsDate()\r\n      : toInteger(this.dateFnsUtils.locale.options.firstWeekContainsDate);\r\n  }\r\n  localeWeekStartsOn(): number | null {\r\n    return (\r\n      this.dateFnsUtils.locale.options &&\r\n      this.dateFnsUtils.locale.options.weekStartsOn\r\n    );\r\n  }\r\n  defaultWeekStartsOn(): number {\r\n    return this.localeWeekStartsOn() == null\r\n      ? 0\r\n      : toInteger(this.localeWeekStartsOn());\r\n  }\r\n  weekStartsOn(): number {\r\n    return this.dateFnsUtils.locale.options.weekStartsOn == null\r\n      ? this.defaultWeekStartsOn()\r\n      : toInteger(this.dateFnsUtils.locale.options.weekStartsOn.weekStartsOn);\r\n  }\r\n  subFnOptions() {\r\n    return {\r\n      firstWeekContainsDate: this.firstWeekContainsDate(),\r\n      weekStartsOn: this.weekStartsOn(),\r\n      locale: this.dateFnsUtils.locale,\r\n    };\r\n  } // If timezone isn't specified, it will be set to the system timezone\r\n  format(v: Date | string | null | undefined, f: string): string | null {\r\n    if (v == null || v === undefined) {\r\n      return null;\r\n    }\r\n    try {\r\n      const d = this.dateOrStringToDate(v);\r\n      return this.dateFnsUtils.format(d, f);\r\n    } catch (err) {\r\n      console.error(err);\r\n      return null;\r\n    }\r\n  }\r\n  // formatByString(\r\n  //   v: Date | string | null | undefined,\r\n  //   f: string,\r\n  // ): string | null {\r\n  //   if (v == null || v === undefined) {\r\n  //     return null;\r\n  //   }\r\n  //   try {\r\n  //     const d = this.dateOrStringToDate(v);\r\n  //     return this.dateFnsUtils.formatByString(d, f);\r\n  //   } catch (err) {\r\n  //     console.error(err);\r\n  //     return null;\r\n  //   }\r\n  // }\r\n  public HoursMinutesSecondsFormat(v: Date | string | null): string | null {\r\n    //return this.format(v, 'hh:mm:ss');\r\n    return this.format(v, this.DateIOFormats.fullTime);\r\n  }\r\n  /**\r\n   * Format to long date only format (localized). e.g. 23 Apr 2987\r\n   * @param v date\r\n   * @returns localized formatted string\r\n   */\r\n  public longDateFormat(v: Date | string | null | undefined): string | null {\r\n    return this.format(v, this.DateIOFormats.fullDate); //'PP'\r\n  }\r\n  /**\r\n   * Format to short date only format (localized). e.g. 23 04 2987\r\n   * @param v date\r\n   * @returns localized formatted string\r\n   */\r\n  public shortDateFormat(v: Date | string | null | undefined): string | null {\r\n    return this.format(v, this.DateIOFormats.keyboardDate); //'P'\r\n  }\r\n  /**\r\n   * Format to long date + time format (localized). e.g. 23 Apr 2987 12:13 AM\r\n   * @param v date\r\n   * @returns localized formatted string\r\n   */\r\n  public longDateTimeFormat(\r\n    v: Date | string | null | undefined,\r\n  ): string | null {\r\n    return this.format(v, this.DateIOFormats.fullDateTime); //PP pp\r\n  }\r\n  /**\r\n   * Format to short date + time format (localized). e.g. 23 04 2987 12:13 AM\r\n   * @param v date\r\n   * @returns localized formatted string\r\n   */\r\n  public shortDateTimeFormat(\r\n    v: Date | string | null | undefined,\r\n  ): string | null {\r\n    return this.format(v, this.DateIOFormats.keyboardDateTime); //P p\r\n  }\r\n  public timeFormat(v: Date | string | null | undefined): string | null {\r\n    return this.format(v, this.DateIOFormats.fullTime); //p\r\n  }\r\n  public parseISO(s: string | Date): Date {\r\n    if (typeof s === 'string') {\r\n      // Remove the timezone offeset part before parsing the date\r\n      // Currently the dates are serialized as with a fake UTC offset\r\n      // this might change in the future so dates will be received with a proper timezone offset\r\n      const truncatedString =\r\n        s[s.length - 1] === 'Z' ? s.substr(0, s.length - 1) : s;\r\n      const date = parseISO(truncatedString);\r\n\r\n      return date;\r\n    } else {\r\n      return s;\r\n    }\r\n  }\r\n  /**\r\n   * Little helper function to parse .net dto date fields.\r\n   * @param s ISO like string\r\n   * @returns parsed date or null\r\n   */\r\n  public parseISOOrNull(s: string | Date | null): Date | null {\r\n    if (s === null) {\r\n      return null;\r\n    }\r\n    if (typeof s === 'string') {\r\n      try {\r\n        return parseISO(s);\r\n      } catch (error) {\r\n        log.error(`parseISOOrNull - failed to parse ${s}`);\r\n        return null;\r\n      }\r\n    } else {\r\n      return s;\r\n    }\r\n  }\r\n  public tryParse(s: string | undefined | null): Date | null {\r\n    if (s === undefined) {\r\n      return null;\r\n    }\r\n    if (s === null) {\r\n      return null;\r\n    }\r\n    //first try pars using iso\r\n    let result = this.parseISO(s);\r\n    if (result === undefined) {\r\n      return null;\r\n    }\r\n    if (!isNaN(result.getTime())) {\r\n      return result;\r\n    }\r\n\r\n    // then try localized short date time\r\n    result = parse(s, 'P p', 0, { locale: this.dateFnsUtils.locale });\r\n    if (!isNaN(result.getTime())) {\r\n      return result;\r\n    }\r\n\r\n    return null;\r\n  }\r\n  public formatDistanceToNow(v: string | Date) {\r\n    const d = this.dateOrStringToDate(v);\r\n    return formatDistanceToNow(d, {\r\n      addSuffix: true,\r\n      locale: this.dateFnsUtils.locale,\r\n    });\r\n  }\r\n  public truncateTime(v: Date | string): Date {\r\n    const d = this.dateOrStringToDate(v);\r\n    const s = startOfDay(d);\r\n    return s;\r\n  }\r\n  public truncateSeconds(v: Date | string): Date {\r\n    const d = this.dateOrStringToDate(v);\r\n    const s = startOfMinute(d);\r\n    return s;\r\n  }\r\n  /**\r\n   * Custom ISO format is needed since the OData api works with a fake UTC timezone\r\n   * Dates on the server are without timezone offset as the dates in the App time zone\r\n   * OData processes the DateTime by appending a Zero timezone offset (UTC)\r\n   * @param date date to format\r\n   * @param options format options\r\n   * @returns ISO string representation\r\n   */\r\n  public formatISO(\r\n    date: Date,\r\n    options?: {\r\n      format?: 'extended' | 'basic';\r\n      representation?: DateType;\r\n    },\r\n  ) {\r\n    const timeFormat = 'HH:mm:ss';\r\n    const dateFormat = 'yyyy-MM-dd';\r\n    const gfs = (representation: DateType | undefined) => {\r\n      switch (representation) {\r\n        default:\r\n        case 'complete':\r\n          return `${dateFormat}'T'${timeFormat}'Z'`;\r\n        case 'date':\r\n          return dateFormat;\r\n        case 'time':\r\n          return timeFormat;\r\n      }\r\n    };\r\n    const dateString = this.dateFnsUtils.format(\r\n      date,\r\n      gfs(options?.representation),\r\n    );\r\n    return dateString;\r\n  }\r\n  public tryFormatIso(\r\n    date: any,\r\n    options?: {\r\n      format?: 'extended' | 'basic';\r\n      representation?: DateType;\r\n    },\r\n  ) {\r\n    try {\r\n      if (date === null) {\r\n        return null;\r\n      }\r\n      if (date === undefined) {\r\n        return undefined;\r\n      }\r\n      if (typeof date === 'string' || date instanceof Date) {\r\n        const formatDate = this.dateOrStringToDate(date);\r\n        return this.formatISO(formatDate, options);\r\n      } else {\r\n        return null;\r\n      }\r\n    } catch (error) {\r\n      return null;\r\n    }\r\n  }\r\n  public formatQueryStringDate(\r\n    date: Date,\r\n    options?: {\r\n      representation?: DateType;\r\n    },\r\n  ): string {\r\n    let convertedDate = this.dateOrStringToDate(date);\r\n    switch (options?.representation ?? 'complete') {\r\n      default:\r\n      case 'complete':\r\n        return this.dateFnsUtils.format(convertedDate, \"yyyy-MM-dd'T'HH:mm:ss\");\r\n      case 'date':\r\n        return this.dateFnsUtils.format(convertedDate, 'yyyy-MM-dd');\r\n      case 'time':\r\n        return this.dateFnsUtils.format(convertedDate, 'HH:mm:ss');\r\n    }\r\n  }\r\n  public parseQueryStringDate(value: string): Date {\r\n    return this.parseISO(value);\r\n  }\r\n  public getDayText(date: Date): string {\r\n    return this.dateFnsUtils.format(date, 'cccc');\r\n  }\r\n\r\n  public getShortDaysArray(): string[] {\r\n    const fdow = startOfWeek(new Date());\r\n    return Array.from(Array(7)).map((e, i) =>\r\n      this.dateFnsUtils.format(\r\n        addDays(fdow, i),\r\n        this.DateIOFormats.weekdayShort,\r\n      ),\r\n    );\r\n  }\r\n  public getLongDaysArray(): string[] {\r\n    const fdow = startOfWeek(new Date());\r\n    return Array.from(Array(7)).map((e, i) =>\r\n      this.dateFnsUtils.format(addDays(fdow, i), this.DateIOFormats.weekday),\r\n    );\r\n  }\r\n  public getMinutesDiff(startDate: Date, endDate: Date) {\r\n    let diff = endDate.getTime() - startDate.getTime();\r\n    return diff / 60000;\r\n  }\r\n  public getHoursDiff(startDate: Date, endDate: Date) {\r\n    const msInHour = 1000 * 60 * 60;\r\n    return (endDate.getTime() - startDate.getTime()) / msInHour;\r\n  }\r\n  public getDaysDiff(startDate: Date, endDate: Date) {\r\n    const msInDays = 1000 * 3600 * 24;\r\n    return (endDate.getTime() - startDate.getTime()) / msInDays;\r\n  }\r\n  public getWeekDiff(startDate: Date, endDate: Date) {\r\n    const msInWeek = 7 * 24 * 60 * 60 * 1000;\r\n    return (endDate.getTime() - startDate.getTime()) / msInWeek;\r\n  }\r\n  public getMonthDiff(startDate: Date, endDate: Date) {\r\n    var months;\r\n    months = (endDate.getFullYear() - startDate.getFullYear()) * 12;\r\n    months -= startDate.getMonth();\r\n    months += endDate.getMonth();\r\n    return months <= 0 ? 0 : months;\r\n  }\r\n  public DateIOFormats: DateIOFormats = {\r\n    dayOfMonth: 'd',\r\n    fullDate: 'PP',\r\n    fullDateWithWeekday: 'PPPP',\r\n    fullDateTime: 'PP p',\r\n    fullDateTime12h: 'PP hh:mm aaa',\r\n    fullDateTime24h: 'PP HH:mm',\r\n    fullTime: 'p',\r\n    fullTime12h: 'hh:mm aaa',\r\n    fullTime24h: 'HH:mm',\r\n    hours12h: 'hh',\r\n    hours24h: 'HH',\r\n    keyboardDate: 'P',\r\n    keyboardDateTime: 'P p',\r\n    keyboardDateTime12h: 'P hh:mm aaa',\r\n    keyboardDateTime24h: 'P HH:mm',\r\n    minutes: 'mm',\r\n    month: 'LLLL',\r\n    monthAndDate: 'MMMM d',\r\n    monthAndYear: 'LLLL yyyy',\r\n    monthShort: 'MMM',\r\n    weekday: 'EEEE',\r\n    weekdayShort: 'EEE',\r\n    normalDate: 'd MMMM',\r\n    normalDateWithWeekday: 'EEE, MMM d',\r\n    seconds: 'ss',\r\n    shortDate: 'MMM d',\r\n    year: 'yyyy',\r\n  };\r\n  public isToday = isToday;\r\n  // diff functions\r\n  public differenceInSeconds = differenceInSeconds;\r\n  public differenceInMinutes = differenceInMinutes;\r\n  public differenceInHours = differenceInHours;\r\n  public differenceInDays = differenceInDays;\r\n  public differenceInWeeks = differenceInWeeks;\r\n  public differenceInMonths = differenceInMonths;\r\n  public differenceInQuarters = differenceInQuarters;\r\n  public differenceInYears = differenceInYears;\r\n  public differenceInCalendarDays = differenceInCalendarDays;\r\n\r\n  // add functions\r\n  public add = add;\r\n  public addMilliseconds = addMilliseconds;\r\n  public addSeconds = addSeconds;\r\n  public addMinutes = addMinutes;\r\n  public addHours = addHours;\r\n  public addDays = addDays;\r\n  public addWeeks = addWeeks;\r\n  public addMonths = addMonths;\r\n  public addQuarters = addQuarters;\r\n  public addYears = addYears;\r\n\r\n  // startOf functions\r\n  public startOfMinute = startOfMinute;\r\n  public startOfHour = startOfHour;\r\n  public startOfDay = startOfDay;\r\n  public startOfWeek(\r\n    date: Date | number,\r\n    firstDayOfWeek?: WeekStartsOn | number,\r\n  ) {\r\n    return startOfWeek(date, {\r\n      locale: dateUtils.dateFnsUtils.locale,\r\n      weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n    });\r\n  }\r\n  public startOfMonth = startOfMonth;\r\n  public startOfQuarter = startOfQuarter;\r\n  public startOfYear = startOfYear;\r\n\r\n  // endOf functions\r\n  public endOfHour = endOfHour;\r\n  public endOfDay = endOfDay;\r\n  public endOfWeek(\r\n    date: Date | number,\r\n    firstDayOfWeek?: WeekStartsOn | number,\r\n  ) {\r\n    return endOfWeek(date, {\r\n      locale: dateUtils.dateFnsUtils.locale,\r\n      weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n    });\r\n  }\r\n  public endOfMonth = endOfMonth;\r\n  public endOfQuarter = endOfQuarter;\r\n  public endOfYear = endOfYear;\r\n  public endOfTomorrow = endOfTomorrow;\r\n  public startOfTomorrow = startOfTomorrow;\r\n  public startOfYesterday = startOfYesterday;\r\n  public endOfYesterday = endOfYesterday;\r\n  public startOfToday = startOfToday;\r\n  public lastDayOfMonth = lastDayOfMonth;\r\n  public getDaysInMonth = getDaysInMonth;\r\n  public getDayOfYear = getDayOfYear;\r\n\r\n  //other\r\n  public getYear = getYear;\r\n  public getMonth = getMonth;\r\n  public getHours = getHours;\r\n  public getMinutes = getMinutes;\r\n  public getDate = getDate;\r\n  public setDate = setDate;\r\n  public setMonth = setMonth;\r\n  public setYear = setYear;\r\n  public setHours = setHours;\r\n  public setMinutes = setMinutes;\r\n  public getDay(date: Date | number): number {\r\n    return getDay(date) as number;\r\n  }\r\n  public setWeek(\r\n    date: Date | number,\r\n    week: number,\r\n    firstDayOfWeek: WeekStartsOn | number,\r\n  ): Date {\r\n    return setWeek(date, week, {\r\n      locale: this.dateFnsUtils.locale,\r\n      weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n    });\r\n  }\r\n  public setDay(\r\n    date: Date | number,\r\n    day: number,\r\n    firstDayOfWeek: WeekStartsOn | number,\r\n  ): Date {\r\n    return setDay(date, day, {\r\n      locale: this.dateFnsUtils.locale,\r\n      weekStartsOn: firstDayOfWeek as WeekStartsOn,\r\n    });\r\n  }\r\n  public set(\r\n    date: Date | number,\r\n    values: {\r\n      year?: number;\r\n      month?: number;\r\n      date?: number;\r\n      hours?: number;\r\n      minutes?: number;\r\n      seconds?: number;\r\n      milliseconds?: number;\r\n    },\r\n  ): Date {\r\n    return set(date, values);\r\n  }\r\n\r\n  public getWeekNumberOfMonth(\r\n    date: Date,\r\n    FirstDayOfWeek?: WeekStartsOn | number,\r\n  ): number {\r\n    return getWeekOfMonth(date, {\r\n      locale: this.dateFnsUtils.locale,\r\n      weekStartsOn: FirstDayOfWeek as WeekStartsOn,\r\n    });\r\n  }\r\n  public intervalToDuration = intervalToDuration;\r\n\r\n  public timeStringToDecimal(time: string): number {\r\n    var hoursMinutes = time.split(/[.:]/);\r\n    var hours = parseInt(hoursMinutes[0], 10);\r\n    var minutes = hoursMinutes[1] ? parseInt(hoursMinutes[1], 10) : 0;\r\n    return hours + minutes / 60;\r\n  }\r\n  public toDate(date: Date | string) {\r\n    return dateUtils.dateOrStringToDate(date);\r\n  }\r\n  public newDate(date: Date | string | undefined) {\r\n    if (!date) {\r\n      return new CustomDate(new Date(), 'complete');\r\n    } else {\r\n      return new CustomDate(this.toDate(date), 'complete');\r\n    }\r\n  }\r\n  public getMeridiem(date: Date | string) {\r\n    return dateUtils.getHours(dateUtils.toDate(date)) >= 12 ? 'pm' : 'am';\r\n  }\r\n  public convertToMeridiem(\r\n    time: Date | string,\r\n    meridiem: 'am' | 'pm',\r\n    ampm: boolean,\r\n  ) {\r\n    let val = dateUtils.toDate(time);\r\n    if (ampm) {\r\n      var currentMeridiem = dateUtils.getHours(val) >= 12 ? 'pm' : 'am';\r\n      if (currentMeridiem !== meridiem) {\r\n        var hours =\r\n          meridiem === 'am'\r\n            ? dateUtils.getHours(val) - 12\r\n            : dateUtils.getHours(val) + 12;\r\n        return dateUtils.setHours(val, hours);\r\n      }\r\n    }\r\n    return val;\r\n  }\r\n  public getMeridiemHours(time: Date | string) {\r\n    let val = dateUtils.toDate(time);\r\n    var currentMeridiem = dateUtils.getHours(val) > 12 ? 'pm' : 'am';\r\n    if (currentMeridiem === 'pm') {\r\n      let hours = dateUtils.getHours(val) - 12;\r\n      return hours;\r\n    }\r\n    return dateUtils.getHours(val);\r\n  }\r\n  public getParsableDate(date: ParsableDate) {\r\n    var resDate =\r\n      date === null || date === undefined\r\n        ? null\r\n        : typeof date === 'object'\r\n        ? new Date(date as Date)\r\n        : typeof date === 'number'\r\n        ? new Date(date)\r\n        : dateUtils.dateOrStringToDate(date);\r\n    return resDate;\r\n  }\r\n}\r\n\r\nexport const dateUtils = new DateUtils();\r\n\r\nexport type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;\r\nexport interface DateIOFormats<TLibFormatToken = string> {\r\n  /** Localized full date @example \"Jan 1, 2019\" */\r\n  fullDate: TLibFormatToken;\r\n  /** Partially localized full date with weekday, useful for text-to-speech accessibility @example \"Tuesday, January 1, 2019\" */\r\n  fullDateWithWeekday: TLibFormatToken;\r\n  /** Date format string with month and day of month @example \"1 January\" */\r\n  normalDate: TLibFormatToken;\r\n  /** Date format string with weekday, month and day of month @example \"Wed, Jan 1\" */\r\n  normalDateWithWeekday: TLibFormatToken;\r\n  /** Shorter day format @example \"Jan 1\" */\r\n  shortDate: TLibFormatToken;\r\n  /** Year format string @example \"2019\" */\r\n  year: TLibFormatToken;\r\n  /** Month format string @example \"January\" */\r\n  month: TLibFormatToken;\r\n  /** Short month format string @example \"Jan\" */\r\n  monthShort: TLibFormatToken;\r\n  /** Month with year format string @example \"January 2018\" */\r\n  monthAndYear: TLibFormatToken;\r\n  /** Month with date format string @example \"January 1\" */\r\n  monthAndDate: TLibFormatToken;\r\n  /** Weekday format string @example \"Wednesday\" */\r\n  weekday: TLibFormatToken;\r\n  /** Short weekday format string @example \"Wed\" */\r\n  weekdayShort: TLibFormatToken;\r\n  /** Day format string @example \"1\" */\r\n  dayOfMonth: TLibFormatToken;\r\n  /** Hours format string @example \"11\" */\r\n  hours12h: TLibFormatToken;\r\n  /** Hours format string @example \"23\" */\r\n  hours24h: TLibFormatToken;\r\n  /** Minutes format string @example \"44\" */\r\n  minutes: TLibFormatToken;\r\n  /** Seconds format string @example \"00\" */\r\n  seconds: TLibFormatToken;\r\n  /** Full time localized format string @example \"11:44 PM\" for US, \"23:44\" for Europe */\r\n  fullTime: TLibFormatToken;\r\n  /** Not localized full time format string @example \"11:44 PM\" */\r\n  fullTime12h: TLibFormatToken;\r\n  /** Not localized full time format string @example \"23:44\" */\r\n  fullTime24h: TLibFormatToken;\r\n  /** Date & time format string with localized time @example \"Jan 1, 2018 11:44 PM\" */\r\n  fullDateTime: TLibFormatToken;\r\n  /** Not localized date & Time format 12h @example \"Jan 1, 2018 11:44 PM\" */\r\n  fullDateTime12h: TLibFormatToken;\r\n  /** Not localized date & Time format 24h @example \"Jan 1, 2018 23:44\" */\r\n  fullDateTime24h: TLibFormatToken;\r\n  /** Localized keyboard input friendly date format @example \"02/13/2020 */\r\n  keyboardDate: TLibFormatToken;\r\n  /** Localized keyboard input friendly date/time format @example \"02/13/2020 23:44\" */\r\n  keyboardDateTime: TLibFormatToken;\r\n  /** Partially localized keyboard input friendly date/time 12h format @example \"02/13/2020 11:44 PM\" */\r\n  keyboardDateTime12h: TLibFormatToken;\r\n  /** Partially localized keyboard input friendly date/time 24h format @example \"02/13/2020 23:44\" */\r\n  keyboardDateTime24h: TLibFormatToken;\r\n}\r\n","import { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { SearchColumnType } from 'app/components/BasicTable/BasicTableProps';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\n/**\r\n * Supported OData operators\r\n * TODO: extend to greater than, etc\r\n */\r\nexport enum ODataOperators {\r\n  Equals = 'eq',\r\n  NotEquals = 'ne',\r\n  GreaterThan = 'gt',\r\n  GreaterThanEqual = 'ge',\r\n  LessThan = 'lt',\r\n  LessThanEqual = 'le',\r\n  Contains = 'contains',\r\n  Between = 'between',\r\n  Intersection = 'intersection',\r\n  Any = 'any',\r\n  NotAny = 'notAny',\r\n  In = 'in',\r\n  Includes = 'includes',\r\n  Excludes = 'excludes',\r\n  InM = 'inm',\r\n  AnyIn = 'AnyIn',\r\n  ContainsM = 'containsm',\r\n  HasNoAny = 'hasNoAny',\r\n  All = 'all',\r\n  AllIn = 'allIn',\r\n}\r\nexport type OdataFilterOperatorType =\r\n  | ODataOperators\r\n  | ((value: FilterValueType | undefined) => string);\r\nexport const operatorToString = (\r\n  key: ODataOperators,\r\n  value: FilterValueType | undefined,\r\n  t: TFunction,\r\n): string => {\r\n  return key === ODataOperators.Equals\r\n    ? t(translations.ODataEquals)\r\n    : key === ODataOperators.NotEquals\r\n    ? t(translations.ODataNotEquals)\r\n    : key === ODataOperators.GreaterThan\r\n    ? value instanceof Date\r\n      ? t(translations.ODataGtAfter)\r\n      : t(translations.ODataGreaterThan)\r\n    : key === 'lt'\r\n    ? value instanceof Date\r\n      ? t(translations.ODataLtBefore)\r\n      : t(translations.ODataLessThan)\r\n    : key === ODataOperators.GreaterThanEqual\r\n    ? t(translations.ODataGreaterThanEqual)\r\n    : key === ODataOperators.LessThanEqual\r\n    ? t(translations.ODataLessThanEqual)\r\n    : key === ODataOperators.Intersection\r\n    ? t(translations.ODataIntersection)\r\n    : key === ODataOperators.NotAny\r\n    ? t(translations.ODataNotAny)\r\n    : key === ODataOperators.Includes\r\n    ? t(translations.ODataIncludes)\r\n    : key === ODataOperators.Excludes\r\n    ? t(translations.ODataExcludes)\r\n    : key === ODataOperators.AnyIn\r\n    ? t(translations.ODataAnyIn)\r\n    : key === ODataOperators.ContainsM\r\n    ? t(translations.ODataContainsM)\r\n    : key === ODataOperators.InM\r\n    ? t(translations.ODataInM)\r\n    : key === ODataOperators.HasNoAny\r\n    ? t(translations.ODataHasNoAny)\r\n    : key === ODataOperators.All\r\n    ? t(translations.ODataAll)\r\n    : key === ODataOperators.AllIn\r\n    ? t(translations.ODataAllIn)\r\n    : key === ODataOperators.In\r\n    ? t(translations.ODataIn)\r\n    : key === ODataOperators.Any\r\n    ? t(translations.ODataAny)\r\n    : key;\r\n};\r\n/**\r\n * Supported value types\r\n */\r\nexport type ODataFieldType = string | number | Date | boolean;\r\n\r\n/**\r\n * Formats a const value in oData format.\r\n * @param value value\r\n * @returns formatted value that can be used in odata filter expression\r\n */\r\nexport function quoteODataValue(\r\n  value: FilterValueType | Array<FilterValueType>,\r\n) {\r\n  if (value === null) {\r\n    return null;\r\n  } else if (typeof value === 'number') {\r\n    return value.toString();\r\n  } else if (typeof value === 'boolean') {\r\n    return value.toString();\r\n  } else if (typeof value === 'string') {\r\n    return `'${escapeODataValue(value)}'`;\r\n  } else if (value instanceof CustomDate) {\r\n    return `${dateUtils.formatISO(value, {\r\n      representation: (value as CustomDate).representation ?? 'date',\r\n    })}`;\r\n  } else if (value instanceof Date) {\r\n    return `${dateUtils.formatISO(value, { representation: 'complete' })}`;\r\n  } else if (Array.isArray(value)) {\r\n    return `(${value.map(v => quoteODataValue(v)).join(',')})`;\r\n  } else if ('Id' in value) {\r\n    return quoteODataValue(value.Id);\r\n  } else {\r\n    console.error(`Value type not supported: ${value}`, value);\r\n    throw new Error(`Value type not supported: ${value}`);\r\n  }\r\n}\r\n/**\r\n * Escapes const OData value\r\n * @param value value\r\n * @returns\r\n */\r\nexport function escapeODataValue(value: string): string {\r\n  return value.replaceAll(\"'\", \"''\");\r\n}\r\n\r\nexport function withisInversed<\r\n  T extends string | undefined = string | undefined\r\n>(condition: T, isInversed: boolean | undefined) {\r\n  if (!isInversed || (condition ?? '') === '') {\r\n    return condition;\r\n  }\r\n  return '(' + condition + ') eq false';\r\n}\r\n\r\n/**\r\n * Filter condition to be used in future custom filters\r\n */\r\nexport class Condition<TRow> {\r\n  public field: keyof TRow;\r\n  public field1?: keyof TRow;\r\n  public operator?: ODataOperators;\r\n  public value?: FilterValueType;\r\n  public isInversed?: boolean;\r\n  constructor(\r\n    field: keyof TRow,\r\n    operator: ODataOperators,\r\n    value: FilterValueType | undefined,\r\n    field1?: keyof TRow,\r\n    isInversed?: boolean,\r\n  ) {\r\n    this.field = field;\r\n    this.field1 = field1;\r\n    this.operator = operator;\r\n    this.value = value;\r\n    this.isInversed = isInversed;\r\n  }\r\n\r\n  /**\r\n   * Format the range filter (between operator)\r\n   * @returns odata filter string\r\n   */\r\n  between() {\r\n    const c1: Condition<TRow>[] = [];\r\n    const start = (this.value as any).start;\r\n    if (start !== null) {\r\n      c1.push(\r\n        new Condition(this.field, ODataOperators.GreaterThanEqual, start),\r\n      );\r\n    }\r\n    const end = (this.value as any).end;\r\n    if (end !== null) {\r\n      c1.push(new Condition(this.field, ODataOperators.LessThanEqual, end));\r\n    }\r\n    const result =\r\n      c1.length > 0 ? `(${c1.map(c => c.toString()).join(' and ')})` : '';\r\n    return result;\r\n  }\r\n  /**\r\n   * Format the range filter (intersection operator)\r\n   * @returns odata filter string\r\n   */\r\n  intersection() {\r\n    if (this.field1 === undefined) return '';\r\n    const c1: Condition<TRow>[] = [];\r\n    const start = (this.value as any).start;\r\n    if (start !== null) {\r\n      c1.push(new Condition(this.field1, ODataOperators.GreaterThan, start));\r\n    }\r\n    const end = (this.value as any).end;\r\n    if (end !== null) {\r\n      c1.push(new Condition(this.field, ODataOperators.LessThan, end));\r\n    }\r\n    const result =\r\n      c1.length > 0 ? `${c1.map(c => c.toString()).join(' and ')}` : '';\r\n    return result;\r\n  }\r\n  hasAny() {\r\n    //if (this.field1 === undefined) return '';\r\n    const result = `${this.field}/any(g: g${\r\n      this.field1 ? '/' + this.field1 : ''\r\n    } eq ${quoteODataValue(this.value as number)})`;\r\n    return result;\r\n  }\r\n  haNoAny() {\r\n    const result = `not ${this.field}/any()`;\r\n    return result;\r\n  }\r\n  notAny() {\r\n    if (this.field1 === undefined) return '';\r\n    const result = `${this.field}/any(g: g/${this.field1} eq ${quoteODataValue(\r\n      this.value as number,\r\n    )}) eq false`;\r\n    return result;\r\n  }\r\n  anyIn() {\r\n    if (!Array.isArray(this.value)) return '';\r\n    const result = `${this.field}/any(g: g${\r\n      !!this.field1 ? '/' + this.field1 : ''\r\n    } in ${quoteODataValue(this.value)})`;\r\n    return result;\r\n  }\r\n  allIn() {\r\n    if (!Array.isArray(this.value)) return '';\r\n    const result = `${this.field}/all(g: g${\r\n      this.field1 ? '/' + this.field1 : ''\r\n    } in ${quoteODataValue(this.value)})`;\r\n    return result;\r\n  }\r\n  all() {\r\n    if (this.field1 === undefined) return '';\r\n    const result = `${this.field}/all(g: g/${this.field1} eq ${quoteODataValue(\r\n      this.value as number,\r\n    )})`;\r\n    return result;\r\n  }\r\n  inM() {\r\n    let res: string[] | undefined =\r\n      this.value !== null && Array.isArray(this.value)\r\n        ? (this.value as Array<FilterValueType>).map(v => {\r\n            return `${quoteODataValue(v)} in ${this.field}`;\r\n          })\r\n        : undefined;\r\n    return res !== undefined ? `(${res.join(' or ')})` : '';\r\n  }\r\n  public withNull(fieldName?: string) {\r\n    const res = this.toString();\r\n    const name = fieldName ?? String(this.field);\r\n    if (res === undefined) return res;\r\n    return '((' + res + ') or ' + name + ' eq null)';\r\n  }\r\n  public toString(): string | undefined {\r\n    if (this.value === undefined) {\r\n      return undefined;\r\n    }\r\n    if (this.operator === undefined) {\r\n      return undefined;\r\n    }\r\n    switch (this.operator) {\r\n      case ODataOperators.Equals:\r\n      case ODataOperators.NotEquals:\r\n      case ODataOperators.GreaterThan:\r\n      case ODataOperators.GreaterThanEqual:\r\n      case ODataOperators.LessThan:\r\n      case ODataOperators.LessThanEqual:\r\n        return `${this.field} ${this.operator} ${quoteODataValue(this.value)}`;\r\n      case ODataOperators.Contains:\r\n        return `contains(tolower(${this.field}), ${quoteODataValue(\r\n          this.value,\r\n        ).toLowerCase()})`;\r\n      case ODataOperators.ContainsM:\r\n        let resCM: string[] | undefined =\r\n          this.value !== null && Array.isArray(this.value)\r\n            ? (this.value as Array<FilterValueType>).map(v => {\r\n                return `contains(tolower(${this.field}), ${quoteODataValue(\r\n                  v?.['Name'] ?? v,\r\n                ).toLowerCase()})`;\r\n              })\r\n            : undefined;\r\n        return resCM !== undefined ? resCM.join(' or ') : '';\r\n      case ODataOperators.Between:\r\n        return this.between();\r\n      case ODataOperators.Intersection:\r\n        return this.intersection();\r\n      case ODataOperators.Any:\r\n        return this.hasAny();\r\n      case ODataOperators.NotAny:\r\n        return this.notAny();\r\n      case ODataOperators.In:\r\n        return `(${quoteODataValue(this.value)} in ${this.field})`;\r\n      case ODataOperators.InM:\r\n        return this.inM();\r\n      case ODataOperators.Includes:\r\n        return `(${this.field} in ${quoteODataValue(this.value)})`;\r\n      case ODataOperators.Excludes:\r\n        return `(${this.field} in ${quoteODataValue(this.value)} eq false)`;\r\n      case ODataOperators.AnyIn:\r\n        return this.anyIn();\r\n      case ODataOperators.HasNoAny:\r\n        return this.haNoAny();\r\n      case ODataOperators.All:\r\n        return this.all();\r\n      case ODataOperators.AllIn:\r\n        return this.allIn();\r\n      default:\r\n        return undefined;\r\n    }\r\n  }\r\n}\r\n\r\n/**\r\n * OData filter expression builder\r\n */\r\nexport class ODataFilterBuilder<T> {\r\n  predicates: (string | Condition<T>)[] = [];\r\n  globalServiceGroupFilter: Condition<T>[] = [];\r\n  stringColumns?: Array<SearchColumnType<T>>;\r\n  stringSearch?: string | null;\r\n  isOptionalServiceGroup?: boolean;\r\n  constructor(x: {\r\n    predicates: (string | Condition<T>)[];\r\n    stringColumns?: Array<SearchColumnType<T>>;\r\n    stringSearch?: string | null;\r\n    globalServiceGroupFilter?: Condition<T>[];\r\n    timezone?: string;\r\n    isOptionalServiceGroup?: boolean;\r\n  }) {\r\n    this.predicates = x.predicates.filter(\r\n      f => f.toString() !== '' && f.toString() !== undefined,\r\n    );\r\n    this.stringColumns = x.stringColumns;\r\n    this.stringSearch = x.stringSearch;\r\n    this.globalServiceGroupFilter = x.globalServiceGroupFilter || [];\r\n    this.isOptionalServiceGroup = x.isOptionalServiceGroup;\r\n  }\r\n  public toString(): string | undefined {\r\n    const x: string[] = [];\r\n    if (\r\n      this.stringSearch !== undefined &&\r\n      this.stringSearch !== null &&\r\n      this.stringSearch !== ''\r\n    ) {\r\n      if (this.stringColumns !== undefined) {\r\n        const stringValue = this.stringSearch.toLowerCase();\r\n        x.push(\r\n          '(' +\r\n            this.stringColumns\r\n              .map(c =>\r\n                typeof c === 'function'\r\n                  ? c(\"'\" + escapeODataValue(stringValue) + \"'\")\r\n                  : new Condition<T>(\r\n                      c as keyof T,\r\n                      ODataOperators.Contains,\r\n                      stringValue,\r\n                    ),\r\n              )\r\n              .map(c => c.toString())\r\n              .join(' or ') +\r\n            ')',\r\n        );\r\n      }\r\n    }\r\n    if (this.predicates?.length > 0) {\r\n      x.push(\r\n        '(' +\r\n          this.predicates\r\n            .map(p => withisInversed(p.toString(), p['isInversed']))\r\n            .filter(p => p !== '' && p !== undefined)\r\n            .join(' and ') +\r\n          ')',\r\n      );\r\n    }\r\n    if (\r\n      this.globalServiceGroupFilter.length > 0 &&\r\n      this.globalServiceGroupFilter[0].field !== ''\r\n    ) {\r\n      if (this.globalServiceGroupFilter[0].field === 'ServiceGroupId') {\r\n        x.push(\r\n          '(' +\r\n            (this.isOptionalServiceGroup === true\r\n              ? this.globalServiceGroupFilter\r\n                  .concat(\r\n                    new Condition<any>(\r\n                      'ServiceGroupId',\r\n                      ODataOperators.Equals,\r\n                      null,\r\n                    ),\r\n                  )\r\n                  .map(p => p.toString())\r\n                  .join(' or ')\r\n              : this.globalServiceGroupFilter\r\n                  .map(p => p.toString())\r\n                  .join(' or ')) +\r\n            ')',\r\n        );\r\n      } else {\r\n        x.push(\r\n          '(' +\r\n            this.globalServiceGroupFilter.map(p => p.toString()).join(' or ') +\r\n            ')',\r\n        );\r\n      }\r\n    }\r\n    const result =\r\n      x.length === 0\r\n        ? undefined\r\n        : x.length === 1 && x[0] === '()'\r\n        ? undefined\r\n        : x.join(' and ');\r\n    return result;\r\n  }\r\n}\r\n\r\nexport type oDataValue = { operator: ODataOperators; value: string };\r\n","//base colors\r\nexport const base_black_c11 = '#121926';\r\nexport const base_white_c0 = '#FFFFFF';\r\n//grayscale colors\r\nexport const grayscale_black_regular_c10 = '#202939';\r\nexport const grayscale_black_components_c9 = '#364152';\r\nexport const grayscale_gray_subtitles_c8 = '#4B5565';\r\nexport const grayscale_gray_components_c7 = '#697586';\r\nexport const grayscale_gray_components_light_c6 = '#9AA3B2';\r\nexport const grayscale_gray_borders_c5 = '#CDD5DF';\r\nexport const grayscale_gray_selection_c4 = '#E3E8EF';\r\nexport const grayscale_gray_bg_components_c3 = '#EEF2F6';\r\nexport const grayscale_gray_background_c2 = '#F8FAFC';\r\nexport const grayscale_gray_bg_light_c1 = '#FCFCFD';\r\n\r\n//opacity colors\r\nexport const overlay_opacity_black = 'rgba(0, 5, 10, 0.70)';\r\nexport const overlay_opacity_white = 'rgba(255, 255, 255, 0.95)';\r\n\r\n//primary colors\r\nexport const primary_dark_text_c10 = '#0B4A6F';\r\nexport const primary_hover_c9 = '#065986';\r\nexport const primary_regular_c8 = '#026AA2';\r\nexport const primary_components_c7 = '#0086C9';\r\nexport const primary_components_light_c6 = '#0BA5EC';\r\nexport const primary_borders_c5 = '#36BFFA';\r\nexport const primary_disabled_c4 = '#C5EAFE';\r\nexport const primary_bg_hover_c3 = '#E0F2FE';\r\nexport const primary_background_c2 = '#F0F9FF';\r\nexport const primary_bg_light_c1 = '#F5FBFF';\r\n\r\n//secondary colors\r\nexport const secondary_violet_dark_text_c10 = '#283493';\r\nexport const secondary_violet_hover_c9 = '#404FB7';\r\nexport const secondary_violet_regular_c8 = '#5C6FDB';\r\nexport const secondary_violet_components_c7 = '#7F94FF';\r\nexport const secondary_violet_components_light_c6 = '#9FB0FF';\r\nexport const secondary_violet_borders_c5 = '#B2C1FF';\r\nexport const secondary_violet_disabled_c4 = '#CBD6FF';\r\nexport const secondary_violet_bg_hover_c3 = '#E5EBFF';\r\nexport const secondary_violet_background_c2 = '#F2F5FF';\r\nexport const secondary_violet_bg_light_c1 = '#F9FAFF';\r\n\r\n//danger colors\r\nexport const semantic_danger_dark_text_c10 = '#841444';\r\nexport const semantic_danger_hover_c9 = '#A41F4C';\r\nexport const semantic_danger_regular_c8 = '#C42E52';\r\nexport const semantic_danger_components_c7 = '#EF6D74';\r\nexport const semantic_danger_components_light_c6 = '#EF6D74';\r\nexport const semantic_danger_borders_c5 = '#F78F8B';\r\nexport const semantic_danger_disabled_c4 = '#FCBCB3';\r\nexport const semantic_danger_bg_hover_c3 = '#FDE1D8';\r\nexport const semantic_danger_background_c2 = '#FEF0EC';\r\nexport const semantic_danger_bg_light_c1 = '#FFF8F5';\r\n\r\n//secondary colors\r\nexport const semantic_success_dark_text_c10 = '#076F4F';\r\nexport const semantic_success_hover_c9 = '#0C8654';\r\nexport const semantic_success_regular_c8 = '#13A75C';\r\nexport const semantic_success_components_c7 = '#1CC760';\r\nexport const semantic_success_components_light_c6 = '#27E861';\r\nexport const semantic_success_borders_c5 = '#7CF889';\r\nexport const semantic_success_disabled_c4 = '#A8FCA9';\r\nexport const semantic_success_bg_hover_c3 = '#D7FDD3';\r\nexport const semantic_success_background_c2 = '#EBFEE9';\r\nexport const semantic_success_bg_light_c1 = '#F5FFF4';\r\n\r\n//alert(warning) colors\r\nexport const semantic_alert_dark_text_c10 = '#7F5000';\r\nexport const semantic_alert_hover_c9 = '#9D6800';\r\nexport const semantic_alert_regular_c8 = '#BC8200';\r\nexport const semantic_alert_components_c7 = '#DB9E00';\r\nexport const semantic_alert_components_light_c6 = '#E9BD3A';\r\nexport const semantic_alert_borders_c5 = '#F4D361';\r\nexport const semantic_alert_disabled_c4 = '#FBE896';\r\nexport const semantic_alert_bg_hover_c3 = '#FDF4CA';\r\nexport const semantic_alert_background_c2 = '#FEFAE4';\r\nexport const semantic_alert_bg_light_c1 = '#FFFCF2';\r\n\r\nexport const bookitColors = {\r\n  base: {\r\n    black: base_black_c11,\r\n    white: base_white_c0,\r\n  },\r\n  grayscale: {\r\n    blackRegular: grayscale_black_regular_c10,\r\n    blackComponents: grayscale_black_components_c9,\r\n    graySubtitles: grayscale_gray_subtitles_c8,\r\n    grayComponents: grayscale_gray_components_c7,\r\n    grayComponentsLight: grayscale_gray_components_light_c6,\r\n    grayBorders: grayscale_gray_borders_c5,\r\n    graySelection: grayscale_gray_selection_c4,\r\n    graybgComponents: grayscale_gray_bg_components_c3,\r\n    grayBackground: grayscale_gray_background_c2,\r\n    grayBackgroundLight: grayscale_gray_bg_light_c1,\r\n  },\r\n  overlays: {\r\n    overlayBlack: overlay_opacity_black,\r\n    overlayWhite: overlay_opacity_white,\r\n  },\r\n  primary: {\r\n    dark: primary_dark_text_c10,\r\n    hover: primary_hover_c9,\r\n    regular: primary_regular_c8,\r\n    components: primary_components_c7,\r\n    componentsLight: primary_components_light_c6,\r\n    borders: primary_borders_c5,\r\n    disabled: primary_disabled_c4,\r\n    bgHover: primary_bg_hover_c3,\r\n    background: primary_background_c2,\r\n    bgLight: primary_bg_light_c1,\r\n  },\r\n  secondary: {\r\n    violet: {\r\n      dark: secondary_violet_dark_text_c10,\r\n      hover: secondary_violet_hover_c9,\r\n      regular: secondary_violet_regular_c8,\r\n      components: secondary_violet_components_c7,\r\n      componentsLight: secondary_violet_components_light_c6,\r\n      borders: secondary_violet_borders_c5,\r\n      disabled: secondary_violet_disabled_c4,\r\n      bgHover: secondary_violet_bg_hover_c3,\r\n      background: secondary_violet_background_c2,\r\n      bgLight: secondary_violet_bg_light_c1,\r\n    },\r\n  },\r\n  danger: {\r\n    dark: semantic_danger_dark_text_c10,\r\n    hover: semantic_danger_hover_c9,\r\n    regular: semantic_danger_regular_c8,\r\n    components: semantic_danger_components_c7,\r\n    componentsLight: semantic_danger_components_light_c6,\r\n    borders: semantic_danger_borders_c5,\r\n    disabled: semantic_danger_disabled_c4,\r\n    bgHover: semantic_danger_bg_hover_c3,\r\n    background: semantic_danger_background_c2,\r\n    bgLight: semantic_danger_bg_light_c1,\r\n  },\r\n  success: {\r\n    dark: semantic_success_dark_text_c10,\r\n    hover: semantic_success_hover_c9,\r\n    regular: semantic_success_regular_c8,\r\n    components: semantic_success_components_c7,\r\n    componentsLight: semantic_success_components_light_c6,\r\n    borders: semantic_success_borders_c5,\r\n    disabled: semantic_success_disabled_c4,\r\n    bgHover: semantic_success_bg_hover_c3,\r\n    background: semantic_success_background_c2,\r\n    bgLight: semantic_success_bg_light_c1,\r\n  },\r\n  warning: {\r\n    dark: semantic_alert_dark_text_c10,\r\n    hover: semantic_alert_hover_c9,\r\n    regular: semantic_alert_regular_c8,\r\n    components: semantic_alert_components_c7,\r\n    componentsLight: semantic_alert_components_light_c6,\r\n    borders: semantic_alert_borders_c5,\r\n    disabled: semantic_alert_disabled_c4,\r\n    bgHover: semantic_alert_bg_hover_c3,\r\n    background: semantic_alert_background_c2,\r\n    bgLight: semantic_alert_bg_light_c1,\r\n  },\r\n};\r\nexport interface ColorsMeta {\r\n  Name: string;\r\n  SemanticMeta: ColorSemanticMeta[];\r\n}\r\nexport interface ColorSemanticMeta {\r\n  Name: string;\r\n  Title: string;\r\n  Colors: ColorDescriptionMeta[];\r\n}\r\nexport interface ColorDescriptionMeta {\r\n  color: string;\r\n  colorName: string;\r\n  colorCode: string;\r\n  colorVariable: string;\r\n}\r\nexport const baseColorMeta: ColorSemanticMeta = {\r\n  Name: 'Base',\r\n  Title:\r\n    'Black Palette for titles, copyrighting and components. Brand black color',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.base.black,\r\n      colorName: 'Black',\r\n      colorCode: 'c11',\r\n      colorVariable: 'base_black_c11',\r\n    },\r\n    {\r\n      color: bookitColors.base.white,\r\n      colorName: 'White',\r\n      colorCode: 'c0',\r\n      colorVariable: 'base_white_c0',\r\n    },\r\n  ],\r\n};\r\nexport const overlaysColorMeta: ColorSemanticMeta = {\r\n  Name: 'Overlays',\r\n  Title:\r\n    'Black and white overlays for popups, popovers and transparent elements',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.overlays.overlayBlack,\r\n      colorName: 'Black Popup Overlay',\r\n      colorCode: 'opacity-black',\r\n      colorVariable: 'overlay_opacity_black',\r\n    },\r\n    {\r\n      color: bookitColors.overlays.overlayWhite,\r\n      colorName: 'White Popup Overlay',\r\n      colorCode: 'opacity-white',\r\n      colorVariable: 'overlay_opacity_white',\r\n    },\r\n  ],\r\n};\r\nexport const grayscaleColorMeta: ColorSemanticMeta = {\r\n  Name: 'Grayscale',\r\n  Title:\r\n    'Black Palette for titles, copyrighting and components. Brand black color',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.grayscale.blackRegular,\r\n      colorName: 'Regular',\r\n      colorCode: 'c10',\r\n      colorVariable: 'grayscale_black_regular_c10',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.blackComponents,\r\n      colorName: 'Black Components',\r\n      colorCode: 'c9',\r\n      colorVariable: 'grayscale_black_components_c9',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.graySubtitles,\r\n      colorName: 'Gray Subtitles',\r\n      colorCode: 'c8',\r\n      colorVariable: 'grayscale_gray_subtitles_c8',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.grayComponents,\r\n      colorName: 'Gray Components',\r\n      colorCode: 'c7',\r\n      colorVariable: 'grayscale_gray_components_c7',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.grayComponentsLight,\r\n      colorName: 'Gray Components Light',\r\n      colorCode: 'c6',\r\n      colorVariable: 'grayscale_gray_components_light_c6',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.grayBorders,\r\n      colorName: 'Gray Borders',\r\n      colorCode: 'c5',\r\n      colorVariable: 'grayscale_gray_borders_c5',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.graySelection,\r\n      colorName: 'Gray Selection',\r\n      colorCode: 'c4',\r\n      colorVariable: 'grayscale_gray_selection_c4',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.graybgComponents,\r\n      colorName: 'Gray Bg Components',\r\n      colorCode: 'c3',\r\n      colorVariable: 'grayscale_gray_bg_components_c3',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.grayBackground,\r\n      colorName: 'Gray Background',\r\n      colorCode: 'c2',\r\n      colorVariable: 'grayscale_gray_background_c2',\r\n    },\r\n    {\r\n      color: bookitColors.grayscale.grayBackgroundLight,\r\n      colorName: 'Gray Background Light',\r\n      colorCode: 'c1',\r\n      colorVariable: 'grayscale_gray_bg_light_c1',\r\n    },\r\n  ],\r\n};\r\nexport const primaryColorMeta: ColorSemanticMeta = {\r\n  Name: 'Primary',\r\n  Title: 'Primary brand blue color',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.primary.dark,\r\n      colorName: 'Dark Text',\r\n      colorCode: 'c10',\r\n      colorVariable: 'primary_dark_text_c10',\r\n    },\r\n    {\r\n      color: bookitColors.primary.hover,\r\n      colorName: 'Hover',\r\n      colorCode: 'c9',\r\n      colorVariable: 'primary_hover_c9',\r\n    },\r\n    {\r\n      color: bookitColors.primary.regular,\r\n      colorName: 'Regular',\r\n      colorCode: 'c8',\r\n      colorVariable: 'primary_regular_c8',\r\n    },\r\n    {\r\n      color: bookitColors.primary.components,\r\n      colorName: 'Components',\r\n      colorCode: 'c7',\r\n      colorVariable: 'primary_components_c7',\r\n    },\r\n    {\r\n      color: bookitColors.primary.componentsLight,\r\n      colorName: 'Components Light',\r\n      colorCode: 'c6',\r\n      colorVariable: 'primary_components_light_c6',\r\n    },\r\n    {\r\n      color: bookitColors.primary.borders,\r\n      colorName: 'Borders',\r\n      colorCode: 'c5',\r\n      colorVariable: 'primary_borders_c5',\r\n    },\r\n    {\r\n      color: bookitColors.primary.disabled,\r\n      colorName: 'Disabled',\r\n      colorCode: 'c4',\r\n      colorVariable: 'primary_disabled_c4',\r\n    },\r\n    {\r\n      color: bookitColors.primary.bgHover,\r\n      colorName: 'Background Hover',\r\n      colorCode: 'c3',\r\n      colorVariable: 'primary_bg_hover_c3',\r\n    },\r\n    {\r\n      color: bookitColors.primary.background,\r\n      colorName: 'Background',\r\n      colorCode: 'c2',\r\n      colorVariable: 'primary_background_c2',\r\n    },\r\n    {\r\n      color: bookitColors.primary.bgLight,\r\n      colorName: 'Background Light',\r\n      colorCode: 'c1',\r\n      colorVariable: 'primary_bg_light_c1',\r\n    },\r\n  ],\r\n};\r\nexport const successColorMeta: ColorSemanticMeta = {\r\n  Name: 'Success',\r\n  Title: 'Main confirmation messages',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.success.dark,\r\n      colorName: 'Dark Text',\r\n      colorCode: 'c10',\r\n      colorVariable: 'success_dark_text_c10',\r\n    },\r\n    {\r\n      color: bookitColors.success.hover,\r\n      colorName: 'Hover',\r\n      colorCode: 'c9',\r\n      colorVariable: 'success_hover_c9',\r\n    },\r\n    {\r\n      color: bookitColors.success.regular,\r\n      colorName: 'Regular',\r\n      colorCode: 'c8',\r\n      colorVariable: 'success_regular_c8',\r\n    },\r\n    {\r\n      color: bookitColors.success.components,\r\n      colorName: 'Components',\r\n      colorCode: 'c7',\r\n      colorVariable: 'success_components_c7',\r\n    },\r\n    {\r\n      color: bookitColors.success.componentsLight,\r\n      colorName: 'Components Light',\r\n      colorCode: 'c6',\r\n      colorVariable: 'success_components_light_c6',\r\n    },\r\n    {\r\n      color: bookitColors.success.borders,\r\n      colorName: 'Borders',\r\n      colorCode: 'c5',\r\n      colorVariable: 'success_borders_c5',\r\n    },\r\n    {\r\n      color: bookitColors.success.disabled,\r\n      colorName: 'Disabled',\r\n      colorCode: 'c4',\r\n      colorVariable: 'success_disabled_c4',\r\n    },\r\n    {\r\n      color: bookitColors.success.bgHover,\r\n      colorName: 'Background Hover',\r\n      colorCode: 'c3',\r\n      colorVariable: 'success_bg_hover_c3',\r\n    },\r\n    {\r\n      color: bookitColors.success.background,\r\n      colorName: 'Background',\r\n      colorCode: 'c2',\r\n      colorVariable: 'success_background_c2',\r\n    },\r\n    {\r\n      color: bookitColors.success.bgLight,\r\n      colorName: 'Background Light',\r\n      colorCode: 'c1',\r\n      colorVariable: 'success_bg_light_c1',\r\n    },\r\n  ],\r\n};\r\nexport const dangerColorMeta: ColorSemanticMeta = {\r\n  Name: 'Danger',\r\n  Title: 'For main danger buttons and indication',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.danger.dark,\r\n      colorName: 'Dark Text',\r\n      colorCode: 'c10',\r\n      colorVariable: 'danger_dark_text_c10',\r\n    },\r\n    {\r\n      color: bookitColors.danger.hover,\r\n      colorName: 'Hover',\r\n      colorCode: 'c9',\r\n      colorVariable: 'danger_hover_c9',\r\n    },\r\n    {\r\n      color: bookitColors.danger.regular,\r\n      colorName: 'Regular',\r\n      colorCode: 'c8',\r\n      colorVariable: 'danger_regular_c8',\r\n    },\r\n    {\r\n      color: bookitColors.danger.components,\r\n      colorName: 'Components',\r\n      colorCode: 'c7',\r\n      colorVariable: 'danger_components_c7',\r\n    },\r\n    {\r\n      color: bookitColors.danger.componentsLight,\r\n      colorName: 'Components Light',\r\n      colorCode: 'c6',\r\n      colorVariable: 'danger_components_light_c6',\r\n    },\r\n    {\r\n      color: bookitColors.danger.borders,\r\n      colorName: 'Borders',\r\n      colorCode: 'c5',\r\n      colorVariable: 'danger_borders_c5',\r\n    },\r\n    {\r\n      color: bookitColors.danger.disabled,\r\n      colorName: 'Disabled',\r\n      colorCode: 'c4',\r\n      colorVariable: 'danger_disabled_c4',\r\n    },\r\n    {\r\n      color: bookitColors.danger.bgHover,\r\n      colorName: 'Background Hover',\r\n      colorCode: 'c3',\r\n      colorVariable: 'danger_bg_hover_c3',\r\n    },\r\n    {\r\n      color: bookitColors.danger.background,\r\n      colorName: 'Background',\r\n      colorCode: 'c2',\r\n      colorVariable: 'danger_background_c2',\r\n    },\r\n    {\r\n      color: bookitColors.danger.bgLight,\r\n      colorName: 'Background Light',\r\n      colorCode: 'c1',\r\n      colorVariable: 'danger_bg_light_c1',\r\n    },\r\n  ],\r\n};\r\nexport const alertColorMeta: ColorSemanticMeta = {\r\n  Name: 'alert',\r\n  Title: 'For main alert buttons and indication',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.warning.dark,\r\n      colorName: 'Dark Text',\r\n      colorCode: 'c10',\r\n      colorVariable: 'alert_dark_text_c10',\r\n    },\r\n    {\r\n      color: bookitColors.warning.hover,\r\n      colorName: 'Hover',\r\n      colorCode: 'c9',\r\n      colorVariable: 'alert_hover_c9',\r\n    },\r\n    {\r\n      color: bookitColors.warning.regular,\r\n      colorName: 'Regular',\r\n      colorCode: 'c8',\r\n      colorVariable: 'alert_regular_c8',\r\n    },\r\n    {\r\n      color: bookitColors.warning.components,\r\n      colorName: 'Components',\r\n      colorCode: 'c7',\r\n      colorVariable: 'alert_components_c7',\r\n    },\r\n    {\r\n      color: bookitColors.warning.componentsLight,\r\n      colorName: 'Components Light',\r\n      colorCode: 'c6',\r\n      colorVariable: 'alert_components_light_c6',\r\n    },\r\n    {\r\n      color: bookitColors.warning.borders,\r\n      colorName: 'Borders',\r\n      colorCode: 'c5',\r\n      colorVariable: 'alert_borders_c5',\r\n    },\r\n    {\r\n      color: bookitColors.warning.disabled,\r\n      colorName: 'Disabled',\r\n      colorCode: 'c4',\r\n      colorVariable: 'alert_disabled_c4',\r\n    },\r\n    {\r\n      color: bookitColors.warning.bgHover,\r\n      colorName: 'Background Hover',\r\n      colorCode: 'c3',\r\n      colorVariable: 'alert_bg_hover_c3',\r\n    },\r\n    {\r\n      color: bookitColors.warning.background,\r\n      colorName: 'Background',\r\n      colorCode: 'c2',\r\n      colorVariable: 'alert_background_c2',\r\n    },\r\n    {\r\n      color: bookitColors.warning.bgLight,\r\n      colorName: 'Background Light',\r\n      colorCode: 'c1',\r\n      colorVariable: 'alert_bg_light_c1',\r\n    },\r\n  ],\r\n};\r\nexport const violetColorMeta: ColorSemanticMeta = {\r\n  Name: 'Violet',\r\n  Title: 'Secondary',\r\n  Colors: [\r\n    {\r\n      color: bookitColors.secondary.violet.dark,\r\n      colorName: 'Dark Text',\r\n      colorCode: 'c10',\r\n      colorVariable: 'secondary_violet_dark_text_c10',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.hover,\r\n      colorName: 'Hover',\r\n      colorCode: 'c9',\r\n      colorVariable: 'secondary_violet_hover_c9',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.regular,\r\n      colorName: 'Regular',\r\n      colorCode: 'c8',\r\n      colorVariable: 'secondary_violet_regular_c8',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.components,\r\n      colorName: 'Components',\r\n      colorCode: 'c7',\r\n      colorVariable: 'secondary_violet_components_c7',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.componentsLight,\r\n      colorName: 'Components Light',\r\n      colorCode: 'c6',\r\n      colorVariable: 'secondary_violet_components_light_c6',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.borders,\r\n      colorName: 'Borders',\r\n      colorCode: 'c5',\r\n      colorVariable: 'secondary_violet_borders_c5',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.disabled,\r\n      colorName: 'Disabled',\r\n      colorCode: 'c4',\r\n      colorVariable: 'secondary_violet_disabled_c4',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.bgHover,\r\n      colorName: 'Background Hover',\r\n      colorCode: 'c3',\r\n      colorVariable: 'secondary_violet_bg_hover_c3',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.background,\r\n      colorName: 'Background',\r\n      colorCode: 'c2',\r\n      colorVariable: 'secondary_violet_background_c2',\r\n    },\r\n    {\r\n      color: bookitColors.secondary.violet.bgLight,\r\n      colorName: 'Background Light',\r\n      colorCode: 'c1',\r\n      colorVariable: 'secondary_violet_bg_light_c1',\r\n    },\r\n  ],\r\n};\r\n","/**\r\n * UserProfileSettings\r\n */\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nexport const USER_PROFILE_KEYS = ['SideBarExpanded'] as const;\r\nexport class UserProfile {\r\n  savedSettings: UserProfileSettings[];\r\n  constructor(settings: UserProfileSettings[]) {\r\n    this.savedSettings = settings;\r\n  }\r\n  public GetSettingByKey(key: string): UserProfileSettings | null {\r\n    if (this.savedSettings.length > 0) {\r\n      let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n      return sett === undefined ? null : sett;\r\n    } else {\r\n      return null;\r\n    }\r\n  }\r\n  public GetSettingByKeyOrDefault(key: string): UserProfileSettings {\r\n    let defaultSetting = {\r\n      Key: key,\r\n      Value: '',\r\n      Enabled: false,\r\n      Selected: false,\r\n      UserName: '',\r\n      Id: 0,\r\n      Name: '',\r\n      AdGroup: '',\r\n      DefaultGroups: '',\r\n      IsMultiple: null,\r\n      StaffEnabled: false,\r\n    } as UserProfileSettings;\r\n    if (this.savedSettings.length > 0) {\r\n      let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n      return sett === undefined ? defaultSetting : sett;\r\n    } else {\r\n      return defaultSetting;\r\n    }\r\n  }\r\n  public UpdateSettingByKey(key: string): UserProfileSettings {\r\n    let defaultSetting = {\r\n      Key: key,\r\n      Value: '',\r\n      Enabled: false,\r\n      Selected: false,\r\n      UserName: '',\r\n      Id: 0,\r\n      Name: '',\r\n      AdGroup: '',\r\n      DefaultGroups: '',\r\n      IsMultiple: null,\r\n      StaffEnabled: false,\r\n    } as UserProfileSettings;\r\n    if (this.savedSettings.length > 0) {\r\n      let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n      return sett === undefined ? defaultSetting : sett;\r\n    } else {\r\n      return defaultSetting;\r\n    }\r\n  }\r\n  public GetSettingValueBy(\r\n    comparator: (item: UserProfileSettings) => boolean,\r\n  ): UserProfileSettings | undefined {\r\n    return this.savedSettings.find(comparator);\r\n  }\r\n\r\n  public GetSettingValueByKey(key: string): any | null {\r\n    if (this.savedSettings.length > 0) {\r\n      let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n      switch (key) {\r\n        case 'SideBarExpanded': {\r\n          return sett === undefined ? true : sett.Enabled;\r\n        }\r\n      }\r\n    }\r\n    return null;\r\n  }\r\n\r\n  public GetSideBarExpanded(key: string): any | null {\r\n    if (this.savedSettings.length > 0) {\r\n      let sett = this.savedSettings.find((value, index) => value.Key === key);\r\n      switch (key) {\r\n        case 'SideBarExpanded': {\r\n          return sett === undefined ? true : sett.Enabled;\r\n        }\r\n      }\r\n    }\r\n    return null;\r\n  }\r\n}\r\n","import { RootState } from 'types';\r\nimport { createSelector } from '@reduxjs/toolkit';\r\nimport { AuthenticatedUser, IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { SiteMapProvider } from 'types/SiteMapSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { initialState } from '.';\r\nimport { UserRegistersToSpecificCoresType } from 'enums/enums';\r\nimport { appendTrailingSlash } from 'utils/url-utils';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { Entity } from 'types/common';\r\nimport { pickBy } from 'lodash';\r\n\r\nconst selectSlice = (state: RootState) => {\r\n  return state.appSettings || initialState;\r\n};\r\nexport const selectAppSettings = createSelector(\r\n  [selectSlice],\r\n  state => state.appSettings,\r\n);\r\n\r\nexport const selectKnownModules = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.Modules,\r\n);\r\nexport const selectKnownModule = createSelector(\r\n  [selectKnownModules, (state, knownModules: KnownModules) => knownModules],\r\n  (state, knownModules: KnownModules) => state?.includes(knownModules) ?? false,\r\n);\r\nexport const selectSystemLocale = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.Globalization.Locale,\r\n);\r\nexport const selectDateFnsLocale = createSelector(\r\n  [selectAppSettings],\r\n  state => {\r\n    const locale = state?.Globalization?.Locale;\r\n    return locale === undefined\r\n      ? undefined\r\n      : dateUtils.dateFnsCultureName(locale);\r\n  },\r\n);\r\nexport const selectUseAmPm = createSelector([selectAppSettings], state => {\r\n  return state?.Globalization?.UseAmPm;\r\n});\r\nexport const selectSystemFirstDayOfWeek = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.Globalization.FirstDayOfWeek ?? 1,\r\n);\r\nexport const selectWebVersion = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.WebVersion,\r\n);\r\nconst DefaultUploadFileSizeLimit = 500000;\r\nexport const selectUploadFileSizeLimit = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.UploadFileSizeLimit || DefaultUploadFileSizeLimit,\r\n);\r\nexport const selectMinimizedBookitlabLogo = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.MinimizedBookitlabLogo || false,\r\n);\r\nconst defaultForbiddenFileExtensions = [\r\n  '.dll',\r\n  '.exe',\r\n  '.vbs',\r\n  '.js',\r\n  '.ts',\r\n  '.tsx',\r\n  '.msi',\r\n  '.com',\r\n  '.bat',\r\n];\r\nexport const selectForbiddenFileExtensions = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.ForbiddenFileExtensions ?? defaultForbiddenFileExtensions,\r\n);\r\nexport const selectLastCodeUpdate = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.LastCodeUpdate,\r\n);\r\nexport const selectAppTimeZone = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.TimeZone,\r\n);\r\nexport const selectPublicUrl = createSelector([selectAppSettings], state =>\r\n  state?.PublicBaseUrl === undefined\r\n    ? undefined\r\n    : appendTrailingSlash(state.PublicBaseUrl),\r\n);\r\nexport const selectRegisterUserGroup = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.DefaultRegistrationGroup,\r\n);\r\nexport const selectOffsetDate = createSelector(\r\n  [selectAppTimeZone, (state, date: Date | string | undefined | null) => date],\r\n  (timeZone, date) => {\r\n    const systemOffset = timeZone?.TimezoneOffsetMinutes ?? 0;\r\n    let correctDate =\r\n      date === null || date === undefined\r\n        ? dateUtils.dateOrStringToDate(new Date())\r\n        : dateUtils.dateOrStringToDate(date);\r\n    const currentDateOffset = correctDate.getTimezoneOffset();\r\n    const dateOrNow = dateUtils.addMinutes(\r\n      correctDate,\r\n      systemOffset + currentDateOffset,\r\n    );\r\n    return dateOrNow;\r\n  },\r\n);\r\nexport const selectUserRegistersToSpecificCores = createSelector(\r\n  [selectAppSettings],\r\n  state =>\r\n    (state?.UserRegistersToSpecificCores as UserRegistersToSpecificCoresType) ||\r\n    UserRegistersToSpecificCoresType.UserRegistersToSpecificCores_NA,\r\n);\r\nexport const selectEmailFromAddress = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.EmailFromAddress,\r\n);\r\nexport const selectExistingImages = createSelector(\r\n  [selectAppSettings],\r\n  state => state?.ExistingImages,\r\n);\r\nconst constructAuthenticatedUser = (a?: IAuthenticatedUser) => {\r\n  return a === undefined ? undefined : new AuthenticatedUser(a);\r\n};\r\nconst selectAuthenticatedUserObject = createSelector(\r\n  [selectSlice],\r\n  state => state.authenticatedUser,\r\n);\r\nexport const selectAuthenticatedUser = createSelector(\r\n  [selectAuthenticatedUserObject],\r\n  state => {\r\n    const a = state;\r\n    const b = constructAuthenticatedUser(a);\r\n    return b;\r\n  },\r\n);\r\n/**\r\n * Returns enabled asset attributes for current session (public/private)\r\n *  */\r\nexport const selectAssetFieldSettings = createSelector(\r\n  [selectAppSettings, selectAuthenticatedUser],\r\n  (appSettings, authenticatedUser) =>\r\n    pickBy(\r\n      appSettings?.AssetFieldSettings,\r\n      (value, key) => value.IsPublic || authenticatedUser !== undefined,\r\n    ),\r\n);\r\nexport const selectAssetPopupSettings = createSelector(\r\n  [selectAppSettings, selectAssetFieldSettings, selectAuthenticatedUser],\r\n  (appSettings, assetFieldSettings, authenticatedUser) => {\r\n    return Object.entries(assetFieldSettings).map(([key, value]) => ({\r\n      Id: key,\r\n      Visible: true,\r\n      DisplayName: value.DisplayName,\r\n    }));\r\n  },\r\n);\r\nexport const selectIsFullScreen = createSelector(\r\n  [selectSlice],\r\n  state => state.isFullScreen,\r\n);\r\nexport const selectCurrentLanguage = createSelector(\r\n  [selectSlice],\r\n  state => state.currentLanguage,\r\n);\r\n\r\nexport const selectLoading = createSelector([selectSlice], state => {\r\n  let loading =\r\n    state.isAuthenticated === true\r\n      ? state.loadingAppSettings ||\r\n        state.loadingSiteMapSettings ||\r\n        state.loadingUserProfileSettings ||\r\n        state.loadingSystemSettings\r\n      : state.isAuthenticated === false\r\n      ? state.loadingAppSettings || state.loadingSystemSettings\r\n      : state.loadingAuthenticatedUser || state.loadingSystemSettings;\r\n  return loading;\r\n});\r\nexport const selectError = createSelector([selectSlice], state => state.error);\r\nexport const selectLoadingUser = createSelector(\r\n  [selectSlice],\r\n  state => state.loadingAuthenticatedUser,\r\n);\r\nexport const selectNotifications = createSelector(\r\n  [selectSlice],\r\n  state => state.notifications,\r\n);\r\nconst selectGlobalSettingsObj = createSelector(\r\n  [selectSlice],\r\n  state => state.systemSettings,\r\n);\r\nexport const selectglobalSettings = createSelector(\r\n  [selectGlobalSettingsObj],\r\n  state => new GlobalSettings(state || ([] as SettingModel[])),\r\n);\r\nexport const selectGlobalSetting = createSelector(\r\n  [selectGlobalSettingsObj, (state, name: AllowedSettings) => name],\r\n  (globalSettingsObj, name) => {\r\n    const x = globalSettingsObj.find(\r\n      f =>\r\n        f.Name.trim().toLowerCase() ===\r\n        AllowedSettings[name].trim().toLowerCase(),\r\n    );\r\n    return x?.Value ?? undefined;\r\n  },\r\n);\r\nexport const selectImageExist = createSelector(\r\n  [selectExistingImages, (state, image: string | null) => image],\r\n  (existingImages, image) => {\r\n    let result = false;\r\n    if (image === null) {\r\n      return false;\r\n    }\r\n    if (!!existingImages && existingImages.length > 0) {\r\n      result = existingImages.some(f => f === image);\r\n    }\r\n    return result;\r\n  },\r\n);\r\nexport const selectGlobalSettingBool = createSelector(\r\n  [selectGlobalSettingsObj, (state, name: AllowedSettings) => name],\r\n  (globalSettingsObj, name) => {\r\n    const x = globalSettingsObj.find(\r\n      f =>\r\n        f.Name.trim().toLowerCase() ===\r\n        AllowedSettings[name].trim().toLowerCase(),\r\n    );\r\n    return x?.Value === null ||\r\n      x?.Value === undefined ||\r\n      x.Value === '' ||\r\n      x.Value.toLowerCase() === 'false'\r\n      ? false\r\n      : x.Value.toLowerCase() === 'true';\r\n  },\r\n);\r\nexport const selectSiteMapSettings = createSelector(\r\n  [selectSlice],\r\n  state => state.siteMapSettings,\r\n);\r\nexport const selectSiteMapProvider = createSelector(\r\n  [selectSlice],\r\n  state => state.siteMapProvider ?? new SiteMapProvider(state.siteMapSettings),\r\n);\r\nexport const selectEventsCount = createSelector(\r\n  [selectSlice],\r\n  state => state.eventsCount,\r\n);\r\nexport const selectEventsCountLoading = createSelector(\r\n  [selectSlice],\r\n  state => state.loadingEventsCount,\r\n);\r\nexport const selectUserProfileSettings = createSelector(\r\n  [selectSlice],\r\n  state => new UserProfile(state.userProfileSettings),\r\n);\r\n/**\r\n * Selects specific user profile setting value provided by the key\r\n * usage example:\r\n * const userProfileValue = useSelector(state => selectUserProfileSetting(state, \"userProfileKey\"))\r\n */\r\nexport const selectUserProfileSetting = createSelector(\r\n  [selectUserProfileSettings, (state, key) => key],\r\n  (state, key) => state.GetSettingByKey(key)?.Value,\r\n);\r\nexport const selectIsExpanded = createSelector(\r\n  [selectSlice],\r\n  state => state.isExpanded,\r\n);\r\nexport const selectIsSubBarCollapsed = createSelector(\r\n  [selectSlice],\r\n  state => state.subBarCollapsed,\r\n);\r\n\r\nexport const selectUpdatedUserProfileSettings = createSelector(\r\n  [selectSlice],\r\n  state => state.updatedUserProfileSettings,\r\n);\r\nexport const selectIsAuthenticated = createSelector(\r\n  [selectSlice],\r\n  state => state.isAuthenticated,\r\n);\r\nexport const selectUpdatedExpandState = createSelector(\r\n  [selectSlice],\r\n  state => state.updatedExpandState,\r\n);\r\nexport const selectIsExpandedSideBar = createSelector(\r\n  [selectSlice, (state, isMobile) => isMobile],\r\n  (state, isMobile) => {\r\n    let result: boolean = false;\r\n    if (isMobile) {\r\n      result = state.isExpanded;\r\n    } else {\r\n      if (state.updatedExpandState) {\r\n        result = state.isExpanded;\r\n      } else {\r\n        let sett = new UserProfile(state.userProfileSettings);\r\n        let expanded = sett.GetSideBarExpanded('SideBarExpanded');\r\n        result = expanded !== null ? expanded : true;\r\n      }\r\n    }\r\n    return result;\r\n  },\r\n);\r\nexport const selectGlobalServiceGroupFilter = createSelector(\r\n  [selectSlice],\r\n  state => {\r\n    let topServiceGroupsIsHidden = state.systemSettings.find(\r\n      f => f.Id === 'HideTopServiceGroupFilter',\r\n    );\r\n    if (\r\n      topServiceGroupsIsHidden !== null &&\r\n      topServiceGroupsIsHidden !== undefined\r\n    ) {\r\n      if (topServiceGroupsIsHidden.Value === 'True') {\r\n        return [];\r\n      } else {\r\n        return state.globalServiceGroupFilter;\r\n      }\r\n    } else {\r\n      return state.globalServiceGroupFilter;\r\n    }\r\n  },\r\n);\r\nexport const selectShowGlobalServiceGroupFilter = createSelector(\r\n  [selectSlice],\r\n  state => state.showGlobalServiceGroupFilter,\r\n);\r\nexport const selectShowGlobalServiceGroupsAsList = createSelector(\r\n  [selectSlice],\r\n  state => state.showGlobalServiceGroupsAsList,\r\n);\r\nexport const selectBarcodeScanTarget = createSelector(\r\n  [selectSlice],\r\n  state => state.barcodeScanTarget,\r\n);\r\nexport const selectShowAllCores = createSelector(\r\n  [selectSlice],\r\n  state => state.showAllCores,\r\n);\r\n\r\n/**\r\n * Selects reservation statuses enabled on the system level\r\n * ```\r\n * const statuses = useSelector(state => selectReservationStatuses(state, t));\r\n * ```\r\n */\r\nexport const selectReservationStatuses = createSelector(\r\n  [\r\n    selectSlice,\r\n    state => selectKnownModule(state, KnownModules.UserGroupCoordRole),\r\n    state =>\r\n      selectGlobalSettingBool(state, AllowedSettings.AllowWorkflowBooking) &&\r\n      selectGlobalSettingBool(\r\n        state,\r\n        AllowedSettings.MultipleTentativeReservationsUnderWorkflowBooking,\r\n      ),\r\n    state =>\r\n      selectGlobalSettingBool(state, AllowedSettings.DraftReservationsEnabled),\r\n    (state, t: TFunction) => t,\r\n  ],\r\n  (\r\n    state,\r\n    UserGroupCoordRole,\r\n    AllowWorkflowBooking,\r\n    DraftReservationsEnabled,\r\n    t,\r\n  ) => {\r\n    const GetListItem = (s: ReservationStatus) => ({\r\n      Id: s,\r\n      Name: t(ReservationStatus[s]),\r\n    });\r\n    const list: Array<Entity<number>> = [];\r\n\r\n    list.push(GetListItem(ReservationStatus.Approved));\r\n    list.push(GetListItem(ReservationStatus.Pending));\r\n    if (UserGroupCoordRole) {\r\n      list.push(GetListItem(ReservationStatus.PendingCoord));\r\n    }\r\n    list.push(GetListItem(ReservationStatus.Cancelled));\r\n    list.push(GetListItem(ReservationStatus.CancelledByAdmin));\r\n    if (AllowWorkflowBooking) {\r\n      list.push(GetListItem(ReservationStatus.Tentative));\r\n    }\r\n    if (DraftReservationsEnabled) {\r\n      list.push(GetListItem(ReservationStatus.Draft));\r\n    }\r\n    return list;\r\n  },\r\n);\r\n","import { GetBooleanFilterOptions } from 'app/components/BooleanPicker';\r\nimport { ALL_PERIOD_TYPES, PeriodTypes } from 'app/components/DatePeriods';\r\nimport startOfDay from 'date-fns/startOfDay';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { CustomDate, DateType } from 'types/CustomDate';\r\nimport { INumbersRange } from 'types/INumbersRange';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { isNullOrUndefined, valOrNull } from 'utils/typeUtils';\r\nimport { FilterValueType } from '../BasicFilter/FilterValueType';\r\nimport {\r\n  FilterIntializer,\r\n  FilterSerializer,\r\n} from '../BasicFilter/IFilterSettings';\r\nimport { AssetRangeType, isAssetRangeType } from '../Filters/AssetRangeFilter';\r\n\r\nexport interface FilterParam {\r\n  Name: string;\r\n  Value?: FilterValueType;\r\n}\r\n\r\n/**\r\n * Case Insensitive URLSearchParams\r\n */\r\nexport class URLSearchParamsCI extends URLSearchParams {\r\n  constructor(value?: string | URLSearchParams) {\r\n    super();\r\n\r\n    const params = new URLSearchParams(value);\r\n    for (const [name, value] of params) {\r\n      this.append(name.toLowerCase(), value);\r\n    }\r\n  }\r\n  public get(name: string): string | null {\r\n    return super.get(name.toLowerCase());\r\n  }\r\n  public set(name: string, value: string | undefined) {\r\n    this.delete(name.toLowerCase());\r\n    if (value !== undefined) {\r\n      super.set(name, value);\r\n    }\r\n  }\r\n\r\n  public toObject() {\r\n    const result = {};\r\n    for (const key of this.keys()) {\r\n      result[key] = this.get(key);\r\n    }\r\n    return result;\r\n  }\r\n\r\n  public equals(other: URLSearchParams): boolean {\r\n    const b = new URLSearchParamsCI(other);\r\n    return this.toString() === b.toString();\r\n  }\r\n}\r\n\r\nexport function GetRawValue(params: URLSearchParams, fieldName: string) {\r\n  var value = params.get(fieldName);\r\n  if (value === null) {\r\n    return undefined;\r\n  }\r\n  if (value === '') {\r\n    return null;\r\n  }\r\n  return setisInversedForUrl(value, false);\r\n}\r\n\r\nexport const isInversedPrefix = 'not;';\r\n\r\nexport function isFilterInversed(val: string | null | undefined) {\r\n  if ((val ?? '') === '') {\r\n    return false;\r\n  }\r\n  return val!.startsWith(isInversedPrefix);\r\n}\r\n\r\nexport function findIsfilterInversed(search: string, key: string | undefined) {\r\n  if (key === undefined) return undefined;\r\n  const params = new URLSearchParams(search);\r\n  const val = params.get(key);\r\n  return isFilterInversed(val);\r\n}\r\n\r\nexport function setisInversedForUrl<\r\n  T extends string | null | undefined = string | null | undefined\r\n>(val: T, isInversed: boolean) {\r\n  if ((val ?? '') === '') return val;\r\n  const definedVal = val!;\r\n  const hasprefix = definedVal.startsWith(isInversedPrefix);\r\n  if (isInversed && !hasprefix) {\r\n    return isInversedPrefix + definedVal;\r\n  }\r\n  if (!isInversed && hasprefix) {\r\n    return definedVal.substring(isInversedPrefix.length);\r\n  }\r\n  return definedVal;\r\n}\r\n\r\n/**\r\n *\r\n * @param rawValue\r\n * @returns\r\n */\r\nexport function GetNumberOrUndefined(rawValue: string | undefined | null) {\r\n  if (rawValue === undefined) {\r\n    return undefined;\r\n  }\r\n  if (rawValue === null) {\r\n    return null;\r\n  }\r\n  var number = parseInt(rawValue);\r\n  if (isNaN(number)) {\r\n    return undefined;\r\n  }\r\n  return number;\r\n}\r\nexport function GetStringOrUndefined(rawValue: string | undefined | null) {\r\n  if (rawValue === undefined) {\r\n    return undefined;\r\n  }\r\n  if (rawValue === null) {\r\n    return null;\r\n  }\r\n  if (rawValue === '') {\r\n    return null;\r\n  }\r\n  return rawValue;\r\n}\r\nexport function getStringUnionOrUndefined<TUnion extends string>(\r\n  rawValue: string | undefined | null,\r\n  unionArray: Array<TUnion>,\r\n) {\r\n  if (rawValue === undefined) {\r\n    return undefined;\r\n  }\r\n  if (rawValue === null) {\r\n    return null;\r\n  }\r\n  if (rawValue === '') {\r\n    return null;\r\n  }\r\n  return unionArray.find(\r\n    f => f.toLocaleLowerCase() === rawValue?.toLowerCase(),\r\n  );\r\n}\r\nexport function GetBooleanOrUndefined(rawValue: string | undefined | null) {\r\n  if (rawValue === undefined) {\r\n    return undefined;\r\n  }\r\n  if (rawValue === null) {\r\n    return null;\r\n  }\r\n  const value = rawValue.toLowerCase() === 'true';\r\n  return value;\r\n}\r\nexport function GetDateOrUndefined(\r\n  rawValue: string | undefined | null,\r\n  type?: DateType,\r\n) {\r\n  if (rawValue === undefined) {\r\n    return undefined;\r\n  }\r\n  if (rawValue === null) {\r\n    return null;\r\n  }\r\n  const date = dateUtils.parseQueryStringDate(rawValue);\r\n  if (isNaN(date.getTime())) {\r\n    return undefined;\r\n  }\r\n  return new CustomDate(date, type ?? 'complete');\r\n}\r\n\r\nexport function GetPartialEntity<T extends number | string | boolean>(\r\n  id: T | undefined | null,\r\n): Identifiable<T> | undefined | null {\r\n  if (id === undefined) {\r\n    return undefined;\r\n  }\r\n  if (id === null) {\r\n    return null;\r\n  }\r\n  return { Id: id };\r\n}\r\nexport function GetEnum(\r\n  value: string | null | undefined,\r\n  enumObject: object,\r\n  t: TFunction,\r\n) {\r\n  if (value === null) {\r\n    return null;\r\n  }\r\n  if (value === undefined) {\r\n    return undefined;\r\n  }\r\n  var options = enumToEntityArray(enumObject, t);\r\n  var numValue = tryParseInt(value);\r\n  if (numValue === undefined) {\r\n    return null;\r\n  }\r\n  if (isNaN(numValue)) {\r\n    return null;\r\n  }\r\n  var item = options.find(f => f.Id === numValue);\r\n\r\n  return item ?? null;\r\n}\r\nexport function GetBooleanEntity(\r\n  value: boolean | undefined | null,\r\n  t: TFunction,\r\n): Entity<boolean> | undefined | null {\r\n  if (value === undefined) {\r\n    return undefined;\r\n  }\r\n  if (value === null) {\r\n    return null;\r\n  }\r\n  return {\r\n    Id: value,\r\n    Name: t(value === true ? translations.Yes : translations.No),\r\n  };\r\n}\r\n\r\nexport const initPickerValue = <T extends string | number | boolean>(\r\n  f: (value: string) => Promise<Entity<T>[]>,\r\n  additionalOptions?: Array<Entity<T>>,\r\n): FilterIntializer => {\r\n  return async (item: FilterValueType) => {\r\n    const x = item as Identifiable<T>;\r\n    const id = x.Id;\r\n    // if some \"addionalItem\" are injected through the filter - first try to look the entity there\r\n    // for example, the \"all my managed servcies\" - with the magic -999 id\r\n    const additionalItem = additionalOptions?.find(option => option.Id === id);\r\n    if (additionalItem !== undefined) {\r\n      return Promise.resolve(additionalItem);\r\n    }\r\n    const failureResult: Entity<T> = { Id: id, Name: 'N/A' };\r\n    if (item === null || (!!x && x.Id === '')) {\r\n      return Promise.resolve(failureResult);\r\n    }\r\n    try {\r\n      const data: any = await f(id.toString());\r\n      const verifiedData = !!data.value ? data.value : data;\r\n      const name =\r\n        verifiedData.length > 0\r\n          ? (verifiedData[0] as Entity<T>)\r\n          : failureResult;\r\n      return name;\r\n    } catch {\r\n      return failureResult;\r\n    }\r\n  };\r\n};\r\nexport const initExPickerValue = <T extends string | number | boolean>(\r\n  f: (\r\n    value: string,\r\n    sourceUrl?: any,\r\n    withoutServiceGroups?: boolean,\r\n  ) => Promise<Entity<T>[]>,\r\n  additionalOptions?: Array<Entity<T>>,\r\n  sourceUrl?: any,\r\n  withoutServiceGroups?: boolean,\r\n) => {\r\n  return async (item: FilterValueType) => {\r\n    const x = item as Identifiable<T>;\r\n    const id = x.Id;\r\n    // if some \"addionalItem\" are injected through the filter - first try to look the entity there\r\n    // for example, the \"all my managed servcies\" - with the magic -999 id\r\n    const additionalItem = additionalOptions?.find(option => option.Id === id);\r\n    if (additionalItem !== undefined) {\r\n      return Promise.resolve(additionalItem);\r\n    }\r\n    const failureResult: Entity<T> = { Id: id, Name: 'N/A' };\r\n    if (item === null || (!!x && x.Id === '')) {\r\n      return Promise.resolve(failureResult);\r\n    }\r\n    try {\r\n      const data: any = await f(id.toString(), sourceUrl, withoutServiceGroups);\r\n      const verifiedData = !!data.value ? data.value : data;\r\n      const name =\r\n        verifiedData.length > 0\r\n          ? (verifiedData[0] as Entity<T>)\r\n          : failureResult;\r\n      return name;\r\n    } catch {\r\n      return failureResult;\r\n    }\r\n  };\r\n};\r\n\r\nexport const initMultiExPickerValue = <T extends string | number | boolean>(\r\n  f: (\r\n    value: string | undefined,\r\n    sourceUrl?: any,\r\n    separator?: string,\r\n    serviceGroups?: Array<Identifiable<number>>,\r\n  ) => Promise<Entity<T>[]>,\r\n  additionalOptions?: Entity<T>[],\r\n  sourceUrl?: any,\r\n  separator?: string,\r\n): FilterIntializer => {\r\n  return async (\r\n    item: FilterValueType,\r\n    serviceGroups?: Array<Identifiable<number>>,\r\n  ) => {\r\n    const x = item as Identifiable<T>[];\r\n    const ids = x.map(v => v.Id);\r\n    const additionalItems = additionalOptions?.filter(option =>\r\n      ids.includes(option.Id),\r\n    );\r\n    if (additionalItems && additionalItems.length) {\r\n      return additionalItems;\r\n    }\r\n    const failureResult: Entity<T>[] = [];\r\n    if (item === null || (!!x && !x.length) || ids.every(v => !v || v === '')) {\r\n      return failureResult;\r\n    }\r\n    try {\r\n      const data: Entity<T>[] = await f(\r\n        ids.join(separator || '|'),\r\n        sourceUrl,\r\n        separator || '|',\r\n        serviceGroups,\r\n      );\r\n      return data.length > 0 ? data : failureResult;\r\n    } catch {\r\n      return failureResult;\r\n    }\r\n  };\r\n};\r\n\r\nexport const initMultiPickerValue = <T extends string | number>(\r\n  f: (value: string) => Promise<Entity<T>[]>,\r\n  additionalOptions?: Entity<T>[],\r\n) => {\r\n  return async (item: FilterValueType) => {\r\n    const x = item as Identifiable<T>[];\r\n    const ids = x.map(v => v.Id);\r\n    const additionalItems = additionalOptions?.filter(option =>\r\n      ids.includes(option.Id),\r\n    );\r\n    if (additionalItems && additionalItems.length) {\r\n      return Promise.resolve(additionalItems);\r\n    }\r\n    const failureResult: Entity<T>[] = [];\r\n    if (\r\n      item === null ||\r\n      (!!x && !x.length) ||\r\n      ids.every(v => v === undefined || v === null || v === '')\r\n    ) {\r\n      return Promise.resolve(failureResult);\r\n    }\r\n    try {\r\n      const data = await f(ids.join('|'));\r\n      return data.length > 0 ? data : failureResult;\r\n    } catch {\r\n      return failureResult;\r\n    }\r\n  };\r\n};\r\n\r\nexport function getFilterParams(search: string): FilterParam[] {\r\n  let result = [] as FilterParam[];\r\n  const params = new URLSearchParams(search);\r\n  params.forEach((value, key) => {\r\n    if (value !== '' && value !== undefined)\r\n      result.push({ Name: key, Value: value });\r\n  });\r\n  return result;\r\n}\r\n\r\nexport function getDefaultFilterValue(\r\n  name: string,\r\n  params: FilterParam[],\r\n): string | undefined {\r\n  const f = params.find(item => item.Name === name && item.Value !== '');\r\n  if (f !== undefined) {\r\n    return f.Value as string;\r\n  } else return undefined;\r\n}\r\n\r\nexport function getDefaultFilterBool(\r\n  name: string,\r\n  params: FilterParam[],\r\n  t: TFunction,\r\n): Entity<boolean> | null {\r\n  const f = params.find(item => item.Name === name && item.Value !== '');\r\n  const value = f?.Value;\r\n  const options = GetBooleanFilterOptions(t);\r\n\r\n  return options.find(item => item.Id.toString() === value) ?? null;\r\n}\r\n\r\nexport function getDefaultFilterDate(\r\n  name: string,\r\n  params: FilterParam[],\r\n): Date | null {\r\n  const st = getDefaultFilterValue(name, params);\r\n  if (st === undefined) {\r\n    return null;\r\n  }\r\n  const date = dateUtils.parseQueryStringDate(st);\r\n  if (date === null) {\r\n    return null;\r\n  }\r\n  return startOfDay(date);\r\n}\r\nexport const getPeriodTypeNameOrUndefined = (s: string | null | undefined) => {\r\n  if (s === undefined) {\r\n    return undefined;\r\n  }\r\n  const lowered = s?.toLowerCase();\r\n  const namedValue: PeriodTypes | undefined = ALL_PERIOD_TYPES.find(\r\n    f => f.toLowerCase() === lowered,\r\n  );\r\n  if (namedValue !== undefined) {\r\n    return namedValue;\r\n  }\r\n\r\n  const num = GetNumberOrUndefined(s);\r\n  if (num === null || num === undefined) {\r\n    return null;\r\n  }\r\n  if (isNaN(num)) {\r\n    return null;\r\n  }\r\n\r\n  if (num >= 0 && num < ALL_PERIOD_TYPES.length) {\r\n    const numberedValue = ALL_PERIOD_TYPES[num];\r\n    return numberedValue;\r\n  }\r\n\r\n  return namedValue;\r\n};\r\n\r\nexport function getDefaultFilterDatePeriod(\r\n  periodTypeFieldName: string,\r\n  customStartFieldName: string,\r\n  customEndFieldName: string,\r\n  params: URLSearchParams,\r\n): PresetDatesRange | undefined | null {\r\n  let periodType = getPeriodTypeNameOrUndefined(\r\n    GetRawValue(params, periodTypeFieldName),\r\n  );\r\n\r\n  const start = GetDateOrUndefined(\r\n    GetRawValue(params, customStartFieldName),\r\n    'complete',\r\n  );\r\n  const end = GetDateOrUndefined(\r\n    GetRawValue(params, customEndFieldName),\r\n    'complete',\r\n  );\r\n\r\n  // set the periodType to CustomDate if either start or end date were provided\r\n  // this intended to handle cases where a link to the page is not fully constructed\r\n  // e.g. /sompage?start=xxx will be translated to period type=CustomDate, start=xxx\r\n  if (isNullOrUndefined(periodType)) {\r\n    if (!isNullOrUndefined(start) || !isNullOrUndefined(end)) {\r\n      periodType = 'CustomDate';\r\n    }\r\n  }\r\n\r\n  if (periodType === undefined || periodType === null) {\r\n    return periodType;\r\n  }\r\n\r\n  if (periodType === 'CustomDate') {\r\n    return PresetDatesRange.Custom(start, end);\r\n  } else {\r\n    return PresetDatesRange.fromType(periodType, null, null);\r\n  }\r\n}\r\n\r\nexport const presetDatesRangeToQueryString = (\r\n  periodTypeFieldName,\r\n  customStartFieldName,\r\n  customEndFieldName,\r\n) => (value: FilterValueType | undefined) => {\r\n  var result = new URLSearchParams();\r\n\r\n  if (value === null) {\r\n    result.append(periodTypeFieldName, '');\r\n    return result;\r\n  }\r\n  if (value !== null && value !== undefined) {\r\n    const type = (value as PresetDatesRange).type?.Id;\r\n    const id = (value as PresetDatesRange).type?.Id;\r\n\r\n    if (id !== undefined) {\r\n      result.append(periodTypeFieldName, id.toString());\r\n      if (type === 'CustomDate') {\r\n        var start = (value as PresetDatesRange).start;\r\n        if (start !== null && start !== undefined) {\r\n          result.append(\r\n            customStartFieldName,\r\n            dateUtils.formatQueryStringDate(start, {\r\n              representation:\r\n                (start as CustomDate)?.representation ?? 'complete',\r\n            }),\r\n          );\r\n        }\r\n        var end = (value as PresetDatesRange).end;\r\n        if (end !== null && end !== undefined) {\r\n          result.append(\r\n            customEndFieldName,\r\n            dateUtils.formatQueryStringDate(end, {\r\n              representation:\r\n                (start as CustomDate)?.representation ?? 'complete',\r\n            }),\r\n          );\r\n        }\r\n      }\r\n    }\r\n  }\r\n  return result;\r\n};\r\n\r\nexport const getDefaultFilterNumberPeriod = (\r\n  fieldName: string,\r\n  params: URLSearchParams,\r\n): INumbersRange | undefined | null => {\r\n  const start = GetNumberOrUndefined(GetRawValue(params, `${fieldName}-min`));\r\n  const end = GetNumberOrUndefined(GetRawValue(params, `${fieldName}-max`));\r\n  if (start === undefined && end === undefined) {\r\n    return undefined;\r\n  } else if (start === null && end === null) {\r\n    return null;\r\n  } else {\r\n    return {\r\n      start: start ?? null,\r\n      end: end ?? null,\r\n    };\r\n  }\r\n};\r\nexport const NumebersRangeToQueryString = fieldName => (\r\n  value: FilterValueType | undefined,\r\n) => {\r\n  var result = new URLSearchParams();\r\n  const startFieldName = `${fieldName}-min`;\r\n  const endFieldName = `${fieldName}-max`;\r\n  if (value === null) {\r\n    result.append(startFieldName, '');\r\n    result.append(endFieldName, '');\r\n    return result;\r\n  }\r\n  if (value !== null && value !== undefined) {\r\n    const start = (value as INumbersRange)?.start;\r\n    const end = (value as INumbersRange)?.end;\r\n\r\n    result.append(startFieldName, start?.toString() ?? '');\r\n    result.append(endFieldName, end?.toString() ?? '');\r\n  }\r\n  return result;\r\n};\r\nexport const formatQueryStringDateValue: (\r\n  fieldName: string,\r\n) => FilterSerializer = (fieldName: string) => (\r\n  value: FilterValueType | undefined | null,\r\n) => {\r\n  var result = new URLSearchParams();\r\n  if (value === null) {\r\n    result.set(fieldName, '');\r\n  }\r\n  if (\r\n    value !== undefined &&\r\n    value !== null &&\r\n    !isNaN((value as Date)?.getTime?.())\r\n  ) {\r\n    result.set(\r\n      fieldName,\r\n      dateUtils.formatQueryStringDate(value as Date, {\r\n        representation: 'date',\r\n      }),\r\n    );\r\n  }\r\n  return result;\r\n};\r\nfunction serializeValue(value: FilterValueType): string | undefined | null {\r\n  try {\r\n    if (value === null) {\r\n      return null;\r\n    }\r\n    return typeof value === 'string'\r\n      ? value\r\n      : typeof value === 'number'\r\n      ? value?.toString()\r\n      : value instanceof CustomDate\r\n      ? dateUtils.formatQueryStringDate(value, {\r\n          representation: (value as CustomDate).representation ?? 'date',\r\n        })\r\n      : value instanceof Date\r\n      ? dateUtils.formatQueryStringDate(value)\r\n      : (value as Entity<number>)?.Id?.toString();\r\n  } catch {\r\n    return undefined;\r\n  }\r\n}\r\n\r\nexport const defaultSerializer: (\r\n  fieldName: string,\r\n) => FilterSerializer = fieldName => value => {\r\n  var result = new URLSearchParams();\r\n  if (value === null) {\r\n    result.set(fieldName, '');\r\n  }\r\n  if (value !== undefined) {\r\n    var stringValue = serializeValue(value);\r\n    if (stringValue !== null && stringValue !== undefined) {\r\n      result.set(fieldName, stringValue);\r\n    }\r\n  }\r\n  return result;\r\n};\r\n\r\nexport const arrayToQueryString: (\r\n  fieldName: string,\r\n) => FilterSerializer = fieldName => value => {\r\n  let result = new URLSearchParams();\r\n  if (Array.isArray(value) || value == null) {\r\n    let stringValues = value\r\n      ?.map(v => serializeValue(v))\r\n      .filter(v => v !== undefined);\r\n    result.set(fieldName, stringValues?.join('|') ?? '');\r\n  }\r\n  return result;\r\n};\r\n\r\nexport const arrayByNameEntityNumberToQueryString: (\r\n  fieldName: string,\r\n) => FilterSerializer = fieldName => value => {\r\n  let result = new URLSearchParams();\r\n  if (Array.isArray(value) || value == null) {\r\n    let stringValues = value\r\n      ?.map(v => (v as Entity<number>)?.Name?.toString())\r\n      .filter(v => v !== undefined);\r\n    result.set(fieldName, stringValues?.join('|') ?? '');\r\n  }\r\n  return result;\r\n};\r\nexport const getStringEntityArray = (\r\n  params: URLSearchParams,\r\n  fieldName: string,\r\n): FilterValueType | undefined => {\r\n  let search = GetRawValue(params, fieldName);\r\n  if (search === undefined) return undefined;\r\n  if (search === null) return null;\r\n  let allSearch = splitFilterValue(search).map(v => GetStringOrUndefined(v));\r\n  allSearch = allSearch.filter(v => v !== undefined);\r\n  if (!allSearch.length) return undefined;\r\n  let allEntities = allSearch.map(v => GetPartialEntity(v));\r\n  allEntities = allEntities.filter(v => v !== undefined);\r\n  if (!allEntities.length) return undefined;\r\n  return allEntities as FilterValueType;\r\n};\r\n\r\nexport const getNumberEntityArray = (\r\n  params: URLSearchParams,\r\n  fieldName: string,\r\n): FilterValueType | undefined => {\r\n  let search = GetRawValue(params, fieldName);\r\n  return getNumberEntityArrayFromString(search) as FilterValueType;\r\n};\r\nexport const getNumberEntityArrayFromString = (\r\n  search: string | undefined | null,\r\n) => {\r\n  if (search === undefined) return undefined;\r\n  if (search === null) return null;\r\n  let allSearch = splitFilterValue(search).map(v => GetNumberOrUndefined(v));\r\n  allSearch = allSearch.filter(v => v !== undefined);\r\n  if (!allSearch.length) return undefined;\r\n  let allEntities = allSearch.map(v => GetPartialEntity(v));\r\n  allEntities = allEntities.filter(v => v !== undefined);\r\n  if (!allEntities.length) return undefined;\r\n  return allEntities;\r\n};\r\n\r\nexport const assetRangeSerializer: (fieldName: string) => FilterSerializer = (\r\n  fieldname: string,\r\n) => value => {\r\n  const res = new URLSearchParams();\r\n  if (isAssetRangeType(value)) {\r\n    res.set(fieldname + 'Val', serializeValue(value.value) ?? '');\r\n    res.set(fieldname + 'Type', serializeValue(value.unitType) ?? '');\r\n  }\r\n  return res;\r\n};\r\n\r\nexport const getAssetRange = (\r\n  params: URLSearchParams,\r\n  fieldName: string,\r\n): FilterValueType | undefined => {\r\n  const val = GetRawValue(params, fieldName + 'Val');\r\n  const type = GetRawValue(params, fieldName + 'Type');\r\n  if (\r\n    valOrNull(val) === null ||\r\n    isNaN(parseFloat(val ?? '')) ||\r\n    valOrNull(type) === null ||\r\n    isNaN(parseInt(type ?? ''))\r\n  ) {\r\n    return undefined;\r\n  }\r\n  return {\r\n    unitType: { Id: parseInt(type ?? '') },\r\n    value: parseFloat(val ?? ''),\r\n  } as AssetRangeType;\r\n};\r\nexport const getSplitNumberArray = (search: string): number[] => {\r\n  return splitFilterValue(search)\r\n    .map(v => {\r\n      var number = parseInt(v);\r\n      if (isNaN(number)) {\r\n        return 0;\r\n      }\r\n      return number;\r\n    })\r\n    .filter(f => f > 0);\r\n};\r\nexport const splitFilterValue = (search: string, separator?: string) => {\r\n  let x = search.indexOf(separator ?? '|') >= 0 ? separator ?? '|' : ',';\r\n  let allSearch = search.split(x);\r\n  return allSearch;\r\n};\r\nexport const joinArray = (values: Array<any>, separator?: string) => {\r\n  return values.join(separator ?? '|');\r\n};\r\n","import axios, { AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { uniqueId } from 'lodash';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\naxios.defaults.baseURL = process.env.PUBLIC_URL;\r\naxios.defaults.timeout = 600000;\r\n\r\n/**\r\n * Check if HTTP status is a success - anything in 2xx range\r\n * e.g. 200, 201, etc.\r\n * @param status HTTP_STATUS\r\n * @returns true for all success statuses\r\n */\r\nconst isStatusOK = (status: number) => status >= 200 && status < 300;\r\n\r\nexport type BatchRequest = {\r\n  id?: string;\r\n  method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';\r\n  pathName: string;\r\n  search?: URLSearchParams;\r\n  body?: any;\r\n};\r\ninterface BatchResponse {\r\n  id: string;\r\n  atomicityGroup: string;\r\n  status: StatusCodes;\r\n  headers: Record<string, string>;\r\n  body?: unknown;\r\n}\r\nexport interface BatchResponses {\r\n  responses: BatchResponse[];\r\n}\r\n// const y = {\r\n//   responses: [\r\n//     {\r\n//       id: 'g1_0',\r\n//       atomicityGroup: 'f27f07a2-e8f4-4c62-8216-4611e3ba07c6',\r\n//       status: 204,\r\n//       headers: { 'odata-version': '4.0' },\r\n//     },\r\n//     {\r\n//       id: 'g1_1',\r\n//       atomicityGroup: 'f27f07a2-e8f4-4c62-8216-4611e3ba07c6',\r\n//       status: 204,\r\n//       headers: { 'odata-version': '4.0' },\r\n//     },\r\n//   ],\r\n// };\r\n// const x = {\r\n//   requests: [\r\n//     {\r\n//       method: 'PATCH',\r\n//       atomicityGroup: 'g1',\r\n//       url:\r\n//         'http://localhost:3194/bkt_webApp/api/odata/v4/ServiceRequestTickets(650)',\r\n//       headers: {\r\n//         'content-type':\r\n//           'application/json; odata.metadata=minimal; odata.streaming=true',\r\n//         'odata-version': '4.0',\r\n//       },\r\n//       id: 'g1_0',\r\n//       body: { Index: 0 },\r\n//     },\r\n//     {\r\n//       method: 'PATCH',\r\n//       atomicityGroup: 'g1',\r\n//       url:\r\n//         'http://localhost:3194/bkt_webApp/api/odata/v4/ServiceRequestTickets(651)',\r\n//       headers: {\r\n//         'content-type':\r\n//           'application/json; odata.metadata=minimal; odata.streaming=true',\r\n//         'odata-version': '4.0',\r\n//       },\r\n//       id: 'g1_1',\r\n//       body: { Index: 1 },\r\n//     },\r\n//   ],\r\n// };\r\n\r\nclass Client {\r\n  public cancelToken = axios.CancelToken;\r\n  public async get<T = any>(\r\n    url: string,\r\n    params?: any,\r\n    cancelToken?: CancelToken,\r\n  ): Promise<T> {\r\n    try {\r\n      const response = await axios.get<T>(url, {\r\n        params: params,\r\n        cancelToken: cancelToken,\r\n      });\r\n      if (isStatusOK(response.status)) {\r\n        return response.data;\r\n      } else {\r\n        throw response;\r\n      }\r\n    } catch (err) {\r\n      throw err;\r\n    }\r\n  }\r\n  public async put<T = any, R = AxiosResponse<T>>(\r\n    url: string,\r\n    data?: any,\r\n    config?: AxiosRequestConfig,\r\n  ): Promise<R> {\r\n    const response = await axios.put(url, data, config);\r\n    if (isStatusOK(response.status)) {\r\n      return response.data;\r\n    } else {\r\n      throw response;\r\n    }\r\n  }\r\n  public async post<T = any>(\r\n    url: string,\r\n    data?: any,\r\n    config?: AxiosRequestConfig,\r\n  ): Promise<T> {\r\n    try {\r\n      const response = await axios.post<T>(url, data, config);\r\n      if (isStatusOK(response.status)) {\r\n        return response.data;\r\n      } else {\r\n        throw response;\r\n      }\r\n    } catch (error) {\r\n      throw error;\r\n    }\r\n  }\r\n  public async patch<T = any>(\r\n    url: string,\r\n    data?: any,\r\n    config?: AxiosRequestConfig,\r\n  ): Promise<T> {\r\n    const response = await axios.patch<T>(url, data, config);\r\n    if (isStatusOK(response.status)) {\r\n      return response.data;\r\n    } else {\r\n      throw response;\r\n    }\r\n  }\r\n  public async delete<T = any, R = AxiosResponse<T>>(\r\n    url: string,\r\n    config?: AxiosRequestConfig,\r\n  ): Promise<R> {\r\n    const response = await axios.delete(url);\r\n    if (isStatusOK(response.status)) {\r\n      return response.data;\r\n    } else {\r\n      throw response;\r\n    }\r\n  }\r\n  public async deleteCustom<T = any>(\r\n    url: string,\r\n    config?: AxiosRequestConfig,\r\n  ): Promise<T> {\r\n    const response = await axios.delete(url);\r\n    if (isStatusOK(response.status)) {\r\n      return response.data;\r\n    } else {\r\n      throw response;\r\n    }\r\n  }\r\n  public async batch(b: Array<BatchRequest>): Promise<BatchResponses> {\r\n    const atomicityGroup = 'g1';\r\n    const payload = {\r\n      requests: b\r\n        // each request needs to be fully qualified e.g. https://foo/api/odata/v4/entity otherwise odata throws NullRef exception regarding virtualpath\r\n        .map((r, index) => {\r\n          const rootedPathWithSearch = toRootedURL(\r\n            r.pathName + (r.search === undefined ? '' : `?${r.search}`),\r\n          );\r\n          return {\r\n            method: r.method,\r\n            atomicityGroup: atomicityGroup,\r\n            url: new URL(rootedPathWithSearch, new URL(window.location.origin)),\r\n\r\n            headers: {\r\n              'content-type':\r\n                'application/json; odata.metadata=minimal; odata.streaming=true',\r\n              'odata-version': '4.0',\r\n            },\r\n            id: r.id ?? uniqueId(`${atomicityGroup}_`),\r\n            body: r.body,\r\n          };\r\n        }),\r\n    };\r\n    const response: AxiosResponse<BatchResponses> = await axios.post(\r\n      '/api/odata/v4/$batch',\r\n      payload,\r\n    );\r\n\r\n    if (\r\n      response.data.responses.every(response => isStatusOK(response.status))\r\n    ) {\r\n      return response.data;\r\n    } else {\r\n      throw response;\r\n    }\r\n  }\r\n  public async batchDelete(urls: string[]) {\r\n    return this.batch(\r\n      urls.map(f => ({\r\n        pathName: f,\r\n        method: 'DELETE',\r\n      })),\r\n    );\r\n  }\r\n  /**\r\n   * Response type is blob by default due to historical reasons. If json is expected, then\r\n   * uploadFile('url', data, {resposneType:'json'})\r\n   * @param url\r\n   * @param file\r\n   * @param config\r\n   */\r\n  public async uploadFile(url, file, config?: AxiosRequestConfig) {\r\n    const formData = new FormData();\r\n    formData.append('File', file);\r\n    const response = await axios.post(url, formData, {\r\n      responseType: 'blob',\r\n      timeout: undefined,\r\n      headers: {\r\n        'Content-Type': 'multipart/form-data',\r\n        Accept: 'application/json',\r\n      },\r\n      ...config,\r\n    });\r\n    return response;\r\n  }\r\n}\r\nexport const httpClient = new Client();\r\n","import { IconName as fontawesome_IconName } from '@fortawesome/fontawesome-svg-core';\r\nimport {\r\n  FontAwesomeIcon,\r\n  FontAwesomeIconProps,\r\n} from '@fortawesome/react-fontawesome';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\nimport { getColor, TypeColor, TypeColorOptions } from 'styles/colors/types';\r\nimport { IconName, IconProp } from 'app/AllIcons';\r\n\r\nexport interface IconProps\r\n  extends Omit<FontAwesomeIconProps, 'color' | 'icon'> {\r\n  color?: TypeColor;\r\n  colorExtend?: TypeColorOptions;\r\n  icon: IconProp;\r\n  info?: string;\r\n}\r\n\r\nexport const Icon = React.forwardRef(function Icon(\r\n  { icon, color, colorExtend, info, ...props }: IconProps,\r\n  ref,\r\n) {\r\n  const iconName = icon as IconName;\r\n  //typeof icon === 'string' ? () : (icon as IconProp);\r\n  const theme = useTheme();\r\n  const defColor = color && getColor(theme, color, colorExtend); //|| theme.palette.common.graySubtitle\r\n\r\n  const WithTitle = ({ children }: { children: React.ReactNode }) =>\r\n    info ? (\r\n      <Tooltip title={info}>\r\n        <span>{children}</span>\r\n      </Tooltip>\r\n    ) : (\r\n      <>{children}</>\r\n    );\r\n  return (\r\n    <WithTitle>\r\n      <FontAwesomeIcon\r\n        icon={iconName as fontawesome_IconName}\r\n        color={defColor}\r\n        {...props}\r\n      />\r\n    </WithTitle>\r\n  );\r\n});\r\n// variant with ref - using SvgIcon component\r\n\r\n// export const Icon = React.forwardRef<any, IconProps>((props, ref) => {\r\n//   const { icon, color, ...rest } = props;\r\n//   const iconName = icon as IconName;\r\n//   const theme = useTheme();\r\n//   const defColor = color && getColor(theme, color);\r\n//   return (\r\n//     <SvgIcon ref={ref}>\r\n//       <FontAwesomeIcon icon={iconName} color={defColor} {...rest} />\r\n//     </SvgIcon>\r\n//   );\r\n// });\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useTheme } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { RightSection } from '../wrappers';\r\n\r\nexport interface FormRightSectionProps {\r\n  children: React.ReactNode;\r\n  isCover?: boolean;\r\n}\r\nexport const FormRightSection = (props: FormRightSectionProps) => {\r\n  const { children, isCover } = props;\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView =\r\n    isMobile || (sidePanelOpen && !sidePanelExpanded) || isCover;\r\n  const theme = useTheme();\r\n  return (\r\n    <RightSection\r\n      className={clsx('rightsection', { shortView: showShortView })}\r\n      theme={theme}\r\n    >\r\n      {children}\r\n    </RightSection>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { Form } from 'formik';\r\nimport { CSSProperties } from '@material-ui/styles';\r\nimport { StyledFormFieldsContainer } from '../StyledFormFieldsContainer';\r\nexport interface IndexNode {\r\n  node: React.ReactNode;\r\n  index: number | string;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  showMore?: boolean;\r\n}\r\nexport interface StyledFormProps {\r\n  onSubmit?: (e?: React.FormEvent<HTMLFormElement> | undefined) => void;\r\n  children: React.ReactNode;\r\n  avoidStyles?: boolean;\r\n  id?: string;\r\n  sectionStyle?: CSSProperties;\r\n  isCover?: boolean;\r\n  noPadding?: boolean;\r\n  skipShortView?: boolean;\r\n}\r\nexport const StyledForm = (props: StyledFormProps) => {\r\n  const {\r\n    id,\r\n    onSubmit,\r\n    avoidStyles,\r\n    children,\r\n    sectionStyle,\r\n    isCover,\r\n    noPadding,\r\n    skipShortView,\r\n    ...other\r\n  } = props;\r\n  return (\r\n    <Form onSubmit={onSubmit} id={id}>\r\n      <StyledFormFieldsContainer\r\n        avoidStyles={avoidStyles}\r\n        sectionStyle={sectionStyle}\r\n        isCover={isCover}\r\n        noPadding={noPadding}\r\n        skipShortView={skipShortView}\r\n        {...other}\r\n      >\r\n        {children}\r\n      </StyledFormFieldsContainer>\r\n    </Form>\r\n  );\r\n};\r\n","import { enumStringKeys } from 'utils/enumKeys';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { httpClient } from './HttpClient';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const SettingsApi = {\r\n  getSystemSettingByKey: (payload: { key: string }) => {\r\n    const url = '/api/odata/v4/SystemSettings';\r\n    const params: {\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $filter: '(Id eq ' + payload.key + ')',\r\n      $select: 'Id,Name,Value',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n  getAllSystemSetting: () => {\r\n    const url = '/api/odata/v4/SystemSettings';\r\n    const params: {\r\n      $select: string;\r\n    } = {\r\n      $select: 'Id,Name,Value',\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n  getAlowedSystemSetting: () => {\r\n    const url = '/api/odata/v4/SystemSettings';\r\n    const params: {\r\n      $select: string;\r\n      $filter?: string;\r\n    } = {\r\n      $select: 'Id,Name,Value',\r\n    };\r\n\r\n    let names: Identifiable<string>[] = enumStringKeys(AllowedSettings).map(\r\n      v => {\r\n        return { Id: v };\r\n      },\r\n    );\r\n\r\n    let filter =\r\n      new Condition<SettingModel>(\r\n        'Name',\r\n        ODataOperators.Includes,\r\n        names,\r\n      ).toString() ?? '';\r\n    params.$filter = filter;\r\n    return httpClient.get(url, params);\r\n  },\r\n  getAllSystemSettingFromList: (keys: string[]) => {\r\n    const url = '/api/odata/v4/SystemSettings';\r\n    const params: {\r\n      $select: string;\r\n      $filter?: string;\r\n    } = {\r\n      $select: 'Id,Name,Value',\r\n    };\r\n\r\n    let names: Identifiable<string>[] = keys.map(v => {\r\n      return { Id: v };\r\n    });\r\n\r\n    let filter =\r\n      new Condition<SettingModel>(\r\n        'Name',\r\n        ODataOperators.Includes,\r\n        names,\r\n      ).toString() ?? '';\r\n    params.$filter = filter;\r\n    return httpClient.get(url, params);\r\n  },\r\n  getLoginSystemSettings: () => {\r\n    const url = '/api/v3/appsettings/GetLoginSettings';\r\n    return httpClient.get(url);\r\n  },\r\n  setSystemSetting: (setting: SettingModel) => {\r\n    const url = '/api/odata/v4/SystemSettings';\r\n    return httpClient.post(url, setting);\r\n  },\r\n};\r\n","import { select } from 'redux-saga/effects';\r\nimport { selectAppSettings, selectIsAuthenticated } from '../selectors';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { ConfigurableTypes, ScreensId } from 'enums/ConfigurableTypes';\r\nimport { GetCachedConfigurableColumnsData } from 'app/components/BasicTable/ConfigurableColumns';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\n/**\r\n * Does prefetch for configurable columns for selected table based pages. These should include mostly used/mostly visited ones\r\n */\r\nexport function* doPrefetchConfigurableColumns() {\r\n  const settings: AppSettings = yield select(selectAppSettings);\r\n  const isAuthenticated: boolean | undefined = yield select(\r\n    selectIsAuthenticated,\r\n  );\r\n  // Ids of the pages (ScreenId enum) and respective required modules\r\n  // Some of the pages can be disabled and are not shown so not all of the configurable columns might be needed\r\n  const authSet: Array<{ s: ScreensId; m?: KnownModules }> = [\r\n    // service groups aka cores directory src\\app\\pages\\CoresDirectoryPage\\index.tsx\r\n    { s: ScreensId.CoresDirectory },\r\n    // reservation history - C:\\Users\\mikea\\Projects\\bookitlab\\web-ui\\src\\app\\pages\\ReservationHistoryPage\\index.tsx\r\n    { s: ScreensId.ReservationHistory },\r\n    // user training - src\\app\\pages\\UserTrainingsPage\\index.tsx\r\n    { s: ScreensId.UserTraining, m: KnownModules.Instruments },\r\n    // training sessions - src\\app\\pages\\TrainingSessionsPage\\index.tsx\r\n    {\r\n      s: ScreensId.UpcomingTrainingSessions,\r\n      m: KnownModules.Instruments,\r\n    },\r\n    // service requests - src\\app\\pages\\ServiceRequestListPage\\index.tsx\r\n    { s: ScreensId.ServiceRequests, m: KnownModules.ServiceRequests },\r\n    // my assets / instruments - src\\app\\pages\\MyAssetsPage\\index.tsx\r\n    { s: ScreensId.MyAssets },\r\n    // work orders aka events aka alerts - src\\app\\pages\\WorkOrdersPage\\index.tsx\r\n    { s: ScreensId.Alerts, m: KnownModules.MaintenanceAssets },\r\n  ];\r\n  const noAuthSet: Array<{ s: ScreensId; m?: KnownModules }> = [\r\n    // public assets src\\app\\pages\\PublicAssets\\index.tsx\r\n    { s: ScreensId.PublicAssets },\r\n  ];\r\n  const screens: Array<ScreensId> = (isAuthenticated ? authSet : noAuthSet)\r\n    .filter(item => item.m === undefined || settings.Modules.includes(item.m))\r\n    .map(item => item.s);\r\n  // preloads reservations history display columns to get faster to the table data\r\n  // does not return anything here, but the fetched data will be already prefetch for the later use elsewhere\r\n  screens.map(screenId =>\r\n    GetCachedConfigurableColumnsData(\r\n      screenId,\r\n      ConfigurableTypes.ColumnScreenConfig,\r\n      isAuthenticated,\r\n    ),\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { SettingsApi } from 'api/SettingsApi';\r\nimport { internalIdLoginActions } from 'app/pages/Animals/InternalIdLoginPage/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { push, replace } from 'connected-react-router';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  call,\r\n  put,\r\n  takeLatest,\r\n  delay,\r\n  all,\r\n  select,\r\n  takeEvery,\r\n  takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { AuthenticatedUser, IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity } from 'types/common';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { appSettingsActions as actions } from '.';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectBarcodeScanTarget,\r\n  selectGlobalSetting,\r\n  selectSystemFirstDayOfWeek,\r\n  selectUserProfileSettings,\r\n} from './selectors';\r\nimport {\r\n  LoginTypes,\r\n  parseBarcode,\r\n  Roles,\r\n  SaveUserProfileSettingAction,\r\n  ScanTarget,\r\n  ScanTemplateResult,\r\n} from './types';\r\nimport { Location } from 'history';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { eventChannel } from 'redux-saga';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { doPrefetchConfigurableColumns } from './workers/doPrefetchConfigurableColumns';\r\nimport { TermsOfUseAgreementApi } from 'api/TermsOfUseAgreementApi';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport function* getAppSettings(action: PayloadAction<boolean>) {\r\n  const requestURL = '/api/v3/appsettings';\r\n  const noAuthURL = '/api/v3/appsettings/NotAuthenticatedSettings';\r\n  const url = action.payload ? requestURL : noAuthURL;\r\n  try {\r\n    const appSettings = yield call(httpClient.get, url);\r\n    yield put(actions.appSettingsLoaded(appSettings));\r\n    yield put(actions.changeLanguage(appSettings.Globalization.Locale));\r\n    if (!action.payload) {\r\n      yield put(actions.loadSystemSettings_Success(appSettings.noAuthSettings));\r\n    }\r\n  } catch (err: unknown) {\r\n    yield put(\r\n      actions.loadError({\r\n        message: 'fail -' + (err as AxiosError)?.response?.status,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* getAuthenticatedUser(action: PayloadAction<boolean>) {\r\n  const requestURL = '/api/v3/appsettings/authenticateduser';\r\n  try {\r\n    const response = yield call(httpClient.get, requestURL);\r\n    const user = response as IAuthenticatedUser;\r\n    user.LoginType = LoginTypes.Password;\r\n    yield put(actions.getAuthenticatedUser_Success(user));\r\n    if (user.Roles.indexOf(Roles.LargeAnimalsOperatingRoomTechnician) >= 0) {\r\n      yield put(internalIdLoginActions.success(user));\r\n    }\r\n  } catch (err) {\r\n    console.error(err);\r\n    const status = (err as AxiosError)?.response?.status;\r\n    if (status === 401 || !status || action.payload) {\r\n      yield put(actions.setIsAuthenticated(false));\r\n    } else {\r\n      window.location.replace(toRootedURL('/login'));\r\n    }\r\n    yield put(actions.getAuthenticatedUser_Error('auth get fail'));\r\n  }\r\n}\r\nfunction* doSetIsAuthenticated(action: PayloadAction<boolean>) {\r\n  yield put(actions.IsAuthenticatedChanged(action.payload));\r\n}\r\nfunction* setLanguage(action: PayloadAction<string | null>) {\r\n  if (action.payload === null) {\r\n    return;\r\n  }\r\n  try {\r\n    const locale: string = action.payload;\r\n    const [language] = locale?.split('-');\r\n\r\n    const systemFirstDayOfWeek: number = yield select(\r\n      selectSystemFirstDayOfWeek,\r\n    );\r\n\r\n    yield all([\r\n      call(l => i18next.changeLanguage(l), language),\r\n      call(l => dateUtils.setLocale(l, systemFirstDayOfWeek), locale),\r\n    ]);\r\n    yield put(actions.languageChanged(i18next.language));\r\n  } catch (err) {\r\n    console.error('setLanguage', err);\r\n  }\r\n}\r\nfunction* getSiteMapSource() {\r\n  const requestURL = '/api/v3/siteMapSettings';\r\n  try {\r\n    const siteMap = yield call(httpClient.get, requestURL);\r\n    yield put(actions.loadSiteMapSettings_Success(siteMap));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(actions.loadSiteMapSettings_Error('site map loding error'));\r\n  }\r\n}\r\nfunction* doNavigate(action: PayloadAction<string>) {\r\n  if (\r\n    typeof action.payload === 'string' &&\r\n    action.payload.indexOf('.aspx') > 0\r\n  ) {\r\n    window.location.href = toRootedURL(action.payload);\r\n  } else {\r\n    yield put(push(action.payload));\r\n  }\r\n}\r\nfunction* getEventsCount() {\r\n  const requestURL = '/api/v3/eventsCount';\r\n  try {\r\n    const count = yield call(httpClient.get, requestURL);\r\n    yield put(actions.loadEventsCount_Success(count));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(actions.loadEventsCount_Error('events count loading error'));\r\n  }\r\n}\r\nfunction* getUserProfileSettings() {\r\n  yield delay(500);\r\n  const requestURL = '/api/v3/userProfile';\r\n  try {\r\n    const settings = yield call(httpClient.get, requestURL);\r\n    yield put(actions.loadUserProfile_Success(settings));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(\r\n      actions.loadUserProfile_Error('user profile settings loading error'),\r\n    );\r\n  }\r\n}\r\nfunction* getSystemSettings() {\r\n  yield delay(500);\r\n  try {\r\n    const settings = yield call(SettingsApi.getAlowedSystemSetting);\r\n    yield put(actions.loadSystemSettings_Success(settings));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(\r\n      actions.loadSystemSettings_Error('user profile settings loading error'),\r\n    );\r\n  }\r\n}\r\nfunction* getLoginSystemSettings() {\r\n  try {\r\n    const settings = yield call(SettingsApi.getLoginSystemSettings);\r\n    yield put(actions.loadLoginSystemSettings_Success(settings));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(\r\n      actions.loadLoginSystemSettings_Error('Login settings loading error'),\r\n    );\r\n  }\r\n}\r\nfunction* updateUserProfileSettings(\r\n  action: PayloadAction<{\r\n    key: string;\r\n    model: UserProfileSettings;\r\n    withDelay?: boolean;\r\n  }>,\r\n) {\r\n  if (action.payload.withDelay) {\r\n    yield delay(500);\r\n  }\r\n  const sett: UserProfile = yield select(selectUserProfileSettings);\r\n  let item = sett.GetSettingByKeyOrDefault(\r\n    action.payload.key,\r\n  ) as UserProfileSettings;\r\n  const payload = Object.assign({}, item, action.payload.model);\r\n  const requestURL = `/api/v3/userProfile/update?key=${action.payload.key}`;\r\n  try {\r\n    const data = yield call(httpClient.put, requestURL, payload);\r\n    yield put(actions.updateUserProfile_Success(data));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(\r\n      actions.updateUserProfile_Error('user profile settings loading error'),\r\n    );\r\n  }\r\n}\r\nfunction* doUpdateExpandedState(action: PayloadAction<boolean>) {\r\n  const sett: UserProfile = yield select(selectUserProfileSettings);\r\n  let item = sett.GetSettingByKeyOrDefault(\r\n    'SideBarExpanded',\r\n  ) as UserProfileSettings;\r\n  const payload = Object.assign({}, item, { Enabled: action.payload });\r\n  const requestURL = `/api/v3/userProfile/update?key=SideBarExpanded`;\r\n  try {\r\n    const data = yield call(httpClient.put, requestURL, payload);\r\n    yield put(actions.updateExpandedState_Success(data));\r\n  } catch (err) {\r\n    console.debug(err);\r\n    yield put(\r\n      actions.updateExpandedState_Error('user profile settings loading error'),\r\n    );\r\n  }\r\n}\r\n// function* doUpdateExpandedState_Local(action: PayloadAction<boolean>) {\r\n//   yield put(actions.setExpandedState_Local(action.payload));\r\n// }\r\nfunction* doLoadGlobalServiceGroupFilter() {\r\n  try {\r\n    const url = '/api/odata/v4/servicegroups/GetGlobalServiceGroupsFilter';\r\n    const params = { $select: 'Id,Name,SidebarQuickAction' };\r\n    const data = yield call(httpClient.get, url, params);\r\n    yield put(actions.loadGlobalServiceGroupFilter_Success(data.value));\r\n  } catch {\r\n    //noop\r\n  }\r\n}\r\nfunction* doSaveGlobalServiceGroupFilter(\r\n  action: PayloadAction<Entity<number>[]>,\r\n) {\r\n  try {\r\n    const url = '/api/odata/v4/servicegroups/SetGlobalServiceGroupsFilter';\r\n    const data = { selection: action.payload.map(f => f.Id) };\r\n    yield call(httpClient.post, url, data);\r\n    yield put(actions.loadGlobalServiceGroupFilter_Success(action.payload));\r\n\r\n    if (action.payload.length <= 3) {\r\n      yield put(\r\n        actions.addNotification({\r\n          key: 'topServiceGroups',\r\n          variant: 'success',\r\n          message: `${i18next.t(translations.SwitchedTo)} ${action.payload\r\n            .map(f => f.Name)\r\n            .join(', ')}`,\r\n        }),\r\n      );\r\n    } else {\r\n      yield put(\r\n        actions.addNotification({\r\n          key: 'topServiceGroups',\r\n          variant: 'success',\r\n          message: `${i18next.t(translations.SwitchedTo)} ${\r\n            action.payload[0].Name\r\n          } and + ${action.payload.length - 1} more`,\r\n        }),\r\n      );\r\n    }\r\n  } catch {\r\n    //noop\r\n  }\r\n}\r\nfunction* doSaveUserProfileSetting(action: SaveUserProfileSettingAction) {\r\n  try {\r\n    // save the filter in the backend\r\n    const url = `/api/v3/userProfile/update`;\r\n    const httpPaload: Partial<UserProfileSettings> = {\r\n      Value: action.payload.Value,\r\n      Enabled: action.payload.Enabled,\r\n    };\r\n\r\n    yield call(httpClient.put, url, httpPaload, {\r\n      params: { key: action.payload.Key },\r\n    });\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\nfunction* doSaveFilter(\r\n  action: PayloadAction<{\r\n    key: string;\r\n    location: Location<unknown>;\r\n    search: string;\r\n  }>,\r\n) {\r\n  try {\r\n    // push new search to browser history\r\n    const search = action.payload.search;\r\n    const noChangeInURL = new URLSearchParamsCI(search).equals(\r\n      new URLSearchParamsCI(action.payload.location.search),\r\n    );\r\n    if (!noChangeInURL) {\r\n      if (\r\n        action.payload.location.search !== search ||\r\n        (action.payload.location.search === '' && search === '')\r\n      ) {\r\n        yield put(\r\n          actions.navigate({\r\n            search: search,\r\n          }),\r\n        );\r\n      }\r\n    }\r\n\r\n    const authenticatedUser: AuthenticatedUser = yield select(\r\n      selectAuthenticatedUser,\r\n    );\r\n    yield* doSaveUserProfileSetting({\r\n      type: action.type,\r\n      payload: {\r\n        Key: action.payload.key,\r\n        Value: search.toString(),\r\n        UserName: authenticatedUser.Id,\r\n        Enabled: true,\r\n      },\r\n    });\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\n\r\nfunction* doSavePageSize(\r\n  action: PayloadAction<{ key: string; value: number }>,\r\n) {\r\n  try {\r\n    const url = `/api/v3/userProfile/update`;\r\n    const httpPaload: Partial<UserProfileSettings> = {\r\n      Value: action.payload.value.toString(),\r\n    };\r\n\r\n    yield call(httpClient.put, url, httpPaload, {\r\n      params: { key: action.payload.key },\r\n    });\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\nfunction* doSaveCardsMode(\r\n  action: PayloadAction<{ key: string; value: boolean }>,\r\n) {\r\n  try {\r\n    const url = `/api/v3/userProfile/update`;\r\n    const httpPaload: Partial<UserProfileSettings> = {\r\n      Value: action.payload.value.toString(),\r\n    };\r\n\r\n    yield call(httpClient.put, url, httpPaload, {\r\n      params: { key: action.payload.key },\r\n    });\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\nfunction* doUpdateMyListSelected(\r\n  action: PayloadAction<SavedViewSelected | undefined>,\r\n) {\r\n  yield put(actions.updateMyList(action.payload));\r\n}\r\n\r\n/**\r\n * Handle barcode scans\r\n * @param action action raised by barcode scanner middleware\r\n */\r\nfunction* doBarcodeScan(action: PayloadAction<{ data: string }>) {\r\n  const MIN_LENGTH_DEFAULT = 6;\r\n  const minBarcodeLengthString: string | undefined = yield select(state =>\r\n    selectGlobalSetting(state, AllowedSettings.MinBarcodeLength),\r\n  );\r\n  const MinBarcodeLength =\r\n    tryParseInt(minBarcodeLengthString) ?? MIN_LENGTH_DEFAULT;\r\n  // prevent accidental barcode detection on fast user input\r\n  if (action.payload.data.length < MinBarcodeLength) {\r\n    return;\r\n  }\r\n  const scannTarget: ScanTarget | undefined = yield select(\r\n    selectBarcodeScanTarget,\r\n  );\r\n  if (scannTarget !== undefined && scannTarget !== ScanTarget.All) {\r\n    return;\r\n  }\r\n  const appSettings: AppSettings = yield select(selectAppSettings);\r\n  yield put(\r\n    actions.addNotification({\r\n      variant: 'info',\r\n      message:\r\n        i18next.t(translations.BarcodeScanModalBody) +\r\n        ' ' +\r\n        action.payload.data,\r\n    }),\r\n  );\r\n  try {\r\n    // // in case and the barcode is a valid internal url - it should be opened in the current window\r\n    // const path = parseBarcodeURL(action, appSettings);\r\n    // if (path !== undefined) {\r\n    //   // perform full navigation since not all target pages are react compatible\r\n    //   // replace with yeild put(push(path)) when asset details + search are converted to react\r\n    //   globalThis.window.location.href = toRootedURL(path);\r\n    //   return;\r\n    // }\r\n\r\n    // // first lookup room by it's external barcode\r\n    // let roomId = yield call(getRoomByExternalBarcode, action.payload.data);\r\n    // if (roomId !== undefined) {\r\n    //   window.location.href = toRootedURL('/Assets/default.aspx', {\r\n    //     roomid: roomId,\r\n    //   });\r\n    //   return;\r\n    // }\r\n    const scanResult = parseBarcode(action.payload.data, appSettings);\r\n    if (scanResult === undefined) {\r\n      yield put(\r\n        actions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.BarcodeNotFoundEx),\r\n        }),\r\n      );\r\n      return;\r\n    } else {\r\n      switch (scanResult.type) {\r\n        case ScanTemplateResult.Asset:\r\n          yield put(push(''));\r\n          yield put(replace(`Assets/Details?id=${scanResult.InternalCode}`));\r\n          return;\r\n        case ScanTemplateResult.Internal:\r\n          let roomId = yield call(\r\n            getRoomByExternalBarcode,\r\n            scanResult.InternalCode ?? action.payload.data,\r\n          );\r\n          if (roomId !== undefined) {\r\n            window.location.href = toRootedURL('/Assets/Public', {\r\n              roomid: roomId,\r\n            });\r\n            return;\r\n          }\r\n          break;\r\n        case ScanTemplateResult.External:\r\n          console.error(\r\n            `${action.type}`,\r\n            action.payload,\r\n            'scanned external URL',\r\n          );\r\n          yield put(\r\n            actions.addNotification({\r\n              variant: 'error',\r\n              message: 'Error: Scanned external URL',\r\n            }),\r\n          );\r\n          return;\r\n      }\r\n    }\r\n\r\n    // TODO: add other barcode lookups below\r\n\r\n    yield put(\r\n      actions.addNotification({\r\n        variant: 'error',\r\n        message: i18next.t(translations.BarcodeNotFoundEx),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    console.error(`${action.type}`, action.payload, error);\r\n  }\r\n}\r\nasync function getRoomByExternalBarcode(barcode: string) {\r\n  try {\r\n    var response: IODataQueryResponse<IRoomDto> = await httpClient.get(\r\n      '/api/odata/v4/rooms',\r\n      {\r\n        $top: 1,\r\n        $select: 'Id',\r\n        $filter: new Condition<IRoomDto>(\r\n          'ExternalBarcode',\r\n          ODataOperators.Equals,\r\n          barcode,\r\n        ).toString(),\r\n      },\r\n    );\r\n    var roomId = response.value[0]?.Id;\r\n    return roomId;\r\n  } catch (error) {}\r\n}\r\n// function parseBarcodeURL(action, appSettings) {\r\n//   try {\r\n//     const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n//     var url = new URL(action.payload.data);\r\n//     var isLocal = url\r\n//       .toString()\r\n//       .toLowerCase()\r\n//       .startsWith(appSettings.PublicBaseUrl.toLowerCase());\r\n//     if (!isLocal) {\r\n//       console.error(`${action.type}`, action.payload, 'scanned external URL');\r\n//       return;\r\n//     }\r\n//     const path = toRelative(publicBaseURL, url);\r\n//     return path;\r\n//   } catch (error) {\r\n//     return undefined;\r\n//   }\r\n// }\r\nfunction* handleFullScreenChange() {\r\n  const isFullScreen = document.fullscreenElement !== null;\r\n  if (isFullScreen) {\r\n    yield put(actions.enterFullScreen_Success());\r\n  } else {\r\n    yield put(actions.exitFullScreen_Success());\r\n  }\r\n}\r\nfunction* doEnterFullScreen(action: PayloadAction<{ selector?: string }>) {\r\n  const log = getLogger('doEnterFullScreen');\r\n  const selector = action.payload.selector;\r\n  const x =\r\n    selector === undefined\r\n      ? document.documentElement\r\n      : document.querySelector(selector);\r\n  const fullScreenElement = (x ?? document.documentElement) as HTMLElement & {\r\n    mozRequestFullScreen(): Promise<void>;\r\n    webkitRequestFullscreen(): Promise<void>;\r\n    msRequestFullscreen(): Promise<void>;\r\n  };\r\n  try {\r\n    yield call;\r\n    if (fullScreenElement.requestFullscreen) {\r\n      fullScreenElement.requestFullscreen();\r\n    }\r\n    if (fullScreenElement.webkitRequestFullscreen) {\r\n      fullScreenElement.webkitRequestFullscreen();\r\n    }\r\n    if (fullScreenElement.mozRequestFullScreen) {\r\n      fullScreenElement.mozRequestFullScreen();\r\n    }\r\n    if (fullScreenElement.msRequestFullscreen) {\r\n      fullScreenElement.msRequestFullscreen();\r\n    }\r\n\r\n    yield put(actions.enterFullScreen_Success());\r\n    log.info('Entered FullScreen', fullScreenElement);\r\n  } catch (error) {\r\n    log.info('Error entering full screen mode', error);\r\n    yield put(\r\n      actions.addNotification({\r\n        variant: 'error',\r\n        message: 'Failed to enter full screen mode. ' + String(error),\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doExitFullScreen() {\r\n  const fullScreenExitFunction = document as Document & {\r\n    mozCancelFullScreen(): Promise<void>;\r\n    webkitExitFullscreen(): Promise<void>;\r\n    msExitFullscreen(): Promise<void>;\r\n  };\r\n  if (document.fullscreenElement !== null) {\r\n    if (fullScreenExitFunction.exitFullscreen) {\r\n      fullScreenExitFunction.exitFullscreen();\r\n    } else if (fullScreenExitFunction.mozCancelFullScreen) {\r\n      /* Firefox */\r\n      fullScreenExitFunction.mozCancelFullScreen();\r\n    } else if (fullScreenExitFunction.webkitExitFullscreen) {\r\n      /* Chrome, Safari and Opera */\r\n      fullScreenExitFunction.webkitExitFullscreen();\r\n    } else if (fullScreenExitFunction.msExitFullscreen) {\r\n      /* IE/Edge */\r\n      fullScreenExitFunction.msExitFullscreen();\r\n    }\r\n  }\r\n  yield put(actions.exitFullScreen_Success());\r\n}\r\nfunction* doSetBarcodeScannigTarget(\r\n  action: PayloadAction<ScanTarget | undefined>,\r\n) {\r\n  yield put(actions.barcodeScannigTarget_Success(action.payload));\r\n}\r\nfunction* doShowAllCores(action: PayloadAction<boolean | undefined>) {\r\n  yield put(actions.setShowAllCores(action.payload));\r\n}\r\nfunction* doCollapseSubBar(action: PayloadAction<boolean | undefined>) {\r\n  yield put(actions.setCollapseSubBar(action.payload));\r\n}\r\nfunction* doAgreeTermOfUse(action: PayloadAction<number>) {\r\n  try {\r\n    const result = yield call(\r\n      TermsOfUseAgreementApi.agreeTermsOfUseAgreement,\r\n      action.payload,\r\n    );\r\n    const response = result as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        actions.addNotification({\r\n          variant: 'error',\r\n          message: response.ErrorMessages[0],\r\n        }),\r\n      );\r\n    } else {\r\n      yield put(actions.getAuthenticatedUser(false));\r\n      yield put(actions.navigate('/dashboards'));\r\n    }\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\n\r\nexport function* getAppSettingsFromSaga() {\r\n  yield takeLatest(actions.loadAppSettings.type, getAppSettings);\r\n  yield takeLatest(actions.getAuthenticatedUser.type, getAuthenticatedUser);\r\n  yield takeLatest(actions.loadSiteMapSettings.type, getSiteMapSource);\r\n  yield takeLatest(actions.changeLanguage.type, setLanguage);\r\n  yield takeLatest(actions.loadEventsCount.type, getEventsCount);\r\n  yield takeLatest(\r\n    actions.loadUserProfileSettings.type,\r\n    getUserProfileSettings,\r\n  );\r\n  yield takeLatest(\r\n    actions.updateUserProfileSettings.type,\r\n    updateUserProfileSettings,\r\n  );\r\n  yield takeLatest(actions.setIsAuthenticated.type, doSetIsAuthenticated);\r\n  yield takeLatest(actions.updateExpandedState.type, doUpdateExpandedState);\r\n  // yield takeLatest(\r\n  //   actions.updateExpandedState_Local.type,\r\n  //   doUpdateExpandedState_Local,\r\n  // );\r\n  yield takeLatest(actions.navigate.type, doNavigate);\r\n  yield takeLatest(\r\n    actions.loadGlobalServiceGroupFilter.type,\r\n    doLoadGlobalServiceGroupFilter,\r\n  );\r\n  yield takeLatest(\r\n    actions.saveGlobalServiceGroupFilter.type,\r\n    doSaveGlobalServiceGroupFilter,\r\n  );\r\n  yield takeLatest(\r\n    actions.saveUserProfileSetting.type,\r\n    doSaveUserProfileSetting,\r\n  );\r\n  yield takeLatest(actions.saveFilter.type, doSaveFilter);\r\n  yield takeLatest(actions.loadSystemSettings.type, getSystemSettings);\r\n  yield takeLatest(\r\n    actions.loadLoginSystemSettings.type,\r\n    getLoginSystemSettings,\r\n  );\r\n  // currently prefetch only depends on the modules (appSettings), so it made sense to fire those immediately after the modules availability\r\n  yield takeLatest(\r\n    actions.appSettingsLoaded.type,\r\n    doPrefetchConfigurableColumns,\r\n  );\r\n  yield takeLatest(actions.savePageSize.type, doSavePageSize);\r\n  yield takeLatest(\r\n    actions.updateMyListSelected_Local.type,\r\n    doUpdateMyListSelected,\r\n  );\r\n  yield takeLatest(BARCODE_SCANNED, doBarcodeScan);\r\n  yield takeLatest(actions.saveCardsMode.type, doSaveCardsMode);\r\n  const fullScreenChannel = eventChannel(emitter => {\r\n    document.addEventListener('fullscreenchange', emitter);\r\n    return () => document.removeEventListener('fullscreenchange', emitter);\r\n  });\r\n  yield takeEvery(fullScreenChannel, handleFullScreenChange);\r\n  yield takeLeading(actions.enterFullScreen, doEnterFullScreen);\r\n  yield takeLeading(actions.exitFullScreen, doExitFullScreen);\r\n  yield takeLatest(\r\n    actions.setBarcodeScannigTarget.type,\r\n    doSetBarcodeScannigTarget,\r\n  );\r\n  yield takeLatest(actions.showAllCores.type, doShowAllCores);\r\n  yield takeLatest(actions.collapseSubBar.type, doCollapseSubBar);\r\n  yield takeLatest(actions.agreeTermOfUse.type, doAgreeTermOfUse);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { AppSettings, AppSettingsErrorType } from 'types/AppSettings';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity } from 'types/common';\r\nimport { Notification } from 'types/Notification';\r\nimport { SiteMapSettings } from 'types/SiteMapSettings';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { getAppSettingsFromSaga } from './saga';\r\nimport {\r\n  AppSettingsState,\r\n  LoginSettingsModel,\r\n  LoginTypes,\r\n  SaveUserProfileSettingAction,\r\n  ScanTarget,\r\n} from './types';\r\nimport * as H from 'history';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\n\r\nexport const initialState: AppSettingsState = {\r\n  error: null,\r\n  loadingAppSettings: true,\r\n  loadingAuthenticatedUser: false,\r\n  loadingSiteMapSettings: false,\r\n  loadingEventsCount: false,\r\n  loadingUserProfileSettings: false,\r\n  appSettings: null,\r\n  notifications: [],\r\n  siteMapSettings: null,\r\n  siteMapProvider: null,\r\n  eventsCount: 0,\r\n  userProfileSettings: [],\r\n  updatedUserProfileSettings: false,\r\n  isExpanded: false,\r\n  globalServiceGroupFilter: undefined,\r\n  showGlobalServiceGroupFilter: false,\r\n  systemSettings: [],\r\n  loadingSystemSettings: false,\r\n  isAuthenticated: undefined,\r\n  showGlobalServiceGroupsAsList: false,\r\n  isFullScreen: false,\r\n  barcodeScanTarget: ScanTarget.All,\r\n  showAllCores: false,\r\n  subBarCollapsed: undefined,\r\n  updatedExpandState: undefined,\r\n};\r\n\r\nlet notificationsCount = 1;\r\nconst slice = createSlice({\r\n  name: 'appSettings',\r\n  initialState,\r\n  reducers: {\r\n    loadAppSettings(state, action: PayloadAction<boolean>) {\r\n      state.loadingAppSettings = true;\r\n    },\r\n    appSettingsLoaded(state, action: PayloadAction<AppSettings>) {\r\n      const appSettings = action.payload;\r\n      state.appSettings = appSettings;\r\n      state.loadingAppSettings = false;\r\n    },\r\n    loadError(state, action: PayloadAction<AppSettingsErrorType>) {\r\n      //TODO: process error state - show feedback?\r\n      state.error = action.payload.message;\r\n      state.loadingAppSettings = false;\r\n    },\r\n    getAuthenticatedUser(state, action: PayloadAction<boolean>) {\r\n      state.loadingAuthenticatedUser = true;\r\n      state.authenticatedUser = undefined;\r\n    },\r\n    getAuthenticatedUser_Success(\r\n      state,\r\n      action: PayloadAction<IAuthenticatedUser>,\r\n    ) {\r\n      const LoginType = LoginTypes.Password;\r\n      state.loadingAuthenticatedUser = false;\r\n      state.isAuthenticated = true;\r\n      state.authenticatedUser = { ...action.payload, LoginType };\r\n      state.currentLanguage = action.payload.Language;\r\n    },\r\n    getAuthenticatedUser_Error(state, action: PayloadAction<string>) {\r\n      state.loadingAuthenticatedUser = false;\r\n    },\r\n    setIsAuthenticated(state, action: PayloadAction<boolean>) {},\r\n    IsAuthenticatedChanged(state, action: PayloadAction<boolean>) {\r\n      state.isAuthenticated = action.payload;\r\n    },\r\n    changeLanguage(state, action: PayloadAction<string>) {},\r\n    languageChanged(state, action: PayloadAction<string>) {\r\n      state.currentLanguage = action.payload;\r\n    },\r\n    addNotification(state, action: PayloadAction<Notification>) {\r\n      // remove notification with the same key if exists\r\n      const key = action.payload.key ?? notificationsCount++;\r\n      const index = state.notifications.findIndex(x => x.key === key);\r\n      if (index >= 0) {\r\n        state.notifications.splice(index, 1);\r\n      }\r\n      // add new notification\r\n      state.notifications.push({\r\n        key: key,\r\n        ...action.payload,\r\n      });\r\n    },\r\n    addNotifications(state, action: PayloadAction<Notification[]>) {\r\n      action.payload.forEach(item =>\r\n        state.notifications.push({\r\n          key: notificationsCount++,\r\n          ...item,\r\n        }),\r\n      );\r\n    },\r\n    removeNotification(state, action: PayloadAction<any>) {\r\n      const index = state.notifications.findIndex(\r\n        x => x.key === action.payload,\r\n      );\r\n      if (index >= 0) {\r\n        state.notifications.splice(index, 1);\r\n      }\r\n    },\r\n    loadSiteMapSettings(state) {\r\n      state.loadingSiteMapSettings = true;\r\n    },\r\n    loadSiteMapSettings_Success(state, action: PayloadAction<SiteMapSettings>) {\r\n      const siteMap = action.payload;\r\n      state.siteMapSettings = siteMap;\r\n      state.loadingSiteMapSettings = false;\r\n    },\r\n    loadSiteMapSettings_Error(state, action: PayloadAction<string>) {\r\n      state.error = action.payload;\r\n      state.loadingSiteMapSettings = false;\r\n    },\r\n    saveUserProfileSetting(state, action: SaveUserProfileSettingAction) {\r\n      function upsert<T>(array: Array<T>, item: T, keyFn: (T) => string) {\r\n        const key = keyFn(item);\r\n        const e = array.find(a => keyFn(a) === key);\r\n        if (e === undefined) {\r\n          return array.push(item);\r\n        } else {\r\n          Object.assign(e, item);\r\n        }\r\n      }\r\n      upsert<UserProfileSettings>(\r\n        state.userProfileSettings,\r\n        {\r\n          ...{\r\n            Id: 0,\r\n            Name: null,\r\n            AdGroup: null,\r\n            DefaultGroups: null,\r\n            Enabled: true,\r\n            IsMultiple: false,\r\n            Selected: false,\r\n            StaffEnabled: false,\r\n          },\r\n          ...action.payload,\r\n        },\r\n        f => f.Key?.toLowerCase(),\r\n      );\r\n    },\r\n    saveFilter(\r\n      state,\r\n      action: PayloadAction<{\r\n        key: string;\r\n        location: H.LocationDescriptorObject<unknown>;\r\n        search: string;\r\n      }>,\r\n    ) {\r\n      const itemIndex =\r\n        state.userProfileSettings.findIndex(\r\n          item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n        ) ?? -1;\r\n      if (itemIndex >= 0) {\r\n        let updatedItem = state.userProfileSettings.find(\r\n          item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n        );\r\n        if (!!updatedItem) {\r\n          updatedItem.Value = action.payload.search;\r\n          state.userProfileSettings.splice(itemIndex, 1);\r\n          state.userProfileSettings.push(updatedItem);\r\n        }\r\n      } else {\r\n        let item = {\r\n          UserName: state.authenticatedUser?.DisplayName,\r\n          Id: 0,\r\n          Key: action.payload.key,\r\n          Value: action.payload.search,\r\n        } as UserProfileSettings;\r\n        state.userProfileSettings.push(item);\r\n      }\r\n      // state.userProfileSettings.forEach(item => {\r\n      //   if (item.Key.toLowerCase() === action.payload.key.toLowerCase()) {\r\n      //     Object.assign({}, item, { Value: action.payload.search });\r\n      //   }\r\n      // });\r\n      // (\r\n      //   state.siteMapProvider ?? new SiteMapProvider(state.siteMapSettings)\r\n      // ).updatePath(action.payload.location.pathname, action.payload.search);\r\n      state.siteMapSettings?.userNodes\r\n        .map(f => f.ChildNodes)\r\n        .flat()\r\n        .forEach(element => {\r\n          if (element !== undefined) {\r\n            const reactUrl = element.reactUrl;\r\n            if (reactUrl !== undefined && reactUrl !== null) {\r\n              const elementPath = reactUrl.split('?')[0] ?? reactUrl;\r\n              if (elementPath === action.payload.location.pathname) {\r\n                element.reactUrl = `${action.payload.location.pathname}?${action.payload.search}`;\r\n                element.Url = `${action.payload.location.pathname}?${action.payload.search}`;\r\n              }\r\n            }\r\n          }\r\n        });\r\n    },\r\n    savePageSize(state, action: PayloadAction<{ key: string; value: number }>) {\r\n      const itemIndex =\r\n        state.userProfileSettings.findIndex(\r\n          item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n        ) ?? -1;\r\n      if (itemIndex >= 0) {\r\n        let updatedItem = state.userProfileSettings.find(\r\n          item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n        );\r\n        if (!!updatedItem) {\r\n          updatedItem.Value = action.payload.value.toString();\r\n          state.userProfileSettings.splice(itemIndex, 1);\r\n          state.userProfileSettings.push(updatedItem);\r\n        }\r\n      } else {\r\n        let item = {\r\n          UserName: state.authenticatedUser?.DisplayName,\r\n          Id: 0,\r\n          Key: action.payload.key,\r\n          Value: action.payload.value.toString(),\r\n        } as UserProfileSettings;\r\n        state.userProfileSettings.push(item);\r\n      }\r\n    },\r\n    saveCardsMode(\r\n      state,\r\n      action: PayloadAction<{ key: string; value: boolean }>,\r\n    ) {\r\n      const itemIndex =\r\n        state.userProfileSettings.findIndex(\r\n          item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n        ) ?? -1;\r\n      if (itemIndex >= 0) {\r\n        let updatedItem = state.userProfileSettings.find(\r\n          item => item.Key.toLowerCase() === action.payload.key.toLowerCase(),\r\n        );\r\n        if (!!updatedItem) {\r\n          updatedItem.Value = action.payload.value.toString();\r\n          state.userProfileSettings.splice(itemIndex, 1);\r\n          state.userProfileSettings.push(updatedItem);\r\n        }\r\n      } else {\r\n        let item = {\r\n          UserName: state.authenticatedUser?.DisplayName,\r\n          Id: 0,\r\n          Key: action.payload.key,\r\n          Value: action.payload.value.toString(),\r\n        } as UserProfileSettings;\r\n        state.userProfileSettings.push(item);\r\n      }\r\n    },\r\n    loadEventsCount(state) {\r\n      state.loadingEventsCount = true;\r\n    },\r\n    loadEventsCount_Success(state, action: PayloadAction<number>) {\r\n      state.eventsCount = action.payload;\r\n      state.loadingEventsCount = false;\r\n    },\r\n    loadEventsCount_Error(state, action: PayloadAction<string>) {\r\n      state.error = action.payload;\r\n      state.loadingEventsCount = false;\r\n    },\r\n\r\n    loadSystemSettings(state) {\r\n      state.loadingSystemSettings = true;\r\n    },\r\n    loadSystemSettings_Success(state, action: PayloadAction<SettingModel[]>) {\r\n      let data: any = action.payload;\r\n      state.systemSettings = !!data.value\r\n        ? (data.value as SettingModel[])\r\n        : (data as SettingModel[]); /* action.payload; */\r\n      state.loadingSystemSettings = false;\r\n    },\r\n    loadSystemSettings_Error(state, action: PayloadAction<string>) {\r\n      state.error = action.payload;\r\n      state.loadingSystemSettings = false;\r\n    },\r\n\r\n    loadLoginSystemSettings(state) {\r\n      state.loadingSystemSettings = true;\r\n    },\r\n\r\n    loadLoginSystemSettings_Success(\r\n      state,\r\n      action: PayloadAction<LoginSettingsModel>,\r\n    ) {\r\n      let data: any = action.payload;\r\n      data.settings.forEach(s => {\r\n        let ss = state.systemSettings.find(f => f.Id === s.Id);\r\n        if (ss !== undefined) {\r\n          ss.Value = s.Value;\r\n        } else {\r\n          state.systemSettings.push(s);\r\n        }\r\n      });\r\n\r\n      if (state.appSettings !== null) {\r\n        data.Modules.forEach(m => {\r\n          if (state.appSettings?.Modules.find(f => f === m) === undefined) {\r\n            state.appSettings?.Modules.push(m);\r\n          }\r\n        });\r\n        state.appSettings.LoginScreenCompanyLogo = data.LoginScreenCompanyLogo;\r\n        state.appSettings.LoginScreenCompanyLogoLink =\r\n          data.LoginScreenCompanyLogoLink;\r\n        state.appSettings.LoginScreenCompanyLogoHeight =\r\n          data.LoginScreenCompanyLogoHeight;\r\n        state.appSettings.ShowForgotPassword = data.ShowForgotPassword;\r\n        state.appSettings.Help_Login = data.Help_Login;\r\n      } else {\r\n        let settings = {} as AppSettings;\r\n        settings.LoginScreenCompanyLogo = data.LoginScreenCompanyLogo;\r\n        settings.LoginScreenCompanyLogoLink = data.LoginScreenCompanyLogoLink;\r\n        settings.LoginScreenCompanyLogoHeight =\r\n          data.LoginScreenCompanyLogoHeight;\r\n        settings.ShowForgotPassword = data.ShowForgotPassword;\r\n        settings.Help_Login = data.Help_Login;\r\n        settings.Modules = data.Modules;\r\n        settings.WebVersion = data.WebVersion;\r\n        settings.LastCodeUpdate = data.LastCodeUpdate;\r\n        state.appSettings = settings;\r\n      }\r\n      state.loadingSystemSettings = false;\r\n    },\r\n    loadLoginSystemSettings_Error(state, action: PayloadAction<string>) {\r\n      state.error = action.payload;\r\n      state.loadingSystemSettings = false;\r\n    },\r\n\r\n    loadUserProfileSettings(state) {\r\n      state.loadingUserProfileSettings = true;\r\n    },\r\n    loadUserProfile_Success(\r\n      state,\r\n      action: PayloadAction<UserProfileSettings[]>,\r\n    ) {\r\n      state.userProfileSettings = action.payload;\r\n      state.loadingUserProfileSettings = false;\r\n    },\r\n    loadUserProfile_Error(state, action: PayloadAction<string>) {\r\n      state.error = action.payload;\r\n      state.loadingUserProfileSettings = false;\r\n    },\r\n    updateUserProfileSettings(\r\n      state,\r\n      action: PayloadAction<{ key: string; model: UserProfileSettings }>,\r\n    ) {\r\n      state.updatedUserProfileSettings = true;\r\n    },\r\n    updateUserProfile_Success(\r\n      state,\r\n      action: PayloadAction<UserProfileSettings>,\r\n    ) {\r\n      state.updatedUserProfileSettings = false;\r\n      const itemIndex =\r\n        state.userProfileSettings.findIndex(\r\n          item => item.Key === action.payload.Key,\r\n        ) ?? -1;\r\n      if (itemIndex >= 0) {\r\n        state.userProfileSettings.splice(itemIndex, 1);\r\n        state.userProfileSettings.push(action.payload);\r\n      } else {\r\n        state.userProfileSettings.push(action.payload);\r\n      }\r\n    },\r\n    updateUserProfile_Error(state, action: PayloadAction<string>) {\r\n      state.updatedUserProfileSettings = false;\r\n    },\r\n    updateExpandedState(state, action: PayloadAction<boolean>) {\r\n      state.updatedExpandState = true;\r\n    },\r\n    updateExpandedState_Success(\r\n      state,\r\n      action: PayloadAction<UserProfileSettings>,\r\n    ) {\r\n      state.updatedExpandState = false;\r\n      const itemIndex =\r\n        state.userProfileSettings.findIndex(\r\n          item => item.Key === action.payload.Key,\r\n        ) ?? -1;\r\n      if (itemIndex >= 0) {\r\n        state.userProfileSettings.splice(itemIndex, 1);\r\n        state.userProfileSettings.push(action.payload);\r\n      } else {\r\n        state.userProfileSettings.push(action.payload);\r\n      }\r\n    },\r\n    updateExpandedState_Error(state, action: PayloadAction<any>) {\r\n      state.updatedExpandState = false;\r\n    },\r\n    updateExpandedState_Local(state, action: PayloadAction<boolean>) {\r\n      state.isExpanded = action.payload;\r\n    },\r\n    // setExpandedState_Local(state, action: PayloadAction<boolean>) {\r\n    //   state.isExpanded = action.payload;\r\n    // },\r\n    navigate(\r\n      state,\r\n      action: PayloadAction<string | H.LocationDescriptorObject<unknown>>,\r\n    ) {},\r\n\r\n    showGlobalServiceGroupFilter(state, action: PayloadAction<boolean>) {\r\n      state.showGlobalServiceGroupFilter = action.payload;\r\n    },\r\n    loadGlobalServiceGroupFilter(state, action: PayloadAction) {},\r\n    loadGlobalServiceGroupFilter_Success(\r\n      state,\r\n      action: PayloadAction<Entity<number>[]>,\r\n    ) {\r\n      state.globalServiceGroupFilter = action.payload;\r\n    },\r\n    saveGlobalServiceGroupFilter(\r\n      state,\r\n      action: PayloadAction<Entity<number>[]>,\r\n    ) {\r\n      state.globalServiceGroupFilter = action.payload;\r\n    },\r\n    saveGlobalServiceGroupFilter_Success(\r\n      state,\r\n      action: PayloadAction<Entity<number>[]>,\r\n    ) {\r\n      state.globalServiceGroupFilter = action.payload;\r\n    },\r\n    setShowGlobalServiceGroupsAsList(state, action: PayloadAction<boolean>) {\r\n      state.showGlobalServiceGroupsAsList = action.payload;\r\n    },\r\n    updateMyListSelected_Local(\r\n      state,\r\n      action: PayloadAction<SavedViewSelected | undefined>,\r\n    ) {\r\n      console.log('myListSelected', action.payload);\r\n    },\r\n    updateMyList(state, action: PayloadAction<SavedViewSelected | undefined>) {\r\n      if (state.appSettings !== null) {\r\n        // state.appSettings.myListSelected = action.payload;\r\n      }\r\n    },\r\n    enterFullScreen(state, action: PayloadAction<{ selector?: string }>) {},\r\n    exitFullScreen(state, action: PayloadAction) {},\r\n    enterFullScreen_Success(state, action: PayloadAction) {\r\n      state.isFullScreen = true;\r\n    },\r\n    exitFullScreen_Success(state, action: PayloadAction) {\r\n      state.isFullScreen = false;\r\n    },\r\n    enterFullScreen_Error(\r\n      state,\r\n      action: PayloadAction<{ selector: string }>,\r\n    ) {},\r\n    exitFullScreen_Error(state, action: PayloadAction<{ selector: string }>) {},\r\n    setBarcodeScannigTarget(\r\n      state,\r\n      action: PayloadAction<ScanTarget | undefined>,\r\n    ) {},\r\n    barcodeScannigTarget_Success(\r\n      state,\r\n      action: PayloadAction<ScanTarget | undefined>,\r\n    ) {\r\n      state.barcodeScanTarget = action.payload;\r\n    },\r\n    barcodeScannigTarget_Error(state, action: PayloadAction) {\r\n      state.barcodeScanTarget = undefined;\r\n    },\r\n    showAllCores(state, action: PayloadAction<boolean | undefined>) {},\r\n    setShowAllCores(state, action: PayloadAction<boolean | undefined>) {\r\n      state.showAllCores = action.payload;\r\n    },\r\n    collapseSubBar(state, action: PayloadAction<boolean | undefined>) {},\r\n    setCollapseSubBar(state, action: PayloadAction<boolean | undefined>) {\r\n      state.subBarCollapsed = action.payload;\r\n    },\r\n    agreeTermOfUse(state, action: PayloadAction<number>) {},\r\n  },\r\n});\r\n\r\nexport const { actions: appSettingsActions } = slice;\r\n\r\nexport const useAppSettingsSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: getAppSettingsFromSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useAppSettingsSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import {\r\n  Button as MatButton,\r\n  ButtonProps as MatButtonProps,\r\n  CircularProgress,\r\n} from '@material-ui/core/index';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { capitalize } from 'lodash';\r\nimport * as React from 'react';\r\n// import { generatePath, useHistory } from 'react-router-dom';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport clsx from 'clsx';\r\nimport { toLocationDescriptor } from 'app/components/BasicLinks/Link';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nexport type ButtonsVariant =\r\n  | 'main'\r\n  | 'gray'\r\n  | 'accent'\r\n  | 'white'\r\n  | 'ghost'\r\n  | 'ghostColor'\r\n  | 'danger'\r\n  | 'text'\r\n  | 'textGray';\r\nexport interface ButtonProps extends Omit<MatButtonProps, 'variant' | 'href'> {\r\n  processing?: boolean;\r\n  /**\r\n   * Variants overview:\r\n   * main - Regular in figma — main color button, used for CTA (call-to-action) buttons\r\n   * white - Secondary White in figma — White button with borders. Used as a button for secondary actions across all application.\r\n   * ghost - Ghost Gray in figma — button that in the Resting state looks like a simple text , but it contains internal paddings and color background on hover and focus states\r\n   * ghostColor - Ghost Color in figma — button that in the Resting state looks like a link/text button , but it contains internal paddings and color background on hover and focus states\r\n   * accent - Accent in figma — Alternative button for the CTA actions, used on the screens that already contain several panels and too many primary buttons. However, this style is now barely used and is candidate to deprecation.\r\n   * gray - Secondary Gray in figma — Gray button style that before used in filters.  This style is now barely used and is candidate to deprecation.\r\n   * danger - Primary Danger in figma — Red filled primary button that is used in the confirmation popups and screens only\r\n   * warning - Primary Alert in figma — Alert filled button that is used to warn users on the section when we need to pay attention about some behavior in the component so user should click on it to fix some issue.\r\n   *           Currntly is used to warn about conflict in the Configurable columns, so user should resolve it.\r\n   * text - Text Button in figma - Have similar behavior to Anchor Link.\r\n   * textGray - Text Button in figma - The same as text varian only styled as grey text link.\r\n   */\r\n  variant?: ButtonsVariant;\r\n  href?: string | IPathAndQuery;\r\n  component?: React.ElementType;\r\n  to?: string | IPathAndQuery;\r\n  target?: string;\r\n}\r\n\r\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n  (\r\n    {\r\n      children,\r\n      disabled,\r\n      processing,\r\n      size = 'medium',\r\n      variant = 'main',\r\n      href,\r\n      component,\r\n      title,\r\n      to,\r\n      ...props\r\n    }: ButtonProps,\r\n    ref,\r\n  ) => {\r\n    // const history = useHistory();\r\n    const dispatch = useDispatch();\r\n    const { actions: appActions } = useAppSettingsSlice();\r\n    const absolutePath =\r\n      href === undefined\r\n        ? undefined\r\n        : typeof href === 'string'\r\n        ? toRootedURL(href)\r\n        : toRootedURL(\r\n            (href as IPathAndQuery).path,\r\n            (href as IPathAndQuery).search,\r\n          );\r\n    const handleClick = (e: any) => {\r\n      if (props.onClick) {\r\n        props.onClick(e);\r\n      }\r\n      if (!!to) {\r\n        let toto = typeof to === 'string' ? to : toLocationDescriptor(to);\r\n        dispatch(appActions.navigate(toto));\r\n        //history.push(toto);\r\n      }\r\n    };\r\n    return title ? (\r\n      <>\r\n        {/*<WithTitle title={title}>*/}\r\n        <Tooltip title={title}>\r\n          <span>\r\n            <MatButton\r\n              disableRipple\r\n              disableFocusRipple\r\n              disableTouchRipple\r\n              variant={\r\n                variant === 'text' || variant === 'textGray'\r\n                  ? 'text'\r\n                  : 'contained'\r\n              }\r\n              size={size}\r\n              disabled={(processing || disabled) ?? false}\r\n              ref={ref}\r\n              component={component ?? !!absolutePath ? 'a' : 'button'}\r\n              onClick={event => {\r\n                handleClick(event);\r\n              }}\r\n              className={clsx(\r\n                props.className,\r\n                `variant${capitalize(variant)}${\r\n                  props.startIcon !== undefined ? ' hasStartIcon' : ''\r\n                }${props.endIcon !== undefined ? ' hasEndIcon' : ''}`,\r\n              )}\r\n              href={absolutePath}\r\n              {...props}\r\n            >\r\n              <span className={'buttonLabel'}>{children}</span>\r\n\r\n              {processing && <CircularProgress size={16} />}\r\n            </MatButton>\r\n          </span>\r\n        </Tooltip>\r\n        {/*</WithTitle>*/}\r\n      </>\r\n    ) : (\r\n      <MatButton\r\n        disableRipple\r\n        disableFocusRipple\r\n        disableTouchRipple\r\n        variant={\r\n          variant === 'text' || variant === 'textGray' ? 'text' : 'contained'\r\n        }\r\n        size={size}\r\n        disabled={(processing || disabled) ?? false}\r\n        ref={ref}\r\n        component={component ?? !!absolutePath ? 'a' : 'button'}\r\n        onClick={event => {\r\n          handleClick(event);\r\n        }}\r\n        className={clsx(\r\n          props.className,\r\n          `variant${capitalize(variant)}${\r\n            props.startIcon !== undefined ? ' hasStartIcon' : ''\r\n          }${props.endIcon !== undefined ? ' hasEndIcon' : ''}`,\r\n        )}\r\n        href={absolutePath}\r\n        {...props}\r\n      >\r\n        <span className={'buttonLabel'}>{children}</span>\r\n\r\n        {processing && <CircularProgress size={20} />}\r\n      </MatButton>\r\n    );\r\n  },\r\n);\r\n","import BasicTypography, { BasicTypographyProps } from './BasicTypography';\r\n\r\nexport function H1(props: BasicTypographyProps) {\r\n  const { children, ...other } = props;\r\n  return (\r\n    <BasicTypography variant=\"h1\" {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport function H2(props: BasicTypographyProps) {\r\n  const { children, ...other } = props;\r\n  return (\r\n    <BasicTypography variant=\"h2\" {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport function H3(props: BasicTypographyProps) {\r\n  const { children, ...other } = props;\r\n  return (\r\n    <BasicTypography variant=\"h3\" {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport function H4(props: BasicTypographyProps) {\r\n  const { children, ...other } = props;\r\n  return (\r\n    <BasicTypography variant=\"h4\" {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport interface SubTitleProps extends BasicTypographyProps {\r\n  size?: 'small' | 'medium';\r\n  children: React.ReactNode;\r\n}\r\nexport function SubTitle(props: SubTitleProps) {\r\n  const { size, children, ...other } = props;\r\n  const subtitleVarian = size === 'small' ? 'subtitle2' : 'subtitle1';\r\n  return (\r\n    <BasicTypography variant={subtitleVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\n\r\nexport interface BodyProps extends BasicTypographyProps {\r\n  size?: 'small' | 'medium' | 'large';\r\n  bold?: boolean;\r\n  children: React.ReactNode;\r\n}\r\nexport function Body(props: BodyProps) {\r\n  const { size, bold, children, ...other } = props;\r\n  const bodyVarian =\r\n    size === 'large'\r\n      ? bold\r\n        ? 'boldL'\r\n        : 'bodyL'\r\n      : size === 'small'\r\n      ? bold\r\n        ? 'boldS'\r\n        : 'bodyS'\r\n      : bold\r\n      ? 'boldM'\r\n      : 'bodyM';\r\n  return (\r\n    <BasicTypography variant={bodyVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\n\r\nexport interface CaptionProps extends BasicTypographyProps {\r\n  bold?: boolean;\r\n  children: React.ReactNode;\r\n}\r\nexport function Caption(props: CaptionProps) {\r\n  const { bold, children, ...other } = props;\r\n  const captionVarian = bold ? 'captionBold' : 'captionRegular';\r\n  return (\r\n    <BasicTypography variant={captionVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport interface UppercaseProps extends BasicTypographyProps {\r\n  children: React.ReactNode;\r\n}\r\nexport function Uppercase(props: UppercaseProps) {\r\n  const { children, ...other } = props;\r\n  return (\r\n    <BasicTypography variant=\"uppercase\" {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport interface TipsProps extends BasicTypographyProps {\r\n  bold?: boolean;\r\n  children: React.ReactNode;\r\n}\r\nexport function Tips(props: TipsProps) {\r\n  const { bold, children, ...other } = props;\r\n  const tipsVarian = bold ? 'tipsBold' : 'tipsRegular';\r\n  return (\r\n    <BasicTypography variant={tipsVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport interface InputLabelProps extends BasicTypographyProps {\r\n  size?: 'xs' | 'medium';\r\n  children: React.ReactNode;\r\n}\r\nexport function InputLabel(props: InputLabelProps) {\r\n  const { size, children, ...other } = props;\r\n  const inputLabelVarian = size === 'xs' ? 'inputLabelXS' : 'inputLabelM';\r\n  return (\r\n    <BasicTypography variant={inputLabelVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\nexport interface InputValueProps extends BasicTypographyProps {\r\n  size?: 'small' | 'medium';\r\n  children: React.ReactNode;\r\n}\r\nexport function InputValue(props: InputValueProps) {\r\n  const { size, children, ...other } = props;\r\n  const inputValueVarian = size === 'small' ? 'inputValueS' : 'inputValueM';\r\n  return (\r\n    <BasicTypography variant={inputValueVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\n\r\nexport interface ButtonLabelProps extends BasicTypographyProps {\r\n  size?: 'small' | 'medium';\r\n  children: React.ReactNode;\r\n}\r\nexport function ButtonLabel(props: ButtonLabelProps) {\r\n  const { size, children, ...other } = props;\r\n  const buttonLabeVarian = size === 'small' ? 'buttonS' : 'buttonM';\r\n  return (\r\n    <BasicTypography variant={buttonLabeVarian} {...other}>\r\n      {children}\r\n    </BasicTypography>\r\n  );\r\n}\r\n","import { trimEnd, trimStart } from 'lodash';\r\nimport * as H from 'history';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport fileDownload from 'js-file-download';\r\nimport axios, { AxiosResponse } from 'axios';\r\n\r\nconst PATH_SEPARATOR = '/';\r\nconst ASP_ROOT = '~';\r\nexport function isAbsoluteURL(urlString: string): boolean {\r\n  const lowered = urlString.toLowerCase();\r\n  return ['http://', 'https://'].some(schema => lowered.startsWith(schema));\r\n}\r\nfunction isRooted(path: string): boolean {\r\n  return path.toLowerCase().startsWith(process.env.PUBLIC_URL.toLowerCase());\r\n}\r\nfunction tryCleanASPRoot(path: string): string {\r\n  return path.startsWith(ASP_ROOT) ? path.replace(ASP_ROOT, '') : path;\r\n}\r\nexport function combine(basePath: string, path: string): string {\r\n  var result =\r\n    trimEnd(basePath, PATH_SEPARATOR) +\r\n    PATH_SEPARATOR +\r\n    trimStart(path, PATH_SEPARATOR);\r\n  return result;\r\n}\r\n\r\n/**\r\n * convert relative path to host rooted, e.g. /reservations -> /bkt_webApp/reservations\r\n * @param path\r\n * @returns url usable in an href attribute\r\n */\r\nexport function toRootedURL(path: string, query?: Record<string, any>): string {\r\n  const cpath = tryCleanASPRoot(path);\r\n  const alreadyRoot = isAbsoluteURL(cpath) || isRooted(cpath);\r\n  const rootedpath = alreadyRoot\r\n    ? cpath\r\n    : combine(process.env.PUBLIC_URL, cpath);\r\n  const fullPath =\r\n    query === undefined ? rootedpath : `${rootedpath}?${toQueryString(query)}`;\r\n  return fullPath;\r\n}\r\n\r\n/**\r\n * Converts Record values to string and add to URLSearchParams\r\n * @param p object representation of query string\r\n * @returns URLSearchParams\r\n */\r\nexport function toQueryString(p: Record<string, any>): URLSearchParams {\r\n  var result = new URLSearchParams();\r\n  Object.entries(p)\r\n    .filter(([key, value]) => value !== undefined)\r\n    .forEach(([key, value]) => {\r\n      result.append(key, value);\r\n    });\r\n  return result;\r\n}\r\n\r\nexport function buildURL(path: string, params: Record<string, any>): string {\r\n  var result = [toRootedURL(path), '?', toQueryString(params)].join('');\r\n  return result;\r\n}\r\nexport function toRelative(root: URL, url: URL) {\r\n  if (root.origin !== url.origin) {\r\n    return undefined;\r\n  }\r\n  if (!url.pathname.toLowerCase().startsWith(root.pathname.toLowerCase())) {\r\n    throw new Error('External path found.');\r\n  }\r\n  const rootPath = appendTrailingSlash(root.pathname);\r\n  const pathStart = url.pathname.substr(rootPath.length - 1);\r\n  const result = pathStart + url.search + url.hash;\r\n  return result;\r\n}\r\nexport function appendTrailingSlash(pathname: string) {\r\n  return pathname + (pathname.endsWith('/') ? '' : '/');\r\n}\r\nexport function removeLeadingSlash(pathname: string) {\r\n  if (pathname.startsWith('/')) {\r\n    return pathname.substring(1);\r\n  } else {\r\n    return pathname;\r\n  }\r\n}\r\n\r\n/**\r\n * Provides absoluteURL (e.g. https://foo.bar/baz?foo) given the usual path & search parameters that can be shared/copied\r\n * @param path target pathName\r\n * @param params search parameters\r\n * @returns absolute url\r\n */\r\nexport function useAbsolute(path?: string, toPath?: string) {\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  if (toPath !== undefined) {\r\n    path = toPath;\r\n  }\r\n  if (publicUrl === undefined) {\r\n    return undefined;\r\n  }\r\n  if (path === undefined) {\r\n    return undefined;\r\n  }\r\n  if (isAbsoluteURL(path)) {\r\n    return path;\r\n  }\r\n\r\n  var baseURL = new URL(publicUrl);\r\n  var targetURL = new URL(removeLeadingSlash(path), baseURL);\r\n  return targetURL.toString();\r\n}\r\n\r\n/**\r\n * Converts odata api parameters to export query string\r\n * @param params odata api parameters\r\n * @returns\r\n */\r\nexport function getExportParameters(params: Record<string, any>) {\r\n  const result = { ...params, $format: 'application/xlsx' };\r\n  delete result['$count'];\r\n  delete result['$top'];\r\n  delete result['$skip'];\r\n  return result;\r\n}\r\nexport function getExportForImportParameters(params: Record<string, any>) {\r\n  const result = { ...params };\r\n  delete result['$count'];\r\n  delete result['$top'];\r\n  delete result['$skip'];\r\n  return result;\r\n}\r\nexport function openExportLinkOld(\r\n  path: string,\r\n  params?: Record<string, any>,\r\n): void {\r\n  const url = toRootedURL(path, params);\r\n  window.open(url, '_blank');\r\n}\r\n\r\nexport async function openExportLink(\r\n  path: string,\r\n  params?: Record<string, any>,\r\n): Promise<void> {\r\n  return new Promise(async resolve => {\r\n    const url = path.replace(process.env.PUBLIC_URL, '');\r\n    try {\r\n      const response = await axios.get(url, {\r\n        responseType: 'blob',\r\n        timeout: undefined,\r\n        params: params,\r\n      });\r\n      const cd = response.headers['content-disposition'];\r\n      const filename: string =\r\n        cd !== undefined ? cd.split('filename=')[1] : 'ExportFile.xlsx';\r\n      fileDownload(response.data, filename);\r\n    } catch {}\r\n    resolve();\r\n  });\r\n}\r\n\r\nexport const odataUrlPrefix = '/api/odata/v4/';\r\n\r\nexport type IPathAndQuery = { path: string; search: Record<string, any> };\r\n\r\nexport function getReturnURL(\r\n  location: H.Location,\r\n  defaultReturnURL: string = '/',\r\n): string {\r\n  try {\r\n    const params = new URLSearchParamsCI(location.search);\r\n    const returnURLKey = 'returnURL';\r\n    const value = params.get(returnURLKey);\r\n    return value ?? defaultReturnURL;\r\n  } catch (error) {\r\n    return defaultReturnURL;\r\n  }\r\n}\r\n\r\n/**\r\n * Pipes content-disposition=attachments download links through client side\r\n * @param props\r\n */\r\nexport async function downloadFile(props: {\r\n  path: string;\r\n  defaultFileName?: string;\r\n}) {\r\n  const response = await axios.get(props.path, {\r\n    timeout: 60 * 60 * 1000,\r\n    responseType: 'blob',\r\n  });\r\n  const cd = response.headers['content-disposition'];\r\n  const [, filename] = cd?.split('=');\r\n  fileDownload(\r\n    response.data,\r\n    decodeURIComponent(filename ?? props.defaultFileName),\r\n  );\r\n}\r\n\r\nexport const getFileName = (result: AxiosResponse, defaultName?: string) => {\r\n  const cd = result.headers['content-disposition'];\r\n  const [, filename] = cd?.split('=');\r\n  return filename ?? defaultName;\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity } from 'types/common';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { Notification } from 'types/Notification';\r\nimport { SiteMapProvider, SiteMapSettings } from 'types/SiteMapSettings';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\nimport { buildURL } from 'utils/url-utils';\r\n/* --- STATE --- */\r\n\r\n/**\r\n * AppSettings state interface\r\n * TODO: auto generate based on bkt_webApp.Api.V4.Models.SettingsModel\r\n */\r\nexport interface AppSettingsState {\r\n  error: string | null;\r\n  loadingAppSettings: boolean;\r\n  appSettings: AppSettings | null;\r\n  loadingAuthenticatedUser: boolean;\r\n  loadingSiteMapSettings: boolean;\r\n  authenticatedUser?: IAuthenticatedUser;\r\n  currentLanguage?: string;\r\n  notifications: Notification[];\r\n  siteMapSettings: SiteMapSettings | null;\r\n  siteMapProvider: SiteMapProvider | null;\r\n  eventsCount: number;\r\n  loadingEventsCount: boolean;\r\n  userProfileSettings: UserProfileSettings[];\r\n  loadingUserProfileSettings: boolean;\r\n  updatedUserProfileSettings: boolean;\r\n  isExpanded: boolean;\r\n  systemSettings: SettingModel[];\r\n  loadingSystemSettings: boolean;\r\n  isAuthenticated?: boolean;\r\n  /**\r\n   * List of Service Groups selected by the user in the global service group filter aka Top Sg filter\r\n   */\r\n  globalServiceGroupFilter: Entity<number>[] | undefined;\r\n  showGlobalServiceGroupFilter: boolean;\r\n  showGlobalServiceGroupsAsList: boolean;\r\n  isFullScreen: boolean;\r\n  barcodeScanTarget?: ScanTarget;\r\n  showAllCores?: boolean;\r\n  subBarCollapsed?: boolean;\r\n  updatedExpandState?: boolean;\r\n}\r\n\r\nexport type ContainerState = AppSettingsState;\r\n\r\n/**\r\n * User roles enum - local/Bookit.Data/Enums.cs\r\n */\r\n\r\nexport enum Roles {\r\n  Administrators = 1,\r\n  GroupAdministrators = 2,\r\n  InstituteCoord = 3,\r\n  HeadOfLab = 4,\r\n  CagesAdministrators = 5,\r\n  LabTech = 6,\r\n  FinAdmin = 7,\r\n  RepAdmin = 8,\r\n  InventoryAdmin = 9,\r\n  UserGroupCoord = 10,\r\n  InstrumentEventsAdmin = 11,\r\n  GroupBudgetsAdmin = 12,\r\n  CalendarOnly = 13,\r\n  Readonly = 14,\r\n  LoanDeskManager = 15,\r\n  EquipmentAdministrator = 16,\r\n  UserInquiryAdmin = 17,\r\n  ModelAdmin = 18,\r\n  RoomOnly = 19,\r\n  InvoicesReader = 20,\r\n  KioskAdmin = 21,\r\n  CustomRole = 22,\r\n  BudgetAdmin = 23,\r\n  GroupAdminAffiliated = 24,\r\n  ServiceGroupBudgetsAdmin,\r\n  AnimalAdmin = 25,\r\n  /// <summary>\r\n  /// Users in this role will unlock the large animals operating room pos\r\n  /// </summary>\r\n  LargeAnimalsOperatingRoomUser = 26,\r\n  LargeAnimalsOperatingRoomTechnician = 27,\r\n  LargeAnimalsOperatingRoomVeterinarian = 28,\r\n  CoreBudgetsAdmin = 29,\r\n  ConsumableKiosk = 30,\r\n  CreateNewAssetsAdmin = 31,\r\n}\r\n\r\nexport enum LoginTypes {\r\n  Password,\r\n  InternalId,\r\n}\r\nexport type ISaveUserProfileSettingPayload = Pick<\r\n  UserProfileSettings,\r\n  'Key' | 'Value' | 'UserName' | 'Enabled'\r\n>;\r\nexport type SaveUserProfileSettingAction = PayloadAction<\r\n  ISaveUserProfileSettingPayload\r\n>;\r\nexport interface NoAuthSettings {\r\n  defaultUserGroup?: Entity<string>;\r\n  registrationEnabled?: boolean;\r\n  requiredUserProps: string[];\r\n  hiddenUserProps: string[];\r\n}\r\nexport const anonimusUrls = [\r\n  'registeraccount',\r\n  'assets/public',\r\n  'assets/details',\r\n];\r\nexport enum ScanTarget {\r\n  All,\r\n  Consumables = 1,\r\n  Asset = 2,\r\n  Inventory = 3,\r\n  Login = 4,\r\n}\r\nexport interface BarcodeData {\r\n  data: string;\r\n  key: ScanTarget;\r\n}\r\nexport interface LoginSettingsModel {\r\n  Modules?: KnownModules[];\r\n  settings?: SettingModel[];\r\n  LoginScreenCompanyLogoLink?: string;\r\n  LoginScreenCompanyLogo?: string;\r\n  LoginScreenCompanyLogoHeight?: string;\r\n  ShowForgotPassword?: boolean;\r\n  Help_Login?: string;\r\n  WebVersion?: string;\r\n  LastCodeUpdate?: Date;\r\n}\r\nexport enum ScanTemplateResult {\r\n  Asset,\r\n  Room,\r\n  Location,\r\n  SubLocation,\r\n  Plate,\r\n  External,\r\n  Internal,\r\n}\r\nexport interface BarcodeScanResult {\r\n  url: string;\r\n  type: ScanTemplateResult;\r\n  InternalCode?: string;\r\n  RoomId?: string;\r\n  LocationId?: string;\r\n  SubLocationId?: string;\r\n  PlateId?: string;\r\n  external?: boolean;\r\n}\r\nexport function parseAssetUrl(\r\n  data: string,\r\n  appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n  try {\r\n    // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n    const template =\r\n      appSettings.AssetBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n        ? appSettings.AssetBarcodeRelativeUrlTemplate.split('?').join('/')\r\n        : appSettings.AssetBarcodeRelativeUrlTemplate;\r\n\r\n    const regExpTemplate = template.replace(/:([^\\\\}]+)/g, '(?<$1>\\\\d+)');\r\n\r\n    var url = new URL(data);\r\n    const path = url.pathname + url.search;\r\n    let toCompareUrl =\r\n      path.indexOf('?') >= 0 ? path.split('?').join('/') : path;\r\n    let internalCode: string | undefined = undefined;\r\n    let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n    if (regObject !== null) {\r\n      let groups = regObject.groups;\r\n      if (groups !== undefined) {\r\n        internalCode = groups['internalCode'];\r\n      }\r\n    }\r\n    if (internalCode !== undefined) {\r\n      let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Details.aspx`, {\r\n        InternalCode: internalCode,\r\n      });\r\n      return {\r\n        type: ScanTemplateResult.Asset,\r\n        url: resUrl,\r\n        InternalCode: internalCode,\r\n      } as BarcodeScanResult;\r\n    }\r\n    return undefined;\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n}\r\nfunction parseRoomUrl(\r\n  data: string,\r\n  appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n  try {\r\n    // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n    const template =\r\n      appSettings.RoomBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n        ? appSettings.RoomBarcodeRelativeUrlTemplate.split('?').join('/')\r\n        : appSettings.RoomBarcodeRelativeUrlTemplate;\r\n\r\n    const regExpTemplate = template.replace(\r\n      /\\{\\{([^\\\\}]+)\\}\\}/g,\r\n      '(?<$1>\\\\d+)',\r\n    );\r\n\r\n    var url = new URL(data);\r\n    let toCompareUrl =\r\n      url.pathname.indexOf('?') >= 0\r\n        ? url.pathname.split('?').join('/')\r\n        : url.pathname;\r\n    let roomId: string | undefined = undefined;\r\n    let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n    if (regObject !== null) {\r\n      let groups = regObject.groups;\r\n      if (groups !== undefined) {\r\n        roomId = groups['Id'];\r\n      }\r\n    }\r\n    if (roomId !== undefined) {\r\n      let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Public`, {\r\n        RoomId: roomId,\r\n      });\r\n      return {\r\n        type: ScanTemplateResult.Room,\r\n        url: resUrl,\r\n        RoomId: roomId,\r\n      } as BarcodeScanResult;\r\n    }\r\n    return undefined;\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n}\r\nexport function parseLocationUrl(\r\n  data: string,\r\n  appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n  try {\r\n    // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n    const template =\r\n      appSettings.LocationBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n        ? appSettings.LocationBarcodeRelativeUrlTemplate.split('?').join('/')\r\n        : appSettings.LocationBarcodeRelativeUrlTemplate;\r\n\r\n    const regExpTemplate = template.replace(\r\n      /\\{\\{([^\\\\}]+)\\}\\}/g,\r\n      '(?<$1>\\\\d+)',\r\n    );\r\n\r\n    var url = new URL(data);\r\n    let toCompareUrl =\r\n      url.pathname.indexOf('?') >= 0\r\n        ? url.pathname.split('?').join('/')\r\n        : url.pathname;\r\n    let locationId: string | undefined = undefined;\r\n    let roomId: string | undefined = undefined;\r\n    let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n    if (regObject !== null) {\r\n      let groups = regObject.groups;\r\n      if (groups !== undefined) {\r\n        locationId = groups['Id'];\r\n        roomId = groups['RoomId'];\r\n      }\r\n    }\r\n    if (locationId !== undefined && roomId !== undefined) {\r\n      let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Public`, {\r\n        RoomId: roomId,\r\n        locationid: locationId,\r\n      });\r\n      return {\r\n        type: ScanTemplateResult.Location,\r\n        url: resUrl,\r\n        RoomId: roomId,\r\n        LocationId: locationId,\r\n      } as BarcodeScanResult;\r\n    }\r\n    return undefined;\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n}\r\nexport function parseSubLocationUrl(\r\n  data: string,\r\n  appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n  try {\r\n    // const publicBaseURL = new URL(appSettings.PublicBaseUrl);\r\n    const template =\r\n      appSettings.SubLocationBarcodeRelativeUrlTemplate.indexOf('?') >= 0\r\n        ? appSettings.SubLocationBarcodeRelativeUrlTemplate.split('?').join('/')\r\n        : appSettings.SubLocationBarcodeRelativeUrlTemplate;\r\n\r\n    const regExpTemplate = template.replace(\r\n      /\\{\\{([^\\\\}]+)\\}\\}/g,\r\n      '(?<$1>\\\\d+)',\r\n    );\r\n\r\n    var url = new URL(data);\r\n    let toCompareUrl =\r\n      url.pathname.indexOf('?') >= 0\r\n        ? url.pathname.split('?').join('/')\r\n        : url.pathname;\r\n    let subLocationId: string | undefined = undefined;\r\n    let locationId: string | undefined = undefined;\r\n    let roomId: string | undefined = undefined;\r\n    let regObject = new RegExp(regExpTemplate).exec(toCompareUrl);\r\n    if (regObject !== null) {\r\n      let groups = regObject.groups;\r\n      if (groups !== undefined) {\r\n        subLocationId = groups['Id'];\r\n        locationId = groups['LocationListId'];\r\n        roomId = groups['RoomId'];\r\n      }\r\n    }\r\n    if (\r\n      subLocationId !== undefined &&\r\n      locationId !== undefined &&\r\n      roomId !== undefined\r\n    ) {\r\n      let resUrl = buildURL(`${appSettings.PublicBaseUrl}Assets/Public`, {\r\n        RoomId: roomId,\r\n        locationid: locationId,\r\n        sublocationid: subLocationId,\r\n      });\r\n      return {\r\n        type: ScanTemplateResult.SubLocation,\r\n        url: resUrl,\r\n        RoomId: roomId,\r\n        LocationId: locationId,\r\n        SubLocationId: subLocationId,\r\n      } as BarcodeScanResult;\r\n    }\r\n    return undefined;\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n}\r\n\r\nexport function parseBarcodeURL(\r\n  data: string,\r\n  appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n  try {\r\n    data = data.replace(/&#x3D;/g, '='); // for backward compatibility\r\n    let assetScanned = parseAssetUrl(data, appSettings);\r\n    let subLocationScanned = parseSubLocationUrl(data, appSettings);\r\n    let locationScanned = parseLocationUrl(data, appSettings);\r\n    let roomScanned = parseRoomUrl(data, appSettings);\r\n    if (!!assetScanned) {\r\n      console.debug(assetScanned);\r\n      return assetScanned;\r\n    }\r\n    if (!!subLocationScanned) {\r\n      console.debug(subLocationScanned);\r\n      return subLocationScanned;\r\n    }\r\n    if (!!locationScanned) {\r\n      console.debug(locationScanned);\r\n      return locationScanned;\r\n    }\r\n    if (!!roomScanned) {\r\n      console.debug(roomScanned);\r\n      return roomScanned;\r\n    }\r\n    return undefined;\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n}\r\nexport function parseBarcode(\r\n  data: string,\r\n  appSettings: AppSettings,\r\n): BarcodeScanResult | undefined {\r\n  try {\r\n    // in case when barcode come as URL, try to create url...\r\n    var url = new URL(data);\r\n    var isLocal = url\r\n      .toString()\r\n      .toLowerCase()\r\n      .startsWith(appSettings.PublicBaseUrl.toLowerCase());\r\n    if (!isLocal) {\r\n      console.debug({ InternalCode: data });\r\n      return {\r\n        url: url.toString(),\r\n        type: ScanTemplateResult.External,\r\n        InternalCode: data,\r\n        external: true,\r\n      };\r\n    } else {\r\n      return parseBarcodeURL(data, appSettings);\r\n    }\r\n  } catch (error) {\r\n    console.debug({ InternalCode: data });\r\n    return {\r\n      url: buildURL(`${appSettings.PublicBaseUrl}Assets/Details.aspx`, {\r\n        InternalCode: data,\r\n      }),\r\n      type: ScanTemplateResult.Internal,\r\n      InternalCode: data,\r\n    } as BarcodeScanResult;\r\n  }\r\n}\r\n","import React, { lazy, Suspense } from 'react';\r\n\r\ninterface Opts {\r\n  fallback: React.ReactNode;\r\n}\r\ntype Unpromisify<T> = T extends Promise<infer P> ? P : never;\r\n\r\nexport const lazyLoad = <\r\n  T extends Promise<any>,\r\n  U extends React.ComponentType<any>\r\n>(\r\n  importFunc: () => T,\r\n  selectorFunc?: (s: Unpromisify<T>) => U,\r\n  opts: Opts = { fallback: null },\r\n) => {\r\n  let lazyFactory: () => Promise<{ default: U }> = importFunc;\r\n\r\n  if (selectorFunc) {\r\n    lazyFactory = () =>\r\n      importFunc().then(module => ({ default: selectorFunc(module) }));\r\n  }\r\n\r\n  const LazyComponent = lazy(lazyFactory);\r\n\r\n  return (props: React.ComponentProps<U>): JSX.Element => (\r\n    <Suspense fallback={opts.fallback!}>\r\n      <LazyComponent {...props} />\r\n    </Suspense>\r\n  );\r\n};\r\n","import { LocationDetailsProps } from 'app/pages/LocationsPage/Details';\r\nimport { AssetPopUpProps } from 'app/pages/AssetPopUp';\r\nimport { QuizDetailsProps } from 'app/pages/QuizDetailsPage/QuizDetails';\r\nimport { StartQuizProps } from 'app/pages/QuizPage/StartQuiz';\r\nimport { TrainingDetailsProps } from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { PaymentProps } from 'app/pages/AddPaymentPage';\r\nimport { ChargeProps } from 'app/pages/AddChargePage';\r\nimport { InvoiceDetailsSidePanelProps } from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { BillingActionsDetailsProps } from 'app/pages/BillingActions/BillingActionsDetailsPage/Details';\r\nimport { SavedViewDetailsProps } from 'app/pages/SavedViewsPage/SavedViewPage/Details';\r\nimport { InstrumentRestrictionsProps } from 'app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { InvoiceTemplatePopUpProps } from 'app/pages/InvoiceTemplates/InvoiceTemplatePopUp';\r\nimport { OtherServiceDetailsProps } from 'app/pages/OtherServiceDetails/Details';\r\nimport { PricePeriodDetailsProps } from 'app/pages/PriceSheetPeriodDetails/Details';\r\nimport { CoreSelectionProps } from 'app/pages/CoreSelectionPage/CoreSelection';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { UserAttributesDetailsProps } from 'app/pages/UserAttributes/UserAttributesDetailsPage/Details';\r\nimport { ServiceRequestDetailsProps } from 'app/pages/Samples/RequestSamplesPage';\r\nimport { CalendarMessagesDetailsProps } from 'app/pages/CalendarMessages/CalendarMessagesDetails/Details';\r\nimport { ReportConsumablesProps } from 'app/pages/OtherServiceDetails/ReportConsumables';\r\nimport { ServiceRequestTicketDetailsProps } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails';\r\nimport { ServiceRequestMilestoneDetailsProps } from 'app/pages/Samples/components/ServiceRequestMilestoneDetails';\r\nimport { ServiceRequestMilestoneChargeDetailsProps } from 'app/pages/Samples/components/ServiceRequestMilestoneChargeDetails';\r\nimport { StockRenewalProps } from 'app/pages/OtherServiceDetails/StockRenewal';\r\nimport { RenewStockProps } from 'app/pages/OtherServiceDetails/RenewStock';\r\nimport { InventoryBatchProps } from 'app/pages/OtherServiceDetails/InventoryBatch';\r\nimport { InvoiceBatchesCommentsProps } from 'app/pages/InvoiceBatches/InvoiceBatchesComments';\r\nimport { InventoryLogProps } from 'app/pages/AssetsInventoryLog/InventoryLog';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ArticleAssociationFormProps } from 'app/pages/ArticlesPage/ArticleAssociationForm';\r\nimport { RegionDetailsProps } from 'app/pages/Regions/RegionsDetailsPage/Details';\r\n\r\nexport interface LayoutState {\r\n  sidePanelState: SidePanelState;\r\n  confirmState: ConfirmState;\r\n  continueState: ContinueState;\r\n  hasAnyNotSavedChanges: boolean;\r\n  doRefreshTable: boolean;\r\n  hideNavigation?: boolean;\r\n  actionTableProcessing?: ProcessingData;\r\n  upsnackbarIndex?: boolean;\r\n  isMobileView?: boolean;\r\n  adminPanelState: AdminPanelState;\r\n}\r\nexport interface SidePanelState {\r\n  sidePanelOpen: boolean;\r\n  pageType?: RenderPageType;\r\n  pageProps?: PageTypeProps;\r\n  expanded: boolean;\r\n  coverOpen?: boolean;\r\n  coverExpanded?: boolean;\r\n}\r\nexport interface ConfirmState {\r\n  confirmOpen: boolean;\r\n  approved: boolean;\r\n  rejected: boolean;\r\n  showLocalConfirm: boolean;\r\n  continueToLink?: string;\r\n}\r\nexport interface ContinueState {\r\n  pageType?: RenderPageType;\r\n  pageProps?: PageTypeProps;\r\n  expanded?: boolean;\r\n  continueOnApprove: boolean;\r\n}\r\nexport interface AdminPanelState {\r\n  adminPanelOpen: boolean;\r\n  url?: string | IPathAndQuery;\r\n}\r\nexport interface ProcessingData {\r\n  name: string;\r\n  processing: boolean;\r\n}\r\nexport enum RenderPageType {\r\n  TrainingDetails,\r\n  QuizCreate,\r\n  QuizzDetails,\r\n  LocationDetails,\r\n  AssetDetails,\r\n  WorkOrderDetails,\r\n  AddPayment,\r\n  AddCharge,\r\n  InvoiceDetails,\r\n  AddBillingAction,\r\n  SavedViewDetails,\r\n  LabelType,\r\n  LabelTypeEdit,\r\n  OtherServiceDetails,\r\n  RestrictionDetails,\r\n  InvoiceTemplatePopUp,\r\n  ReservationDetails,\r\n  PricePeriodsDetails,\r\n  Article,\r\n  CoreSelection,\r\n  AssetsSelection,\r\n  ArticleNew,\r\n  ArticleEdit,\r\n  UserAttributesDetails,\r\n  ServiceRequestDetails,\r\n  CalendarMessagesDetails,\r\n  ReportConsumables,\r\n  ServiceRequestTicketDetails,\r\n  ServiceRequestMilestone,\r\n  ServiceRequestMilestoneCharge,\r\n  StockRenewal,\r\n  RenewStock,\r\n  InventoryBatch,\r\n  InvoiceBatchesComments,\r\n  AssetInventoryLog,\r\n  ArticleForm,\r\n  RegionDetails,\r\n}\r\nexport interface SidePanelContentProps {\r\n  useSidePanel: boolean;\r\n}\r\nexport type PageTypeProps =\r\n  | TrainingDetailsProps\r\n  | StartQuizProps\r\n  | QuizDetailsProps\r\n  | LocationDetailsProps\r\n  | AssetPopUpProps\r\n  | WorkOrderDetailsProps\r\n  | PaymentProps\r\n  | ChargeProps\r\n  | InvoiceDetailsSidePanelProps\r\n  | BillingActionsDetailsProps\r\n  | SavedViewDetailsProps\r\n  | InvoiceTemplatePopUpProps\r\n  | OtherServiceDetailsProps\r\n  | InstrumentRestrictionsProps\r\n  | ReservationDetailsProps\r\n  | PricePeriodDetailsProps\r\n  | CoreSelectionProps\r\n  | AssetsSelectionProps\r\n  | UserAttributesDetailsProps\r\n  | ServiceRequestDetailsProps\r\n  | ServiceRequestTicketDetailsProps\r\n  | ReportConsumablesProps\r\n  | CalendarMessagesDetailsProps\r\n  | ServiceRequestMilestoneDetailsProps\r\n  | ServiceRequestMilestoneChargeDetailsProps\r\n  | StockRenewalProps\r\n  | RenewStockProps\r\n  | InventoryBatchProps\r\n  | InvoiceBatchesCommentsProps\r\n  | InventoryLogProps\r\n  | ArticleAssociationFormProps\r\n  | RegionDetailsProps;\r\n","import * as React from 'react';\r\nimport {\r\n  IconButton as MatIconButton,\r\n  IconButtonProps as MatIconButtonProps,\r\n  Link,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { capitalize } from 'lodash';\r\nimport { ButtonsVariant } from '../Button';\r\nimport { toLocationDescriptor } from 'app/components/BasicLinks/Link';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\nexport interface IconButtonPropsBase\r\n  extends Omit<MatIconButtonProps, 'size' | 'color'> {\r\n  disabled?: boolean;\r\n  children?: React.ReactNode;\r\n  href?: string | IPathAndQuery;\r\n  to?: string | IPathAndQuery;\r\n  target?: string;\r\n  icon?: IconProp;\r\n}\r\nexport interface IPrimaryIconStyleThemeProps {\r\n  size?: 'large' | 'medium' | 'small' | 'xs';\r\n  variant?: ButtonsVariant;\r\n  shape?: 'circle' | 'square';\r\n}\r\nexport type IconButtonProps = IconButtonPropsBase & IPrimaryIconStyleThemeProps;\r\n\r\nexport function IconButton(props: IconButtonProps) {\r\n  const {\r\n    children,\r\n    disabled,\r\n    size = 'small',\r\n    variant = 'main',\r\n    shape = 'square',\r\n    href,\r\n    to,\r\n    title,\r\n    target,\r\n    icon,\r\n    ...other\r\n  } = props;\r\n  const dispatch = useDispatch();\r\n  const { actions: appActions } = useAppSettingsSlice();\r\n  const handleClick = (e: any) => {\r\n    if (props.onClick) {\r\n      props.onClick(e);\r\n    }\r\n    if (!!to) {\r\n      let toto = typeof to === 'string' ? to : toLocationDescriptor(to);\r\n      dispatch(appActions.navigate(toto));\r\n      //history.push(toto);\r\n    }\r\n  };\r\n  const absolutePath =\r\n    href === undefined\r\n      ? undefined\r\n      : typeof href === 'string'\r\n      ? toRootedURL(href)\r\n      : toRootedURL(\r\n          (href as IPathAndQuery).path,\r\n          (href as IPathAndQuery).search,\r\n        );\r\n\r\n  return href ? (\r\n    <WithTitle title={title}>\r\n      <Link href={absolutePath} target={target}>\r\n        <MatIconButton\r\n          className={clsx(\r\n            props.className,\r\n            `variant${capitalize(variant)} iconSize${capitalize(\r\n              size,\r\n            )} shape${capitalize(shape)}`,\r\n          )}\r\n          disabled={disabled}\r\n          disableRipple\r\n          onClick={event => {\r\n            event.stopPropagation();\r\n            handleClick(event);\r\n          }}\r\n          {...other}\r\n        >\r\n          {!!children ? children : <Icon icon={icon ?? 'question-circle'} />}\r\n        </MatIconButton>\r\n      </Link>\r\n    </WithTitle>\r\n  ) : (\r\n    <WithTitle title={title}>\r\n      <MatIconButton\r\n        className={clsx(\r\n          props.className,\r\n          `variant${capitalize(variant)} iconSize${capitalize(\r\n            size,\r\n          )} shape${capitalize(shape)}`,\r\n        )}\r\n        onClick={event => {\r\n          event.stopPropagation();\r\n          handleClick(event);\r\n        }}\r\n        disabled={disabled}\r\n        disableRipple\r\n        {...other}\r\n      >\r\n        {!!children ? children : <Icon icon={icon ?? 'question-circle'} />}\r\n      </MatIconButton>\r\n    </WithTitle>\r\n  );\r\n}\r\n\r\nexport function WithTitle({\r\n  children,\r\n  title,\r\n}: React.PropsWithChildren<{\r\n  title?: string;\r\n}>) {\r\n  if (title) {\r\n    return (\r\n      <Tooltip title={title}>\r\n        <span>{children}</span>\r\n      </Tooltip>\r\n    );\r\n  } else {\r\n    return <>{children}</>;\r\n  }\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { delay, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { layoutActions as actions } from '.';\r\nimport { PageTypeProps, RenderPageType } from './type';\r\nimport {\r\n  selectAdminPanelOpen,\r\n  selectHasNotSavedChanges,\r\n  selectSidePanelOpen,\r\n} from './selectors';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\n\r\n// export function* doInitSidePanel() {\r\n//   yield put(actions.initLayoutState());\r\n// }\r\nexport function* doOpenSidePanel(\r\n  action: PayloadAction<{\r\n    type: RenderPageType | undefined;\r\n    props: PageTypeProps | undefined;\r\n    expanded: boolean | undefined;\r\n  }>,\r\n) {\r\n  const isChangesNotSaved: boolean = yield select(selectHasNotSavedChanges);\r\n  const sidePanelOpen: boolean = yield select(selectSidePanelOpen);\r\n  if (isChangesNotSaved) {\r\n    yield put(\r\n      actions.setContinueState({\r\n        type: action.payload.type,\r\n        props: action.payload.props,\r\n        expanded: action.payload.expanded,\r\n        continue: true,\r\n      }),\r\n    );\r\n    yield put(actions.setConfirmOpen(true));\r\n  } else {\r\n    if (sidePanelOpen) {\r\n      yield put(actions.resetSidePanel(true));\r\n      yield delay(200);\r\n      yield put(\r\n        actions.setTuggleOpenState({\r\n          expanded: !!action.payload.expanded,\r\n          type: action.payload.type,\r\n          props: action.payload.props,\r\n          open: true,\r\n        }),\r\n      );\r\n    } else {\r\n      yield put(\r\n        actions.setTuggleOpenState({\r\n          expanded: !!action.payload.expanded,\r\n          type: action.payload.type,\r\n          props: action.payload.props,\r\n          open: true,\r\n        }),\r\n      );\r\n    }\r\n  }\r\n}\r\nexport function* doOpenAdminPanel(\r\n  action: PayloadAction<{\r\n    url: string | IPathAndQuery;\r\n  }>,\r\n) {\r\n  const adminPanelOpen: boolean = yield select(selectAdminPanelOpen);\r\n  if (adminPanelOpen) {\r\n    yield put(actions.resetAdminPanel(true));\r\n    yield delay(100);\r\n    yield put(actions.setAdminPanelUrl(action.payload.url));\r\n  } else {\r\n    yield put(actions.setAdminPanelUrl(action.payload.url));\r\n    yield put(actions.setAdminPanelOpen(true));\r\n  }\r\n}\r\nexport function* layoutSaga() {\r\n  yield takeLatest(actions.openSidePanel.type, doOpenSidePanel);\r\n  yield takeLatest(actions.openAdminPanel.type, doOpenAdminPanel);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { layoutSaga } from './saga';\r\nimport {\r\n  LayoutState,\r\n  PageTypeProps,\r\n  ProcessingData,\r\n  RenderPageType,\r\n} from './type';\r\n\r\nexport const initialState: LayoutState = {\r\n  sidePanelState: {\r\n    sidePanelOpen: false,\r\n    pageType: undefined,\r\n    pageProps: undefined,\r\n    expanded: false,\r\n    coverOpen: false,\r\n    coverExpanded: false,\r\n  },\r\n  confirmState: {\r\n    confirmOpen: false,\r\n    approved: false,\r\n    rejected: false,\r\n    showLocalConfirm: false,\r\n    continueToLink: undefined,\r\n  },\r\n  hasAnyNotSavedChanges: false,\r\n  doRefreshTable: false,\r\n  continueState: {\r\n    continueOnApprove: false,\r\n    pageProps: undefined,\r\n    pageType: undefined,\r\n    expanded: undefined,\r\n  },\r\n  hideNavigation: undefined,\r\n  actionTableProcessing: undefined,\r\n  upsnackbarIndex: undefined,\r\n  isMobileView: undefined,\r\n  adminPanelState: {\r\n    adminPanelOpen: false,\r\n    url: undefined,\r\n  },\r\n};\r\nexport interface IOpenSidePanelPayload {\r\n  type: RenderPageType | undefined;\r\n  props: PageTypeProps | undefined;\r\n  expanded?: boolean;\r\n}\r\n\r\nconst slice = createSlice({\r\n  name: 'layout',\r\n  initialState,\r\n  reducers: {\r\n    toggleSidePanel(state, action: PayloadAction<boolean>) {\r\n      state.sidePanelState.sidePanelOpen = action.payload;\r\n    },\r\n    openSidePanel(state, action: PayloadAction<IOpenSidePanelPayload>) {},\r\n    setTuggleOpenState(\r\n      state,\r\n      action: PayloadAction<{\r\n        expanded: boolean;\r\n        type: RenderPageType | undefined;\r\n        props: PageTypeProps | undefined;\r\n        open: boolean;\r\n      }>,\r\n    ) {\r\n      state.sidePanelState.expanded = action.payload.expanded;\r\n      state.sidePanelState.pageProps = action.payload.props;\r\n      state.sidePanelState.pageType = action.payload.type;\r\n      state.sidePanelState.sidePanelOpen = action.payload.open;\r\n    },\r\n    setPageType(state, action: PayloadAction<RenderPageType | undefined>) {\r\n      state.sidePanelState.pageType = action.payload;\r\n    },\r\n    setPageProps(state, action: PayloadAction<PageTypeProps | undefined>) {\r\n      state.sidePanelState.pageProps = action.payload;\r\n    },\r\n    setExpanded(state, action: PayloadAction<boolean>) {\r\n      state.sidePanelState.expanded = action.payload;\r\n    },\r\n    resetSidePanel(state, action: PayloadAction<boolean | undefined>) {\r\n      state.sidePanelState.sidePanelOpen = action.payload || false;\r\n      state.sidePanelState.pageProps = undefined;\r\n      state.sidePanelState.pageType = undefined;\r\n      state.sidePanelState.expanded = false;\r\n      state.sidePanelState.coverExpanded = undefined;\r\n      state.sidePanelState.coverOpen = undefined;\r\n      state.confirmState = {\r\n        confirmOpen: false,\r\n        approved: false,\r\n        rejected: false,\r\n        showLocalConfirm: false,\r\n        continueToLink: undefined,\r\n      };\r\n      state.hasAnyNotSavedChanges = false;\r\n      state.upsnackbarIndex = undefined;\r\n    },\r\n    setConfirmOpen(state, action: PayloadAction<boolean>) {\r\n      state.confirmState.confirmOpen = action.payload;\r\n    },\r\n    resetConfirmState(state, action: PayloadAction) {\r\n      state.confirmState = {\r\n        confirmOpen: false,\r\n        approved: false,\r\n        rejected: false,\r\n        showLocalConfirm: false,\r\n        continueToLink: undefined,\r\n      };\r\n    },\r\n    setConfirmApproved(state, action: PayloadAction<boolean>) {\r\n      state.confirmState.approved = action.payload;\r\n    },\r\n    setConfirmRejected(state, action: PayloadAction<boolean>) {\r\n      state.confirmState.rejected = action.payload;\r\n    },\r\n    setContinueToLink(state, action: PayloadAction<string>) {\r\n      state.confirmState.continueToLink = action.payload;\r\n    },\r\n    setNotSavedChanges(state, action: PayloadAction<boolean>) {\r\n      state.hasAnyNotSavedChanges = action.payload;\r\n    },\r\n    setRefreshTable(state, action: PayloadAction<boolean>) {\r\n      state.doRefreshTable = action.payload;\r\n    },\r\n    setActionTableProcessing(\r\n      state,\r\n      action: PayloadAction<ProcessingData | undefined>,\r\n    ) {\r\n      state.actionTableProcessing = action.payload;\r\n    },\r\n    setLocalConfirm(state, action: PayloadAction<boolean>) {\r\n      state.confirmState.showLocalConfirm = action.payload;\r\n    },\r\n    setContinueOnApprove(state, action: PayloadAction<boolean>) {\r\n      state.continueState.continueOnApprove = action.payload;\r\n    },\r\n    setHideNavigation(state, action: PayloadAction<boolean | undefined>) {\r\n      state.hideNavigation = action.payload;\r\n    },\r\n    setContinueState(\r\n      state,\r\n      action: PayloadAction<{\r\n        type: RenderPageType | undefined;\r\n        props: PageTypeProps | undefined;\r\n        expanded: boolean | undefined;\r\n        continue: boolean;\r\n      }>,\r\n    ) {\r\n      state.continueState.continueOnApprove = action.payload.continue;\r\n      state.continueState.pageProps = action.payload.props;\r\n      state.continueState.pageType = action.payload.type;\r\n      state.continueState.expanded = action.payload.expanded;\r\n    },\r\n    resetContinueState(state, action: PayloadAction) {\r\n      state.continueState = {\r\n        continueOnApprove: false,\r\n        pageProps: undefined,\r\n        pageType: undefined,\r\n        expanded: undefined,\r\n      };\r\n    },\r\n    setUpSnackBarIndex(state, action: PayloadAction<boolean>) {\r\n      state.upsnackbarIndex = action.payload;\r\n    },\r\n    setIsMobileView(state, action: PayloadAction<boolean>) {\r\n      state.isMobileView = action.payload;\r\n    },\r\n    setIsCoverOpen(state, action: PayloadAction<boolean | undefined>) {\r\n      state.sidePanelState.coverOpen = action.payload;\r\n    },\r\n    setIsCoverExpanded(state, action: PayloadAction<boolean | undefined>) {\r\n      state.sidePanelState.coverExpanded = action.payload;\r\n    },\r\n    openAdminPanel(\r\n      state,\r\n      action: PayloadAction<{ url: string | IPathAndQuery }>,\r\n    ) {},\r\n    resetAdminPanel(state, action: PayloadAction<boolean | undefined>) {\r\n      state.adminPanelState.adminPanelOpen = action.payload || false;\r\n      state.adminPanelState.url = undefined;\r\n    },\r\n    setAdminPanelUrl(state, action: PayloadAction<string | IPathAndQuery>) {\r\n      state.adminPanelState.url = action.payload;\r\n    },\r\n    setAdminPanelOpen(state, action: PayloadAction<boolean | undefined>) {\r\n      state.adminPanelState.adminPanelOpen = action.payload || false;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: layoutActions } = slice;\r\n\r\nexport const useLayoutSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: layoutSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import React from 'react';\r\nimport { Box as MuiBox, BoxProps as MuiBoxProps } from '@material-ui/core';\r\nexport interface BoxProps extends MuiBoxProps {\r\n  children?: React.ReactNode;\r\n}\r\n\r\nexport function Box({ children, ...props }: BoxProps) {\r\n  return <MuiBox {...props}>{children}</MuiBox>;\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types/RootState';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => {\r\n  return state.layout || initialState;\r\n};\r\nexport const selectSidePanelState = createSelector(\r\n  [selectSlice],\r\n  state => state.sidePanelState,\r\n);\r\nexport const selectSidePanelOpen = createSelector(\r\n  [selectSlice],\r\n  state => state.sidePanelState.sidePanelOpen,\r\n);\r\nexport const selectPageType = createSelector(\r\n  [selectSlice],\r\n  state => state.sidePanelState.pageType,\r\n);\r\nexport const selectExpandedSidePanel = createSelector(\r\n  [selectSlice],\r\n  state => state.sidePanelState.expanded,\r\n);\r\nexport const selectPageTypeProps = createSelector(\r\n  [selectSlice],\r\n  state => state.sidePanelState.pageProps,\r\n);\r\nexport const selectConfirmState = createSelector(\r\n  [selectSlice],\r\n  state => state.confirmState,\r\n);\r\nexport const selectConfirmOpen = createSelector(\r\n  [selectSlice],\r\n  state => state.confirmState.confirmOpen,\r\n);\r\nexport const selectConfirmApproved = createSelector(\r\n  [selectSlice],\r\n  state => state.confirmState.approved,\r\n);\r\nexport const selectConfirmRejected = createSelector(\r\n  [selectSlice],\r\n  state => state.confirmState.rejected,\r\n);\r\nexport const selectHasNotSavedChanges = createSelector(\r\n  [selectSlice],\r\n  state => state.hasAnyNotSavedChanges,\r\n);\r\nexport const selectDoRefreshTable = createSelector(\r\n  [selectSlice],\r\n  state => state.doRefreshTable,\r\n);\r\nexport const selectShowLocalConfirm = createSelector(\r\n  [selectSlice],\r\n  state => state.confirmState.showLocalConfirm,\r\n);\r\nexport const selectContinueOnApprove = createSelector(\r\n  [selectSlice],\r\n  state => state.continueState.continueOnApprove,\r\n);\r\nexport const selectContinueState = createSelector(\r\n  [selectSlice],\r\n  state => state.continueState,\r\n);\r\nexport const selectContinueToLink = createSelector(\r\n  [selectSlice],\r\n  state => state.confirmState.continueToLink,\r\n);\r\nexport const selectHideNavigation = createSelector(\r\n  [selectSlice],\r\n  state => state.hideNavigation,\r\n);\r\nexport const selectSnackBarIndex = createSelector(\r\n  [selectSlice],\r\n  state => state.upsnackbarIndex,\r\n);\r\nexport const selectIsMobileView = createSelector(\r\n  [selectSlice],\r\n  state => state.isMobileView,\r\n);\r\nexport const selectActionTableProcessing = createSelector(\r\n  [selectSlice],\r\n  state => state.actionTableProcessing,\r\n);\r\nexport const selectProcessingIndicator = createSelector(\r\n  [selectActionTableProcessing],\r\n  processing => (methodName: string) => {\r\n    if (processing === undefined) {\r\n      return undefined;\r\n    } else if (methodName === processing.name) {\r\n      return processing.processing;\r\n    } else {\r\n      return undefined;\r\n    }\r\n  },\r\n);\r\nexport const selectIsCoverOpen = createSelector(\r\n  [selectSidePanelState],\r\n  state => state.coverOpen,\r\n);\r\nexport const selectIsCoverExpanded = createSelector(\r\n  [selectSidePanelState],\r\n  state => state.coverExpanded,\r\n);\r\nexport const selectAdminPanelOpen = createSelector(\r\n  [selectSlice],\r\n  state => state.adminPanelState.adminPanelOpen,\r\n);\r\nexport const selectAdminPanelUrl = createSelector(\r\n  [selectSlice],\r\n  state => state.adminPanelState.url,\r\n);\r\n","import { BudgetFields } from 'enums/BudgetFields';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { KnownModules } from './KnownModules';\r\nimport { Entity } from './common';\r\nimport { ImageSize } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { SettingModel } from 'utils/globalSettings/SettingModel';\r\n\r\nexport enum EnumAssetTypes {\r\n  Equipment,\r\n  TrainingProgram,\r\n  LectureRoom,\r\n  ServiceGroup,\r\n  SuperGroup,\r\n  Request,\r\n  OfflineService,\r\n  NotAvailable,\r\n}\r\nexport interface AppSettings {\r\n  Globalization: CultureInfoModel;\r\n  Modules: KnownModules[];\r\n  UserInternalIdLength: number | null;\r\n  InternalUserId2FieldLength: number | null;\r\n  WebVersion: string;\r\n  LastCodeUpdate: Date;\r\n  UserGroupsProviderType: number;\r\n  AssetFieldSettings: Record<AssetAttributes, IAssetAttributeSettingDto>;\r\n  PublicBaseUrl: string;\r\n  UploadFileSizeLimit: number;\r\n  MinimizedBookitlabLogo: boolean;\r\n  ForbiddenFileExtensions: string[];\r\n  BudgetFieldSettings: {\r\n    BudgetField: BudgetFields;\r\n    Disabled: Boolean;\r\n  }[];\r\n  TimeZone: ITimeZone;\r\n  AssetBarcodeUrlTemplate: string;\r\n  AssetBarcodeRelativeUrlTemplate: string;\r\n  RoomBarcodeUrlTemplate: string;\r\n  RoomBarcodeRelativeUrlTemplate: string;\r\n  LocationBarcodeUrlTemplate: string;\r\n  LocationBarcodeRelativeUrlTemplate: string;\r\n  SubLocationBarcodeUrlTemplate: string;\r\n  SubLocationBarcodeRelativeUrlTemplate: string;\r\n  SamplePlateBarcodeUrlTemplate: string;\r\n  SamplePlateBarcodeRelativeUrlTemplate: string;\r\n  ConsumableTypeBarcodeUrlTemplate: string;\r\n  ConsumableTypeBarcodeRelativeUrlTemplate: string;\r\n  RequiredUserProps: string[];\r\n  HideUserProps: string[];\r\n  DefaultRegistrationGroup: Entity<string> | null;\r\n  UserRegistersToSpecificCores: number;\r\n  TopCustomerLogoLink: string;\r\n  TopCustomerLogo: string;\r\n  FavIconImg: string;\r\n  FavIconTitle: string;\r\n  DTUOrbitWebServiceEnabled: boolean;\r\n  PubMedWebServiceEnabled: boolean;\r\n  EmailFromAddress: string;\r\n  ShowRawErrors: boolean;\r\n  ExistingImages: string[];\r\n  Help_Login: string | null;\r\n  LoginScreenCompanyLogoLink: string;\r\n  LoginScreenCompanyLogo: string;\r\n  LoginScreenCompanyLogoHeight: string;\r\n  ShowForgotPassword: boolean;\r\n  AdvancedAssetPublicSearchFilterAttributes: string;\r\n  BrowseByUnitBy: number;\r\n  noAuthSettings?: SettingModel[];\r\n}\r\n\r\nexport interface ITimeZone {\r\n  Id: string;\r\n  StandardName: string;\r\n  TimezoneOffsetMinutes: number;\r\n  DisplayName: string;\r\n}\r\n\r\nexport function IsBudgetFieldEnabled(\r\n  setting: AppSettings | null,\r\n  BudgetField: BudgetFields,\r\n): boolean {\r\n  if (!!setting && setting.BudgetFieldSettings) {\r\n    var result = setting.BudgetFieldSettings.find(bf => {\r\n      return bf.BudgetField === BudgetField;\r\n    });\r\n    return result !== undefined ? result.Disabled === false : true;\r\n  }\r\n  return false;\r\n}\r\nexport interface CultureInfoModel {\r\n  Locale: string;\r\n  FirstDayOfWeek: number;\r\n  UseAmPm: boolean;\r\n}\r\n\r\nexport interface AppSettingsErrorType {\r\n  message: string;\r\n}\r\nexport function IsModuleEnabled(\r\n  setting: AppSettings | null,\r\n  module: KnownModules,\r\n): boolean {\r\n  if (!!setting && setting.Modules) {\r\n    return setting?.Modules.includes(module);\r\n  }\r\n  return false;\r\n}\r\nexport function IsAssetFieldEnabled(\r\n  setting: AppSettings | null,\r\n  AssetField: AssetAttributes,\r\n  AssetAvailabilityType?: AssetTypes,\r\n): boolean {\r\n  if (!!setting && setting.AssetFieldSettings && AssetField !== undefined) {\r\n    const s = setting.AssetFieldSettings[AssetAttributes[AssetField]];\r\n    if (s !== undefined) {\r\n      if (AssetAvailabilityType !== undefined) {\r\n        const id = EnumAssetTypes[AssetAvailabilityType];\r\n        return s.AssetTypes.includes(id);\r\n      } else {\r\n        return true;\r\n      }\r\n    }\r\n  }\r\n  return false;\r\n}\r\nexport function IsAssetFieldIsPublic(\r\n  setting: AppSettings | null,\r\n  AssetField: AssetAttributes,\r\n  AssetAvailabilityType?: AssetTypes,\r\n): boolean {\r\n  if (!!setting && setting.AssetFieldSettings && AssetField !== undefined) {\r\n    const s = setting.AssetFieldSettings[AssetAttributes[AssetField]];\r\n    if (s !== undefined) {\r\n      if (AssetAvailabilityType !== undefined) {\r\n        const id = EnumAssetTypes[AssetAvailabilityType];\r\n        return s.AssetTypes.includes(id) && s.IsPublic === true;\r\n      } else {\r\n        return s.IsPublic === true;\r\n      }\r\n    }\r\n  }\r\n  return false;\r\n}\r\nexport function IsAssetImageExist(\r\n  settings: AppSettings | null,\r\n  imageName: string | null,\r\n  imageSize?: ImageSize,\r\n) {\r\n  if (\r\n    imageName === null ||\r\n    settings === null ||\r\n    !settings.ExistingImages ||\r\n    (!!settings.ExistingImages && settings.ExistingImages.length < 1)\r\n  ) {\r\n    return false;\r\n  }\r\n  let result = false;\r\n  result =\r\n    !!settings.ExistingImages &&\r\n    settings.ExistingImages.length > 0 &&\r\n    settings.ExistingImages.some(f => f === imageName);\r\n  // switch (imageSize) {\r\n  //   case 'full':\r\n  //     result =\r\n\r\n  //     break;\r\n  //   case 'thumb':\r\n  //     result =\r\n  //       !!settings.ExistingImages.ThumbImages &&\r\n  //       settings.ExistingImages.ThumbImages.length > 0 &&\r\n  //       settings.ExistingImages.ThumbImages.some(f => f === imageName);\r\n  //     break;\r\n  //   case 'vertical':\r\n  //     result =\r\n  //       !!settings.ExistingImages.CardVerticalImages &&\r\n  //       settings.ExistingImages.CardVerticalImages.length > 0 &&\r\n  //       settings.ExistingImages.CardVerticalImages.some(f => f === imageName);\r\n  //     break;\r\n  //   case 'horizontal':\r\n  //     result =\r\n  //       !!settings.ExistingImages.CardHorizontalImages &&\r\n  //       settings.ExistingImages.CardHorizontalImages.length > 0 &&\r\n  //       settings.ExistingImages.CardHorizontalImages.some(f => f === imageName);\r\n  //     break;\r\n  //   default:\r\n  //     result = false;\r\n  // }\r\n  return result;\r\n}\r\nexport function getOffsetDate(\r\n  settings: AppSettings | null,\r\n  date: Date | string | undefined | null,\r\n) {\r\n  const systemOffset = settings?.TimeZone?.TimezoneOffsetMinutes ?? 0;\r\n  let correctDate =\r\n    date === null || date === undefined\r\n      ? dateUtils.dateOrStringToDate(new Date())\r\n      : dateUtils.dateOrStringToDate(date);\r\n  const currentDateOffset = correctDate.getTimezoneOffset();\r\n  const dateOrNow = dateUtils.addMinutes(\r\n    correctDate,\r\n    systemOffset + currentDateOffset,\r\n  );\r\n  return dateOrNow;\r\n}\r\n\r\nexport function GetAssetTypeFrom(\r\n  availability: AvailabilityTypes,\r\n): AssetTypes | undefined {\r\n  switch (availability) {\r\n    case AvailabilityTypes.NotAvailable:\r\n    case AvailabilityTypes.AvailableNotBookable:\r\n      return 'NotAvailable';\r\n    case AvailabilityTypes.FreelyBookable:\r\n    case AvailabilityTypes.LoanableEquipment:\r\n      return 'Equipment';\r\n    case AvailabilityTypes.ServiceRelated:\r\n      return 'OfflineService';\r\n    case AvailabilityTypes.ServiceGroup:\r\n      return 'ServiceGroup';\r\n    case AvailabilityTypes.SuperGroup:\r\n      return 'SuperGroup';\r\n    case AvailabilityTypes.RequestRelated:\r\n      return 'Request';\r\n    case AvailabilityTypes.TrainingProgram:\r\n      return 'TrainingProgram';\r\n    case AvailabilityTypes.LectureRoom:\r\n      return 'LectureRoom';\r\n    default:\r\n      return;\r\n  }\r\n}\r\n\r\nexport type AssetTypes =\r\n  | 'Equipment'\r\n  | 'TrainingProgram'\r\n  | 'LectureRoom'\r\n  | 'ServiceGroup'\r\n  | 'SuperGroup'\r\n  | 'Request'\r\n  | 'OfflineService'\r\n  | 'NotAvailable';\r\nexport interface IAssetAttributeSettingDto {\r\n  Name: string;\r\n  AssetTypes: Array<AssetTypes>;\r\n  AssetCats: Array<number>;\r\n  IsPublic: boolean;\r\n  Enabled: boolean;\r\n  DisplayName: string;\r\n  Order: number;\r\n}\r\n","import { Identifiable } from 'types/common';\r\n\r\nexport function isNullOrUndefined<T>(\r\n  value: T | null | undefined,\r\n): value is null | undefined {\r\n  return value === null || value === undefined;\r\n}\r\n\r\nexport function isEmptyOrWhitespace(s: string | null | undefined): boolean {\r\n  return s === null || s === undefined || s === '' || s.trim() === '';\r\n}\r\nexport function toUndefinedIfEmptyOrWhitespace(s: string | null | undefined) {\r\n  return isEmptyOrWhitespace(s) ? undefined : s;\r\n}\r\nexport function toLowerCaseSafely(s: string | null | undefined): string | null {\r\n  return s === null || s === undefined ? null : s.toLowerCase();\r\n}\r\n\r\nexport const valOrNull = <T>(val: T | undefined | null) => {\r\n  return val ?? null;\r\n};\r\n\r\n//for use in filter to mark all as not undefined\r\nexport const notUndefined = <T>(val: T | undefined): val is T => {\r\n  return val !== undefined;\r\n};\r\n\r\nexport type PartialExceptId<T extends Identifiable<unknown>> = Pick<T, 'Id'> &\r\n  Partial<Omit<T, 'Id'>>;\r\n\r\nexport function toNumberOrNull(value: any): number | null {\r\n  if (value === null || value === undefined) {\r\n    return null;\r\n  }\r\n  if (typeof value === 'string') {\r\n    if (isNaN(parseInt(value))) {\r\n      return null;\r\n    } else {\r\n      return parseInt(value);\r\n    }\r\n  } else if (typeof value === 'number') {\r\n    return value;\r\n  } else {\r\n    return null;\r\n  }\r\n}\r\n","import { EnumType } from 'typescript';\r\nimport { AllowedSettings } from './AllowedSettings';\r\nimport { SettingModel } from './SettingModel';\r\n\r\nexport class GlobalSettings {\r\n  settings: SettingModel[];\r\n  constructor(sett: SettingModel[]) {\r\n    this.settings = sett;\r\n  }\r\n  public TryGet(key: string): string | null {\r\n    if (this.settings.length > 0) {\r\n      let obj = this.settings.find((value, index) => value.Name === key);\r\n      return obj === undefined ? null : obj.Value;\r\n    } else {\r\n      return null;\r\n    }\r\n  }\r\n  //please dont forget to add key of the setting to the allowed list of the enum AllowedSettings\r\n  public GetString(key: AllowedSettings): string {\r\n    let keyValue = AllowedSettings[key];\r\n    let res = this.TryGet(keyValue.toString());\r\n    return res === null ? '' : res;\r\n  }\r\n  public GetNullableByKey(key: AllowedSettings): string | null {\r\n    let keyValue = AllowedSettings[key];\r\n    return this.TryGet(keyValue.toString());\r\n  }\r\n  public GetNullableString(key: string): string | null {\r\n    return this.TryGet(key);\r\n  }\r\n  public GetBooleanByKey(key: AllowedSettings): boolean {\r\n    let res = this.GetString(key);\r\n    return res === '' ? false : res.toLowerCase() === 'true';\r\n  }\r\n  public GetBoolean(key: string): boolean {\r\n    let res = this.TryGet(key);\r\n    return res === null ? false : res.toLowerCase() === 'true';\r\n  }\r\n  public GetNullableBoolean(key: string): boolean | null {\r\n    let res = this.TryGet(key);\r\n    return res === null ? null : res.toLowerCase() === 'true';\r\n  }\r\n  public GetEnum(key: string, typeEnum: EnumType): EnumType {\r\n    let res = this.TryGet(key);\r\n    return res === null ? typeEnum.getDefault() : typeEnum[res];\r\n  }\r\n  public GetNullableEnum(key: string, typeEnum: EnumType): EnumType | null {\r\n    let res = this.TryGet(key);\r\n    return res === null ? null : typeEnum[res];\r\n  }\r\n}\r\n","export enum KnownModules {\r\n  Default = 0,\r\n  Assets = 1,\r\n  BudgetsSyncDoNotDeactivateMissingBudgets = 2,\r\n  AccServices = 3,\r\n  Quizzes = 4,\r\n  AllowOngoingReservationModification = 5,\r\n  AssetBarcodePrinting = 6,\r\n  AssetDetailsDisplayContactsRelatedOnly = 7,\r\n  AutomatedEndTimeUpdate = 8,\r\n  AutomaticEmailSending = 9,\r\n  AutomaticMonthlyPaymentLetter = 10,\r\n  Billing = 11,\r\n  Blitz = 12,\r\n  WebRelayTm = 13,\r\n  WebRelayX600m = 14,\r\n  NiDAQmx = 15,\r\n  KmTronicRelay = 16,\r\n  Budgets = 17,\r\n  BudgetCats = 18,\r\n  BudgetLimits = 19,\r\n  Cages = 20,\r\n  Colonies = 21,\r\n  ConfigurableColumns = 22,\r\n  CoreWizard = 23,\r\n  CostObjects = 24,\r\n  CustmerBranding = 25,\r\n  CreditByQuarter = 26,\r\n  CustomFormLinks = 27,\r\n  CustomRoles = 28,\r\n  Dashboards = 29,\r\n  DashboardAnnouncement = 30,\r\n  DataStorage = 31,\r\n  DataStoreCharge = 32,\r\n  Departments = 33,\r\n  Dictionaries = 34,\r\n  Divisions = 35,\r\n  Documents = 36,\r\n  DoorAccess = 37,\r\n  DoorAccessTibboController = 38,\r\n  DoorAccessImport = 39,\r\n  Eln /*Projects/Experiments*/ = 40,\r\n  Experiment = 41,\r\n  EmailCommunicationWithUsers = 42,\r\n  EquipmentAssemblies = 43,\r\n  EventsBillingByEndDate = 44,\r\n  EventsBillingByStartDate = 45,\r\n  Expenses = 46,\r\n  Factors = 47,\r\n  FactorsByInstTypes = 48,\r\n  FactorsByUserGroups = 49,\r\n  FinAdminRole = 50,\r\n  FixedRate = 51,\r\n  ForgotPassword = 52,\r\n  Genomics = 53,\r\n  GroupPermissions = 54,\r\n  GroupTrainingBookings = 55,\r\n  GoogleCalendar = 56,\r\n  HideInstrumentsFromUntrainedUsers = 57,\r\n  HideNonDefaultBudgets = 58,\r\n  HeaderStyle = 59,\r\n  IdleTimeOut = 60,\r\n  InstituteCoordRole = 61,\r\n  Instruments = 62,\r\n  Invoices = 63,\r\n  IpRelay = 64,\r\n  JoinAdGroup = 65,\r\n  //JoinAdGroupText = 66,\r\n  JoinAdGroupGenerate = 67,\r\n  LabTechRole = 68,\r\n  LargeAnimals = 69,\r\n  LocalApp = 70,\r\n  LocationTracking = 71,\r\n  MaintenanceAssets = 72,\r\n  Messages = 73,\r\n  MultipleAdGroups = 74,\r\n  Newsletter = 75,\r\n  OfflineFactors = 76,\r\n  OfflineServiceWithReservation = 77,\r\n  OfflineServices = 78,\r\n  OnlineBudgets = 79,\r\n  PaymentsByBudgets = 80,\r\n  PaymentsManagement = 81,\r\n  Plates = 82,\r\n  PlatesProcessing = 83,\r\n  Pricing = 84,\r\n  ProjectQuotes = 85,\r\n  Projects = 86,\r\n  QuickbooksExport = 87,\r\n  Quotes = 88,\r\n  Relay = 89,\r\n  RepAdminRole = 90,\r\n  RequestedServiceLinesInwokradditionalstatuses = 91,\r\n  RequestsLinesManagement = 92,\r\n  RequireAssetRoomAndBuilding = 93,\r\n  ResCancelNotifications = 94,\r\n  ReservationNotification = 95,\r\n  ReservationShrink = 96,\r\n  ReservationTakeOver = 97,\r\n  ReservationsCustomForm = 99,\r\n  RetroReservations = 101,\r\n  RetroReservationsAdminAsUser = 102,\r\n  SAP_Billing = 103,\r\n  SAP_NRC_Billing = 104,\r\n  SAP_SFTP = 105,\r\n  SampleManagementAutoProcessRequests = 106,\r\n  SampleManagementTables = 107,\r\n  SampleProcessing = 108,\r\n  SampleRequestPrintLabels = 109,\r\n  SampleRequestQuote = 110,\r\n  SampleRequestResultFiles = 111,\r\n  Sensors = 112,\r\n  ServiceRequests = 113,\r\n  RequestMilestones = 114,\r\n  ShibbolethAuthentication = 115,\r\n  ShibbolethExternalBudgets = 116,\r\n  ShowLicenseScreen = 117,\r\n  SkipPendingReservationCharge = 118,\r\n  SkipReservationBudgetValidation = 119,\r\n  SystemSettings = 120,\r\n  OAuth = 121,\r\n  Suppliers = 122,\r\n  TempUsers = 123,\r\n  TimeZone = 124,\r\n  Timeline = 125,\r\n  TrainingExpiration = 126,\r\n  Tutoring = 127,\r\n  TutoringHours = 128,\r\n  Undergraduate = 129,\r\n  UsageForm = 130,\r\n  UsageTutoring = 131,\r\n  UserBudgets = 132,\r\n  UserCanExpire = 133,\r\n  UserGroupCoordRole = 134,\r\n  UserGroupSelfAssign = 135,\r\n  UserGroupsAssignment = 136,\r\n  UserPermission = 137,\r\n  WS_Billing = 138,\r\n  WeeklyCalendar = 139,\r\n  WindowsAuthentication = 140,\r\n  Workflows = 141,\r\n  ShowAvailableNotBookableAssetsOnDashboard = 142,\r\n  EnableWorkflowExperiments = 143,\r\n  MultipleInstruments_AddRemoveOnEditReservation = 144,\r\n  PriceSheetPricing = 145,\r\n  PriceSheetFeeTypes = 146,\r\n  BudgetExperiments = 147,\r\n  Location = 148,\r\n  ServiceGroupRegistration = 149,\r\n  ReportsGenerator = 150,\r\n  AssetDecommission = 151,\r\n  //ShowBudgetsScreenFromUsers = 152,\r\n  CloningInstrumentsAssets = 153,\r\n  InstituteProjects = 154,\r\n  OfflineServiceBookedBy = 155,\r\n  TermsOfUseAgreement = 156,\r\n  TrainingLevelPermissions = 157,\r\n  TrainingPrograms = 158,\r\n  SourceAndLabelSampleProccessing = 159,\r\n  LocalAppRemoteControl = 160,\r\n  LoanDesk = 161,\r\n  VisualLogBook = 162,\r\n  BiWeeklyWorkingHoursPeriods = 163,\r\n  ReservationsImport = 164,\r\n  ServiceRequestProjectsInReservations = 165,\r\n  AllowSGAToControlSingleEquipment = 166,\r\n  MultipleCustomForms = 167,\r\n  UserInquiry = 168,\r\n  ProjectJoinRequests = 169,\r\n  DTUStudentCardIntergration = 170,\r\n  AssetModels = 171,\r\n  PriceSheetUserGroups = 172,\r\n  PeopleSoftBilling = 173,\r\n  DisableBillingEvents = 174,\r\n  InstrumetServiceProjectCode = 175,\r\n  RaspberryPi = 176,\r\n  SamplesAutomation = 177,\r\n}\r\n","import { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport * as rdd from 'react-device-detect';\r\n\r\nexport function DetectIsMobile() {\r\n  const { checkIsMobile } = useIsMobile();\r\n  return checkIsMobile();\r\n}\r\nexport function GetBrowserInfo() {\r\n  console.debug(`\r\n    fullBrowserVersion: ${rdd.fullBrowserVersion};\r\n    browserName: ${rdd.browserName};\r\n    browserVersion: ${rdd.browserVersion};\r\n    deviceType: ${rdd.deviceType};\r\n    engineName: ${rdd.engineName};\r\n    engineVersion: ${rdd.engineVersion};\r\n    osName: ${rdd.osName};\r\n    osVersion: ${rdd.osVersion};\r\n    mobileModel: ${rdd.mobileModel};\r\n    mobileVendor: ${rdd.mobileVendor};\r\n  `);\r\n}\r\n","/**\r\n *\r\n * AutocompletePickerS2\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { CircularProgress, InputBaseComponentProps } from '@material-ui/core';\r\nimport Autocomplete from '@material-ui/lab/Autocomplete';\r\nimport { EntityType } from 'types/common';\r\nimport {\r\n  autocompleteExtendStyles,\r\n  autocompleteStyles,\r\n} from 'styles/MUIExtend/autocompleteStyles';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { CSSProperties } from 'styled-components';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport clsx from 'clsx';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n  extractDataFromResponse,\r\n  IDisableable,\r\n  loadDataAndPrepareOptions,\r\n  OptionType,\r\n} from '../Utils/autoCompletePickerUtils';\r\nimport { FilterOptionsState } from '@material-ui/lab';\r\nimport { highlightSearchTerm } from '../BaseOptionsPicker/highlightSearchTerm';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\n\r\nexport interface AutocompletePickerProps<T extends EntityType> {\r\n  loadData: (\r\n    searchTerm: string | null,\r\n    predicates?: (string | Condition<T>)[],\r\n  ) => Promise<T[] | { value: T[]; more: boolean }>;\r\n  filterOptions?: (\r\n    options: OptionType<T>[],\r\n    state: FilterOptionsState<OptionType<T>>,\r\n  ) => OptionType<T>[];\r\n  value?: T | null;\r\n  label?: string;\r\n  onChange?: (value: T | null) => void;\r\n  size?: 'medium' | 'small';\r\n  mini?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  isOpen?: boolean;\r\n  disableClearable?: boolean;\r\n  style?: CSSProperties;\r\n  required?: boolean;\r\n  fullWidth?: boolean;\r\n  additionalItem?: T | null;\r\n  disabled?: boolean;\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  info?: string;\r\n  noOptionsText?: React.ReactNode;\r\n  defaultValue?: T | null;\r\n  id?: string;\r\n  select?: boolean;\r\n  customData?: T | T[] | null;\r\n  predicates?: (string | Condition<T>)[];\r\n  ariaLabel?: string;\r\n  className?: string;\r\n  title?: string;\r\n  loading?: boolean;\r\n  clearOnBlur?: boolean;\r\n  freeSolo?: boolean;\r\n  handleInputChange?: (value: string) => void;\r\n  additionalSearchTerm?: string | null;\r\n  onPickerOpen?: () => void;\r\n  renderOptionName?: (option: OptionType<T>) => string;\r\n  getOptionLabelName?: (option: OptionType<T>) => string;\r\n  inputProps?: InputBaseComponentProps | undefined;\r\n  autoFocus?: boolean;\r\n  autoHighlight?: boolean;\r\n  autoComplete?: boolean;\r\n  autoSelect?: boolean;\r\n  blurOnSelect?: 'touch' | 'mouse' | true | false;\r\n  clearOnEscape?: boolean;\r\n  includeInputInList?: boolean;\r\n  selectOnFocus?: boolean;\r\n  disableListWrap?: boolean;\r\n  disableCloseOnSelect?: boolean;\r\n  filterSelectedOptions?: boolean;\r\n  openOnFocus?: boolean;\r\n  setSomeOpen?: (open: boolean) => void;\r\n  ListboxProps?: object;\r\n}\r\n\r\nexport function AutocompletePicker<T extends EntityType>({\r\n  label,\r\n  loadData,\r\n  filterOptions = options => options,\r\n  value,\r\n  onChange,\r\n  size,\r\n  mini,\r\n  variant,\r\n  isOpen,\r\n  disableClearable,\r\n  style,\r\n  fullWidth = false,\r\n  additionalItem,\r\n  disabled,\r\n  info,\r\n  noOptionsText,\r\n  id,\r\n  select,\r\n  required,\r\n  predicates,\r\n  ariaLabel,\r\n  className,\r\n  title,\r\n  loading: propsLoading,\r\n  freeSolo,\r\n  handleInputChange,\r\n  additionalSearchTerm,\r\n  renderOptionName,\r\n  getOptionLabelName,\r\n  inputProps,\r\n  autoFocus,\r\n  autoHighlight = true,\r\n  autoComplete,\r\n  autoSelect = true,\r\n  blurOnSelect,\r\n  clearOnEscape,\r\n  includeInputInList,\r\n  selectOnFocus,\r\n  disableListWrap,\r\n  filterSelectedOptions,\r\n  disableCloseOnSelect,\r\n  openOnFocus,\r\n  setSomeOpen,\r\n  ListboxProps,\r\n  ...props\r\n}: AutocompletePickerProps<T>) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const classes = autocompleteStyles();\r\n  const extClasses = autocompleteExtendStyles();\r\n  const timerRef = React.useRef<any>(null);\r\n  //const miniClass = `${size === 'small' && mini ? 'miniDense' : ''}`;\r\n  let firstOpen = isOpen;\r\n  const [open, setOpen] = React.useState(firstOpen);\r\n  const [options, setOptions] = React.useState<\r\n    Array<OptionType<T>> | undefined\r\n  >([]);\r\n  const [searchTerm, setSearchTerm] = React.useState<string | null>(\r\n    additionalSearchTerm === undefined ? null : additionalSearchTerm,\r\n  );\r\n  const [hasSelected, setSelected] = React.useState(\r\n    value !== undefined && value !== null,\r\n  );\r\n  const [firstMounted, setFirstMounted] = React.useState<boolean | undefined>(\r\n    true,\r\n  );\r\n  useEffectOnMount(() => {\r\n    !!setSomeOpen && setSomeOpen(isOpen ?? false);\r\n  });\r\n  const handleSelectText = (\r\n    event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,\r\n  ) => {\r\n    event.target.select();\r\n    event.target.setSelectionRange(0, event.target.value.length);\r\n    setFirstMounted(undefined);\r\n    console.log('auto focus running');\r\n  };\r\n  React.useEffect(() => {\r\n    return () => clearTimeout(timerRef.current);\r\n  }, []);\r\n  const [loading, setLoading] = React.useState<boolean>(propsLoading ?? false);\r\n  // update internal \"loading\" state when \"loading\" property changes it's value\r\n  React.useEffect(() => {\r\n    if (propsLoading !== undefined) {\r\n      setLoading(propsLoading);\r\n    }\r\n  }, [propsLoading]);\r\n  const doload = open && (options === undefined || options?.length === 0);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n\r\n  React.useEffect(() => {\r\n    let active = true;\r\n    if (!doload) {\r\n      return undefined;\r\n    }\r\n    (async () => {\r\n      try {\r\n        setLoading(true);\r\n        const rawResponse = await loadData(searchTerm, predicates);\r\n        const response = extractDataFromResponse(rawResponse);\r\n        const optionsData = loadDataAndPrepareOptions({\r\n          response,\r\n          additionalItem,\r\n          t,\r\n        });\r\n\r\n        if (active) {\r\n          setOptions(optionsData);\r\n          setLoading(false);\r\n        }\r\n      } catch {\r\n        if (!active) return;\r\n        setOptions([]);\r\n        setLoading(false);\r\n      }\r\n    })();\r\n\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [additionalItem, doload, loadData, predicates, searchTerm, t]);\r\n\r\n  React.useEffect(() => {\r\n    if (!open) {\r\n      setOptions(undefined);\r\n    }\r\n  }, [open]);\r\n\r\n  return (\r\n    <Autocomplete\r\n      id={id || 'asynchronous-demo'}\r\n      //Material-UI: A component is changing the uncontrolled open state of Autocomplete to be controlled.\r\n      //Elements should not switch from uncontrolled to controlled (or vice versa).\r\n      open={open || false}\r\n      noOptionsText={noOptionsText || 'No Options'}\r\n      disabled={disabled}\r\n      onOpen={() => {\r\n        !disableClearable && setOptions(undefined);\r\n        !selectOnFocus && setSearchTerm(null);\r\n        setOpen(true);\r\n        !!setSomeOpen && setSomeOpen(true);\r\n        !!props.onPickerOpen && props.onPickerOpen();\r\n      }}\r\n      onClose={() => {\r\n        setSearchTerm(null);\r\n        setOpen(false);\r\n        !!setSomeOpen && setSomeOpen(false);\r\n        setLoading(false);\r\n      }}\r\n      onChange={(event, value, reason, details) => {\r\n        if (\r\n          value == null ||\r\n          ((value as T)?.Id !== undefined &&\r\n            ((value as unknown) as IDisableable)?.disabled !== true)\r\n        ) {\r\n          setSearchTerm(null);\r\n          onChange?.(value as T);\r\n          setSelected(value !== undefined && value !== null);\r\n        }\r\n      }}\r\n      multiple={false}\r\n      onInputChange={(event, newInputValue, reason) => {\r\n        setOptions(undefined);\r\n        if (reason === 'input') {\r\n          let val =\r\n            !!newInputValue && newInputValue !== null\r\n              ? newInputValue.trimStart()\r\n              : newInputValue;\r\n          setSearchTerm(val);\r\n          if (handleInputChange !== undefined) {\r\n            handleInputChange(val);\r\n          }\r\n        }\r\n      }}\r\n      style={style}\r\n      getOptionSelected={(option, value) =>\r\n        (option as T)?.Id !== undefined &&\r\n        (value as T)?.Id !== undefined &&\r\n        (option as T)?.Id === (value as T)?.Id\r\n      }\r\n      getOptionDisabled={option =>\r\n        ((option as unknown) as IDisableable)?.disabled ?? false\r\n      }\r\n      getOptionLabel={option => {\r\n        if (!!getOptionLabelName) {\r\n          return getOptionLabelName(option);\r\n        } else {\r\n          return option.Name ?? t(translations.NA);\r\n        }\r\n      }}\r\n      renderOption={(option, state) =>\r\n        highlightSearchTerm(\r\n          !!renderOptionName ? renderOptionName(option) : option.Name,\r\n          state.inputValue,\r\n        )\r\n      }\r\n      options={(options as OptionType<T>[]) ?? []}\r\n      filterSelectedOptions={filterSelectedOptions}\r\n      /**\r\n       *  filter is needed to be disabled in order to show server filterd items that might not contain the searchterm as is\r\n       *  or to show any other additional label like \"showing x records, please search fo more\"\r\n       * */\r\n      filterOptions={filterOptions}\r\n      loading={loading}\r\n      value={value ?? null}\r\n      classes={{\r\n        root: clsx(classes.root, showShortView ? 'shortView' : undefined),\r\n        tag: classes.tag,\r\n        tagSizeSmall: classes.tagSizeSmall,\r\n        inputRoot: classes.inputRoot,\r\n        input: classes.input,\r\n        inputFocused: classes.inputFocused,\r\n        endAdornment: classes.endAdornment,\r\n        clearIndicator: classes.clearIndicator,\r\n        popupIndicator: classes.popupIndicator,\r\n        popupIndicatorOpen: classes.popupIndicatorOpen,\r\n        paper: classes.paper,\r\n        listbox: classes.listbox,\r\n        loading: classes.loading,\r\n        noOptions: classes.noOptions,\r\n        option: classes.option,\r\n        groupLabel: classes.groupLabel,\r\n        groupUl: classes.groupUl,\r\n      }}\r\n      fullWidth={fullWidth}\r\n      className={clsx(className, extClasses.extendRoot)}\r\n      disableClearable={disableClearable}\r\n      onBlur={props?.onBlur}\r\n      size={size}\r\n      popupIcon={<Icon icon=\"chevron-down\" size=\"xs\" />}\r\n      closeIcon={<Icon icon=\"circle-xmark\" size=\"xs\" />}\r\n      freeSolo={freeSolo}\r\n      selectOnFocus={selectOnFocus || (isMobile ? false : true)}\r\n      renderInput={params => (\r\n        <BaseTextField\r\n          {...params}\r\n          label={label}\r\n          fullWidth={fullWidth}\r\n          size={size}\r\n          variant={variant || 'standard'}\r\n          name={props.name}\r\n          placeholder={props.placeholder ?? t(translations.AllValues)}\r\n          error={props.error}\r\n          select={select}\r\n          required={required}\r\n          helperText={props.helperText}\r\n          //onFocus={event => event.target.select()}\r\n          autoFocus={autoFocus}\r\n          onFocus={event => {\r\n            clearTimeout(timerRef.current);\r\n            if (\r\n              autoFocus &&\r\n              value !== null &&\r\n              value !== undefined &&\r\n              selectOnFocus &&\r\n              firstMounted\r\n            ) {\r\n              timerRef.current = setTimeout(handleSelectText, 100, event);\r\n            }\r\n          }}\r\n          inputProps={{\r\n            ...params.inputProps,\r\n            ...inputProps,\r\n            'aria-label': `${\r\n              label ? undefined : ariaLabel ? ariaLabel : 'search input'\r\n            }`,\r\n            // 'aria-labelledby': `${\r\n            //   label ? undefined : id ? `${id}_label` : undefined\r\n            // }`,\r\n            title: title,\r\n          }}\r\n          InputProps={{\r\n            //autoFocus: firstOpen || autoFocus,\r\n            classes: {\r\n              root: clsx(showShortView ? 'shortView' : undefined),\r\n            },\r\n            ...params.InputProps,\r\n            endAdornment: (\r\n              <React.Fragment>\r\n                {props.error}\r\n                {loading ? (\r\n                  <CircularProgress\r\n                    color=\"inherit\"\r\n                    size={params.size === 'small' ? 12 : 16}\r\n                    style={{\r\n                      position: 'absolute',\r\n                      right: 32,\r\n                      top: 'calc(50% - 8px)',\r\n                    }}\r\n                  />\r\n                ) : info ? (\r\n                  <InfoIcon\r\n                    title={info}\r\n                    className={clsx(extClasses.infoIcon, {\r\n                      [extClasses.infoWidthPlus]:\r\n                        hasSelected && !disableClearable,\r\n                      [extClasses.infoWidthMinus]:\r\n                        !hasSelected || disableClearable,\r\n                    })}\r\n                  />\r\n                ) : null}\r\n                {params.InputProps.endAdornment}\r\n              </React.Fragment>\r\n            ),\r\n          }}\r\n        />\r\n      )}\r\n      autoHighlight={autoHighlight}\r\n      autoComplete={autoComplete}\r\n      autoSelect={autoSelect}\r\n      blurOnSelect={blurOnSelect}\r\n      clearOnEscape={clearOnEscape}\r\n      includeInputInList={includeInputInList}\r\n      disableListWrap={disableListWrap}\r\n      openOnFocus={openOnFocus}\r\n      disableCloseOnSelect={disableCloseOnSelect}\r\n      ListboxProps={ListboxProps}\r\n    />\r\n  );\r\n}\r\n","import parse from 'autosuggest-highlight/parse';\r\nimport match from 'autosuggest-highlight/match';\r\n\r\nexport function highlightSearchTerm(text, highlight) {\r\n  // Split on highlight term and include term into parts, ignore case\r\n  const matches = match(text, highlight);\r\n  const parts = parse(text, matches);\r\n\r\n  return (\r\n    <span>\r\n      {parts.map((part, index) =>\r\n        part.highlight ? (\r\n          <strong key={index}>{part.text}</strong>\r\n        ) : (\r\n          <span key={index}>{part.text}</span>\r\n        ),\r\n      )}\r\n    </span>\r\n  );\r\n}\r\n","import {\r\n  capitalize,\r\n  Tooltip as MuiTooltip,\r\n  TooltipProps as MuiTooltipProps,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { TFunctionResult } from 'i18next';\r\nimport * as React from 'react';\r\nexport type ThemeColor = 'dark' | 'light';\r\nexport interface TooltipsProps extends Omit<MuiTooltipProps, 'title'> {\r\n  themeColor?: ThemeColor;\r\n  /**\r\n   * Tooltip title. redefined here to include TFunctionResult\r\n   */\r\n  title: React.ReactNode | TFunctionResult;\r\n  headTitle?: React.ReactNode | TFunctionResult;\r\n}\r\n\r\nexport function Tooltip({\r\n  children,\r\n  themeColor = 'dark',\r\n  title,\r\n  headTitle,\r\n  arrow = true,\r\n  interactive,\r\n  ...props\r\n}: TooltipsProps) {\r\n  return (\r\n    <MuiTooltip\r\n      arrow={arrow}\r\n      classes={{ popper: `color${capitalize(themeColor)}` }}\r\n      interactive={interactive}\r\n      title={\r\n        !!headTitle || (!!title && title !== '') ? (\r\n          <div className={'content'}>\r\n            {!!headTitle && (\r\n              <Body size=\"small\" bold color={'inherit'}>\r\n                {headTitle}\r\n              </Body>\r\n            )}\r\n            <Body size=\"small\" color={'inherit'}>\r\n              {title}\r\n            </Body>\r\n          </div>\r\n        ) : (\r\n          ''\r\n        )\r\n      }\r\n      {...props}\r\n    >\r\n      {children}\r\n    </MuiTooltip>\r\n  );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.AvailabilityTypes\r\n *\r\n */\r\n\r\nexport enum AvailabilityTypes {\r\n  NotAvailable = 0,\r\n  AvailableNotBookable = 1,\r\n  FreelyBookable = 2,\r\n  //BookableWApproval = 3,\r\n  ServiceRelated = 4,\r\n  ServiceGroup = 5,\r\n  SuperGroup = 6,\r\n  //FreelyBookableBillable = 7,\r\n  //ApprovalRequiredBillable = 8,\r\n  RequestRelated = 9,\r\n  TrainingProgram = 10,\r\n  LoanableEquipment = 11,\r\n  LectureRoom = 12,\r\n}\r\nexport type AvailabilityTypesUnion = keyof typeof AvailabilityTypes;\r\nexport const AvailabilityTypesUnionArray: Array<AvailabilityTypesUnion> = [\r\n  'NotAvailable',\r\n  'AvailableNotBookable',\r\n  'FreelyBookable',\r\n  //'BookableWApproval',\r\n  'ServiceRelated',\r\n  'ServiceGroup',\r\n  'SuperGroup',\r\n  //'FreelyBookableBillable',\r\n  //'ApprovalRequiredBillable',\r\n  'RequestRelated',\r\n  'TrainingProgram',\r\n  'LoanableEquipment',\r\n  'LectureRoom',\r\n];\r\n","export enum ServiceType {\r\n  Online = 1,\r\n  Offline = 2,\r\n  Sample = 3,\r\n  Workflow = 4,\r\n}\r\n\r\nexport type ServiceTypeUnion = keyof typeof ServiceType;\r\n","import { Typography, TypographyProps } from '@material-ui/core';\r\nimport { BookitTypographyVariant } from '@material-ui/core/styles/createTypography';\r\nimport { capitalize } from 'lodash';\r\nimport * as React from 'react';\r\nimport { typographyComponentMapping } from 'styles/typography/bookitTypography';\r\nimport clsx from 'clsx';\r\n\r\nexport interface BasicTypographyProps extends Omit<TypographyProps, 'variant'> {\r\n  variant?: BookitTypographyVariant;\r\n  component?: React.ElementType;\r\n  italic?: boolean;\r\n  style?: React.CSSProperties;\r\n  className?: string;\r\n}\r\nexport const BasicTypography = (props: BasicTypographyProps) => {\r\n  const {\r\n    children,\r\n    variant = 'bodyM',\r\n    italic,\r\n    component,\r\n    color,\r\n    style,\r\n    className,\r\n    ...other\r\n  } = props;\r\n  return (\r\n    <Typography\r\n      component={component || typographyComponentMapping[variant] || 'label'}\r\n      color={color ?? 'primary'}\r\n      className={clsx(`variant${capitalize(variant)}`, className, {\r\n        italic: italic,\r\n      })}\r\n      style={style}\r\n      {...other}\r\n    >\r\n      {children}\r\n    </Typography>\r\n  );\r\n};\r\nexport default BasicTypography;\r\n","export enum AssetAttributes {\r\n  NotActive,\r\n  AssetAccessories,\r\n  AssetCat,\r\n  AssetCatGroup,\r\n  AccountingId,\r\n  NickName,\r\n  OtherNames,\r\n  Type2Counter,\r\n  Brand,\r\n  Model,\r\n  ModelID,\r\n  ModelNumber,\r\n  Building,\r\n  Room,\r\n  Experts,\r\n  Contacts,\r\n  Public,\r\n  Raac,\r\n  MainSpecRange,\r\n  FunctionalCharacteristics,\r\n  ElectricalSpecs,\r\n  WebLink,\r\n  Tags,\r\n  Suppliers,\r\n  BrandCode,\r\n  InternalCode,\r\n  POnumber,\r\n  Campus,\r\n  LifeDate,\r\n  ExtraText0,\r\n  ExtraText1,\r\n  ExtraText2,\r\n  ExtraText3,\r\n  ExtraText4,\r\n  ExtraText5,\r\n  ExtraText6,\r\n  ExtraText7,\r\n  ExtraText8,\r\n  ExtraText9,\r\n  ExtraText10,\r\n  ExtraText11,\r\n  ExtraText12,\r\n  ExtraText13,\r\n  ExtraText14,\r\n  ExtraText15,\r\n  ExtraInt0,\r\n  ExtraInt1,\r\n  ExtraInt2,\r\n  ExtraInt3,\r\n  ExtraInt4,\r\n  ExtraDec0,\r\n  ExtraDec1,\r\n  ExtraDec2,\r\n  ExtraDec3,\r\n  ExtraDec4,\r\n  ExtraBool0,\r\n  ExtraBool1,\r\n  ExtraBool2,\r\n  ExtraBool3,\r\n  ExtraBool4,\r\n  ExtraUrl0,\r\n  ExtraUrl1,\r\n  ExtraUrl2,\r\n  ExtraUrl3,\r\n  ExtraUrl4,\r\n  ExtraRichText0,\r\n  ExtraRichText1,\r\n  ExtraRichText2,\r\n  ExtraRichText3,\r\n  ExtraRichText4,\r\n  ExtraDDL0,\r\n  ExtraDDL1,\r\n  ExtraDDL2,\r\n  ExtraDDL3,\r\n  ExtraDDL4,\r\n  ExtraDDL5,\r\n  ExtraDDL6,\r\n  ExtraDDL7,\r\n  ExtraDDL8,\r\n  ExtraDDL9,\r\n  ExtraDDL10,\r\n  ExtraDDL11,\r\n  ExtraDDL12,\r\n  ExtraDDL13,\r\n  ExtraDDL14,\r\n  ExtraDDL15,\r\n  ExtraDate0,\r\n  ExtraDate1,\r\n  ExtraDate2,\r\n  ExtraDate3,\r\n  ExtraDate4,\r\n  ExtraDate5,\r\n  ExtraDate6,\r\n  ExtraDate7,\r\n  ExtraDate8,\r\n  ExtraDate9,\r\n  UnderOriginalWarranty,\r\n  WarrantyEndDate,\r\n  ServiceContract,\r\n  GasSource,\r\n  ImageName,\r\n  Description,\r\n  ShortDescription,\r\n  // not present on asset search results\r\n  LocationsList,\r\n  // not present on asset search results\r\n  Range,\r\n  ExportLicense,\r\n  ForceTutoring,\r\n  SubLocationsList,\r\n  Details,\r\n  Classification,\r\n  Location,\r\n  SectionContacts,\r\n  Identifiers,\r\n  AdditionalInfo,\r\n  SectionLabel7,\r\n  SectionLabel8,\r\n  SectionLabel9,\r\n  SectionLabel10,\r\n  Status,\r\n  ServiceGroup,\r\n  Division,\r\n  AvailabilityType,\r\n  DOI,\r\n}\r\n","import {\r\n  BookitTypographyVariant,\r\n  FontStyleOptions,\r\n  TypographyStyleOptions,\r\n  Variant,\r\n} from '@material-ui/core/styles/createTypography';\r\nimport { CSSProperties } from '@material-ui/styles';\r\nexport const h1: CSSProperties = {\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '40px',\r\n  fontStyle: 'normal',\r\n  fontWeight: 700,\r\n  lineHeight: '141%',\r\n  letterSpacing: '-0.4px' /* 56.4px */,\r\n};\r\nexport const h2: CSSProperties = {\r\n  //styleName: Bkt/Header 2;\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '32px',\r\n  fontStyle: 'normal',\r\n  fontWeight: 700,\r\n  lineHeight: '146%', ///* 46.72px */\r\n  letterSpacing: '-0.4px',\r\n};\r\nexport const h3: CSSProperties = {\r\n  //styleName: Bkt/Header 3;\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '24px',\r\n  fontStyle: 'normal',\r\n  fontWeight: 700,\r\n  lineHeight: '160%' /* 38.4px */,\r\n  letterSpacing: '-0.2px',\r\n};\r\nexport const h4: CSSProperties = {\r\n  //styleName: Bkt/Header 4:\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '20px',\r\n  fontStyle: 'normal',\r\n  fontWeight: 700,\r\n  lineHeight: '160%' /* 32px */,\r\n  letterSpacing: '-0.1px',\r\n};\r\nexport const subtitle1: CSSProperties = {\r\n  /* Bkt/Subtitle 1 */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '24px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '160%' /* 38.4px */,\r\n  fontWeight: 400,\r\n};\r\nexport const subtitle2: CSSProperties = {\r\n  /* Bkt/Subtitle 2 */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '20px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '160%' /* 32px */,\r\n  fontWeight: 400,\r\n};\r\nexport const boldL: CSSProperties = {\r\n  /* Bkt/Bold L */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '18px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 25.38px */,\r\n  fontWeight: 700,\r\n  letterSpacing: '0px',\r\n};\r\nexport const boldM: CSSProperties = {\r\n  /* Bkt/Bold M */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '16px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 25.38px */,\r\n  fontWeight: 700,\r\n  letterSpacing: '0px',\r\n};\r\nexport const boldS: CSSProperties = {\r\n  /* Bkt/Bold S */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '14px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 19.74px */,\r\n  fontWeight: 700,\r\n  letterSpacing: '0.1px',\r\n};\r\nexport const bodyL: CSSProperties = {\r\n  /* Bkt/Body L */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '18px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 22.56px */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0px',\r\n};\r\nexport const bodyM: CSSProperties = {\r\n  /* Bkt/Body M */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '16px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 22.56px */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0px',\r\n};\r\nexport const bodyS: CSSProperties = {\r\n  /* Bkt/Body S */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '14px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 19.74px */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0.1px',\r\n};\r\n\r\nexport const captionBold: CSSProperties = {\r\n  /* Bkt/Caption Bold */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '12px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 16.92px */,\r\n  fontWeight: 700,\r\n  letterSpacing: '0.2px',\r\n};\r\nexport const captionRegular: CSSProperties = {\r\n  /* Bkt/Caption */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '12px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 16.92px */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0.2px',\r\n};\r\nexport const uppercase: CSSProperties = {\r\n  /* Bkt/UPPERCASE */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '12px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '160%' /* 19.2px */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0.1px',\r\n  textTransform: 'uppercase',\r\n};\r\nexport const tipsBold: CSSProperties = {\r\n  /* Bkt/Tips Bold */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '10px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 19.2px */,\r\n  fontWeight: 700,\r\n  letterSpacing: '0.2px',\r\n};\r\nexport const tipsRegular: CSSProperties = {\r\n  /* Bkt/Tips Regular */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '10px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '141%' /* 19.2px */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0.2px',\r\n};\r\n\r\nexport const inputLabelM: CSSProperties = {\r\n  /* Components Styles/Input Label - M */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '16px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '20px' /* 125% */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0px',\r\n};\r\nexport const inputLabelXS: CSSProperties = {\r\n  /* Components Styles/Input Label - XS */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '12px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '16px' /* 133.333% */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0px',\r\n};\r\nexport const inputValueM: CSSProperties = {\r\n  /* Components Styles/Input - Value M */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '16px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '20px' /* 125% */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0.2px',\r\n};\r\nexport const inputValueS: CSSProperties = {\r\n  /* Components Styles/Input - Value S */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '14px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '20px' /* 142.857% */,\r\n  fontWeight: 400,\r\n  letterSpacing: '0.2px',\r\n};\r\nexport const buttonM: CSSProperties = {\r\n  /* Components Styles/Button - M */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '16px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '20px' /* 125% */,\r\n  fontWeight: 600,\r\n  letterSpacing: '0.2px',\r\n};\r\nexport const buttonS: CSSProperties = {\r\n  /* Components Styles/Button - S */\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontSize: '14px',\r\n  fontStyle: 'normal',\r\n  lineHeight: '20px' /* 142.857% */,\r\n  fontWeight: 600,\r\n  letterSpacing: '0.2px',\r\n};\r\n\r\nexport const bookitTypography: BookitTypographyOptions = {\r\n  h1: h1,\r\n  h2: h2,\r\n  h3: h3,\r\n  h4: h4,\r\n  subtitle1: subtitle1,\r\n  subtitle2: subtitle2,\r\n  boldL: boldL,\r\n  boldM: boldM,\r\n  boldS: boldS,\r\n  bodyL: bodyL,\r\n  bodyM: bodyM,\r\n  bodyS: bodyS,\r\n  captionBold: captionBold,\r\n  captionRegular: captionRegular,\r\n  uppercase: uppercase,\r\n  tipsBold: tipsBold,\r\n  tipsRegular: tipsRegular,\r\n  inputLabelM: inputLabelM,\r\n  inputLabelXS: inputLabelXS,\r\n  inputValueM: inputValueM,\r\n  inputValueS: inputValueS,\r\n  buttonM: buttonM,\r\n  buttonS: buttonS,\r\n};\r\n\r\nexport const defaultVariantMapping: Partial<Record<Variant, string>> = {\r\n  h1: 'h1',\r\n  h2: 'h2',\r\n  h3: 'h3',\r\n  h4: 'h4',\r\n  h5: 'h5',\r\n  h6: 'h6',\r\n  subtitle1: 'h6',\r\n  subtitle2: 'h6',\r\n  body1: 'p',\r\n  body2: 'p',\r\n  button: 'label',\r\n  caption: 'label',\r\n  overline: 'label',\r\n};\r\nexport const typographyComponentMapping: Partial<Record<\r\n  BookitTypographyVariant,\r\n  React.ElementType\r\n>> = {\r\n  h1: 'h1',\r\n  h2: 'h2',\r\n  h3: 'h3',\r\n  h4: 'h4',\r\n  bodyL: 'p',\r\n  bodyM: 'p',\r\n  bodyS: 'p',\r\n  boldL: 'p',\r\n  boldM: 'p',\r\n  boldS: 'p',\r\n  buttonM: 'label',\r\n  buttonS: 'label',\r\n  captionRegular: 'label',\r\n  captionBold: 'label',\r\n  inputLabelM: 'label',\r\n  inputLabelXS: 'label',\r\n  inputValueM: 'span',\r\n  inputValueS: 'span',\r\n  subtitle1: 'p',\r\n  subtitle2: 'p',\r\n  tipsBold: 'label',\r\n  tipsRegular: 'label',\r\n  uppercase: 'p',\r\n};\r\nexport const typographyNameMapping: Partial<Record<\r\n  BookitTypographyVariant,\r\n  string\r\n>> = {\r\n  h1: 'Header 1',\r\n  h2: 'Header 2',\r\n  h3: 'Header 3',\r\n  h4: 'Header 4',\r\n  bodyL: 'Body L',\r\n  bodyM: 'Body M',\r\n  bodyS: 'Body S',\r\n  boldL: 'Bold L',\r\n  boldM: 'Bold M',\r\n  boldS: 'Bold S',\r\n  buttonM: 'Button M',\r\n  buttonS: 'Button S',\r\n  captionRegular: 'Caption Regular',\r\n  captionBold: 'Caption Bold',\r\n  inputLabelM: 'Input Label M',\r\n  inputLabelXS: 'Input Label XS',\r\n  inputValueM: 'Input Value M',\r\n  inputValueS: 'Input Value S',\r\n  subtitle1: 'Subtitle 1',\r\n  subtitle2: 'Subtitle 2',\r\n  tipsBold: 'Tips Bold',\r\n  tipsRegular: 'Tips Regular',\r\n  uppercase: 'UPPERCASE',\r\n};\r\n\r\nexport interface TypographyOptionMeta {\r\n  Name: string;\r\n  variant: BookitTypographyVariant;\r\n  style: CSSProperties;\r\n}\r\nexport const getTypographyMeta = (): TypographyOptionMeta[] => {\r\n  const data: TypographyOptionMeta[] = Object.entries(bookitTypography).map(\r\n    ent => {\r\n      return {\r\n        Name: typographyNameMapping[ent[0]] as string,\r\n        style: ent[1] as CSSProperties,\r\n        variant: ent[0] as BookitTypographyVariant,\r\n      };\r\n    },\r\n  );\r\n  return data;\r\n};\r\nexport interface BookitTypographyOptions\r\n  extends Partial<\r\n    Record<BookitTypographyVariant, TypographyStyleOptions> & FontStyleOptions\r\n  > {}\r\n","import {\r\n  useInjectReducer as useReducer,\r\n  useInjectSaga as useSaga,\r\n} from 'redux-injectors';\r\nimport {\r\n  InjectReducerParams,\r\n  InjectSagaParams,\r\n  RootStateKeyType,\r\n} from './types/injector-typings';\r\n\r\n/* Wrap redux-injectors with stricter types */\r\n\r\nexport function useInjectReducer<Key extends RootStateKeyType>(\r\n  params: InjectReducerParams<Key>,\r\n) {\r\n  return useReducer(params);\r\n}\r\n\r\nexport function useInjectSaga(params: InjectSagaParams) {\r\n  return useSaga(params);\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { EntityType, INamedEntity } from 'types/common';\r\nimport {\r\n  Condition,\r\n  escapeODataValue,\r\n  ODataFilterBuilder,\r\n} from 'api/odata/ODataFilter';\r\nimport { translations } from 'locales/translations';\r\nimport { TFunction } from 'i18next';\r\nimport { uniq } from 'lodash';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\n\r\n/**\r\n * Sets maximum limit of rows to fetch from the server for autocomplete picker.\r\n * Fetching all at once significantly slows down UI on slow connections.\r\n */\r\nconst MAX_TOP = 200;\r\n\r\ninterface loadDataParams<TEntity extends EntityType> {\r\n  url: string;\r\n  idPropertyName?: keyof TEntity;\r\n  DisplaynamePropertyName?: keyof TEntity;\r\n  predicates?: (string | Condition<TEntity>)[];\r\n  select?: Array<keyof TEntity>;\r\n  globalServiceGroupFilter?: Condition<TEntity>[];\r\n  expand?: string;\r\n  isOptionalServiceGroup?: boolean;\r\n  transformModel?: (item: TEntity) => TEntity;\r\n  useSearchOrPredicate?: boolean;\r\n  queryString?: Record<string, any>;\r\n  maxTop?: number;\r\n}\r\nexport interface autocompleteLoadDataResult<TEntity extends EntityType> {\r\n  value: TEntity[];\r\n  more: boolean;\r\n  limit?: number;\r\n}\r\nexport const getAutoCompleteLoadDataFn = <TEntity extends EntityType>({\r\n  url,\r\n  idPropertyName = 'Id',\r\n  DisplaynamePropertyName = 'Name',\r\n  select = [idPropertyName, DisplaynamePropertyName],\r\n  predicates: basePredicates = [],\r\n  globalServiceGroupFilter = [],\r\n  isOptionalServiceGroup = undefined,\r\n  expand = undefined,\r\n  transformModel = undefined,\r\n  useSearchOrPredicate = undefined,\r\n  queryString,\r\n  maxTop,\r\n}: loadDataParams<TEntity>) => async (\r\n  searchTerm: string | null,\r\n  dynamicPredicates?: (string | Condition<TEntity>)[],\r\n) => {\r\n  const params = {\r\n    ...queryString,\r\n    ...{\r\n      $orderby: `${String(DisplaynamePropertyName)} asc`,\r\n      $select: uniq(select).join(','),\r\n      $top: (maxTop ?? MAX_TOP) + 1,\r\n      $filter:\r\n        useSearchOrPredicate && searchTerm !== null\r\n          ? `(${String(DisplaynamePropertyName)} eq ${\r\n              \"'\" + escapeODataValue(searchTerm) + \"'\"\r\n            })`\r\n          : new ODataFilterBuilder<TEntity>({\r\n              predicates: dynamicPredicates\r\n                ? [...(dynamicPredicates ?? [])]\r\n                : basePredicates,\r\n              stringColumns: [DisplaynamePropertyName],\r\n              stringSearch: searchTerm ?? undefined,\r\n              globalServiceGroupFilter: globalServiceGroupFilter,\r\n              isOptionalServiceGroup: isOptionalServiceGroup,\r\n            }).toString(),\r\n      $expand: undefinedIfIsEmpty(expand),\r\n    },\r\n  };\r\n\r\n  const response = await httpClient.get(url, params);\r\n  const value = !!transformModel\r\n    ? (response.value as TEntity[]).map(f => transformModel(f))\r\n    : (response.value as TEntity[]);\r\n\r\n  return {\r\n    value: value.slice(0, maxTop ?? MAX_TOP),\r\n    more: value.length > (maxTop ?? MAX_TOP),\r\n    limit: maxTop ?? MAX_TOP,\r\n  };\r\n};\r\nexport const extractDataFromResponse = <T extends EntityType>(\r\n  response: T[] | autocompleteLoadDataResult<T>,\r\n) => {\r\n  if (Array.isArray(response)) {\r\n    return { value: response, more: false };\r\n  } else {\r\n    return response as autocompleteLoadDataResult<T>;\r\n  }\r\n};\r\n\r\nexport const loadDataAndPrepareOptions = <T extends EntityType>({\r\n  t,\r\n  response,\r\n  additionalItem,\r\n}: {\r\n  t: TFunction;\r\n  response: autocompleteLoadDataResult<T>;\r\n  additionalItem?: T | null;\r\n}) => {\r\n  const value = response.value;\r\n  if (additionalItem !== null && additionalItem !== undefined) {\r\n    value.unshift(additionalItem);\r\n  }\r\n  const nonSelectableOptions: NonSelectableOption[] = response.more\r\n    ? [\r\n        {\r\n          disabled: true,\r\n          Name: t(translations.ShowingFirstXRecords, {\r\n            maxRecordsLimit: response.limit ?? MAX_TOP,\r\n          }),\r\n        },\r\n      ]\r\n    : [];\r\n  return [...value, ...nonSelectableOptions];\r\n};\r\n\r\nexport interface IDisableable {\r\n  disabled: boolean;\r\n}\r\nexport interface IRemoveable {\r\n  noremoved: boolean;\r\n}\r\nexport interface IInfoOption {\r\n  titleInfo?: string;\r\n}\r\nexport interface IColored {\r\n  Color?: string;\r\n}\r\n\r\nexport type NonSelectableOption = INamedEntity & IDisableable;\r\nexport type NonRemoveableOption = INamedEntity & IRemoveable;\r\nexport type InfoOption = INamedEntity & IInfoOption;\r\nexport type ColoredOption = INamedEntity &\r\n  NonSelectableOption &\r\n  NonRemoveableOption &\r\n  InfoOption &\r\n  IColored;\r\nexport type OptionType<T> =\r\n  | T\r\n  | NonSelectableOption\r\n  | NonRemoveableOption\r\n  | InfoOption\r\n  | ColoredOption;\r\n","import i18next, { TFunction } from 'i18next';\r\nimport { Entity, INamedEntity } from 'types/common';\r\n\r\nconst isNumber = (x: string | number): x is number => !isNaN(+x);\r\nconst onlyNumbersReducer = (nums: number[], x: string | number): number[] =>\r\n  isNumber(x) ? [...nums, x] : nums;\r\nconst onlyStringReducer = (nums: string[], x: string | number): string[] =>\r\n  isNumber(x) ? nums : [...nums, x];\r\n\r\ntype Descripted<T> = {\r\n  [K in keyof T]: {\r\n    readonly id: T[K];\r\n    readonly description: string;\r\n  };\r\n}[keyof T];\r\n\r\ntype NonFunctional<T> = T extends Function ? never : T;\r\nexport interface EnumEntity extends Entity<number> {\r\n  OriginalName: string;\r\n}\r\n/**\r\n * Helper function to map with a TypeScript enum\r\n * This returns an array of numbers (e.g. [0,1,2,...])\r\n * corresponding to the enum, so you can create arrays that the enum can index.\r\n * @param keys TypeScript enum\r\n */\r\nexport const enumKeys = (keys: unknown): number[] =>\r\n  Object.keys(keys as string[]).reduce(onlyNumbersReducer, []);\r\n\r\nexport const enumStringKeys = (keys: unknown): string[] =>\r\n  Object.keys(keys as string[]).reduce(onlyStringReducer, []);\r\n\r\n/**\r\n * Helper to produce an array of enum descriptors.\r\n * @param enumeration Enumeration object.\r\n * @param separatorRegex Regex that would catch the separator in your enum key.\r\n */\r\nexport function enumToDescriptedArray<T extends {}>(\r\n  enumeration: T,\r\n): Descripted<T>[] {\r\n  return (Object.keys(enumeration) as Array<keyof T>)\r\n    .filter(key => isNaN(Number(key)))\r\n    .filter(\r\n      key =>\r\n        typeof enumeration[key] === 'number' ||\r\n        typeof enumeration[key] === 'string',\r\n    )\r\n    .map(key => ({\r\n      id: enumeration[key],\r\n      description: String(key),\r\n    }));\r\n}\r\n\r\n/**\r\n * TFunction may throw an error if called before i18next has been initialized.\r\n * There's really good point to try and use localization before it's been localized but it's used this way in a couple of places already\r\n * @param key localizaiton key\r\n * @param t TFunction\r\n * @returns localized value or null\r\n */\r\nfunction tryGetName(key: string, t?: TFunction): string {\r\n  try {\r\n    const tFunction = t ?? GetTFunction();\r\n    return tFunction?.(key) ?? key;\r\n  } catch (error) {\r\n    return key;\r\n  }\r\n}\r\n/**\r\n * Gets TFunction from i18next instance\r\n * @returns TFunction\r\n */\r\nconst GetTFunction: () => TFunction | undefined = () => {\r\n  const i18n = i18next;\r\n  if (i18n.isInitialized) {\r\n    const defaultNS = 'translation';\r\n    return i18n.getFixedT(\r\n      null,\r\n      i18n.options.ns ?? i18n.options.defaultNS ?? defaultNS,\r\n    );\r\n  }\r\n  return undefined;\r\n};\r\nexport function toEntityEnumArray<T extends {}>(\r\n  enumeration: T,\r\n  t?: TFunction,\r\n  prefixKey?: string,\r\n): EnumEntity[] {\r\n  return Object.keys(enumeration)\r\n    .filter(key => isNaN(Number(key)))\r\n    .filter(\r\n      key =>\r\n        typeof enumeration[key] === 'number' ||\r\n        typeof enumeration[key] === 'string',\r\n    )\r\n    .map(key => {\r\n      return {\r\n        Id: enumeration[key],\r\n        Name: !!prefixKey\r\n          ? tryGetName(prefixKey + String(key), t)\r\n          : tryGetName(String(key), t),\r\n        OriginalName: String(key),\r\n      };\r\n    });\r\n}\r\nexport function enumToEntityArray<T extends {}>(\r\n  enumeration: T,\r\n  t?: TFunction,\r\n  prefixKey?: string,\r\n): Entity<number>[] {\r\n  return Object.keys(enumeration)\r\n    .filter(key => isNaN(Number(key)))\r\n    .filter(\r\n      key =>\r\n        typeof enumeration[key] === 'number' ||\r\n        typeof enumeration[key] === 'string',\r\n    )\r\n    .map(key => {\r\n      return {\r\n        Id: enumeration[key],\r\n        Name: !!prefixKey\r\n          ? tryGetName(prefixKey + String(key), t)\r\n          : tryGetName(String(key), t),\r\n      };\r\n    });\r\n}\r\nexport function GetOptionsFilterFunction<TItem extends INamedEntity>(\r\n  items: Array<TItem>,\r\n  customSearch?: (value: TItem, search: string) => boolean,\r\n) {\r\n  return (searchTerm: string | null) => {\r\n    if (searchTerm !== null && searchTerm !== '' && searchTerm !== undefined) {\r\n      return items.filter(\r\n        f =>\r\n          f.Name.toLowerCase().startsWith(searchTerm.toLowerCase()) ||\r\n          f.Name.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1 ||\r\n          (!!customSearch && customSearch(f, searchTerm)),\r\n      );\r\n    }\r\n    return items;\r\n  };\r\n}\r\n\r\n/**\r\n * Helper to produce an array of enum values.\r\n * @param enumeration Enumeration object.\r\n */\r\nexport function enumToArray<T extends {}>(\r\n  enumeration: T,\r\n): NonFunctional<T[keyof T]>[] {\r\n  return Object.keys(enumeration)\r\n    .filter(key => isNaN(Number(key)))\r\n    .map(key => enumeration[key])\r\n    .filter(val => typeof val === 'number' || typeof val === 'string');\r\n}\r\n\r\nexport class EnumHelpers {\r\n  static getNamesAndValues<T extends number>(e: any) {\r\n    return EnumHelpers.getNames(e).map(n => ({ name: n, value: e[n] as T }));\r\n  }\r\n\r\n  static getNames(e: any) {\r\n    return EnumHelpers.getObjValues(e).filter(\r\n      v => typeof v === 'string',\r\n    ) as string[];\r\n  }\r\n\r\n  static getValues<T extends number>(e: any) {\r\n    return EnumHelpers.getObjValues(e).filter(\r\n      v => typeof v === 'number',\r\n    ) as T[];\r\n  }\r\n\r\n  static getSelectList<T extends number, U>(\r\n    e: any,\r\n    stringConverter: (arg: U) => string,\r\n  ) {\r\n    const selectList = new Map<T, string>();\r\n    this.getValues(e).forEach(val =>\r\n      selectList.set(val as T, stringConverter((val as unknown) as U)),\r\n    );\r\n    return selectList;\r\n  }\r\n\r\n  static getSelectListAsArray<T extends number, U>(\r\n    e: any,\r\n    stringConverter: (arg: U) => string,\r\n  ) {\r\n    return Array.from(this.getSelectList(e, stringConverter), value => ({\r\n      value: value[0] as T,\r\n      presentation: value[1],\r\n    }));\r\n  }\r\n\r\n  private static getObjValues(e: any): (number | string)[] {\r\n    return Object.keys(e).map(k => e[k]);\r\n  }\r\n}\r\n","/**\r\n * Formats string similar to .net string.Format\r\n * @param s format string\r\n * @param params interpolated values\r\n */\r\nexport function stringFormat(s, ...args: any) {\r\n  return s.replace(/{(\\d+)}/g, function (match, number) {\r\n    return typeof args[number] != 'undefined' ? args[number] : match;\r\n  });\r\n}\r\n\r\n/**\r\n * Removes html tags and leaves only the text\r\n * @param value html text\r\n * @returns plain text without tags\r\n */\r\nexport function removeHtml(value: string) {\r\n  return value.replace(/<[^>]+>/g, '');\r\n}\r\n\r\nexport function tryParseWithoutNaN(parse: (value: string) => number) {\r\n  return (value: string) => {\r\n    const x = parse(value);\r\n    if (isNaN(x)) {\r\n      return undefined;\r\n    } else {\r\n      return x;\r\n    }\r\n  };\r\n}\r\n\r\nexport function tryParse<TResult>(\r\n  parse: (value: string) => TResult,\r\n): (value: string | null | undefined) => TResult | undefined {\r\n  return (value: string | null | undefined) => {\r\n    if (value === null) {\r\n      return undefined;\r\n    }\r\n    if (value === undefined) {\r\n      return undefined;\r\n    }\r\n    try {\r\n      const x = parse(value);\r\n      return x;\r\n    } catch {\r\n      return undefined;\r\n    }\r\n  };\r\n}\r\n\r\n/**\r\n * Tries to parse string-like value.\r\n * Usefull to reduce bloat when an integer value needs to be converted to number without resorting to null/undefined checks.\r\n * @param value string/null/undefined\r\n * @returns number if it's int-like or undefined otherwise\r\n */\r\nexport function tryParseInt(value: string | null | undefined) {\r\n  return tryParse(tryParseWithoutNaN(parseInt))(value);\r\n}\r\n\r\nexport function tryParseFloat(value: string | null | undefined) {\r\n  return tryParse(tryParseWithoutNaN(parseFloat))(value);\r\n}\r\nexport function tryParsePositiveFloat(value: string | null | undefined) {\r\n  return tryParse(value => {\r\n    const x = parseFloat(value);\r\n    if (x > 0) {\r\n      return x;\r\n    }\r\n  })(value);\r\n}\r\n\r\nexport function tryParseBool(value: string | null | undefined) {\r\n  return tryParse(value => value.toLowerCase() === 'true')(value);\r\n}\r\nexport function isNumericPositive(value: string): boolean {\r\n  let res = /^\\d+$/.test(value);\r\n  return res === true;\r\n}\r\n","import * as React from 'react';\r\nexport const useEffectOnMount = (effect: React.EffectCallback) => {\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  React.useEffect(effect, []);\r\n};\r\nexport const useLayoutEffectOnMount = (effect: React.EffectCallback) => {\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  React.useLayoutEffect(effect, []);\r\n};\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { SqlDayOfWeek } from 'api/odata/generated/enums/SqlDayOfWeek';\r\nimport { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IReservationAssemblyPartDto } from 'api/odata/generated/entities/IReservationAssemblyPartDto';\r\n\r\n/* --- STATE --- */\r\nexport interface ReservationState {\r\n  detailsState: AsyncDataState<ReservationDetailsState>;\r\n  reservationSettingsState?: ReservationSettingsState;\r\n  equipmentsSettingsState?: ServiceSettingsState;\r\n  confirmAssistedReservations?: boolean;\r\n  trainingsData: UserTrainingReservationData | null;\r\n  processing: boolean;\r\n  valueHandler?: FieldHandlerProps<ReservationDetailsState>;\r\n  requestedValueFor?: keyof ReservationDetailsState;\r\n  requestedValue?: any;\r\n  equipmentChangeResultState?: ReservationEquipmentsChangeResult;\r\n  isChangeCompleted?: boolean;\r\n  transferState: TransferState;\r\n  creditState: AsyncDataState<PricingState>;\r\n  hasCharges?: boolean;\r\n  savedOfflineServices: IOtherServices[];\r\n  refeshOfflineService?: boolean;\r\n  terminationState: TerminationState;\r\n  cloneReservation?: boolean;\r\n  reservationDtoState?: IReservationDto;\r\n  isEdit: boolean;\r\n  asyncChangeLoading?: boolean;\r\n  submitCredit?: boolean;\r\n  ByApprovalErrors?: Array<string>;\r\n  userCanRequestApproval?: boolean;\r\n  refreshWorkOrderLink?: boolean;\r\n  notFound?: boolean;\r\n}\r\nexport interface ReservationQueryStringParameters {\r\n  uid?: string;\r\n  id?: string;\r\n  selectedIds?: string;\r\n  Start?: string;\r\n  End?: string;\r\n  proj?: string;\r\n  tsid?: string;\r\n  remarks?: string;\r\n  accid?: string;\r\n  singleClick?: string;\r\n  duration?: string;\r\n  ug?: string;\r\n  un?: string;\r\n  ft?: string;\r\n  /**\r\n   * Service Request ID\r\n   */\r\n  srid?: string;\r\n  /**\r\n   * ServiceRequest row ID\r\n   */\r\n  srrid?: string;\r\n  /**\r\n   * Service request sample IDs (comma separated)\r\n   */\r\n  srsid?: string;\r\n  /**\r\n   * Service request samples run ID\r\n   */\r\n  sampleRunId?: string;\r\n  Edit?: string;\r\n  defaultMulti?: string;\r\n  resIdTransferredFrom?: string;\r\n  source?: string;\r\n  UpdateToNow?: string;\r\n  terminated?: string;\r\n  Shrink?: string;\r\n  resourceChanged?: string;\r\n  staffEquipmentId?: string;\r\n  staffUser?: string;\r\n  bid?: string;\r\n}\r\n// Model to Save Reservation - mutch Server Model\r\nexport interface ReservationEquipment {\r\n  EquipmentId: number;\r\n  EquipmentName: string;\r\n  AccServiceIds: number[];\r\n  AssemblyId: number | null;\r\n\r\n  ReservationId: number | null;\r\n}\r\nexport interface ReservationBudgetModel {\r\n  id: number;\r\n  text: string;\r\n  percent: number | null;\r\n  ReservationId: number | null;\r\n}\r\nexport interface CustomFormValueModel {\r\n  FieldId: number;\r\n  Value?: string;\r\n  DisplayValue?: string;\r\n}\r\nexport interface ReservationPartModel {\r\n  StarTime: Date | string;\r\n  EquipmentId: number;\r\n  Id: number;\r\n  BudgetId: number | null;\r\n}\r\nexport enum FundingTypes {\r\n  Internal = 0,\r\n  External = 1,\r\n}\r\nexport enum ReservationStatus {\r\n  Approved = 1,\r\n  Pending = 2,\r\n  Cancelled = 3,\r\n  AllStatus = 4,\r\n  CancelledByAdmin = 5,\r\n  Done = 6,\r\n  NotDone = 7,\r\n  DoneWOBooking = 8,\r\n  ApprovedOnce = 9,\r\n  PendingCoord = 10,\r\n  Tentative = 11,\r\n  Draft = 12,\r\n}\r\nexport type ReservationStatusUnion = keyof typeof ReservationStatus;\r\nexport enum RecurringReservationUpdateOptions {\r\n  CurrentReservation = 1,\r\n  Following = 2,\r\n  All = 3,\r\n}\r\nexport enum ReservationRepeatPeriods {\r\n  Daily = 1,\r\n  Weekly = 2,\r\n  Monthly = 3,\r\n}\r\nexport enum ReservationRepeatMonthlyTypes {\r\n  SameDate = 1,\r\n  SameWeekDay = 2,\r\n}\r\nexport interface ReservationRepeatModel {\r\n  RepeatsEveryNum: number | null;\r\n  RepeatsEveryType: ReservationRepeatPeriods | null;\r\n  RepeatsOn: SqlDayOfWeek[];\r\n  RepeatsBy: ReservationRepeatMonthlyTypes;\r\n  RepeatOption: RepetitiveOptions;\r\n  RepeatEndTime: Date | string;\r\n  Repeat_Period: number | null;\r\n}\r\n\r\nexport interface ReservationModel {\r\n  Id: number;\r\n  Services: ReservationEquipment[];\r\n  StartTime: Date | string;\r\n  EndTime: Date | string;\r\n  Username: string;\r\n  UserGroupId: string;\r\n  Collaborators: string[];\r\n  BudgetId: number | null;\r\n  BudgetExperimentId: number | null;\r\n  InstituteProjectId: number | null;\r\n  WorkflowBooking: Entity<number> | null;\r\n  ExternalCustomerId: number | null;\r\n  FundingTypeId: FundingTypes | null;\r\n  StaffUser: string | null;\r\n  PurchaseOrder: string | null;\r\n  Reference: string | null;\r\n  Tutoring: boolean;\r\n  TrainingSignUp: boolean;\r\n  TrainingSessionId: number | null;\r\n  Status: ReservationStatus;\r\n  AllStartTimes: (Date | string)[];\r\n  InsertedAt: Date | string | null;\r\n  InsertedBy: string | null;\r\n  UpdatedAt: Date | string | null;\r\n  UpdatedBy: string | null;\r\n  CancelledAt: Date | string | null;\r\n  UserRequestedByApproval: boolean;\r\n  Remarks: string | null;\r\n  TutorName: string | null;\r\n  PartialAttendance: boolean;\r\n  PartialAttendanceStart: number | null;\r\n  PartialAttendanceEnd: number | null;\r\n  CustomFormValues: CustomFormValueModel[];\r\n  Name: string;\r\n  TransferFromId: number | null;\r\n  TransferInProgress: boolean;\r\n  TransferredTo: string | null;\r\n  WaitingTransferApproval: boolean;\r\n  Parts: ReservationPartModel[];\r\n  RecurringUpdateOption: RecurringReservationUpdateOptions;\r\n  BudgetIds: ReservationBudgetModel[];\r\n  OfflineServices: OfflineservicesModel[];\r\n  Terminated: boolean;\r\n  TotalCost: number;\r\n  SavedForLater: boolean;\r\n  FullDayReservation: boolean;\r\n  SampleRunId: number | null;\r\n}\r\nexport interface ReservationInsertModel extends ReservationModel {\r\n  Repeat: ReservationRepeatModel | null;\r\n  AssignToServiceRequestId: number | null;\r\n  AssignToServiceRequestRowIds: number[];\r\n  AssignToServiceRequestSampleIds: number[];\r\n}\r\nexport interface ReservationUpdateModel extends ReservationModel {}\r\nexport interface OfflineservicesModel {\r\n  ServiceTypeName: string;\r\n  Quantity: number;\r\n  UnitsName: string;\r\n  Remarks: string;\r\n  Factor: number;\r\n  OfflineServiceTypeId: number;\r\n  InventoryBatchId: number | null;\r\n  BudgetId: number | null;\r\n  BudgetExperimentId: number | null;\r\n  UserGroup: string | null;\r\n}\r\n// react side Model\r\n\r\nexport interface IMandatoryEquipmentsDto extends CheckEntity {\r\n  Id: number;\r\n  ParentName: string;\r\n  Name: string;\r\n  AssetId: number | null;\r\n  AccServices: IEquipmentAccServiceDto[];\r\n  AssemblyId: number | null;\r\n  HasAssemblyParts: boolean;\r\n  HideProjects: boolean;\r\n  AllowPartialProjectCharges: boolean;\r\n  AllowPartialSingleProjectCharges: boolean;\r\n  TrainingSignUpApproval: number;\r\n  HideTrainingSession: boolean;\r\n  HasAttendance: boolean;\r\n  ForceTutoring: boolean;\r\n  IsEquipmentTutoring: boolean;\r\n  NotAllowReservations: boolean;\r\n  AllowOneAccSerOnly: boolean;\r\n  AllowReservationCollaborators: number;\r\n  ForceFullDayReservations: boolean;\r\n  IsAdmin: boolean;\r\n  Color: string;\r\n  ServiceGroupId: number;\r\n  ServiceGroupName: string;\r\n  ReservationOfflineServicesEnabled: boolean | null;\r\n  RestrictReservationToTimeSlots: boolean;\r\n  MinOrderHours: number;\r\n  DefaultReservationDuration: number;\r\n  DefaultAccServiceId: number | null;\r\n  BudgetsTurnedOn: boolean;\r\n  Billable: boolean;\r\n  OfflineServices: IEquipmentOfflineServiceTypeDto[];\r\n  FirstCustomFormId: number | null;\r\n  CustomFormId: number | null;\r\n  CustomForms: ICustomFormDto[];\r\n  LoanTypeId: number;\r\n  AllowModification: boolean;\r\n  AllowExtendReservation: boolean;\r\n  AllowUsersToShortenReservations: boolean;\r\n  AllowedToTransfer: boolean;\r\n  AllowedToTransferAll: boolean;\r\n  EnforceReservationRestrictions: boolean;\r\n  LimitlessReservationAllowed: boolean | null;\r\n  checked: boolean;\r\n  disabled: boolean;\r\n  MaxOrderHours: number;\r\n  MinOrderGap: number;\r\n  RestrictDurationUnitsAmount: number | null;\r\n  RestrictDurationUnitType: number | null;\r\n  StaffUserSelectionVisible: boolean | null;\r\n  StaffUserSelectionRequired: boolean | null;\r\n  StaffUserSelection: IUserFilterDto[];\r\n  RequireUserGroupCoordApproval: boolean;\r\n  DraftReservationsTypeId: number;\r\n}\r\nexport interface IReservationEquipmentDto extends Entity<number> {\r\n  Id: number;\r\n  Name: string;\r\n  AssetId: number | null;\r\n  AccServices: IEquipmentAccServiceDto[];\r\n  AssemblyId: number | null;\r\n  HasAssemblyParts: boolean;\r\n  ReservationId?: number;\r\n  HideProjects: boolean;\r\n  AllowPartialProjectCharges: boolean;\r\n  AllowPartialSingleProjectCharges: boolean;\r\n  TrainingSignUpApproval: number;\r\n  HideTrainingSession: boolean;\r\n  HasAttendance: boolean;\r\n  ForceTutoring: boolean;\r\n  IsEquipmentTutoring: boolean;\r\n  NotAllowReservations: boolean;\r\n  AllowOneAccSerOnly: boolean;\r\n  AllowReservationCollaborators: number;\r\n  ForceFullDayReservations: boolean;\r\n  BudgetExperimentSettings: boolean;\r\n  Color: string;\r\n  ServiceGroupId: number;\r\n  ServiceGroupName: string;\r\n  ReservationOfflineServicesEnabled: boolean | null;\r\n  RestrictReservationToTimeSlots: boolean;\r\n  MinOrderHours: number;\r\n  DefaultReservationDuration: number;\r\n  DefaultAccServiceId: number | null;\r\n  BudgetsTurnedOn: boolean;\r\n  Billable: boolean;\r\n  MandatoriesEquipments: IMandatoryEquipmentsDto[];\r\n  OptionalsEquipments: IMandatoryEquipmentsDto[];\r\n  OfflineServices: IEquipmentOfflineServiceTypeDto[];\r\n  FirstCustomFormId: number | null;\r\n  CustomFormId: number | null;\r\n  CustomForms: ICustomFormDto[];\r\n  LoanTypeId: number;\r\n  AllowModification: boolean;\r\n  AllowExtendReservation: boolean;\r\n  AllowUsersToShortenReservations: boolean;\r\n  AllowedToTransfer: boolean;\r\n  AllowedToTransferAll: boolean;\r\n  EnforceReservationRestrictions: boolean;\r\n  LimitlessReservationAllowed: boolean | null;\r\n  MaxOrderHours: number;\r\n  MinOrderGap: number;\r\n  RestrictDurationUnitsAmount: number | null;\r\n  RestrictDurationUnitType: number | null;\r\n  StaffUserSelectionVisible: boolean | null;\r\n  StaffUserSelectionRequired: boolean | null;\r\n  StaffUserSelection: IUserFilterDto[];\r\n  RequireUserGroupCoordApproval: boolean;\r\n  DraftReservationsTypeId: number;\r\n}\r\nexport interface IEquipmentOfflineServiceTypeDto extends Entity<number> {\r\n  Id: number;\r\n  Name: string;\r\n  EquipmentId: number;\r\n  Mandatory: boolean;\r\n  HideProject: boolean;\r\n}\r\n/**\r\n * Represents an entity connected to a budget (e.g. Reservation)\r\n */\r\nexport interface IWithBudget {\r\n  Budget: Entity<number> | null; //IBudgetFilterDto | null;\r\n}\r\nexport interface ReservationDetailsState extends IWithBudget {\r\n  Id: number;\r\n  EquipmentsData: Entity<number>[];\r\n  FatherId?: number | null;\r\n  TrainingSession: ITrainingSessionDto | null;\r\n  StaffUser: Entity<string> | null; //IUserFilterDto | null;\r\n  BookedBy: Entity<string> | null; //IUserFilterDto | null;\r\n  Remarks?: string | null;\r\n  StartTime: Date | string;\r\n  EndTime: Date | string;\r\n  Tutoring: boolean;\r\n  Status?: Entity<number> | null;\r\n  TrainingSignUp: boolean;\r\n  ADGroup?: Entity<string> | null;\r\n  DisplayName?: string | null;\r\n  InstituteProject: Entity<number> | null;\r\n  WorkflowBooking?: Entity<number> | null;\r\n  ExternalCustomer?: Entity<number> | null;\r\n  FundingType?: Entity<number> | null;\r\n  PurchaseOrder?: string | null;\r\n  Reference?: string | null;\r\n  BudgetExperiment?: Entity<number> | null;\r\n  SampleIds: number[];\r\n  PartialAttendance: boolean;\r\n  PartialAttendanceStart?: number | null;\r\n  PartialAttendanceEnd?: number | null;\r\n  TransferredTo: Entity<string> | null;\r\n  WaitingTransferApproval: boolean;\r\n  TransferFromId: number | null;\r\n  SampleRunId?: number | null;\r\n  AccServices: Entity<number>[]; //IAccServiceDto[];\r\n  FormValues: IFormValueDto[];\r\n  CollaboratedUsers: Entity<string>[]; //IUserFilterDto[];\r\n  OptionalsEquipments: CheckEntity[];\r\n  FullDayReservation: boolean;\r\n  AssemblyParts?: IReservationAssemblyPartDto[] | null;\r\n}\r\nexport interface ReservationSettingsState {\r\n  BaseEquipment: IReservationEquipmentDto | null;\r\n  FatherId: number | null;\r\n  Repeat_Period: number | null;\r\n  TrainingSessionOnly: boolean;\r\n  SessionId: number | null;\r\n  RecordDate: Date | string | null;\r\n  LastUpdateDate: Date | string | null;\r\n  Entered: Date | string | null;\r\n  Cancelled: Date | string | null;\r\n  LastUpdateAdmin: Entity<string> | null;\r\n  RepeatEndTime: Date | string | null;\r\n  Repeat: boolean;\r\n  HasCharges: boolean;\r\n  FundingTypeId: number | null;\r\n  ParentAssemblyReservationId: number | null;\r\n  TopAssemblyReservationId: number | null;\r\n  TransferInProgress: boolean;\r\n  HasOfflineServices: boolean;\r\n  HasTrainingSession: boolean;\r\n  NextReservationTime: string | null;\r\n  PartReservations: IReservationPartDto[];\r\n  AssignToServiceRequestId: number | null;\r\n  AssignToServiceRequestRowIds: number[];\r\n  AssignToServiceRequestSampleIds: number[];\r\n  TutorName?: string | null;\r\n  CustomForms: ICustomFormDto[];\r\n  MandatoriesEquipments: IMandatoryEquipmentsDto[];\r\n  OptionalsEquipments: IMandatoryEquipmentsDto[];\r\n  FirstInitEquipments: number[];\r\n  OfflineMandatory: IOtherServices[];\r\n  OfflineOptional: IOtherServices[];\r\n  //localSettings\r\n  UserRequestedByApproval: boolean;\r\n  RecurringUpdateOption: number | null;\r\n  TerminateReservation: boolean;\r\n  Owner: boolean;\r\n  Ongoing: boolean;\r\n  FutureReservation: boolean;\r\n  PastReservation: boolean;\r\n  IsForceTutoring: boolean;\r\n  ForceFullDayReservations: boolean;\r\n  StaffMandatoryEquipment: IReservationEquipmentDto | null;\r\n  TotalCost?: number;\r\n  SaveForLater: boolean;\r\n}\r\nexport interface IReservationDto {\r\n  Id: number;\r\n  EquipmentsData: IReservationEquipmentDto[];\r\n  Budget: IBudgetFilterDto | null; //IBudgetFilterDto | null;\r\n  TrainingSession: ITrainingSessionDto | null; //ITrainingSessionDto | null;\r\n  StaffUser: IUserFilterDto | null; //IUserFilterDto | null;\r\n  BookedBy: IUserFilterDto | null; //IUserFilterDto | null;\r\n  Remarks?: string | null;\r\n  StartTime: Date | string;\r\n  EndTime: Date | string;\r\n  Tutoring: boolean;\r\n  FullDayReservation: boolean;\r\n  TutorName?: string | null;\r\n  StatusId: number;\r\n  TrainingSignUp: boolean;\r\n  ADGroup?: Entity<string> | null;\r\n  DisplayName?: string | null;\r\n  InstituteProject: Entity<number> | null;\r\n  WorkflowBooking?: Entity<number> | null;\r\n  ExternalCustomer?: Entity<number> | null;\r\n  PurchaseOrder?: string | null;\r\n  Reference?: string | null;\r\n  BudgetExperiment?: Entity<number> | null;\r\n  TransferFromId: number | null;\r\n  PartialAttendance: boolean;\r\n  PartialAttendanceStart?: number | null;\r\n  PartialAttendanceEnd?: number | null;\r\n  TransferredTo: Entity<string> | null;\r\n  SampleRunId?: number | null;\r\n  AccServiceId: number | null;\r\n  AccSerIds: string | null;\r\n  AccServices: IEquipmentAccServiceDto[]; //IAccServiceDto[];\r\n  FormValues: IFormValueDto[];\r\n  CollaboratedUsers: IUserFilterDto[]; //IUserFilterDto[];\r\n  SampleIds: number[];\r\n  PartReservations: IReservationPartDto[];\r\n  BaseEquipment: IReservationEquipmentDto | null;\r\n  FatherId: number | null;\r\n  Repeat_Period: number | null;\r\n  TrainingSessionOnly: boolean;\r\n  SessionId: number | null;\r\n  RecordDate: Date | string | null;\r\n  LastUpdateDate: Date | string | null;\r\n  Entered: Date | string | null;\r\n  Cancelled: Date | string | null;\r\n  LastUpdateAdmin: IUserFilterDto | null;\r\n  RepeatEndTime: Date | string | null;\r\n  Repeat: boolean;\r\n  HasCharges: boolean;\r\n\r\n  /**\r\n   * This property is used to read the funding type from the server (initReservation)\r\n   */\r\n  FundingTypeId: number | null;\r\n  ParentAssemblyReservationId: number | null;\r\n  TopAssemblyReservationId: number | null;\r\n  WaitingTransferApproval: boolean;\r\n  TransferInProgress: boolean;\r\n  HasOfflineServices: boolean;\r\n  HasTrainingSession: boolean;\r\n  NextReservationTime: string | null;\r\n  AssignToServiceRequestId: number | null;\r\n  AssignToServiceRequestRowIds: number[];\r\n  AssignToServiceRequestSampleIds: number[];\r\n  CustomForms: ICustomFormDto[];\r\n  MandatoriesEquipments: IMandatoryEquipmentsDto[];\r\n  OptionalsEquipments: IMandatoryEquipmentsDto[];\r\n  TerminateReservation: boolean;\r\n  FirstInitEquipments: number[];\r\n  OfflineMandatory: IOtherServices[];\r\n  IsForceTutoring: boolean;\r\n  ForceFullDayReservations: boolean;\r\n  ForceReservationSettingsState: boolean;\r\n  IsFuture: boolean;\r\n  IsPast: boolean;\r\n  IsOngoing: boolean;\r\n  StaffMandatoryEquipment: IReservationEquipmentDto | null;\r\n  AssemblyParts: IReservationAssemblyPartDto[] | null;\r\n}\r\nexport interface IReservationPartDto {\r\n  Id: number;\r\n  Equipment: IReservationEquipmentDto;\r\n  BudgetID: number | null;\r\n  BudgetName: string | null;\r\n  StartTime: Date | string;\r\n  ParentAssemblyReservationId: number | null;\r\n  TopAssemblyReservationId: number | null;\r\n  AccServiceId: number | null;\r\n  AccSerIds: string | null;\r\n  Repeat_Period: number | null;\r\n}\r\nexport interface ReservationDetailsResponseModel extends IResponseType {\r\n  Id: number | null;\r\n  IsValid: boolean;\r\n  model: IReservationDto;\r\n  insertedModel: ReservationInsertModel;\r\n  warnOnTrainingSession: boolean;\r\n  ReservationIds: number[];\r\n  FirstEquipmentId: number;\r\n  userTrainingsApprovalData: UserTrainingReservationData | null;\r\n  EquipmentChangeResult: ReservationEquipmentsChangeResult | null;\r\n  credit: number | null;\r\n  balance: number | null;\r\n}\r\nexport interface ReservationGlobalState {\r\n  details: ReservationDetailsState;\r\n  settings: ReservationSettingsState;\r\n  customFormFiles: IFormFileValue[];\r\n  RepetitiveOptions: IRepetitiveDto | null;\r\n  offlineServices: IOtherServices[];\r\n}\r\nexport interface ServiceSettingsState {\r\n  HasHideProjects: boolean;\r\n  HasConflictProjects: boolean;\r\n  HasMultipleProjects: boolean;\r\n  HasPartialSingleProject: boolean;\r\n  TrainingSignUpApproval?: number;\r\n  HideTrainingSession: boolean;\r\n  HasAttendance: boolean;\r\n  ForceTutoring: boolean;\r\n  ForceFullDayReservations: boolean;\r\n  IsEquipmentTutoring: boolean;\r\n  NotAllowReservations: boolean;\r\n  AllowOneAccSerOnly: boolean;\r\n  AllowReservationCollaborators: boolean;\r\n  IsAllAdmin: boolean;\r\n  AllOffServicesAllowed: boolean | null;\r\n\r\n  RestrictReservationToTimeSlots: boolean;\r\n  MinOrderHours: number;\r\n  DefaultReservationDuration: number;\r\n  DefaultAccServiceId: number | null;\r\n  BudgetsTurnedOn: boolean;\r\n  Billable: boolean;\r\n  CustomForms: ICustomFormDto[];\r\n  IsLoanDesc: boolean;\r\n  AllowModification: boolean;\r\n  AllowExtendReservation: boolean;\r\n  AllowUsersToShortenReservations: boolean;\r\n  AllowedToTransfer: boolean;\r\n  AllowedToTransferAll: boolean;\r\n  StartSlots: Date | string | null;\r\n  EndSlots: Date | string | null;\r\n  BudgetVisible: boolean;\r\n  OfflineServicesVisible: boolean;\r\n  Groups: number[];\r\n  HasAccServices: boolean;\r\n  MaxOrderHours: number;\r\n  MinOrderGap: number;\r\n  RestrictDurationUnitsAmount: number | null;\r\n  RestrictDurationUnitType: number | null;\r\n  StaffUserVisibleAllways: boolean;\r\n  StaffUserVisibleOnPending: boolean;\r\n  StaffUserRequiredAlwais: boolean;\r\n  StaffUserRequiredOnPending: boolean;\r\n  StaffUserSelection: IUserFilterDto[];\r\n  RequireUserGroupCoordApproval: boolean;\r\n  DraftForAll: boolean;\r\n  DraftApprovalRequred: boolean;\r\n  DraftSaveForLater: boolean;\r\n  budgetExperimentVisible: boolean;\r\n  EnforceReservationRestrictions: boolean;\r\n  LimitlessReservationAllowed: boolean;\r\n  OfflineServiceTypes: IEquipmentOfflineServiceTypeDto[];\r\n}\r\nexport interface EquipmentsChangeStateParameters {\r\n  Equipments: number[];\r\n  AccServices: number[];\r\n  ReservationId: number | null;\r\n  Start: Date | string;\r\n  End: Date | string;\r\n  BookedBy: string | null;\r\n  ADGroup: string | null;\r\n  Tutoring: boolean;\r\n  FullDayReservation: boolean;\r\n  Status: number;\r\n  TrainingSignUp: boolean;\r\n  FundingTypeId: number;\r\n  TrainingSessionId: number | null;\r\n  BudgetId: number | null;\r\n  Remarks: string | null;\r\n  CheckStatus: boolean;\r\n  CheckSession: boolean;\r\n}\r\nexport interface EquipmentSlotParameters {\r\n  EquipmentId: number;\r\n  Start: Date | string;\r\n  End: Date | string;\r\n}\r\n\r\nexport interface ReservationEquipmentsChangeResult {\r\n  CustomForms?: CustomFormsResult;\r\n  ErrorMessages: string[];\r\n  WarningMessages: string[];\r\n  DefaultBudget: IBudgetFilterDto | null;\r\n  StatusChange: StatusChangeResult | null;\r\n  TrainingSessionData: TrainingSessionResult | null;\r\n}\r\nexport interface ReservationValidationResult {\r\n  ErrorMessages: string[];\r\n  WarningMessages: string[];\r\n  PermissionErrors: string[];\r\n  PrerequisiteTrainings?: PrerequisitsResult;\r\n  UserCanRequestApproval?: boolean;\r\n}\r\nexport interface AsyncEquipmentsChangeResult {\r\n  StartSlots: Date | string | null;\r\n  EndSlots: Date | string | null;\r\n}\r\nexport interface StatusChangeResult {\r\n  Status: number;\r\n  Tutoring: boolean;\r\n  IsForceTutoring: boolean;\r\n  ForceFullDayReservations: boolean;\r\n  FullDayReservation: boolean;\r\n}\r\nexport interface TrainingSessionResult {\r\n  TrainingSessionId: number | null;\r\n  Start: Date | string;\r\n  End: Date | string;\r\n  HasTrainingSession: boolean;\r\n  StaffUser: string | null;\r\n}\r\nexport interface PrerequisitsResult {\r\n  PrerequisiteTrainings: Entity<number>[];\r\n  ErrorMessage: string;\r\n  IsValid: boolean;\r\n}\r\nexport interface CustomFormsResult {\r\n  CustomForms: ICustomFormDto[];\r\n  ErrorMessages: string[];\r\n  IsValid: boolean;\r\n}\r\nexport interface UserTrainingEquipments {\r\n  ReservationId: number | null;\r\n  EquipmentId: number;\r\n  EquipmentName: string;\r\n  TrainingRecordId: number | null;\r\n  RequiresAdminApproval: boolean;\r\n  NotShowPopup: boolean;\r\n}\r\nexport interface UserTrainingReservationData {\r\n  UserName: string;\r\n  StartTime: Date | string;\r\n  EndTime: Date | string;\r\n  Equipments: UserTrainingEquipments[];\r\n  FatherId: number | null;\r\n  ReservationId: number | null;\r\n  Tutoring: boolean;\r\n}\r\nexport interface HasUsageEndRresult {\r\n  HasUsage: boolean;\r\n  OfflineServiceTypeIds: number[];\r\n}\r\nexport interface TransferToReservation {\r\n  User: Entity<string>;\r\n  ReservtionId: number;\r\n}\r\nexport interface TransferState {\r\n  User: Entity<string> | null;\r\n  ReservtionId?: number;\r\n  WaitingTransferApproval?: boolean;\r\n  transferProcessing?: boolean;\r\n  transferStepCompleted?: boolean;\r\n}\r\nexport interface RequestReservations {\r\n  RequestId: number | null;\r\n  TotalRowsCount: number | null;\r\n  AssociatedRowsCount: number | null;\r\n}\r\nexport interface TerminationState {\r\n  terminatProcessing?: boolean;\r\n  terminateCompleted?: boolean;\r\n}\r\nexport const getSingleReservationStatus = (val: number): Entity<number> => {\r\n  return enumToEntityArray(ReservationStatus).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\nexport type createReservation_Success_Action = PayloadAction<{\r\n  hasErrors: boolean;\r\n  reservationIds: number[];\r\n  insertModel?: ReservationInsertModel;\r\n}>;\r\nexport interface PricingState {\r\n  credit: number;\r\n  balance: number | null;\r\n}\r\n","import { useState, useMemo, SetStateAction } from 'react';\r\n\r\nexport type AsyncSetState<State> = (\r\n  nextState: SetStateAction<State> | Promise<SetStateAction<State>>,\r\n  cancelToken?: { mounted: boolean },\r\n) => void;\r\n\r\nexport type AsyncExtendState<State> = (\r\n  partialState:\r\n    | SetStateAction<Partial<State>>\r\n    | Promise<SetStateAction<Partial<State>>>,\r\n) => void;\r\n\r\n/**\r\n * A hook similar to React's `useState` which allows you to also pass promises which resolve to the next state.\r\n *\r\n * Also returns an extra method which extends the current state, synchronously and/or asynchronously.\r\n * For the current state to be extended, it must first be a non-null value.\r\n *\r\n * Example:\r\n * ```ts\r\n * interface State {\r\n *   foo: string\r\n *   bar: string\r\n * }\r\n *\r\n * const [ state, setState, extendState ] = useAsyncExtendedState<State>({\r\n *   foo: 'foo',\r\n *   bar: 'bar'\r\n * })\r\n *\r\n * // This works as usual.\r\n * setState({ foo: 'Hello', bar: 'World!' })\r\n * setState(state => ({ foo: 'Hello', bar: 'World!' }))\r\n *\r\n * // This also works.\r\n * const fetchState = () => API.client.get<State>('data').then(response => {\r\n *   return response.data\r\n *\r\n *   // or return (state: State) => {\r\n *     // return response.data\r\n *   // }\r\n * })\r\n *\r\n * // The state will eventually be set to the asynchronously resolved value.\r\n * setState(fetchState())\r\n *\r\n * // Or extend the state immediately.\r\n * extendState({ foo: 'Hello' })\r\n * extendState(state => ({ bar: 'World!' }))\r\n *\r\n * // Or extend the state asynchronously.\r\n * const fetchPartialState = () => API.client.get<Partial<State>>('data').then(response => {\r\n *   return response.data\r\n *\r\n *   // or return (state: State) => {\r\n *     // return response.data\r\n *   // }\r\n * })\r\n *\r\n * // The state will eventually be extended by the asynchronously resolved value.\r\n * extendState(fetchPartialState())\r\n * ```\r\n */\r\nexport const useAsyncExtendedState = <State>(\r\n  initialState: State,\r\n): [State, AsyncSetState<State>, AsyncExtendState<State>] => {\r\n  const [state, setState] = useState<State>(initialState);\r\n\r\n  const asyncSetState: AsyncSetState<State> = useMemo(\r\n    () => async (nextState, cancelToken) => {\r\n      const initialNextState = nextState;\r\n\r\n      try {\r\n        if (nextState instanceof Promise) {\r\n          nextState = await nextState;\r\n\r\n          if (nextState === initialNextState) {\r\n            // there was an error but it was caught by something else - i.e., nextState.catch()\r\n            throw new Error(`Uncatchable error.`);\r\n          }\r\n        }\r\n        if (cancelToken && !cancelToken.mounted) return;\r\n\r\n        setState(state => {\r\n          if (typeof nextState === `function`) {\r\n            nextState = (nextState as (state: State) => State)(state);\r\n          }\r\n\r\n          return nextState as State;\r\n        });\r\n      } catch (error) {}\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [],\r\n  );\r\n\r\n  const asyncExtendState: AsyncExtendState<State> = useMemo(\r\n    () => async partialState => {\r\n      const initialExtendState = partialState;\r\n\r\n      try {\r\n        if (partialState instanceof Promise) {\r\n          partialState = await partialState;\r\n\r\n          if (partialState === initialExtendState) {\r\n            // there was an error but it was caught by something else - i.e., partialState.catch()\r\n            throw new Error(`Uncatchable error.`);\r\n          }\r\n        }\r\n\r\n        setState(state => {\r\n          if (typeof partialState === `function`) {\r\n            partialState = (partialState as (state: State) => Partial<State>)(\r\n              state,\r\n            );\r\n          }\r\n\r\n          return { ...state, ...partialState } as State;\r\n        });\r\n      } catch (err) {}\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [],\r\n  );\r\n\r\n  return [state, asyncSetState, asyncExtendState];\r\n};\r\n","import { selectAppTimeZone } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport React from 'react';\r\n\r\nexport interface ISystemDate {\r\n  newDate: () => Date;\r\n  getOffsetDate: (date: Date | string | undefined | null) => Date;\r\n  getOffset: (date: Date | undefined) => Date;\r\n  systemOffset: number;\r\n  currentTimezoneOffser: number;\r\n  withoutOffset: (date: Date | string | undefined | null) => Date;\r\n  getOffsetDateOrNull: (\r\n    date: Date | string | number | object | undefined | null,\r\n  ) => Date | null;\r\n}\r\n\r\nexport const useSystemDate = (): ISystemDate => {\r\n  const appTimeZone = useSelector(selectAppTimeZone);\r\n  const systemOffset = appTimeZone?.TimezoneOffsetMinutes ?? 0;\r\n  const currentTimezoneOffser = new Date().getTimezoneOffset();\r\n  const getOffset = React.useCallback(\r\n    (date: Date | undefined): Date => {\r\n      const currentDateOffset = (date || new Date()).getTimezoneOffset();\r\n      const appNow = dateUtils.addMinutes(\r\n        date || new Date(),\r\n        systemOffset + currentDateOffset,\r\n      );\r\n      return appNow;\r\n    },\r\n    [systemOffset],\r\n  );\r\n  const newDate = React.useCallback(() => {\r\n    return getOffset(undefined);\r\n  }, [getOffset]);\r\n  const getOffsetDate = React.useCallback(\r\n    (date: Date | string | undefined | null) => {\r\n      if (date === null || date === undefined) {\r\n        return newDate();\r\n      } else {\r\n        let parsedDate = dateUtils.dateOrStringToDate(date);\r\n        return getOffset(parsedDate);\r\n      }\r\n    },\r\n    [getOffset, newDate],\r\n  );\r\n  const getOffsetDateOrNull = React.useCallback(\r\n    (date: Date | string | number | object | undefined | null) => {\r\n      if (date === null || date === undefined) {\r\n        return null;\r\n      } else {\r\n        let localDate = dateUtils.dateFnsUtils.date(date);\r\n        if (localDate === null) return null;\r\n        let parsedDate = dateUtils.dateOrStringToDate(localDate);\r\n        return getOffset(parsedDate);\r\n      }\r\n    },\r\n    [getOffset],\r\n  );\r\n  const withoutOffset = React.useCallback(\r\n    (date: Date | string | undefined | null) => {\r\n      const withOffset =\r\n        date === null || date === undefined\r\n          ? newDate()\r\n          : dateUtils.dateOrStringToDate(date);\r\n      return dateUtils.addMinutes(\r\n        withOffset,\r\n        (withOffset.getTimezoneOffset() + systemOffset) * -1,\r\n      );\r\n    },\r\n    [newDate, systemOffset],\r\n  );\r\n  return {\r\n    newDate,\r\n    getOffsetDate,\r\n    getOffset,\r\n    systemOffset,\r\n    currentTimezoneOffser,\r\n    withoutOffset,\r\n    getOffsetDateOrNull,\r\n  };\r\n};\r\n","/**\r\n *\r\n * ExternalLink\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  Link as MuiLink,\r\n  LinkBaseProps as MuiLinkProps,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { IPathAndQuery, toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { makeStyles } from '@material-ui/styles';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nexport interface ExternalLinkProps extends Omit<MuiLinkProps, 'href'> {\r\n  href: string | IPathAndQuery;\r\n  /**\r\n   * Show external URL icon with copy url functionality\r\n   */\r\n  showIcon?: boolean;\r\n  /**\r\n   * used in case when need to use URL without adding root of the installation so to avoid toRootedURL() method.\r\n   */\r\n  useInlineUrl?: boolean;\r\n  to?: string | IPathAndQuery;\r\n}\r\n\r\n/**\r\n * External link - opens in a new tab/window\r\n * This should be used for all external links and should be clear that it leads to a resource outside of the system\r\n * @param props\r\n * @returns\r\n */\r\nexport const ExternalLink = React.forwardRef(function ExternalLink(\r\n  props: ExternalLinkProps,\r\n  ref,\r\n) {\r\n  return <LinkBehavior ref={ref} {...props} target=\"_blank\" />;\r\n});\r\n\r\n/**\r\n * Link to a resource inside the larger system but external to the React app\r\n * Renders <a href=\"path\" ...\r\n * @param param0\r\n * @returns\r\n */\r\nexport function Link(props: ExternalLinkProps) {\r\n  return <LinkBehavior {...props} />;\r\n}\r\n\r\n/**\r\n * Link that can accept forwarded ref prop. Usefull in the \"override component\" in the material ui\r\n * Usage example: <ListItem component={LinkBehavior} href={'/Reports/OperatingRoomProceduresSummary.aspx'} ...\r\n */\r\nexport const LinkBehavior = React.forwardRef<any, ExternalLinkProps>(\r\n  function LinkBehavior(props, ref) {\r\n    const { href, to, useInlineUrl, ...rest } = props;\r\n    const history = useHistory();\r\n    const classes = useStyles();\r\n    const emptyLink = href === '';\r\n    const absolutePath =\r\n      typeof href === 'string'\r\n        ? useInlineUrl === true\r\n          ? href\r\n          : toRootedURL(href)\r\n        : toRootedURL(\r\n            (href as IPathAndQuery).path,\r\n            (href as IPathAndQuery).search,\r\n          );\r\n    const localPath =\r\n      to !== undefined\r\n        ? typeof to === 'string'\r\n          ? to\r\n          : (to as IPathAndQuery).path +\r\n            '?' +\r\n            toQueryString((to as IPathAndQuery).search)\r\n        : to;\r\n    const { t } = useTranslation();\r\n    const dispatch = useDispatch();\r\n    const { actions } = useAppSettingsSlice();\r\n    const handleLocalPathClick = React.useCallback(() => {\r\n      if (localPath !== undefined) {\r\n        history.push('');\r\n        history.replace(localPath);\r\n      }\r\n    }, [history, localPath]);\r\n    const handleIconClick = () => {\r\n      clipboardWrite(absolutePath).then(() =>\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'success',\r\n            message: `${t(translations.URLCopied)} - ${absolutePath}`,\r\n          }),\r\n        ),\r\n      );\r\n    };\r\n    if (props.showIcon === true) {\r\n      return (\r\n        <span className={classes.externalLinkRoot}>\r\n          <MuiLink\r\n            className={classes.link}\r\n            ref={ref}\r\n            href={\r\n              to === undefined\r\n                ? emptyLink\r\n                  ? undefined\r\n                  : absolutePath\r\n                : undefined\r\n            }\r\n            // href={\r\n            //   onClick ? undefined : to === undefined ? absolutePath : undefined\r\n            // }\r\n            onClick={event => {\r\n              if (to !== undefined) {\r\n                handleLocalPathClick();\r\n              }\r\n              if (!!props.onClick) {\r\n                props.onClick(event);\r\n              }\r\n            }}\r\n            {...rest}\r\n          />\r\n          <Tooltip title={t(translations.CopyURL)}>\r\n            <span>\r\n              <IconButton\r\n                size=\"small\"\r\n                shape=\"square\"\r\n                variant=\"ghost\"\r\n                onClick={handleIconClick}\r\n              >\r\n                <Icon icon=\"external-link\" />\r\n              </IconButton>\r\n            </span>\r\n          </Tooltip>\r\n        </span>\r\n      );\r\n    } else {\r\n      return (\r\n        <MuiLink\r\n          className={classes.link}\r\n          ref={ref}\r\n          href={\r\n            to === undefined\r\n              ? emptyLink\r\n                ? undefined\r\n                : absolutePath\r\n              : undefined\r\n          }\r\n          onClick={event => {\r\n            if (to !== undefined) {\r\n              handleLocalPathClick();\r\n            }\r\n            if (!!props.onClick) {\r\n              props.onClick(event);\r\n            }\r\n          }}\r\n          {...rest}\r\n        />\r\n      );\r\n    }\r\n  },\r\n);\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n  externalLinkRoot: {\r\n    whiteSpace: 'nowrap',\r\n  },\r\n  link: { cursor: 'pointer' },\r\n  externalLinkIcon: {\r\n    display: 'inline',\r\n  },\r\n}));\r\n\r\nconst permissionName = 'clipboard-write' as PermissionName;\r\nconst clipboardWriteEnabled = async () => {\r\n  const result = await navigator.permissions.query({ name: permissionName });\r\n  return result.state === 'granted' || result.state === 'prompt';\r\n};\r\nconst clipboardWrite = async (text: string) => {\r\n  const enabled = await clipboardWriteEnabled();\r\n  if (enabled) {\r\n    const copyResult = await navigator.clipboard.writeText(text);\r\n    return copyResult;\r\n  }\r\n};\r\n","import { Dialog } from '@material-ui/core';\r\nimport { ReactNode } from 'react';\r\nimport clsx from 'clsx';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectIsCoverExpanded } from '../../slice/selectors';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useLayoutSlice } from '../../slice';\r\n\r\nexport interface CoverWrapperProps {\r\n  children: ReactNode;\r\n  open: boolean;\r\n  onClose?: (e: any) => void;\r\n}\r\n\r\nexport const CoverWrapper = ({\r\n  children,\r\n  open,\r\n  onClose,\r\n}: CoverWrapperProps) => {\r\n  const isMobile = DetectIsMobile();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const coverExpanded = useSelector(selectIsCoverExpanded);\r\n  useEffectOnMount(() => {\r\n    dispatch(actions.setIsCoverOpen(open));\r\n  });\r\n  return (\r\n    <div style={{ height: '100%' }} onClick={e => e.stopPropagation()}>\r\n      <Dialog\r\n        fullWidth={coverExpanded || isMobile}\r\n        maxWidth={false}\r\n        className={clsx('coverRoot', {\r\n          coverShortRoot: !coverExpanded || isMobile,\r\n        })}\r\n        hideBackdrop={true}\r\n        scroll=\"paper\"\r\n        disableAutoFocus\r\n        open={open}\r\n        onClose={onClose}\r\n        // BackdropProps={{\r\n        //   invisible: true,\r\n        // }}\r\n        // onBackdropClick={e => {\r\n        //   console.log('cover backdrop click', e);\r\n        //   !!onClose && onClose(e);\r\n        // }}\r\n      >\r\n        {children}\r\n      </Dialog>\r\n    </div>\r\n  );\r\n};\r\n","/**\r\n *\r\n * LinearProgress\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  LinearProgress as MuiLinearProgress,\r\n  LinearProgressProps as MuiLinearProgressProps,\r\n} from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n\r\nexport interface LinearProgressProps\r\n  extends MuiLinearProgressProps,\r\n    AdditionalProps {}\r\ninterface AdditionalProps {\r\n  /**\r\n   * Show/hide the progress bar preventing layout shift.\r\n   */\r\n  visible: boolean | undefined;\r\n}\r\n\r\nfunction LinearProgress1({ visible = false, ...props }: LinearProgressProps) {\r\n  return <MuiLinearProgress {...props} />;\r\n}\r\n\r\n/**\r\n * MUI's LinearProgress extension that helps to prevent layout shift when component is added/removed from the tree.\r\n */\r\nexport const LinearProgress = styled(LinearProgress1)<AdditionalProps>`\r\n  visibility: ${props => (props.visible === true ? 'visible' : 'hidden')};\r\n`;\r\n","import * as React from 'react';\r\nimport { LinearProgress } from 'app/components/LinearProgress';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { TitlePage } from './TitlePage';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport {\r\n  SwitchActions,\r\n  SwitchActionsProps,\r\n} from '../PageActions/SwitchActions';\r\nimport { SkeletonIfLoading } from './SkeletonIfLoading';\r\nimport { useTheme } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\nimport clsx from 'clsx';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface HeadProps {\r\n  closable: boolean | undefined;\r\n  useSidePanel: boolean;\r\n  closePanel: () => void;\r\n  pageName: React.ReactNode;\r\n  titlePage: string | undefined;\r\n  pageLink: string | undefined;\r\n  toPageLink?: string;\r\n  titleTooltip: string | undefined;\r\n  isMobile: boolean;\r\n  disableExpandToggle: boolean | undefined;\r\n  expandPanel: () => void;\r\n  subTitlePage?: React.ReactNode;\r\n  leftTopActions?: ActionRenderer[];\r\n  rightTopActions?: ActionRenderer[];\r\n  onSubmit?: () => void;\r\n  switchState?: SwitchActionsProps;\r\n  useSwithActions?: boolean;\r\n  showProcessing?: boolean;\r\n  loading: boolean;\r\n  isCover?: boolean;\r\n  rightTopActionsLength?: number;\r\n  rightActionsLoading?: boolean;\r\n}\r\nconst TitleRoot = styled('div')(({ theme }) => ({\r\n  '&.page-wrapper-title-root': {\r\n    paddingTop: '24px',\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'center',\r\n    width: '100%',\r\n    gap: '24px',\r\n    '.topIcons': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'flex-end',\r\n      alignItems: 'center',\r\n      alignSelf: 'end',\r\n      padding: 0,\r\n      gap: theme.spacing(1.25),\r\n      '.topRightIcons': {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        position: 'absolute',\r\n        padding: 0,\r\n        gap: '12px',\r\n        top: theme.spacing(2),\r\n      },\r\n    },\r\n    '.titleContainer': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      //justifyContent: 'space-between',\r\n      //alignItems: 'flex-end',\r\n      alignItems: 'center',\r\n      gap: '24px',\r\n      padding: '0px 32px',\r\n      width: '100%',\r\n      alignSelf: 'stretch',\r\n      //gap: theme.spacing(4.5),\r\n      '.titleSubtitle': {\r\n        display: 'flex',\r\n        alignItems: 'center',\r\n        gap: '8px',\r\n        flex: '1 0 0',\r\n        // flexDirection: 'column',\r\n        // alignItems: 'flex-start',\r\n        // padding: 0,\r\n        '& .titleAndDescription': {\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          gap: '4px',\r\n          flex: '1 0 0',\r\n          '& .titleContent': {\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            justifyContent: 'center',\r\n            alignItems: 'flex-start',\r\n            gap: '8px',\r\n            alignSelf: 'stretch',\r\n            '& .iconAdjustment': {\r\n              display: 'flex',\r\n              paddingTop: '2px',\r\n              alignItems: 'flex-start',\r\n              gap: '10px',\r\n              '& .textButton': {\r\n                display: 'flex',\r\n                flexDirection: 'column',\r\n                alignItems: 'flex-start',\r\n                gap: '10px',\r\n              },\r\n            },\r\n            '& .pageDescription': {\r\n              display: 'flex',\r\n              alignItems: 'center',\r\n              gap: '8px',\r\n            },\r\n            '& .subPageDescription': {\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              alignItems: 'flex-start',\r\n              gap: '4px',\r\n              flex: '1 0 0',\r\n            },\r\n          },\r\n        },\r\n      },\r\n      '.rightControls': {\r\n        display: 'flex',\r\n        //flexDirection: 'row',\r\n        alignItems: 'center',\r\n        //padding: 0,\r\n        gap: '8px',\r\n      },\r\n    },\r\n  },\r\n}));\r\nexport function Head(props: HeadProps) {\r\n  const { t } = useTranslation();\r\n  const theme = useTheme();\r\n  const {\r\n    closable,\r\n    useSidePanel,\r\n    closePanel,\r\n    pageName,\r\n    titlePage,\r\n    pageLink,\r\n    titleTooltip,\r\n    isMobile,\r\n    disableExpandToggle,\r\n    expandPanel,\r\n    subTitlePage,\r\n    leftTopActions,\r\n    rightTopActions,\r\n    onSubmit,\r\n    showProcessing,\r\n    loading,\r\n    useSwithActions,\r\n    switchState,\r\n    isCover,\r\n    rightTopActionsLength,\r\n    rightActionsLoading,\r\n  } = props;\r\n  const actionsLength = React.useMemo(() => {\r\n    if (rightTopActions !== undefined && rightTopActions.length > 0) {\r\n      let res = rightTopActionsLength !== undefined ? rightTopActionsLength : 1;\r\n      if (res > rightTopActions.length) {\r\n        res = rightTopActions.length;\r\n      }\r\n      return res;\r\n    } else return 0;\r\n  }, [rightTopActions, rightTopActionsLength]);\r\n  return (\r\n    <SkeletonIfLoading loading={loading}>\r\n      <TitleRoot\r\n        theme={theme}\r\n        className={clsx('page-wrapper-title-root', { cover: isCover })}\r\n      >\r\n        <div className={'titleContainer'}>\r\n          <div className={'titleSubtitle'}>\r\n            <div className={'titleAndDescription'}>\r\n              <div className={'titleContent'}>\r\n                {pageName && (\r\n                  <div className={'iconAdjustment'}>\r\n                    <div className={'textButton'}>\r\n                      <Button\r\n                        variant=\"textGray\"\r\n                        size=\"small\"\r\n                        aria-label=\"minimize\"\r\n                        title={\r\n                          !isMobile && useSidePanel && !disableExpandToggle\r\n                            ? t(translations.ShowLess)\r\n                            : undefined\r\n                        }\r\n                        startIcon={\r\n                          !isMobile && useSidePanel && !disableExpandToggle ? (\r\n                            <Icon icon={['fas', 'arrow-left']} />\r\n                          ) : undefined\r\n                        }\r\n                        onClick={() =>\r\n                          !isMobile &&\r\n                          useSidePanel &&\r\n                          !disableExpandToggle &&\r\n                          expandPanel()\r\n                        }\r\n                      >\r\n                        {pageName}\r\n                      </Button>\r\n                      {/* <Body bold={true} color=\"secondary\">\r\n                         {pageName}\r\n                      </Body> */}\r\n                    </div>\r\n                  </div>\r\n                )}\r\n                <div className={'pageDescription'}>\r\n                  {titlePage ? (\r\n                    <TitlePage\r\n                      title={titlePage}\r\n                      pageLink={pageLink}\r\n                      useSidePanel={useSidePanel}\r\n                      buttonsLenth={0}\r\n                      tooltip={titleTooltip}\r\n                      expandPanel={\r\n                        !isMobile &&\r\n                        useSidePanel &&\r\n                        !disableExpandToggle &&\r\n                        !pageName\r\n                          ? expandPanel\r\n                          : undefined\r\n                      }\r\n                    />\r\n                  ) : (\r\n                    <Skeleton variant=\"text\" width=\"20ch\" />\r\n                  )}\r\n                </div>\r\n                {subTitlePage && (\r\n                  <div className={'subPageDescription'}>\r\n                    <Body size=\"small\">{subTitlePage}</Body>\r\n                  </div>\r\n                )}\r\n              </div>\r\n            </div>\r\n            <div className={'rightControls'}>\r\n              <>\r\n                {!!leftTopActions &&\r\n                  leftTopActions?.length > 0 &&\r\n                  leftTopActions?.map((item, index) => (\r\n                    <span key={index}>{item(onSubmit)}</span>\r\n                  ))}\r\n                {rightActionsLoading &&\r\n                  (!rightTopActions ||\r\n                    (!!rightTopActions && rightTopActions?.length === 0)) && (\r\n                    <React.Fragment>\r\n                      <Skeleton\r\n                        width={'80px'}\r\n                        height={'40px'}\r\n                        style={{\r\n                          backgroundColor: bookitColors.grayscale.graySelection,\r\n                        }}\r\n                      />\r\n                      <Skeleton\r\n                        width={'80px'}\r\n                        height={'40px'}\r\n                        style={{\r\n                          backgroundColor: bookitColors.grayscale.graySelection,\r\n                        }}\r\n                      />\r\n                      <Skeleton\r\n                        width={'40px'}\r\n                        height={'40px'}\r\n                        style={{\r\n                          backgroundColor: bookitColors.grayscale.graySelection,\r\n                        }}\r\n                      />\r\n                    </React.Fragment>\r\n                  )}\r\n                {!!rightTopActions && rightTopActions?.length > 0 && (\r\n                  <React.Fragment>\r\n                    {rightTopActions\r\n                      .filter((t, index) => index < actionsLength)\r\n                      .map(f => (\r\n                        <span>{f(onSubmit)}</span>\r\n                      ))}\r\n                    <ReactActions\r\n                      id={`sidepanel_top_actions`}\r\n                      size=\"small\"\r\n                      items={rightTopActions\r\n                        .filter((ot, ind) => ind >= actionsLength)\r\n                        .map((item, index) => (\r\n                          <span key={index}>{item(onSubmit)}</span>\r\n                        ))}\r\n                      keepOpen={false}\r\n                    ></ReactActions>\r\n                  </React.Fragment>\r\n                )}\r\n                {useSwithActions && switchState && (\r\n                  <React.Fragment>\r\n                    <SwitchActions\r\n                      target={switchState.target}\r\n                      getProps={switchState.getProps}\r\n                    />\r\n                  </React.Fragment>\r\n                )}\r\n                {closable && useSidePanel && (\r\n                  <IconButton\r\n                    variant=\"ghost\"\r\n                    aria-label=\"close\"\r\n                    size=\"small\"\r\n                    shape=\"square\"\r\n                    title={t(translations.Close)}\r\n                    onClick={closePanel}\r\n                  >\r\n                    <Icon\r\n                      icon=\"times\"\r\n                      size=\"lg\"\r\n                      color=\"default\"\r\n                      colorExtend=\"textHover\"\r\n                    />\r\n                  </IconButton>\r\n                )}\r\n              </>\r\n            </div>\r\n          </div>\r\n        </div>\r\n        {showProcessing && (\r\n          <div style={{ width: '100%' }}>\r\n            <LinearProgress\r\n              variant=\"query\"\r\n              color=\"primary\"\r\n              visible={showProcessing}\r\n            />\r\n          </div>\r\n        )}\r\n      </TitleRoot>\r\n    </SkeletonIfLoading>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { TitlePage } from './TitlePage';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport {\r\n  SwitchActions,\r\n  SwitchActionsProps,\r\n} from '../PageActions/SwitchActions';\r\nimport styled from 'styled-components';\r\nimport { useTheme } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { LinearProgress } from 'app/components/LinearProgress';\r\nimport { useAbsolute } from 'utils/url-utils';\r\n\r\nexport interface ShortHeadProps {\r\n  closable: boolean | undefined;\r\n  useSidePanel: boolean;\r\n  closePanel: () => void;\r\n  pageName: React.ReactNode;\r\n  titlePage: string | undefined;\r\n  pageLink: string | undefined;\r\n  toPageLink?: string;\r\n  titleTooltip: string | undefined;\r\n  isMobile: boolean;\r\n  disableExpandToggle: boolean | undefined;\r\n  expandPanel: () => void;\r\n  subTitlePage?: React.ReactNode;\r\n  leftTopActions?: ActionRenderer[];\r\n  rightTopActions?: ActionRenderer[];\r\n  rightTopActionsAsMenu?: boolean;\r\n  switchState?: SwitchActionsProps;\r\n  useSwithActions?: boolean;\r\n  onSubmit?: () => void;\r\n  showProcessing?: boolean;\r\n  loading: boolean;\r\n  isCover?: boolean;\r\n  useShortView?: boolean;\r\n  hideMenu?: boolean;\r\n}\r\nconst ShortTitleRoot = styled('div')(({ theme }) => ({\r\n  '&.page-wrapper-short-title-root': {\r\n    padding: 0,\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'flex-start',\r\n    width: '100%',\r\n    gap: theme.spacing(1.25),\r\n    '.shortTitleContainer': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'space-between',\r\n      padding: theme.spacing(2, 2, 1.5),\r\n      alignItems: 'flex-start',\r\n      width: '100%',\r\n      gap: theme.spacing(0.5),\r\n      '.iconAndTitle': {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        padding: 0,\r\n        width: '100%',\r\n        gap: theme.spacing(1.5),\r\n        alignSelf: 'center',\r\n      },\r\n      '.shortRightIcons': {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        padding: 0,\r\n        gap: '8px',\r\n      },\r\n    },\r\n    '.shortSwithContainer': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      alignSelf: 'stretch',\r\n      width: '100%',\r\n      gap: 10,\r\n      padding: theme.spacing(1, 3, 2),\r\n      // '.shortSwithButtons': {\r\n      //   display: 'flex',\r\n      //   flexDirection: 'row',\r\n      //   alignItems: 'center',\r\n      //   width: '100%',\r\n      //   height: '32px',\r\n      //   border: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n      //   background: bookitColors.base.white,\r\n      //   borderRadius: '6px',\r\n      //   //padding: theme.spacing(0.25, 0.25),\r\n      //   //gap: '12px',\r\n      //   justifyContent: 'stretch',\r\n      // },\r\n    },\r\n  },\r\n}));\r\nexport function ShortHead(props: ShortHeadProps) {\r\n  const { t } = useTranslation();\r\n  const {\r\n    closable,\r\n    useSidePanel,\r\n    closePanel,\r\n    titlePage,\r\n    pageLink,\r\n    toPageLink,\r\n    titleTooltip,\r\n    isMobile,\r\n    disableExpandToggle,\r\n    expandPanel,\r\n    rightTopActions,\r\n    rightTopActionsAsMenu,\r\n    onSubmit,\r\n    useSwithActions,\r\n    switchState,\r\n    showProcessing,\r\n    loading,\r\n    isCover,\r\n    useShortView,\r\n    hideMenu,\r\n  } = props;\r\n  const theme = useTheme();\r\n  const topIconsLength = React.useMemo(() => {\r\n    return (\r\n      (!isMobile && useSidePanel && !disableExpandToggle ? 1 : 0) +\r\n      (closable && useSidePanel ? 1 : 0) +\r\n      (rightTopActions !== undefined && rightTopActions.length > 0\r\n        ? rightTopActions.length === 1 && !rightTopActionsAsMenu\r\n          ? 1\r\n          : rightTopActions.length === 2 && !rightTopActionsAsMenu\r\n          ? 2\r\n          : 1\r\n        : 0)\r\n    );\r\n  }, [\r\n    closable,\r\n    disableExpandToggle,\r\n    isMobile,\r\n    rightTopActions,\r\n    rightTopActionsAsMenu,\r\n    useSidePanel,\r\n  ]);\r\n  const absolutePageLink = useAbsolute(pageLink, toPageLink);\r\n  return (\r\n    <ShortTitleRoot\r\n      theme={theme}\r\n      className={clsx('page-wrapper-short-title-root', { cover: isCover })}\r\n    >\r\n      <div className={'shortTitleContainer'}>\r\n        <div className={'iconAndTitle'}>\r\n          {loading ? (\r\n            <Skeleton variant=\"text\" width=\"20ch\" />\r\n          ) : (\r\n            <React.Fragment>\r\n              {titlePage && (\r\n                <TitlePage\r\n                  title={titlePage}\r\n                  pageLink={pageLink}\r\n                  toPageLink={toPageLink}\r\n                  useSidePanel={useSidePanel}\r\n                  buttonsLenth={topIconsLength}\r\n                  tooltip={titleTooltip}\r\n                  isCover={isCover}\r\n                  useShortView={useShortView}\r\n                  hideMenu={hideMenu}\r\n                  toExpandPanel={\r\n                    !isMobile &&\r\n                    useSidePanel &&\r\n                    !disableExpandToggle &&\r\n                    !isCover\r\n                      ? expandPanel\r\n                      : undefined\r\n                  }\r\n                />\r\n              )}\r\n            </React.Fragment>\r\n          )}\r\n        </div>\r\n        <div className={'shortRightIcons'}>\r\n          {loading ? (\r\n            <Skeleton variant=\"rect\" width=\"32px\" height=\"32px\" />\r\n          ) : (\r\n            <React.Fragment>\r\n              {rightTopActions !== undefined && rightTopActions.length > 0 && (\r\n                <>\r\n                  {rightTopActions.length === 1 && !rightTopActionsAsMenu ? (\r\n                    <span>{rightTopActions[0](onSubmit)}</span>\r\n                  ) : rightTopActions.length === 2 && !rightTopActionsAsMenu ? (\r\n                    <React.Fragment>\r\n                      <span>{rightTopActions[0](onSubmit)}</span>\r\n                      <span>{rightTopActions[1](onSubmit)}</span>\r\n                    </React.Fragment>\r\n                  ) : (\r\n                    <ReactActions\r\n                      size=\"small\"\r\n                      id={`sidepanel_top_actions`}\r\n                      items={\r\n                        [\r\n                          ...rightTopActions?.map((item, index) => (\r\n                            <span key={index}>{item(onSubmit)}</span>\r\n                          )),\r\n                        ].filter(v => !!v) as JSX.Element[]\r\n                      }\r\n                    ></ReactActions>\r\n                  )}\r\n                </>\r\n              )}\r\n              <React.Fragment>\r\n                {!isMobile &&\r\n                  absolutePageLink !== undefined &&\r\n                  (useSidePanel || isCover) &&\r\n                  !disableExpandToggle && (\r\n                    <IconButton\r\n                      variant=\"ghost\"\r\n                      aria-label=\"maximize\"\r\n                      size=\"small\"\r\n                      shape=\"square\"\r\n                      onClick={() => {\r\n                        if (isCover) {\r\n                          if (!!absolutePageLink) {\r\n                            window.open(absolutePageLink, '_blank');\r\n                          }\r\n                        } else {\r\n                          expandPanel();\r\n                        }\r\n                      }}\r\n                    >\r\n                      <Icon\r\n                        icon={'external-link-alt'}\r\n                        color=\"default\"\r\n                        colorExtend=\"textHover\"\r\n                      />\r\n                    </IconButton>\r\n                  )}\r\n                {closable && useSidePanel && (\r\n                  <IconButton\r\n                    variant=\"ghost\"\r\n                    aria-label=\"close\"\r\n                    size=\"small\"\r\n                    shape=\"square\"\r\n                    onClick={closePanel}\r\n                    title={t(translations.CloseSidePanel)}\r\n                  >\r\n                    <Icon\r\n                      icon=\"times\"\r\n                      size=\"lg\"\r\n                      color=\"default\"\r\n                      colorExtend=\"textHover\"\r\n                    />\r\n                  </IconButton>\r\n                )}\r\n              </React.Fragment>\r\n            </React.Fragment>\r\n          )}\r\n        </div>\r\n      </div>\r\n      {useSwithActions && switchState && !loading && (\r\n        <div className={'shortSwithContainer'}>\r\n          <SwitchActions\r\n            target={switchState.target}\r\n            getProps={switchState.getProps}\r\n          />\r\n        </div>\r\n      )}\r\n      {showProcessing && (\r\n        <LinearProgress\r\n          visible={showProcessing ?? false}\r\n          variant=\"query\"\r\n          color=\"primary\"\r\n        />\r\n      )}\r\n    </ShortTitleRoot>\r\n  );\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const TopButtonsContainer = styled('div')(({ theme }) => ({\r\n  display: 'flex',\r\n  flexDirection: 'row',\r\n  justifyContent: 'space-between',\r\n  alignItems: 'center',\r\n  '.leftButtons': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'flex-start',\r\n    alignItems: 'center',\r\n    width: 'auto',\r\n    gap: theme.spacing(1),\r\n  },\r\n  '.rightButtons': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'flex-start',\r\n    alignItems: 'center',\r\n    width: 'auto',\r\n    gap: theme.spacing(1),\r\n  },\r\n}));\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { TopButtonsContainer } from '../styled';\r\n\r\nexport interface ButtonsPanelProps {\r\n  leftActions?: ActionRenderer[];\r\n  rightActions?: ActionRenderer[];\r\n  isMobile: boolean;\r\n  sidePanelExpanded: boolean;\r\n  disableExpandToggle: boolean | undefined;\r\n  useSidePanel: boolean;\r\n  onSubmit?: () => void;\r\n  expandPanel: () => void;\r\n  leftActionsMaxLength?: number;\r\n}\r\n\r\nexport function ButtonsPanel(props: ButtonsPanelProps) {\r\n  const { t } = useTranslation();\r\n  const {\r\n    leftActions,\r\n    rightActions,\r\n    isMobile,\r\n    sidePanelExpanded,\r\n    disableExpandToggle,\r\n    useSidePanel,\r\n    onSubmit,\r\n    expandPanel,\r\n    leftActionsMaxLength = 1,\r\n  } = props;\r\n  const theme = useTheme();\r\n  return (\r\n    <TopButtonsContainer theme={theme}>\r\n      <div className={'leftButtons'}>\r\n        <React.Fragment>\r\n          {!!leftActions && leftActions?.length > 0 && (\r\n            <React.Fragment>\r\n              {leftActions.length > leftActionsMaxLength ? (\r\n                <React.Fragment>\r\n                  {[...Array(leftActionsMaxLength).keys()].map(x => (\r\n                    <span key={`Act${x}`}>{leftActions[x](onSubmit)}</span>\r\n                  ))}\r\n                  {!isMobile && useSidePanel && !disableExpandToggle && (\r\n                    <Button\r\n                      variant=\"ghost\"\r\n                      size=\"small\"\r\n                      id=\"pw_bp_showMore\"\r\n                      onClick={expandPanel}\r\n                    >\r\n                      <Body bold={true} size=\"small\">\r\n                        {sidePanelExpanded\r\n                          ? t(translations.ShowLess)\r\n                          : t(translations.MoreOptionsMobile)}\r\n                      </Body>\r\n                    </Button>\r\n                  )}\r\n                  <ReactActions\r\n                    id={`left_bottom_actions`}\r\n                    iconVariant=\"ghost\"\r\n                    size=\"small\"\r\n                    items={leftActions\r\n                      .filter((item, index) => index > leftActionsMaxLength - 1)\r\n                      .filter(item => item !== undefined)\r\n                      .map((item, index) => (\r\n                        <span key={index}>{item(onSubmit)}</span>\r\n                      ))}\r\n                  ></ReactActions>\r\n                </React.Fragment>\r\n              ) : (\r\n                <React.Fragment>\r\n                  {leftActions?.map((item, index) => (\r\n                    <span key={index}>{item(onSubmit)}</span>\r\n                  ))}\r\n                  {!isMobile && useSidePanel && !disableExpandToggle && (\r\n                    <Button\r\n                      variant=\"ghostColor\"\r\n                      size=\"small\"\r\n                      id=\"pw_bp_showMore\"\r\n                      onClick={expandPanel}\r\n                    >\r\n                      <Body bold={true} size=\"small\">\r\n                        {sidePanelExpanded\r\n                          ? t(translations.ShowLess)\r\n                          : t(translations.MoreOptionsMobile)}\r\n                      </Body>\r\n                    </Button>\r\n                  )}\r\n                </React.Fragment>\r\n              )}\r\n            </React.Fragment>\r\n          )}\r\n        </React.Fragment>\r\n      </div>\r\n      <div className={'rightButtons'}>\r\n        <>\r\n          {!!rightActions &&\r\n            rightActions?.length > 0 &&\r\n            rightActions?.map((item, index) => (\r\n              <span key={index}>{item(onSubmit)}</span>\r\n            ))}\r\n        </>\r\n      </div>\r\n    </TopButtonsContainer>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { ActionRenderer } from '../PageActions/ActionRender';\r\nimport styled from 'styled-components';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface TopButtonsPanelProps {\r\n  rightTopActions?: ActionRenderer[];\r\n  leftTopActions?: ActionRenderer[];\r\n  maxLeftTopButtonsLength?: number;\r\n  showShortView: boolean;\r\n  onSubmit?: () => void;\r\n  expandPanel: () => void;\r\n  leftActionsLoading?: boolean;\r\n}\r\n\r\nconst TopButtonsContainer = styled('div')(({ theme }) => ({\r\n  display: 'flex',\r\n  flexDirection: 'row',\r\n  justifyContent: 'flex-start',\r\n  alignItems: 'center',\r\n  paddingInline: theme.spacing(2, 0),\r\n  '.leftButtons': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'flex-start',\r\n    alignItems: 'center',\r\n    width: 'auto',\r\n    gap: theme.spacing(1),\r\n  },\r\n}));\r\nexport function TopButtonsPanel(props: TopButtonsPanelProps) {\r\n  const {\r\n    leftTopActions,\r\n    showShortView,\r\n    onSubmit,\r\n    maxLeftTopButtonsLength = 2,\r\n    leftActionsLoading,\r\n  } = props;\r\n  const theme = useTheme();\r\n  return (\r\n    <TopButtonsContainer theme={theme}>\r\n      <div className={'leftButtons'}>\r\n        <React.Fragment>\r\n          {leftActionsLoading &&\r\n            (!leftTopActions ||\r\n              (!!leftTopActions && leftTopActions?.length === 0)) && (\r\n              <React.Fragment>\r\n                <Skeleton\r\n                  width={'80px'}\r\n                  height={'40px'}\r\n                  style={{\r\n                    backgroundColor: bookitColors.grayscale.graySelection,\r\n                  }}\r\n                />\r\n                <Skeleton\r\n                  width={'80px'}\r\n                  height={'40px'}\r\n                  style={{\r\n                    backgroundColor: bookitColors.grayscale.graySelection,\r\n                  }}\r\n                />\r\n                <Skeleton\r\n                  width={'40px'}\r\n                  height={'40px'}\r\n                  style={{\r\n                    backgroundColor: bookitColors.grayscale.graySelection,\r\n                  }}\r\n                />\r\n              </React.Fragment>\r\n            )}\r\n          {!!leftTopActions && leftTopActions?.length > 0 && (\r\n            <React.Fragment>\r\n              {showShortView ? (\r\n                <React.Fragment>\r\n                  {leftTopActions.length > maxLeftTopButtonsLength ? (\r\n                    <React.Fragment>\r\n                      {leftTopActions\r\n                        .filter((f, i) => i < maxLeftTopButtonsLength)\r\n                        .map((f, i) => (\r\n                          <span key={'leftAction' + i}>{f(onSubmit)}</span>\r\n                        ))}\r\n                      {/* <span key=\"firstAct\">{leftTopActions[0](onSubmit)}</span>\r\n                      <span key=\"secondAct\">{leftTopActions[1](onSubmit)}</span> */}\r\n                      <ReactActions\r\n                        id={`left_top_actions`}\r\n                        iconVariant=\"white\"\r\n                        size=\"small\"\r\n                        keepOpen={false}\r\n                        items={leftTopActions\r\n                          .filter(\r\n                            (item, index) => index >= maxLeftTopButtonsLength,\r\n                          )\r\n                          .map((item, index) => (\r\n                            <span key={index}>{item(onSubmit)}</span>\r\n                          ))}\r\n                      ></ReactActions>\r\n                    </React.Fragment>\r\n                  ) : (\r\n                    <React.Fragment>\r\n                      {leftTopActions?.map((item, index) => (\r\n                        <span key={index}>{item(onSubmit)}</span>\r\n                      ))}\r\n                    </React.Fragment>\r\n                  )}\r\n                </React.Fragment>\r\n              ) : (\r\n                <React.Fragment>\r\n                  {leftTopActions?.map((item, index) => (\r\n                    <span key={index}>{item(onSubmit)}</span>\r\n                  ))}\r\n                </React.Fragment>\r\n              )}\r\n            </React.Fragment>\r\n          )}\r\n        </React.Fragment>\r\n      </div>\r\n    </TopButtonsContainer>\r\n  );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport {\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport React from 'react';\r\nimport { TopButtonsContainer } from '../styled';\r\n\r\nexport interface FormSkeletonProps {\r\n  fullPage: boolean;\r\n}\r\nconst thingsCount = 15;\r\nconst getRandomWidth = () => {\r\n  return (Math.random() * 40 + 50).toFixed(0).toString() + '%';\r\n};\r\nexport const ButtonsSkeleton = () => {\r\n  const theme = useTheme();\r\n  return (\r\n    <TopButtonsContainer theme={theme}>\r\n      <div className={'leftButtons'}>\r\n        <Skeleton width=\"64px\" height=\"32px\" />\r\n        <Skeleton width=\"64px\" height=\"32px\" />\r\n      </div>\r\n      <div className={'rightButtons'}>\r\n        <Skeleton width=\"64px\" height=\"32px\" />\r\n      </div>\r\n    </TopButtonsContainer>\r\n  );\r\n};\r\nexport const FormSkeleton = (props: FormSkeletonProps) => {\r\n  return (\r\n    <StyledFormFieldsContainer\r\n      sectionStyle={{\r\n        overflow: 'hidden',\r\n        height: '95%',\r\n        paddingInline: '16px',\r\n      }}\r\n    >\r\n      <FormLeftSection>\r\n        {[...Array(thingsCount).keys()].map(i => (\r\n          <Skeleton\r\n            key={i}\r\n            width={getRandomWidth()}\r\n            component={Math.random() > 0.5 ? 'h1' : 'p'}\r\n          />\r\n        ))}\r\n      </FormLeftSection>\r\n      <FormRightSection>\r\n        {props.fullPage &&\r\n          [...Array(thingsCount).keys()].map(i => (\r\n            <Skeleton\r\n              key={i}\r\n              width={getRandomWidth()}\r\n              component={Math.random() > 0.5 ? 'h1' : 'p'}\r\n            />\r\n          ))}\r\n      </FormRightSection>\r\n    </StyledFormFieldsContainer>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { ActionRenderer } from './PageActions/ActionRender';\r\nimport { useLayoutSlice } from '../../slice';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectHideNavigation,\r\n  selectIsCoverExpanded,\r\n  selectIsCoverOpen,\r\n} from '../../slice/selectors';\r\nimport clsx from 'clsx';\r\nimport { CoverWrapper } from '../CoverWrapper';\r\nimport { Head } from './components/Head';\r\nimport { ShortHead } from './components/ShortHead';\r\nimport { ButtonsPanel } from './components/ButtonsPanel';\r\nimport { TopButtonsPanel } from './components/TopButtonsPanel';\r\nimport { SwitchActionsProps } from './PageActions/SwitchActions';\r\nimport { ButtonsSkeleton, FormSkeleton } from './components/FormSkeleton';\r\nimport styled from 'styled-components';\r\nimport { useTheme } from '@material-ui/styles';\r\nimport { bookitShadows } from 'styles/shadows/bookitShadow';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport {\r\n  selectIsSubBarCollapsed,\r\n  selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nexport type PageContentRenderer = () => React.ReactNode;\r\n\r\nexport interface PageWrapperProps extends CoverProps {\r\n  children: React.ReactNode;\r\n  pageName?: React.ReactNode;\r\n  titlePage?: string;\r\n  subTitlePage?: React.ReactNode;\r\n  leftActions?: ActionRenderer[];\r\n  rightActions?: ActionRenderer[];\r\n  rightTopActions?: ActionRenderer[];\r\n  leftTopActions?: ActionRenderer[];\r\n  onSubmit?: () => void;\r\n  onClose?: () => void;\r\n  closeSidePanel?: () => void;\r\n  closable?: boolean;\r\n  useSidePanel: boolean;\r\n  loading?: boolean;\r\n  confirm?: JSX.Element;\r\n  pageLink?: string;\r\n  toPageLink?: string;\r\n  cover?: React.ReactNode;\r\n  disableExpandToggle?: boolean;\r\n  titleTooltip?: string;\r\n  switchState?: SwitchActionsProps;\r\n  useSwitchActions?: boolean;\r\n  topProcessing?: boolean;\r\n  maxLeftTopButtonsLength?: number;\r\n  rightTopActionsAsMenu?: boolean;\r\n  hideTitleBar?: boolean;\r\n  leftActionsMaxLength?: number;\r\n  rightTopActionsLength?: number;\r\n  leftActionsLoading?: boolean;\r\n  rightActionsLoading?: boolean;\r\n  useShortView?: boolean;\r\n  hideMenu?: boolean;\r\n  id?: string;\r\n}\r\n\r\nexport interface CoverProps {\r\n  isCover?: boolean;\r\n  closeCover?: () => void;\r\n  coverClosed?: boolean;\r\n}\r\n\r\nconst PageWrapperRoot = styled('div')(({ theme }) => ({\r\n  '&.page-wrapper-root': {\r\n    background: bookitColors.grayscale.grayBackground,\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'flex-start',\r\n    padding: 0,\r\n    //minWidth: '360px',\r\n    gap: 8,\r\n    '.sidePanelRoot &': {\r\n      background: bookitColors.base.white,\r\n    },\r\n    '&.covered': {\r\n      filter: 'brightness(30%)',\r\n    },\r\n    '&.cover:not(.covered)': {\r\n      // height: '95vh',\r\n      height: 'calc(100dvh - 50px)',\r\n      //height: '100vh',\r\n      '& [class*=\"tableButtonsRootShort\"]': {\r\n        maxWidth: '320px',\r\n      },\r\n    },\r\n    '&.baseNavigationHeight': {\r\n      height: '97dvh',\r\n    },\r\n    '&.baseRootUsePanelHeight': {\r\n      height: '99.9dvh',\r\n    },\r\n    '&.baseRootUsePanelShortHeight': {\r\n      // height: '97vh',\r\n      height: 'calc(100dvh - 50px)',\r\n      minWidth: 'unset',\r\n    },\r\n    '&.baseRootHeight': {\r\n      height: '91dvh',\r\n      '&.subBarExpanded': {\r\n        height: '85dvh',\r\n      },\r\n    },\r\n    '.content': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      width: '100%',\r\n      padding: '8px 0 0',\r\n      '&.contentRoot': {\r\n        justifyContent: 'space-between',\r\n        height: '100%',\r\n        overflow: 'hidden',\r\n      },\r\n      '&.contentMobRoot': {\r\n        justifyContent: 'space-between',\r\n        padding: theme.spacing(1, 0, 0, 0),\r\n        height: '100%',\r\n        //height: '90%',\r\n        //gap: theme.spacing(2),\r\n        flex: '0 1 calc(100% - 50px)',\r\n        overflow: 'hidden',\r\n        '&.hideTitleBar': {\r\n          padding: '0px',\r\n          flex: '0 1 100%',\r\n        },\r\n      },\r\n      '&.hideTitleBar': {\r\n        padding: '0px',\r\n      },\r\n      '.contentContainer': {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        padding: 0,\r\n        width: '100%',\r\n        height: '100%',\r\n        position: 'relative',\r\n        overflowY: 'auto',\r\n        gap: '32px',\r\n        '&::-webkit-scrollbar': {\r\n          width: '6px',\r\n          // '&&': {\r\n          //   background: 'yelow',\r\n          // },\r\n        },\r\n        '&::-webkit-scrollbar-thumb': {\r\n          boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n          borderRadius: '6px',\r\n          backgroundColor: theme.palette.common.grayBorders,\r\n        },\r\n        '&.showShortView': {\r\n          gap: '16px',\r\n          marginBottom: '16px',\r\n        },\r\n      },\r\n      //TO DO: find a way to add a box-shadow to bottom toolbar in case when content is scrollable so it match to the Figma.\r\n      '.bottomToolbar': {\r\n        position: 'static',\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        width: '100%',\r\n        background: bookitColors.base.white,\r\n        borderRadius: 'unset',\r\n        padding: theme.spacing(2, 3, 2, 3),\r\n        boxShadow: bookitShadows.shadowBorderTop,\r\n        marginBottom: 'env(safe-area-inset-bottom, 50px)',\r\n        flexShrink: 0,\r\n        flexGrow: 0,\r\n        '&.showShortView': {\r\n          gap: '8px',\r\n          boxShadow: bookitShadows.shadowBorderTop,\r\n        },\r\n      },\r\n    },\r\n  },\r\n}));\r\n\r\nexport const PageWrapper = React.memo(function PageWrapper(\r\n  props: PageWrapperProps,\r\n) {\r\n  const {\r\n    pageName,\r\n    titlePage,\r\n    subTitlePage,\r\n    children,\r\n    leftActions,\r\n    rightActions,\r\n    rightTopActions,\r\n    leftTopActions,\r\n    loading,\r\n    onSubmit,\r\n    onClose,\r\n    closeSidePanel,\r\n    closable,\r\n    useSidePanel,\r\n    confirm,\r\n    pageLink,\r\n    toPageLink,\r\n    cover,\r\n    closeCover,\r\n    disableExpandToggle,\r\n    titleTooltip,\r\n    isCover,\r\n    switchState,\r\n    useSwitchActions: useSwithActions,\r\n    topProcessing,\r\n    maxLeftTopButtonsLength,\r\n    rightTopActionsAsMenu,\r\n    hideTitleBar,\r\n    leftActionsMaxLength,\r\n    rightTopActionsLength,\r\n    leftActionsLoading,\r\n    rightActionsLoading,\r\n    useShortView,\r\n    coverClosed,\r\n    hideMenu,\r\n    id,\r\n  } = props;\r\n  // const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const coverExpanded = useSelector(selectIsCoverExpanded);\r\n  const hideNavigation = useSelector(selectHideNavigation);\r\n  const isCoverOpen = useSelector(selectIsCoverOpen);\r\n  const collapsedBar = useSelector(selectIsSubBarCollapsed);\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n  const isCovered = !!cover;\r\n  const [isCoverClosed, setIsCoverClosed] = React.useState<boolean | undefined>(\r\n    coverClosed,\r\n  );\r\n  const showShortView = React.useMemo(() => {\r\n    return (\r\n      isMobile ||\r\n      (useSidePanel && !sidePanelExpanded) ||\r\n      (isCover && !coverExpanded) ||\r\n      useShortView\r\n    );\r\n  }, [\r\n    coverExpanded,\r\n    isCover,\r\n    isMobile,\r\n    sidePanelExpanded,\r\n    useShortView,\r\n    useSidePanel,\r\n  ]);\r\n\r\n  const closePanel = () => {\r\n    if (isCover) {\r\n      closeCover?.();\r\n      dispatch(actions.setIsCoverOpen(false));\r\n      return;\r\n    }\r\n    if (closeSidePanel) {\r\n      closeSidePanel();\r\n    } else {\r\n      dispatch(actions.resetSidePanel());\r\n    }\r\n    if (onClose) {\r\n      onClose();\r\n    }\r\n  };\r\n  const expandPanel = () => {\r\n    if (isCover) {\r\n      dispatch(actions.setIsCoverExpanded(!coverExpanded));\r\n    } else {\r\n      dispatch(actions.setExpanded(!sidePanelExpanded));\r\n    }\r\n  };\r\n  const onCoveredClick = event => {\r\n    if (\r\n      isCovered &&\r\n      isCoverOpen &&\r\n      !!event.target.id &&\r\n      event.target.id.indexOf('page-wrapper-root') > -1\r\n    ) {\r\n      closeCover?.();\r\n      dispatch(actions.setIsCoverOpen(false));\r\n    }\r\n  };\r\n  const theme = useTheme();\r\n  React.useEffect(() => {\r\n    setIsCoverClosed(coverClosed);\r\n  }, [coverClosed]);\r\n  React.useEffect(() => {\r\n    if (isCoverOpen && isCover && isCoverClosed) {\r\n      closeCover?.();\r\n      dispatch(actions.setIsCoverOpen(false));\r\n      setIsCoverClosed(undefined);\r\n    }\r\n  }, [actions, closeCover, isCoverClosed, dispatch, isCover, isCoverOpen]);\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapperRoot\r\n        theme={theme}\r\n        id={id !== undefined ? `page-wrapper-root-${id}` : 'page-wrapper-root'}\r\n        key=\"page-wrapper-root\"\r\n        onClick={onCoveredClick}\r\n        className={clsx('page-wrapper-root', {\r\n          covered: isCovered,\r\n          cover: isCover || !!cover,\r\n          baseRootUsePanelHeight:\r\n            (useSidePanel || isMobile) &&\r\n            !(useSidePanel && isMobile) &&\r\n            !isCover &&\r\n            !cover,\r\n          baseRootUsePanelShortHeight: useSidePanel && isMobile,\r\n          baseRootHeight: !useSidePanel && !hideNavigation && !isMobile,\r\n          subBarExpanded:\r\n            !useSidePanel &&\r\n            !hideNavigation &&\r\n            !isMobile &&\r\n            !collapsedBar &&\r\n            showGroups &&\r\n            !isCovered,\r\n          baseNavigationHeight: !useSidePanel && hideNavigation,\r\n        })}\r\n      >\r\n        {!hideTitleBar && (\r\n          <React.Fragment>\r\n            {showShortView ? (\r\n              <ShortHead\r\n                closable={closable}\r\n                useSidePanel={useSidePanel}\r\n                closePanel={closePanel}\r\n                pageName={pageName}\r\n                titlePage={titlePage}\r\n                pageLink={pageLink}\r\n                toPageLink={toPageLink}\r\n                titleTooltip={titleTooltip}\r\n                isMobile={isMobile}\r\n                disableExpandToggle={disableExpandToggle}\r\n                expandPanel={expandPanel}\r\n                subTitlePage={subTitlePage}\r\n                leftTopActions={leftTopActions}\r\n                rightTopActions={rightTopActions}\r\n                onSubmit={onSubmit}\r\n                switchState={switchState}\r\n                useSwithActions={useSwithActions && !loading}\r\n                showProcessing={topProcessing}\r\n                loading={!!loading}\r\n                rightTopActionsAsMenu={rightTopActionsAsMenu}\r\n                isCover={isCover || !!cover}\r\n                useShortView={useShortView}\r\n                hideMenu={hideMenu}\r\n              />\r\n            ) : (\r\n              <Head\r\n                closable={closable}\r\n                useSidePanel={useSidePanel}\r\n                closePanel={closePanel}\r\n                pageName={pageName}\r\n                titlePage={titlePage}\r\n                pageLink={pageLink}\r\n                toPageLink={toPageLink}\r\n                titleTooltip={titleTooltip}\r\n                isMobile={isMobile}\r\n                disableExpandToggle={disableExpandToggle || isCover}\r\n                expandPanel={expandPanel}\r\n                subTitlePage={subTitlePage}\r\n                leftTopActions={leftTopActions}\r\n                rightTopActions={rightTopActions}\r\n                onSubmit={onSubmit}\r\n                switchState={switchState}\r\n                useSwithActions={useSwithActions && !loading}\r\n                showProcessing={topProcessing}\r\n                loading={!!loading}\r\n                isCover={isCover}\r\n                rightTopActionsLength={rightTopActionsLength}\r\n                rightActionsLoading={rightActionsLoading}\r\n              />\r\n            )}\r\n          </React.Fragment>\r\n        )}\r\n        <div\r\n          className={clsx('content', {\r\n            contentRoot: !showShortView,\r\n            contentMobRoot: showShortView,\r\n            hideTitleBar: hideTitleBar,\r\n          })}\r\n        >\r\n          <React.Fragment>\r\n            <div\r\n              className={clsx('contentContainer', {\r\n                showShortView: showShortView,\r\n              })}\r\n            >\r\n              {loading ? (\r\n                <FormSkeleton fullPage={!showShortView} />\r\n              ) : (\r\n                <React.Fragment>\r\n                  {showShortView &&\r\n                    ((leftTopActions && leftTopActions.length > 0) ||\r\n                      leftActionsLoading) && (\r\n                      <TopButtonsPanel\r\n                        leftTopActions={leftTopActions}\r\n                        rightTopActions={rightTopActions}\r\n                        showShortView={showShortView}\r\n                        onSubmit={onSubmit}\r\n                        expandPanel={expandPanel}\r\n                        maxLeftTopButtonsLength={maxLeftTopButtonsLength}\r\n                        leftActionsLoading={leftActionsLoading}\r\n                      />\r\n                    )}\r\n                  <React.Fragment>{children}</React.Fragment>\r\n                </React.Fragment>\r\n              )}\r\n            </div>\r\n            <React.Fragment>\r\n              {confirm}\r\n              {leftActions && leftActions?.length > 0 && (\r\n                <div\r\n                  className={clsx('bottomToolbar', {\r\n                    showShortView: showShortView,\r\n                  })}\r\n                >\r\n                  {/* {showShortView &&\r\n                    !isMobile &&\r\n                    useSidePanel &&\r\n                    !disableExpandToggle &&\r\n                    leftActions &&\r\n                    leftActions?.length > 1 && (\r\n                      <React.Fragment>\r\n                        {loading ? (\r\n                          <div className=\"showMore\">\r\n                            <Skeleton width=\"8ch\" />\r\n                          </div>\r\n                        ) : (\r\n                          <div className=\"showMore\">\r\n                            <Button\r\n                              variant=\"text\"\r\n                              size=\"small\"\r\n                              onClick={expandPanel}\r\n                            >\r\n                              <Body bold={true} size=\"small\">\r\n                                {sidePanelExpanded\r\n                                  ? t(translations.ShowLess)\r\n                                  : t(translations.ShowMore)}\r\n                              </Body>\r\n                            </Button>\r\n                          </div>\r\n                        )}\r\n                      </React.Fragment>\r\n                    )} */}\r\n                  {loading ? (\r\n                    <ButtonsSkeleton />\r\n                  ) : (\r\n                    <ButtonsPanel\r\n                      leftActions={leftActions}\r\n                      rightActions={rightActions}\r\n                      isMobile={isMobile}\r\n                      sidePanelExpanded={sidePanelExpanded}\r\n                      disableExpandToggle={disableExpandToggle || isCover}\r\n                      useSidePanel={useSidePanel}\r\n                      onSubmit={onSubmit}\r\n                      expandPanel={expandPanel}\r\n                      leftActionsMaxLength={leftActionsMaxLength}\r\n                    />\r\n                  )}\r\n                </div>\r\n              )}\r\n            </React.Fragment>\r\n          </React.Fragment>\r\n        </div>\r\n        {useSidePanel && !!cover && (\r\n          <CoverWrapper onClose={closeCover} open={isCovered}>\r\n            {cover}\r\n          </CoverWrapper>\r\n        )}\r\n      </PageWrapperRoot>\r\n    </React.Fragment>\r\n  );\r\n});\r\n","/**\r\n * Compile time guard on Union Type switch\r\n * Usage example:\r\n * ```\r\n * type Union = 'apple' | 'banana' | 'orange';\r\n * function test(arg: Union) {\r\n *    switch (arg) {\r\n *      case 'apple':\r\n *        ...\r\n *      case 'banana':\r\n *        ...\r\n *      default:\r\n *        // this will generate a comiple warning since 'orange' is not handled in the switch\r\n *        assertExhaustive(arg);\r\n *    }\r\n * }\r\n */\r\nexport function assertExhaustive(value: never, message?: string): never {\r\n  throw new Error(\r\n    message ?? `Reached unexpected case in exhaustive switch: ${value}`,\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.offlineServiceState || initialState;\r\n\r\nexport const selectProcessing = createSelector(\r\n  [selectSlice],\r\n  state => state.processing,\r\n);\r\nexport const selectInitConsumablesProcessing = createSelector(\r\n  [selectSlice],\r\n  state => state.consumablesProcessing,\r\n);\r\nexport const selectService = createSelector(\r\n  [selectSlice],\r\n  state => state.detailsState,\r\n);\r\nexport const selectServiceProcessing = createSelector(\r\n  [selectService],\r\n  state => state.processing,\r\n);\r\nexport const selectServicenError = createSelector(\r\n  [selectService],\r\n  state => state.error,\r\n);\r\nexport const selectServiceHasError = createSelector(\r\n  [selectService],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectServiceCompleted = createSelector(\r\n  [selectService],\r\n  state => state.completed,\r\n);\r\nexport const selectServiceData = createSelector(\r\n  [selectService],\r\n  state => state.data,\r\n);\r\nexport const selectConnectedInitState = createSelector(\r\n  [selectSlice],\r\n  state => state.connectedDataState,\r\n);\r\nexport const selectServiceChangeState = createSelector(\r\n  [selectSlice],\r\n  state => state.serviceChangeResultState,\r\n);\r\nexport const selectFieldHandler = createSelector(\r\n  [selectSlice],\r\n  state => state.valueHandler,\r\n);\r\nexport const selectCreditState = createSelector(\r\n  [selectSlice],\r\n  state => state.creditState,\r\n);\r\nexport const selectCredit = createSelector(\r\n  [selectCreditState],\r\n  state => state.data,\r\n);\r\nexport const selectCreditProcessing = createSelector(\r\n  [selectCreditState],\r\n  state => state.processing,\r\n);\r\nexport const selectCreditCompleted = createSelector(\r\n  [selectCreditState],\r\n  state => state.completed,\r\n);\r\nexport const selectHasCharges = createSelector(\r\n  [selectSlice],\r\n  state => state.hasCharges,\r\n);\r\nexport const selectConsumablesState = createSelector(\r\n  [selectSlice],\r\n  state => state.consumablesState,\r\n);\r\nexport const selectSavedReservationService = createSelector(\r\n  [selectSlice],\r\n  state => state.savedReservationService,\r\n);\r\nexport const selectConsumablesProcessing = createSelector(\r\n  [selectConsumablesState],\r\n  state => state.processing,\r\n);\r\nexport const selectConsumablesData = createSelector(\r\n  [selectConsumablesState],\r\n  state => state.data,\r\n);\r\nexport const selectConsumablesError = createSelector(\r\n  [selectConsumablesState],\r\n  state => state.error,\r\n);\r\nexport const selectConsumablesHasErrors = createSelector(\r\n  [selectConsumablesState],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectConsumablesCompleted = createSelector(\r\n  [selectConsumablesState],\r\n  state => state.completed,\r\n);\r\nexport const selectConsumablesValueHandler = createSelector(\r\n  [selectSlice],\r\n  state => state.consumablesValueHandler,\r\n);\r\nexport const selectSelectedServiceType = createSelector(\r\n  [selectSlice],\r\n  state => state.selectedServiceTypes,\r\n);\r\nexport const selectEditCreatableService = createSelector(\r\n  [selectSlice],\r\n  state => state.editCreatableService,\r\n);\r\nexport const selectBarcodeScanned = createSelector(\r\n  [selectSlice],\r\n  state => state.barcodeScanned,\r\n);\r\nexport const selectRefreshConsumableServices = createSelector(\r\n  [selectSlice],\r\n  state => state.refeshOfflineServices,\r\n);\r\nexport const selectStockRenewalsState = createSelector(\r\n  [selectSlice],\r\n  state => state.stockRenewalState,\r\n);\r\nexport const selectStockRenewalProcessing = createSelector(\r\n  [selectStockRenewalsState],\r\n  state => state.processing,\r\n);\r\nexport const selectStockRenewalData = createSelector(\r\n  [selectStockRenewalsState],\r\n  state => state.data,\r\n);\r\nexport const selectStockRenewalError = createSelector(\r\n  [selectStockRenewalsState],\r\n  state => state.error,\r\n);\r\nexport const selectStockRenewalHasErrors = createSelector(\r\n  [selectStockRenewalsState],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectStockRenewalCompleted = createSelector(\r\n  [selectStockRenewalsState],\r\n  state => state.completed,\r\n);\r\nexport const selectStockRenewalValueHandler = createSelector(\r\n  [selectSlice],\r\n  state => state.stockRenewalValueHandler,\r\n);\r\nexport const selectRenewStockState = createSelector(\r\n  [selectSlice],\r\n  state => state.renewStockState,\r\n);\r\nexport const selectRenewStockProcessing = createSelector(\r\n  [selectRenewStockState],\r\n  state => state.processing,\r\n);\r\nexport const selectRenewStockData = createSelector(\r\n  [selectRenewStockState],\r\n  state => state.data,\r\n);\r\nexport const selectRenewStockError = createSelector(\r\n  [selectRenewStockState],\r\n  state => state.error,\r\n);\r\nexport const selectRenewStockHasErrors = createSelector(\r\n  [selectRenewStockState],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectRenewStockCompleted = createSelector(\r\n  [selectRenewStockState],\r\n  state => state.completed,\r\n);\r\nexport const selectRenewStockValueHandler = createSelector(\r\n  [selectSlice],\r\n  state => state.renewStockValueHandler,\r\n);\r\nexport const selectIsEdit = createSelector(\r\n  [selectSlice],\r\n  state => state.isEdit,\r\n);\r\n\r\nexport const selectInventoryBatchState = createSelector(\r\n  [selectSlice],\r\n  state => state.inventoryBatchState,\r\n);\r\nexport const selectInventoryBatchProcessing = createSelector(\r\n  [selectInventoryBatchState],\r\n  state => state.processing,\r\n);\r\nexport const selectInventoryBatchData = createSelector(\r\n  [selectInventoryBatchState],\r\n  state => state.data,\r\n);\r\nexport const selectInventoryBatchError = createSelector(\r\n  [selectInventoryBatchState],\r\n  state => state.error,\r\n);\r\nexport const selectInventoryBatchHasErrors = createSelector(\r\n  [selectInventoryBatchState],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectInventoryBatchCompleted = createSelector(\r\n  [selectInventoryBatchState],\r\n  state => state.completed,\r\n);\r\nexport const selectInventoryBatchValueHandler = createSelector(\r\n  [selectSlice],\r\n  state => state.inventoryBatchValueHandler,\r\n);\r\nexport const selectInventoryBatchIsEdit = createSelector(\r\n  [selectSlice],\r\n  state => state.batchIsEdit,\r\n);\r\nexport const selectInventoryBatchEditable = createSelector(\r\n  [selectSlice],\r\n  state => state.inventoryBatchEditable,\r\n);\r\nexport const selectCreatableService = createSelector(\r\n  [selectSlice],\r\n  state => state.getCreatableService,\r\n);\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.reservation || initialState;\r\n\r\nexport const selectReservationState = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\nexport const selectProcessing = createSelector(\r\n  [selectReservationState],\r\n  state => state.processing,\r\n);\r\nexport const selectReservation = createSelector(\r\n  [selectReservationState],\r\n  state => state.detailsState,\r\n);\r\nexport const selectReservationProcessing = createSelector(\r\n  [selectReservation],\r\n  state => state.processing,\r\n);\r\nexport const selectReservationError = createSelector(\r\n  [selectReservation],\r\n  state => state.error,\r\n);\r\nexport const selectReservationHasError = createSelector(\r\n  [selectReservation],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectReservationCompleted = createSelector(\r\n  [selectReservation],\r\n  state => state.completed,\r\n);\r\nexport const selectReservationData = createSelector(\r\n  [selectReservation],\r\n  state => state.data,\r\n);\r\nexport const selectReservationSettings = createSelector(\r\n  [selectReservationState],\r\n  state => state.reservationSettingsState,\r\n);\r\nexport const selectEquipmentsSettings = createSelector(\r\n  [selectReservationState],\r\n  state => state.equipmentsSettingsState,\r\n);\r\nexport const selectConfirmAssistedReservations = createSelector(\r\n  [selectReservationState],\r\n  state => state.confirmAssistedReservations,\r\n);\r\nexport const selectUserTrainingData = createSelector(\r\n  [selectReservationState],\r\n  state => state.trainingsData,\r\n);\r\nexport const selectFieldHandler = createSelector(\r\n  [selectReservationState],\r\n  state => state.valueHandler,\r\n);\r\nexport const selectRequestedValueFor = createSelector(\r\n  [selectReservationState],\r\n  state => state.requestedValueFor,\r\n);\r\nexport const selectRequestedValue = createSelector(\r\n  [selectReservationState],\r\n  state => state.requestedValue,\r\n);\r\nexport const selectEquipmentChangeState = createSelector(\r\n  [selectReservationState],\r\n  state => state.equipmentChangeResultState,\r\n);\r\nexport const selectEquipmentChangeCompleted = createSelector(\r\n  [selectReservationState],\r\n  state => state.isChangeCompleted,\r\n);\r\nexport const selectAsyncChangeLoading = createSelector(\r\n  [selectReservationState],\r\n  state => state.asyncChangeLoading,\r\n);\r\n\r\nexport const selectTransferState = createSelector(\r\n  [selectReservationState],\r\n  state => state.transferState,\r\n);\r\nexport const selectTransferProcessing = createSelector(\r\n  [selectTransferState],\r\n  state => state.transferProcessing,\r\n);\r\nexport const selectTransferStepCompleted = createSelector(\r\n  [selectTransferState],\r\n  state => state.transferStepCompleted,\r\n);\r\nexport const selectTransferToUser = createSelector(\r\n  [selectTransferState],\r\n  state => state.User,\r\n);\r\nexport const selectTransferReservation = createSelector(\r\n  [selectTransferState],\r\n  state => state.ReservtionId,\r\n);\r\nexport const selectTransferWaitingApproval = createSelector(\r\n  [selectTransferState],\r\n  state => state.WaitingTransferApproval,\r\n);\r\nexport const selectCreditState = createSelector(\r\n  [selectSlice],\r\n  state => state.creditState,\r\n);\r\nexport const selectCredit = createSelector(\r\n  [selectCreditState],\r\n  state => state.data,\r\n);\r\nexport const selectCreditProcessing = createSelector(\r\n  [selectCreditState],\r\n  state => state.processing,\r\n);\r\nexport const selectCreditCompleted = createSelector(\r\n  [selectCreditState],\r\n  state => state.completed,\r\n);\r\nexport const selectHasCharges = createSelector(\r\n  [selectSlice],\r\n  state => state.hasCharges,\r\n);\r\nexport const selectSavedOfflineServices = createSelector(\r\n  [selectSlice],\r\n  state => state.savedOfflineServices,\r\n);\r\nexport const selectRefreshOfflineServices = createSelector(\r\n  [selectSlice],\r\n  state => state.refeshOfflineService,\r\n);\r\nexport const selectTerminateState = createSelector(\r\n  [selectSlice],\r\n  state => state.terminationState,\r\n);\r\nexport const selectTerminateProcessing = createSelector(\r\n  [selectTerminateState],\r\n  state => state.terminatProcessing,\r\n);\r\nexport const selectTerminateCompleted = createSelector(\r\n  [selectTerminateState],\r\n  state => state.terminateCompleted,\r\n);\r\nexport const selectCloneReservations = createSelector(\r\n  [selectSlice],\r\n  state => state.cloneReservation,\r\n);\r\nexport const selectReservationDtoState = createSelector(\r\n  [selectSlice],\r\n  state => state.reservationDtoState,\r\n);\r\nexport const selectIsEdit = createSelector(\r\n  [selectSlice],\r\n  state => state.isEdit,\r\n);\r\nexport const selectSavedForLater = createSelector(\r\n  [selectReservationSettings],\r\n  state => state?.SaveForLater,\r\n);\r\nexport const selectIsCreditSubmited = createSelector(\r\n  [selectSlice],\r\n  state => state.submitCredit,\r\n);\r\nexport const selectByApprovalErrors = createSelector(\r\n  [selectSlice],\r\n  state => state.ByApprovalErrors,\r\n);\r\nexport const selectUserCanRequestApproval = createSelector(\r\n  [selectSlice],\r\n  state => state.userCanRequestApproval,\r\n);\r\nexport const selectRefreshWorkOrderLink = createSelector(\r\n  [selectSlice],\r\n  state => state.refreshWorkOrderLink,\r\n);\r\nexport const selectReservationNotFound = createSelector(\r\n  [selectSlice],\r\n  state => state.notFound,\r\n);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { TextFieldProps } from '../TextField';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport BaseTextField from '../BasicInputs/BaseTextField';\r\n\r\nexport const FormTextField = ({\r\n  label,\r\n  onChange,\r\n  onBlur,\r\n  value,\r\n  name,\r\n  error,\r\n  helperText,\r\n  ...props\r\n}: FieldHookConfig<string> &\r\n  Omit<TextFieldProps, 'helperText'> &\r\n  IFieldProps) => {\r\n  const [field, meta] = useField<string>({ name, ...props });\r\n  const handleChange = e => {\r\n    if (onChange !== undefined) {\r\n      onChange(e);\r\n    }\r\n    field.onChange(e);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <BaseTextField\r\n      name={name}\r\n      label={label ?? t(translations[name])}\r\n      fullWidth={props.fullWidth}\r\n      variant=\"filled\"\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? ''}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error || helperText}\r\n      id={props.id || 'textfieldId'}\r\n      inputProps={{\r\n        ...props.inputProps,\r\n        'aria-label': `${label ? undefined : 'text input'}`,\r\n      }}\r\n      color=\"primary\"\r\n      InputProps={{\r\n        ...props.InputProps,\r\n        endAdornment: (\r\n          <React.Fragment>\r\n            {props.info ? <InfoIcon title={props.info} /> : null}\r\n            {props.InputProps?.endAdornment}\r\n          </React.Fragment>\r\n        ),\r\n      }}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n","export enum ConfigurableTypes {\r\n  ColumnScreenConfig = 1,\r\n  ColumnExportConfig = 2,\r\n  ColumnFinExportConfig = 3,\r\n}\r\nexport enum ExportTypes {\r\n  CSV = 1,\r\n  XLS = 2,\r\n  XLSX = 3,\r\n}\r\nexport enum ScreensId {\r\n  // \"~/UsageHistory.aspx\"\r\n  UsageHistory = 1,\r\n  // \"~/History.aspx\"\r\n  ReservationHistory = 2,\r\n  // \"~/UsagePaymentReport.aspx\"\r\n  UsagePaymentReport = 3,\r\n  // \"~/Budgets.aspx\"\r\n  Budgets = 4,\r\n  // \"~/ServiceRequests.aspx\"\r\n  ServiceRequests = 5,\r\n  // \"~/UserTraining.aspx\"\r\n  UserTraining = 6,\r\n  // \"~/Alerts/default.aspx\"\r\n  Alerts = 7,\r\n  // \"~/Invoices/Default.aspx\"\r\n  Invoices = 8,\r\n  // \"~/Invoices/Default.aspx\"\r\n  InvoicesList = 9,\r\n  // \"~/ProjectPlanningReport.aspx\"\r\n  ProjectPlanningReport = 10,\r\n  // \"~/Assets/Default.aspx\"\r\n  AssetSearch = 11,\r\n  // \"~/Admin/Assets/Default.aspx\"\r\n  AssetsList = 12,\r\n  // \"~/Invoices/Create.aspx\"\r\n  EstimatedInvoices = 13,\r\n  // \"~/Alerts/UserTickets.aspx\"\r\n  AlertsTickets = 14,\r\n  // \"~/Alerts/AssignedToMe.aspx\"\r\n  AlertsAssignedTo = 15,\r\n  // \"~/Alerts/MyAssets.aspx\"\r\n  MyAssets = 16,\r\n  // \"~/TrainingProgramsList.aspx\"\r\n  UpcomingTrainingSessions = 17,\r\n  // \"~/CoresDirectory.aspx\"\r\n  CoresDirectory = 18,\r\n  // \"~/Maps/Buildings.aspx\"\r\n  Buildings = 19,\r\n  // \"~/Maps/Rooms.aspx\"\r\n  Rooms = 20,\r\n  // \"~/Reports/Default.aspx\"\r\n  AdHocReports = 21,\r\n  // \"~/Documents.aspx\"\r\n  Documents = 22,\r\n  // \"~/Messages.aspx\"\r\n  CalendarMessages = 23,\r\n  // \"~/TrainingWaitingList\"\r\n  TrainingWaitingList = 24,\r\n  // \"~/Users\"\r\n  Users = 25,\r\n  //~/EmailNotifications\r\n  Email = 26,\r\n  //~/Experiments/experimenttemplates\r\n  ExperimentTemplate = 27,\r\n  //~/UsersHistory\r\n  UsersHistory = 28,\r\n  // ~/Assets/Details.aspx?id=\r\n  ShortAssetsList = 29,\r\n  //~/Quizzes\r\n  Quizzes = 30,\r\n  //~/Submissions\r\n  Submissions = 31,\r\n  //~/UserTrainingHistory\r\n  UserTrainingHistory = 32,\r\n  //~/OtherServices\r\n  OtherServices = 33,\r\n  //~/Invoices/InvoiceLetterTemplates.aspx\r\n  InvoiceLetters = 34,\r\n  //~/Charges\r\n  Charges = 35,\r\n  //~/Locations\r\n  Locations = 36,\r\n  //~/Locations/Building\r\n  BuildingRooms = 37,\r\n  //~/Campuses.aspx\r\n  Campuses = 38,\r\n  //~/Areas.aspx\r\n  Areas = 39,\r\n  //~/LocationList.aspx\r\n  LocationList = 40,\r\n  //~/Categories.aspx\r\n  Categories = 41,\r\n  //~/CategoryGroups.aspx\r\n  CategoryGroups = 42,\r\n  //~/SendEmailToUsers\r\n  SendEmailToUsers = 43,\r\n  //~/OnlineBudgetsStatus\r\n  OnlineBudgetsStatus = 366659,\r\n  //~/InvoiceBatches\r\n  InvoiceBatches = 44,\r\n  //\"~/Invoices/Details\"\r\n  InvoiceCharges = 45,\r\n  //~/BillingActions\r\n  BillingActions = 46,\r\n  //~/LocationTypes\r\n  LocationTypes = 47,\r\n  //~/mylists\r\n  SavedViews = 48,\r\n  SubLocationList = 49,\r\n  SubLocationTypes = 50,\r\n  Schedule = 51,\r\n  PricePeriod = 52,\r\n  InvoiceTemplates = 53,\r\n  Articles = 54,\r\n  Expenses = 55,\r\n  UserAttributes = 56,\r\n  SampleRunsDetails = 57,\r\n  SamplesList = 58,\r\n  SampleRequests = 59,\r\n  OfflineServiceTypes = 60,\r\n  SampelsRunsList = 61,\r\n  SamplesPlates = 62,\r\n  SamplesModifications = 63,\r\n  PublicAssets = 64,\r\n  //~/Assets/Inventory/Log\r\n  BarcodeScanLog = 65,\r\n  ServiceRequestAuditTrailHistory = 66,\r\n  // \"~/Maps/Areas/Default.aspx\"\r\n  Floors = 67,\r\n  // ~/Invoices/SubscriptionTypes/Default.aspx\r\n  SubscriptionTypes = 68,\r\n  // \"~/Experiments/Default.aspx\"\r\n  BudgetExperiments = 69,\r\n  Regions = 70,\r\n  SuperGroup = 71,\r\n}\r\n","import { RootStateKeyType } from '../types/injector-typings';\r\nimport {\r\n  createSlice as createSliceOriginal,\r\n  SliceCaseReducers,\r\n  CreateSliceOptions,\r\n} from '@reduxjs/toolkit';\r\n\r\n/* Wrap createSlice with stricter Name options */\r\n\r\n/* istanbul ignore next */\r\nexport const createSlice = <\r\n  State,\r\n  CaseReducers extends SliceCaseReducers<State>,\r\n  Name extends RootStateKeyType\r\n>(\r\n  options: CreateSliceOptions<State, CaseReducers, Name>,\r\n) => {\r\n  return createSliceOriginal(options);\r\n};\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport * as Yup from 'yup';\r\n\r\nexport const EntityNumberSchema: Yup.SchemaOf<Entity<number>> = Yup.object({\r\n  Id: Yup.number().required(),\r\n  Name: Yup.string().ensure(),\r\n});\r\nexport const EntityStringSchema: Yup.SchemaOf<Entity<string>> = Yup.object({\r\n  Id: Yup.string().required(),\r\n  Name: Yup.string().ensure(),\r\n});\r\nexport const IdentifiableNumberSchema: Yup.SchemaOf<Identifiable<\r\n  number\r\n>> = Yup.object({\r\n  Id: Yup.number().required(),\r\n});\r\nexport const IdentifiableStringSchema: Yup.SchemaOf<Identifiable<\r\n  string\r\n>> = Yup.object({\r\n  Id: Yup.string().required(),\r\n});\r\nexport const CheckEntityShema: Yup.SchemaOf<CheckEntity> = Yup.object({\r\n  Id: Yup.number().defined(),\r\n  Name: Yup.string().ensure(),\r\n  checked: Yup.boolean().default(false),\r\n  disabled: Yup.boolean().default(undefined),\r\n});\r\nconst inventoryBatchesSchema = Yup.array().of(\r\n  Yup.mixed() as Yup.SchemaOf<IInventoryBatchDto>,\r\n);\r\nexport const OfflineServiceTypeShema: Yup.SchemaOf<IOfflineServiceFilterDto> = Yup.object(\r\n  {\r\n    Id: Yup.number().defined(),\r\n    Name: Yup.string().ensure(),\r\n    ServiceGroupId: Yup.number().defined(),\r\n    ServiceTypeId: Yup.number().defined().default(2),\r\n    Active: Yup.boolean().default(true),\r\n    HideProjects: Yup.boolean().default(false),\r\n    IntQuantityOnly: Yup.boolean().default(false),\r\n    UnitTypeID: Yup.number().nullable().default(null),\r\n    UnitTypeName: Yup.string().ensure(),\r\n    AllowToUser: Yup.boolean().default(false),\r\n    Inventory: Yup.number().defined().default(1),\r\n    DefaultQuantity: Yup.number().nullable().notRequired().default(null),\r\n    ReservationOverlappingInventory: Yup.number()\r\n      .nullable()\r\n      .notRequired()\r\n      .default(null),\r\n    IsAdmin: Yup.boolean().default(false),\r\n    AllowedBudgets: Yup.array().of(Yup.number().required()),\r\n    StaffOnly: Yup.boolean().default(false),\r\n    BudgetsTurnedOn: Yup.boolean().default(false),\r\n    NotLessThanZero: Yup.boolean().default(false),\r\n    TrackInventory: Yup.boolean().default(false),\r\n    InventoryBatchesEnabled: Yup.boolean().default(false),\r\n    InventoryBatches: inventoryBatchesSchema,\r\n  },\r\n);\r\nexport const ServiceGroupEntitySchema = EntityNumberSchema;\r\nexport const BudgetEntitySechema = EntityNumberSchema;\r\nexport const BudgetExperimentEntitySechema = EntityNumberSchema;\r\nexport const InstituteProjectEntitySechema = EntityNumberSchema;\r\nexport const PaymentMethodEntitySchema = EntityNumberSchema;\r\nexport const UserEntitySchema = EntityStringSchema;\r\nexport const OnlineServiceEntitySchema = EntityNumberSchema;\r\nexport const OfflineServiceTypeEntitySchema = EntityNumberSchema;\r\nexport const FeeTypeEntitySchema = EntityNumberSchema;\r\nexport const UserGroupEntitySchema = EntityStringSchema;\r\nexport const ServiceTypeSchema = EntityNumberSchema;\r\n","import { IconProp } from 'app/AllIcons';\r\nimport * as React from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ActionButton } from '../ActionButton';\r\nimport { ActionIconButton } from '../ActionIconButton';\r\nimport { ButtonsVariant } from '../Button';\r\n\r\nexport interface TopActionButtonProps {\r\n  onClick?: React.MouseEventHandler<HTMLButtonElement>;\r\n  disabled?: boolean;\r\n  startIcon?: IconProp;\r\n  endIcon?: IconProp;\r\n  icon: IconProp;\r\n  text: string;\r\n  title?: string;\r\n  variant?: ButtonsVariant;\r\n  size?: 'large' | 'medium' | 'small' | 'xs';\r\n  shape?: 'circle' | 'square';\r\n  customIcon?: React.ReactNode;\r\n  href?: string | IPathAndQuery;\r\n  to?: string;\r\n  noChangeOnMobile?: boolean;\r\n  target?: string;\r\n  id?: string;\r\n  fullWidth?: boolean;\r\n  isIconButton?: boolean;\r\n  processing?: boolean;\r\n}\r\n\r\nexport function TopActionButton(props: TopActionButtonProps) {\r\n  const {\r\n    onClick,\r\n    disabled,\r\n    startIcon,\r\n    endIcon,\r\n    icon,\r\n    text,\r\n    title,\r\n    variant,\r\n    size,\r\n    shape,\r\n    customIcon,\r\n    noChangeOnMobile,\r\n    id,\r\n    isIconButton,\r\n    fullWidth,\r\n    processing,\r\n    ...other\r\n  } = props;\r\n  const isMobile = DetectIsMobile();\r\n  const action =\r\n    (isMobile || isIconButton) && !noChangeOnMobile ? (\r\n      <ActionIconButton\r\n        icon={icon}\r\n        title={title || ''}\r\n        onClick={onClick}\r\n        disabled={disabled}\r\n        variant={variant || 'ghost'}\r\n        size={size || 'small'}\r\n        shape={shape || 'square'}\r\n        customIcon={customIcon}\r\n        id={id}\r\n        {...other}\r\n      />\r\n    ) : (\r\n      <ActionButton\r\n        onClick={onClick}\r\n        starticon={startIcon}\r\n        endicon={endIcon}\r\n        title={title}\r\n        text={text}\r\n        disabled={disabled}\r\n        fullWidth={fullWidth}\r\n        variant={variant || 'main'}\r\n        size={size === 'xs' ? 'small' : size}\r\n        processing={processing}\r\n        id={id}\r\n        {...other}\r\n      />\r\n    );\r\n  return action;\r\n}\r\n","import { SidePanelRenderer } from 'app/Layout/FrontendLayout/components/SidePanel/SidePanelRenderer';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n  selectContinueToLink,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  PageTypeProps,\r\n  RenderPageType,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nexport interface SidePanelOpenState {\r\n  renderPageType?: RenderPageType;\r\n  renderPageProps?: PageTypeProps;\r\n  useSidePanel?: boolean;\r\n  isCover?: boolean;\r\n  expanded?: boolean;\r\n}\r\nexport interface SidePanelCloseState {\r\n  useSidePanel?: boolean;\r\n  isCover?: boolean;\r\n  onClose?: () => void;\r\n  showConfirm?: boolean;\r\n}\r\n\r\nfunction useSidePanelState(\r\n  onConfirm?: () => boolean,\r\n  onReject?: () => void,\r\n  isCover?: boolean,\r\n  useSidePanel?: boolean,\r\n  onClose?: () => void,\r\n) {\r\n  const dispatch = useDispatch();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const [cover, setCover] = React.useState<React.ReactNode | undefined>(\r\n    undefined,\r\n  );\r\n  const [coverClosed, setCoverClosed] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const closeCover = () => {\r\n    setCover(undefined);\r\n  };\r\n  const onCloseCover = React.useCallback(() => {\r\n    return closeCover();\r\n  }, []);\r\n  const closePanel = React.useCallback(\r\n    (state: SidePanelCloseState) => {\r\n      if (state.showConfirm) {\r\n        dispatch(layoutActions.setConfirmOpen(true));\r\n      } else {\r\n        if (state.isCover) {\r\n          setCover(undefined);\r\n          setCoverClosed(true);\r\n        } else {\r\n          dispatch(layoutActions.resetSidePanel());\r\n        }\r\n        if (!!state.onClose) {\r\n          state.onClose();\r\n        }\r\n      }\r\n    },\r\n    [dispatch, layoutActions],\r\n  );\r\n  const openPanel = React.useCallback(\r\n    (state: SidePanelOpenState) => {\r\n      state.useSidePanel || state.isCover\r\n        ? setCover(\r\n            <SidePanelRenderer\r\n              renderPageType={state.renderPageType}\r\n              renderPageProps={Object.assign({}, state.renderPageProps, {\r\n                closeCover: closeCover,\r\n                onClose: closeCover,\r\n                isCover: true,\r\n                useSidePanel: true,\r\n              })}\r\n            />,\r\n          )\r\n        : dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: state.renderPageType,\r\n              props: Object.assign({}, state.renderPageProps, {\r\n                useSidePanel: true,\r\n              }),\r\n              expanded: state.expanded,\r\n            }),\r\n          );\r\n    },\r\n    [dispatch, layoutActions],\r\n  );\r\n  React.useEffect(() => {\r\n    if (confirmApproved) {\r\n      if (!!onConfirm) {\r\n        let confirmed = onConfirm();\r\n        if (confirmed) {\r\n          if (continueToOther.continueOnApprove) {\r\n            if (isCover) {\r\n              setCover(undefined);\r\n            } else {\r\n              dispatch(layoutActions.resetSidePanel());\r\n            }\r\n            if (!!onClose) {\r\n              onClose();\r\n            }\r\n            setTimeout(() => {\r\n              useSidePanel || isCover\r\n                ? setCover(\r\n                    <SidePanelRenderer\r\n                      renderPageType={continueToOther.pageType}\r\n                      renderPageProps={Object.assign(\r\n                        {},\r\n                        continueToOther.pageProps,\r\n                        {\r\n                          closeCover: onClose,\r\n                          onClose: onClose,\r\n                          isCover: true,\r\n                        },\r\n                      )}\r\n                    />,\r\n                  )\r\n                : dispatch(\r\n                    layoutActions.openSidePanel({\r\n                      type: continueToOther.pageType,\r\n                      props: continueToOther.pageProps,\r\n                      expanded: continueToOther.expanded,\r\n                    }),\r\n                  );\r\n              dispatch(layoutActions.resetContinueState());\r\n            }, 100);\r\n          } else if (continueLink !== undefined) {\r\n            dispatch(appSettingsActions.navigate(continueLink));\r\n            if (isCover) {\r\n              setCover(undefined);\r\n            } else {\r\n              dispatch(layoutActions.resetSidePanel());\r\n            }\r\n            if (!!onClose) {\r\n              onClose();\r\n            }\r\n          } else {\r\n            if (isCover) {\r\n              setCover(undefined);\r\n            } else {\r\n              dispatch(layoutActions.resetSidePanel());\r\n            }\r\n            if (!!onClose) {\r\n              onClose();\r\n            }\r\n          }\r\n        } else {\r\n          dispatch(layoutActions.resetConfirmState());\r\n        }\r\n      } else {\r\n        if (continueToOther.continueOnApprove) {\r\n          if (isCover) {\r\n            setCover(undefined);\r\n          } else {\r\n            dispatch(layoutActions.resetSidePanel());\r\n          }\r\n          if (!!onClose) {\r\n            onClose();\r\n          }\r\n          setTimeout(() => {\r\n            useSidePanel || isCover\r\n              ? setCover(\r\n                  <SidePanelRenderer\r\n                    renderPageType={continueToOther.pageType}\r\n                    renderPageProps={Object.assign(\r\n                      {},\r\n                      continueToOther.pageProps,\r\n                      {\r\n                        closeCover: onClose,\r\n                        onClose: onClose,\r\n                        isCover: true,\r\n                      },\r\n                    )}\r\n                  />,\r\n                )\r\n              : dispatch(\r\n                  layoutActions.openSidePanel({\r\n                    type: continueToOther.pageType,\r\n                    props: continueToOther.pageProps,\r\n                    expanded: continueToOther.expanded,\r\n                  }),\r\n                );\r\n            dispatch(layoutActions.resetContinueState());\r\n          }, 100);\r\n        } else if (continueLink !== undefined) {\r\n          dispatch(appSettingsActions.navigate(continueLink));\r\n          if (isCover) {\r\n            setCover(undefined);\r\n          } else {\r\n            dispatch(layoutActions.resetSidePanel());\r\n          }\r\n          if (!!onClose) {\r\n            onClose();\r\n          }\r\n        } else {\r\n          if (isCover) {\r\n            setCover(undefined);\r\n          } else {\r\n            dispatch(layoutActions.resetSidePanel());\r\n          }\r\n          if (!!onClose) {\r\n            onClose();\r\n          }\r\n        }\r\n      }\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n      if (!!onReject) {\r\n        onReject();\r\n      }\r\n    }\r\n\r\n    return () => undefined;\r\n  }, [\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther.continueOnApprove,\r\n    continueToOther.expanded,\r\n    continueToOther.pageProps,\r\n    continueToOther.pageType,\r\n    dispatch,\r\n    isCover,\r\n    layoutActions,\r\n    onClose,\r\n    onConfirm,\r\n    onReject,\r\n    useSidePanel,\r\n  ]);\r\n\r\n  return { cover, openPanel, closePanel, coverClosed, onCloseCover };\r\n}\r\nexport default useSidePanelState;\r\n","/**\r\n *\r\n * DialogConfirm\r\n *\r\n */\r\nimport { DialogProps } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ActionButton } from '../BasicButtons/ActionButton';\r\nimport { BasicDialog } from '../BasicDialog';\r\nimport { DialogActionsRenderer } from '../BasicDialog/DialogActionsRender';\r\n\r\nexport interface DialogConfirmProps\r\n  extends Omit<DialogProps, 'open' | 'title'> {\r\n  title?: string | React.ReactNode;\r\n  subtitle?: React.ReactNode;\r\n  body: React.ReactNode;\r\n  confirmButtonLabel?: string;\r\n  cancelButtonLabel?: string;\r\n  onConfirm?: React.MouseEventHandler<HTMLButtonElement>;\r\n  onCancel?: () => void;\r\n  onClose?: () => void;\r\n  processing?: boolean;\r\n  disabled?: boolean;\r\n  isOpen: boolean;\r\n  maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;\r\n  actions?: DialogActionsRenderer[];\r\n  confirmTitle?: string;\r\n  managedState?: boolean;\r\n  dialogRootClassName?: string;\r\n  disableBackdropClick?: boolean;\r\n}\r\n\r\nexport function DialogConfirm({\r\n  title,\r\n  body,\r\n  confirmButtonLabel,\r\n  cancelButtonLabel,\r\n  onConfirm,\r\n  onCancel,\r\n  processing,\r\n  isOpen,\r\n  maxWidth,\r\n  subtitle,\r\n  disabled,\r\n  actions,\r\n  onClose,\r\n  confirmTitle,\r\n  managedState,\r\n  dialogRootClassName,\r\n  disableBackdropClick,\r\n  ...props\r\n}: DialogConfirmProps) {\r\n  const { t } = useTranslation();\r\n  const [open, setOpen] = React.useState(isOpen);\r\n\r\n  // const handleClickOpen = () => {\r\n  //   setOpen(true);\r\n  // };\r\n  React.useEffect(() => {\r\n    setOpen(isOpen);\r\n  }, [isOpen]);\r\n\r\n  const handleClose = () => {\r\n    onCancel?.();\r\n    onClose?.();\r\n    if (!managedState) {\r\n      setOpen(false);\r\n    }\r\n  };\r\n  const handleConfirm = event => {\r\n    if (!!onConfirm) {\r\n      onConfirm(event);\r\n    }\r\n  };\r\n  const btnActions: DialogActionsRenderer[] = [];\r\n  if (actions && actions.length > 0) {\r\n    actions.forEach(a => btnActions.push(a));\r\n  }\r\n  if (!!onConfirm) {\r\n    btnActions.push(() => (\r\n      <ActionButton\r\n        autoFocus\r\n        text={confirmButtonLabel ?? t(translations.Confirm)}\r\n        variant=\"main\"\r\n        processing={processing}\r\n        disabled={disabled || processing}\r\n        onClick={handleConfirm}\r\n        title={confirmTitle}\r\n      />\r\n    ));\r\n  }\r\n  if (!!onCancel) {\r\n    btnActions.push(() => (\r\n      <ActionButton\r\n        text={cancelButtonLabel ?? t(translations.Cancel)}\r\n        variant=\"ghost\"\r\n        disabled={processing}\r\n        onClick={!managedState ? handleClose : onCancel}\r\n      />\r\n    ));\r\n  }\r\n\r\n  return (\r\n    <BasicDialog\r\n      maxWidth={maxWidth}\r\n      isopen={open}\r\n      id=\"confirmation-dialog-title\"\r\n      title={title}\r\n      subtitle={subtitle}\r\n      body={body}\r\n      leftActions={btnActions}\r\n      rightActions={[]}\r\n      processing={processing}\r\n      disabled={disabled}\r\n      dialogRootClassName={dialogRootClassName}\r\n      onClose={!managedState ? handleClose : onClose}\r\n      disableBackdropClick={disableBackdropClick}\r\n      PaperProps={\r\n        !!props.className ? { classes: { root: props.className } } : undefined\r\n      }\r\n    />\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { TableState } from 'react-table';\r\nimport { Entity, IAsyncValue, Identifiable } from 'types/common';\r\nimport { PartialRecord } from 'types/PartialRecord';\r\nimport { RunTypesUnion } from '../../components/RunTypePicker';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { ServiceRequestMilestoneChargeType } from '../../components/ServiceRequestMilestoneChargeDetails';\r\nimport { IUserBaseDto } from 'api/odata/generated/entities/IUserBaseDto';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { IOpenSidePanelPayload } from 'app/Layout/FrontendLayout/slice';\r\nimport { IConsumableServiceDto } from 'api/odata/generated/entities/IConsumableServiceDto';\r\nimport { PromiseStatus } from 'app/hooks/usePromise';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport { Dictionary } from 'lodash';\r\nimport { CustomFormValueType } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { SpecialColumnTypesUnion } from 'api/odata/generated/enums/SpecialColumnTypes';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\n\r\n/* --- STATE --- */\r\nexport type ISampleListTableState = Partial<\r\n  TableState<ISample> & {\r\n    searchColumns?: Array<string>;\r\n    customFilters: Array<\r\n      Pick<IFilterSettings<ISample>, 'fieldName' | 'operator' | 'value'>\r\n    >;\r\n  }\r\n>;\r\nexport type IFieldState = {\r\n  status: PromiseStatus;\r\n};\r\n\r\nexport type ControlledTableState<TRow extends object> = Partial<\r\n  TableState<TRow> & {\r\n    searchColumns?: Array<string>;\r\n  }\r\n>;\r\nexport type ServiceRequestRowsTableState = ControlledTableState<\r\n  IServiceRequestRowDto\r\n>;\r\nexport interface RowsWithTotalCount<TRow extends object> {\r\n  rows: TRow[];\r\n  dataLength: number;\r\n}\r\nexport interface IControlledTableState<TRow extends object> {\r\n  tableState: ControlledTableState<TRow>;\r\n  selectedRows: Array<TRow>;\r\n  data: IAsyncValue<RowsWithTotalCount<TRow>>;\r\n}\r\nexport interface IServiceRequestRowsTableState {}\r\nexport interface IRequestDetailsModel\r\n  extends Omit<IServiceRequestDto, 'Rows' | 'FormValues'>,\r\n    IServiceRequestDetailsFormModel {}\r\n/**\r\n * Represents interface to service request form data values.\r\n */\r\nexport interface IServiceRequestDetailsFormModel {\r\n  Rows?: Array<IServiceRequestTableRowModel>;\r\n  FormValues?: Record<string, unknown>;\r\n}\r\nexport interface IRequestSamplesState {\r\n  RequestSamples: IAsyncValue<{ data: ISample[]; dataLength: number }>;\r\n  RequestDetails: IAsyncValue<IRequestDetailsModel>;\r\n  ServiceRequestStatuses: IAsyncValue<Array<IServiceRequestStatusDto>>;\r\n  ServiceRequestRowStatuses?: Array<IServiceRequestRowStatusDto>;\r\n  SamplesTableState: ISampleListTableState;\r\n  SamplesSelected: any[];\r\n  ServiceRequestRows: IAsyncValue<IServiceRequestTableRowModel[]>;\r\n  serviceRequestId?: number;\r\n  ImportState: {\r\n    open: boolean;\r\n    processing: boolean;\r\n  };\r\n  fieldsState: PartialRecord<keyof IServiceRequestDto, IFieldState | undefined>;\r\n  milestoneProcessing?: boolean;\r\n  milestoneChargeProcessing?: boolean;\r\n  submitting?: boolean;\r\n  SidePanel?: IOpenSidePanelPayload;\r\n  createServiceRequestRowStatus?: PromiseStatus;\r\n}\r\n\r\nexport interface ISample extends Record<string, unknown> {\r\n  Id: number;\r\n  ServiceRequestId: number;\r\n  BudgetName: string | null;\r\n  BudgetId: number | null;\r\n  SourceRunIds: Array<number> | null;\r\n  TargetRunIds: Array<number> | null;\r\n  Status: number;\r\n  StatusName: string | null;\r\n  AnalyticalSampleId: string | null;\r\n  BiologicalSampleId: string | null;\r\n  TMT_Type: string | null;\r\n  TMT_Label: string | null;\r\n  TMT_Set: string | null;\r\n  SubjectId: string | null;\r\n  Concentration: number | null;\r\n  Volume: number | null;\r\n  SamplePlateId: string | null;\r\n  Position: string | null;\r\n  SampleType: string | null;\r\n  TaxaId: string | null;\r\n}\r\n\r\nexport interface ITableState {\r\n  pageIndex: number;\r\n  pageSize: number;\r\n  columnOrder: any;\r\n  filters: any;\r\n  globalFilter: any;\r\n}\r\n\r\nexport interface ISampleRun\r\n  extends Record<string, unknown>,\r\n    ISampleTarget,\r\n    ISample {\r\n  Id: number;\r\n  ServiceRequestId: number;\r\n  Status: number;\r\n  BudgetName: string | null;\r\n  AnalyticalSampleId: string | null;\r\n  RunId: number | null;\r\n\r\n  TMT_Type: string | null;\r\n  TMT_Label: string | null;\r\n  TMT_Set: string | null;\r\n\r\n  Concentration: number | null;\r\n  Volume: number | null;\r\n  SamplePlateId: string | null;\r\n  Position: string | null;\r\n\r\n  TargetConcentration: number | null;\r\n  TargetVolume: number | null;\r\n  TargetPlateId: string | null;\r\n  TargetPosition: string | null;\r\n  TargetTubeLabel: string | null;\r\n  TargetSampleType: string | null;\r\n}\r\n\r\nexport interface IRunDetails {\r\n  Id?: number;\r\n  RunType: RunTypesUnion;\r\n  Samples: ISampleTarget[];\r\n}\r\n\r\nexport interface ISampleTarget extends ISample {\r\n  TargetConcentration: number | null;\r\n  TargetVolume: number | null;\r\n  TargetPlateId: string | null;\r\n  TargetPosition: string | null;\r\n  TargetTubeLabel: string | null;\r\n  TargetSampleType: string | null;\r\n}\r\n\r\nexport interface ISamplesFilter {\r\n  ServiceRequestId?: number;\r\n}\r\n\r\nexport type IServiceRequestUpdateStatusAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'Status'> & IReason\r\n>;\r\nexport type IServiceRequestUpdateBudgetAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'Budget'>\r\n>;\r\nexport type IServiceRequestUpdateFundingTypeAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'FundingTypeId'>\r\n>;\r\nexport type IServiceRequestUpdatePurchaseOrderAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'PurchaseOrder'>\r\n>;\r\nexport type IServiceRequestUpdateExternalInternalNumberAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'ExternalInternalNumber'>\r\n>;\r\nexport type IServiceRequestPatchAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id'> & Partial<Omit<IServiceRequestDto, 'Id'>>\r\n>;\r\nexport type IServiceRequestUpdateGradientAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'Gradient'>\r\n>;\r\nexport type IServiceRequestUpdateOverheadAction = PayloadAction<\r\n  Pick<IServiceRequestDto, 'Id' | 'OverheadMinutes'>\r\n>;\r\nexport type ILoadServiceRequestMilestonesAction = PayloadAction<\r\n  Identifiable<number>\r\n>;\r\nexport type ILoadServiceRequestMilestonesSuccessAction = PayloadAction<\r\n  Array<IServiceRequestMilestoneDto>\r\n>;\r\nexport type ILoadServiceRequestRowsAction = PayloadAction<{\r\n  serviceRequestId: number;\r\n  state: Partial<TableState<IServiceRequestRowDto>>;\r\n}>;\r\nexport type ICancelServiceRequestPayloadAction = PayloadAction<\r\n  {\r\n    serviceRequestId: number;\r\n  } & IReason\r\n>;\r\nexport type UpdateServiceRequestRowValueAction = PayloadAction<{\r\n  serviceRequestId: number;\r\n  serviceRequestValue: Pick<\r\n    IServiceRequestRowValueDto,\r\n    'ColumnId' | 'RowId' | 'Value' | 'DisplayValue'\r\n  >;\r\n}>;\r\n\r\nexport interface IRequestMilestoneManualChargeUserModel {\r\n  Id: string;\r\n  Title: string;\r\n  display: string;\r\n}\r\n\r\nexport interface IRequestMilestoneManualChargeModel {\r\n  OfflineServiceType: IConsumableServiceDto | null;\r\n  Unit: Entity<number> | null;\r\n  Id: number;\r\n  Name: string | null;\r\n  Quantity: number | null;\r\n  Rate: number | null;\r\n  Remarks: string | null;\r\n  Date: Timestamp | null;\r\n  UpdatedBy: IRequestMilestoneManualChargeUserModel | null;\r\n}\r\n\r\nexport type InsertServiceRequestMilestoneChargeAction = PayloadAction<\r\n  Partial<IRequestMilestoneManualChargeModel> & {\r\n    ServiceRequestId: number;\r\n    ServiceRequestMilestoneId: number;\r\n  }\r\n>;\r\nexport type UpdateServiceRequestMilestoneChargeAction = PayloadAction<\r\n  Pick<IRequestMilestoneManualChargeModel, 'Id'> &\r\n    Partial<IRequestMilestoneManualChargeModel> & {\r\n      ServiceRequestId: number;\r\n      ServiceRequestMilestoneId: number;\r\n    }\r\n>;\r\nexport interface IServiceRequestMilestoneChargeForm {\r\n  Id?: number;\r\n  Type?: ServiceRequestMilestoneChargeType;\r\n  Name?: string;\r\n  Service?: IConsumableServiceDto;\r\n  Rate?: number;\r\n  Date?: Date | null;\r\n  Unit?: Entity<number>;\r\n  Quantity?: number;\r\n  Remarks?: string;\r\n}\r\nexport interface IServiceRequestMilestoneForm {\r\n  Id?: number;\r\n  Name?: string;\r\n  Assignees?: IUserBaseDto[];\r\n  CompletionDate?: Date | null;\r\n  TargetDate?: Date | null;\r\n  Description?: string;\r\n  Status?: ServiceRequestMilestoneStatusesUnion;\r\n}\r\n/** WebApi interface */\r\nexport interface ServiceRequestMilestoneInsertModel {\r\n  Id?: number;\r\n  ServiceRequestId: number;\r\n\r\n  Name: string | null;\r\n  Assignees: string | null;\r\n  CompletionDate: Timestamp | null;\r\n  TargetDate: Timestamp | null;\r\n  Description: string | null;\r\n  StatusId: number | null;\r\n}\r\n/** WebApi interface */\r\nexport type RequestMilestoneModel = Pick<\r\n  ServiceRequestMilestoneInsertModel,\r\n  'CompletionDate' | 'StatusId'\r\n>;\r\nexport interface IReason {\r\n  Reason?: string;\r\n}\r\n\r\n/**\r\n * UI column obj\r\n */\r\nexport interface IServiceRequestTableColumnModel\r\n  extends Pick<\r\n    IFormFieldDto,\r\n    | 'Id'\r\n    | 'Label'\r\n    //| 'ColumnType'\r\n    | 'Index'\r\n    // | 'Options'\r\n    // | 'OptionsSourceType'\r\n    | 'Required'\r\n    | 'ParentId'\r\n    | 'SizeLimit'\r\n    // | 'Active'\r\n    | 'Description'\r\n    | 'DisplayType'\r\n    | 'IsMultiple'\r\n    | 'CopyPrevValues'\r\n    | 'CustomRoles'\r\n    | 'UserSelectionType'\r\n    | 'FixedRoles'\r\n  > {\r\n  IsColumn: true;\r\n  Options?: IFormFieldOptionDto[];\r\n  ColumnType: CustomFormColumnTypes;\r\n  isRequired: boolean;\r\n}\r\n/**\r\n * UI interface of the service request row value\r\n * CustomFormValueType narrowed to include types supported on the custom form table\r\n */\r\nexport type IServiceRequestTableRowValueModel = Extract<\r\n  CustomFormValueType,\r\n  string | Date | number | boolean | Entity<string>\r\n>;\r\n\r\n/**\r\n * UI interface of the service request table model\r\n */\r\nexport interface IServiceRequestTableRowModel\r\n  extends Omit<IServiceRequestRowDto, 'Values'> {\r\n  Values: Dictionary<IServiceRequestTableRowValueModel>;\r\n}\r\n\r\n// case 'Disclaimer':\r\n// case 'Dictionary':\r\n// case 'Index1':\r\n// case 'Index2':\r\n// case 'Label':\r\n// case 'Lane':\r\n// case 'Plate':\r\n// case 'PlateCell':\r\n// case 'RunLane':\r\n// case 'SequencingModes':\r\n// case 'Name':\r\n// case 'SourceAndLabel':\r\n// case 'Source':\r\n// case 'UserSelection':\r\n\r\ntype Extends<T, U extends T> = U;\r\n\r\n/**\r\n * List of the column types (SpecialColumnTypes) currently supported on the custom form table\r\n */\r\nexport type CustomFormColumnTypes = Extends<\r\n  SpecialColumnTypesUnion,\r\n  | 'CheckBox'\r\n  | 'Date'\r\n  | 'DropDownList'\r\n  | 'ShortText'\r\n  | 'Serial'\r\n  | 'Email'\r\n  | 'PositiveInteger'\r\n  | 'Number'\r\n  | 'PositiveDecimal'\r\n  | 'UserSelection'\r\n>;\r\nexport const ColumnTypesArray: Array<CustomFormColumnTypes> = [\r\n  'CheckBox',\r\n  'Date',\r\n  'DropDownList',\r\n  'ShortText',\r\n  'Serial',\r\n  'Email',\r\n  'PositiveInteger',\r\n  'Number',\r\n  'PositiveDecimal',\r\n  'UserSelection',\r\n];\r\n","import { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { DisplayTypes } from 'api/odata/generated/enums/DisplayTypes';\r\nimport { UserSelectionTypeUnion } from 'api/odata/generated/enums/UserSelectionType';\r\nimport { createOptions } from 'app/components/CustomForm/CustomFormFields/CustomFormDropDown';\r\nimport { Dictionary, keyBy } from 'lodash';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n  ColumnTypesArray,\r\n  CustomFormColumnTypes,\r\n  IServiceRequestTableColumnModel,\r\n} from '../types';\r\n\r\nexport class ServiceRequestTableColumn\r\n  implements IServiceRequestTableColumnModel {\r\n  AssignParent(result: Dictionary<ServiceRequestTableColumn>): void {\r\n    const parentFieldName = this.getParentFieldName();\r\n    if (parentFieldName !== null) {\r\n      const parent = result[parentFieldName];\r\n      if (parent !== undefined) {\r\n        this.Parent = parent;\r\n        (parent.Children = parent.Children ?? []).push(this);\r\n      }\r\n    }\r\n  }\r\n\r\n  IsColumn: true = true;\r\n  Options?: IFormFieldOptionDto[] | undefined;\r\n  ColumnType: CustomFormColumnTypes;\r\n  isRequired: boolean;\r\n  Id: number;\r\n  Label: string;\r\n  Index: number;\r\n  Required: 'Optional' | 'User' | 'Admin' | 'Conditional';\r\n  ParentId: number | null;\r\n  SizeLimit: number;\r\n  Description: string | null;\r\n  DisplayType: DisplayTypes;\r\n  IsMultiple: boolean;\r\n  CopyPrevValues: boolean;\r\n  CustomRoles: string | null;\r\n  UserSelectionType: UserSelectionTypeUnion | null;\r\n  FixedRoles: string | null;\r\n\r\n  Parent: ServiceRequestTableColumn | null = null;\r\n  Children: Array<ServiceRequestTableColumn> | null = null;\r\n\r\n  constructor(columnDto: IFormFieldDto, isAdmin?: boolean) {\r\n    this.Id = columnDto.Id;\r\n    // see null check above in filter\r\n    this.ColumnType = (columnDto.ColumnType as CustomFormColumnTypes)!;\r\n    this.Description = columnDto.Description;\r\n    this.DisplayType = columnDto.DisplayType;\r\n    this.Index = columnDto.Index;\r\n    this.IsColumn = true;\r\n    this.IsMultiple = columnDto.IsMultiple;\r\n    this.Label = columnDto.Label;\r\n    this.ParentId = columnDto.ParentId;\r\n    this.Required = columnDto.Required;\r\n    this.SizeLimit = columnDto.SizeLimit;\r\n    this.Options =\r\n      columnDto.ColumnType === 'DropDownList'\r\n        ? createOptions(columnDto)\r\n        : undefined;\r\n    this.isRequired = this.isColumnRequired({\r\n      Required: columnDto.Required,\r\n      isAdmin: isAdmin ?? false,\r\n    });\r\n    this.CopyPrevValues = columnDto.CopyPrevValues;\r\n    this.CustomRoles = columnDto.CustomRoles;\r\n    this.UserSelectionType = columnDto.UserSelectionType;\r\n    this.FixedRoles = columnDto.FixedRoles;\r\n  }\r\n\r\n  static getFieldName(columnId: number) {\r\n    return `column_${String(columnId)}`;\r\n  }\r\n  getFieldName() {\r\n    return ServiceRequestTableColumn.getFieldName(this.Id);\r\n  }\r\n  getParentFieldName() {\r\n    if (this.ParentId === null) {\r\n      return null;\r\n    }\r\n    return ServiceRequestTableColumn.getFieldName(this.ParentId);\r\n  }\r\n\r\n  private isColumnRequired = (\r\n    props: Pick<IFormFieldDto, 'Required'> & { isAdmin: boolean },\r\n  ) => {\r\n    switch (props.Required) {\r\n      case 'Optional': //optional\r\n        return false;\r\n      case 'User': //required for user (all users)\r\n        return true;\r\n      case 'Admin': //required for admin\r\n        return props.isAdmin;\r\n      case 'Conditional':\r\n        // not supported on columns/table\r\n        return false;\r\n      default:\r\n        assertExhaustive(props.Required);\r\n    }\r\n  };\r\n}\r\n\r\nexport class ServiceRequestTableColumnsCollection {\r\n  columnsObj: Dictionary<ServiceRequestTableColumn>;\r\n  constructor(columnsData, isAdmin: boolean, VisibleToAdminOnly?: boolean) {\r\n    if (VisibleToAdminOnly === true && isAdmin !== true) {\r\n      this.columnsObj = {};\r\n      return;\r\n    }\r\n    const columns =\r\n      columnsData\r\n        ?.filter(f => f.Active === true)\r\n        ?.filter(\r\n          column =>\r\n            column.IsColumn === true &&\r\n            column.ColumnType !== null &&\r\n            (ColumnTypesArray as string[]).includes(column.ColumnType),\r\n        )\r\n        ?.map(columnDto => new ServiceRequestTableColumn(columnDto, isAdmin)) ??\r\n      [];\r\n    const result = keyBy(columns, column => column.getFieldName());\r\n    columns.forEach(column => column.AssignParent(result));\r\n    this.columnsObj = result;\r\n  }\r\n\r\n  getArray() {\r\n    return Object.values(this.columnsObj);\r\n  }\r\n  get(columnId: number) {\r\n    return this.columnsObj[ServiceRequestTableColumn.getFieldName(columnId)];\r\n  }\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { SpecialColumnTypesUnion } from 'api/odata/generated/enums/SpecialColumnTypes';\r\nimport { tryParseBool, tryParseFloat, tryParseInt } from 'utils/string-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n  isEmptyOrWhitespace,\r\n  toUndefinedIfEmptyOrWhitespace,\r\n} from 'utils/typeUtils';\r\nimport { ServiceRequestTableColumnsCollection } from './utils/ServiceRequestTableColumn';\r\nimport { IServiceRequestDetailsFormModel } from './types';\r\n\r\nconst selectSlice = (state: RootState) => state.requestSamples || initialState;\r\n\r\nexport const selectRequestSamples = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\nexport const selectServiceRequestStatuses = createSelector(\r\n  [selectSlice],\r\n  state => state.ServiceRequestStatuses,\r\n);\r\nexport const selectServiceRequestRowStatues = createSelector(\r\n  [selectSlice],\r\n  state => state.ServiceRequestRowStatuses,\r\n);\r\nexport const selectSubmitting = createSelector(\r\n  [selectSlice],\r\n  state => state.submitting,\r\n);\r\n\r\nexport const selectServiceRequestStatusesByInternalId = createSelector(\r\n  [\r\n    selectServiceRequestStatuses,\r\n    (\r\n      state,\r\n      serviceRequestInternalStatus: InternalServiceRequestStatusesUnion,\r\n    ) => serviceRequestInternalStatus,\r\n  ],\r\n  (state, serviceRequestInternalStatus: InternalServiceRequestStatusesUnion) =>\r\n    state.value?.filter(\r\n      status => status.InternalStatusId === serviceRequestInternalStatus,\r\n    ),\r\n);\r\nexport const selectServiceRequestId = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.serviceRequestId,\r\n);\r\nexport const selectRequestDetails = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.RequestDetails,\r\n);\r\nexport const selectCommentIsInternal = createSelector(\r\n  [selectRequestDetails],\r\n  state => state.value?.CommentIsInternal,\r\n);\r\nexport const selectRequestDetailsData = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.RequestDetails?.value,\r\n);\r\nexport const selectServiceRequestCustomForm = createSelector(\r\n  [selectRequestDetailsData],\r\n  state => state?.FormValues,\r\n);\r\nexport const selectServiceRequestCustomTable = createSelector(\r\n  [selectRequestDetailsData],\r\n  state => state?.Rows,\r\n);\r\nexport const selectServiceRequestFormData = createSelector(\r\n  [selectServiceRequestCustomForm, selectServiceRequestCustomTable],\r\n  (formValues, rows) => {\r\n    const result: IServiceRequestDetailsFormModel = {\r\n      FormValues: formValues,\r\n      Rows: rows,\r\n    };\r\n    return result;\r\n  },\r\n);\r\nexport const selectRequestDetailsFieldsState = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.fieldsState,\r\n);\r\nexport const selectServiceRequestDetailsFieldState = createSelector(\r\n  [\r\n    selectRequestDetailsFieldsState,\r\n    (state, fieldName: keyof IServiceRequestDto) => fieldName,\r\n  ],\r\n  (state, fieldName) => state[fieldName],\r\n);\r\nconst selectService = createSelector([selectRequestDetailsData], state => {\r\n  return state?.Service;\r\n});\r\nconst selectStatus = createSelector([selectRequestDetailsData], state => {\r\n  return state?.Status;\r\n});\r\nconst selectCreatedFor = createSelector([selectRequestDetailsData], state => {\r\n  return state?.CreatedFor;\r\n});\r\nexport const selectIsServiceRequestAdmin = createSelector(\r\n  [selectService, selectCreatedFor, selectStatus, selectAuthenticatedUser],\r\n  (Service, CreatedFor, Status, authenticatedUser) => {\r\n    let isAdmin = false;\r\n    let isOwner = false;\r\n    let isEditable = false;\r\n    if (Service === undefined) {\r\n      return { isAdmin, isOwner, isEditable };\r\n    }\r\n    if (authenticatedUser === undefined) {\r\n      return { isAdmin, isOwner, isEditable };\r\n    }\r\n    if (authenticatedUser.Roles.includes(Roles.Administrators)) {\r\n      return { isAdmin: true, isOwner: false, isEditable: true };\r\n    }\r\n\r\n    isAdmin = authenticatedUser.IsAdminOf({\r\n      ServiceGroupId: Service.ServiceGroup.Id,\r\n      ServiceId: Service.Id,\r\n      ServiceTypeId: ServiceType.Sample,\r\n    });\r\n\r\n    isOwner = CreatedFor?.Id === authenticatedUser?.Id;\r\n    const userEditableStatuses: Array<InternalServiceRequestStatusesUnion> = [\r\n      'Draft',\r\n      'ReturnedToUser',\r\n      'QuoteSendToUser',\r\n    ];\r\n    const internalStatusId = Status?.InternalStatusId;\r\n    // todo: check equipment administrator permissions\r\n    isEditable =\r\n      isAdmin ||\r\n      (isOwner &&\r\n        internalStatusId !== undefined &&\r\n        userEditableStatuses.includes(internalStatusId));\r\n    return { isAdmin, isOwner, isEditable };\r\n  },\r\n);\r\nexport const selectSamplesTableState = createSelector(\r\n  [selectSlice],\r\n  state => state.SamplesTableState,\r\n);\r\nexport const selectSamplesData = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.RequestSamples,\r\n);\r\nexport const selectImportState = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.ImportState,\r\n);\r\nexport const selectSelectedSamples = createSelector(\r\n  [selectRequestSamples],\r\n  state => state.SamplesSelected,\r\n);\r\nconst selectCustomForm = createSelector(\r\n  [selectService],\r\n  state => state?.CustomForm,\r\n);\r\nconst selectCustomFormFields = createSelector(\r\n  [selectRequestDetailsData],\r\n  state => state?.Service.CustomForm.FormFields,\r\n);\r\nexport const selectServiceRequestCustomFormColumns = createSelector(\r\n  [selectCustomForm, selectCustomFormFields, selectIsServiceRequestAdmin],\r\n  (customForm, state, isAdmin) => {\r\n    return new ServiceRequestTableColumnsCollection(\r\n      state,\r\n      isAdmin.isAdmin,\r\n      customForm?.VisibleToAdminOnly,\r\n    );\r\n  },\r\n);\r\n\r\nexport const selectServiceRequestCustomFormFields = createSelector(\r\n  [selectRequestDetails],\r\n  state =>\r\n    state.value?.Service?.CustomForm?.FormFields?.filter(\r\n      f => f.Active === true,\r\n    )?.filter(column => column.IsColumn === false) ?? [],\r\n);\r\n\r\nexport const selectServiceRequestMilestones = createSelector(\r\n  [selectRequestDetails],\r\n  state => state.value?.Milestones,\r\n);\r\nexport const selectServiceRequestMilestoneProcessing = createSelector(\r\n  [selectSlice],\r\n  state => state.milestoneProcessing,\r\n);\r\n\r\nexport const selectServiceRequestSidePanel = createSelector(\r\n  [selectSlice],\r\n  state => state.SidePanel,\r\n);\r\n\r\nexport const selectServiceRequestRows = createSelector(\r\n  [selectSlice],\r\n  state => state.ServiceRequestRows,\r\n);\r\n\r\nexport function fromDtoValue(\r\n  type: SpecialColumnTypesUnion,\r\n  formValueDto:\r\n    | Pick<IFormValueDto, 'Value' | 'DisplayValue'>\r\n    | null\r\n    | undefined,\r\n) {\r\n  if (formValueDto === null) {\r\n    return null;\r\n  }\r\n  if (formValueDto === undefined) {\r\n    return undefined;\r\n  }\r\n  switch (type) {\r\n    case 'CheckBox':\r\n      return tryParseBool(formValueDto.Value);\r\n    case 'Date':\r\n      return dateUtils.tryFormatIso(dateUtils.tryParse(formValueDto.Value));\r\n    case 'Disclaimer':\r\n    case 'Dictionary':\r\n    case 'Index1':\r\n    case 'Index2':\r\n    case 'Label':\r\n    case 'Lane':\r\n    case 'Plate':\r\n    case 'PlateCell':\r\n    case 'RunLane':\r\n    case 'SequencingModes':\r\n    case 'Name':\r\n    case 'SourceAndLabel':\r\n    case 'Source':\r\n      return undefined;\r\n    case 'UserSelection':\r\n    case 'DropDownList':\r\n      if (isEmptyOrWhitespace(formValueDto.Value)) {\r\n        return undefined;\r\n      } else {\r\n        return {\r\n          Id: formValueDto.Value,\r\n          Name:\r\n            toUndefinedIfEmptyOrWhitespace(formValueDto.DisplayValue) ??\r\n            formValueDto.Value,\r\n        };\r\n      }\r\n    case 'ShortText':\r\n    case 'Serial':\r\n    case 'Email':\r\n      return formValueDto.Value;\r\n    case 'PositiveInteger':\r\n      return tryParseInt(formValueDto.Value);\r\n    case 'Number':\r\n    case 'PositiveDecimal':\r\n      return tryParseFloat(formValueDto.Value);\r\n\r\n    default:\r\n      assertExhaustive(type);\r\n  }\r\n}\r\n\r\nexport const selectServiceRequestRowsForm = createSelector(\r\n  [selectSlice],\r\n  state => state.ServiceRequestRows?.value,\r\n);\r\n\r\nexport const selectServiceRequestRowInsertStatus = createSelector(\r\n  [selectSlice],\r\n  state => state.createServiceRequestRowStatus,\r\n);\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\n\r\nexport interface InfoIconProps {\r\n  title: NonNullable<React.ReactNode>;\r\n  className?: string;\r\n  error?: boolean;\r\n}\r\n\r\nconst styles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      cursor: 'pointer',\r\n      zIndex: 1,\r\n      '&.tableInfo': {\r\n        position: 'absolute',\r\n        top: '15%',\r\n        left: '0px',\r\n        '&>svg': {\r\n          width: 13,\r\n          height: 13,\r\n        },\r\n      },\r\n    },\r\n  }),\r\n);\r\n// const StyledTooltip = styled(Tooltip)`\r\n//   cursor: pointer;\r\n//   z-index: 1;\r\n//   &.tableInfo {\r\n//     position: absolute;\r\n//     top: 20%;\r\n//     left: 0px;\r\n//   }\r\n// `;\r\nexport const InfoIcon = (props: InfoIconProps) => {\r\n  const { title, className, error } = props;\r\n  const classes = styles();\r\n  return (\r\n    <Tooltip arrow title={title} className={clsx(classes.root, className)}>\r\n      <span>\r\n        <Icon\r\n          icon=\"info-circle\"\r\n          color={error ? 'danger' : 'default'}\r\n          colorExtend=\"textHover\"\r\n          fontSize=\"13px\"\r\n          width=\"13px\"\r\n        />\r\n      </span>\r\n    </Tooltip>\r\n  );\r\n};\r\n","import { useTranslation } from 'react-i18next';\r\nimport { dateUtils, WeekStartsOn } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { WorkWeekDays } from './WorkWeekDays';\r\n\r\nexport enum RepetitiveOptions {\r\n  DoNotRepeat,\r\n  RepeatDaily,\r\n  RepeatWeeklyOn,\r\n  RepeatMonthlyOn,\r\n  RepeatEveryWeekDay,\r\n  RepeatCustom,\r\n}\r\nexport enum RepeatPeriod {\r\n  Days = 1,\r\n  Weeks = 2,\r\n  Months = 3,\r\n}\r\nexport enum RepeatMonthlyBy {\r\n  RepeatsBy_DayOfMonth = 1,\r\n  RepeatsBy_DayOfWeek = 2,\r\n}\r\nexport function GetRepetitiveOptions(\r\n  startDate: Date | null,\r\n  firstDayOfWeek: number,\r\n) {\r\n  let items = enumToEntityArray(RepetitiveOptions);\r\n  let date = dateUtils.dateOrStringToDate(startDate ?? new Date());\r\n  let dayName = dateUtils.getDayText(date);\r\n\r\n  const { t } = useTranslation();\r\n  let weekName = enumToEntityArray(WorkWeekDays, t).filter(\r\n    f =>\r\n      dateUtils.getWeekNumberOfMonth(date, firstDayOfWeek as WeekStartsOn) ===\r\n      f.Id,\r\n  )[0].Name;\r\n\r\n  let weekDays = `${dateUtils.getLongDaysArray()[firstDayOfWeek]} - ${\r\n    dateUtils.getLongDaysArray()[dateUtils.getLongDaysArray().length - 2]\r\n  }`;\r\n\r\n  items.forEach(item => {\r\n    if (item.Id === RepetitiveOptions.RepeatWeeklyOn) {\r\n      item.Name = item.Name.replace('{0}', dayName);\r\n    }\r\n    if (item.Id === RepetitiveOptions.RepeatMonthlyOn) {\r\n      item.Name = item.Name.replace('{0}', weekName).replace('{1}', dayName);\r\n    }\r\n    if (item.Id === RepetitiveOptions.RepeatEveryWeekDay) {\r\n      item.Name = item.Name.replace('{0}', weekDays);\r\n    }\r\n  });\r\n  return items;\r\n}\r\n","export enum AllowedSettings {\r\n  'DefaultQuickAssetSearchAction',\r\n  'UserFormatResult',\r\n  'InstrumentOptionsInCalender',\r\n  'CalendarPublicIntegrationFeed',\r\n  'AllowUsersToOpt_Out',\r\n  'InternalUserIdFieldLength',\r\n  'InternalUserId2FieldLength',\r\n  'ServiceGroupAdminsCanManageUsers',\r\n  'EnableServiceGroupAffilationManagment',\r\n  'FavIconImg',\r\n  'FavIconTitle',\r\n  'TopMenuBorder',\r\n  'TopCustomerLogo',\r\n  'TopCustomerLogoLink',\r\n  'DeleteEmailNotficationsMonth',\r\n\r\n  'AssetCatEnabled',\r\n  'TrainingActivationAllowedBySGAOnly',\r\n  'TrainingCreatedAsNotActiveByDefault',\r\n  'HideInstrumentRestrictions',\r\n  'EnableReservationSidePanel',\r\n  'PriceSheetBy',\r\n  'SGACreateProjects',\r\n  'UGFCreateProjects',\r\n  'HideRoomFloorTextBoxes',\r\n  'EnableInvoicePartialEvents',\r\n  'ISOCurrencySymbol',\r\n  'AccumulateNewChargesToExistingInvoice',\r\n  'CreateInovicesBy',\r\n  'CreateInvoiceSyncLimit',\r\n  'AllowMultiServiceGroupInvoices',\r\n  'ReservationUserGroupGroupByBudgetUserGroup',\r\n  'AllowedFeeTypes',\r\n  'InvoiceFromBatchScreenOnly',\r\n  'AllowExternalFundingInvoiceFinExport',\r\n  'AllowExternalFundingInvoicePdfExport',\r\n  'EnableFinAccountManagment',\r\n  'AllowUsersToViewCharges',\r\n  'GlobalInvoiceVAT',\r\n  'NamePrefixMandatory',\r\n  'AssetCatGroupEnabled',\r\n  'FinSystemInvoicesEnviroment',\r\n  'HideDymoPrinterMenu',\r\n  'WarnDefaultBudgetEnabled',\r\n  'DymoPrinterSupported',\r\n  'ZebraPrinterSupported',\r\n  'ShowDefaultBudgetOnUserProfile',\r\n  'BudgetLimited_ByUsers',\r\n  'AllowPartialMultipleProjectCharges',\r\n  'AllowPartialSingleProjectCharges',\r\n  'HideTrainingSessionsSettings',\r\n  'HideAssistedReservationsSettings',\r\n  'HideCalcPriceOnOfflineService',\r\n  'CrossInstrumentTraining',\r\n  'HideReferenceFieldInReservationDetails',\r\n  'MultipleInstrumentReservations',\r\n  'InstrumentAvailabilityDropDown',\r\n  'MinBarcodeLength',\r\n  'ShowDashboardAnnouncement',\r\n  'DashboardAnnouncement',\r\n  'RoomUserRoleEnabled',\r\n  'GlobalPriceSheetPeriods',\r\n  'AdvancedAssetSearchFilterAttributes',\r\n  'AdvancedAssetPublicSearchFilterAttributes',\r\n  'WarrantyEndDateVisibleAllUsers',\r\n  'OnlyAdminCanImportAssets',\r\n  'Help_Dashboard',\r\n  'AllowWorkflowBooking',\r\n  'MultipleTentativeReservationsUnderWorkflowBooking',\r\n  'CalendarTimelineEmptySlotClickSettings',\r\n  'NoDashboardRedirectOnCoreSelection',\r\n  'HideTopServiceGroupFilter',\r\n  'TerminateReservation',\r\n  'CalendarServicesPickerCapacity',\r\n  'MaximumTimelineRowsLimit',\r\n  'IntervalRefreshingCalendar',\r\n  'ShouldAllowCustomDashboards',\r\n  'EnableLegacyScheduler',\r\n  'EnableTwoDaysTimelineButton',\r\n  'AutomaticAssetNamings',\r\n  'EnableCustomDaysTimelineButton',\r\n  'DefaultCustomDaysTimelineValue',\r\n  'SkipCoreSelectionScreen',\r\n  'SchedulerReservationBodyTemplate',\r\n  'SchedulerReservationTooltipTemplate',\r\n  'IncludeCustomFormInSchedulerReservationTooltip',\r\n  'AllowToRemoveFromMultipleReservation',\r\n  'DraftReservationsEnabled',\r\n  'UserReservationsRestricted',\r\n  'UsageKioskRoleEnabled',\r\n  'RequestMilestones',\r\n  'MandatoryOfflineServicesOnTrainingSignUps',\r\n  'NewUsersSignupForm',\r\n  'PurchaseOrderLengthSetting',\r\n  'HideLinkToRegistrationForm',\r\n  'SessionTimeout_Persistent',\r\n  'Help_Login',\r\n  'HideReservationCollaborators',\r\n  'LoginScreenCompanyLogo',\r\n  'LoginScreenCompanyLogoLink',\r\n  'LoginScreenCompanyLogoHeight',\r\n  'ShowForgotPassword',\r\n  'BrowseByUnit',\r\n  'MaxRecordsAllowedAssetImport',\r\n  'DoNotAllowReservationUserChangeByStaff',\r\n  'AssetImageSizeType',\r\n  'AllowToSwitchToOtherSites',\r\n  'ExternalSwitchTitle1',\r\n  'ExternalSwitchUrl1',\r\n  'ExternalSwitchTitle2',\r\n  'ExternalSwitchUrl2',\r\n  'ExternalSitesIcon',\r\n  'RequireSupplierExternalId',\r\n  'MaximumImagesPerOneUpload',\r\n  'MaxLoadedAssetImageMbSize',\r\n  'ModifyReservationNameForUsers',\r\n  'HideCommentSharingForAllUsers',\r\n  'AllowLargeFilesUpload',\r\n  'AssetInventoryDaysWithoutVerification',\r\n  'QRCodeBaseLength', // Asset Related\r\n  'SideBarQuickActions',\r\n  'LimitServiceGroupLicenses',\r\n  'Help_ReservationHistory',\r\n  'Help_UsageHistory',\r\n  'Help_OtherServices',\r\n  'Help_Training',\r\n  'Help_Incidents',\r\n  'Help_ServiceGroupRegistration',\r\n  'SSOuserFirstLogin',\r\n  'SSOuserFirstLoginWithOrWithoutUG',\r\n  'ServiceRequestReservations',\r\n  /**\r\n   * Returns True if the bool setting is turned on explicitly, otherwise returns false.\r\n   * @param key\r\n   * @returns boolean\r\n   */\r\n}\r\n","import * as React from 'react';\r\nimport { EntityType } from 'types/common';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from '../AutocompletePicker';\r\nimport { createFilterOptions } from '@material-ui/lab';\r\n\r\nexport interface BaseOptionsPickerProps<T extends EntityType>\r\n  extends Omit<AutocompletePickerProps<T>, 'loadData'> {\r\n  getOptions: (searchTerm: string | null) => T[];\r\n}\r\n\r\nexport function BaseOptionsPicker<T extends EntityType>(\r\n  props: BaseOptionsPickerProps<T>,\r\n) {\r\n  const { getOptions, ...other } = props;\r\n  const loadData = async (searchTerm: string | null): Promise<T[]> =>\r\n    new Promise<T[]>(resolve => {\r\n      const opts = getOptions(searchTerm);\r\n      resolve(opts);\r\n    });\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      filterOptions={\r\n        props.filterSelectedOptions === false\r\n          ? undefined\r\n          : createFilterOptions({\r\n              ignoreAccents: true,\r\n              ignoreCase: true,\r\n              stringify: option => option.Name,\r\n              trim: true,\r\n            })\r\n      }\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","import { FormValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { FieldHookConfig, useFormikContext } from 'formik';\r\nimport * as React from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { FormFieldsSection, FormRow } from '../FormsLayout';\r\nimport {\r\n  FormListenerProps,\r\n  IFieldProps,\r\n  IFormFieldSetting,\r\n} from './IFormFieldSetting';\r\nexport type IFieldRender = (item: JSX.Element) => React.ReactNode;\r\nexport type IFieldSectionRender = () => React.ReactNode;\r\nexport interface FieldsRendererProps<T> {\r\n  fields: FormFieldProps<any>[];\r\n  row?: T;\r\n}\r\nexport interface FormFieldProps<T> extends IFormFieldSetting {\r\n  component: React.FC<FieldHookConfig<T> & IFieldProps & any>;\r\n  order: number;\r\n}\r\nexport interface IFieldRendererProps<T> {\r\n  fieldRow: React.FC<FormFieldProps<FormValueType>>;\r\n  row?: T;\r\n}\r\nexport interface IFieldSection<T> {\r\n  title?: string;\r\n  fields: (FormFieldProps<any> | JSX.Element)[];\r\n  order: number;\r\n  avoidRenderSection?: boolean;\r\n  item: T;\r\n}\r\n\r\nexport function FormikField<T>(props: FormFieldProps<T>) {\r\n  //const { component } = props;\r\n  // const Field = React.memo(function Field(props: FormFieldProps<T>) => {\r\n  //   return React.createElement(component, props);\r\n  // });\r\n  return (\r\n    <FormRow fullRow={props.fullRow} hide={props.hide} minRow={props.minRow}>\r\n      <props.component {...props} />\r\n    </FormRow>\r\n  );\r\n}\r\nexport function FormikSection<T>(props: IFieldSection<T>) {\r\n  const { title, fields, order, avoidRenderSection } = props;\r\n\r\n  return fields.length > 0 ? (\r\n    <React.Fragment>\r\n      {avoidRenderSection ? (\r\n        <React.Fragment>\r\n          {fields.map((field, index) => (\r\n            <React.Fragment key={`${order}-${index}`}>\r\n              {'component' in field ? (\r\n                <FormikField {...field} key={`${order}-${index}`} />\r\n              ) : (\r\n                field\r\n              )}\r\n            </React.Fragment>\r\n          ))}\r\n        </React.Fragment>\r\n      ) : (\r\n        <FormFieldsSection titleSection={title}>\r\n          {fields.map((field, index) => (\r\n            <React.Fragment key={`${order}-${index}`}>\r\n              {'component' in field ? (\r\n                <FormikField {...field} key={`${order}-${index}`} />\r\n              ) : (\r\n                field\r\n              )}\r\n            </React.Fragment>\r\n          ))}\r\n        </FormFieldsSection>\r\n      )}\r\n    </React.Fragment>\r\n  ) : (\r\n    <></>\r\n  );\r\n}\r\nexport function FormListener<T>({\r\n  onFormChange,\r\n  fields,\r\n}: FormListenerProps<T>) {\r\n  const {\r\n    values,\r\n    setFieldValue,\r\n    isValid,\r\n    dirty,\r\n    setFieldTouched,\r\n    validateField,\r\n    setFieldError,\r\n    validate,\r\n  } = useFormikContext<T>();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  React.useEffect(() => {\r\n    onFormChange(\r\n      values,\r\n      isValid,\r\n      dirty,\r\n      setFieldValue,\r\n      setFieldTouched,\r\n      validateField,\r\n      setFieldError,\r\n      validate,\r\n    );\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    ...fields.map(field => values[field]),\r\n    isValid,\r\n    dirty,\r\n  ]);\r\n\r\n  React.useEffect(() => {\r\n    dispatch(actions.setNotSavedChanges(dirty));\r\n  }, [actions, dirty, dispatch]);\r\n\r\n  return null;\r\n}\r\nexport interface FieldChangeHandlerProps<T> {\r\n  key?: keyof T;\r\n  value: any;\r\n  shouldValidate?: boolean;\r\n}\r\nexport interface FieldHandlerProps<T> {\r\n  run?: boolean;\r\n  fieldKey?: keyof T;\r\n  fieldValue?: any;\r\n  shouldValidate?: boolean;\r\n  resetFieldState?: () => void;\r\n  additionalFunc?: (value: any) => void;\r\n}\r\nexport function useFieldChangeHandler<T>() {\r\n  const { setFieldValue } = useFormikContext<T>();\r\n  const changeField = React.useCallback(\r\n    (key, value, shouldValidate) => {\r\n      if (key !== undefined) {\r\n        setFieldValue(key.toString(), value, shouldValidate);\r\n      }\r\n    },\r\n    [setFieldValue],\r\n  );\r\n  return [changeField];\r\n}\r\nexport function SubmittingHandler<T>({\r\n  value,\r\n  resetSubmitting,\r\n}: {\r\n  value: boolean;\r\n  resetSubmitting: () => void;\r\n}) {\r\n  const { setSubmitting } = useFormikContext<T>();\r\n  React.useEffect(() => {\r\n    if (value) {\r\n      setSubmitting(!value);\r\n      resetSubmitting();\r\n    }\r\n\r\n    return () => {};\r\n  }, [resetSubmitting, setSubmitting, value]);\r\n  return null;\r\n}\r\nexport function FieldHandler<T>({\r\n  run,\r\n  fieldKey,\r\n  fieldValue,\r\n  shouldValidate,\r\n  resetFieldState,\r\n  additionalFunc,\r\n}: FieldHandlerProps<T>) {\r\n  const [changeField] = useFieldChangeHandler<T>();\r\n  //const [doChange, setDoChange] = React.useState<boolean | undefined>(run);\r\n  React.useEffect(() => {\r\n    if (run && fieldKey !== undefined) {\r\n      changeField(fieldKey, fieldValue, shouldValidate);\r\n      if (!!additionalFunc) additionalFunc({ [fieldKey]: fieldValue });\r\n      if (!!resetFieldState) resetFieldState();\r\n      //setDoChange(undefined);\r\n    }\r\n    return () => {};\r\n  }, [\r\n    changeField,\r\n    run,\r\n    fieldKey,\r\n    shouldValidate,\r\n    fieldValue,\r\n    resetFieldState,\r\n    additionalFunc,\r\n  ]);\r\n  return null;\r\n}\r\nexport interface SetValueProps<T> {\r\n  setValue?: (value: any) => void;\r\n  resetValueKey?: () => void;\r\n  fieldKey?: keyof T;\r\n}\r\nexport function FieldValue<T>({\r\n  setValue,\r\n  resetValueKey,\r\n  fieldKey,\r\n}: SetValueProps<T>) {\r\n  const { getFieldMeta } = useFormikContext<T>();\r\n\r\n  React.useEffect(() => {\r\n    if (fieldKey !== undefined) {\r\n      const meta = getFieldMeta(fieldKey.toString());\r\n      if (!!setValue) setValue(meta.value);\r\n      if (!!resetValueKey) resetValueKey();\r\n    }\r\n    return () => {};\r\n  }, [fieldKey, getFieldMeta, setValue, resetValueKey]);\r\n  return null;\r\n}\r\n","/**\r\n *\r\n * DatePeriods\r\n *\r\n */\r\nimport { Select, MenuItem, FormControl } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport StandardInput from '../BasicInputs/BaseInputs/StandardInput';\r\nimport { getPeriods } from '../pickers/DatePeriodsPicker';\r\n\r\n/**\r\n * The order of the values in this array does matter for backwards compatibility since there periods type picker used Integer Ids stored in a duplicate array and these might be saved in the saved query string filters for some users.\r\n *\r\n */\r\nexport const ALL_PERIOD_TYPES = [\r\n  'CustomDate',\r\n  'Today',\r\n  'TodayTomorrow',\r\n  'ThisWeek',\r\n  'NextWeek',\r\n  'ThisMonth',\r\n  'NextMonth',\r\n  'ThisQuarter',\r\n  'NextQuarter',\r\n  'ThisYear',\r\n  'NextYear',\r\n  'LastWeek',\r\n  'LastMonth',\r\n  'LastQuarter',\r\n  'LastYear',\r\n  'Tomorrow',\r\n  'Yesterday',\r\n] as const;\r\ntype PeriodTypesTyple = typeof ALL_PERIOD_TYPES;\r\nexport type PeriodTypes = PeriodTypesTyple[number];\r\nexport interface PeriodTypesEntity extends Entity<PeriodTypes> {}\r\nexport const getPeriodTypesEntity = (\r\n  valueType: PeriodTypes,\r\n): PeriodTypesEntity => {\r\n  return getPeriods()\r\n    .map(item => {\r\n      return {\r\n        Id: item.Id,\r\n        Name: translations[item.Name],\r\n        type: item.Name as PeriodTypes,\r\n      };\r\n    })\r\n    .filter(value => {\r\n      return value.type === valueType;\r\n    })[0];\r\n};\r\nexport const getPeriodTypesEntityById = (\r\n  id: PeriodTypes | number | undefined,\r\n): PeriodTypesEntity | undefined => {\r\n  if (id === undefined) {\r\n    return undefined;\r\n  }\r\n  const periodType: PeriodTypes | undefined =\r\n    typeof id === 'number' ? ALL_PERIOD_TYPES[id] : id;\r\n\r\n  return getPeriods()\r\n    .map(item => {\r\n      return {\r\n        Id: item.Id,\r\n        Name: translations[item.Name],\r\n        type: item.Name as PeriodTypes,\r\n      };\r\n    })\r\n    .filter(value => {\r\n      return value.Id === periodType;\r\n    })[0];\r\n};\r\nexport interface DatePeriodsProps {\r\n  value: PeriodTypes;\r\n  onChange: (value: PeriodTypes) => void;\r\n  size?: 'medium' | 'small' | undefined;\r\n}\r\n\r\nexport function DatePeriods(props: DatePeriodsProps) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <FormControl variant=\"filled\">\r\n      <Select\r\n        input={<StandardInput margin=\"dense\" />}\r\n        value={props.value}\r\n        onChange={e => props.onChange(e.target.value as PeriodTypes)}\r\n      >\r\n        {ALL_PERIOD_TYPES.map(key => (\r\n          <MenuItem key={key} value={key}>\r\n            {t(key)}\r\n          </MenuItem>\r\n        ))}\r\n      </Select>\r\n    </FormControl>\r\n  );\r\n}\r\n","import {\r\n  DownloadFileProps,\r\n  ListMessagesProps,\r\n  OpenDetailsProps,\r\n} from './Actions';\r\n\r\nexport enum SnackBarActionType {\r\n  refreshTable = 1,\r\n}\r\nexport enum SnackBarMessageType {\r\n  openSidepanelDetails = 1,\r\n  showLinkMessage = 2,\r\n  HTML = 3,\r\n  messageList = 4,\r\n  fileDownload = 5,\r\n}\r\nexport type SnackBarMessageProps =\r\n  | OpenDetailsProps\r\n  | ListMessagesProps\r\n  | DownloadFileProps;\r\n","import * as Handlebar from 'handlebars';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport sanitizeHtml from 'sanitize-html';\r\n\r\nHandlebar.registerHelper('formatDate', (date, format) => {\r\n  try {\r\n    return dateUtils.format(date, format);\r\n  } catch (error) {\r\n    return error;\r\n  }\r\n});\r\nHandlebar.registerHelper('sanitize', value => {\r\n  try {\r\n    return sanitizeHtml(value);\r\n  } catch (error) {\r\n    return error;\r\n  }\r\n});\r\n\r\nconst customFormAst = Handlebar.parse(\r\n  '{{#each CustomForm}}<p>{{Id}}: {{Value}}</p>{{/each}}',\r\n);\r\nexport const parse = (template: string | undefined) =>\r\n  Handlebar.parse(template ?? '');\r\n/**\r\n * Compiles Handlebars template to be used in scheduler text templates.\r\n * * adds formatDate support\r\n * * adds support for {{CustomForm}} - by replacing it with the custom form - specific template\r\n * @param template user-input template text\r\n * @returns\r\n */\r\nexport const compileHandlebarsTemplate = <T>(template?: string) => {\r\n  if (template === undefined) {\r\n    return undefined;\r\n  }\r\n\r\n  // first parse the template\r\n  const ast = Handlebar.parse(template);\r\n\r\n  // mutate - replace the CustomForm placeholder by expanding it using another AST\r\n  new ReplaceMutatingVisitor('CustomForm', customFormAst).accept(ast);\r\n\r\n  // finally compile the resulting AST\r\n  const result = Handlebar.compile<T>(ast);\r\n\r\n  return result;\r\n};\r\n\r\n/**\r\n * Mutates AST tree by replacing a given node.\r\n */\r\nclass ReplaceMutatingVisitor extends Handlebar.Visitor {\r\n  _replacementStatement = null;\r\n  _path = null;\r\n  mutating = true;\r\n  /**\r\n   * Initializes the Visitor\r\n   * @param path original Path name to replace the node at\r\n   * @param replacementStatement replacement expression\r\n   */\r\n  constructor(path, replacementStatement) {\r\n    super();\r\n    this._path = path;\r\n    this._replacementStatement = replacementStatement;\r\n  }\r\n  MustacheStatement(mustache: hbs.AST.MustacheStatement) {\r\n    if ((mustache.path as hbs.AST.PathExpression)?.original === this._path) {\r\n      return this._replacementStatement;\r\n    }\r\n  }\r\n}\r\n","import * as Handlebar from 'handlebars';\r\n\r\n/**\r\n * Extracts paths used in handlebars ast\r\n */\r\nexport class ExtractPathsVisitor extends Handlebar.Visitor {\r\n  paths: string[] = [];\r\n  MustacheStatement(mustache: hbs.AST.MustacheStatement) {\r\n    // for our purpose the path can be either a direct property path or a handlebars helper function with property as a parameter\r\n    const isHelperPath = mustache.params.length > 0;\r\n    if (isHelperPath) {\r\n      // extract all parameters that are PathExpression only (e.g. ignore LiteralExpression, etc.)\r\n      const paths = mustache.params\r\n        .filter(f => f.type === 'PathExpression')\r\n        .map(f => (f as hbs.AST.PathExpression)?.original);\r\n      this.paths.push(...paths);\r\n    } else {\r\n      this.paths.push((mustache.path as hbs.AST.PathExpression)?.original);\r\n    }\r\n  }\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { allowedToViewAlert } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n  selectglobalSettings,\r\n  selectKnownModule,\r\n  selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { RootState } from 'types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { initialState } from '.';\r\nimport { getViewEndDate, getViewStartDate } from '../utils';\r\nimport { EventType, SchedulerState } from './types';\r\nimport { selectGlobalSetting } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { MultipleInstrumentReservations } from 'enums/MultipleInstrumentReservations';\r\nimport { selectSelectedSavedView } from 'app/pages/SavedViewsPage/SavedViewPage/slice/selectors';\r\nimport { selectIsMobileView } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  compileHandlebarsTemplate,\r\n  parse,\r\n} from '../components/event_text/handlebars';\r\nimport { ExtractPathsVisitor } from '../components/event_text/ExtractPathsVisitor';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { union } from 'lodash';\r\nimport { Identifiable } from 'types/common';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { canEditReservation } from 'app/permissions/Reservations/reservationPermissions';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { mapEvents } from '../utils/syncSchedulerEvents';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { tryParseBool } from 'utils/string-utils';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  (state.scheduler || initialState) as SchedulerState;\r\n\r\nexport const selectScheduler = createSelector([selectSlice], state => state);\r\n\r\nconst selectEvents = createSelector([selectScheduler], state => state.events);\r\n\r\nexport const selectSchedulerEvents = createSelector([selectScheduler], state =>\r\n  state.viewState?.date === undefined\r\n    ? undefined\r\n    : state.events[state.viewState?.date],\r\n);\r\n\r\nexport const selectSchedulerOfflineHours = createSelector(\r\n  [selectScheduler],\r\n  state => state.offlineHours,\r\n);\r\nexport const selectTrainingSessions = createSelector(\r\n  [selectScheduler],\r\n  state => state.trainingSessions,\r\n);\r\n\r\nexport const selectSchedulerViewState = createSelector(\r\n  [selectSlice],\r\n  state => state.viewState,\r\n);\r\nexport const selectSchedulerDateTs = createSelector(\r\n  [selectSchedulerViewState],\r\n  state => state?.date,\r\n);\r\nexport const selectSchedulerViewType = createSelector(\r\n  [selectSchedulerViewState],\r\n  state => state?.viewType,\r\n);\r\n\r\nexport const selectSchedulerDate = createSelector(\r\n  [selectSchedulerDateTs],\r\n  state => (state === undefined ? undefined : dateUtils.parseISO(state)),\r\n);\r\n\r\nexport const selectNonWorkingHours = createSelector(\r\n  [selectScheduler],\r\n  state => state.nonWorkingHours,\r\n);\r\nexport const selectSchedulerTempEvents = createSelector(\r\n  [selectSlice],\r\n  state => state.tempReservations,\r\n);\r\n\r\nexport const selectLoadedServices = createSelector(\r\n  [selectScheduler],\r\n  state => state.selectedServices,\r\n);\r\nexport const selectSchedulerServicesLimit = createSelector(\r\n  [selectLoadedServices, selectglobalSettings, selectSchedulerViewState],\r\n  (services, globalSettings, viewState) => {\r\n    const limitKey =\r\n      viewState?.viewType === 'calendar'\r\n        ? 'CalendarServicesPickerCapacity'\r\n        : viewState?.viewType === 'timeline'\r\n        ? 'MaximumTimelineRowsLimit'\r\n        : undefined;\r\n    const limitString =\r\n      limitKey === undefined ? undefined : globalSettings.TryGet(limitKey);\r\n    const limitNumber =\r\n      limitString === undefined || limitString === null\r\n        ? undefined\r\n        : parseInt(limitString);\r\n    return limitNumber;\r\n  },\r\n);\r\nexport const selectSchedulerFilters = createSelector(\r\n  [selectSlice],\r\n  state => state.filters,\r\n);\r\nexport const selectWithReservationsOnly = createSelector(\r\n  [selectSchedulerFilters],\r\n  state =>\r\n    (state?.['WithReservationsOnly']?.value as Identifiable<boolean>)?.Id,\r\n);\r\nexport const selectSchedulerServicesLimitReached = createSelector(\r\n  [selectLoadedServices, selectSchedulerServicesLimit],\r\n  (services, limitNumber) =>\r\n    services !== undefined &&\r\n    limitNumber !== undefined &&\r\n    services?.length > limitNumber,\r\n);\r\nexport const selectSchedulerSelectedServices = createSelector(\r\n  [selectLoadedServices, selectSchedulerServicesLimit],\r\n  (services, limitNumber) => {\r\n    if (services === undefined) {\r\n      return undefined;\r\n    }\r\n    if (limitNumber !== undefined && !isNaN(limitNumber)) {\r\n      return services.slice(0, limitNumber);\r\n    } else {\r\n      return services;\r\n    }\r\n  },\r\n);\r\nexport const selectSchedulerDerivedServices = createSelector(\r\n  [selectScheduler],\r\n  state => state.derivedServices,\r\n);\r\n/**\r\n * map reservations in scheduler prasable format\r\n */\r\nconst selectMappedReservations = createSelector(\r\n  [selectEvents, selectSchedulerDateTs],\r\n  (items, date) =>\r\n    date === undefined\r\n      ? undefined\r\n      : mapEvents('reservation', items[date], f => ({\r\n          id: String(f.Id),\r\n          reservation_id: f.Id,\r\n          start_date: f.StartTime,\r\n          end_date: f.EndTime,\r\n          color: f.EquipmentColor ?? undefined,\r\n          service_id: f.EquipmentId,\r\n          service_name: f.EquipmentName,\r\n        })),\r\n);\r\n/**\r\n * map offline hours in scheduler prasable format\r\n */\r\nconst selectMappedOfflineHours = createSelector(\r\n  [selectSchedulerOfflineHours, selectSchedulerDateTs],\r\n  (items, date) =>\r\n    date === undefined\r\n      ? undefined\r\n      : mapEvents('offline', items[date], offline => ({\r\n          id: `offline_${offline.Id}`,\r\n          alert_id: offline.AlertId ?? undefined,\r\n\r\n          start_date: offline.StartTime,\r\n          end_date: offline.EndTime,\r\n          service_id: offline.EquipmentId,\r\n          service_name: offline.EquipmentName,\r\n          offline_id: offline.Id,\r\n        })),\r\n);\r\n/**\r\n * map training session in scheduler prasable format\r\n */\r\nconst selectMappedTrainingSessions = createSelector(\r\n  [selectTrainingSessions, selectSchedulerDateTs],\r\n  (items, date) =>\r\n    date === undefined\r\n      ? undefined\r\n      : mapEvents('trainingsession', items[date], item => {\r\n          const x = {\r\n            id: `trainingsession_${item.Id}`,\r\n            reservation_id: item.ReservationId ?? undefined,\r\n            start_date: item.StartTime,\r\n            end_date: item.EndTime,\r\n            service_id: item.EquipmentId,\r\n            service_name: item.EquipmentName,\r\n            color: item.EquipmentColor ?? undefined,\r\n            trainingsession_id: item.Id,\r\n          };\r\n          return x;\r\n        }),\r\n);\r\n/**\r\n * combine all items shown as events\r\n */\r\nconst selectMapped = createSelector(\r\n  [\r\n    selectMappedReservations,\r\n    selectMappedOfflineHours,\r\n    selectMappedTrainingSessions,\r\n  ],\r\n  (a, b, c) =>\r\n    a === undefined && b === undefined && c === undefined\r\n      ? undefined\r\n      : [...(a ?? []), ...(b ?? []), ...(c ?? [])],\r\n);\r\n/**\r\n * Selects combined reservations, training sessions & offline hours used to be parsed by the dhtmlx scheduler\r\n */\r\nexport const selectSchedulerParseEvents = createSelector(\r\n  [selectMapped, selectAuthenticatedUser, selectSchedulerViewType],\r\n  (mappedEvents, authenticatedUser, viewType) => {\r\n    var items =\r\n      viewType === 'calendar'\r\n        ? mappedEvents?.filter(\r\n            f =>\r\n              !(\r\n                f.type === 'reservation' &&\r\n                (f.original as ICalendarReservationDto).TrainingSignUp === true\r\n              ),\r\n          )\r\n        : mappedEvents;\r\n    return items?.map(item => {\r\n      const viewType = item.type;\r\n\r\n      let readonly = true;\r\n      let notClickable = false;\r\n      switch (viewType) {\r\n        case 'reservation':\r\n          readonly =\r\n            !canEditReservation(authenticatedUser, {\r\n              ServiceId: item.original.EquipmentId ?? 0,\r\n              ServiceTypeId: ServiceType.Online,\r\n              ServiceGroupId: item.original.ServiceGroupId ?? 0,\r\n              UserId: (item.original as ICalendarReservationDto).BookedById,\r\n            }) ||\r\n            (item.original as ICalendarReservationDto).Restricted === true ||\r\n            (item.original as ICalendarReservationDto).TrainingSignUp === true;\r\n          notClickable =\r\n            !canEditReservation(authenticatedUser, {\r\n              ServiceId: item.original.EquipmentId ?? 0,\r\n              ServiceTypeId: ServiceType.Online,\r\n              ServiceGroupId: item.original.ServiceGroupId ?? 0,\r\n              UserId: (item.original as ICalendarReservationDto).BookedById,\r\n            }) ||\r\n            (item.original as ICalendarReservationDto).Restricted === true;\r\n          break;\r\n        case 'offline':\r\n          readonly = notClickable = !allowedToViewAlert(authenticatedUser, {\r\n            ReportedBy: (item.original as IWorkingHoursDto).BookedById,\r\n            ServiceGroupId: (item.original as IWorkingHoursDto).ServiceGroupId,\r\n            ServiceId: item.original.EquipmentId ?? 0,\r\n            ServiceTypeId: ServiceType.Online,\r\n          });\r\n      }\r\n\r\n      return {\r\n        ...item,\r\n        readonly: readonly,\r\n        notClickable: notClickable,\r\n        // disables start event resize on timeline view\r\n        _no_resize_end: readonly,\r\n        // disabled end event drag on timelene view\r\n        _no_resize_start: readonly,\r\n        // disables drag on matrix view\r\n        _no_drag_move: readonly,\r\n      };\r\n    });\r\n  },\r\n);\r\nexport const selectSchedulerServices = createSelector(\r\n  [\r\n    selectSchedulerSelectedServices,\r\n    selectSchedulerDerivedServices,\r\n    selectGlobalServiceGroupFilter,\r\n    selectWithReservationsOnly,\r\n\r\n    selectMapped,\r\n  ],\r\n  (\r\n    selectedServices,\r\n    derivedServices,\r\n    serviceGroups,\r\n    WithReservationsOnly,\r\n    events,\r\n  ) => {\r\n    // use selectedServices if case a service have been selected\r\n    // if no service was selected use the services of reservations returned by the filter\r\n    const services =\r\n      (selectedServices ?? []).length > 0 ? selectedServices : derivedServices;\r\n\r\n    // show only services of the selected top service group filter if it has been applied\r\n    const intermediate1 = filterServicesByServiceGroups(\r\n      serviceGroups,\r\n      services,\r\n    );\r\n\r\n    // applies WithReservationsOnly filter to the services\r\n    const intermediate2 = filterServicesByEvents(\r\n      events,\r\n      intermediate1,\r\n      WithReservationsOnly,\r\n    );\r\n\r\n    return intermediate2;\r\n  },\r\n);\r\nexport const selectSchedulerPreviousViewState = createSelector(\r\n  [selectSlice],\r\n  state => state.previousViewState,\r\n);\r\nconst instrumentMultipleEnabled = state =>\r\n  selectGlobalSetting(state, AllowedSettings.MultipleInstrumentReservations);\r\n\r\nexport const selectMultipleModeState = createSelector(\r\n  [\r\n    instrumentMultipleEnabled,\r\n    selectSelectedSavedView,\r\n    selectUserProfileSettings,\r\n  ],\r\n  (multipleInstrumentsSetting, currentSelected, userProfile) => {\r\n    if (\r\n      multipleInstrumentsSetting !== undefined &&\r\n      MultipleInstrumentReservations[multipleInstrumentsSetting] !==\r\n        MultipleInstrumentReservations.NotAllowed\r\n    ) {\r\n      // todo:\r\n\r\n      const instrumentMultipleEnabled =\r\n        userProfile.GetSettingValueBy(\r\n          (f: { Key: string }) =>\r\n            f.Key.toLowerCase() === 'BookMultipleInstruments'.toLowerCase(),\r\n        )?.IsMultiple ?? undefined;\r\n      if (!!currentSelected) {\r\n        return currentSelected.Multiple;\r\n      } else if (instrumentMultipleEnabled !== undefined) {\r\n        return instrumentMultipleEnabled;\r\n      } else {\r\n        return (\r\n          MultipleInstrumentReservations[multipleInstrumentsSetting] ===\r\n          MultipleInstrumentReservations.AllowedDefaultMultiple\r\n        );\r\n      }\r\n    } else {\r\n      return undefined;\r\n    }\r\n  },\r\n);\r\n\r\nexport const selectSchedulerViewStartDate = createSelector(\r\n  [selectSchedulerViewState],\r\n  state =>\r\n    state === undefined\r\n      ? undefined\r\n      : getViewStartDate(state.viewLength, state.date, state.customStart),\r\n);\r\nexport const selectSchedulerViewEndDate = createSelector(\r\n  [selectSchedulerViewState],\r\n  state =>\r\n    state === undefined\r\n      ? undefined\r\n      : getViewEndDate(\r\n          state.viewLength,\r\n          state.date,\r\n          state.customDays,\r\n          state.customStart,\r\n        ),\r\n);\r\nexport const selectSchedulerViewCustomDays = createSelector(\r\n  [selectSchedulerViewState],\r\n  state => state?.customDays,\r\n);\r\nexport const selectSchedulerViewCustomStart = createSelector(\r\n  [selectSchedulerViewState],\r\n  state => state?.customStart,\r\n);\r\nexport const selectNotUseLocation = createSelector(\r\n  [selectSlice],\r\n  state => state.notUseLocation,\r\n);\r\nexport const selectEmptySlotAdminClick = createSelector(\r\n  [selectScheduler],\r\n  state => state.emptySlotAdminClick,\r\n);\r\nexport const selectSchedulerNewEventServices = createSelector(\r\n  [\r\n    selectSchedulerViewState,\r\n    selectSchedulerTempEvents,\r\n    selectSchedulerSelectedServices,\r\n    selectSchedulerDerivedServices,\r\n    selectIsMobileView,\r\n  ],\r\n  (\r\n    viewState,\r\n    tempReservation,\r\n    selectedServices,\r\n    derivedServices,\r\n    isMobileView,\r\n  ) => {\r\n    // timeline + daily calendar (unit) has separate row/column for each service\r\n    // so in this state new event is placed directly on an instrument\r\n    const singleServiceEvent =\r\n      viewState?.viewType === 'timeline' ||\r\n      (viewState?.viewType === 'calendar' &&\r\n        viewState.viewLength === 'day' &&\r\n        !isMobileView);\r\n\r\n    const getSingleServiceEventServices = () => {\r\n      // try looking up both directly selected services and services derived from the events shown on the calendar when no service is directly selected\r\n      const s =\r\n        selectedServices?.find(f => f.Id === tempReservation?.service_id) ??\r\n        derivedServices?.find(f => f.Id === tempReservation?.service_id);\r\n      if (s === undefined) {\r\n        return [];\r\n      } else {\r\n        return [s];\r\n      }\r\n    };\r\n    const services =\r\n      (singleServiceEvent\r\n        ? getSingleServiceEventServices()\r\n        : selectedServices) ?? [];\r\n\r\n    return services;\r\n  },\r\n);\r\nexport const selectTwoDaysTimelineButtonEnabled = createSelector(\r\n  [selectglobalSettings],\r\n  globalSettings => {\r\n    return globalSettings.GetBoolean('EnableTwoDaysTimelineButton');\r\n  },\r\n);\r\nexport const selectCustomDaysTimelineButtonEnabled = createSelector(\r\n  [selectglobalSettings],\r\n  globalSettings => {\r\n    return globalSettings.GetBoolean('EnableCustomDaysTimelineButton');\r\n  },\r\n);\r\nexport const selectSelectedReservationEvents = createSelector(\r\n  [selectSlice],\r\n  state => state.selectedReservationEvents,\r\n);\r\n\r\nexport const selectDefaultCustomDaysTimelineValue = createSelector(\r\n  [selectglobalSettings],\r\n  globalSettings => {\r\n    const daysString = globalSettings.TryGet('DefaultCustomDaysTimelineValue');\r\n    const daysNumber =\r\n      daysString === undefined || daysString === null\r\n        ? undefined\r\n        : parseInt(daysString);\r\n    return daysNumber;\r\n  },\r\n);\r\n\r\nexport const selectIncludeCustomFormInSchedulerReservationTooltip = createSelector(\r\n  [\r\n    (state: RootState) =>\r\n      selectGlobalSetting(\r\n        state,\r\n        AllowedSettings.IncludeCustomFormInSchedulerReservationTooltip,\r\n      ),\r\n  ],\r\n  f => tryParseBool(f),\r\n);\r\n\r\nexport const selectSchedulerReservationBodyTemplate = createSelector(\r\n  [\r\n    (state: RootState) =>\r\n      selectGlobalSetting(\r\n        state,\r\n        AllowedSettings.SchedulerReservationBodyTemplate,\r\n      ),\r\n  ],\r\n  f => compileHandlebarsTemplate(f),\r\n);\r\n\r\nexport const selectSchedulerReservationTooltipTemplate = createSelector(\r\n  [\r\n    (state: RootState) =>\r\n      selectGlobalSetting(\r\n        state,\r\n        AllowedSettings.SchedulerReservationTooltipTemplate,\r\n      ),\r\n  ],\r\n  f => compileHandlebarsTemplate(f),\r\n);\r\n\r\nexport const selectCalendarReservationColumns = createSelector(\r\n  [\r\n    (state: RootState) =>\r\n      selectGlobalSetting(\r\n        state,\r\n        AllowedSettings.SchedulerReservationBodyTemplate,\r\n      ),\r\n\r\n    (state: RootState) =>\r\n      selectGlobalSetting(\r\n        state,\r\n        AllowedSettings.SchedulerReservationTooltipTemplate,\r\n      ),\r\n    (state: RootState) =>\r\n      selectKnownModule(state, KnownModules.EquipmentAssemblies),\r\n    (state: RootState) =>\r\n      selectGlobalSetting(state, AllowedSettings.AllowWorkflowBooking),\r\n    selectIncludeCustomFormInSchedulerReservationTooltip,\r\n  ],\r\n  (\r\n    schedulerReservationBodyTemplate,\r\n    schedulerReservationTooltipTemplate,\r\n    equipmentAssemblies,\r\n    allowWorkflowBooking,\r\n    includeCustomFormInSchedulerReservationTooltip,\r\n  ) => {\r\n    const pathExtractor = new ExtractPathsVisitor();\r\n    pathExtractor.accept(parse(schedulerReservationBodyTemplate));\r\n    pathExtractor.accept(parse(schedulerReservationTooltipTemplate));\r\n    const reservationHistorySelectArray: Array<\r\n      keyof ICalendarReservationDto\r\n    > = [\r\n      'Id',\r\n      'StartTime',\r\n      'EndTime',\r\n      'EquipmentId',\r\n      'EquipmentName',\r\n      'ServiceGroupId',\r\n      'EquipmentColor',\r\n      'BookedBy',\r\n      'BookedById',\r\n      'StatusId',\r\n      'Tutoring',\r\n      'Restricted',\r\n      'TrainingSignUp',\r\n      'FullDayReservation',\r\n    ];\r\n    if (equipmentAssemblies) {\r\n      reservationHistorySelectArray.push('TopAssemblyReservationId');\r\n    }\r\n    if (allowWorkflowBooking) {\r\n      reservationHistorySelectArray.push('WorkFlowBookingName');\r\n    }\r\n    if (includeCustomFormInSchedulerReservationTooltip === true) {\r\n      reservationHistorySelectArray.push('CustomForm');\r\n    }\r\n    const p = union(reservationHistorySelectArray, pathExtractor.paths);\r\n    return p;\r\n  },\r\n);\r\nfunction filterServicesByServiceGroups(\r\n  serviceGroups?: Identifiable<number>[],\r\n  services?: IServiceFilterDto[],\r\n) {\r\n  const serviceGroupIds = (serviceGroups ?? [])?.map(f => f.Id);\r\n  return serviceGroupIds.length === 0\r\n    ? services\r\n    : services?.filter(\r\n        service =>\r\n          service.ServiceGroupId === undefined ||\r\n          serviceGroupIds.includes(service.ServiceGroupId),\r\n      );\r\n}\r\n\r\nfunction filterServicesByEvents(\r\n  events: Array<{ type: EventType; service_id: number }> | undefined,\r\n  services: IServiceFilterDto[] | undefined,\r\n  WithReservationsOnly: boolean | undefined,\r\n) {\r\n  if (WithReservationsOnly === true) {\r\n    const servicesWithEvents = new Set(\r\n      events\r\n        ?.filter(f => f.type === 'reservation' || f.type === 'trainingsession')\r\n        .map(f => f.service_id),\r\n    );\r\n\r\n    const xx = services?.filter(service => servicesWithEvents.has(service.Id));\r\n    return xx;\r\n  } else {\r\n    return services;\r\n  }\r\n}\r\n\r\nexport const selectSchedulerLoadingEvents = createSelector(\r\n  [selectSlice],\r\n  state => state.loadingEvents,\r\n);\r\n\r\nexport const selectTimelineGroupBy = createSelector(\r\n  [selectSchedulerViewState],\r\n  state => state?.groupBy,\r\n);\r\n\r\nexport const selectExportToPDF = createSelector(\r\n  [selectSlice],\r\n  state => state.exportToPDF,\r\n);\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.RequiredTypes\r\n *\r\n */\r\n\r\nexport enum RequiredTypes {\r\n  Optional = 0,\r\n  User = 1,\r\n  Admin = 2,\r\n  Conditional = 3,\r\n}\r\nexport type RequiredTypesUnion = keyof typeof RequiredTypes;\r\nexport const RequiredTypesUnionArray: Array<RequiredTypesUnion> = [\r\n  'Optional',\r\n  'User',\r\n  'Admin',\r\n  'Conditional',\r\n];\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.DisplayTypes\r\n *\r\n */\r\n\r\nexport enum DisplayTypes {\r\n  AlwaysVisible = 0,\r\n  VisibleToAdminOnly = 1,\r\n  VisibleToUserOnDoneRequest = 2,\r\n}\r\nexport type DisplayTypesUnion = keyof typeof DisplayTypes;\r\nexport const DisplayTypesUnionArray: Array<DisplayTypesUnion> = [\r\n  'AlwaysVisible',\r\n  'VisibleToAdminOnly',\r\n  'VisibleToUserOnDoneRequest',\r\n];\r\n","import { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n  createOptions,\r\n  getDropDownInitValue,\r\n} from './CustomFormFields/CustomFormDropDown';\r\nimport * as Yup from 'yup';\r\nimport * as React from 'react';\r\nimport { ObjectShape } from 'yup/lib/object';\r\nimport { RequiredTypes } from 'api/odata/generated/enums/RequiredTypes';\r\nimport { Entity } from 'types/common';\r\nimport { DisplayTypes } from 'api/odata/generated/enums/DisplayTypes';\r\nimport { isEmptyOrWhitespace, isNullOrUndefined } from 'utils/typeUtils';\r\nimport { lookup } from 'mime-types';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectForbiddenFileExtensions,\r\n  selectUploadFileSizeLimit,\r\n} from 'app/slice/selectors';\r\nimport { differenceWith } from 'lodash';\r\nimport {\r\n  IServiceRequestTableColumnModel,\r\n  IServiceRequestTableRowValueModel,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport interface IFormFileValue {\r\n  Id: number;\r\n  Value: string | null;\r\n  DisplayValue?: string | null;\r\n  Size: number | null;\r\n  PostedFile: File | null;\r\n}\r\nexport function instanceOfIFormValueType(\r\n  objects: any,\r\n): objects is IFormFileValue[] {\r\n  const members = ['Id', 'Value', 'DisplayValue', 'Size', 'PostedFile'];\r\n  return (\r\n    Array.isArray(objects) &&\r\n    objects.every(object => members.every(member => member in object))\r\n  );\r\n}\r\nexport const formFileSchema: Yup.SchemaOf<IFormFileValue> = Yup.object({\r\n  Id: Yup.number().default(-1),\r\n  Value: Yup.string().nullable().default(null),\r\n  DisplayValue: Yup.string().nullable(),\r\n  Size: Yup.number().nullable(true).default(0),\r\n  PostedFile: Yup.mixed().nullable(true).default(null),\r\n});\r\nexport const formValueSchema: Yup.SchemaOf<IFormValueDto> = Yup.object({\r\n  Id: Yup.number().default(-1),\r\n  Value: Yup.string().default('').nullable(),\r\n  DisplayValue: Yup.string().nullable().default(null),\r\n  FormFieldId: Yup.number().default(-1),\r\n  Readonly: Yup.boolean().default(false),\r\n  SourceValueId: Yup.number().nullable(true).notRequired().default(null),\r\n  AlertId: Yup.number().nullable(true).notRequired().default(null),\r\n  AlertTypeId: Yup.number().nullable(true).notRequired().default(null),\r\n  CustomFormId: Yup.number().nullable().default(null),\r\n  CustomFormName: Yup.string().nullable().default(null),\r\n  RequestId: Yup.number().nullable().default(null),\r\n  ReservationId: Yup.number().nullable().default(null),\r\n  ExperimentItemId: Yup.number().nullable().default(null),\r\n  BudgetExperimentId: Yup.number().nullable().default(null),\r\n  ServiceGroupUserId: Yup.number().nullable().default(null),\r\n  ServiceGroupId: Yup.number().nullable().default(null),\r\n});\r\n\r\nexport const ParseFormFieldEnums = (formFields: IFormFieldDto[]) =>\r\n  formFields.forEach(ff => {\r\n    ff.Required = RequiredTypes[ff.Required.toString()];\r\n  });\r\nexport const DeserializeValue = (\r\n  formField: IFormFieldDto,\r\n  formValue: IFormValueDto | null,\r\n) => {\r\n  switch (formField.Type) {\r\n    case 'ShortText':\r\n    case 'Email':\r\n    case 'Number':\r\n    case 'PositiveNumber':\r\n    case 'RichText':\r\n    case 'MultipleAnswersQuestion':\r\n    case 'RadioButtons':\r\n      if (\r\n        formValue &&\r\n        formValue.Value &&\r\n        !isEmptyOrWhitespace(formValue.Value)\r\n      ) {\r\n        return formValue.Value;\r\n      }\r\n      return null;\r\n    case 'Date':\r\n      if (\r\n        formValue &&\r\n        formValue.Value &&\r\n        !isEmptyOrWhitespace(formValue.Value)\r\n      ) {\r\n        return dateUtils.tryParse(formValue.Value);\r\n      }\r\n      return null;\r\n    // case 'AlphanumericWithDashes':\r\n    //   return getAlphaNumericValue(formValue);\r\n    case 'CheckBox':\r\n    case 'Disclaimer':\r\n      if (\r\n        formValue &&\r\n        formValue.Value &&\r\n        !isEmptyOrWhitespace(formValue.Value)\r\n      ) {\r\n        return formValue.Value.toLowerCase() === 'true';\r\n      }\r\n      return false;\r\n    case 'DropDownList':\r\n    case 'UserSelection':\r\n      if (\r\n        formValue &&\r\n        formValue.Value &&\r\n        !isEmptyOrWhitespace(formValue.Value)\r\n      ) {\r\n        const options = createOptions(formField);\r\n        let ddlValue = getDropDownInitValue(\r\n          formValue.Value ?? undefined,\r\n          formField.IsMultiple,\r\n          options,\r\n        );\r\n        return formField.IsMultiple ? ddlValue : ddlValue[0];\r\n      } else {\r\n        return formField.IsMultiple ? [] : null;\r\n      }\r\n    case 'FormSection':\r\n      return null;\r\n    default:\r\n      return null;\r\n  }\r\n};\r\nexport type CustomFormValueType =\r\n  | string\r\n  | Date\r\n  | number\r\n  | boolean\r\n  | IFormFileValue\r\n  | Entity<string>\r\n  | Array<Entity<string>>;\r\nexport const SerializeValue = (\r\n  formField: IFormFieldDto,\r\n  formValue: CustomFormValueType,\r\n): string | null => {\r\n  if (formValue === null || formValue === undefined) {\r\n    return null;\r\n  }\r\n  switch (formField.Type) {\r\n    case 'CheckBox':\r\n    case 'Disclaimer':\r\n      return (formValue as boolean).toString();\r\n    case 'Date':\r\n      return (\r\n        dateUtils.tryFormatIso(formValue, {\r\n          format: 'basic',\r\n          representation: 'date',\r\n        }) ?? null\r\n      );\r\n\r\n    case 'Email':\r\n    case 'Number':\r\n    case 'PositiveNumber':\r\n    case 'RichText':\r\n    case 'ShortText':\r\n    case 'MultipleAnswersQuestion':\r\n    case 'RadioButtons':\r\n      return typeof formValue === 'string' && isEmptyOrWhitespace(formValue)\r\n        ? ''\r\n        : formValue.toString();\r\n    case 'File':\r\n      if (instanceOfIFormValueType(formValue)) {\r\n        let fileValue = formValue as IFormFileValue[];\r\n        if (fileValue.length > 0) {\r\n          return formField.IsMultiple\r\n            ? fileValue\r\n                .filter(f => f.Value !== null)\r\n                .map(v => v.Value)\r\n                .join(',')\r\n            : fileValue[0].Value ?? '';\r\n        } else {\r\n          return '';\r\n        }\r\n      }\r\n      break;\r\n    case 'FormSection':\r\n      return '';\r\n    case 'DropDownList':\r\n    case 'UserSelection':\r\n      if (formValue === null || formValue === undefined) {\r\n        return '';\r\n      } else {\r\n        if (Array.isArray(formValue)) {\r\n          return (formValue as Entity<string>[]).map(f => f.Id).join(',');\r\n        } else {\r\n          return (formValue as Entity<string>).Id.toString();\r\n        }\r\n      }\r\n    default:\r\n      return '';\r\n  }\r\n  return null;\r\n};\r\nexport const getSerializableIsRequired = (\r\n  formField: IFormFieldDto,\r\n  formValue: CustomFormValueType,\r\n) => {\r\n  const val = SerializeValue(formField, formValue);\r\n  return (\r\n    val === null ||\r\n    val === undefined ||\r\n    isEmptyOrWhitespace(val) ||\r\n    val === 'false'\r\n  );\r\n};\r\n\r\nexport function getFieldSchema(\r\n  formField: IFormFieldDto,\r\n  isAdmin: boolean,\r\n  fileSize: number,\r\n  notAllowedExt: string[],\r\n) {\r\n  switch (formField.Type) {\r\n    case 'MultipleAnswersQuestion':\r\n      let result = Yup.string()\r\n        .nullable()\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.string()\r\n\r\n              .required(`${formField.Label} answer is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: 'required',\r\n          message: `${formField.Label} answer is required.`,\r\n          test: (value, context) => {\r\n            if (isEmptyOrWhitespace(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return result;\r\n    case 'RadioButtons':\r\n      let radioButtons = Yup.string()\r\n        .nullable()\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.string()\r\n\r\n              .required(`${formField.Label} radio is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: 'required',\r\n          message: `${formField.Label} radio is required.`,\r\n          test: (value, context) => {\r\n            if (isEmptyOrWhitespace(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return radioButtons;\r\n    case 'File':\r\n      let resultFile = Yup.array()\r\n        .nullable()\r\n        .of(formFileSchema)\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.array()\r\n              .of(formFileSchema)\r\n              .required(`${formField.Label} file is required.`)\r\n              .min(1, `${formField.Label} file is required.`),\r\n          },\r\n        )\r\n        .test({\r\n          name: 'required',\r\n          message: `${formField.Label} file is required.`,\r\n          test: (value, context) => {\r\n            if (value === undefined || value === null || value.length === 0) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: true,\r\n        })\r\n        .test({\r\n          name: 'size',\r\n          message: `${formField.Label} file is to large.`,\r\n          test: (value, context) => {\r\n            if (value !== undefined && value !== null && value.length > 0) {\r\n              let files = value as IFormFileValue[];\r\n              if (files.length > 0) {\r\n                return files.every(f => f.Size == null || f.Size <= fileSize);\r\n              }\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: true,\r\n        })\r\n        .test({\r\n          name: 'type',\r\n          message: `${formField.Label} file type is forbidden.`,\r\n          test: (value, context) => {\r\n            if (value !== undefined && value !== null && value.length > 0) {\r\n              let files = value as IFormFileValue[];\r\n              if (files.length > 0) {\r\n                let blockedTypes = notAllowedExt.map(f => lookup(f));\r\n                let allowedExt =\r\n                  formField.Options === null\r\n                    ? []\r\n                    : formField.Options.split(',').map(f => lookup(f));\r\n                return files.every(f => {\r\n                  if (f.PostedFile !== null) {\r\n                    return (\r\n                      !blockedTypes.includes(f.PostedFile.type) &&\r\n                      (allowedExt.length === 0 ||\r\n                        allowedExt.includes(f.PostedFile.type))\r\n                    );\r\n                  } else {\r\n                    return true;\r\n                  }\r\n                });\r\n              }\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: true,\r\n        });\r\n      return resultFile;\r\n    case 'Date':\r\n      let resultDate = getCustomFormDateSchema(formField, isAdmin);\r\n      return resultDate;\r\n    case 'Email':\r\n      let resultEmail = Yup.string()\r\n        .nullable()\r\n        .email(`${formField.Label} - Email format is not valid`)\r\n        .max(\r\n          formField.SizeLimit,\r\n          `Maximum length of this field is ${formField.SizeLimit}`,\r\n        )\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.string()\r\n              .max(\r\n                formField.SizeLimit,\r\n                `Maximum length of this field is ${formField.SizeLimit}`,\r\n              )\r\n              .required(`${formField.Label} email is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} email is required.`,\r\n          test: (value, context) => {\r\n            if (isEmptyOrWhitespace(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return resultEmail;\r\n    case 'ShortText':\r\n      let resultText = Yup.string()\r\n        .nullable()\r\n        .max(\r\n          formField.SizeLimit,\r\n          `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n        )\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.string()\r\n              .max(\r\n                formField.SizeLimit,\r\n                `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n              )\r\n              .required(`${formField.Label} text is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} text is required.`,\r\n          test: (value, context) => {\r\n            if (isEmptyOrWhitespace(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      // if (formField.Required === 'Conditional') {\r\n      //   if (formField.RequiredFieldToCompare !== null) {\r\n      //     resultText.when((formField.RequiredFieldToCompare ?? formField.DependencyFieldId ?? 'N/A').toString(), {\r\n      //       is: value => isRequired(formField, isAdmin, groupAdmin, value),\r\n      //       then: Yup.string()\r\n      //         .max(\r\n      //           formField.SizeLimit,\r\n      //           `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n      //         )\r\n      //         .required(`${formField.Label} text is required.`),\r\n      //     });\r\n      //   }\r\n      // } else if (isRequired(formField, isAdmin, groupAdmin, null)) {\r\n      //   resultText = resultText.required(\r\n      //     `${formField.Label} text is required.`,\r\n      //   );\r\n      // } else if (\r\n      //   formField.DependencyFieldId !== null &&\r\n      //   formField.DependencyValue !== null\r\n      // ) {\r\n      //   resultText.when(formField.DependencyFieldId.toString(), {\r\n      //     is: value => requiredByDependency(formField, value),\r\n      //     then: Yup.string()\r\n      //       .max(\r\n      //         formField.SizeLimit,\r\n      //         `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n      //       )\r\n      //       .required(`${formField.Label} text is required.`),\r\n      //     otherwise: Yup.string()\r\n      //       .nullable()\r\n      //       .max(\r\n      //         formField.SizeLimit,\r\n      //         `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n      //       ),\r\n      //   });\r\n      // } else {\r\n      //   resultText = resultText.notRequired();\r\n      // }\r\n      return resultText;\r\n    case 'RichText':\r\n      let resultRichText = Yup.string()\r\n        .nullable()\r\n        .max(\r\n          formField.SizeLimit,\r\n          `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n        )\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.string()\r\n              .max(\r\n                formField.SizeLimit,\r\n                `${formField.Label} must be ${formField.SizeLimit} characters long.`,\r\n              )\r\n              .required(`${formField.Label} rich text is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} rich text is required.`,\r\n          test: (value, context) => {\r\n            if (isEmptyOrWhitespace(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return resultRichText;\r\n    case 'Number':\r\n      let resultNumber = Yup.number()\r\n        .nullable()\r\n        .max(\r\n          formField.SizeLimit,\r\n          `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n        )\r\n        .min(\r\n          -formField.SizeLimit,\r\n          `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n        )\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.number()\r\n              .max(\r\n                formField.SizeLimit,\r\n                `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n              )\r\n              .min(\r\n                -formField.SizeLimit,\r\n                `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n              )\r\n              .required(`${formField.Label} number is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} number is required.`,\r\n          test: (value, context) => {\r\n            if (isNullOrUndefined(value) || isNaN(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return resultNumber;\r\n    case 'PositiveNumber':\r\n      let resultPosNumber = Yup.number()\r\n        .nullable()\r\n        .max(\r\n          formField.SizeLimit,\r\n          `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n        )\r\n        .min(\r\n          0,\r\n          `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n        )\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.number()\r\n              .max(\r\n                formField.SizeLimit,\r\n                `${formField.Label} must be less than ${formField.SizeLimit} .`,\r\n              )\r\n              .min(\r\n                0,\r\n                `${formField.Label} must be greater than ${formField.SizeLimit} .`,\r\n              )\r\n              .required(`${formField.Label} number is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} number is required.`,\r\n          test: (value, context) => {\r\n            if (isNullOrUndefined(value) || isNaN(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return resultPosNumber;\r\n    case 'Disclaimer':\r\n      let resultDesc = Yup.boolean()\r\n        .default(false)\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} check is required`,\r\n          test: (value, context) => value === true,\r\n          exclusive: true,\r\n        });\r\n      return resultDesc;\r\n    case 'CheckBox':\r\n      let resultCheck = Yup.boolean()\r\n        .default(false)\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.boolean()\r\n              .default(false)\r\n              .test({\r\n                name: formField.Id.toString(),\r\n                message: `${formField.Label} check is required`,\r\n                test: (value, context) => value === true,\r\n                exclusive: true,\r\n              }),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} rich text is required.`,\r\n          test: (value, context) => {\r\n            if (isNullOrUndefined(value) || value === false) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      return resultCheck;\r\n    case 'DropDownList':\r\n    case 'UserSelection':\r\n      let singleResult = Yup.mixed()\r\n        .nullable()\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.mixed()\r\n              .required(`${formField.Label} select option is required.`)\r\n              .nullable(),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} select option is required.`,\r\n          test: (value, context) => {\r\n            if (isNullOrUndefined(value)) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      let multipleResult = Yup.array()\r\n        .of(Yup.mixed())\r\n        .when(\r\n          [\r\n            (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n            (formField.DependencyFieldId ?? 'NA').toString(),\r\n          ],\r\n          {\r\n            is: value => isRequired(formField, isAdmin, value),\r\n            then: Yup.array()\r\n              .of(Yup.mixed())\r\n              .min(1)\r\n              .required(`${formField.Label} select option is required.`),\r\n          },\r\n        )\r\n        .test({\r\n          name: formField.Id.toString(),\r\n          message: `${formField.Label} select option is required.`,\r\n          test: (value, context) => {\r\n            if (isNullOrUndefined(value) || value.length === 0) {\r\n              return isRequired(formField, isAdmin, null) === false;\r\n            }\r\n            return true;\r\n          },\r\n          exclusive: false,\r\n        });\r\n      // if (formField.Required === 'Conditional') {\r\n      //   if (formField.RequiredFieldToCompare !== null) {\r\n      //     if (formField.IsMultiple) {\r\n      //       multipleResult.when(formField.RequiredFieldToCompare.toString(), {\r\n      //         is: value =>\r\n      //           value !== null &&\r\n      //           value !== undefined &&\r\n      //           (value as Entity<string>[]).some(\r\n      //             f => f.Id === formField.RequiredValueToCompare ?? '',\r\n      //           ),\r\n      //         then: Yup.array()\r\n      //           .of(Yup.mixed())\r\n      //           .required(`${formField.Label} select option is required.`),\r\n      //         otherwise: Yup.array()\r\n      //           .of(Yup.mixed())\r\n      //           .nullable(true)\r\n      //           .notRequired(),\r\n      //       });\r\n      //     } else {\r\n      //       singleResult.when(formField.RequiredFieldToCompare.toString(), {\r\n      //         is: value =>\r\n      //           value !== null &&\r\n      //           value !== undefined &&\r\n      //           ((value as Entity<string>).Id ===\r\n      //             formField.RequiredValueToCompare ??\r\n      //             ''),\r\n      //         then: Yup.mixed().required(\r\n      //           `${formField.Label} select option is required.`,\r\n      //         ),\r\n      //         otherwise: Yup.mixed().nullable(true).notRequired(),\r\n      //       });\r\n      //     }\r\n      //   }\r\n      // } else if (isRequired(formField, isAdmin, null)) {\r\n      //   if (formField.IsMultiple) {\r\n      //     multipleResult = multipleResult.required(\r\n      //       `${formField.Label} select option is required.`,\r\n      //     );\r\n      //   } else {\r\n      //     singleResult = singleResult.required(\r\n      //       `${formField.Label} select option is required.`,\r\n      //     );\r\n      //   }\r\n      // } else if (\r\n      //   formField.DependencyFieldId !== null &&\r\n      //   formField.DependencyValue !== null\r\n      // ) {\r\n      //   if (formField.IsMultiple) {\r\n      //     multipleResult.when(formField.DependencyFieldId.toString(), {\r\n      //       is: value => isDependencyVisible(formField, value),\r\n      //       then: Yup.array()\r\n      //         .of(Yup.mixed())\r\n      //         .required(`${formField.Label} select option is required.`),\r\n      //       otherwise: Yup.array().of(Yup.mixed()).nullable(true).notRequired(),\r\n      //     });\r\n      //   } else {\r\n      //     singleResult.when(formField.DependencyFieldId.toString(), {\r\n      //       is: value => isDependencyVisible(formField, value),\r\n      //       then: Yup.mixed().required(\r\n      //         `${formField.Label} select option is required.`,\r\n      //       ),\r\n      //       otherwise: Yup.mixed().nullable(true).notRequired(),\r\n      //     });\r\n      //   }\r\n      // } else {\r\n      //   if (formField.IsMultiple) {\r\n      //     multipleResult = multipleResult.nullable(true).notRequired();\r\n      //   } else {\r\n      //     singleResult = singleResult.nullable(true).notRequired();\r\n      //   }\r\n      // }\r\n      if (formField.IsMultiple) {\r\n        return multipleResult;\r\n      } else {\r\n        return singleResult;\r\n      }\r\n  }\r\n  let def = Yup.string().nullable().default(null);\r\n  return def;\r\n}\r\n\r\nfunction getCustomFormDateSchema(\r\n  formField: Pick<\r\n    IFormFieldDto,\r\n    | 'Id'\r\n    | 'Label'\r\n    | 'Required'\r\n    | 'DependencyFieldId'\r\n    | 'DependencyValue'\r\n    | 'DependencyMultiple'\r\n    | 'DependencyVisibility'\r\n    | 'RequiredFieldToCompare'\r\n    | 'RequiredValueToCompare'\r\n  >,\r\n  isAdmin: boolean,\r\n) {\r\n  return Yup.date()\r\n    .nullable()\r\n    .when(\r\n      [\r\n        (formField.RequiredFieldToCompare ?? 'NA').toString(),\r\n        (formField.DependencyFieldId ?? 'NA').toString(),\r\n      ],\r\n      {\r\n        is: value => isRequired(formField, isAdmin, value),\r\n        then: Yup.date()\r\n          .required(`${formField.Label} date is required.`)\r\n          .nullable(),\r\n      },\r\n    )\r\n    .test({\r\n      name: formField.Id.toString(),\r\n      message: `${formField.Label} date is required.`,\r\n      test: (value, context) => {\r\n        if (isNullOrUndefined(value)) {\r\n          return isRequired(formField, isAdmin, null) === false;\r\n        }\r\n        return true;\r\n      },\r\n      exclusive: false,\r\n    });\r\n}\r\n\r\nexport function isRequired(\r\n  formField: Pick<\r\n    IFormFieldDto,\r\n    | 'Required'\r\n    | 'DependencyFieldId'\r\n    | 'DependencyValue'\r\n    | 'DependencyMultiple'\r\n    | 'DependencyVisibility'\r\n    | 'RequiredFieldToCompare'\r\n    | 'RequiredValueToCompare'\r\n  >,\r\n  isAdmin: boolean,\r\n  value: any,\r\n): boolean {\r\n  let required = false;\r\n  let requiredType = formField.Required;\r\n  switch (requiredType) {\r\n    case 'Optional':\r\n      required = false;\r\n      break;\r\n    case 'User':\r\n      required = true;\r\n      break;\r\n    case 'Admin':\r\n      required = isAdmin;\r\n      break;\r\n    case 'Conditional':\r\n      if (\r\n        formField.RequiredFieldToCompare !== null &&\r\n        formField.RequiredValueToCompare !== null &&\r\n        !isNullOrUndefined(value)\r\n      ) {\r\n        let comparedValue = getParentValue(value);\r\n        return formField.RequiredValueToCompare === comparedValue;\r\n      }\r\n      break;\r\n    default:\r\n      required = false;\r\n      break;\r\n  }\r\n  if (required && formField.DependencyFieldId !== null) {\r\n    required = isDependencyVisible(formField, value);\r\n  }\r\n  return required;\r\n}\r\nexport function isVisible(\r\n  formField: IFormFieldDto,\r\n  isAdmin: boolean,\r\n  visibleOnComletion?: () => boolean,\r\n) {\r\n  let visible = true;\r\n  switch (formField.DisplayType) {\r\n    case DisplayTypes.AlwaysVisible:\r\n      visible = true;\r\n      break;\r\n    case DisplayTypes.VisibleToAdminOnly:\r\n      visible = isAdmin;\r\n      break;\r\n    case DisplayTypes.VisibleToUserOnDoneRequest:\r\n      if (visibleOnComletion) {\r\n        visible = visibleOnComletion();\r\n      }\r\n      break;\r\n    default:\r\n      visible = true;\r\n  }\r\n  return visible;\r\n}\r\nexport function isDependencyVisible(\r\n  formField: Pick<\r\n    IFormFieldDto,\r\n    | 'DependencyFieldId'\r\n    | 'DependencyValue'\r\n    | 'DependencyMultiple'\r\n    | 'DependencyVisibility'\r\n    | 'RequiredFieldToCompare'\r\n    | 'RequiredValueToCompare'\r\n  >,\r\n  value: any,\r\n): boolean {\r\n  if (\r\n    formField.DependencyFieldId === null ||\r\n    formField.DependencyValue === null\r\n  ) {\r\n    return true;\r\n  }\r\n  let valueTocompare = formField.DependencyValue;\r\n  let parentValue = getParentValue(value);\r\n  if (formField.DependencyMultiple) {\r\n    if (parentValue === null) {\r\n      return !(formField.DependencyVisibility === true);\r\n    }\r\n    let vp = valueTocompare.split(',');\r\n    let pv = parentValue.split(',');\r\n    let comparedRes = vp.filter(f => pv.filter(vf => vf === f).length > 0);\r\n    let valid = comparedRes.length === vp.length;\r\n    if (valid) {\r\n      return formField.DependencyVisibility === true;\r\n    } else {\r\n      return !(formField.DependencyVisibility === true);\r\n    }\r\n  } else {\r\n    if (valueTocompare === parentValue) {\r\n      return formField.DependencyVisibility === true;\r\n    } else {\r\n      return !(formField.DependencyVisibility === true);\r\n    }\r\n  }\r\n}\r\nexport function getParentValue(value: any): string | null {\r\n  if (\r\n    value === null ||\r\n    value === undefined ||\r\n    (Array.isArray(value) && value.length === 0)\r\n  ) {\r\n    return null;\r\n  } else if (typeof value === 'string') {\r\n    return value;\r\n  } else if (Array.isArray(value)) {\r\n    return (value as Entity<string>[]).map(f => f.Id).join(',');\r\n  } else if (value.hasOwnProperty('Id')) {\r\n    return (value as Entity<string>).Id;\r\n  } else {\r\n    return value.toString();\r\n  }\r\n}\r\nexport const getFieldsVisibilities = (\r\n  formFields: IFormFieldDto[],\r\n  isAdmin: boolean,\r\n  values: Record<string, any> | undefined,\r\n  visibleOnCompletion?: () => boolean,\r\n): Record<number, boolean> | undefined => {\r\n  if (values) {\r\n    const visibilities: Record<number, boolean> = {};\r\n    formFields.forEach(field => {\r\n      if (field.Active) {\r\n        visibilities[field.Id] =\r\n          isVisible(field, isAdmin, visibleOnCompletion) &&\r\n          (field.DependencyFieldId === null ||\r\n            (field.DependencyFieldId !== null &&\r\n              isDependencyVisible(\r\n                field,\r\n                values[field.DependencyFieldId.toString()],\r\n              )));\r\n      }\r\n    });\r\n    return visibilities;\r\n  }\r\n  return undefined;\r\n};\r\nexport const useCustomFormSchema = (\r\n  formFields: IFormFieldDto[],\r\n  isAdmin: boolean,\r\n): Yup.SchemaOf<object> => {\r\n  const ForbiddenFileExtensions = useSelector(selectForbiddenFileExtensions);\r\n  const UploadFileSizeLimit = useSelector(selectUploadFileSizeLimit);\r\n  return React.useMemo(() => {\r\n    const shape: ObjectShape = {};\r\n    formFields.forEach(field => {\r\n      if (field.Active) {\r\n        shape[field.Id] = getFieldSchema(\r\n          field,\r\n          isAdmin,\r\n          UploadFileSizeLimit,\r\n          ForbiddenFileExtensions,\r\n        );\r\n      }\r\n    });\r\n    return Yup.object(shape);\r\n  }, [ForbiddenFileExtensions, UploadFileSizeLimit, formFields, isAdmin]);\r\n};\r\nexport const getCustomFormInitialValues = (\r\n  formFields: IFormFieldDto[],\r\n  formValues?: IFormValueDto[],\r\n  startQuiz?: boolean,\r\n): Record<string, unknown> | undefined => {\r\n  if (\r\n    formValues === undefined &&\r\n    (startQuiz === undefined || startQuiz === false)\r\n  ) {\r\n    return undefined;\r\n  }\r\n  const xx = formFields\r\n    .map(formField => ({\r\n      formField: formField,\r\n      formValue: formValues?.find(\r\n        formValue => formValue.FormFieldId === formField.Id,\r\n      ),\r\n    }))\r\n    .map(item => ({\r\n      formField: item.formField,\r\n      value:\r\n        item.formField.Type === 'File'\r\n          ? item.formValue === null || item.formValue === undefined\r\n            ? null\r\n            : [item.formValue]\r\n          : DeserializeValue(item.formField, item.formValue ?? null),\r\n    }));\r\n\r\n  const result =\r\n    xx.reduce((initialValues, item) => {\r\n      initialValues[item.formField.Id.toString()] = item.value ?? null;\r\n\r\n      return initialValues;\r\n    }, {}) ?? {};\r\n  return result;\r\n};\r\nexport const orderFields = (item: IFormFieldDto, next: IFormFieldDto) => {\r\n  return item.Index! - next.Index!;\r\n};\r\nexport const serializeValues = (\r\n  formFields: IFormFieldDto[],\r\n  value: Record<string, unknown>,\r\n) => {\r\n  const serialized: Record<number, string | null> = {};\r\n  let files: IFormFileValue[] = [];\r\n  formFields.forEach(field => {\r\n    if (field.Active) {\r\n      serialized[field.Id] = SerializeValue(\r\n        field,\r\n        value[field.Id] as CustomFormValueType,\r\n      );\r\n\r\n      if (field.Type === 'File') {\r\n        files = [...files, ...(value[field.Id] as IFormFileValue[])];\r\n      }\r\n    }\r\n  });\r\n  return { serialized, files };\r\n};\r\nexport const toFormValuesArray = (\r\n  serialized: Record<number, string | null>,\r\n  formValues: IFormValueDto[],\r\n  formFields: IFormFieldDto[],\r\n): IFormValueDto[] => {\r\n  const ffs = RecordToFormValuesArray(formFields, formValues, serialized);\r\n  const diff = differenceWith(\r\n    ffs,\r\n    formValues,\r\n    (a, b) => a.FormFieldId === b.FormFieldId && a.Value === b.Value,\r\n  ).filter(f => !(f.Value === null && f.Id === 0));\r\n  return diff;\r\n};\r\nfunction RecordToFormValuesArray(\r\n  formFields: IFormFieldDto[],\r\n  formValues: IFormValueDto[],\r\n  serialized: Record<number, string | null>,\r\n): IFormValueDto[] {\r\n  return formFields.map(formField => {\r\n    const result = formValues.find(\r\n      formValue => formValue.FormFieldId === formField.Id,\r\n    ) ?? {\r\n      Id: 0,\r\n      FormFieldId: formField.Id,\r\n      Value: null,\r\n      DisplayValue: null,\r\n      RequestId: null,\r\n      ReservationId: null,\r\n      ExperimentItemId: null,\r\n      SourceValueId: null,\r\n      Readonly: false,\r\n      BudgetExperimentId: null,\r\n      AlertId: null,\r\n      AlertTypeId: null,\r\n      ServiceGroupUserId: null,\r\n      ServiceGroupId: null,\r\n      CustomFormId: null,\r\n      CustomFormName: null,\r\n    };\r\n    return { ...result, ...{ Value: serialized[formField.Id.toString()] } };\r\n  });\r\n}\r\n\r\nexport function serializeCustomFormRowValue(\r\n  value: IServiceRequestTableRowValueModel,\r\n): Pick<IFormValueDto, 'Value' | 'DisplayValue'> {\r\n  if (value == null) {\r\n    return { Value: null, DisplayValue: null };\r\n  } else if (typeof value === 'string') {\r\n    return { Value: value, DisplayValue: null };\r\n  } else if (typeof value === 'number') {\r\n    return { Value: value.toString(), DisplayValue: null };\r\n  } else if (typeof value === 'boolean') {\r\n    return { Value: value.toString(), DisplayValue: null };\r\n  } else if (value instanceof Date) {\r\n    return {\r\n      Value:\r\n        dateUtils.tryFormatIso(value, {\r\n          format: 'basic',\r\n          representation: 'date',\r\n        }) ?? null,\r\n      DisplayValue: null,\r\n    };\r\n  } else {\r\n    return {\r\n      Value: value.Id,\r\n      DisplayValue: value.Name,\r\n    };\r\n  }\r\n}\r\n\r\nexport function getCustomFormRowDisplay(\r\n  value: IServiceRequestTableRowValueModel,\r\n) {\r\n  if (value == null) {\r\n    return '';\r\n  } else if (typeof value === 'string') {\r\n    return value;\r\n  } else if (typeof value === 'number') {\r\n    return value.toString();\r\n  } else if (typeof value === 'boolean') {\r\n    return value.toString();\r\n  } else if (value instanceof Date) {\r\n    return dateUtils.shortDateFormat(value);\r\n  } else {\r\n    return value.Name;\r\n  }\r\n}\r\n\r\nexport function getCustomFormColumnSchema(\r\n  props: Pick<\r\n    IServiceRequestTableColumnModel,\r\n    'Label' | 'ColumnType' | 'isRequired' | 'Options' | 'SizeLimit'\r\n  >,\r\n) {\r\n  const baseSchema = getCustomFormColumnBaseSchema(props).label(props.Label);\r\n  const result = props.isRequired ? baseSchema.required() : baseSchema;\r\n  return result;\r\n}\r\nfunction getCustomFormColumnBaseSchema(\r\n  props: Pick<\r\n    IServiceRequestTableColumnModel,\r\n    'Label' | 'ColumnType' | 'Options' | 'SizeLimit'\r\n  >,\r\n) {\r\n  switch (props.ColumnType) {\r\n    case 'CheckBox':\r\n      return Yup.boolean().label(props.Label);\r\n    case 'Date':\r\n      return Yup.date().label(props.Label);\r\n    case 'DropDownList':\r\n      //TODO: validate selected option is present in the column options\r\n      return Yup.mixed<IFormFieldOptionDto>().label(props.Label);\r\n    case 'UserSelection':\r\n      return Yup.mixed<Entity<string>>().label(props.Label);\r\n    case 'Email':\r\n      return Yup.string().label(props.Label).email();\r\n    case 'Number':\r\n      return Yup.number()\r\n        .label(props.Label)\r\n        .min(-props.SizeLimit)\r\n        .max(props.SizeLimit);\r\n    case 'PositiveDecimal':\r\n      return Yup.number().label(props.Label).min(0).max(props.SizeLimit);\r\n    case 'PositiveInteger':\r\n      return Yup.number()\r\n        .integer()\r\n        .label(props.Label)\r\n        .min(0)\r\n        .max(props.SizeLimit);\r\n    case 'ShortText':\r\n      return Yup.string();\r\n    case 'Serial':\r\n      return Yup.string();\r\n\r\n    default:\r\n      assertExhaustive(props.ColumnType);\r\n  }\r\n}\r\n","/**\r\n * Represents Date with representation info - e.g. representation: 'complete' | 'date' | 'time'\r\n */\r\nexport class CustomDate extends Date {\r\n  representation: DateType = 'date';\r\n  constructor(value?: number | string | Date, type?: DateType) {\r\n    super(value ?? new Date());\r\n    this.representation = type ?? 'complete';\r\n  }\r\n}\r\n\r\nexport type DateType = 'complete' | 'date' | 'time';\r\n","/**\r\n *\r\n * UserPicker\r\n *\r\n */\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n  Condition,\r\n  ODataOperators,\r\n  quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type UserUrl =\r\n  | 'restricted'\r\n  | 'full'\r\n  | 'admin'\r\n  | 'relevant'\r\n  | 'budgetExperiments';\r\nexport interface UserPickerProps\r\n  extends Omit<AutocompletePickerProps<IUserFilterDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  selectArray?: Array<keyof IUserFilterDto>;\r\n  urlType?: UserUrl;\r\n  withGroupFilter?: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\n\r\nconst noExpandURlTypes: (UserUrl | undefined)[] = ['relevant'];\r\n\r\nconst url = '/api/odata/v4/UserFilter';\r\nconst fullActiveUrl = '/api/odata/v4/UserFilter/GetUserSelections';\r\nconst adminsUrl = '/api/odata/v4/UserFilter/GetAdminUsers';\r\nexport const relevantUrl = '/api/odata/v4/UserFilter/GetRelevantUsers';\r\nconst budgetExperimentsUrl =\r\n  '/api/odata/v4/UserFilter/GetBudgetExperimentsUsers';\r\nexport const initUserData = (id: string, urlType?: UserUrl) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  let initUrl =\r\n    urlType === 'full'\r\n      ? fullActiveUrl\r\n      : urlType === 'admin'\r\n      ? adminsUrl\r\n      : urlType === 'budgetExperiments'\r\n      ? budgetExperimentsUrl\r\n      : url;\r\n  return httpClient\r\n    .get(initUrl, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\n\r\nexport function UserPicker(props: UserPickerProps) {\r\n  const { t } = useTranslation();\r\n  const servicegroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const serviceGroups = props.serviceGroups ?? servicegroups;\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  const loadData = React.useCallback(\r\n    getAutoCompleteLoadDataFn<IUserFilterDto>({\r\n      url:\r\n        props.urlType === 'full'\r\n          ? fullActiveUrl\r\n          : props.urlType === 'admin'\r\n          ? adminsUrl\r\n          : props.urlType === 'relevant'\r\n          ? relevantUrl\r\n          : props.urlType === 'budgetExperiments'\r\n          ? budgetExperimentsUrl\r\n          : url,\r\n      predicates: props.predicates,\r\n      globalServiceGroupFilter:\r\n        !props.withGroupFilter || !serviceGroups?.length\r\n          ? undefined\r\n          : [\r\n              new Condition<any>(\r\n                'ServiceGroups',\r\n                ODataOperators.AnyIn,\r\n                serviceGroups,\r\n                'Id',\r\n              ),\r\n            ],\r\n      select: props.selectArray ?? [\r\n        'Id',\r\n        'Name',\r\n        'UserGroupId',\r\n        'UserGroupName',\r\n        'UserGroups',\r\n        'Budgets',\r\n        'IsAdminPanel',\r\n        'IsEquipmentAdmin',\r\n        'IsGroupAdmin',\r\n        'IsLabTech',\r\n        'ServiceGroupIds',\r\n        'Services',\r\n        'CustomRoles',\r\n        'UserGroupId',\r\n        'UserGroupName',\r\n        'UserRoles',\r\n        'StaffEquipmentId',\r\n        'DefaultBudgetId',\r\n      ],\r\n      expand: noExpandURlTypes.includes(props.urlType)\r\n        ? ''\r\n        : 'Services,UserGroups',\r\n    }),\r\n    [serviceGroups, props.withGroupFilter],\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'userpickerId'}\r\n      placeholder={t(translations.AllUsers)}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function ServicesFilter(\r\n  services: IServiceTypeFilterDto[],\r\n  budgetExperimentEnabled: boolean,\r\n  userGroupId?: string,\r\n  budgetId?: number,\r\n  defaultBudgetEnabled?: boolean,\r\n  isDefaultSelected?: boolean,\r\n): (string | Condition<IUserFilterDto>)[] {\r\n  const predicates: (string | Condition<IUserFilterDto>)[] = [];\r\n  if (userGroupId !== undefined) {\r\n    predicates.push(\r\n      `(${new Condition<IUserFilterDto>(\r\n        'UserGroups',\r\n        ODataOperators.Any,\r\n        userGroupId,\r\n        'Id',\r\n      )} or ${new Condition<IUserFilterDto>(\r\n        'UserGroupId',\r\n        ODataOperators.Equals,\r\n        userGroupId,\r\n      )})`,\r\n    );\r\n  }\r\n  if (budgetId !== undefined && !isDefaultSelected) {\r\n    if (defaultBudgetEnabled) {\r\n      predicates.push(\r\n        `(${new Condition<IUserFilterDto>(\r\n          'Budgets',\r\n          ODataOperators.Any,\r\n          budgetId,\r\n        ).toString()} or ${new Condition<IUserFilterDto>(\r\n          'DefaultBudgetId',\r\n          ODataOperators.Equals,\r\n          budgetId,\r\n        ).toString()})`,\r\n      );\r\n    } else {\r\n      predicates.push(\r\n        new Condition<IUserFilterDto>('Budgets', ODataOperators.Any, budgetId),\r\n      );\r\n    }\r\n  }\r\n  if (\r\n    services.length > 0 &&\r\n    budgetExperimentEnabled &&\r\n    !services.some(f => f.HideProject)\r\n  ) {\r\n    //TODO: add filter by selected services\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\nexport function AdminServicesFilter(\r\n  serviceItems: IServiceFilterDto[],\r\n): (string | Condition<IUserFilterDto>)[] {\r\n  if (!serviceItems.length || serviceItems.length < 1) {\r\n    return [];\r\n  }\r\n  let groups = [...new Set(serviceItems.map(f => f.ServiceGroupId))];\r\n  let groupIds = groups.map(item => {\r\n    return { Id: item };\r\n  }) as Identifiable<number>[];\r\n  let services = serviceItems\r\n    .map(f => {\r\n      return {\r\n        ServiceId: f.Id ?? 0,\r\n        ServiceTypeId: f.ServiceTypeId ?? 0,\r\n      };\r\n    })\r\n    .filter(f => f.ServiceId !== 0 && f.ServiceTypeId !== 0);\r\n  let groupsF = `(${new Condition(\r\n    'ServiceGroupIds',\r\n    ODataOperators.AnyIn,\r\n    groupIds,\r\n  ).toString()})`;\r\n  // let groupsF = `(${groups\r\n  //   .map(a => new Condition('ServiceGroupIds', ODataOperators.AnyIn, groupIds).toString())\r\n  //   .join(' and ')})`;\r\n  let servF = `(Services/any(s: s/Id in ${quoteODataValue(\r\n    services.map(f => f.ServiceId),\r\n  )}))`;\r\n\r\n  return [`${groupsF} or ${servF}`];\r\n}\r\nexport const initAssigneeAdminUsers = (\r\n  type: IWorkOrderTypeDto,\r\n  serviceItems: IServiceFilterDto[],\r\n) => {\r\n  const predicates: (string | Condition<IUserFilterDto>)[] = [];\r\n  if (type.AssignedToCoreAdmin) {\r\n    predicates.push(\r\n      new Condition<IUserFilterDto>(\r\n        'IsGroupAdmin',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ),\r\n    );\r\n  }\r\n  if (type.AssignedToInstrumentAdmin) {\r\n    predicates.push(\r\n      new Condition<IUserFilterDto>(\r\n        'IsEquipmentAdmin',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ),\r\n    );\r\n  }\r\n  if (type.AssignedToLabTech) {\r\n    predicates.push(\r\n      new Condition<IUserFilterDto>('IsLabTech', ODataOperators.Equals, true),\r\n    );\r\n  }\r\n  if (serviceItems.length < 1 || predicates.length < 1) {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve([] as Entity<string>[]);\r\n    });\r\n  } else {\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: `${AdminServicesFilter(serviceItems)[0]} and (${predicates\r\n        .map(f => f.toString())\r\n        .join(' or ')})`,\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<string>[]);\r\n  }\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { useState, useMemo, useEffect, useRef } from 'react';\r\n\r\nexport type PromiseStatus = `pending` | `resolved` | `rejected`;\r\nexport type CancelPromise = (message?: string) => void;\r\nexport type ResetPromiseState<T> = (\r\n  keys?: keyof PromiseState<T> | Array<keyof PromiseState<T>>,\r\n) => void;\r\n\r\nexport interface PromiseState<T> {\r\n  status?: PromiseStatus;\r\n  promise?: Promise<T>;\r\n  value?: T;\r\n  error?: Error;\r\n  cancel?: CancelPromise;\r\n}\r\n\r\nexport type PromiseStateWithReset<T> = PromiseState<T> & {\r\n  reset: ResetPromiseState<T>;\r\n};\r\n\r\n/**\r\n * A hook which accepts an asynchronous function (i.e., a function which returns a promise).\r\n *\r\n * Returns a new asynchronous function wrapping the original to be called as necessary,\r\n * along with the state of the promise as `status`, `promise`, `value`, `error`, `cancel()`,\r\n * and a `reset()` method to reset the state.\r\n *\r\n * Pairs well with the {@link hooks.useAsyncExtendedState | `useAsyncExtendedState`} hook.\r\n *\r\n * Example:\r\n * ```ts\r\n * interface State {\r\n *   foo: string\r\n *   bar: string\r\n * }\r\n *\r\n * const [ state, setState, extendState ] = useAsyncExtendedState<State>({\r\n *   foo: 'foo',\r\n *   bar: 'bar'\r\n * })\r\n *\r\n * const read = (id: string) => API.client.get<Partial<State>>(`things/${id}`).then(response => {\r\n *   return response.data\r\n * })\r\n *\r\n * const [ readThingRequest, readThing ] = usePromise(read)\r\n *\r\n * const isPending = readThingRequest.status === 'pending'\r\n *\r\n * return (\r\n *   <>\r\n *     <div>\r\n *       foo: {state.foo}\r\n *     </div>\r\n *\r\n *     <div>\r\n *       bar: {state.bar}\r\n *     </div>\r\n *\r\n *     <UI.Button onClick={() => extendState(readThing('someId'))} disabled={isPending}>\r\n *       <span>\r\n *         {isPending\r\n *           ? 'Reading thing...'\r\n *           : 'Read thing'\r\n *         }\r\n *       </span>\r\n *     </UI.Button>\r\n *\r\n *     <UI.Error>\r\n *       {readThingRequest.error}\r\n *     </UI.Error>\r\n *   </>\r\n * )\r\n * ```\r\n */\r\nexport const usePromise = <T extends (...args: any[]) => any>(\r\n  asyncFunction: T,\r\n  initialState?: PromiseState<ReturnType<T>>,\r\n): [\r\n  PromiseStateWithReset<ReturnType<T>>,\r\n  (...asyncFuncArgs: Parameters<T>) => ReturnType<T>,\r\n] => {\r\n  const [state, setState] = useState<PromiseState<ReturnType<T>>>(\r\n    initialState || {},\r\n  );\r\n  const isCancelled = useRef(false);\r\n  const isUnmounted = useRef(false);\r\n\r\n  const callAsyncFunction = useMemo(\r\n    () => (...args: Parameters<T>): ReturnType<T> => {\r\n      const promise = asyncFunction(...args);\r\n      const cancel: CancelPromise = message => {\r\n        isCancelled.current = true;\r\n\r\n        if (!isUnmounted.current) {\r\n          setState(({ value }) => ({\r\n            status: `rejected`,\r\n            value,\r\n            error: message ? new Error(message) : undefined,\r\n          }));\r\n        }\r\n      };\r\n\r\n      isCancelled.current = false;\r\n\r\n      if (promise instanceof Promise) {\r\n        return new Promise(resolve => {\r\n          const fulfillPromise = async () => {\r\n            try {\r\n              const value: ReturnType<T> = await promise;\r\n\r\n              if (!isCancelled.current && !isUnmounted.current) {\r\n                setState({ status: `resolved`, value });\r\n                resolve(value);\r\n              }\r\n            } catch (error) {\r\n              if (!isCancelled.current && !isUnmounted.current) {\r\n                setState(({ value }) => ({\r\n                  status: `rejected`,\r\n                  value,\r\n                  error:\r\n                    error instanceof Error ? error : new Error(error as string),\r\n                }));\r\n              }\r\n            }\r\n          };\r\n\r\n          setState(({ value }) => ({\r\n            status: `pending`,\r\n            value,\r\n            promise,\r\n            cancel,\r\n          }));\r\n          fulfillPromise();\r\n        }) as ReturnType<T>;\r\n      } else {\r\n        setState({ status: `resolved`, value: promise });\r\n        return promise;\r\n      }\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [asyncFunction],\r\n  );\r\n\r\n  const reset: ResetPromiseState<T> = useMemo(\r\n    () => keys =>\r\n      setState(state => {\r\n        if (!keys) {\r\n          return {};\r\n        }\r\n\r\n        const nextState = { ...state };\r\n\r\n        if (Array.isArray(keys)) {\r\n          for (const key of keys) {\r\n            delete nextState[key];\r\n          }\r\n        } else {\r\n          delete nextState[keys];\r\n        }\r\n\r\n        return nextState;\r\n      }),\r\n    [],\r\n  );\r\n\r\n  const stateWithReset: PromiseStateWithReset<ReturnType<T>> = useMemo(\r\n    () => ({ ...state, reset }),\r\n    [state, reset],\r\n  );\r\n\r\n  useEffect(() => {\r\n    return () => {\r\n      isCancelled.current = true;\r\n      isUnmounted.current = true;\r\n    };\r\n  }, []);\r\n\r\n  return [stateWithReset, callAsyncFunction];\r\n};\r\n","import {\r\n  getPeriodTypesEntity,\r\n  PeriodTypes,\r\n  PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { IPresetDatesRange } from './IPresetDatesRange';\r\nimport { DatesRange } from './DatesRange';\r\nimport { translations } from 'locales/translations';\r\nimport { TFunction } from 'i18next';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport class PresetDatesRange extends DatesRange implements IPresetDatesRange {\r\n  constructor(t?: IPresetDatesRange) {\r\n    super(t as IPresetDatesRange);\r\n    this.type = (t as IPresetDatesRange)?.type ?? {\r\n      Id: 'CustomDate',\r\n      Name: `${translations.CustomDate}`,\r\n      type: 'CustomDate',\r\n    };\r\n  }\r\n  type: PeriodTypesEntity = {\r\n    Id: 'CustomDate',\r\n    Name: `${translations.CustomDate}`,\r\n  };\r\n\r\n  GetPresetDatesRangeDisplayString(t: TFunction): string {\r\n    switch (this.type?.Id) {\r\n      default:\r\n        return t(this.type.Id);\r\n      case 'CustomDate':\r\n        return `${\r\n          this.start === null\r\n            ? t(translations.NA)\r\n            : dateUtils.shortDateTimeFormat(this.start)\r\n        } - ${\r\n          this.end === null\r\n            ? t(translations.NA)\r\n            : dateUtils.shortDateTimeFormat(this.end)\r\n        }`;\r\n    }\r\n  }\r\n  static fromPreset(t: PeriodTypesEntity) {\r\n    return new PresetDatesRange({\r\n      type: t,\r\n      ...DatesRange.fromPreset(t, null, null),\r\n    });\r\n  }\r\n  static fromInitPreset(\r\n    t: PeriodTypesEntity,\r\n    start: Date | null,\r\n    end: Date | null,\r\n  ) {\r\n    return new PresetDatesRange({\r\n      type: t,\r\n      ...DatesRange.fromPreset(t, start, end),\r\n    });\r\n  }\r\n  static fromType(t: PeriodTypes, st: Date | null, et: Date | null) {\r\n    const x = getPeriodTypesEntity(t);\r\n    const y = DatesRange.fromPreset(x as PeriodTypesEntity, st, et);\r\n    const z: IPresetDatesRange = {\r\n      type: x,\r\n      start: y.start,\r\n      end: y.end,\r\n    };\r\n    return new PresetDatesRange(z);\r\n  }\r\n\r\n  static Custom(\r\n    start: Date | undefined | null,\r\n    end: Date | undefined | null,\r\n  ): PresetDatesRange | undefined {\r\n    return new PresetDatesRange({\r\n      type: getPeriodTypesEntity('CustomDate'),\r\n      start: start ?? null,\r\n      end: end ?? null,\r\n    });\r\n  }\r\n}\r\n","import {\r\n  call,\r\n  put,\r\n  select,\r\n  debounce,\r\n  takeLeading,\r\n  takeLatest,\r\n  takeEvery,\r\n} from 'redux-saga/effects';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { requestSamplesActions as actions } from '.';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  InsertServiceRequestMilestoneChargeAction,\r\n  ILoadServiceRequestMilestonesAction,\r\n  IRequestMilestoneManualChargeModel,\r\n  ISample,\r\n  IServiceRequestPatchAction,\r\n  IServiceRequestUpdateBudgetAction,\r\n  IServiceRequestUpdateStatusAction,\r\n  UpdateServiceRequestMilestoneChargeAction,\r\n  ServiceRequestMilestoneInsertModel,\r\n  UpdateServiceRequestRowValueAction,\r\n  IServiceRequestTableRowModel,\r\n  IRequestDetailsModel,\r\n  IServiceRequestUpdatePurchaseOrderAction,\r\n  IServiceRequestUpdateFundingTypeAction,\r\n  IServiceRequestUpdateExternalInternalNumberAction,\r\n  IServiceRequestUpdateGradientAction,\r\n  IServiceRequestUpdateOverheadAction,\r\n  ILoadServiceRequestRowsAction,\r\n} from './types';\r\nimport { TableState } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { TableFilterBuilder } from 'app/components/BasicTable/TableFilterBuilder';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  selectRequestDetailsData,\r\n  selectSamplesTableState,\r\n  selectServiceRequestCustomFormColumns,\r\n  selectServiceRequestCustomFormFields,\r\n  selectServiceRequestId,\r\n} from './selectors';\r\nimport { AxiosError, AxiosResponse } from 'axios';\r\nimport fileDownload from 'js-file-download';\r\nimport { deleteSamples, IDeleteSamplesResult } from 'api/SamplesApi';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { Entity } from 'types/common';\r\nimport { takeLatestByKey } from 'utils/redux-saga';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalSettingBool,\r\n  selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { IConsumableServiceDto } from 'api/odata/generated/entities/IConsumableServiceDto';\r\nimport {\r\n  ServiceRequestMilestoneStatuses,\r\n  ServiceRequestMilestoneStatusesUnion,\r\n} from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport {\r\n  IOpenSidePanelPayload,\r\n  layoutActions,\r\n} from 'app/Layout/FrontendLayout/slice';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { selectSidePanelState } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelState,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { push } from 'connected-react-router';\r\nimport { GetServiceRequestDetailsPath } from './path';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { getLogger } from 'loglevel';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\nimport {\r\n  prepareServiceRequestRowModel,\r\n  serviceRequestModelToDto,\r\n} from './prepareServiceRequestRowModel';\r\nimport { omit } from 'lodash';\r\nimport { getCustomFormInitialValues } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\n\r\nconst log = getLogger('ServiceRequestDetails');\r\n\r\nfunction* doInit(action: PayloadAction) {\r\n  try {\r\n    const statuses: IODataQueryResponse<IServiceRequestStatusDto> = yield call(\r\n      httpClient.get,\r\n      '/api/odata/v4/ServiceRequestStatusFilter',\r\n    );\r\n    yield put(actions.initServiceRequestStatuses_Success(statuses.value));\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n  yield* doLoadServiceRequestRowStatuses();\r\n}\r\nfunction* doLoadRequestDetails(action: PayloadAction<number>) {\r\n  try {\r\n    const SampleManagementTablesEnabled = yield select(state =>\r\n      selectKnownModule(state, KnownModules.SampleManagementTables),\r\n    );\r\n    const requestDetails: IServiceRequestDto = yield call(\r\n      httpClient.get,\r\n      `api/odata/v4/ServiceRequests/${action.payload}`,\r\n      {\r\n        $expand: [\r\n          'Status',\r\n          'Service($expand=ServiceGroup,CustomForm)',\r\n          'CreatedBy($select=Id,Name)',\r\n          'CreatedFor($expand=UserGroup)',\r\n          'UpdatedBy($select=Id,Name)',\r\n          'SubmittedBy($select=Id,Name)',\r\n          'UserGroup($select=Id,Name)',\r\n          'Budget($select=Id,Name,FundingTypeId,PurchaseOrderOptionId)',\r\n          'UnitType($select=Id,Name)',\r\n          'Gradient($select=Id,Name,ServiceGroupId,EstimatedRuntimeMinutes)',\r\n        ].join(','),\r\n      },\r\n    );\r\n    yield put(\r\n      actions.loadRequestDetails_Success(\r\n        omit(requestDetails, 'Rows', 'FormValues'),\r\n      ),\r\n    );\r\n\r\n    if (\r\n      requestDetails.Service.CustomForm.FormFields.some(\r\n        f => f.Active && f.IsColumn === false,\r\n      )\r\n    ) {\r\n      yield put(actions.loadFormValues(action.payload));\r\n    }\r\n\r\n    if (\r\n      requestDetails.Service.CustomForm.FormFields.some(\r\n        f => f.Active && f.IsColumn === true,\r\n      ) ||\r\n      SampleManagementTablesEnabled\r\n    ) {\r\n      yield* doLoadServiceRequestRows({\r\n        type: action.type,\r\n        payload: {\r\n          serviceRequestId: requestDetails.Id,\r\n          state: {\r\n            pageIndex: 0,\r\n            pageSize: 10,\r\n          },\r\n        },\r\n      });\r\n    }\r\n\r\n    // trigger loading the milestones if the request milestones are enabled both in the global settings and on the service settings\r\n    const requestMilestones: boolean = yield select(state =>\r\n      selectGlobalSettingBool(state, AllowedSettings.RequestMilestones),\r\n    );\r\n    if (requestDetails.Service.MilestonesAddonsType !== 'NA') {\r\n      if (requestMilestones === true) {\r\n        yield put(actions.loadMilestones({ Id: action.payload }));\r\n      }\r\n    }\r\n    if (requestDetails.InvoiceId !== null) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'warning',\r\n          message: i18next.t(translations.requestblockedbyinvoice),\r\n        }),\r\n      );\r\n    }\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(\r\n      actions.loadRequestDetails_Error({\r\n        response: {\r\n          status: (error as AxiosError)?.response?.status,\r\n        },\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doRefreshRequestDetails(action: PayloadAction<number>) {\r\n  try {\r\n    const requestDetails = yield call(\r\n      httpClient.get,\r\n      `api/odata/v4/ServiceRequests/${action.payload}`,\r\n      {\r\n        $expand: [\r\n          'Status',\r\n          'Service($expand=ServiceGroup,CustomForm)',\r\n          'CreatedBy($select=Id,Name)',\r\n          'CreatedFor($expand=UserGroup)',\r\n          'UpdatedBy($select=Id,Name)',\r\n          'SubmittedBy($select=Id,Name)',\r\n          'UserGroup($select=Id,Name)',\r\n          'Budget($select=Id,Name,FundingTypeId,PurchaseOrderOptionId)',\r\n          'UnitType($select=Id,Name)',\r\n          'Gradient($select=Id,Name,ServiceGroupId,EstimatedRuntimeMinutes)',\r\n        ].join(','),\r\n      },\r\n    );\r\n    yield put(actions.refreshRequestDetails_Success(requestDetails));\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n}\r\nfunction* doLoadFormValues(action: PayloadAction<number>) {\r\n  const url = `api/odata/v4/ServiceRequests(${action.payload})/FormValues`;\r\n  const data: IODataQueryResponse<IFormValueDto> = yield call(\r\n    httpClient.get,\r\n    url,\r\n  );\r\n\r\n  const formFields = yield select(selectServiceRequestCustomFormFields);\r\n  const valuesObject = getCustomFormInitialValues(formFields, data.value);\r\n  if (valuesObject !== undefined) {\r\n    yield put(actions.loadFormValues_Success(valuesObject));\r\n  }\r\n}\r\nfunction* doSaveFormValue(\r\n  action: PayloadAction<\r\n    Pick<IFormValueDto, 'RequestId' | 'FormFieldId' | 'DisplayValue'> &\r\n      Pick<IFormFieldDto, 'Type'> & { Value: any }\r\n  >,\r\n) {\r\n  if (action.payload.RequestId === null) {\r\n    log.warn('doSaveFormValue: requestId is empty');\r\n  }\r\n  try {\r\n    if (action.payload.Type === 'File' && action.payload.Value?.length === 0) {\r\n      action.payload.Value = null;\r\n    }\r\n    if (action.payload.Type === 'File' && action.payload.Value !== null) {\r\n      const formData = new FormData();\r\n      formData.append(\r\n        'file',\r\n        action.payload.Value[0].PostedFile,\r\n        action.payload.Value[0].DisplayName,\r\n      );\r\n      yield call(\r\n        httpClient.post,\r\n        `/api/requests/${action.payload.RequestId}/formvalues/${action.payload.FormFieldId}/file`,\r\n        formData,\r\n        {\r\n          headers: {\r\n            'Content-Type': 'multipart/form-data',\r\n            Accept: 'application/json',\r\n          },\r\n        },\r\n      );\r\n    } else {\r\n      const url = `/api/odata/v4/ServiceRequests(${action.payload.RequestId})/FormValues`;\r\n      const payload = action.payload;\r\n      yield call(httpClient.post, url, omit(payload, 'Type'));\r\n    }\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n}\r\nfunction* doLoadSamples(\r\n  action: PayloadAction<\r\n    Partial<\r\n      Partial<\r\n        TableState<IRow> & {\r\n          customFilters: IFilterSettings<IRow>[];\r\n          searchColumns: string[];\r\n        }\r\n      >\r\n    >\r\n  >,\r\n) {\r\n  // todo: switch to odata v4: const url = `/api/odata/v4/ServiceRequests(${id})`;\r\n\r\n  const serviceRequestId = yield select(selectServiceRequestId);\r\n  const url = '/api/odata/v4/samples';\r\n\r\n  const currentTableState = yield select(selectSamplesTableState);\r\n  const filters = [\r\n    '(not SourceRunIds/any())',\r\n    new Condition<ISample>(\r\n      'ServiceRequestId',\r\n      ODataOperators.Equals,\r\n      serviceRequestId,\r\n    ),\r\n  ];\r\n  const params = {\r\n    $count: true,\r\n    $top: currentTableState.pageSize,\r\n    $skip:\r\n      (currentTableState.pageIndex ?? 1) * (currentTableState.pageSize ?? 5),\r\n    $orderby:\r\n      currentTableState.sortBy\r\n        ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n        .join(',') || undefined,\r\n\r\n    $filter: TableFilterBuilder(\r\n      currentTableState.customFilters,\r\n      currentTableState.globalFilter,\r\n      undefined,\r\n      currentTableState.searchColumns,\r\n      filters,\r\n    ),\r\n  };\r\n  try {\r\n    const data = yield call(httpClient.get, url, params);\r\n    yield put(actions.loadSamples_Success(data));\r\n  } catch (error) {\r\n    yield put(\r\n      actions.loadSamples_Error(i18next.t(translations.AnErrorOccurred)),\r\n    );\r\n    const forbidden = (error as AxiosError)?.response?.status === 403;\r\n    if (forbidden) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.Forbidden),\r\n        }),\r\n      );\r\n    }\r\n  }\r\n}\r\nfunction* doLoadServiceRequestRows(action: ILoadServiceRequestRowsAction) {\r\n  const url = `api/odata/v4/ServiceRequests(${action.payload.serviceRequestId})/Rows`;\r\n  const data: IODataQueryResponse<IServiceRequestRowDto> = yield call(\r\n    httpClient.get,\r\n    url,\r\n    //TODO: bring back server side paging?\r\n    //params,\r\n  );\r\n  const columns = yield select(selectServiceRequestCustomFormColumns);\r\n  const model = prepareServiceRequestRowModel(data.value, columns);\r\n  yield put(actions.loadServiceRequestRows_Success(model ?? []));\r\n}\r\nfunction* doLoadMilestones(action: ILoadServiceRequestMilestonesAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Milestones`;\r\n  const params = {\r\n    $expand: [\r\n      'Assignees($select=Id,Name)',\r\n      `ServiceRequestMilestoneCharges($expand=${[\r\n        'Service($select=Id,Name,Rate;$expand=UnitType($select=Id,Name))',\r\n        'UpdatedBy($select=Id,Name)',\r\n        'UnitType($select=Id,Name)',\r\n      ].join(',')})`,\r\n    ].join(','),\r\n  };\r\n  const data: IODataQueryResponse<IServiceRequestMilestoneDto> = yield call(\r\n    httpClient.get,\r\n    url,\r\n    params,\r\n  );\r\n  yield put(actions.loadMilestones_Success(data.value));\r\n}\r\nfunction* doCreateSample(action: PayloadAction<ISample>) {\r\n  try {\r\n    const url = `/api/odata/v4/samples`;\r\n    const response = yield call(httpClient.post, url, action.payload);\r\n    yield put(actions.createSample_Success(response));\r\n  } catch (error) {\r\n    log.error('doCreateSample', error);\r\n    yield put(actions.createSample_Error());\r\n    const forbidden = (error as AxiosError)?.response?.status === 403;\r\n    if (forbidden) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.Forbidden),\r\n        }),\r\n      );\r\n    }\r\n  }\r\n}\r\nfunction* doUpdateServiceRequestSampleField(\r\n  action: PayloadAction<Partial<ISample>>,\r\n) {\r\n  const url = `/api/odata/v4/samples(${action.payload.Id})`;\r\n  const payload: Omit<Partial<ISample>, 'Id'> = action.payload;\r\n  try {\r\n    yield call(httpClient.patch, url, payload);\r\n    yield put(actions.updateServiceRequestSampleField_Success());\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateServiceRequestSampleField_Error());\r\n    const forbidden = (error as AxiosError)?.response?.status === 403;\r\n    if (forbidden) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.Forbidden),\r\n        }),\r\n      );\r\n      return;\r\n    }\r\n    const msg = (error as AxiosError)?.response?.data?.error?.innererror\r\n      ?.message;\r\n    if (msg !== undefined) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'SamplesListPage.saga.updateField',\r\n          variant: 'error',\r\n          message: msg,\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.updateServiceRequestSampleField_Error());\r\n  }\r\n}\r\n\r\nfunction* doUpdateServiceRequestRowValue(\r\n  action: UpdateServiceRequestRowValueAction,\r\n) {\r\n  // TODO: migrate value updates to the new api\r\n  // const url = `/api/odata/v4/ServiceRequests(${action.payload.serviceRequestId})/Rows(${action.payload.serviceRequestValue.RowId})/Values`;\r\n  const url = `/api/requests/${action.payload.serviceRequestId}/tabledata/${action.payload.serviceRequestValue.RowId}/${action.payload.serviceRequestValue.ColumnId}`;\r\n  const payload =\r\n    action.payload.serviceRequestValue.DisplayValue === null\r\n      ? action.payload.serviceRequestValue.Value\r\n      : {\r\n          id: action.payload.serviceRequestValue.Value,\r\n          text: action.payload.serviceRequestValue.DisplayValue,\r\n        };\r\n\r\n  try {\r\n    yield call(httpClient.post, url, JSON.stringify(payload), {\r\n      headers: { 'Content-Type': 'application/json' },\r\n    });\r\n    yield put(actions.updateServiceRequestRowValue_Success());\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateServiceRequestRowValue_Error());\r\n    const forbidden = (error as AxiosError)?.response?.status === 403;\r\n    if (forbidden) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.Forbidden),\r\n        }),\r\n      );\r\n      return;\r\n    }\r\n    const msg = (error as AxiosError)?.response?.data?.error?.innererror\r\n      ?.message;\r\n    if (msg !== undefined) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'SamplesListPage.saga.updateField',\r\n          variant: 'error',\r\n          message: msg,\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.updateServiceRequestSampleField_Error());\r\n  }\r\n}\r\n\r\nfunction* doImport(action: PayloadAction<any>) {\r\n  const file = action.payload.file;\r\n  const serviceRequestId = action.payload.serviceRequestId;\r\n  const url = `/api/SamplesImport/import?serviceRequestId=${serviceRequestId}`;\r\n  try {\r\n    const response = yield call(httpClient.uploadFile, url, file);\r\n    const allRowsImportedSuccessfully = response.data?.size === 0;\r\n    if (allRowsImportedSuccessfully) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'success',\r\n          message: i18next.t(translations.AllRowsImportedSuccessfully),\r\n        }),\r\n      );\r\n    } else {\r\n      yield call(fileDownload, response.data, 'import-result.xlsx');\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'warning',\r\n          message: i18next.t(\r\n            translations.OneOrMoreErrorOccurredDuringImportPleaseReviewOutputFile,\r\n          ),\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.import_Success());\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.import_Error());\r\n    const forbidden = (error as AxiosError)?.response?.status === 403;\r\n    if (forbidden) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.Forbidden),\r\n        }),\r\n      );\r\n      return;\r\n    }\r\n  }\r\n}\r\n\r\nfunction* doDeleteSamples(action: PayloadAction<ISample[]>) {\r\n  let r: IDeleteSamplesResult = yield call(deleteSamples, action.payload);\r\n\r\n  for (const error of r.errors) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: error.message,\r\n      }),\r\n    );\r\n  }\r\n  if (r.successCount > 0) {\r\n    // reload table data\r\n    const tableState = yield select(selectSamplesTableState);\r\n    yield put(actions.loadSamples(tableState));\r\n\r\n    // post success notification of deleted records\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.XRecordsWereBeDeleted, {\r\n          x: r.successCount,\r\n        }),\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doPatchRequestDetails(action: IServiceRequestPatchAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response = yield call(httpClient.patch, url, payload);\r\n    yield put(actions.patch_Success({ ...response, ...action.payload }));\r\n    //yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.patch_Error(action.payload));\r\n    const axiosError = error as AxiosError;\r\n    const reason =\r\n      axiosError?.response?.data?.error?.innererror?.message ??\r\n      axiosError?.response?.data?.error?.message ??\r\n      axiosError?.response?.data?.statusText ??\r\n      i18next.t(translations.NA);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: reason,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doUpdateStatus(action: IServiceRequestUpdateStatusAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Status`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response = yield call(httpClient.post, url, {\r\n      ...payload.Status,\r\n      ...{ Reason: action.payload.Reason },\r\n    });\r\n    yield put(\r\n      actions.updateStatus_Success({\r\n        ...response,\r\n        // old API returns Status in old format, override it here with IServiceRequestStatusDto\r\n        Status: action.payload.Status,\r\n      }),\r\n    );\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.StatusUpdatedTo, action.payload.Status),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateStatus_Error(action.payload));\r\n    const axiosError = error as AxiosError;\r\n    const reason =\r\n      axiosError?.response?.data?.error?.innererror?.message ??\r\n      axiosError?.response?.data?.error?.message ??\r\n      axiosError?.response?.data?.statusText ??\r\n      i18next.t(translations.NA);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: i18next.t(translations.ServiceRequestStatusUpdate_Error, {\r\n          reason: reason,\r\n        }),\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doUpdateServiceRequestRowStatus(\r\n  action: PayloadAction<{\r\n    serviceRequestId: number;\r\n    serviceRequestRowId: number;\r\n    status: IServiceRequestRowStatusDto | null;\r\n  }>,\r\n) {\r\n  try {\r\n    yield call(\r\n      httpClient.post,\r\n      `api/requests/${action.payload.serviceRequestId}/tabledata/rows/${action.payload.serviceRequestRowId}/Status`,\r\n      JSON.stringify(action.payload.status?.Id),\r\n      {\r\n        headers: { 'Content-Type': 'application/json' },\r\n      },\r\n    );\r\n    yield put(actions.updateServiceRequestRowStatus_Success(action.payload));\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n}\r\n\r\nfunction* doUpdateBudget(action: IServiceRequestUpdateBudgetAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Budget`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response: IServiceRequestDto = yield call(\r\n      httpClient.post,\r\n      url,\r\n      payload.Budget,\r\n    );\r\n    yield put(actions.updateBudget_Success(response));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.BudgetUpdatedTo, {\r\n          Name: action.payload.Budget.Name,\r\n        }),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateBudget_Error(action.payload));\r\n  }\r\n}\r\nfunction* doUpdateGradient(action: IServiceRequestUpdateGradientAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Gradient`;\r\n  const payload = action.payload;\r\n  try {\r\n    yield call(httpClient.post, url, payload.Gradient);\r\n    yield put(actions.updateGradient_Success(action.payload));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.GradientUpdatedTo, {\r\n          Name: action.payload.Gradient?.Name,\r\n        }),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    //yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateGradient_Error(action.payload));\r\n  }\r\n}\r\nfunction* doUpdateOverheadMinutes(action: IServiceRequestUpdateOverheadAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/OverheadMinutes`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response: IServiceRequestDto = yield call(\r\n      httpClient.post,\r\n      url,\r\n      payload.OverheadMinutes,\r\n    );\r\n    yield put(actions.updateOverheadMinutes_Success(response));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.OverheadTimeUpdatedTo, {\r\n          Name: action.payload.OverheadMinutes,\r\n        }),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateOverheadMinutes_Error(action.payload));\r\n  }\r\n}\r\nfunction* doUpdatePurchaseOrder(\r\n  action: IServiceRequestUpdatePurchaseOrderAction,\r\n) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/PurchaseOrder`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response: IServiceRequestDto = yield call(\r\n      httpClient.post,\r\n      url,\r\n      payload.PurchaseOrder,\r\n    );\r\n    yield put(actions.updatePurchaseOrder_Success(response));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.PurchaseOrderUpdatedTo, {\r\n          Name: action.payload.PurchaseOrder,\r\n        }),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updatePurchaseOrder_Error(action.payload));\r\n  }\r\n}\r\n\r\nfunction* doUpdateExternalInternalNumber(\r\n  action: IServiceRequestUpdateExternalInternalNumberAction,\r\n) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/ExternalInternalNumber`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response: IServiceRequestDto = yield call(\r\n      httpClient.post,\r\n      url,\r\n      payload.ExternalInternalNumber,\r\n    );\r\n    yield put(actions.updateExternalInternalNumber_Success(response));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.ExternalInternalNumberUpdatedTo, {\r\n          Name: action.payload.ExternalInternalNumber,\r\n        }),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateExternalInternalNumber_Error(action.payload));\r\n  }\r\n}\r\n\r\nfunction* doUpdateFundingType(action: IServiceRequestUpdateFundingTypeAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/FundingType`;\r\n  const payload = action.payload;\r\n  try {\r\n    const response: IServiceRequestDto = yield call(\r\n      httpClient.post,\r\n      url,\r\n      payload.FundingTypeId,\r\n    );\r\n    yield put(actions.updateFundingType_Success(response));\r\n    if (action.payload.FundingTypeId !== null) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          message: i18next.t(translations.FundingTypeUpdatedTo, {\r\n            Name: getSingleInvoiceFundingType(action.payload.FundingTypeId)\r\n              .Name,\r\n          }),\r\n          variant: 'success',\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    console.debug(payload);\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateFundingType_Error(action.payload));\r\n  }\r\n}\r\nfunction* doSubmit(action: PayloadAction<IRequestDetailsModel>) {\r\n  const url = `api/ServiceRequests/${action.payload.Id}/SubmitStep`;\r\n  try {\r\n    yield call(httpClient.post, url);\r\n    yield put(actions.submitStep_success(action.payload));\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.StepHasBeenSubmitted),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    log.error(error);\r\n    const errorMessages = getErrorMessages(error);\r\n    yield* putErrorMessages(errorMessages);\r\n    yield put(actions.submitStep_Error());\r\n  }\r\n}\r\n\r\nfunction* putErrorMessages(errorMessages: Array<string> | undefined) {\r\n  if (errorMessages !== undefined) {\r\n    for (const message of errorMessages) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: message,\r\n        }),\r\n      );\r\n    }\r\n  }\r\n}\r\n\r\nfunction getErrorMessages(error: unknown): Array<string> | undefined {\r\n  const axiosError = error as AxiosError;\r\n  const isAxiosError = axiosError.isAxiosError;\r\n  if (isAxiosError) {\r\n    const dataErrorMessages = axiosError.response?.data?.ErrorMessages;\r\n    if (\r\n      Array.isArray(dataErrorMessages) &&\r\n      dataErrorMessages.length > 0 &&\r\n      typeof dataErrorMessages[0] === 'string'\r\n    ) {\r\n      return dataErrorMessages as Array<string>;\r\n    }\r\n  }\r\n}\r\n\r\nfunction* doCancelServiceRequest(action: IServiceRequestUpdateStatusAction) {\r\n  const url = `/api/odata/v4/ServiceRequests(${action.payload.Id})/Status`;\r\n  const payload = action.payload;\r\n  try {\r\n    yield call(httpClient.post, url, {\r\n      ...payload.Status,\r\n      ...{ Reason: action.payload.Reason },\r\n    });\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.RequestCancelled),\r\n      }),\r\n    );\r\n    yield put(actions.refreshRequestDetails(action.payload.Id));\r\n  } catch (error) {\r\n    log.error(error);\r\n    //yield put(actions.updateStatus_Error(action.payload));\r\n    const axiosError = error as AxiosError;\r\n    const reason =\r\n      axiosError?.response?.data?.error?.innererror?.message ??\r\n      axiosError?.response?.data?.error?.message ??\r\n      axiosError?.response?.data?.statusText ??\r\n      i18next.t(translations.NA);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: i18next.t(translations.ServiceRequestStatusUpdate_Error, {\r\n          reason: reason,\r\n        }),\r\n      }),\r\n    );\r\n  }\r\n}\r\n\r\nfunction* doInsertMilestoneCharge(\r\n  action: InsertServiceRequestMilestoneChargeAction,\r\n) {\r\n  const serviceRequest: IServiceRequestDto = yield select(\r\n    selectRequestDetailsData,\r\n  );\r\n  if (serviceRequest === undefined) {\r\n    return;\r\n  }\r\n  try {\r\n    const url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestone/${action.payload.ServiceRequestMilestoneId}/ServiceRequestMilestoneCharge`;\r\n\r\n    const result: IRequestMilestoneManualChargeModel = yield call(\r\n      httpClient.post,\r\n      url,\r\n      action.payload,\r\n    );\r\n\r\n    const charge: IServiceRequestMilestoneChargeDto = {\r\n      Date: result.Date,\r\n      Id: result.Id,\r\n      Amount:\r\n        (result.Rate ?? action.payload.OfflineServiceType?.Rate ?? 0) *\r\n        (result.Quantity ?? 0),\r\n      InvoiceId: null,\r\n      Name: result.Name,\r\n      //OfflineServiceTypeId: result.OfflineServiceType?.Id,\r\n      Quantity: result.Quantity,\r\n      OfflineServiceTypeId: result.OfflineServiceType?.Id ?? null,\r\n      Rate: result.Rate,\r\n      Remarks: result.Remarks,\r\n      ServiceRequestMilestoneId: action.payload.ServiceRequestMilestoneId,\r\n      Service:\r\n        (action.payload.OfflineServiceType as IConsumableServiceDto) ?? null,\r\n      UnitTypeId: null,\r\n\r\n      UpdatedBy:\r\n        result.UpdatedBy === null\r\n          ? null\r\n          : {\r\n              Id: result.UpdatedBy?.Id,\r\n              Name: result.UpdatedBy?.Title,\r\n            },\r\n      UnitType:\r\n        (result.Unit as Entity<number>) ??\r\n        action.payload.OfflineServiceType?.UnitType ??\r\n        null,\r\n    };\r\n    yield put(actions.insertMilestoneCharge_Success(charge));\r\n    yield put(actions.closeSidePanel());\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.InsertSuccess),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.insertMilestoneCharge_Error());\r\n  }\r\n}\r\nfunction* doDeleteServiceRequestMilestoneCharge(\r\n  action: PayloadAction<IServiceRequestMilestoneChargeDto>,\r\n) {\r\n  const serviceRequest: IServiceRequestDto = yield select(\r\n    selectRequestDetailsData,\r\n  );\r\n  if (serviceRequest === undefined) {\r\n    return;\r\n  }\r\n  try {\r\n    const url = `api/requests/${serviceRequest.Id}/ServiceRequestMilestone/${action.payload.ServiceRequestMilestoneId}/ServiceRequestMilestoneCharge/${action.payload.Id}`;\r\n    yield call(httpClient.delete, url);\r\n    yield put(actions.deleteMilestoneCharge_Success(action.payload));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.DeleteSuccess),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n}\r\nfunction* doUpdateMilestoneCharge(\r\n  action: UpdateServiceRequestMilestoneChargeAction,\r\n) {\r\n  const serviceRequest: IServiceRequestDto = yield select(\r\n    selectRequestDetailsData,\r\n  );\r\n  if (serviceRequest === undefined) {\r\n    return;\r\n  }\r\n  try {\r\n    const url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestone/${action.payload.ServiceRequestMilestoneId}/ServiceRequestMilestoneCharge`;\r\n    const authenticatedUser: IAuthenticatedUser = yield select(\r\n      selectAuthenticatedUser,\r\n    );\r\n\r\n    const result: IRequestMilestoneManualChargeModel = yield call(\r\n      httpClient.put,\r\n      url,\r\n      action.payload,\r\n    );\r\n\r\n    const charge: IServiceRequestMilestoneChargeDto = {\r\n      Date: result.Date,\r\n      Id: result.Id,\r\n      Amount:\r\n        (result.Rate ?? action.payload.OfflineServiceType?.Rate ?? 0) *\r\n        (result.Quantity ?? 0),\r\n      InvoiceId: null,\r\n      Name: result.Name,\r\n      //OfflineServiceTypeId: result.OfflineServiceType?.Id,\r\n      Quantity: result.Quantity,\r\n      OfflineServiceTypeId: result.OfflineServiceType?.Id ?? null,\r\n      Rate: result.Rate,\r\n      Remarks: result.Remarks,\r\n      ServiceRequestMilestoneId: action.payload.ServiceRequestMilestoneId,\r\n      Service: result.OfflineServiceType as IConsumableServiceDto,\r\n      UnitTypeId: action.payload.Unit?.Id ?? null,\r\n      UpdatedBy:\r\n        action.payload.UpdatedBy === null\r\n          ? null\r\n          : action.payload.UpdatedBy === undefined\r\n          ? null\r\n          : {\r\n              Id: action.payload.UpdatedBy.Id,\r\n              Name: action.payload.UpdatedBy.Title,\r\n            } ?? authenticatedUser,\r\n      UnitType:\r\n        (result.Unit as Entity<number>) ??\r\n        action.payload.OfflineServiceType?.UnitType ??\r\n        null,\r\n    };\r\n    yield put(actions.closeSidePanel());\r\n    yield put(actions.updateMilestoneCharge_Success(charge));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.UpdateSuccess),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(actions.updateMilestoneCharge_Error());\r\n  }\r\n}\r\nfunction* doInsertMilestone(\r\n  action: PayloadAction<IServiceRequestMilestoneDto>,\r\n) {\r\n  try {\r\n    var url = `api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestones`;\r\n    var data: Partial<ServiceRequestMilestoneInsertModel> = {\r\n      Name: action.payload.Name,\r\n      CompletionDate: action.payload.CompletionDate,\r\n      Assignees: action.payload.Assignees?.map(function (u) {\r\n        return u.Id;\r\n      }).join(','),\r\n    };\r\n    const response = yield call(httpClient.post, url, data);\r\n\r\n    const p: IServiceRequestMilestoneDto = {\r\n      Assignees: action.payload.Assignees,\r\n      Charged: false,\r\n      Id: response.Id,\r\n      ServiceRequestMilestoneCharges: [],\r\n      CompletionDate: response.CompletionDate,\r\n      Name: response.Name,\r\n      Description: response.Description,\r\n      InvoiceId: null,\r\n      ServiceRequestId: action.payload.ServiceRequestId,\r\n      Status: action.payload.Status,\r\n      TargetDate: response.TargetDate,\r\n    };\r\n    yield put(actions.insertMilestone_Success(p));\r\n    yield put(actions.closeSidePanel());\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'foo',\r\n        variant: 'success',\r\n        message: i18next.t(translations.InsertSuccess),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    log.error(error);\r\n    const msg = (error as AxiosError)?.message;\r\n    if (msg !== undefined) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          key: 'foo',\r\n          message: msg,\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.insertMilestone_Error());\r\n  }\r\n}\r\nfunction* doDeleteMilestone(\r\n  action: PayloadAction<IServiceRequestMilestoneDto>,\r\n) {\r\n  try {\r\n    var url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestones/${action.payload.Id}`;\r\n    yield call(httpClient.delete, url);\r\n    yield put(actions.deleteMilestone_Success(action.payload));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.DeleteSuccess),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    //todo\r\n    log.error(error);\r\n  }\r\n}\r\nfunction* doUpdateMilestone(\r\n  action: PayloadAction<IServiceRequestMilestoneDto>,\r\n) {\r\n  try {\r\n    var url = `/api/requests/${action.payload.ServiceRequestId}/ServiceRequestMilestones/${action.payload.Id}`;\r\n    const requestPayload: ServiceRequestMilestoneInsertModel = {\r\n      Assignees: action.payload.Assignees?.map(f => f.Id).join(','),\r\n\r\n      Id: action.payload.Id,\r\n\r\n      CompletionDate: action.payload.CompletionDate,\r\n      Name: action.payload.Name,\r\n      Description: action.payload.Description,\r\n      ServiceRequestId: action.payload.ServiceRequestId,\r\n      StatusId:\r\n        ServiceRequestMilestoneStatuses[action.payload.Status ?? 'NotStarted'],\r\n      TargetDate: action.payload.TargetDate,\r\n    };\r\n    const response: ServiceRequestMilestoneInsertModel = yield call(\r\n      httpClient.put,\r\n      url,\r\n      requestPayload,\r\n    );\r\n    yield put(\r\n      actions.updateMilestone_Success({\r\n        ...action.payload,\r\n        ...{\r\n          Status:\r\n            (response.StatusId === null\r\n              ? undefined\r\n              : (ServiceRequestMilestoneStatuses[\r\n                  response.StatusId\r\n                ] as ServiceRequestMilestoneStatusesUnion)) ?? 'NotStarted',\r\n          CompletionDate: response.CompletionDate,\r\n        },\r\n      }),\r\n    );\r\n    yield put(actions.closeSidePanel());\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.UpdateSuccess),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    //todo\r\n    log.error(error);\r\n  }\r\n}\r\nfunction* doOpenSidePanel(action: PayloadAction<IOpenSidePanelPayload>) {\r\n  const sidePanelState: SidePanelState = yield select(selectSidePanelState);\r\n  const isSidePanelOpen =\r\n    sidePanelState.sidePanelOpen &&\r\n    sidePanelState.pageType === RenderPageType.ServiceRequestDetails;\r\n  if (!isSidePanelOpen) {\r\n    yield put(\r\n      layoutActions.openSidePanel({\r\n        type: action.payload.type,\r\n        props: Object.assign({}, action.payload.props, {\r\n          useSidePanel: true,\r\n        }),\r\n        expanded: action.payload.expanded,\r\n      }),\r\n    );\r\n  } else {\r\n    yield put(\r\n      actions.setCover({\r\n        type: action.payload.type,\r\n        props: Object.assign({}, action.payload.props, {\r\n          isCover: true,\r\n          useSidePanel: true,\r\n        }),\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doCloseSidePanel(action: PayloadAction) {\r\n  const sidePanelState: SidePanelState = yield select(selectSidePanelState);\r\n  const isSidePanelOpen =\r\n    sidePanelState.sidePanelOpen &&\r\n    sidePanelState.pageType === RenderPageType.ServiceRequestDetails;\r\n  if (isSidePanelOpen) {\r\n    yield put(actions.setCover(undefined));\r\n  } else {\r\n    yield put(layoutActions.resetSidePanel());\r\n    yield put(actions.resetRequestDetails);\r\n  }\r\n}\r\nfunction* doCloneServiceRequest(action: PayloadAction<number>) {\r\n  try {\r\n    const url = `api/ServiceRequests/${action.payload}/CopyStep`;\r\n    const response: { NewRequestId: number } = yield call(httpClient.post, url);\r\n    yield put(push(GetServiceRequestDetailsPath(response.NewRequestId)));\r\n  } catch (error) {\r\n    log.error(error);\r\n    const axiosError = error as AxiosError;\r\n    const messages = getv2ControllerErrorMessages(axiosError?.response);\r\n    if (messages !== undefined && messages.length > 0) {\r\n      appSettingsActions.addNotifications(\r\n        messages.map(message => ({\r\n          variant: 'error',\r\n          message: message,\r\n        })),\r\n      );\r\n    }\r\n  }\r\n}\r\n\r\nfunction* doCreateServiceRequestRow(\r\n  action: PayloadAction<Partial<IServiceRequestTableRowModel>>,\r\n) {\r\n  const messageKey = 'doCreateServiceRequestRow';\r\n  try {\r\n    if (action.payload.ServiceRequestId === undefined) {\r\n      log.error(\r\n        'doCreateServiceRequestRow - ServiceRequestId is required',\r\n        action.payload,\r\n      );\r\n      return;\r\n    }\r\n    const url = `api/odata/v4/ServiceRequests(${action.payload.ServiceRequestId})/Rows`;\r\n    const columns = yield select(selectServiceRequestCustomFormColumns);\r\n    const dto = serviceRequestModelToDto(action.payload, columns);\r\n    const response: IServiceRequestRowDto = yield call(\r\n      httpClient.post,\r\n      url,\r\n      dto,\r\n    );\r\n    yield put(\r\n      actions.createServiceRequestRow_Success(\r\n        prepareServiceRequestRowModel([response], columns),\r\n      ),\r\n    );\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        key: messageKey,\r\n        message: i18next.t(\r\n          translations.ServiceRequestRow_InsertSuccess,\r\n          response,\r\n        ),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    log.error(error);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        key: messageKey,\r\n        message: i18next.t(translations.ServiceRequestRow_InsertError),\r\n      }),\r\n    );\r\n  }\r\n}\r\n\r\nconst getv2ControllerErrorMessages = (\r\n  response?: AxiosResponse<any>,\r\n): string[] | undefined => {\r\n  if (response === undefined) {\r\n    return undefined;\r\n  }\r\n  const message: string[] = [];\r\n\r\n  if (typeof response.data == 'string') {\r\n    message.push(response.data);\r\n  } else if (response.data.ExceptionMessage !== undefined) {\r\n    message.push(response.data.ExceptionMessage);\r\n  } else if (response.data.Message !== undefined) {\r\n    message.push(response.data.Message);\r\n  } else if (response.data.message !== undefined) {\r\n    message.push(response.data.message);\r\n  } else if (response.data.ErrorMessages) {\r\n    for (var i = 0; i < response.data.ErrorMessages.length; i++) {\r\n      message.push(response.data.ErrorMessages[i] as string);\r\n    }\r\n  }\r\n\r\n  return message;\r\n};\r\n\r\nfunction* doLoadServiceRequestRowStatuses() {\r\n  try {\r\n    const SampleManagementTablesEnabled = yield select(state =>\r\n      selectKnownModule(state, KnownModules.SampleManagementTables),\r\n    );\r\n    if (SampleManagementTablesEnabled) {\r\n      const data: IODataQueryResponse<IServiceRequestRowStatusDto> = yield call(\r\n        httpClient.get,\r\n        '/api/odata/v4/ServiceRequestRowStatuses',\r\n      );\r\n      yield put(actions.loadServiceRequestRowStatuses_Success(data.value));\r\n    }\r\n  } catch (error) {\r\n    log.error('Error loading service request row statuses');\r\n  }\r\n}\r\n\r\nexport function* requestSamplesSaga() {\r\n  yield takeLeading(actions.init.type, doInit);\r\n  yield takeLatest(actions.loadRequestDetails.type, doLoadRequestDetails);\r\n  yield takeLatest(actions.refreshRequestDetails.type, doRefreshRequestDetails);\r\n  yield takeLatest(actions.loadFormValues.type, doLoadFormValues);\r\n  yield takeLatest(actions.loadMilestones.type, doLoadMilestones);\r\n  yield takeLatest(actions.insertMilestoneCharge.type, doInsertMilestoneCharge);\r\n  yield takeLatest(actions.updateMilestoneCharge.type, doUpdateMilestoneCharge);\r\n  yield takeLatest(\r\n    actions.deleteMilestoneCharge.type,\r\n    doDeleteServiceRequestMilestoneCharge,\r\n  );\r\n  yield takeLatest(actions.openSidePanel.type, doOpenSidePanel);\r\n  yield takeLatest(actions.closeSidePanel.type, doCloseSidePanel);\r\n\r\n  yield takeLatest(actions.insertMilestone.type, doInsertMilestone);\r\n  yield takeLatest(actions.updateMilestone.type, doUpdateMilestone);\r\n  yield takeLatest(actions.deleteMilestone.type, doDeleteMilestone);\r\n\r\n  yield takeLatest(actions.loadSamples.type, doLoadSamples);\r\n  yield takeLatest(actions.patch.type, doPatchRequestDetails);\r\n  yield takeLatest(actions.updateStatus.type, doUpdateStatus);\r\n  yield takeLatest(\r\n    actions.updateServiceRequestRowStatus.type,\r\n    doUpdateServiceRequestRowStatus,\r\n  );\r\n  yield takeLatest(actions.updateBudget.type, doUpdateBudget);\r\n  yield takeLatest(actions.updatePurchaseOrder.type, doUpdatePurchaseOrder);\r\n  yield takeLatest(\r\n    actions.updateExternalInternalNumber.type,\r\n    doUpdateExternalInternalNumber,\r\n  );\r\n  yield takeLatest(actions.updateFundingType.type, doUpdateFundingType);\r\n  yield takeLatest(actions.updateGradient.type, doUpdateGradient);\r\n  yield takeLatest(actions.updateOverheadMinutes.type, doUpdateOverheadMinutes);\r\n  yield takeLatest(actions.submitStep.type, doSubmit);\r\n  yield takeLatest(actions.cancelServiceRequest.type, doCancelServiceRequest);\r\n  yield takeLatest(actions.createSample.type, doCreateSample);\r\n  yield debounce(\r\n    100,\r\n    actions.updateServiceRequestSampleField.type,\r\n    doUpdateServiceRequestSampleField,\r\n  );\r\n  yield debounce(\r\n    100,\r\n    actions.updateServiceRequestRowValue.type,\r\n    doUpdateServiceRequestRowValue,\r\n  );\r\n  yield takeLatest(actions.import.type, doImport);\r\n  yield takeLatest(actions.import_Success.type, doLoadSamples);\r\n  yield takeLeading(actions.deleteSamples.type, doDeleteSamples);\r\n  yield takeLeading(actions.cloneServiceRequest, doCloneServiceRequest);\r\n\r\n  yield takeEvery(\r\n    actions.createServiceRequestRow.type,\r\n    doCreateServiceRequestRow,\r\n  );\r\n\r\n  yield takeLatest(\r\n    actions.loadServiceRequestRows.type,\r\n    doLoadServiceRequestRows,\r\n  );\r\n\r\n  yield takeLatestByKey<IFormValueDto>(\r\n    actions.saveFormValues.type,\r\n    f => f?.FormFieldId,\r\n    doSaveFormValue,\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { requestSamplesSaga } from './saga';\r\nimport {\r\n  ISample,\r\n  ISampleListTableState,\r\n  IRequestSamplesState,\r\n  IServiceRequestPatchAction,\r\n  IServiceRequestUpdateStatusAction,\r\n  IServiceRequestUpdateBudgetAction,\r\n  ILoadServiceRequestMilestonesAction,\r\n  ILoadServiceRequestMilestonesSuccessAction,\r\n  InsertServiceRequestMilestoneChargeAction,\r\n  UpdateServiceRequestMilestoneChargeAction,\r\n  UpdateServiceRequestRowValueAction,\r\n  IServiceRequestTableRowModel,\r\n  IRequestDetailsModel,\r\n  IServiceRequestDetailsFormModel,\r\n  IServiceRequestUpdatePurchaseOrderAction,\r\n  IServiceRequestUpdateFundingTypeAction,\r\n  IServiceRequestUpdateExternalInternalNumberAction,\r\n  IServiceRequestUpdateGradientAction,\r\n  IServiceRequestUpdateOverheadAction,\r\n  ILoadServiceRequestRowsAction,\r\n} from './types';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { merge, remove } from 'lodash';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { IOpenSidePanelPayload } from 'app/Layout/FrontendLayout/slice';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\n\r\nexport const initialState: IRequestSamplesState = {\r\n  RequestSamples: {},\r\n  ServiceRequestStatuses: {},\r\n  ServiceRequestRows: {},\r\n  fieldsState: {},\r\n  SamplesTableState: {\r\n    pageSize: 10,\r\n    pageIndex: 0,\r\n    sortBy: [{ id: 'Id', desc: true }],\r\n    customFilters: [],\r\n    globalFilter: '',\r\n  },\r\n  SamplesSelected: [],\r\n  RequestDetails: {},\r\n  ImportState: {\r\n    open: false,\r\n    processing: false,\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'requestSamples',\r\n  initialState,\r\n  reducers: {\r\n    init(state, action: PayloadAction) {},\r\n    initServiceRequestStatuses_Success(\r\n      state,\r\n      action: PayloadAction<Array<IServiceRequestStatusDto>>,\r\n    ) {\r\n      state.ServiceRequestStatuses = {\r\n        status: 'resolved',\r\n        value: action.payload,\r\n      };\r\n    },\r\n    initServiceRequestStatuses_Error(state, action: PayloadAction) {\r\n      state.ServiceRequestStatuses = {\r\n        status: 'rejected',\r\n      };\r\n    },\r\n    loadServiceRequestRowStatuses_Success(\r\n      state,\r\n      action: PayloadAction<Array<IServiceRequestRowStatusDto>>,\r\n    ) {\r\n      state.ServiceRequestRowStatuses = action.payload;\r\n    },\r\n    loadRequestDetails(state, action: PayloadAction<number>) {\r\n      state.RequestDetails = { status: 'pending' };\r\n      state.serviceRequestId = action.payload;\r\n    },\r\n    loadRequestDetails_Success(\r\n      state,\r\n      action: PayloadAction<IRequestDetailsModel>,\r\n    ) {\r\n      state.RequestDetails = {\r\n        status: 'resolved',\r\n        value: action.payload,\r\n      };\r\n    },\r\n    loadRequestDetails_Error(state, action: PayloadAction<unknown>) {\r\n      state.RequestDetails = {\r\n        status: 'rejected',\r\n        error: action.payload,\r\n      };\r\n    },\r\n    resetRequestDetails(state, action: PayloadAction) {\r\n      state.RequestSamples = {};\r\n      state.ServiceRequestStatuses = {};\r\n      state.ServiceRequestRows = {};\r\n      state.fieldsState = {};\r\n      state.SamplesTableState = {\r\n        pageSize: 10,\r\n        pageIndex: 0,\r\n        sortBy: [{ id: 'Id', desc: true }],\r\n        customFilters: [],\r\n        globalFilter: '',\r\n      };\r\n      state.SamplesSelected = [];\r\n      state.RequestDetails = {};\r\n      state.ImportState = {\r\n        open: false,\r\n        processing: false,\r\n      };\r\n      state.ServiceRequestRowStatuses = [];\r\n      state.serviceRequestId = undefined;\r\n      state.SidePanel = undefined;\r\n      state.createServiceRequestRowStatus = undefined;\r\n      state.milestoneProcessing = undefined;\r\n      state.milestoneChargeProcessing = undefined;\r\n      state.submitting = undefined;\r\n    },\r\n    refreshRequestDetails(state, action: PayloadAction<number>) {\r\n      state.RequestDetails.status = 'pending';\r\n    },\r\n    refreshRequestDetails_Success(\r\n      state,\r\n      action: PayloadAction<IRequestDetailsModel>,\r\n    ) {\r\n      if (state.RequestDetails.value !== undefined) {\r\n        state.RequestDetails.value = {\r\n          ...state.RequestDetails.value,\r\n          ...action.payload,\r\n        };\r\n      }\r\n      state.RequestDetails.status = 'resolved';\r\n    },\r\n\r\n    loadFormValues(state, action: PayloadAction<number>) {},\r\n    loadFormValues_Success(\r\n      state,\r\n      action: PayloadAction<Record<string, unknown>>,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      state.RequestDetails.value.FormValues = action.payload;\r\n    },\r\n\r\n    updateStatus(state, action: IServiceRequestUpdateStatusAction) {\r\n      state.fieldsState.Status = { status: 'pending' };\r\n    },\r\n    updateStatus_Success(\r\n      state,\r\n      action: PayloadAction<Partial<IServiceRequestDto>>,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      merge(state.RequestDetails.value, action.payload);\r\n      if (state.fieldsState.Status !== undefined) {\r\n        state.fieldsState.Status.status = 'resolved';\r\n      }\r\n    },\r\n    updateStatus_Error(state, action: IServiceRequestUpdateStatusAction) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      state.RequestDetails.value.Status = {\r\n        ...state.RequestDetails.value.Status,\r\n      };\r\n      delete state.fieldsState.Status;\r\n    },\r\n\r\n    updateBudget(state, action: IServiceRequestUpdateBudgetAction) {\r\n      state.fieldsState.Budget = { status: 'pending' };\r\n    },\r\n    updateBudget_Success(state, action: IServiceRequestUpdateBudgetAction) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n      delete state.fieldsState.Budget;\r\n    },\r\n    updateBudget_Error(state, action: IServiceRequestUpdateBudgetAction) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      state.RequestDetails.value.Budget = {\r\n        ...state.RequestDetails.value.Budget,\r\n      };\r\n      delete state.fieldsState.Budget;\r\n    },\r\n    updateGradient(state, action: IServiceRequestUpdateGradientAction) {\r\n      state.fieldsState.Gradient = { status: 'pending' };\r\n    },\r\n    updateGradient_Success(state, action: IServiceRequestUpdateGradientAction) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n      delete state.fieldsState.Gradient;\r\n    },\r\n    updateGradient_Error(state, action: IServiceRequestUpdateGradientAction) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      if (state.RequestDetails.value.Gradient !== null) {\r\n        state.RequestDetails.value.Gradient = {\r\n          ...state.RequestDetails.value.Gradient,\r\n        };\r\n      }\r\n\r\n      delete state.fieldsState.Gradient;\r\n    },\r\n    updateOverheadMinutes(state, action: IServiceRequestUpdateOverheadAction) {\r\n      state.fieldsState.OverheadMinutes = { status: 'pending' };\r\n    },\r\n    updateOverheadMinutes_Success(\r\n      state,\r\n      action: IServiceRequestUpdateOverheadAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n      delete state.fieldsState.OverheadMinutes;\r\n    },\r\n    updateOverheadMinutes_Error(\r\n      state,\r\n      action: IServiceRequestUpdateOverheadAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      delete state.fieldsState.OverheadMinutes;\r\n    },\r\n    updatePurchaseOrder(\r\n      state,\r\n      action: IServiceRequestUpdatePurchaseOrderAction,\r\n    ) {\r\n      state.fieldsState.PurchaseOrder = { status: 'pending' };\r\n    },\r\n    updatePurchaseOrder_Success(\r\n      state,\r\n      action: IServiceRequestUpdatePurchaseOrderAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n      delete state.fieldsState.PurchaseOrder;\r\n    },\r\n    updatePurchaseOrder_Error(\r\n      state,\r\n      action: IServiceRequestUpdatePurchaseOrderAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      delete state.fieldsState.PurchaseOrder;\r\n    },\r\n    updateFundingType(state, action: IServiceRequestUpdateFundingTypeAction) {\r\n      state.fieldsState.FundingTypeId = { status: 'pending' };\r\n    },\r\n    updateFundingType_Success(\r\n      state,\r\n      action: IServiceRequestUpdateFundingTypeAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n      delete state.fieldsState.FundingTypeId;\r\n    },\r\n    updateFundingType_Error(\r\n      state,\r\n      action: IServiceRequestUpdateFundingTypeAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      // state.RequestDetails.value.FundingTypeId = {\r\n      //   ...state.RequestDetails.value.FundingTypeId,\r\n      // };\r\n      delete state.fieldsState.FundingTypeId;\r\n    },\r\n    updateExternalInternalNumber(\r\n      state,\r\n      action: IServiceRequestUpdateExternalInternalNumberAction,\r\n    ) {\r\n      state.fieldsState.ExternalInternalNumber = { status: 'pending' };\r\n    },\r\n    updateExternalInternalNumber_Success(\r\n      state,\r\n      action: IServiceRequestUpdateExternalInternalNumberAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n      delete state.fieldsState.ExternalInternalNumber;\r\n    },\r\n    updateExternalInternalNumber_Error(\r\n      state,\r\n      action: IServiceRequestUpdateExternalInternalNumberAction,\r\n    ) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      delete state.fieldsState.ExternalInternalNumber;\r\n    },\r\n    submitStep(state, action: PayloadAction<IServiceRequestDetailsFormModel>) {\r\n      state.submitting = true;\r\n    },\r\n    submitStep_success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestDetailsFormModel>,\r\n    ) {\r\n      state.submitting = false;\r\n      if (state.RequestDetails.value !== undefined) {\r\n        Object.assign(state.RequestDetails.value, action.payload);\r\n      }\r\n    },\r\n    submitStep_Error(state, action: PayloadAction) {\r\n      state.submitting = false;\r\n    },\r\n    cancelServiceRequest(state, action: IServiceRequestUpdateStatusAction) {},\r\n\r\n    patch(state, action: IServiceRequestPatchAction) {\r\n      // update state to processing of each field being updated\r\n      const fields = (Object.keys(action.payload) as Array<\r\n        keyof typeof action.payload\r\n      >)\r\n        .filter(f => f !== 'Id')\r\n        .reduce((prev, current) => {\r\n          prev[current] = { processing: true };\r\n          return prev;\r\n        }, {});\r\n      Object.assign(state.fieldsState, fields);\r\n    },\r\n    patch_Success(state, action: IServiceRequestPatchAction) {\r\n      if (state.RequestDetails.value === undefined) {\r\n        return;\r\n      }\r\n      // release fields that were being processes\r\n      Object.keys(action.payload).forEach(f => delete state.fieldsState[f]);\r\n      //merge(state.RequestDetails.value, action.payload);\r\n      Object.assign(state.RequestDetails.value, action.payload);\r\n    },\r\n    patch_Error(state, action: IServiceRequestPatchAction) {\r\n      // release fields that were being processes\r\n      Object.keys(action.payload).forEach(f => delete state.fieldsState[f]);\r\n    },\r\n\r\n    saveFormValues(\r\n      state,\r\n      action: PayloadAction<\r\n        Pick<IFormValueDto, 'RequestId' | 'FormFieldId' | 'DisplayValue'> &\r\n          Pick<IFormFieldDto, 'Type'> & { Value: any }\r\n      >,\r\n    ) {},\r\n\r\n    loadSamples(state, action: PayloadAction<ISampleListTableState>) {\r\n      state.RequestSamples.status = 'pending';\r\n      state.SamplesTableState = {\r\n        pageSize: action.payload.pageSize,\r\n        pageIndex: action.payload.pageIndex,\r\n        sortBy: action.payload.sortBy,\r\n        globalFilter: action.payload.globalFilter,\r\n        searchColumns: action.payload.searchColumns,\r\n        customFilters: action.payload.customFilters?.map(filter => ({\r\n          fieldName: filter.fieldName,\r\n          operator: filter.operator,\r\n          value: filter.value,\r\n        })),\r\n      };\r\n    },\r\n    loadSamples_Success(state, action: PayloadAction<any>) {\r\n      state.RequestSamples = {\r\n        status: 'resolved',\r\n        value: {\r\n          data: action.payload.value as ISample[],\r\n          dataLength: action.payload['@odata.count'],\r\n        },\r\n      };\r\n    },\r\n    loadSamples_Error(state, action: PayloadAction<string>) {\r\n      state.RequestSamples.status = 'rejected';\r\n      state.RequestSamples.error = action.payload;\r\n    },\r\n\r\n    loadServiceRequestRows(state, action: ILoadServiceRequestRowsAction) {\r\n      state.ServiceRequestRows.status = 'pending';\r\n    },\r\n    loadServiceRequestRows_Success(\r\n      state,\r\n      action: PayloadAction<Array<IServiceRequestTableRowModel>>,\r\n    ) {\r\n      state.ServiceRequestRows = {\r\n        value: action.payload,\r\n\r\n        status: 'resolved',\r\n      };\r\n\r\n      Object.assign(state.RequestDetails.value, { Rows: action.payload });\r\n    },\r\n    loadServiceRequestRows_Error(state, error: PayloadAction) {\r\n      state.ServiceRequestRows = { error: true };\r\n    },\r\n\r\n    deleteServiceRequestRows(\r\n      state,\r\n      action: PayloadAction<Array<IServiceRequestRowDto>>,\r\n    ) {},\r\n    deleteServiceRequestRows_Success(\r\n      state,\r\n      action: PayloadAction<Array<IServiceRequestTableRowModel>>,\r\n    ) {\r\n      const id = action.payload.map(item => item.Id);\r\n      state.ServiceRequestRows.value = state.ServiceRequestRows.value?.filter(\r\n        item => !id.includes(item.Id),\r\n      );\r\n    },\r\n\r\n    createServiceRequestRow(\r\n      state,\r\n      action: PayloadAction<Partial<IServiceRequestTableRowModel>>,\r\n    ) {\r\n      //state.RequestServiceRequestRows.processing = true;\r\n      state.createServiceRequestRowStatus = 'pending';\r\n    },\r\n    createServiceRequestRow_Success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestTableRowModel[]>,\r\n    ) {\r\n      state.ServiceRequestRows.value?.push(...action.payload);\r\n      state.createServiceRequestRowStatus = 'resolved';\r\n    },\r\n    createServiceRequestRow_Error(state, action: PayloadAction) {\r\n      state.createServiceRequestRowStatus = 'rejected';\r\n    },\r\n\r\n    loadMilestones(state, action: ILoadServiceRequestMilestonesAction) {},\r\n    loadMilestones_Success(\r\n      state,\r\n      action: ILoadServiceRequestMilestonesSuccessAction,\r\n    ) {\r\n      if (state.RequestDetails.value !== undefined) {\r\n        state.RequestDetails.value.Milestones = action.payload;\r\n      }\r\n    },\r\n\r\n    insertMilestone(\r\n      state,\r\n      action: PayloadAction<Partial<IServiceRequestMilestoneDto>>,\r\n    ) {\r\n      state.milestoneProcessing = true;\r\n    },\r\n    insertMilestone_Success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneDto>,\r\n    ) {\r\n      const serviceRequest = state.RequestDetails.value;\r\n      if (serviceRequest !== undefined) {\r\n        serviceRequest.Milestones.push(action.payload);\r\n      }\r\n      state.milestoneProcessing = false;\r\n    },\r\n    insertMilestone_Error(state, action: PayloadAction) {\r\n      state.milestoneProcessing = false;\r\n    },\r\n    updateMilestone(\r\n      state,\r\n      action: PayloadAction<Partial<Partial<IServiceRequestMilestoneDto>>>,\r\n    ) {\r\n      state.milestoneProcessing = true;\r\n    },\r\n    updateMilestone_Success(\r\n      state,\r\n      action: PayloadAction<\r\n        Partial<IServiceRequestMilestoneDto> & Pick<IServiceRequestDto, 'Id'>\r\n      >,\r\n    ) {\r\n      const serviceRequest = state.RequestDetails.value;\r\n      if (serviceRequest !== undefined) {\r\n        const milestone = serviceRequest.Milestones.find(\r\n          f => f.Id === action.payload.Id,\r\n        );\r\n        if (milestone !== undefined) {\r\n          Object.assign(milestone, action.payload);\r\n        }\r\n      }\r\n      state.milestoneProcessing = false;\r\n    },\r\n    updateMilestone_Error(state, action: PayloadAction) {\r\n      state.milestoneProcessing = false;\r\n    },\r\n    deleteMilestone(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneDto>,\r\n    ) {},\r\n    deleteMilestone_Success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneDto>,\r\n    ) {\r\n      const serviceRequest = state.RequestDetails.value;\r\n      if (serviceRequest !== undefined) {\r\n        remove(serviceRequest.Milestones, f => f.Id === action.payload.Id);\r\n      }\r\n    },\r\n\r\n    insertMilestoneCharge(\r\n      state,\r\n      action: InsertServiceRequestMilestoneChargeAction,\r\n    ) {\r\n      state.milestoneChargeProcessing = true;\r\n    },\r\n    insertMilestoneCharge_Success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneChargeDto>,\r\n    ) {\r\n      if (state.RequestDetails.value !== undefined) {\r\n        const milestone = state.RequestDetails.value.Milestones.find(\r\n          f => f.Id === action.payload.ServiceRequestMilestoneId,\r\n        );\r\n        if (milestone !== undefined) {\r\n          milestone.ServiceRequestMilestoneCharges.push(action.payload);\r\n        }\r\n      }\r\n      state.milestoneChargeProcessing = false;\r\n    },\r\n    insertMilestoneCharge_Error(state, action: PayloadAction) {\r\n      state.milestoneChargeProcessing = false;\r\n    },\r\n    openSidePanel(state, action: PayloadAction<IOpenSidePanelPayload>) {},\r\n    closeSidePanel(state, action: PayloadAction) {},\r\n    setCover(state, action: PayloadAction<IOpenSidePanelPayload | undefined>) {\r\n      state.SidePanel = action.payload;\r\n    },\r\n    updateMilestoneCharge(\r\n      state,\r\n      action: UpdateServiceRequestMilestoneChargeAction,\r\n    ) {\r\n      state.milestoneChargeProcessing = true;\r\n    },\r\n    updateMilestoneCharge_Success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneChargeDto>,\r\n    ) {\r\n      if (state.RequestDetails.value !== undefined) {\r\n        const milestone = state.RequestDetails.value.Milestones.find(\r\n          f => f.Id === action.payload.ServiceRequestMilestoneId,\r\n        );\r\n        if (milestone !== undefined) {\r\n          const charge = milestone.ServiceRequestMilestoneCharges.find(\r\n            f => f.Id === action.payload.Id,\r\n          );\r\n          if (charge !== undefined) {\r\n            Object.assign(charge, action.payload);\r\n          }\r\n        }\r\n      }\r\n      state.milestoneChargeProcessing = false;\r\n    },\r\n    updateMilestoneCharge_Error(state, action: PayloadAction) {\r\n      state.milestoneChargeProcessing = false;\r\n    },\r\n    deleteMilestoneCharge(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneChargeDto>,\r\n    ) {},\r\n    deleteMilestoneCharge_Success(\r\n      state,\r\n      action: PayloadAction<IServiceRequestMilestoneChargeDto>,\r\n    ) {\r\n      if (state.RequestDetails.value !== undefined) {\r\n        const milestone = state.RequestDetails.value.Milestones.find(\r\n          f => f.Id === action.payload.ServiceRequestMilestoneId,\r\n        );\r\n        if (milestone !== undefined) {\r\n          remove(\r\n            milestone.ServiceRequestMilestoneCharges,\r\n            f => f.Id === action.payload.Id,\r\n          );\r\n        }\r\n      }\r\n    },\r\n    setSelected(state, action: PayloadAction<ISample[]>) {\r\n      state.SamplesSelected = action.payload;\r\n    },\r\n\r\n    createSample(state, action: PayloadAction<ISample>) {\r\n      state.RequestSamples = { status: 'pending' };\r\n    },\r\n    createSample_Success(state, action: PayloadAction<ISample>) {\r\n      state.RequestSamples.value?.data?.push(action.payload);\r\n      state.RequestSamples.status = 'resolved';\r\n      if (state.RequestSamples.value !== undefined) {\r\n        state.RequestSamples.value.dataLength =\r\n          (state.RequestSamples.value.dataLength ?? 0) + 1;\r\n      }\r\n    },\r\n    createSample_Error(state, action: PayloadAction) {\r\n      state.RequestSamples.status = 'rejected';\r\n    },\r\n\r\n    updateServiceRequestSampleField(\r\n      state,\r\n      action: PayloadAction<Partial<ISample>>,\r\n    ) {\r\n      // update row in samples list\r\n      const item = state.RequestSamples?.value?.data?.find(\r\n        s => s.Id === action.payload.Id,\r\n      );\r\n      if (item !== undefined) {\r\n        Object.assign(item, action.payload);\r\n      }\r\n    },\r\n    updateServiceRequestSampleField_Success(state, action: PayloadAction) {},\r\n    updateServiceRequestSampleField_Error(state, action: PayloadAction) {},\r\n\r\n    updateServiceRequestRowValue(\r\n      state,\r\n      action: UpdateServiceRequestRowValueAction,\r\n    ) {},\r\n    updateServiceRequestRowValue_Success(state, action: PayloadAction) {\r\n      // TODO: update internal state\r\n    },\r\n    updateServiceRequestRowValue_Error(state, action: PayloadAction) {\r\n      // TODO: ??\r\n    },\r\n\r\n    updateServiceRequestRowStatus(\r\n      state,\r\n      action: PayloadAction<{\r\n        serviceRequestId: number;\r\n        serviceRequestRowId: number;\r\n        status: IServiceRequestRowStatusDto | null;\r\n      }>,\r\n    ) {},\r\n    updateServiceRequestRowStatus_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        serviceRequestId: number;\r\n        serviceRequestRowId: number;\r\n        status: IServiceRequestRowStatusDto | null;\r\n      }>,\r\n    ) {\r\n      if (action.payload.status !== null) {\r\n        const row = state.ServiceRequestRows.value?.find(\r\n          f => f.Id === action.payload.serviceRequestRowId,\r\n        );\r\n        if (row !== undefined) {\r\n          row.Status = action.payload.status;\r\n          row.StatusId = action.payload.status?.Id;\r\n        }\r\n      }\r\n    },\r\n\r\n    toggleImport(state, action: PayloadAction<boolean>) {\r\n      state.ImportState.open = action.payload;\r\n    },\r\n\r\n    import(state, action: PayloadAction<any>) {\r\n      state.ImportState.processing = true;\r\n    },\r\n    import_Success(state, action: PayloadAction) {\r\n      state.ImportState.processing = false;\r\n      state.ImportState.open = false;\r\n    },\r\n    import_Error(state, action: PayloadAction) {\r\n      state.ImportState.processing = false;\r\n    },\r\n\r\n    setHasFiles(state, action: PayloadAction<boolean>) {\r\n      if (state.RequestDetails.value !== undefined) {\r\n        state.RequestDetails.value.HasFiles = action.payload;\r\n      }\r\n    },\r\n\r\n    deleteSamples(state, action: PayloadAction<ISample[]>) {},\r\n    cloneServiceRequest(state, action: PayloadAction<number>) {},\r\n  },\r\n});\r\n\r\nexport const { actions: requestSamplesActions } = slice;\r\n\r\nexport const useRequestSamplesSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: requestSamplesSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useRequestSamplesSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { Entity } from 'types/common';\r\n\r\n/**\r\n * Combines Id & Name into an object that represents an entity\r\n * @param id Entity Id\r\n * @param name Entity Name\r\n * @param otherData additional Data\r\n * @returns Entity with Id & Name populated\r\n */\r\nexport function toEntity<T>(\r\n  id: T | null | undefined,\r\n  name?: string | null,\r\n  otherData?: Record<string, any>,\r\n): Entity<T> | null {\r\n  if (id == null || id === undefined || name == null || name === undefined) {\r\n    return null;\r\n  } else {\r\n    return !!otherData\r\n      ? Object.assign({}, { Id: id, Name: name ?? id }, otherData)\r\n      : { Id: id, Name: name ?? id };\r\n  }\r\n}\r\n","/**\r\n *\r\n * FundingTypeIdPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { InvoiceFundingType } from 'enums/InvoiceFundingType';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface FundingTypePickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSingleInvoiceFundingType = (val: number): Entity<number> => {\r\n  return enumToEntityArray(InvoiceFundingType).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const initFundingTypeData = (\r\n  initval: string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  const val = parseInt(initval ?? '');\r\n  if (initval === undefined || isNaN(val)) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([getSingleInvoiceFundingType(val)]);\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(InvoiceFundingType);\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function FundingTypeIdPicker(props: FundingTypePickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetsPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport type avTypes =\r\n  | 'bookable'\r\n  | 'serviceRelated'\r\n  | 'serviceGroup'\r\n  | 'bookableAndnotbookable'\r\n  | 'workOrderRelated'\r\n  | 'all';\r\n\r\nexport interface AssetsPickerProps\r\n  extends Omit<AutocompleteMultiPickerExProps<IAssetDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  restrictByAvType?: avTypes;\r\n  /**\r\n   * Option to filter admin permissions. If set to true will return only the assets authenticated user is an admin of\r\n   */\r\n  admin?: boolean;\r\n  /**\r\n   * Fetches only Active assets/instruments if this property is set to true\r\n   */\r\n  showOnlyActiveAssets?: boolean;\r\n  withoutServiceGroups?: boolean;\r\n}\r\nexport const bookable: Identifiable<number>[] = [\r\n  //{ Id: AvailabilityTypes.ApprovalRequiredBillable as number },\r\n  //{ Id: AvailabilityTypes.BookableWApproval as number },\r\n  { Id: AvailabilityTypes.FreelyBookable as number },\r\n  //{ Id: AvailabilityTypes.FreelyBookableBillable as number },\r\n  { Id: AvailabilityTypes.LectureRoom as number },\r\n  { Id: AvailabilityTypes.LoanableEquipment as number },\r\n  { Id: AvailabilityTypes.TrainingProgram as number },\r\n];\r\nexport const bookableAndnotbookable: Identifiable<number>[] = bookable.concat([\r\n  { Id: AvailabilityTypes.AvailableNotBookable as number },\r\n]);\r\nexport const servicesRelated: Identifiable<number>[] = [\r\n  //{ Id: AvailabilityTypes.ApprovalRequiredBillable as number },\r\n  //{ Id: AvailabilityTypes.BookableWApproval as number },\r\n  { Id: AvailabilityTypes.FreelyBookable as number },\r\n  //{ Id: AvailabilityTypes.FreelyBookableBillable as number },\r\n  { Id: AvailabilityTypes.LectureRoom as number },\r\n  { Id: AvailabilityTypes.LoanableEquipment as number },\r\n  { Id: AvailabilityTypes.TrainingProgram as number },\r\n  { Id: AvailabilityTypes.AvailableNotBookable as number },\r\n  { Id: AvailabilityTypes.NotAvailable as number },\r\n  { Id: AvailabilityTypes.RequestRelated as number },\r\n  { Id: AvailabilityTypes.ServiceRelated as number },\r\n];\r\nexport const initAssetsData = (\r\n  initval: string | undefined,\r\n  byService?: boolean,\r\n  serviceTypes?: Identifiable<number>[],\r\n  admin?: boolean,\r\n) => {\r\n  const url =\r\n    admin === true\r\n      ? '/api/odata/v4/AssetNames/AdminAssets'\r\n      : '/api/odata/v4/AssetNames';\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    let ids = (initval.indexOf(',') !== -1\r\n      ? initval.split(',')\r\n      : initval.indexOf('|') !== -1\r\n      ? initval.split('|')\r\n      : [initval]\r\n    ).map(item => {\r\n      return { Id: parseInt(item) };\r\n    }) as Identifiable<number>[];\r\n    let filters: string | undefined = undefined;\r\n    if (ids.length > 0) {\r\n      const predicates: string | Condition<IAssetDto>[] = [];\r\n\r\n      if (byService) {\r\n        predicates.push(\r\n          new Condition('ServiceId', ODataOperators.Includes, ids),\r\n        );\r\n        let types =\r\n          !!serviceTypes && serviceTypes.length > 0\r\n            ? serviceTypes\r\n            : [{ Id: 1 }];\r\n\r\n        predicates.push(\r\n          new Condition('ServiceTypeId', ODataOperators.Includes, types),\r\n        );\r\n      } else {\r\n        predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n      }\r\n      filters = predicates.map(f => f.toString()).join(' and ');\r\n    }\r\n\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: filters,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport function AssetsFilterForWorkOrder(\r\n  orederType: IWorkOrderTypeDto | undefined,\r\n): Condition<IAssetDto>[] {\r\n  const predicates: Condition<IAssetDto>[] = [];\r\n  if (orederType !== undefined) {\r\n    if (orederType.Groups && orederType.Groups.length > 0) {\r\n      predicates.push(\r\n        new Condition<IAssetDto>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          orederType.Groups.map(f => f.Id),\r\n        ),\r\n      );\r\n    }\r\n    if (orederType.AssetCats && orederType.AssetCats.length > 0) {\r\n      predicates.push(\r\n        new Condition(\r\n          'AssetCatId',\r\n          ODataOperators.Includes,\r\n          orederType.AssetCats.map(f => f.Id),\r\n        ),\r\n      );\r\n    }\r\n  }\r\n\r\n  predicates.push(\r\n    new Condition('ServiceTypeId', ODataOperators.Includes, [\r\n      { Id: 1 },\r\n      { Id: 2 },\r\n      // { Id: 3 },\r\n    ]),\r\n  );\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  } else {\r\n    return [];\r\n  }\r\n}\r\nexport function AssetsFilterForCalibrationWorkOrder(\r\n  orederType: IWorkOrderTypeDto | undefined,\r\n  selectedIds: number[],\r\n): Condition<IAssetDto>[] {\r\n  const predicates: Condition<IAssetDto>[] = [];\r\n  if (orederType !== undefined) {\r\n    if (orederType.Groups && orederType.Groups.length > 0) {\r\n      predicates.push(\r\n        new Condition<IAssetDto>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          orederType.Groups,\r\n        ),\r\n      );\r\n    }\r\n    if (orederType.AssetCats && orederType.AssetCats.length > 0) {\r\n      predicates.push(\r\n        new Condition(\r\n          'AssetCatId',\r\n          ODataOperators.Includes,\r\n          orederType.AssetCats,\r\n        ),\r\n      );\r\n    }\r\n  }\r\n  if (selectedIds.length > 0) {\r\n    predicates.push(\r\n      new Condition<IAssetDto>('Id', ODataOperators.Excludes, selectedIds),\r\n    );\r\n  }\r\n\r\n  predicates.push(\r\n    new Condition('ServiceTypeId', ODataOperators.Includes, [\r\n      { Id: 1 },\r\n      { Id: 2 },\r\n      { Id: 3 },\r\n    ]),\r\n  );\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  } else {\r\n    return [];\r\n  }\r\n}\r\nexport function AssetsFilterForSavedView(\r\n  topServiceGroups: Entity<number>[] | undefined,\r\n): Condition<IAssetDto>[] {\r\n  const predicates: Condition<IAssetDto>[] = [];\r\n  if (topServiceGroups !== undefined) {\r\n    if (topServiceGroups.length > 0) {\r\n      predicates.push(\r\n        new Condition<IAssetDto>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          topServiceGroups,\r\n        ),\r\n      );\r\n    }\r\n  }\r\n  predicates.push(\r\n    new Condition('ServiceTypeId', ODataOperators.Includes, [\r\n      { Id: 1 },\r\n      //{ Id: 2 },\r\n      //{ Id: 3 },\r\n    ]),\r\n  );\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  } else {\r\n    return [];\r\n  }\r\n}\r\nconst loadData = (\r\n  predicates: (string | Condition<IAssetDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  admin?: boolean,\r\n  withoutServiceGroups?: boolean,\r\n) => {\r\n  const url =\r\n    admin === true\r\n      ? '/api/odata/v4/AssetNames/AdminAssets'\r\n      : '/api/odata/v4/AssetNames';\r\n  return getAutoCompleteLoadDataFn<IAssetDto>({\r\n    url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'AssetCatId',\r\n      'Availability',\r\n      // BookableAsset is not mapped (AssetNamesController)\r\n      //      'BookableAsset',\r\n      'Image',\r\n      'ServiceGroupId',\r\n      'ServiceId',\r\n      'ServiceTypeId',\r\n      'ServiceGroupName',\r\n      'ServiceGroupAssetId',\r\n      'Color',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n      !!globalServiceGroupFilter &&\r\n      globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IAssetDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\nexport function AssetsPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  restrictByAvType,\r\n  showOnlyActiveAssets,\r\n  admin,\r\n  withoutServiceGroups,\r\n  ...props\r\n}: AssetsPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n\r\n  let avFilter =\r\n    restrictByAvType === undefined ? undefined : getAvFilter(restrictByAvType);\r\n\r\n  let filters =\r\n    avFilter !== undefined\r\n      ? predicates !== undefined\r\n        ? [...predicates, avFilter]\r\n        : [avFilter]\r\n      : predicates;\r\n  if (showOnlyActiveAssets === true) {\r\n    filters?.push(\r\n      new Condition<IAssetDto>('Active', ODataOperators.Equals, true),\r\n    );\r\n  }\r\n  const innerLoadData = loadData(\r\n    filters,\r\n    globalServiceGroupFilter || [],\r\n    admin,\r\n    withoutServiceGroups,\r\n  );\r\n\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      variant={variant}\r\n      loadData={innerLoadData}\r\n      onChange={onChange}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'assets-multi-picker'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={defaultValue ?? []}\r\n      label={label}\r\n      value={value ?? []}\r\n      ariaLabel={'Assets search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\nexport function ServiceGroupAssetsPicker(\r\n  props: Omit<AssetsPickerProps, 'restrictByAvType'>,\r\n) {\r\n  return <AssetsPicker restrictByAvType=\"serviceGroup\" {...props} />;\r\n}\r\nexport function InstrumentAssetsPicker(\r\n  props: Omit<AssetsPickerProps, 'restrictByAvType'>,\r\n) {\r\n  return <AssetsPicker restrictByAvType=\"bookable\" {...props} />;\r\n}\r\nexport function getAvFilter(restrictByAvType: avTypes) {\r\n  switch (restrictByAvType) {\r\n    case 'bookable':\r\n      return `(${new Condition(\r\n        'Availability/Id',\r\n        ODataOperators.Includes,\r\n        bookable,\r\n      ).toString()})`;\r\n    case 'bookableAndnotbookable':\r\n      return `(${new Condition(\r\n        'Availability/Id',\r\n        ODataOperators.Includes,\r\n        bookableAndnotbookable,\r\n      ).toString()})`;\r\n    case 'serviceRelated':\r\n      return `(${new Condition(\r\n        'Availability/Id',\r\n        ODataOperators.Includes,\r\n        servicesRelated,\r\n      ).toString()})`;\r\n    case 'workOrderRelated':\r\n      return `(${new Condition(\r\n        'Availability/Id',\r\n        ODataOperators.Includes,\r\n        servicesRelated.filter(\r\n          f => f.Id !== (AvailabilityTypes.RequestRelated as number),\r\n        ),\r\n      ).toString()})`;\r\n    case 'serviceGroup':\r\n      return `(${new Condition(\r\n        'Availability/Id',\r\n        ODataOperators.Equals,\r\n        AvailabilityTypes.ServiceGroup,\r\n      ).toString()})`;\r\n    case 'all':\r\n      return undefined;\r\n    default:\r\n      assertExhaustive(restrictByAvType);\r\n  }\r\n}\r\n","import { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { LoginTypes, Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { intersection } from 'lodash';\r\nimport { enumToArray, enumToDescriptedArray } from 'utils/enumKeys';\r\nimport { Entity } from './common';\r\n\r\nexport interface IAuthenticatedUser extends Entity<string> {\r\n  Language?: string;\r\n  CultureName?: string;\r\n  Roles: number[];\r\n  LoginType: LoginTypes;\r\n  UserGroups: Entity<string>[];\r\n  ActiveUserGroup?: Entity<string>;\r\n  DisplayName?: string;\r\n  AdminEquipments?: AuthServiceDto[];\r\n  AdminServiceGroups?: AuthServiceGroupDto[];\r\n  InstrumentEventsGroups?: AuthServiceGroupDto[];\r\n  CreatableGroups?: Entity<number>[];\r\n  HasRegisterableServiceGroups?: boolean;\r\n  FormatedName?: string;\r\n  HasNotifications?: boolean;\r\n  HasOptOutCoreSelection: boolean;\r\n  CalendarType: number;\r\n  RequireUserGroupCoordApproval: boolean;\r\n  HasSignedTermsOfUse: boolean;\r\n  IsActiveDirectory: boolean;\r\n  JoinStatus?: number;\r\n  CustomRoleUrls?: CustomRoleData;\r\n}\r\nexport interface AuthServiceDto extends Entity<number> {\r\n  Id: number;\r\n  Name: string;\r\n  ServiceTypeId: number;\r\n  ServiceGroupId: number;\r\n  IsLabTech: boolean;\r\n}\r\nexport interface AuthServiceGroupDto extends Entity<number> {\r\n  Id: number;\r\n  Name: string;\r\n  IsLabTech: boolean;\r\n}\r\nexport interface IIsAdminOfParams {\r\n  ServiceTypeId: ServiceType;\r\n  ServiceId: number;\r\n  ServiceGroupId: number;\r\n}\r\nexport interface IIsAdminOrOwnerOfParams extends IIsAdminOfParams {\r\n  UserId: string | null;\r\n}\r\nexport enum CustomRolePermissionLevel {\r\n  AdminWriteLevel = 0,\r\n  ReadOnlyLevel = 1,\r\n}\r\nexport type CustomRoleData = {\r\n  [key: string]: CustomRolePermissionLevel;\r\n};\r\n\r\nexport enum CustomRoleAllowePages {\r\n  Users = '/Users.aspx?module=main',\r\n  UsersList = '/Users.aspx?list=',\r\n  AddUser = '/NewUser.aspx',\r\n  EditUser = '/NewUser.aspx?un=',\r\n  UsersHistory = '/UsersHistory',\r\n  UsersImport = '/UsersImport.aspx',\r\n  UserGroups = '/AllowedAdGroups.aspx',\r\n  AddUserGroup = '/AllowedAdGroup.aspx',\r\n  EditUserGroup = '/AllowedAdGroup.aspx?ID=',\r\n  Departments = '/Departments.aspx',\r\n  Institutes = '/Institutes.aspx',\r\n  InstituteTypes = '/InstituteTypes.aspx',\r\n  AddInsituteType = '/InstituteType.aspx',\r\n  EditInstituteType = '/InstituteType.aspx?ID=',\r\n  Disciplines = '/Disciplines.aspx',\r\n  BillingPreview = '/Invoices/Create.aspx',\r\n  InvoiceBatches = '/Invoices/Batches.aspx',\r\n  Invoices = '/Invoices/Default.aspx',\r\n  InvoiceDetails = '/Invoices/Details.aspx',\r\n  InvoicePayments = '/Invoices/InvoicePayments.aspx',\r\n  Charges = '/Invoices/InvoiceUserRows.aspx',\r\n  SubscriptionTypes = '/Invoices/SubscriptionTypes/Default.aspx',\r\n  SubscriptionTypesList = '/Invoices/SubscriptionTypes/Default.aspx?list=',\r\n  AddSubscriptionType = '/Invoices/SubscriptionTypes/AddNew.aspx',\r\n  EditSubscriptionType = '/Invoices/SubscriptionTypes/Edit.aspx',\r\n  Subscriptions = '/Invoices/Subscriptions/Default.aspx',\r\n  SubscriptionsList = '/Invoices/Subscriptions/Default.aspx?list=',\r\n  AddSubscription = '/Invoices/Subscriptions/Create.aspx',\r\n  EditSubscription = '/Invoices/Subscriptions/Edit.aspx',\r\n}\r\nexport class AuthenticatedUser implements IAuthenticatedUser {\r\n  // Entity<string> members\r\n  Id: string;\r\n  Name: string;\r\n  // IAuthenticatedUser members\r\n  Language?: string;\r\n  CultureName?: string;\r\n  Roles: number[];\r\n  LoginType: LoginTypes;\r\n  UserGroups: Entity<string>[];\r\n  ActiveUserGroup?: Entity<string>;\r\n  DisplayName?: string;\r\n  AdminEquipments: AuthServiceDto[];\r\n  AdminServiceGroups: AuthServiceGroupDto[];\r\n  InstrumentEventsGroups: AuthServiceGroupDto[];\r\n  CreatableGroups: Entity<number>[];\r\n  HasRegisterableServiceGroups?: boolean;\r\n  FormatedName?: string;\r\n  HasNotifications?: boolean;\r\n  HasOptOutCoreSelection: boolean;\r\n  CalendarType: number;\r\n  RequireUserGroupCoordApproval: boolean;\r\n  HasSignedTermsOfUse: boolean;\r\n  IsActiveDirectory: boolean;\r\n  JoinStatus?: number;\r\n  CustomRoleUrls?: CustomRoleData;\r\n\r\n  //constructor\r\n  constructor(data: IAuthenticatedUser) {\r\n    this.Id = data.Id;\r\n    this.Name = data.Name;\r\n    this.Language = data.Language;\r\n    this.CultureName = data.CultureName;\r\n    this.Roles = data.Roles;\r\n    this.LoginType = data.LoginType;\r\n    this.UserGroups = data.UserGroups;\r\n    this.ActiveUserGroup = data.ActiveUserGroup;\r\n    this.DisplayName = data.DisplayName;\r\n    this.AdminEquipments = data.AdminEquipments ?? [];\r\n    this.AdminServiceGroups = data.AdminServiceGroups ?? [];\r\n    this.InstrumentEventsGroups = data.InstrumentEventsGroups ?? [];\r\n    this.CreatableGroups = data.CreatableGroups ?? [];\r\n    this.HasRegisterableServiceGroups = data.HasRegisterableServiceGroups;\r\n    this.FormatedName = data.FormatedName;\r\n    this.HasNotifications = data.HasNotifications;\r\n    this.HasOptOutCoreSelection = data.HasOptOutCoreSelection;\r\n    this.CalendarType = data.CalendarType;\r\n    this.RequireUserGroupCoordApproval = data.RequireUserGroupCoordApproval;\r\n    this.HasSignedTermsOfUse = data.HasSignedTermsOfUse;\r\n    this.IsActiveDirectory = data.IsActiveDirectory;\r\n    this.JoinStatus = data.JoinStatus;\r\n    this.CustomRoleUrls = data.CustomRoleUrls;\r\n  }\r\n  /**\r\n   * Generic permissions check on a partial DTO:\r\n   * either it is a user created object\r\n   * @param row Dto partial object\r\n   * @returns true if current user has permissions\r\n   */\r\n  public IsAdminOf(row: IIsAdminOfParams) {\r\n    return (\r\n      this.HasAdminGroupPermissions(row?.ServiceGroupId) ||\r\n      this.HasLabTechGroupPermissions(row?.ServiceGroupId) ||\r\n      this.HasAdminServicePermissions(row.ServiceTypeId, row.ServiceId) ||\r\n      this.HasLabTechServicePermissions(row.ServiceTypeId, row.ServiceId)\r\n    );\r\n  }\r\n  /**\r\n   * Determines if current user is an Admin or Owner of an object\r\n   * @param row some partial DTO\r\n   * @returns\r\n   */\r\n  public IsAdminOrOwnerOf(row: IIsAdminOrOwnerOfParams) {\r\n    const result = this.IsAdminOf(row) || row.UserId === this.Id;\r\n    return result;\r\n  }\r\n\r\n  public HasCustomRolesPermission(\r\n    pages: CustomRoleAllowePages[],\r\n    level?: CustomRolePermissionLevel,\r\n  ): boolean {\r\n    if (this.Roles.includes(Roles.CustomRole)) {\r\n      if (this.CustomRoleUrls !== undefined) {\r\n        let result = false;\r\n        let rootedPages = pages.map(\r\n          page => process.env.PUBLIC_URL.toLowerCase() + page.toLowerCase(),\r\n        );\r\n        rootedPages.forEach(page => {\r\n          if (\r\n            Object.entries(this.CustomRoleUrls ?? {}).some(\r\n              item =>\r\n                item[0].toLowerCase() === page && (!level || level === item[1]),\r\n            )\r\n          ) {\r\n            result = true;\r\n            return;\r\n          }\r\n        });\r\n        return result;\r\n      }\r\n    }\r\n\r\n    return false;\r\n  }\r\n  public HasCustomRolePermission(\r\n    page: CustomRoleAllowePages,\r\n    level?: CustomRolePermissionLevel,\r\n  ): boolean {\r\n    if (this.Roles.includes(Roles.CustomRole)) {\r\n      if (this.CustomRoleUrls !== undefined) {\r\n        let rootedPage =\r\n          process.env.PUBLIC_URL.toLowerCase() + page.toLowerCase();\r\n        if (\r\n          Object.entries(this.CustomRoleUrls ?? {}).some(\r\n            item =>\r\n              item[0].toLowerCase() === rootedPage &&\r\n              (!level || level === item[1]),\r\n          )\r\n        ) {\r\n          return true;\r\n        }\r\n      }\r\n    }\r\n\r\n    return false;\r\n  }\r\n  public HasCustomRoleUrlPermission(\r\n    url: string,\r\n    level?: CustomRolePermissionLevel,\r\n  ): boolean {\r\n    if (this.Roles.includes(Roles.CustomRole)) {\r\n      if (this.CustomRoleUrls !== undefined) {\r\n        let rootedPage = url.toLowerCase();\r\n        if (\r\n          Object.entries(this.CustomRoleUrls ?? {}).some(\r\n            item =>\r\n              (item[0].toLowerCase() === rootedPage ||\r\n                (item[0].toLowerCase().indexOf('?list=') > 0 &&\r\n                  item[0].toLowerCase().indexOf(rootedPage) >= 0)) &&\r\n              (!level || level === item[1]),\r\n          )\r\n        ) {\r\n          return true;\r\n        }\r\n      }\r\n    }\r\n\r\n    return false;\r\n  }\r\n  public HasAdminGroupPermissions(serviceGroupId?: number): boolean {\r\n    if (serviceGroupId === undefined) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n      return this.AdminServiceGroups.some(\r\n        f => f.Id === serviceGroupId && f.IsLabTech === false,\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n\r\n  public isAdmin(): boolean {\r\n    return this.Roles.includes(Roles.Administrators);\r\n  }\r\n\r\n  public isGroupAdmin(): boolean {\r\n    return this.isAdmin() || this.Roles.includes(Roles.GroupAdministrators);\r\n  }\r\n\r\n  public isLabTech(): boolean {\r\n    return this.isAdmin() || this.Roles.includes(Roles.LabTech);\r\n  }\r\n\r\n  public HasAdminServicePermissions(\r\n    serviceTypeId: number,\r\n    serviceId?: number,\r\n  ): boolean {\r\n    if (serviceId === undefined) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (\r\n      this.Roles.includes(Roles.GroupAdministrators) ||\r\n      this.Roles.includes(Roles.EquipmentAdministrator)\r\n    ) {\r\n      return this.AdminEquipments.some(\r\n        item =>\r\n          item.Id === serviceId &&\r\n          item.ServiceTypeId === serviceTypeId &&\r\n          item.IsLabTech === false,\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public HasCreateAdminGroupPermissions(serviceGroupId?: number): boolean {\r\n    if (serviceGroupId === undefined) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (this.Roles.includes(Roles.CreateNewAssetsAdmin)) {\r\n      return this.CreatableGroups.map(item => item.Id).includes(serviceGroupId);\r\n    }\r\n    return false;\r\n  }\r\n  public HasAdminGroupOnlyPermissions(serviceGroupId?: number): boolean {\r\n    if (serviceGroupId === undefined) {\r\n      return false;\r\n    }\r\n    if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n      return this.AdminServiceGroups.some(\r\n        f => f.Id === serviceGroupId && f.IsLabTech === false,\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public HasAdminServiceOnlyPermissions(\r\n    serviceTypeId: number,\r\n    serviceId?: number,\r\n  ): boolean {\r\n    if (serviceId === undefined) {\r\n      return false;\r\n    }\r\n    if (\r\n      this.Roles.includes(Roles.GroupAdministrators) ||\r\n      this.Roles.includes(Roles.EquipmentAdministrator)\r\n    ) {\r\n      return this.AdminEquipments.some(\r\n        item =>\r\n          item.Id === serviceId &&\r\n          item.ServiceTypeId === serviceTypeId &&\r\n          item.IsLabTech === false,\r\n      );\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n  public HasLabTechGroupPermissions(serviceGroupId?: number): boolean {\r\n    if (serviceGroupId === undefined) {\r\n      return false;\r\n    }\r\n    if (!this.Roles.includes(Roles.LabTech)) {\r\n      return false;\r\n    } else {\r\n      return this.AdminServiceGroups.some(\r\n        f => f.Id === serviceGroupId && f.IsLabTech === true,\r\n      );\r\n    }\r\n  }\r\n  public HasLabTechServicePermissions(\r\n    serviceTypeId: number,\r\n    serviceId?: number,\r\n  ): boolean {\r\n    if (serviceId === undefined) {\r\n      return false;\r\n    }\r\n    if (!this.Roles.includes(Roles.LabTech)) {\r\n      return false;\r\n    } else {\r\n      return this.AdminEquipments.some(\r\n        item =>\r\n          item.Id === serviceId &&\r\n          item.ServiceTypeId === serviceTypeId &&\r\n          item.IsLabTech === true,\r\n      );\r\n    }\r\n  }\r\n  public HasInstrumentEventsGroupPermissions(serviceGroupId?: number): boolean {\r\n    if (serviceGroupId === undefined) {\r\n      return false;\r\n    }\r\n    if (!this.Roles.includes(Roles.InventoryAdmin)) {\r\n      return false;\r\n    } else {\r\n      return this.InstrumentEventsGroups.some(f => f.Id === serviceGroupId);\r\n    }\r\n  }\r\n  public IsAllAdminGroupPermissions(serviceGroups?: number[]): boolean {\r\n    if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n      return serviceGroups.every(f =>\r\n        this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === false),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public IsAllServicesAdmin(services?: IServiceTypeFilterDto[]): boolean {\r\n    if (services === undefined || services.length < 1) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (\r\n      this.Roles.includes(Roles.GroupAdministrators) ||\r\n      this.Roles.includes(Roles.EquipmentAdministrator)\r\n    ) {\r\n      return services.every(f =>\r\n        this.AdminEquipments.some(\r\n          s =>\r\n            s.Id === f.Id &&\r\n            s.ServiceTypeId === f.ServiceTypeId &&\r\n            s.IsLabTech === false,\r\n        ),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public HasSomeAdminGroupPermissions(serviceGroups?: number[]): boolean {\r\n    if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (this.Roles.includes(Roles.GroupAdministrators)) {\r\n      return serviceGroups.some(f =>\r\n        this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === false),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public HasSomeAdminServicesPermissions(\r\n    services?: IServiceTypeFilterDto[],\r\n  ): boolean {\r\n    if (services === undefined || services.length < 1) {\r\n      return this.Roles.includes(Roles.Administrators);\r\n    }\r\n    if (this.Roles.includes(Roles.Administrators)) {\r\n      return true;\r\n    }\r\n    if (\r\n      this.Roles.includes(Roles.GroupAdministrators) ||\r\n      this.Roles.includes(Roles.EquipmentAdministrator)\r\n    ) {\r\n      return services.some(f =>\r\n        this.AdminEquipments.some(\r\n          s =>\r\n            s.Id === f.Id &&\r\n            s.ServiceTypeId === f.ServiceTypeId &&\r\n            s.IsLabTech === false,\r\n        ),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public HasSomeLabTechGroupPermissions(serviceGroups?: number[]): boolean {\r\n    if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n      return false;\r\n    }\r\n    if (this.Roles.includes(Roles.LabTech)) {\r\n      return serviceGroups.some(f =>\r\n        this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === true),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public HasSomeLabTechServicesPermissions(\r\n    services?: IServiceTypeFilterDto[],\r\n  ): boolean {\r\n    if (services === undefined || services.length < 1) {\r\n      return false;\r\n    }\r\n    if (this.Roles.includes(Roles.LabTech)) {\r\n      return services.some(f =>\r\n        this.AdminEquipments.some(\r\n          s =>\r\n            s.Id === f.Id &&\r\n            s.ServiceTypeId === f.ServiceTypeId &&\r\n            s.IsLabTech === true,\r\n        ),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public IsAllLabTechGroupPermissions(serviceGroups?: number[]): boolean {\r\n    if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n      return false;\r\n    }\r\n    if (this.Roles.includes(Roles.LabTech)) {\r\n      return serviceGroups.every(f =>\r\n        this.AdminServiceGroups.some(g => g.Id === f && g.IsLabTech === true),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public IsAllServicesLabTech(services?: IServiceTypeFilterDto[]): boolean {\r\n    if (services === undefined || services.length < 1) {\r\n      return false;\r\n    }\r\n    if (this.Roles.includes(Roles.LabTech)) {\r\n      return services.every(f =>\r\n        this.AdminEquipments.some(\r\n          s =>\r\n            s.Id === f.Id &&\r\n            s.ServiceTypeId === f.ServiceTypeId &&\r\n            s.IsLabTech === true,\r\n        ),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n  public IsAllGroupOrLabTechAdmin(\r\n    serviceGroups?: number[],\r\n    services?: IServiceTypeFilterDto[],\r\n  ): boolean {\r\n    return (\r\n      this.IsAllAdminGroupPermissions(serviceGroups) ||\r\n      this.IsAllServicesAdmin(services) ||\r\n      this.IsAllLabTechGroupPermissions(serviceGroups) ||\r\n      this.IsAllServicesLabTech(services)\r\n    );\r\n  }\r\n  public IsAllInstrumentEventsGroupPermissions(\r\n    serviceGroups?: number[],\r\n  ): boolean {\r\n    if (serviceGroups === undefined || serviceGroups.length < 1) {\r\n      return false;\r\n    }\r\n\r\n    if (this.Roles.includes(Roles.InventoryAdmin)) {\r\n      return serviceGroups.every(f =>\r\n        this.InstrumentEventsGroups.some(g => g.Id === f),\r\n      );\r\n    }\r\n    return false;\r\n  }\r\n}\r\n\r\nexport function isInRole(\r\n  user: IAuthenticatedUser | undefined,\r\n  role: string | Roles,\r\n): boolean {\r\n  if (user && user.Roles.length > 0) {\r\n    let baseRoles = enumToArray(Roles);\r\n    let odjRoles = enumToDescriptedArray(Roles);\r\n    if (intersection(user.Roles, baseRoles).length > 0) {\r\n      if (typeof role === 'string') {\r\n        return (\r\n          odjRoles.filter(\r\n            item =>\r\n              item.description.toLowerCase() === (role as string).toLowerCase(),\r\n          ).length > 0\r\n        );\r\n      } else {\r\n        return user.Roles.includes(role as Roles);\r\n      }\r\n    }\r\n  }\r\n  return false;\r\n}\r\n\r\n// export function isServiseGroupAdmin(\r\n//   user: IAuthenticatedUser | undefined,\r\n//   ServiceGroups: Identifiable<number>[] | undefined,\r\n// ): boolean {\r\n//   if (\r\n//     user &&\r\n//     ServiceGroups &&\r\n//     ServiceGroups.length > 0 &&\r\n//     user.Roles.indexOf(Roles.GroupAdministrators) >= 0\r\n//   ) {\r\n//     const sg = user.AdminServiceGroups;\r\n//     if (sg) {\r\n//       for (var i = 0; i < sg.length; i++) {\r\n//         const Id = sg[i].Id;\r\n//         if (ServiceGroups.some(item => item.Id === Id)) {\r\n//           return true;\r\n//         }\r\n//       }\r\n//       return false;\r\n//     } else {\r\n//       return false;\r\n//     }\r\n//   } else {\r\n//     return false;\r\n//   }\r\n// }\r\n// export function isAllServiseGroupAdmin(\r\n//   user: IAuthenticatedUser | undefined,\r\n//   ServiceGroups: Entity<number>[] | undefined,\r\n// ): boolean {\r\n//   if (\r\n//     user &&\r\n//     ServiceGroups &&\r\n//     ServiceGroups.length > 0 &&\r\n//     user.Roles.indexOf(Roles.GroupAdministrators) >= 0\r\n//   ) {\r\n//     const sg = user.AdminServiceGroups;\r\n//     if (sg) {\r\n//       if (ServiceGroups.every(item => sg.some(g => g.Id === item.Id))) {\r\n//         return true;\r\n//       }\r\n//       return false;\r\n//     } else {\r\n//       return false;\r\n//     }\r\n//   } else {\r\n//     return false;\r\n//   }\r\n// }\r\n// export function isServiceGroupOrLabTechAdmin(\r\n//   user: IAuthenticatedUser | undefined,\r\n//   Services: number[] | undefined,\r\n//   ServiceGroups: number[] | undefined,\r\n// ): boolean {\r\n//   let result = false;\r\n//   if (user !== undefined) {\r\n//     if (\r\n//       ServiceGroups !== undefined &&\r\n//       user.Roles.includes(Roles.GroupAdministrators)\r\n//     ) {\r\n//       const sg = user.AdminServiceGroups;\r\n//       if (\r\n//         sg !== undefined &&\r\n//         ServiceGroups.every(item => sg.some(g => g.Id === item))\r\n//       ) {\r\n//         result = true;\r\n//       }\r\n//     } else if (user.Roles.includes(Roles.LabTech)) {\r\n//       const sg = user.AdminServiceGroups;\r\n//       const eqs = user.AdminEquipments;\r\n//       let isLabAdmin = false;\r\n//       let isEqAdmin = false;\r\n//       if (ServiceGroups !== undefined) {\r\n//         if (\r\n//           sg !== undefined &&\r\n//           ServiceGroups.every(item => sg.some(g => g.Id === item))\r\n//         ) {\r\n//           isLabAdmin = true;\r\n//         }\r\n//       }\r\n//       if (Services !== undefined) {\r\n//         if (\r\n//           eqs !== undefined &&\r\n//           Services.every(item => eqs.some(eq => eq === item))\r\n//         ) {\r\n//           isEqAdmin = true;\r\n//         }\r\n//       }\r\n//       result = isLabAdmin || isEqAdmin;\r\n//     } else if (user.Roles.includes(Roles.EquipmentAdministrator)) {\r\n//       if (Services !== undefined) {\r\n//         const eqs = user.AdminEquipments;\r\n//         if (\r\n//           eqs !== undefined &&\r\n//           Services.every(item => eqs.some(eq => eq === item))\r\n//         ) {\r\n//           result = true;\r\n//         }\r\n//       }\r\n//     }\r\n//   }\r\n//   return result;\r\n// }\r\n// export function isOnlineServicesAdmin(\r\n//   user: IAuthenticatedUser | undefined,\r\n//   Services: Entity<number>[] | undefined,\r\n// ): boolean {\r\n//   if (\r\n//     user &&\r\n//     Services &&\r\n//     Services.length > 0 &&\r\n//     (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n//       user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n//       user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n//       user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n//   ) {\r\n//     const eqs: IServiceTypeFilterDto[] | undefined = user.AllAdminEquipments;\r\n//     if (!!eqs && eqs.length > 0) {\r\n//       let result = eqs\r\n//         .filter(f => f.ServiceTypeId === 1)\r\n//         .filter(f => Services.some(item => item.Id === f.Id));\r\n//       return result.length > 0;\r\n//     } else {\r\n//       return false;\r\n//     }\r\n//   } else {\r\n//     return false;\r\n//   }\r\n// }\r\n// export function isServiceAdmin(\r\n//   user: IAuthenticatedUser | undefined,\r\n//   Service: number | undefined,\r\n//   ServiceTypeId: ServiceType,\r\n// ): boolean {\r\n//   if (\r\n//     user &&\r\n//     Service &&\r\n//     (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n//       user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n//       user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n//       user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n//   ) {\r\n//     if (\r\n//       user.AllAdminEquipments?.some(\r\n//         item => item.Id === Service && item.ServiceTypeId === ServiceTypeId,\r\n//       )\r\n//     ) {\r\n//       return true;\r\n//     }\r\n//     return false;\r\n//   } else {\r\n//     return false;\r\n//   }\r\n// }\r\n// export function isAllServiceAdmin(\r\n//   user: IAuthenticatedUser | undefined,\r\n//   Services: IServiceTypeFilterDto[],\r\n// ): boolean {\r\n//   if (\r\n//     user &&\r\n//     Services.length > 0 &&\r\n//     (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n//       user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n//       user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n//       user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n//   ) {\r\n//     if (\r\n//       user.AllAdminEquipments?.some(item =>\r\n//         Services.some(\r\n//           f => f.Id === item.Id && f.ServiceTypeId === item.ServiceTypeId,\r\n//         ),\r\n//       )\r\n//     ) {\r\n//       return true;\r\n//     }\r\n//     return false;\r\n//   } else {\r\n//     return false;\r\n//   }\r\n// }\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { Entity } from 'types/common';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { samplePlatesSaga } from './saga';\r\nimport {\r\n  IBulkSamplePlateCreate,\r\n  ISamplePlateCreate,\r\n  SamplePlatesState,\r\n  SamplePlatesTableState,\r\n} from './types';\r\n\r\nexport const initialState: SamplePlatesState = {\r\n  data: { processing: false },\r\n  create: { processing: false },\r\n  bulckCreate: { processing: false },\r\n  update: { processing: false },\r\n  delete: { processing: false },\r\n  tableState: {\r\n    pageSize: 10,\r\n    pageIndex: 0,\r\n    sortBy: [{ id: 'Id', desc: true }],\r\n    customFilters: [],\r\n    globalFilter: '',\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'samplePlates',\r\n  initialState,\r\n  reducers: {\r\n    get(state, action: PayloadAction<SamplePlatesTableState>) {\r\n      state.data.processing = true;\r\n      state.tableState = {\r\n        pageSize: action.payload.pageSize,\r\n        pageIndex: action.payload.pageIndex,\r\n        sortBy: action.payload.sortBy,\r\n        globalFilter: action.payload.globalFilter,\r\n        serviceGroups:\r\n          action.payload.serviceGroups?.length !== 0\r\n            ? action.payload.serviceGroups\r\n            : undefined,\r\n        visibleColumns: action.payload.visibleColumns,\r\n        customFilters: action.payload.customFilters?.map(filter => ({\r\n          fieldName: filter.fieldName,\r\n          operator: filter.operator,\r\n          value: filter.value,\r\n        })),\r\n      };\r\n    },\r\n    get_Success(state, action: PayloadAction<any>) {\r\n      state.data.processing = false;\r\n      state.data.error = undefined;\r\n      state.data.data = action.payload.value;\r\n      state.data.dataLength = action.payload['@odata.count'];\r\n    },\r\n    get_Error(state, action: PayloadAction<any>) {},\r\n\r\n    export(state, action: PayloadAction) {},\r\n\r\n    getPlateTypes_Success(state, action: PayloadAction<Entity<number>[]>) {\r\n      state.plateTypes = action.payload;\r\n    },\r\n\r\n    showCreate(\r\n      state,\r\n      action: PayloadAction<{ serviceGroups: Entity<number>[] }>,\r\n    ) {\r\n      state.create.open = true;\r\n      state.create.initialValues = {\r\n        IsRack: false,\r\n        ServiceGroup:\r\n          action.payload.serviceGroups.length === 1\r\n            ? action.payload.serviceGroups[0]\r\n            : undefined,\r\n        SamplePlateType: state.plateTypes?.[0],\r\n        Active: true,\r\n      };\r\n    },\r\n    showBulkCreate(\r\n      state,\r\n      action: PayloadAction<{ serviceGroups: Entity<number>[] }>,\r\n    ) {\r\n      state.bulckCreate.open = true;\r\n      state.bulckCreate.initialValues = {\r\n        IsRack: false,\r\n        ServiceGroup:\r\n          action.payload.serviceGroups.length === 1\r\n            ? action.payload.serviceGroups[0]\r\n            : undefined,\r\n        SamplePlateType: state.plateTypes?.[0],\r\n        Active: true,\r\n      };\r\n    },\r\n    hideCreate(state, action: PayloadAction) {\r\n      state.create.processing = false;\r\n      state.create.open = false;\r\n    },\r\n    hideBulkCreate(state, action: PayloadAction) {\r\n      state.bulckCreate.processing = false;\r\n      state.bulckCreate.open = false;\r\n    },\r\n    create(state, action: PayloadAction<ISamplePlateCreate>) {\r\n      state.create.processing = true;\r\n    },\r\n    bulkCreate(state, action: PayloadAction<IBulkSamplePlateCreate>) {\r\n      state.bulckCreate.processing = true;\r\n    },\r\n    bulkCreate_SetProgress(state, action: PayloadAction<number>) {\r\n      state.bulckCreate.progress = action.payload;\r\n    },\r\n    create_Success(state, action: PayloadAction<ISamplePlateDto>) {\r\n      state.create.processing = false;\r\n      state.create.open = false;\r\n    },\r\n    bulkCreate_Success(state, action: PayloadAction) {\r\n      state.bulckCreate.processing = false;\r\n      state.bulckCreate.open = false;\r\n    },\r\n    create_Error(state, action: PayloadAction<any>) {},\r\n    bulkCreate_Error(state, action: PayloadAction<any>) {},\r\n\r\n    hideUpdate(state, action: PayloadAction) {\r\n      state.update.processing = false;\r\n      state.update.open = false;\r\n    },\r\n    edit(state, action: PayloadAction<ISamplePlateDto>) {\r\n      state.update.processing = false;\r\n      state.update.open = true;\r\n      state.update.initialValues = {\r\n        Id: action.payload.Id,\r\n        Location: toEntity(\r\n          action.payload.LocationId,\r\n          action.payload.LocationName,\r\n        ),\r\n        Room: toEntity(action.payload.RoomId, action.payload.RoomName),\r\n        SamplePlateType: toEntity(\r\n          action.payload.SamplePlateTypeId,\r\n          action.payload.SamplePlateTypeName,\r\n        ),\r\n        ServiceGroup: toEntity(\r\n          action.payload.ServiceGroupId,\r\n          action.payload.ServiceGroupName,\r\n        ),\r\n        IsRack: action.payload.IsRack,\r\n        Active: action.payload.Active,\r\n      };\r\n    },\r\n    update(\r\n      state,\r\n      action: PayloadAction<{\r\n        original: ISamplePlateCreate;\r\n        current: Partial<ISamplePlateCreate>;\r\n      }>,\r\n    ) {\r\n      state.update.processing = true;\r\n    },\r\n    update_Success(state, action: PayloadAction<Partial<ISamplePlateDto>>) {\r\n      state.update.processing = false;\r\n      state.update.open = false;\r\n      state.update.initialValues = undefined;\r\n    },\r\n    update_Error(state, action: PayloadAction<any>) {},\r\n\r\n    delete(state, action: PayloadAction<string>) {\r\n      state.delete.processing = true;\r\n    },\r\n    delete_Success(state, action: PayloadAction<ISamplePlateDto>) {},\r\n    delete_Error(state, action: PayloadAction<any>) {},\r\n\r\n    deactivatePlates(state, action: PayloadAction<ISamplePlateDto[]>) {},\r\n    deactivatePlates_Success(state, action: PayloadAction) {},\r\n    deactivatePlates_Error(state, action: PayloadAction) {},\r\n\r\n    deletePlates(state, action: PayloadAction<ISamplePlateDto[]>) {},\r\n    deletePlates_Success(state, action: PayloadAction) {},\r\n    deletePlates_Error(state, action: PayloadAction) {},\r\n  },\r\n});\r\n\r\nexport const { actions: samplePlatesActions } = slice;\r\n\r\nexport const useSamplePlatesSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: samplePlatesSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useSamplePlatesSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import {\r\n  FormControl,\r\n  FormHelperText,\r\n  FormLabel,\r\n  InputLabel,\r\n} from '@material-ui/core';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { RichTextEditor, RichTextEditorProps } from '../RichTextEditor';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { FormControlProps } from './FormControls/FormControl';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nexport const FormRichTextField = ({\r\n  onChange,\r\n  onBlur,\r\n  value,\r\n  hasMentions,\r\n  onChangeMentions,\r\n  autoFocus,\r\n  additionalButtons,\r\n  isInvoiceTemplateEditor,\r\n  extendedMode,\r\n  labelOnTop,\r\n  ...props\r\n}: FieldHookConfig<string> &\r\n  IFieldProps &\r\n  Omit<RichTextEditorProps, 'onChange'>) => {\r\n  const [field, meta, helpers] = useField<string>({ ...props });\r\n  const handleChange = (value: string | undefined | null) => {\r\n    // formik is not happy with neither undefined nor null\r\n    const formikValue = value ?? '';\r\n    field.onChange(formikValue);\r\n    helpers.setValue(formikValue, true);\r\n    onChange?.(value);\r\n  };\r\n  return (\r\n    <RichTextField\r\n      className={props.className}\r\n      fullWidth={props.fullWidth !== false}\r\n      disabled={props.disabled}\r\n      variant=\"outlined\"\r\n      label={props.label}\r\n      error={meta.error}\r\n      info={props.info}\r\n      helperText={props.helperText}\r\n      value={field.value}\r\n      onChange={handleChange}\r\n      hasMentions={hasMentions}\r\n      onChangeMentions={onChangeMentions}\r\n      autofocus={autoFocus}\r\n      additionalButtons={additionalButtons}\r\n      isInvoiceTemplateEditor={isInvoiceTemplateEditor}\r\n      extendedMode={extendedMode}\r\n      labelOnTop={labelOnTop}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\nexport interface RichTextFieldProps\r\n  extends RichTextEditorProps,\r\n    Pick<FormControlProps, 'className' | 'fullWidth' | 'variant'> {\r\n  error?: string;\r\n  label?: string;\r\n  info?: string;\r\n\r\n  helperText?: string;\r\n}\r\nexport function RichTextField({\r\n  className,\r\n  error,\r\n  fullWidth,\r\n  disabled,\r\n  label,\r\n  info,\r\n  variant = 'outlined',\r\n  helperText,\r\n  labelOnTop,\r\n  ...props\r\n}: RichTextFieldProps) {\r\n  const [controlsVisible, setControlsVisible] = React.useState<boolean>(false);\r\n  return (\r\n    <>\r\n      <FormControl\r\n        className={className}\r\n        error={Boolean(error)}\r\n        fullWidth={fullWidth !== false}\r\n        disabled={disabled}\r\n        variant={variant}\r\n      >\r\n        {label && (\r\n          <>\r\n            {labelOnTop ? (\r\n              <FormLabel\r\n                error={Boolean(error)}\r\n                className={'rich-text-form-label'}\r\n              >\r\n                {label}\r\n              </FormLabel>\r\n            ) : (\r\n              <InputLabel\r\n                error={Boolean(error)}\r\n                className={clsx('rich-text-input-label', {\r\n                  'rich-text-input-label-focused': controlsVisible,\r\n                })}\r\n                variant=\"filled\"\r\n              >\r\n                {label}\r\n              </InputLabel>\r\n            )}\r\n          </>\r\n        )}\r\n\r\n        <RichTextEditor\r\n          info={info}\r\n          setControlsVisible={setControlsVisible}\r\n          labelOnTop={labelOnTop}\r\n          {...props}\r\n        />\r\n        {error !== undefined ||\r\n          (!!helperText && (\r\n            <FormHelperText error={Boolean(error)}>\r\n              {error || helperText}\r\n            </FormHelperText>\r\n          ))}\r\n      </FormControl>\r\n    </>\r\n  );\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { AssetIdentifier } from 'app/pages/AssetPopUp/components/Utils';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { ServiceTypeUnion } from 'enums/ServiceTypes';\r\nimport { Row } from 'react-table';\r\nimport { AssetPopUpProps } from 'app/pages/AssetPopUp/index';\r\nimport { pick } from 'lodash';\r\n\r\ninterface AssetLinkIdentifierProps {\r\n  id?: number;\r\n  serviceId?: number;\r\n  serviceType?: ServiceTypeUnion;\r\n}\r\nexport type AssetLinkProps = AssetIdentifier & {\r\n  children: React.ReactNode;\r\n  title?: string;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n};\r\n\r\nexport const AssetLink = (props: AssetLinkProps) => {\r\n  const { t } = useTranslation();\r\n  const openAsset = useOpenAssetPopUp();\r\n\r\n  const open = () => {\r\n    openAsset(\r\n      pick(props, 'id', 'serviceId', 'serviceType') as AssetIdentifier,\r\n      props.openPanelWithCover,\r\n    );\r\n  };\r\n  return (\r\n    <Tooltip title={props.title ?? t(translations.ShowAssetSidePanel)}>\r\n      <MuiLink\r\n        style={{ cursor: 'pointer' }}\r\n        onClick={() => open()}\r\n        color=\"textPrimary\"\r\n      >\r\n        {props.children}\r\n      </MuiLink>\r\n    </Tooltip>\r\n  );\r\n};\r\n\r\nexport type UseOpenAssetPopUpProps = AssetIdentifier & {\r\n  useSidePanel?: boolean;\r\n};\r\nexport const useOpenAssetPopUp = () => {\r\n  const { openPanel } = useSidePanelState();\r\n\r\n  return React.useCallback(\r\n    (\r\n      props: UseOpenAssetPopUpProps,\r\n      openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n    ) => {\r\n      const identifier = props;\r\n      if (identifier !== undefined) {\r\n        const assetPopupProps: AssetPopUpProps = {\r\n          identifier: identifier,\r\n          useSidePanel: props.useSidePanel ?? false,\r\n        };\r\n        if (!!openPanelWithCover) {\r\n          openPanelWithCover({\r\n            renderPageType: RenderPageType.AssetDetails,\r\n            renderPageProps: assetPopupProps,\r\n            expanded: false,\r\n            useSidePanel: props.useSidePanel,\r\n            isCover: props.useSidePanel,\r\n          });\r\n        } else {\r\n          openPanel({\r\n            renderPageType: RenderPageType.AssetDetails,\r\n            renderPageProps: assetPopupProps,\r\n            expanded: false,\r\n            useSidePanel: false,\r\n            isCover: false,\r\n          } as SidePanelOpenState);\r\n        }\r\n      }\r\n    },\r\n    [openPanel],\r\n  );\r\n};\r\n\r\ninterface PrimaryActionDynamicRow extends IRow {\r\n  Id?: number;\r\n  serviceId?: number;\r\n  serviceType?: ServiceTypeUnion;\r\n}\r\n\r\n//used for Dashboard tadles\r\nexport const OpenAssetPrimaryAction: PrimaryActionDynamic<PrimaryActionDynamicRow> = (\r\n  openPanel,\r\n  row,\r\n  toggle,\r\n  user,\r\n  useSidePanel,\r\n) => {\r\n  const identifier = getAssetIdentifier(row);\r\n  if (identifier === undefined) {\r\n    console.error('no asset identifier found for row ', row);\r\n  } else {\r\n    const props: AssetPopUpProps = {\r\n      identifier: identifier,\r\n      useSidePanel: useSidePanel ?? false,\r\n    };\r\n    openPanel({\r\n      renderPageType: RenderPageType.AssetDetails,\r\n      renderPageProps: props,\r\n      useSidePanel: useSidePanel,\r\n      expanded: false,\r\n      isCover: useSidePanel,\r\n    });\r\n  }\r\n};\r\nfunction getAssetIdentifier(\r\n  row: Row<PrimaryActionDynamicRow>,\r\n): AssetIdentifier | undefined {\r\n  return getAssetLinkIdentifier({\r\n    id: row.original.Id,\r\n    serviceId: row.original.serviceId,\r\n    serviceType: row.original.serviceType,\r\n  });\r\n}\r\n\r\nfunction getAssetLinkIdentifier(\r\n  row: AssetLinkIdentifierProps,\r\n): AssetIdentifier | undefined {\r\n  if (row.id !== undefined) {\r\n    return {\r\n      id: row.id,\r\n    };\r\n  } else if (row.serviceId !== undefined && row.serviceType !== undefined) {\r\n    return {\r\n      serviceId: row.serviceId,\r\n      serviceType: row.serviceType,\r\n    };\r\n  }\r\n}\r\n","export enum RestrictDurationUnitTypes {\r\n  LimitMinutes = 1,\r\n  LimitHours = 2,\r\n  LimitDays = 3,\r\n  LimitWeeks = 4,\r\n  LimitMonths = 5,\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { IViewState, ViewLengths, ViewModes, ViewTypes } from '../slice/types';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n  getPeriodTypesEntity,\r\n  getPeriodTypesEntityById,\r\n  PeriodTypes,\r\n  PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { DatesRange } from 'types/DatesRange';\r\nimport {\r\n  SchedulerDatePositionArray,\r\n  SchedulerDatePositionUnion,\r\n} from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { serializeSchedulerDate } from './formatSchedulerDateOrUndefined';\r\nimport { RestrictDurationUnitTypes } from 'enums/RestrictDurationUnitTypes';\r\nimport { isSameMonth, isSameYear } from 'date-fns';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IEquipmentWorkingHoursDto } from 'api/odata/generated/entities/IEquipmentWorkingHoursDto';\r\nimport { orderBy } from 'lodash';\r\n\r\n/**\r\n * Returns view length (day/week/etc.) for a given view mode\r\n * @param viewMode scheduler viewMode\r\n * @returns view length\r\n */\r\nexport function getViewLength(viewMode: ViewModes) {\r\n  return viewMode.split('_')[0] as ViewLengths;\r\n}\r\n\r\n/**\r\n * Returns the view type part of the viewmode e.g. week_timeline -> timeline\r\n * @param viewMode scheduler viewMode\r\n * @returns view type\r\n */\r\nexport function getViewType(viewMode: ViewModes) {\r\n  const parts = viewMode.split('_');\r\n  if (parts.length === 1) {\r\n    return 'calendar';\r\n  } else if (parts[1] === 'unit') {\r\n    return 'calendar';\r\n  } else {\r\n    return parts[1] as ViewTypes;\r\n  }\r\n}\r\n\r\n/**\r\n * Returns parsed viewMode\r\n * @param viewMode scheduler viewmode\r\n * @returns\r\n */\r\nexport function parseViewMode(viewMode: ViewModes) {\r\n  return {\r\n    viewType: getViewType(viewMode),\r\n    viewLength: getViewLength(viewMode),\r\n  };\r\n}\r\nexport function getNextViewLength(\r\n  length: ViewLengths,\r\n  customDaysEnabled?: boolean,\r\n  twoDaysEnabled?: boolean,\r\n): ViewLengths {\r\n  switch (length) {\r\n    case 'day':\r\n      return twoDaysEnabled\r\n        ? 'twodays'\r\n        : customDaysEnabled\r\n        ? 'customdays'\r\n        : 'week';\r\n    case 'twodays':\r\n      return customDaysEnabled ? 'customdays' : 'week';\r\n    case 'customdays':\r\n      return 'week';\r\n    case 'week':\r\n      return 'month';\r\n    case 'month':\r\n      return 'quarter';\r\n    case 'quarter':\r\n      return 'year';\r\n    default:\r\n      return length;\r\n  }\r\n}\r\nexport function getPrevViewLength(\r\n  length: ViewLengths,\r\n  customDaysEnabled?: boolean,\r\n  twoDaysEnabled?: boolean,\r\n): ViewLengths {\r\n  switch (length) {\r\n    case 'twodays':\r\n      return 'day';\r\n    case 'customdays':\r\n      return twoDaysEnabled ? 'twodays' : 'day';\r\n    case 'week':\r\n      return customDaysEnabled\r\n        ? 'customdays'\r\n        : twoDaysEnabled\r\n        ? 'twodays'\r\n        : 'day';\r\n    case 'month':\r\n      return 'week';\r\n    case 'quarter':\r\n      return 'month';\r\n    case 'year':\r\n      return 'quarter';\r\n    default:\r\n      return length;\r\n  }\r\n}\r\n/**\r\n * Combines view mode and view type into scheduler view mode e.g. 'weekly' & 'calendar' -> 'weekly'\r\n * @param param0 view mode and view type\r\n * @returns\r\n */\r\nexport const getSchedulerViewMode = (\r\n  viewType: 'calendar' | 'timeline',\r\n  viewlength: ViewLengths,\r\n  isMobile: boolean,\r\n): ViewModes => {\r\n  switch (viewType) {\r\n    case 'calendar':\r\n      switch (viewlength) {\r\n        case 'day':\r\n        case 'twodays':\r\n        case 'customdays':\r\n          return isMobile ? 'day' : 'day_unit';\r\n        case 'week':\r\n          return 'week';\r\n        case 'month':\r\n          return 'month';\r\n        case 'quarter':\r\n          return 'quarter';\r\n        case 'year':\r\n          return 'year';\r\n        case 'customPeriod':\r\n          return 'day_unit';\r\n        default:\r\n          assertExhaustive(viewlength);\r\n      }\r\n      break;\r\n    case 'timeline':\r\n      return `${viewlength}_${viewType}`;\r\n    default:\r\n      assertExhaustive(viewType);\r\n  }\r\n};\r\n/**\r\n * Gets the schedulr view type\r\n * @param viewType view type\r\n * @param viewlength view length\r\n * @param isMobile mobile\r\n * @returns\r\n */\r\nexport const getSchedulerViewType = (\r\n  viewType: 'calendar' | 'timeline',\r\n  viewlength: ViewLengths,\r\n  isMobile: boolean,\r\n): 'calendar' | 'unit' | 'timeline' => {\r\n  switch (viewType) {\r\n    case 'calendar':\r\n      switch (viewlength) {\r\n        case 'day':\r\n        case 'twodays':\r\n        case 'customdays':\r\n          return isMobile ? 'calendar' : 'unit';\r\n        case 'week':\r\n        case 'month':\r\n          return viewType;\r\n        case 'quarter':\r\n        case 'year':\r\n          return 'timeline';\r\n        case 'customPeriod':\r\n          return viewType === 'calendar' ? 'unit' : 'timeline';\r\n        default:\r\n          assertExhaustive(viewlength);\r\n      }\r\n      break;\r\n    case 'timeline':\r\n      return viewType;\r\n    default:\r\n      assertExhaustive(viewType);\r\n  }\r\n};\r\n/**\r\n * Gets the start of the displayed period\r\n * @param viewLength view length\r\n * @param datets date\r\n * @returns start of the period\r\n */\r\nexport const getViewStartDate = (\r\n  viewLength: ViewLengths,\r\n  datets?: Timestamp,\r\n  customStart?: boolean,\r\n) => {\r\n  const date = datets === undefined ? undefined : dateUtils.parseISO(datets);\r\n  if (date === undefined) {\r\n    return undefined;\r\n  }\r\n\r\n  switch (viewLength) {\r\n    case 'day':\r\n    case 'twodays':\r\n    case 'customdays':\r\n      return dateUtils.startOfDay(date);\r\n    case 'week':\r\n      return customStart\r\n        ? dateUtils.startOfDay(date)\r\n        : dateUtils.startOfWeek(date);\r\n    case 'month':\r\n      return customStart\r\n        ? dateUtils.startOfDay(date)\r\n        : dateUtils.startOfMonth(date);\r\n    case 'quarter':\r\n      return customStart\r\n        ? dateUtils.startOfDay(date)\r\n        : dateUtils.startOfQuarter(date);\r\n    case 'year':\r\n      return customStart\r\n        ? dateUtils.startOfDay(date)\r\n        : dateUtils.startOfYear(date);\r\n  }\r\n};\r\n/**\r\n * Gets the view end date\r\n * @param viewLength\r\n * @param datets\r\n * @returns\r\n */\r\nexport const getViewEndDate = (\r\n  viewLength: ViewLengths,\r\n  datets?: Timestamp,\r\n  days?: number,\r\n  customStart?: boolean,\r\n) => {\r\n  const date = datets === undefined ? undefined : dateUtils.parseISO(datets);\r\n  if (date === undefined) {\r\n    return undefined;\r\n  }\r\n  switch (viewLength) {\r\n    case 'day':\r\n      return dateUtils.endOfDay(date);\r\n    case 'twodays':\r\n      return dateUtils.addDays(dateUtils.endOfDay(date), 1);\r\n    case 'customdays':\r\n      return dateUtils.addDays(dateUtils.endOfDay(date), !!days ? days - 1 : 2);\r\n    case 'week':\r\n      return customStart\r\n        ? dateUtils.addDays(dateUtils.startOfDay(date), 6)\r\n        : dateUtils.endOfWeek(date);\r\n    case 'month':\r\n      return customStart\r\n        ? dateUtils.addMonths(date, 1)\r\n        : dateUtils.endOfMonth(date);\r\n    case 'quarter':\r\n      return customStart\r\n        ? dateUtils.addQuarters(date, 1)\r\n        : dateUtils.endOfQuarter(date);\r\n    case 'year':\r\n      return customStart\r\n        ? dateUtils.addYears(date, 1)\r\n        : dateUtils.endOfYear(date);\r\n  }\r\n};\r\n/**\r\n * Returns a display label for the dates period display\r\n * @param viewLength view length\r\n * @param date view date\r\n * @returns display label\r\n */\r\nexport const getPeriodDisplayLabel = (\r\n  viewLength: ViewLengths,\r\n  date: Timestamp,\r\n  compact: boolean,\r\n  customDays?: number,\r\n  customStart?: boolean,\r\n) => {\r\n  const start = getViewStartDate(viewLength, date, customStart);\r\n  const end = getViewEndDate(viewLength, date, customDays, customStart);\r\n  if (start === undefined || end === undefined) {\r\n    return undefined;\r\n  }\r\n  switch (viewLength) {\r\n    case 'year':\r\n      return `${dateUtils.format(start, 'yyyy')}`;\r\n    case 'quarter':\r\n      if (isSameYear(start, end)) {\r\n        return `${dateUtils.format(start, 'MMM')} - ${dateUtils.format(\r\n          end,\r\n          'MMM yyyy',\r\n        )}`;\r\n      } else {\r\n        return `${dateUtils.format(start, 'MMM yyyy')} - ${dateUtils.format(\r\n          end,\r\n          'MMM yyyy',\r\n        )}`;\r\n      }\r\n    case 'month':\r\n      if (isSameYear(start, end)) {\r\n        if (isSameMonth(start, end)) {\r\n          return dateUtils.format(date, 'MMM');\r\n        } else {\r\n          return `${dateUtils.format(start, 'MMM dd')} - ${dateUtils.format(\r\n            end,\r\n            'MMM dd yyyy',\r\n          )}`;\r\n        }\r\n      } else {\r\n        return `${dateUtils.format(start, 'MMM dd yyyy')} - ${dateUtils.format(\r\n          end,\r\n          'MMM dd yyyy',\r\n        )}`;\r\n      }\r\n    case 'day':\r\n      return dateUtils.format(date, compact ? 'MMM dd' : 'MMM dd, yyyy');\r\n    case 'week':\r\n      if (isSameMonth(start, end)) {\r\n        return `${dateUtils.format(start, 'MMM dd')} - ${dateUtils.format(\r\n          end,\r\n          'dd',\r\n        )}`;\r\n      } else {\r\n        return `${dateUtils.format(start, 'MMM dd')} - ${dateUtils.format(\r\n          end,\r\n          'MMM dd',\r\n        )}`;\r\n      }\r\n    case 'twodays':\r\n    case 'customdays':\r\n    case 'customPeriod':\r\n      return `${dateUtils.format(\r\n        start,\r\n        compact ? 'MMM dd' : 'MMM dd, yyyy',\r\n      )} - ${dateUtils.format(end, compact ? 'dd' : 'MMM dd')}`;\r\n    default:\r\n      assertExhaustive(viewLength);\r\n  }\r\n};\r\n\r\nexport const periodTypeToLengthType = (\r\n  periodType: PeriodTypes,\r\n): ViewLengths | undefined => {\r\n  switch (periodType) {\r\n    case 'Today':\r\n    case 'Yesterday':\r\n    case 'Tomorrow':\r\n      return 'day';\r\n    case 'TodayTomorrow':\r\n      return 'twodays';\r\n    case 'ThisWeek':\r\n    case 'LastWeek':\r\n    case 'NextWeek':\r\n      return 'week';\r\n    case 'LastMonth':\r\n    case 'ThisMonth':\r\n    case 'NextMonth':\r\n      return 'month';\r\n    case 'LastQuarter':\r\n    case 'ThisQuarter':\r\n    case 'NextQuarter':\r\n      return 'quarter';\r\n    case 'LastYear':\r\n    case 'ThisYear':\r\n    case 'NextYear':\r\n      return 'year';\r\n    default:\r\n      return undefined;\r\n  }\r\n};\r\nexport const lengthTypeToPeriodType = (\r\n  lengthType: ViewLengths,\r\n): PeriodTypes | undefined => {\r\n  switch (lengthType) {\r\n    case 'day':\r\n      return 'Today';\r\n    case 'twodays':\r\n      return 'TodayTomorrow';\r\n    case 'week':\r\n      return 'ThisWeek';\r\n    case 'month':\r\n      return 'ThisMonth';\r\n    case 'customdays':\r\n      return 'CustomDate';\r\n    case 'quarter':\r\n      return 'ThisQuarter';\r\n    case 'year':\r\n      return 'ThisYear';\r\n    default:\r\n      return undefined;\r\n  }\r\n};\r\nexport const viewStateFromFilter = (\r\n  periodType: PeriodTypesEntity | SchedulerDatePositionUnion,\r\n): Pick<IViewState, 'preset' | 'viewLength' | 'date'> | undefined => {\r\n  const periodTypeUnion =\r\n    (periodType as PeriodTypesEntity)?.Id ??\r\n    (periodType as SchedulerDatePositionUnion);\r\n  const schedulerPreset:\r\n    | SchedulerDatePositionUnion\r\n    | undefined = SchedulerDatePositionArray.find(\r\n    f => f.toLowerCase() === periodTypeUnion.toLowerCase(),\r\n  );\r\n  if (schedulerPreset === undefined) {\r\n    return undefined;\r\n  }\r\n  const x = DatesRange.fromPreset(\r\n    { Id: schedulerPreset as PeriodTypes, Name: '' },\r\n    null,\r\n    null,\r\n  );\r\n\r\n  if (x.start === null) {\r\n    return undefined;\r\n  }\r\n  const length = periodTypeToLengthType(periodTypeUnion);\r\n  if (length === undefined) {\r\n    return undefined;\r\n  }\r\n\r\n  return {\r\n    preset: schedulerPreset,\r\n    viewLength: length,\r\n    date: serializeSchedulerDate(x.start),\r\n  };\r\n};\r\nexport const getPeriodFromViewLength = (\r\n  length: ViewLengths,\r\n  date: Date,\r\n  customDays?: number,\r\n) => {\r\n  let value = Object.assign(\r\n    new PresetDatesRange(),\r\n    {\r\n      type:\r\n        (getPeriodTypesEntityById(\r\n          lengthTypeToPeriodType(length),\r\n        ) as PeriodTypesEntity) ??\r\n        (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n    },\r\n    DatesRange.fromPreset(\r\n      (getPeriodTypesEntityById(\r\n        lengthTypeToPeriodType(length),\r\n      ) as PeriodTypesEntity) ??\r\n        (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n      length === 'customdays' ? date : date,\r\n      length === 'customdays'\r\n        ? dateUtils.addDays(date, (customDays ?? 3) - 1)\r\n        : dateUtils.parseISO(date),\r\n    ),\r\n  );\r\n  return value;\r\n};\r\nexport function timelineColumnWidth(isMobile: boolean) {\r\n  return isMobile ? 100 : 300;\r\n}\r\nexport const MatchUnitSlotToEnd = (\r\n  startTime: Timestamp,\r\n  endTime: Timestamp,\r\n  unitType: RestrictDurationUnitTypes,\r\n  amount: number,\r\n) => {\r\n  const start = dateUtils.parseISO(startTime);\r\n  const end = dateUtils.parseISO(endTime);\r\n  let dateSt = start;\r\n  let slotLength = 0;\r\n  let lastCorrectEnd = new Date();\r\n  let diffDuration = amount;\r\n  switch (unitType) {\r\n    case RestrictDurationUnitTypes.LimitMinutes:\r\n      while (dateSt < end) {\r\n        dateSt = dateUtils.addMinutes(dateSt, amount);\r\n        slotLength++;\r\n      }\r\n      lastCorrectEnd = dateUtils.addMinutes(dateSt, -amount);\r\n      diffDuration = dateUtils.getMinutesDiff(end, dateSt);\r\n      let newMinutesEnd =\r\n        slotLength > 1\r\n          ? diffDuration <= amount / 2\r\n            ? dateSt\r\n            : lastCorrectEnd\r\n          : dateSt;\r\n      return newMinutesEnd;\r\n    case RestrictDurationUnitTypes.LimitHours:\r\n      while (dateSt < end) {\r\n        dateSt = dateUtils.addHours(dateSt, amount);\r\n        slotLength++;\r\n      }\r\n      lastCorrectEnd = dateUtils.addHours(dateSt, -amount);\r\n      diffDuration = dateUtils.getHoursDiff(end, dateSt);\r\n      let newHoursEnd =\r\n        slotLength > 1\r\n          ? diffDuration <= amount / 2\r\n            ? dateSt\r\n            : lastCorrectEnd\r\n          : dateSt;\r\n      return newHoursEnd;\r\n    case RestrictDurationUnitTypes.LimitDays:\r\n      while (dateSt < end) {\r\n        dateSt = dateUtils.addDays(dateSt, amount);\r\n        slotLength++;\r\n      }\r\n      lastCorrectEnd = dateUtils.addDays(dateSt, -amount);\r\n      diffDuration = dateUtils.getDaysDiff(end, dateSt);\r\n      let newDaysEnd =\r\n        slotLength > 1\r\n          ? diffDuration <= amount / 2\r\n            ? dateSt\r\n            : lastCorrectEnd\r\n          : dateSt;\r\n      return newDaysEnd;\r\n    case RestrictDurationUnitTypes.LimitWeeks:\r\n      while (dateSt < end) {\r\n        dateSt = dateUtils.addWeeks(dateSt, amount);\r\n        slotLength++;\r\n      }\r\n      lastCorrectEnd = dateUtils.addWeeks(dateSt, -amount);\r\n      diffDuration = dateUtils.differenceInWeeks(end, dateSt);\r\n      let newWeekEnd =\r\n        slotLength > 1\r\n          ? diffDuration <= amount / 2\r\n            ? dateSt\r\n            : lastCorrectEnd\r\n          : dateSt;\r\n      return newWeekEnd;\r\n    case RestrictDurationUnitTypes.LimitMonths:\r\n      while (dateSt < end) {\r\n        dateSt = dateUtils.addMonths(dateSt, amount);\r\n        slotLength++;\r\n      }\r\n      lastCorrectEnd = dateUtils.addMonths(dateSt, -amount);\r\n      diffDuration = dateUtils.getMonthDiff(end, dateSt);\r\n      let newMonthEnd =\r\n        slotLength > 1\r\n          ? diffDuration <= amount / 2\r\n            ? dateSt\r\n            : lastCorrectEnd\r\n          : dateSt;\r\n      return newMonthEnd;\r\n  }\r\n};\r\nexport const fix_date = (date: Timestamp, duration: number) => {\r\n  let start = dateUtils.parseISO(date);\r\n  return dateUtils.addHours(start, duration);\r\n};\r\nexport function adjustToTimeSlot(\r\n  startTime: Date,\r\n  endTime: Date,\r\n  workingHours: Array<IEquipmentWorkingHoursDto>,\r\n  minDuration?: number,\r\n) {\r\n  let result = {\r\n    start: startTime,\r\n    end: endTime,\r\n  };\r\n  if (workingHours.length > 0) {\r\n    // let correctEnd = endTime > correctStart ? endTime : correctStart;\r\n    let weekStartDay = dateUtils.getDay(startTime);\r\n    let slots = workingHours.map(f => {\r\n      return {\r\n        StartTime: dateUtils.dateFnsUtils.mergeDateAndTime(\r\n          startTime,\r\n          dateUtils.parseISO(f.StartTime),\r\n        ),\r\n        EndTime: dateUtils.dateFnsUtils.mergeDateAndTime(\r\n          endTime,\r\n          dateUtils.parseISO(f.EndTime),\r\n        ),\r\n        DayOfWeek: f.DayOfWeek,\r\n      };\r\n    });\r\n    // .filter(f => f.StartTime < correctEnd && f.EndTime > startTime);\r\n    let startSlots = slots.filter(\r\n      s => s.DayOfWeek === weekStartDay && s.StartTime <= startTime,\r\n    );\r\n    if (startSlots.length > 0) {\r\n      let startOrdered = orderBy(startSlots, f => f.StartTime, 'desc');\r\n      result.start = startOrdered[0].StartTime;\r\n    }\r\n    let correctEnd =\r\n      !!minDuration &&\r\n      minDuration > 0 &&\r\n      dateUtils.differenceInMinutes(endTime, result.start) < minDuration\r\n        ? dateUtils.addMinutes(result.start, minDuration)\r\n        : endTime;\r\n    let weekEndDay = dateUtils.getDay(correctEnd);\r\n    let endSlots = slots.filter(\r\n      s => s.DayOfWeek === weekEndDay && s.EndTime >= correctEnd,\r\n    );\r\n    if (endSlots.length > 0) {\r\n      let endOrdered = orderBy(endSlots, f => f.EndTime, 'asc');\r\n      result.end = endOrdered[0].EndTime;\r\n    }\r\n    return result;\r\n  } else {\r\n    return result;\r\n  }\r\n}\r\n","import * as React from 'react';\r\nimport { CircularProgress } from '@material-ui/core';\r\n\r\nexport interface ProgressProps {\r\n  inProgress: boolean;\r\n  size: number;\r\n}\r\nexport function Progress({ inProgress, size }: ProgressProps) {\r\n  return (\r\n    <React.Fragment>\r\n      {inProgress ? (\r\n        <CircularProgress\r\n          color=\"inherit\"\r\n          size={size}\r\n          style={{\r\n            position: 'absolute',\r\n            top: '50%',\r\n            left: '50%',\r\n            zIndex: 1,\r\n            marginTop: -size / 2,\r\n            marginLeft: -size / 2,\r\n          }}\r\n        />\r\n      ) : null}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { PricingState } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { isEmptyOrWhitespace, isNullOrUndefined } from 'utils/typeUtils';\r\n\r\n/* --- STATE --- */\r\n\r\nexport interface OfflineServiceState {\r\n  detailsState: AsyncDataState<OtherServiceDetailsState>;\r\n  connectedDataState: IConnectedFiltersDto;\r\n  processing: boolean;\r\n  consumablesProcessing: boolean;\r\n  valueHandler?: FieldHandlerProps<OtherServiceDetailsState>;\r\n  serviceChangeResultState?: OfflineServiceTypeChangeResult;\r\n  creditState: AsyncDataState<PricingState>;\r\n  hasCharges?: boolean;\r\n  savedReservationService?: IOtherServices;\r\n  consumablesState: AsyncDataState<ReportConsumablesState>;\r\n  consumablesValueHandler?: FieldHandlerProps<ReportConsumablesState>;\r\n  selectedServiceTypes: Array<number>;\r\n  editCreatableService?: IOtherServices;\r\n  barcodeScanned?: boolean;\r\n  refeshOfflineServices?: boolean;\r\n  stockRenewalState: AsyncDataState<StockRenewalState>;\r\n  stockRenewalValueHandler?: FieldHandlerProps<StockRenewalState>;\r\n  renewStockState: AsyncDataState<RenewStockState>;\r\n  renewStockValueHandler?: FieldHandlerProps<RenewStockState>;\r\n  inventoryBatchState: AsyncDataState<InventoryBatchState>;\r\n  inventoryBatchValueHandler?: FieldHandlerProps<InventoryBatchState>;\r\n  inventoryBatchEditable?: IInventoryBatchDto;\r\n  isEdit?: boolean;\r\n  batchIsEdit?: boolean;\r\n  getCreatableService?: IOtherServices;\r\n}\r\nexport interface OfflineServiceQueryStringParameters {\r\n  id?: string;\r\n  ipid?: string;\r\n  user?: string;\r\n  bid?: string;\r\n  be?: string;\r\n  ecid?: string;\r\n  po?: string;\r\n  reference?: string;\r\n  remarks?: string;\r\n  factor?: string;\r\n  amount?: string;\r\n  adg?: string;\r\n  stid?: string;\r\n  ReservationId?: string;\r\n  UsageId?: string;\r\n  servicedate?: string;\r\n  batchId?: string;\r\n}\r\nexport interface StockRenewalParams {\r\n  stid?: string;\r\n  servicedate?: string;\r\n}\r\nexport interface RenewStockParams {\r\n  id?: string;\r\n  stid?: string;\r\n  servicedate?: string;\r\n  remarks?: string;\r\n  amount?: string;\r\n  batchId?: string;\r\n}\r\nexport interface InventoryBatchParams {\r\n  id?: string;\r\n  name?: string;\r\n  stid?: string;\r\n  purchasedate?: string;\r\n  lot?: string;\r\n  inventory?: string;\r\n}\r\nexport interface OtherServiceDetailsState {\r\n  Id: number;\r\n  ServiceType: IOfflineServiceFilterDto | null;\r\n  DiscountFactor?: number | null;\r\n  Quantity?: number | null;\r\n  ReservationId?: number | null;\r\n  UsageId?: number | null;\r\n  Remarks?: string | null;\r\n  SyncReservation?: boolean | null;\r\n  SyncUsage?: boolean | null;\r\n  InventoryBatch?: IInventoryBatchDto | null;\r\n\r\n  // ServiceDate: Date | string;\r\n  // BookedBy: Entity<string> | null;\r\n  // UserGroup: Entity<string> | null;\r\n  // Budget: Entity<number> | null;\r\n  // InstituteProject: Entity<number> | null;\r\n  // ExternalCustomer?: Entity<number> | null;\r\n  // FundingType?: Entity<number> | null;\r\n  // PurchaseOrder?: string | null;\r\n  // Reference?: string | null;\r\n  // BudgetExperiment?: Entity<number> | null;\r\n}\r\nexport interface ReportConsumablesState {\r\n  Services: IOtherServices[];\r\n}\r\nexport interface RenewStockState {\r\n  Id: number;\r\n  ServiceType: IOfflineServiceFilterDto | null;\r\n  DateReceived: Date | string;\r\n  InventoryBatch?: IInventoryBatchDto | null;\r\n  Quantity?: number | null;\r\n  Remarks?: string | null;\r\n}\r\nexport interface InventoryBatchState {\r\n  Id: number;\r\n  Name: string;\r\n  ServiceType: IOfflineServiceFilterDto | null;\r\n  PurchaseDate?: Date | string | null;\r\n  ExpirationDate?: Date | string | null;\r\n  Inventory: number;\r\n  Lot?: string | null;\r\n  PurchasePricePerUnit: number | null;\r\n}\r\nexport interface StockRenewalState {\r\n  Services: IOtherServices[];\r\n  DateReceived: Date | string;\r\n  AutoGenerateNewBatches?: boolean | null;\r\n}\r\nexport interface OfflineServicesResponse extends IResponseType {\r\n  Id: number | null;\r\n  data: IOtherServices | null;\r\n  serviceType: Entity<number>;\r\n  IsValid: boolean;\r\n}\r\nexport interface InventoryBatchResponse extends IResponseType {\r\n  Id: number | null;\r\n  data: IInventoryBatchDto | null;\r\n  serviceType: Entity<number>;\r\n  IsValid: boolean;\r\n}\r\nexport interface ConsumableServicesResponse extends IResponseType {\r\n  Id: number[];\r\n  data: IOtherServices[];\r\n  IsValid: boolean;\r\n}\r\n\r\nexport interface ServiceChangeStateParameters {\r\n  ServiceTypes: number[];\r\n  ReservationId: number | null;\r\n  UsageId: number | null;\r\n  Start: Date | string;\r\n  BookedBy: string | null;\r\n  ADGroup: string | null;\r\n  BudgetId: number | null;\r\n  FundingTypeId: number;\r\n}\r\nexport interface ErrorServices {\r\n  id: number;\r\n  error?: string;\r\n}\r\nexport interface OfflineServiceTypeChangeResult {\r\n  ErrorMessages: string[];\r\n  DefaultBudget: IBudgetFilterDto | null;\r\n  DefaultExperiment: IBudgetExperimentsFilterDto | null;\r\n}\r\nexport const ConvertDtoToModel = (\r\n  service: IOtherServices,\r\n  serviceType: IOfflineServiceFilterDto | null,\r\n): OtherServiceDetailsState => {\r\n  let model = {\r\n    Id: service.Id,\r\n    ServiceType: serviceType,\r\n    ServiceTypeId: ServiceType.Offline,\r\n    DiscountFactor: service.DiscountFactor,\r\n    Quantity: service.Quantity ?? service.DefaultQuantity,\r\n    Remarks: service.Remarks,\r\n    ReservationId: service.ReservationId,\r\n    UsageId: service.UsageId,\r\n    InventoryBatch:\r\n      service.InventoryBatchId === null\r\n        ? null\r\n        : ({\r\n            Id: service.InventoryBatchId,\r\n            Name: service.InventoryBatchName,\r\n            Inventory: service.InventoryBatchAmount,\r\n          } as IInventoryBatchDto),\r\n  } as OtherServiceDetailsState;\r\n  return model;\r\n};\r\nexport const ConvertConsumablesToModel = (\r\n  services: IOtherServices[],\r\n): ReportConsumablesState => {\r\n  return {\r\n    Services: services,\r\n    DiscountFactor: 1,\r\n    Remarks: null,\r\n  } as ReportConsumablesState;\r\n};\r\nexport const ConvertConsumablesToRenewalModel = (\r\n  services: IOtherServices[],\r\n  date: Date | string,\r\n): StockRenewalState => {\r\n  return {\r\n    Services: services,\r\n    DateReceived: dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n    AutoGenerateNewBatches: true,\r\n  } as StockRenewalState;\r\n};\r\nexport const ConvertRenewStockToModel = (\r\n  service: IOtherServices,\r\n  serviceType: IOfflineServiceFilterDto | null,\r\n): RenewStockState => {\r\n  let model = {\r\n    Id: service.Id,\r\n    ServiceType: serviceType,\r\n    // service.ServiceTypeID > 0\r\n    //   ? ({\r\n    //       Id: service.ServiceTypeID,\r\n    //       Name: service.ServiceType,\r\n    //       Active: true,\r\n    //       AllowToUser: service.AllowToUser,\r\n    //       DefaultQuantity: service.DefaultQuantity,\r\n    //       HideProjects: service.HideProjects,\r\n    //       IntQuantityOnly: service.IntQuantityOnly,\r\n    //       Inventory: service.Inventory,\r\n    //       ReservationOverlappingInventory:\r\n    //         service.ReservationOverlappingInventory,\r\n    //       ServiceGroupId: service.ServiceGroupId,\r\n    //       ServiceTypeId: 2,\r\n    //       StaffOnly: service.StaffOnly,\r\n    //       UnitTypeID: service.UnitTypeId,\r\n    //       UnitTypeName: service.Units,\r\n    //       NotLessThanZero: service.NotLessThanZero,\r\n    //       TrackInventory: service.TrackInventory,\r\n    //       InventoryBatchesEnabled: service.InventoryBatchesEnabled,\r\n    //     } as IOfflineServiceFilterDto)\r\n    //   : null,\r\n    Quantity: service.Quantity ?? service.DefaultQuantity,\r\n    Remarks: service.Remarks,\r\n    InventoryBatch:\r\n      service.InventoryBatchId === null\r\n        ? null\r\n        : ({\r\n            Id: service.InventoryBatchId,\r\n            Name: service.InventoryBatchName,\r\n            Inventory: service.InventoryBatchAmount,\r\n          } as IInventoryBatchDto),\r\n    DateReceived: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(service.ServiceDate),\r\n    ),\r\n  } as RenewStockState;\r\n  return model;\r\n};\r\nexport const ConvertInventoryBatchToModel = (\r\n  batch: IInventoryBatchDto,\r\n  serviceType: IOfflineServiceFilterDto | null,\r\n  newDate: Date | string,\r\n): InventoryBatchState => {\r\n  let model = {\r\n    Id: batch.Id,\r\n    ServiceType: serviceType,\r\n    Inventory: batch.Inventory,\r\n    Name: batch.Name,\r\n    PurchasePricePerUnit: batch.PurchasePricePerUnit,\r\n    ExpirationDate: batch.ExpirationDate,\r\n    Lot: batch.Lot,\r\n    PurchaseDate: dateUtils.formatQueryStringDate(\r\n      dateUtils.dateOrStringToDate(batch.PurchaseDate || newDate),\r\n    ),\r\n  } as InventoryBatchState;\r\n  return model;\r\n};\r\nexport const ConvertDtoToConnectedModel = (\r\n  service: IOtherServices,\r\n): IConnectedFiltersDto => {\r\n  let model = {\r\n    User: toEntity(service.BookedBy, service.UserDisplayName),\r\n    UserGroup: toEntity(service.UserGroup, service.UserGroupName),\r\n    Budget: toEntity(service.BudgetID, service.Budget),\r\n    InstituteProject: toEntity(\r\n      service.InstituteProjectId,\r\n      service.InstituteProjectName,\r\n    ),\r\n    StartTime: dateUtils.formatQueryStringDate(\r\n      dateUtils.dateOrStringToDate(service.ServiceDate),\r\n    ),\r\n    BudgetExperiment: toEntity(\r\n      service.BudgetExperimentId,\r\n      service.BudgetExperimentName,\r\n    ),\r\n    ExternalCustomer: toEntity(\r\n      service.ExternalCustomerId,\r\n      service.ExternalCustomerName,\r\n    ),\r\n    FundingType: getSingleInvoiceFundingType(service.FundingType ?? 0),\r\n    PurchaseOrder: service.PurchaseOrder,\r\n    Reference: service.Reference,\r\n  } as IConnectedFiltersDto;\r\n  return model;\r\n};\r\nexport const ConvertModelToInsertEntity = (\r\n  model: OtherServiceDetailsState,\r\n  connectedModel: IConnectedFiltersDto,\r\n) => {\r\n  let data = {\r\n    Id: model.Id,\r\n    BudgetID: connectedModel.Budget?.Id || null,\r\n    Budget: connectedModel.Budget?.Name,\r\n    UserGroup: connectedModel.UserGroup?.Id || null,\r\n    UserGroupName: connectedModel.UserGroup?.Name,\r\n    BookedBy: connectedModel.User?.Id,\r\n    UserDisplayName: connectedModel.User?.Name,\r\n    ServiceTypeID: model.ServiceType?.Id,\r\n    ServiceType: model.ServiceType?.Name,\r\n    ServiceDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(connectedModel.StartTime),\r\n    ),\r\n    Quantity: +(model.Quantity ?? 0).toString(),\r\n    DiscountFactor: Number(model.DiscountFactor ?? 1),\r\n    Remarks: model.Remarks,\r\n    FundingType: connectedModel.FundingType?.Id,\r\n    BudgetExperimentId: connectedModel.BudgetExperiment?.Id,\r\n    BudgetExperimentName: connectedModel.BudgetExperiment?.Name,\r\n    ReservationId: model.ReservationId,\r\n    UsageId: model.UsageId,\r\n    ExternalCustomerId: connectedModel.ExternalCustomer?.Id,\r\n    ExternalCustomerName: connectedModel.ExternalCustomer?.Name,\r\n    SyncReservation: false,\r\n    SyncUsage: false,\r\n    StaffOnly: model.ServiceType?.StaffOnly || false,\r\n    InstituteProjectId: connectedModel.InstituteProject?.Id,\r\n    InstituteProjectName: connectedModel.InstituteProject?.Name,\r\n    PurchaseOrder: connectedModel.PurchaseOrder,\r\n    Reference: connectedModel.Reference,\r\n    BudgetsTurnedOn: model.ServiceType?.BudgetsTurnedOn,\r\n    DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n    HideProjects: model.ServiceType?.HideProjects,\r\n    IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n    ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n    AllowToUser: model.ServiceType?.AllowToUser,\r\n    UnitTypeId: model.ServiceType?.UnitTypeID,\r\n    Units: model.ServiceType?.UnitTypeName,\r\n    TrackInventory: model.ServiceType?.TrackInventory,\r\n    InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n    InventoryBatchId: model.InventoryBatch?.Id,\r\n    InventoryBatchName: model.InventoryBatch?.Name,\r\n    InventoryBatchAmount: model.InventoryBatch?.Inventory,\r\n    NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n  } as IOtherServices;\r\n  return data;\r\n};\r\nexport const ConvertModelToUpdateEntity = (\r\n  model: OtherServiceDetailsState,\r\n  original: OtherServiceDetailsState,\r\n  connectedModel: IConnectedFiltersDto,\r\n) => {\r\n  let data = {\r\n    Id: original.Id,\r\n    BudgetID: connectedModel.Budget?.Id || null,\r\n    Budget: connectedModel.Budget?.Name,\r\n    UserGroup: connectedModel.UserGroup?.Id || null,\r\n    UserGroupName: connectedModel.UserGroup?.Name,\r\n    BookedBy: connectedModel.User?.Id,\r\n    UserDisplayName: connectedModel.User?.Name,\r\n    ServiceTypeID: model.ServiceType?.Id,\r\n    ServiceType: model.ServiceType?.Name,\r\n    ServiceDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(connectedModel.StartTime),\r\n    ),\r\n    Quantity: +(model.Quantity ?? 0).toString(),\r\n    DiscountFactor: Number(model.DiscountFactor ?? 1),\r\n    Remarks: model.Remarks,\r\n    FundingType: connectedModel.FundingType?.Id,\r\n    BudgetExperimentId: connectedModel.BudgetExperiment?.Id,\r\n    BudgetExperimentName: connectedModel.BudgetExperiment?.Name,\r\n    ReservationId: model.ReservationId,\r\n    UsageId: model.UsageId,\r\n    ExternalCustomerId: connectedModel.ExternalCustomer?.Id,\r\n    ExternalCustomerName: connectedModel.ExternalCustomer?.Name,\r\n    SyncReservation: false,\r\n    SyncUsage: false,\r\n    StaffOnly: model.ServiceType?.StaffOnly || false,\r\n    InstituteProjectId: connectedModel.InstituteProject?.Id,\r\n    InstituteProjectName: connectedModel.InstituteProject?.Name,\r\n    PurchaseOrder: connectedModel.PurchaseOrder,\r\n    Reference: connectedModel.Reference,\r\n    BudgetsTurnedOn: model.ServiceType?.BudgetsTurnedOn,\r\n    DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n    HideProjects: model.ServiceType?.HideProjects,\r\n    IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n    ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n    AllowToUser: model.ServiceType?.AllowToUser,\r\n    UnitTypeId: model.ServiceType?.UnitTypeID,\r\n    Units: model.ServiceType?.UnitTypeName,\r\n    TrackInventory: model.ServiceType?.TrackInventory,\r\n    InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n    InventoryBatchId: model.InventoryBatch?.Id,\r\n    InventoryBatchName: model.InventoryBatch?.Name,\r\n    InventoryBatchAmount: model.InventoryBatch?.Inventory,\r\n    NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n  } as IOtherServices;\r\n  return data;\r\n};\r\nexport const ConvertModelToUpdateRenewStockEntity = (\r\n  model: RenewStockState,\r\n  original: RenewStockState,\r\n  autoGenerateBatch?: boolean,\r\n) => {\r\n  let data = {\r\n    Id: original.Id,\r\n    ServiceTypeID: model.ServiceType?.Id,\r\n    ServiceType: model.ServiceType?.Name,\r\n    ServiceDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(model.DateReceived),\r\n    ),\r\n    Quantity: +(model.Quantity ?? 0).toString(),\r\n    Remarks: model.Remarks,\r\n    DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n    IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n    ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n    InventoryBatchId: model.InventoryBatch?.Id,\r\n    InventoryBatchName: model.InventoryBatch?.Name,\r\n    InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n    RenewStockInventory: true,\r\n    TrackInventory: model.ServiceType?.TrackInventory,\r\n    NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n    AutoGenerateNewBatches: autoGenerateBatch,\r\n  } as IOtherServices;\r\n  return data;\r\n};\r\nexport const getDefaultService = (\r\n  user: AuthenticatedUser | undefined,\r\n  date: Date | string,\r\n) => {\r\n  return {\r\n    Id: 0,\r\n    BookedBy: user?.Id,\r\n    UserDisplayName: user?.Name,\r\n    BudgetID: null,\r\n    Budget: null,\r\n    BudgetExperimentId: null,\r\n    BudgetExperimentName: null,\r\n    AllowToUser: true,\r\n    DiscountFactor: 1,\r\n    Quantity: null,\r\n    DefaultQuantity: null,\r\n    ExternalCustomerId: null,\r\n    ExternalCustomerName: null,\r\n    FundingType: 0,\r\n    HideProjects: false,\r\n    InstituteProjectId: null,\r\n    InstituteProjectName: null,\r\n    IntQuantityOnly: true,\r\n    Mandatory: false,\r\n    Remarks: null,\r\n    ReservationId: null,\r\n    ServiceDate: date,\r\n    ServiceTypeID: 0,\r\n    ServiceType: null,\r\n    ServiceGroupId: 0,\r\n    Units: null,\r\n    UnitTypeId: null,\r\n    UserGroup: null,\r\n    UserGroupName: null,\r\n    StaffOnly: false,\r\n    Reference: null,\r\n    PurchaseOrder: null,\r\n    UsageId: null,\r\n    HasCharges: false,\r\n    TrackInventory: false,\r\n    InventoryBatchesEnabled: false,\r\n    NotLessThanZero: true,\r\n    ReservationOverlappingInventory: null,\r\n    BudgetsTurnedOn: false,\r\n    InventoryBatchId: null,\r\n    InventoryBatchName: null,\r\n    ServiceGroup: null,\r\n  } as IOtherServices;\r\n};\r\nexport const getDefaultBatch = (date: Date | string) => {\r\n  return {\r\n    Id: 0,\r\n    Name: dateUtils.shortDateFormat(date) ?? '',\r\n    ExpirationDate: null,\r\n    Inventory: 0,\r\n    Lot: null,\r\n    OfflineServiceTypeId: 0,\r\n    OfflineServiceTypeName: '',\r\n    PurchaseDate: date,\r\n    PurchasePricePerUnit: null,\r\n  } as IInventoryBatchDto;\r\n};\r\nexport const ConvertConsumablesToInsertEntity = (\r\n  services: IOtherServices[],\r\n  connectedModel: IConnectedFiltersDto,\r\n  discountFactor?: number | null,\r\n  remarks?: string | null,\r\n) => {\r\n  return services.map(f => {\r\n    let savedData: IOtherServices = {\r\n      Id: f.Id,\r\n      BudgetID: connectedModel.Budget?.Id || null,\r\n      Budget: connectedModel.Budget?.Name ?? null,\r\n      UserGroup: connectedModel.UserGroup?.Id || null,\r\n      UserGroupName: connectedModel.UserGroup?.Name ?? null,\r\n      BookedBy: connectedModel.User?.Id ?? null,\r\n      UserDisplayName: connectedModel.User?.Name ?? null,\r\n      ServiceTypeID: f.ServiceTypeID,\r\n      ServiceType: f.ServiceType,\r\n      ServiceDate: dateUtils.formatISO(\r\n        dateUtils.dateOrStringToDate(connectedModel.StartTime),\r\n      ),\r\n      Quantity: Number(f.Quantity),\r\n      DiscountFactor: Number(f.DiscountFactor),\r\n      Remarks: f.Remarks,\r\n      FundingType: connectedModel.FundingType?.Id ?? null,\r\n      BudgetExperimentId: connectedModel.BudgetExperiment?.Id ?? null,\r\n      BudgetExperimentName: connectedModel.BudgetExperiment?.Name ?? null,\r\n      ReservationId: f.ReservationId,\r\n      UsageId: f.UsageId,\r\n      ExternalCustomerId: connectedModel.ExternalCustomer?.Id ?? null,\r\n      ExternalCustomerName: connectedModel.ExternalCustomer?.Name ?? null,\r\n      SyncReservation: false,\r\n      SyncUsage: false,\r\n      StaffOnly: f.StaffOnly || false,\r\n      InstituteProjectId: connectedModel.InstituteProject?.Id ?? null,\r\n      InstituteProjectName: connectedModel.InstituteProject?.Name ?? null,\r\n      PurchaseOrder: connectedModel.PurchaseOrder ?? null,\r\n      Reference: connectedModel.Reference ?? null,\r\n      BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n      DefaultQuantity: f.DefaultQuantity,\r\n      HideProjects: f.HideProjects,\r\n      IntQuantityOnly: f.IntQuantityOnly,\r\n      ServiceGroupId: f.ServiceGroupId,\r\n      AllowToUser: f.AllowToUser,\r\n      UnitTypeId: f.UnitTypeId,\r\n      Units: f.Units,\r\n      TrackInventory: f.TrackInventory,\r\n      InventoryBatchesEnabled: f.InventoryBatchesEnabled,\r\n      InventoryBatchId: f.InventoryBatchId,\r\n      InventoryBatchName: f.InventoryBatchName,\r\n      InventoryBatchAmount: f.InventoryBatchAmount,\r\n      NotLessThanZero: f.NotLessThanZero,\r\n      AutoGenerateNewBatches: false,\r\n      InsertedAt: null,\r\n      ServiceGroup: null,\r\n      ServiceRate: 0,\r\n      DepartmentId: null,\r\n      HasCharges: false,\r\n      InsertedBy: null,\r\n      Institute: null,\r\n      InstituteId: null,\r\n      InstituteTypeId: null,\r\n      Inventory: -1,\r\n      Mandatory: false,\r\n      RenewStockInventory: false,\r\n      ReservationOverlappingInventory: null,\r\n    };\r\n    if (!isNullOrUndefined(discountFactor)) {\r\n      let globalFactor = Number(discountFactor);\r\n      let serviceFactor = Number(f.DiscountFactor);\r\n      if (globalFactor !== serviceFactor) {\r\n        if (serviceFactor === 0 || serviceFactor === 1) {\r\n          savedData.DiscountFactor = globalFactor;\r\n        }\r\n      }\r\n    }\r\n    if (!isEmptyOrWhitespace(remarks)) {\r\n      if (isEmptyOrWhitespace(f.Remarks)) {\r\n        savedData.Remarks = remarks ?? null;\r\n      }\r\n    }\r\n\r\n    return savedData;\r\n  });\r\n};\r\nexport const ConvertRenewStockToInsertEntity = (\r\n  model: RenewStockState,\r\n  autoGenerateBatch?: boolean,\r\n) => {\r\n  let data = {\r\n    Id: model.Id,\r\n    ServiceTypeID: model.ServiceType?.Id,\r\n    ServiceType: model.ServiceType?.Name,\r\n    ServiceDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(model.DateReceived),\r\n    ),\r\n    Quantity: +(model.Quantity ?? 0).toString(),\r\n    Remarks: model.Remarks,\r\n    InventoryBatchesEnabled: model.ServiceType?.InventoryBatchesEnabled,\r\n    InventoryBatchId: model.InventoryBatch?.Id,\r\n    InventoryBatchName: model.InventoryBatch?.Name,\r\n    DefaultQuantity: model.ServiceType?.DefaultQuantity,\r\n    IntQuantityOnly: model.ServiceType?.IntQuantityOnly,\r\n    ServiceGroupId: model.ServiceType?.ServiceGroupId,\r\n    TrackInventory: model.ServiceType?.TrackInventory,\r\n    NotLessThanZero: model.ServiceType?.NotLessThanZero,\r\n    AutoGenerateNewBatches: autoGenerateBatch,\r\n    RenewStockInventory: true,\r\n  } as IOtherServices;\r\n  return data;\r\n};\r\nexport const ConvertInventoryBatchToEntity = (model: InventoryBatchState) => {\r\n  let data = {\r\n    Id: model.Id,\r\n    Name: model.Name,\r\n    OfflineServiceTypeId: model.ServiceType?.Id,\r\n    OfflineServiceTypeName: model.ServiceType?.Name,\r\n    PurchaseDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(model.PurchaseDate ?? new Date()),\r\n    ),\r\n    ExpirationDate:\r\n      model.ExpirationDate === null || model.ExpirationDate === undefined\r\n        ? null\r\n        : dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(model.ExpirationDate),\r\n          ),\r\n    Inventory: 0, //  model.Inventory,\r\n    Lot: model.Lot,\r\n    PurchasePricePerUnit: model.PurchasePricePerUnit,\r\n  } as IInventoryBatchDto;\r\n  return data;\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { offlineServiceStateActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { OtherServicesApi as api } from 'api/OtherServicesApi';\r\nimport {\r\n  ConsumableServicesResponse,\r\n  ConvertConsumablesToInsertEntity,\r\n  ConvertDtoToConnectedModel,\r\n  ConvertInventoryBatchToEntity,\r\n  ConvertModelToInsertEntity,\r\n  ConvertModelToUpdateEntity,\r\n  ConvertModelToUpdateRenewStockEntity,\r\n  ConvertRenewStockToInsertEntity,\r\n  getDefaultBatch,\r\n  getDefaultService,\r\n  InventoryBatchParams,\r\n  InventoryBatchResponse,\r\n  InventoryBatchState,\r\n  OfflineServiceQueryStringParameters,\r\n  OfflineServicesResponse,\r\n  OfflineServiceTypeChangeResult,\r\n  OtherServiceDetailsState,\r\n  RenewStockParams,\r\n  RenewStockState,\r\n  ReportConsumablesState,\r\n  ServiceChangeStateParameters,\r\n  StockRenewalParams,\r\n  StockRenewalState,\r\n} from './types';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { OtherServiceDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport {\r\n  ConnectedFiltersInit,\r\n  IConnectedFiltersDto,\r\n} from 'types/IConnectedFiltersDto';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { connectedFiltersActions } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { selectConnectedFiltersData } from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectBarcodeScanTarget,\r\n  selectGlobalSetting,\r\n  selectOffsetDate,\r\n} from 'app/slice/selectors';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { MultiDetailsProps } from 'app/Layout/FrontendLayout/components/Snackbar/Actions';\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nimport { parseBarcode, ScanTarget } from 'app/slice/types';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { InventoryBatchProps } from '../../InventoryBatch';\r\nimport { RenewStockProps } from '../../RenewStock';\r\nimport { v4 as uuid } from 'uuid';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\n\r\nfunction* doInitDetails(\r\n  action: PayloadAction<{\r\n    query: OfflineServiceQueryStringParameters;\r\n    service?: IOtherServices;\r\n    globalSettings: GlobalSettingsType;\r\n    editCreatable?: boolean;\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IOtherServices | null = action.payload.service || null;\r\n    const date = yield select(state => selectOffsetDate(state, new Date()));\r\n    let hasError: boolean = false;\r\n    const user: AuthenticatedUser | undefined = yield select(\r\n      selectAuthenticatedUser,\r\n    );\r\n    let serviceType: IOfflineServiceFilterDto | null = null;\r\n    if (data === null) {\r\n      const result = yield call(api.initOfflineService, action.payload.query);\r\n      console.debug('service result: ', result);\r\n      let response = result as OfflineServicesResponse;\r\n      if (response.ErrorMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.ErrorMessages.map(item => {\r\n              return {\r\n                key: `initOfflineErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: `initOfflineWarn_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.SuccessMessages.map(item => {\r\n              return {\r\n                key: `initOfflineSucc_${uuid()}`,\r\n                message: item,\r\n                variant: 'success',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      data =\r\n        response.data ??\r\n        getDefaultService(\r\n          user,\r\n          dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n        );\r\n      hasError = !response.IsValid;\r\n      serviceType = response.serviceType as IOfflineServiceFilterDto;\r\n    }\r\n    if (serviceType === null && data.ServiceTypeID > 0) {\r\n      serviceType = yield call(\r\n        api.getServiceType,\r\n        data.ServiceTypeID,\r\n        'public',\r\n      );\r\n    }\r\n    yield put(\r\n      connectedFiltersActions.extendSettingsState({\r\n        services:\r\n          data.ServiceTypeID > 0\r\n            ? [\r\n                {\r\n                  Id: data.ServiceTypeID,\r\n                  Name: data.ServiceType,\r\n                  ServiceGroupId: data.ServiceGroupId,\r\n                  ServiceTypeId: ServiceType.Offline,\r\n                  Active: true,\r\n                  BudgetsTurnedOn: data.BudgetsTurnedOn,\r\n                  HideProject: data.HideProjects,\r\n                } as IServiceTypeFilterDto,\r\n              ]\r\n            : [],\r\n        globalSettings: action.payload.globalSettings,\r\n        isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n        settings: {},\r\n        data: ConvertDtoToConnectedModel(data),\r\n      }),\r\n    );\r\n    yield put(\r\n      connectedFiltersActions.saveState(ConvertDtoToConnectedModel(data)),\r\n    );\r\n    yield put(\r\n      actions.initDetails_Success({\r\n        hasErrors: hasError,\r\n        hasCharges: data.HasCharges,\r\n        data: data,\r\n        isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n        serviceType: serviceType,\r\n      }),\r\n    );\r\n    if (\r\n      data.ServiceTypeID > 0 &&\r\n      !(data.Id > 0) &&\r\n      !action.payload.editCreatable\r\n    ) {\r\n      const parameters = {\r\n        ServiceTypes: [data.ServiceTypeID],\r\n        ReservationId: data.ReservationId,\r\n        UsageId: data.UsageId,\r\n        BookedBy: data.BookedBy,\r\n        ADGroup: data.UserGroup,\r\n        Start: dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(data.ServiceDate),\r\n        ),\r\n        BudgetId: data.BudgetID,\r\n        FundingTypeId: data.FundingType ?? 0,\r\n      } as ServiceChangeStateParameters;\r\n      yield put(actions.initServiceChangeStateData(parameters));\r\n    }\r\n  } catch (error: unknown) {\r\n    yield put(actions.initDetails_Error(error));\r\n  }\r\n}\r\nfunction* doInitServiceChangeStateData(\r\n  action: PayloadAction<ServiceChangeStateParameters>,\r\n) {\r\n  try {\r\n    let res = yield call(api.getServiceChangeState, action.payload);\r\n    let response = res as OfflineServiceTypeChangeResult;\r\n\r\n    yield put(actions.initServiceChangeStateData_Success(response));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initServiceChangeStateData_Error());\r\n  }\r\n}\r\nfunction* doCreate(\r\n  action: PayloadAction<{\r\n    model: OtherServiceDetailsState;\r\n    saveCreatable?: boolean;\r\n  }>,\r\n) {\r\n  const connectedModel: IConnectedFiltersDto = yield select(\r\n    selectConnectedFiltersData,\r\n  );\r\n  const httpPayloads: IOtherServices = ConvertModelToInsertEntity(\r\n    action.payload.model,\r\n    connectedModel,\r\n  );\r\n  try {\r\n    const result = yield call(api.insertOtherService, httpPayloads);\r\n    let response = result as OfflineServicesResponse;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: `serviceInsertError_${uuid()}`,\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (responseSuccess.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: `serviceInsertSuccess_${uuid()}`,\r\n            message: responseSuccess[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: true,\r\n              itemName: i18next.t(translations.OfflineService),\r\n              detailsType: RenderPageType.OtherServiceDetails,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id ?? -1,\r\n                },\r\n                initialService: response.data,\r\n              } as OtherServiceDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (responseWarnings.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseWarnings.map(item => {\r\n              return {\r\n                key: `serviceInsertWarning_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = responseErrors.length > 0;\r\n    if (action.payload.saveCreatable === true && !hasErrors) {\r\n      yield put(actions.setReservationService(response.data ?? undefined));\r\n    }\r\n    yield put(\r\n      actions.createService_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: `serviceInsert_${uuid()}`,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createService_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: OtherServiceDetailsState;\r\n    original: OtherServiceDetailsState;\r\n    saveCreatable?: boolean;\r\n  }>,\r\n) {\r\n  const connectedModel: IConnectedFiltersDto = yield select(\r\n    selectConnectedFiltersData,\r\n  );\r\n  let updatedService = ConvertModelToUpdateEntity(\r\n    action.payload.current,\r\n    action.payload.original,\r\n    connectedModel,\r\n  );\r\n  let hasErrors = false;\r\n  try {\r\n    if (action.payload.saveCreatable) {\r\n      yield put(actions.setReservationService(updatedService));\r\n    } else {\r\n      const results = yield call(\r\n        api.updateOtherService,\r\n        updatedService,\r\n        action.payload.current.Id,\r\n      );\r\n      let response = results as OfflineServicesResponse;\r\n      let respErrors = response.ErrorMessages;\r\n      if (respErrors.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            respErrors.map(item => {\r\n              return {\r\n                key: `serviceUpdateErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      } else {\r\n        if (response.SuccessMessages.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              key: `serviceUpdateSuccess_${uuid()}`,\r\n              message: response.SuccessMessages[0],\r\n              messageType: SnackBarMessageType.openSidepanelDetails,\r\n              messageTypeProps: {\r\n                Id: response.Id ?? undefined,\r\n                created: false,\r\n                itemName: i18next.t(translations.OfflineService),\r\n                detailsType: RenderPageType.OtherServiceDetails,\r\n                detailsTypeProps: {\r\n                  useSidePanel: true,\r\n                  queryParams: {\r\n                    id: '' + response.Id ?? -1,\r\n                  },\r\n                  initialService: response.data,\r\n                } as OtherServiceDetailsProps,\r\n              },\r\n              variant: 'success',\r\n            }),\r\n          );\r\n        }\r\n        if (response.WarningMessages.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotifications(\r\n              response.WarningMessages.map(item => {\r\n                return {\r\n                  key: `serviceUpdateWarn_${uuid()}`,\r\n                  message: item,\r\n                  variant: 'warning',\r\n                };\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n      hasErrors = response.ErrorMessages.length > 0;\r\n    }\r\n    yield put(\r\n      actions.updateService_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: `serviceUpdateErr_${uuid()}`,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateService_Error(Error));\r\n  }\r\n}\r\nfunction* doSetAnyValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof OtherServiceDetailsState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setAnyValueSuccess(action.payload));\r\n}\r\nfunction* doSetConsumableValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof ReportConsumablesState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setConsumableValueSuccess(action.payload));\r\n}\r\nfunction* doSetRenewalValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof StockRenewalState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setStockRenewalValueSuccess(action.payload));\r\n}\r\nfunction* doGetCredit(action: PayloadAction<OtherServiceDetailsState>) {\r\n  const connectedModel: IConnectedFiltersDto = yield select(\r\n    selectConnectedFiltersData,\r\n  );\r\n  const httpPayloads: IOtherServices = ConvertModelToInsertEntity(\r\n    action.payload,\r\n    connectedModel,\r\n  );\r\n  try {\r\n    const result = yield call(api.calculateCredit, httpPayloads);\r\n    yield put(\r\n      actions.getCredit_Success({\r\n        credit: result.TotalCost,\r\n        balance: result.Balance,\r\n      }),\r\n    );\r\n  } catch {\r\n    yield put(actions.getCredit_Success({ credit: 0, balance: null }));\r\n  }\r\n}\r\nfunction* doGetTotalCredit(action: PayloadAction<IOtherServices[]>) {\r\n  const connectedModel: IConnectedFiltersDto = yield select(\r\n    selectConnectedFiltersData,\r\n  );\r\n  const httpPayloads: IOtherServices[] = ConvertConsumablesToInsertEntity(\r\n    action.payload,\r\n    connectedModel,\r\n  );\r\n  try {\r\n    const result = yield call(api.calculateTotalCredit, httpPayloads);\r\n    yield put(\r\n      actions.getTotalCredit_Success({\r\n        credit: result.TotalCost,\r\n        balance: result.Balance,\r\n      }),\r\n    );\r\n  } catch {\r\n    yield put(actions.getTotalCredit_Success({ credit: 0, balance: null }));\r\n  }\r\n}\r\nfunction* doInitConsumables(\r\n  action: PayloadAction<{\r\n    query: OfflineServiceQueryStringParameters;\r\n    globalSettings: GlobalSettingsType;\r\n    services?: IOtherServices[];\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IOtherServices[] = !!action.payload.services\r\n      ? action.payload.services\r\n      : [];\r\n    const user: AuthenticatedUser | undefined = yield select(\r\n      selectAuthenticatedUser,\r\n    );\r\n    if (data.length < 1) {\r\n      const result = yield call(\r\n        api.initConsumableServices,\r\n        action.payload.query,\r\n      );\r\n      let response = result as ConsumableServicesResponse;\r\n      if (response.ErrorMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.ErrorMessages.map(item => {\r\n              return {\r\n                key: `initOfflineErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: `initOfflineWarn_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.SuccessMessages.map(item => {\r\n              return {\r\n                key: `initOfflineSucc_${uuid()}`,\r\n                message: item,\r\n                variant: 'success',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      data = response.data;\r\n    }\r\n    yield put(\r\n      connectedFiltersActions.extendSettingsState({\r\n        services:\r\n          data.length > 0\r\n            ? data.map(f => {\r\n                return {\r\n                  Id: f.ServiceTypeID,\r\n                  Name: f.ServiceType,\r\n                  ServiceGroupId: f.ServiceGroupId,\r\n                  ServiceTypeId: ServiceType.Offline,\r\n                  Active: true,\r\n                  BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n                  HideProject: f.HideProjects,\r\n                } as IServiceTypeFilterDto;\r\n              })\r\n            : [],\r\n        globalSettings: action.payload.globalSettings,\r\n        isEdit: false,\r\n        settings: {},\r\n        data:\r\n          data.length > 0\r\n            ? ConvertDtoToConnectedModel(data[0])\r\n            : ConnectedFiltersInit(\r\n                undefined,\r\n                undefined,\r\n                toEntity(user?.Id, user?.Name),\r\n                action.payload.globalSettings\r\n                  .reservationUserGroupGroupByBudgetUserGroup\r\n                  ? undefined\r\n                  : toEntity(\r\n                      user?.ActiveUserGroup?.Id,\r\n                      user?.ActiveUserGroup?.Name,\r\n                    ),\r\n                undefined,\r\n                undefined,\r\n                undefined,\r\n                getSingleInvoiceFundingType(0),\r\n                undefined,\r\n                undefined,\r\n                undefined,\r\n              ),\r\n      }),\r\n    );\r\n    yield put(\r\n      connectedFiltersActions.saveState(\r\n        data.length > 0\r\n          ? ConvertDtoToConnectedModel(data[0])\r\n          : ConnectedFiltersInit(\r\n              undefined,\r\n              undefined,\r\n              toEntity(user?.Id, user?.Name),\r\n              action.payload.globalSettings\r\n                .reservationUserGroupGroupByBudgetUserGroup\r\n                ? undefined\r\n                : toEntity(\r\n                    user?.ActiveUserGroup?.Id,\r\n                    user?.ActiveUserGroup?.Name,\r\n                  ),\r\n              undefined,\r\n              undefined,\r\n              undefined,\r\n              getSingleInvoiceFundingType(0),\r\n              undefined,\r\n              undefined,\r\n              undefined,\r\n            ),\r\n      ),\r\n    );\r\n    yield put(\r\n      actions.initConsumables_Success({\r\n        data: data,\r\n        user: toEntity(user?.Id, user?.Name),\r\n        userGroup: action.payload.globalSettings\r\n          .reservationUserGroupGroupByBudgetUserGroup\r\n          ? undefined\r\n          : toEntity(user?.ActiveUserGroup?.Id, user?.ActiveUserGroup?.Name),\r\n      }),\r\n    );\r\n    if (data.length > 0) {\r\n      const parameters = {\r\n        ServiceTypes: data.map(f => f.ServiceTypeID),\r\n        ReservationId: null,\r\n        UsageId: null,\r\n        BookedBy: data[0].BookedBy,\r\n        ADGroup: data[0].UserGroup,\r\n        Start: dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(data[0].ServiceDate),\r\n        ),\r\n        BudgetId: data[0].BudgetID,\r\n        FundingTypeId: data[0].FundingType ?? 0,\r\n      } as ServiceChangeStateParameters;\r\n      yield put(actions.initServiceChangeStateData(parameters));\r\n    }\r\n  } catch (error: unknown) {\r\n    yield put(actions.initConsumables_Error(error));\r\n  }\r\n}\r\nfunction* doCreateConsumables(\r\n  action: PayloadAction<{\r\n    Services: IOtherServices[];\r\n    DiscountFactor?: number | null;\r\n    Remarks?: string | null;\r\n  }>,\r\n) {\r\n  const connectedModel: IConnectedFiltersDto = yield select(\r\n    selectConnectedFiltersData,\r\n  );\r\n  const httpPayloads: IOtherServices[] = ConvertConsumablesToInsertEntity(\r\n    action.payload.Services,\r\n    connectedModel,\r\n    action.payload.DiscountFactor,\r\n    action.payload.Remarks,\r\n  );\r\n  try {\r\n    const result = yield call(api.insertConsumableServices, httpPayloads);\r\n    let response = result as ConsumableServicesResponse;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: `serviceInsertError_${uuid()}`,\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (responseSuccess.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: `serviceInsertSuccess_${uuid()}`,\r\n            message: responseSuccess[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: undefined,\r\n              created: true,\r\n              multiple: true,\r\n              itemName: i18next.t(translations.OfflineService),\r\n              itemEndName: 'logged',\r\n              multiDetails: response.data.map(f => {\r\n                return {\r\n                  Id: f.Id,\r\n                  detailsType: RenderPageType.OtherServiceDetails,\r\n                  detailsTypeProps: {\r\n                    useSidePanel: true,\r\n                    queryParams: {\r\n                      id: '' + f.Id ?? -1,\r\n                    },\r\n                    initialService: f,\r\n                  } as OtherServiceDetailsProps,\r\n                } as MultiDetailsProps;\r\n              }),\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (responseWarnings.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseWarnings.map(item => {\r\n              return {\r\n                key: `serviceInsertWarning_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = responseErrors.length > 0;\r\n    yield put(\r\n      actions.createConsumables_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: `serviceInsert_${uuid()}`,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createConsumables_Error(Error));\r\n  }\r\n}\r\nasync function getAssetByInternalCode(barcode: string) {\r\n  try {\r\n    var response: IODataQueryResponse<IMyAssetsRow> = await httpClient.get(\r\n      '/api/odata/v4/MyAssets',\r\n      {\r\n        $top: 1,\r\n        $select: 'ServiceId',\r\n        $filter: `${new Condition<IMyAssetsRow>(\r\n          'InternalCode',\r\n          ODataOperators.Equals,\r\n          barcode,\r\n        ).toString()} and ${new Condition<IMyAssetsRow>(\r\n          'ServiceTypeId',\r\n          ODataOperators.Equals,\r\n          2,\r\n        ).toString()}`,\r\n      },\r\n    );\r\n    var serviceTypeId = response.value[0]?.ServiceId;\r\n    return serviceTypeId;\r\n  } catch (error) {}\r\n}\r\nfunction* doBarcodeScan(action: PayloadAction<{ data: string }>) {\r\n  const MIN_LENGTH_DEFAULT = 6;\r\n  const minBarcodeLengthString: string | undefined = yield select(state =>\r\n    selectGlobalSetting(state, AllowedSettings.MinBarcodeLength),\r\n  );\r\n  const MinBarcodeLength =\r\n    tryParseInt(minBarcodeLengthString) ?? MIN_LENGTH_DEFAULT;\r\n  // prevent accidental barcode detection on fast user input\r\n  if (action.payload.data.length < MinBarcodeLength) {\r\n    return;\r\n  }\r\n  const scannTarget: ScanTarget | undefined = yield select(\r\n    selectBarcodeScanTarget,\r\n  );\r\n  if (scannTarget === undefined || scannTarget !== ScanTarget.Consumables) {\r\n    return;\r\n  }\r\n  const appSettings: AppSettings = yield select(selectAppSettings);\r\n  yield put(\r\n    appSettingsActions.addNotification({\r\n      variant: 'info',\r\n      message:\r\n        i18next.t(translations.BarcodeScanModalBody) +\r\n        ' ' +\r\n        action.payload.data,\r\n    }),\r\n  );\r\n  try {\r\n    // in case and the barcode is a valid internal url - get InternalCode\r\n    let scanedBarcode = parseBarcode(action.payload.data, appSettings);\r\n\r\n    let internalId = action.payload.data;\r\n    if (scanedBarcode !== undefined) {\r\n      internalId = scanedBarcode.InternalCode ?? action.payload.data;\r\n    }\r\n    if (internalId === undefined || internalId === null) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.BarcodeNotFoundEx),\r\n        }),\r\n      );\r\n    } else {\r\n      const serviceId = yield call(getAssetByInternalCode, internalId);\r\n      if (serviceId !== undefined) {\r\n        yield put(actions.setSelectedServiceType([serviceId]));\r\n        yield put(actions.setBarcodeScanned(true));\r\n\r\n        return;\r\n      }\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: i18next.t(translations.BarcodeNotFoundEx),\r\n        }),\r\n      );\r\n    }\r\n  } catch (error) {\r\n    console.error(`${action.type}`, action.payload, error);\r\n  }\r\n}\r\nfunction* doSetIsBarcodeScanned(action: PayloadAction<boolean | undefined>) {\r\n  yield put(actions.setBarcodeScanned_Success(action.payload));\r\n}\r\nfunction* doInitStockRenewal(\r\n  action: PayloadAction<{\r\n    query: StockRenewalParams;\r\n    services?: IOtherServices[];\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IOtherServices[] = !!action.payload.services\r\n      ? action.payload.services\r\n      : [];\r\n    const date = yield select(state => selectOffsetDate(state, new Date()));\r\n    if (data.length < 1) {\r\n      const result = yield call(\r\n        api.initStockRenewalServices,\r\n        action.payload.query,\r\n      );\r\n      let response = result as ConsumableServicesResponse;\r\n      if (response.ErrorMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.ErrorMessages.map(item => {\r\n              return {\r\n                key: `initOfflineErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: `initOfflineWarn_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.SuccessMessages.map(item => {\r\n              return {\r\n                key: `initOfflineSucc_${uuid()}`,\r\n                message: item,\r\n                variant: 'success',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      data = response.data;\r\n    }\r\n    yield put(\r\n      actions.initStockRenewal_Success({\r\n        data: data,\r\n        date: dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    yield put(actions.initStockRenewal_Error(error));\r\n  }\r\n}\r\nfunction* doCreateStockRenewals(action: PayloadAction<StockRenewalState>) {\r\n  const httpPayloads: IOtherServices[] = action.payload.Services;\r\n  try {\r\n    const result = yield call(api.insertStockRenewalServices, httpPayloads);\r\n    let response = result as ConsumableServicesResponse;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: `stockrenewalInsertError_${uuid()}`,\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (responseSuccess.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: `stockrenewalInsertSuccess_${uuid()}`,\r\n            message: responseSuccess[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: undefined,\r\n              created: true,\r\n              multiple: true,\r\n              itemName: i18next.t(translations.RenewStock),\r\n              multiDetails: response.data.map(f => {\r\n                return {\r\n                  Id: f.Id,\r\n                  detailsType: RenderPageType.RenewStock,\r\n                  detailsTypeProps: {\r\n                    useSidePanel: true,\r\n                    queryParams: {\r\n                      id: '' + f.Id ?? -1,\r\n                    },\r\n                    initialService: f,\r\n                  } as RenewStockProps,\r\n                } as MultiDetailsProps;\r\n              }),\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (responseWarnings.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseWarnings.map(item => {\r\n              return {\r\n                key: `stockrenewalInsertWarning_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = responseErrors.length > 0;\r\n    yield put(\r\n      actions.createStockRenewals_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: `stockrenewalInsert_${uuid()}`,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createStockRenewals_Error(Error));\r\n  }\r\n}\r\nfunction* doInitRenewStock(\r\n  action: PayloadAction<{\r\n    query: RenewStockParams;\r\n    service?: IOtherServices;\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IOtherServices | null = action.payload.service || null;\r\n    let hasError: boolean = false;\r\n    const date = yield select(state => selectOffsetDate(state, new Date()));\r\n    const user: AuthenticatedUser | undefined = yield select(\r\n      selectAuthenticatedUser,\r\n    );\r\n    let serviceType: IOfflineServiceFilterDto | null = null;\r\n    if (data === null) {\r\n      const result = yield call(\r\n        api.initRenewStockService,\r\n        action.payload.query,\r\n      );\r\n      console.debug('service result: ', result);\r\n      let response = result as OfflineServicesResponse;\r\n      if (response.ErrorMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.ErrorMessages.map(item => {\r\n              return {\r\n                key: `initOfflineErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: `initOfflineWarn_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.SuccessMessages.map(item => {\r\n              return {\r\n                key: `initOfflineSucc_${uuid()}`,\r\n                message: item,\r\n                variant: 'success',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      data =\r\n        response.data ??\r\n        getDefaultService(\r\n          user,\r\n          dateUtils.formatISO(dateUtils.dateOrStringToDate(date)),\r\n        );\r\n      hasError = !response.IsValid;\r\n      serviceType = response.serviceType as IOfflineServiceFilterDto;\r\n    }\r\n    if (serviceType === null && data.ServiceTypeID > 0) {\r\n      serviceType = yield call(api.getServiceType, data.ServiceTypeID);\r\n    }\r\n    yield put(\r\n      actions.initRenewStock_Success({\r\n        hasErrors: hasError,\r\n        data: data,\r\n        isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n        serviceType: serviceType,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    yield put(actions.initRenewStock_Error(error));\r\n  }\r\n}\r\nfunction* doCreateRenewStock(\r\n  action: PayloadAction<{\r\n    model: RenewStockState;\r\n    editCreatable: boolean;\r\n    preventRefreshTable?: boolean;\r\n    autoGenerateBatch?: boolean;\r\n    saveCreatable?: boolean;\r\n  }>,\r\n) {\r\n  const httpPayloads: IOtherServices = ConvertRenewStockToInsertEntity(\r\n    action.payload.model,\r\n    action.payload.autoGenerateBatch,\r\n  );\r\n  if (action.payload.editCreatable) {\r\n    yield put(actions.setEditCreatableService(httpPayloads));\r\n    yield put(\r\n      actions.createRenewStock_Success({\r\n        hasErrors: false,\r\n      }),\r\n    );\r\n  } else {\r\n    try {\r\n      const result = yield call(api.insertOtherService, httpPayloads);\r\n      let response = result as OfflineServicesResponse;\r\n      let responseErrors = response.ErrorMessages;\r\n      let responseWarnings = response.WarningMessages;\r\n      let responseSuccess = response.SuccessMessages;\r\n      if (responseErrors.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseErrors.map(item => {\r\n              return {\r\n                key: `RenewStockInsertError_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      } else {\r\n        if (responseSuccess.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              key: `RenewStockInsertSuccess_${uuid()}`,\r\n              message: responseSuccess[0],\r\n              messageType: SnackBarMessageType.openSidepanelDetails,\r\n              messageTypeProps: {\r\n                Id: response.Id ?? undefined,\r\n                created: true,\r\n                itemName: i18next.t(translations.RenewStock),\r\n                detailsType: RenderPageType.RenewStock,\r\n                detailsTypeProps: {\r\n                  useSidePanel: true,\r\n                  queryParams: {\r\n                    id: '' + response.Id ?? -1,\r\n                  },\r\n                  initialService: response.data,\r\n                } as RenewStockProps,\r\n              },\r\n              variant: 'success',\r\n            }),\r\n          );\r\n        }\r\n        if (responseWarnings.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotifications(\r\n              responseWarnings.map(item => {\r\n                return {\r\n                  key: `RenewStockInsertWarning_${uuid()}`,\r\n                  message: item,\r\n                  variant: 'warning',\r\n                };\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n        if (!action.payload.preventRefreshTable) {\r\n          yield put(layoutActions.setRefreshTable(true));\r\n        }\r\n      }\r\n      let hasErrors = responseErrors.length > 0;\r\n      yield put(\r\n        actions.createRenewStock_Success({\r\n          hasErrors: hasErrors,\r\n        }),\r\n      );\r\n      if (action.payload.saveCreatable) {\r\n        yield put(actions.getCreatableService(response.data ?? undefined));\r\n      }\r\n    } catch (error: unknown) {\r\n      const message =\r\n        (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n        ((error as AxiosError)?.response?.status === 403\r\n          ? i18next.t(translations.Forbidden)\r\n          : undefined) ??\r\n        i18next.t(translations.errormessage);\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: `RenewStockInsert_${uuid()}`,\r\n          message: message,\r\n          variant: 'error',\r\n        }),\r\n      );\r\n      yield put(actions.createRenewStock_Error(Error));\r\n    }\r\n  }\r\n}\r\nfunction* doUpdateRenewStock(\r\n  action: PayloadAction<{\r\n    current: RenewStockState;\r\n    original: RenewStockState;\r\n    editCreatable: boolean;\r\n    autoGenerateBatch?: boolean;\r\n  }>,\r\n) {\r\n  let updatedService = ConvertModelToUpdateRenewStockEntity(\r\n    action.payload.current,\r\n    action.payload.original,\r\n    action.payload.autoGenerateBatch,\r\n  );\r\n  if (action.payload.editCreatable) {\r\n    yield put(actions.setEditCreatableService(updatedService));\r\n    yield put(\r\n      actions.updateRenewStock_Success({\r\n        hasErrors: false,\r\n      }),\r\n    );\r\n  } else {\r\n    try {\r\n      const results = yield call(\r\n        api.updateOtherService,\r\n        updatedService,\r\n        action.payload.current.Id,\r\n      );\r\n      let response = results as OfflineServicesResponse;\r\n      let respErrors = response.ErrorMessages;\r\n      if (respErrors.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            respErrors.map(item => {\r\n              return {\r\n                key: `serviceUpdateErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      } else {\r\n        if (response.SuccessMessages.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              key: `serviceUpdateSuccess_${uuid()}`,\r\n              message: response.SuccessMessages[0],\r\n              messageType: SnackBarMessageType.openSidepanelDetails,\r\n              messageTypeProps: {\r\n                Id: response.Id ?? undefined,\r\n                created: false,\r\n                itemName: i18next.t(translations.RenewStock),\r\n                detailsType: RenderPageType.RenewStock,\r\n                detailsTypeProps: {\r\n                  useSidePanel: true,\r\n                  queryParams: {\r\n                    id: '' + response.Id ?? -1,\r\n                  },\r\n                  initialService: response.data,\r\n                } as RenewStockProps,\r\n              },\r\n              variant: 'success',\r\n            }),\r\n          );\r\n        }\r\n        if (response.WarningMessages.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotifications(\r\n              response.WarningMessages.map(item => {\r\n                return {\r\n                  key: `serviceUpdateWarn_${uuid()}`,\r\n                  message: item,\r\n                  variant: 'warning',\r\n                };\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n      let hasErrors = response.ErrorMessages.length > 0;\r\n      yield put(\r\n        actions.updateRenewStock_Success({\r\n          hasErrors: hasErrors,\r\n        }),\r\n      );\r\n    } catch (error: unknown) {\r\n      const message =\r\n        (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n        ((error as AxiosError)?.response?.status === 403\r\n          ? i18next.t(translations.Forbidden)\r\n          : undefined) ??\r\n        i18next.t(translations.errormessage);\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: `serviceUpdateErr_${uuid()}`,\r\n          message: message,\r\n          variant: 'error',\r\n        }),\r\n      );\r\n      yield put(actions.updateRenewStock_Error(Error));\r\n    }\r\n  }\r\n}\r\nfunction* doInitInventoryBatch(\r\n  action: PayloadAction<{\r\n    query: InventoryBatchParams;\r\n    batch?: IInventoryBatchDto;\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IInventoryBatchDto | null = action.payload.batch || null;\r\n    let hasError: boolean = false;\r\n    const newDate = yield select(state => selectOffsetDate(state, new Date()));\r\n    let serviceType: IOfflineServiceFilterDto | null = null;\r\n    if (data === null) {\r\n      const result = yield call(api.initInventoryBatch, action.payload.query);\r\n      let response = result as InventoryBatchResponse;\r\n      if (response.ErrorMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.ErrorMessages.map(item => {\r\n              return {\r\n                key: `initBatchErr_${uuid()}`,\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: `initBatchWarn_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.SuccessMessages.map(item => {\r\n              return {\r\n                key: `initBatchSucc_${uuid()}`,\r\n                message: item,\r\n                variant: 'success',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      data =\r\n        response.data ??\r\n        getDefaultBatch(\r\n          dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate)),\r\n        );\r\n      hasError = !response.IsValid;\r\n      serviceType = response.serviceType as IOfflineServiceFilterDto;\r\n    }\r\n    if (serviceType === null && data.OfflineServiceTypeId > 0) {\r\n      serviceType = yield call(api.getServiceType, data.OfflineServiceTypeId);\r\n    }\r\n    yield put(\r\n      actions.initInventoryBatch_Success({\r\n        hasErrors: hasError,\r\n        data: data,\r\n        isEdit: (tryParseInt(action.payload.query.id) ?? 0) > 0,\r\n        serviceType: serviceType,\r\n        newDate: dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate)),\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    yield put(actions.initInventoryBatch_Error(error));\r\n  }\r\n}\r\nfunction* doCreateInventoryBatch(\r\n  action: PayloadAction<{\r\n    model: InventoryBatchState;\r\n    saveCreatable?: boolean;\r\n    preventRefreshTable?: boolean;\r\n  }>,\r\n) {\r\n  const httpPayloads: IInventoryBatchDto = ConvertInventoryBatchToEntity(\r\n    action.payload.model,\r\n  );\r\n\r\n  try {\r\n    const result = yield call(api.insertInventoryBatch, httpPayloads);\r\n    let response = result as InventoryBatchResponse;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: `batchInsertError_${uuid()}`,\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (responseSuccess.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: `batchInsertSuccess_${uuid()}`,\r\n            message: responseSuccess[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: true,\r\n              itemName: i18next.t(translations.InventoryBatch),\r\n              detailsType: RenderPageType.InventoryBatch,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id ?? -1,\r\n                },\r\n                initialBatch: response.data,\r\n              } as InventoryBatchProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (responseWarnings.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseWarnings.map(item => {\r\n              return {\r\n                key: `batchInsertWarning_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n    }\r\n    let hasErrors = responseErrors.length > 0;\r\n    if (action.payload.saveCreatable === true) {\r\n      yield put(actions.setInventoryBatchEditable(response.data ?? undefined));\r\n    } else {\r\n      if (!action.payload.preventRefreshTable) {\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n    yield put(\r\n      actions.createInventoryBatch_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: `batchInsert_err_${uuid()}`,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createInventoryBatch_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdateInventoryBatch(\r\n  action: PayloadAction<{\r\n    current: InventoryBatchState;\r\n    original: InventoryBatchState;\r\n    saveCreatable?: boolean;\r\n    preventRefreshTable?: boolean;\r\n  }>,\r\n) {\r\n  let updatedService = ConvertInventoryBatchToEntity(action.payload.current);\r\n\r\n  try {\r\n    const results = yield call(\r\n      api.updateInventoryBatch,\r\n      updatedService,\r\n      action.payload.current.Id,\r\n    );\r\n    let response = results as InventoryBatchResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: `batchUpdateErr_${uuid()}`,\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: `batchUpdateSuccess_${uuid()}`,\r\n            message: response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: false,\r\n              itemName: i18next.t(translations.InventoryBatch),\r\n              detailsType: RenderPageType.InventoryBatch,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id ?? -1,\r\n                },\r\n                initialBatch: response.data,\r\n              } as InventoryBatchProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: `batchUpdateWarn_${uuid()}`,\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      //yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    if (action.payload.saveCreatable === true) {\r\n      yield put(actions.setInventoryBatchEditable(response.data ?? undefined));\r\n    } else {\r\n      if (!action.payload.preventRefreshTable) {\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateInventoryBatch_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: `serviceUpdateErr_${uuid()}`,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateInventoryBatch_Error(Error));\r\n  }\r\n}\r\nfunction* doSetRenewStockValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof RenewStockState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setRenewStockValueSuccess(action.payload));\r\n}\r\nfunction* doSetInventoryBatchValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof InventoryBatchState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setInventoryBatchValueSuccess(action.payload));\r\n}\r\nexport function* offlineServiceStateSaga() {\r\n  yield takeLatest(actions.initDetails.type, doInitDetails);\r\n  yield takeLatest(actions.createService.type, doCreate);\r\n  yield takeLatest(actions.updateService.type, doUpdate);\r\n  yield takeLatest(actions.setAnyValue.type, doSetAnyValue);\r\n  yield takeLatest(actions.setConsumableValue.type, doSetConsumableValue);\r\n  yield takeLatest(actions.createConsumables.type, doCreateConsumables);\r\n  yield takeLatest(actions.getCredit.type, doGetCredit);\r\n  yield takeLatest(actions.getTotalCredit.type, doGetTotalCredit);\r\n  yield takeLatest(\r\n    actions.initServiceChangeStateData.type,\r\n    doInitServiceChangeStateData,\r\n  );\r\n  yield takeLatest(actions.initConsumables.type, doInitConsumables);\r\n  yield takeLatest(actions.setStockRenewalValue.type, doSetRenewalValue);\r\n  yield takeLatest(actions.setRenewStockValue.type, doSetRenewStockValue);\r\n  yield takeLatest(\r\n    actions.setInventoryBatchValue.type,\r\n    doSetInventoryBatchValue,\r\n  );\r\n  yield takeLatest(actions.initStockRenewal.type, doInitStockRenewal);\r\n  yield takeLatest(actions.createStockRenewals.type, doCreateStockRenewals);\r\n  yield takeLatest(actions.initRenewStock.type, doInitRenewStock);\r\n  yield takeLatest(actions.createRenewStock.type, doCreateRenewStock);\r\n  yield takeLatest(actions.updateRenewStock.type, doUpdateRenewStock);\r\n  yield takeLatest(actions.initInventoryBatch.type, doInitInventoryBatch);\r\n  yield takeLatest(actions.createInventoryBatch.type, doCreateInventoryBatch);\r\n  yield takeLatest(actions.updateInventoryBatch.type, doUpdateInventoryBatch);\r\n  yield takeLatest(BARCODE_SCANNED, doBarcodeScan);\r\n  yield takeLatest(actions.setBarcodeScanned.type, doSetIsBarcodeScanned);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { PricingState } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { Entity } from 'types/common';\r\nimport { ConnectedFiltersInit } from 'types/IConnectedFiltersDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { offlineServiceStateSaga } from './saga';\r\nimport {\r\n  ConvertConsumablesToRenewalModel,\r\n  ConvertConsumablesToModel,\r\n  ConvertDtoToConnectedModel,\r\n  ConvertDtoToModel,\r\n  OfflineServiceQueryStringParameters,\r\n  OfflineServiceState,\r\n  OfflineServiceTypeChangeResult,\r\n  OtherServiceDetailsState,\r\n  ReportConsumablesState,\r\n  ServiceChangeStateParameters,\r\n  StockRenewalState,\r\n  StockRenewalParams,\r\n  RenewStockState,\r\n  RenewStockParams,\r\n  ConvertRenewStockToModel,\r\n  InventoryBatchState,\r\n  InventoryBatchParams,\r\n  ConvertInventoryBatchToModel,\r\n} from './types';\r\n\r\nexport const initialState: OfflineServiceState = {\r\n  detailsState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n    error: undefined,\r\n  },\r\n  processing: false,\r\n  consumablesProcessing: false,\r\n  valueHandler: undefined,\r\n  connectedDataState: ConnectedFiltersInit(),\r\n  serviceChangeResultState: undefined,\r\n  creditState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n    error: undefined,\r\n  },\r\n  hasCharges: undefined,\r\n  savedReservationService: undefined,\r\n  consumablesState: {\r\n    data: {\r\n      Services: [],\r\n    },\r\n    completed: undefined,\r\n    dataLength: undefined,\r\n    error: undefined,\r\n    hasErrors: undefined,\r\n    processing: undefined,\r\n  },\r\n  consumablesValueHandler: undefined,\r\n  selectedServiceTypes: [],\r\n  editCreatableService: undefined,\r\n  barcodeScanned: undefined,\r\n  refeshOfflineServices: undefined,\r\n  stockRenewalState: {\r\n    data: undefined,\r\n    completed: undefined,\r\n    dataLength: undefined,\r\n    error: undefined,\r\n    hasErrors: undefined,\r\n    processing: undefined,\r\n  },\r\n  stockRenewalValueHandler: undefined,\r\n  renewStockState: {\r\n    data: undefined,\r\n    completed: undefined,\r\n    dataLength: undefined,\r\n    error: undefined,\r\n    hasErrors: undefined,\r\n    processing: undefined,\r\n  },\r\n  renewStockValueHandler: undefined,\r\n  inventoryBatchState: {\r\n    data: undefined,\r\n    completed: undefined,\r\n    dataLength: undefined,\r\n    error: undefined,\r\n    hasErrors: undefined,\r\n    processing: undefined,\r\n  },\r\n  inventoryBatchValueHandler: undefined,\r\n  isEdit: undefined,\r\n  batchIsEdit: undefined,\r\n  inventoryBatchEditable: undefined,\r\n  getCreatableService: undefined,\r\n};\r\nconst slice = createSlice({\r\n  name: 'offlineServiceState',\r\n  initialState,\r\n  reducers: {\r\n    initDetails(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: OfflineServiceQueryStringParameters;\r\n        globalSettings: GlobalSettingsType;\r\n        service?: IOtherServices;\r\n        editCreatable?: boolean;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.valueHandler = undefined;\r\n      if (!action.payload.editCreatable) {\r\n        state.connectedDataState = ConnectedFiltersInit();\r\n      }\r\n      state.serviceChangeResultState = undefined;\r\n    },\r\n    initDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        hasCharges: boolean;\r\n        data: IOtherServices;\r\n        isEdit: boolean;\r\n        serviceType: IOfflineServiceFilterDto | null;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.detailsState.data = ConvertDtoToModel(\r\n        action.payload.data,\r\n        action.payload.serviceType,\r\n      );\r\n      state.connectedDataState = ConvertDtoToConnectedModel(\r\n        action.payload.data,\r\n      );\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.hasCharges = action.payload.hasCharges;\r\n      state.isEdit = action.payload.isEdit;\r\n    },\r\n    initDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    resetDetailsState(state, action: PayloadAction<boolean | undefined>) {\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.processing = false;\r\n      state.valueHandler = undefined;\r\n      if (action.payload !== true) {\r\n        state.connectedDataState = ConnectedFiltersInit();\r\n        state.serviceChangeResultState = undefined;\r\n      }\r\n      state.isEdit = undefined;\r\n    },\r\n    createService(\r\n      state,\r\n      action: PayloadAction<{\r\n        model: OtherServiceDetailsState;\r\n        saveCreatable?: boolean;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    createService_Success(\r\n      state,\r\n      action: PayloadAction<{ hasErrors: boolean }>,\r\n    ) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n    },\r\n    createService_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n    updateService(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: OtherServiceDetailsState;\r\n        original: OtherServiceDetailsState;\r\n        saveCreatable?: boolean;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    updateService_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n    },\r\n    updateService_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n    setAnyValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof OtherServiceDetailsState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setAnyValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof OtherServiceDetailsState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.valueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetValueHandler(state, action: PayloadAction) {\r\n      state.valueHandler = undefined;\r\n    },\r\n    initServiceChangeStateData(\r\n      state,\r\n      action: PayloadAction<ServiceChangeStateParameters>,\r\n    ) {},\r\n    initServiceChangeStateData_Success(\r\n      state,\r\n      action: PayloadAction<OfflineServiceTypeChangeResult>,\r\n    ) {\r\n      state.serviceChangeResultState = action.payload;\r\n    },\r\n    initServiceChangeStateData_Error(state, action: PayloadAction) {\r\n      state.serviceChangeResultState = undefined;\r\n    },\r\n    resetServiceChangeState(state, action: PayloadAction) {\r\n      state.serviceChangeResultState = undefined;\r\n    },\r\n    getCredit(state, action: PayloadAction<OtherServiceDetailsState>) {\r\n      state.creditState.processing = true;\r\n      state.creditState.completed = undefined;\r\n      state.creditState.hasErrors = undefined;\r\n    },\r\n    getCredit_Success(state, action: PayloadAction<PricingState>) {\r\n      state.creditState.processing = false;\r\n      state.creditState.completed = true;\r\n      state.creditState.data = action.payload;\r\n    },\r\n    getCredit_Error(state, action: PayloadAction<any>) {\r\n      state.creditState.processing = false;\r\n      state.creditState.completed = true;\r\n      state.creditState.data = undefined;\r\n    },\r\n    resetCreditState(state, action: PayloadAction) {\r\n      state.creditState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    getTotalCredit(state, action: PayloadAction<IOtherServices[]>) {\r\n      state.creditState.processing = true;\r\n      state.creditState.completed = undefined;\r\n      state.creditState.hasErrors = undefined;\r\n    },\r\n    getTotalCredit_Success(state, action: PayloadAction<PricingState>) {\r\n      state.creditState.processing = false;\r\n      state.creditState.completed = true;\r\n      state.creditState.data = action.payload;\r\n    },\r\n    getTotalCredit_Error(state, action: PayloadAction<any>) {\r\n      state.creditState.processing = false;\r\n      state.creditState.completed = true;\r\n      state.creditState.data = undefined;\r\n    },\r\n    resetTotalCreditState(state, action: PayloadAction) {\r\n      state.creditState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    setReservationService(\r\n      state,\r\n      action: PayloadAction<IOtherServices | undefined>,\r\n    ) {\r\n      state.savedReservationService = action.payload;\r\n    },\r\n    setConsumableValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof ReportConsumablesState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setConsumableValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof ReportConsumablesState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.consumablesValueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetConsumableValueHandler(state, action: PayloadAction) {\r\n      state.consumablesValueHandler = undefined;\r\n    },\r\n    initConsumables(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: OfflineServiceQueryStringParameters;\r\n        globalSettings: GlobalSettingsType;\r\n        services?: IOtherServices[];\r\n      }>,\r\n    ) {\r\n      state.consumablesProcessing = true;\r\n      state.consumablesState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.consumablesValueHandler = undefined;\r\n    },\r\n    initConsumables_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        data: IOtherServices[];\r\n        user?: Entity<string> | null;\r\n        userGroup?: Entity<string> | null;\r\n      }>,\r\n    ) {\r\n      state.consumablesProcessing = false;\r\n      state.consumablesState.data = ConvertConsumablesToModel(\r\n        action.payload.data,\r\n      );\r\n      state.connectedDataState =\r\n        action.payload.data.length > 0\r\n          ? ConvertDtoToConnectedModel(action.payload.data[0])\r\n          : ConnectedFiltersInit(\r\n              undefined,\r\n              undefined,\r\n              action.payload.user,\r\n              action.payload.userGroup,\r\n              undefined,\r\n              undefined,\r\n              undefined,\r\n              getSingleInvoiceFundingType(0),\r\n              undefined,\r\n              undefined,\r\n              undefined,\r\n            );\r\n    },\r\n    initConsumables_Error(state, action: PayloadAction<any>) {\r\n      state.consumablesProcessing = false;\r\n    },\r\n    extendConsumablesData(state, action: PayloadAction<IOtherServices[]>) {\r\n      state.consumablesState.data = { Services: action.payload };\r\n    },\r\n    createConsumables(\r\n      state,\r\n      action: PayloadAction<{\r\n        Services: IOtherServices[];\r\n        DiscountFactor?: number | null;\r\n        Remarks?: string | null;\r\n      }>,\r\n    ) {\r\n      state.consumablesState.processing = true;\r\n      state.consumablesState.completed = undefined;\r\n      state.consumablesState.hasErrors = undefined;\r\n    },\r\n    createConsumables_Success(\r\n      state,\r\n      action: PayloadAction<{ hasErrors: boolean }>,\r\n    ) {\r\n      state.consumablesState.processing = false;\r\n      state.consumablesState.hasErrors = action.payload.hasErrors;\r\n      state.consumablesState.completed = true;\r\n    },\r\n    createConsumables_Error(state, action: PayloadAction<any>) {\r\n      state.consumablesState.processing = false;\r\n      state.consumablesState.completed = true;\r\n      state.consumablesState.hasErrors = true;\r\n    },\r\n    resetConsumablesState(state, action: PayloadAction) {\r\n      state.consumablesState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        error: undefined,\r\n        dataLength: undefined,\r\n      };\r\n      state.consumablesProcessing = false;\r\n      state.consumablesValueHandler = undefined;\r\n      state.connectedDataState = ConnectedFiltersInit();\r\n      state.serviceChangeResultState = undefined;\r\n      state.selectedServiceTypes = [];\r\n      state.barcodeScanned = undefined;\r\n      state.refeshOfflineServices = undefined;\r\n    },\r\n    resetSelectedServiceType(state, action: PayloadAction) {\r\n      state.selectedServiceTypes = [];\r\n    },\r\n    setSelectedServiceType(state, action: PayloadAction<Array<number>>) {\r\n      state.selectedServiceTypes = action.payload;\r\n    },\r\n    setEditCreatableService(\r\n      state,\r\n      action: PayloadAction<IOtherServices | undefined>,\r\n    ) {\r\n      state.editCreatableService = action.payload;\r\n    },\r\n    getCreatableService(\r\n      state,\r\n      action: PayloadAction<IOtherServices | undefined>,\r\n    ) {\r\n      state.getCreatableService = action.payload;\r\n    },\r\n    setBarcodeScanned(state, action: PayloadAction<boolean | undefined>) {},\r\n    setBarcodeScanned_Success(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.barcodeScanned = action.payload;\r\n    },\r\n    setRefreshConsumableOfflineServices(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.refeshOfflineServices = action.payload;\r\n    },\r\n\r\n    setStockRenewalValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof StockRenewalState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setStockRenewalValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof StockRenewalState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.stockRenewalValueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetStockRenewalValueHandler(state, action: PayloadAction) {\r\n      state.stockRenewalValueHandler = undefined;\r\n    },\r\n    initStockRenewal(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: StockRenewalParams;\r\n        services?: IOtherServices[];\r\n      }>,\r\n    ) {\r\n      state.stockRenewalState = {\r\n        data: undefined,\r\n        processing: true,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.stockRenewalValueHandler = undefined;\r\n    },\r\n    initStockRenewal_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        data: IOtherServices[];\r\n        date: Date | string;\r\n      }>,\r\n    ) {\r\n      state.stockRenewalState.processing = false;\r\n      state.stockRenewalState.data = ConvertConsumablesToRenewalModel(\r\n        action.payload.data,\r\n        action.payload.date,\r\n      );\r\n    },\r\n    initStockRenewal_Error(state, action: PayloadAction<any>) {\r\n      state.stockRenewalState.processing = false;\r\n    },\r\n    createStockRenewals(state, action: PayloadAction<StockRenewalState>) {\r\n      state.stockRenewalState.processing = true;\r\n      state.stockRenewalState.completed = undefined;\r\n      state.stockRenewalState.hasErrors = undefined;\r\n    },\r\n    createStockRenewals_Success(\r\n      state,\r\n      action: PayloadAction<{ hasErrors: boolean }>,\r\n    ) {\r\n      state.stockRenewalState.processing = false;\r\n      state.stockRenewalState.hasErrors = action.payload.hasErrors;\r\n      state.stockRenewalState.completed = true;\r\n    },\r\n    createStockRenewals_Error(state, action: PayloadAction<any>) {\r\n      state.stockRenewalState.processing = false;\r\n      state.stockRenewalState.completed = true;\r\n      state.stockRenewalState.hasErrors = true;\r\n    },\r\n    resetStockRenewalState(state, action: PayloadAction) {\r\n      state.stockRenewalState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        error: undefined,\r\n        dataLength: undefined,\r\n      };\r\n      state.processing = false;\r\n      state.stockRenewalValueHandler = undefined;\r\n      state.selectedServiceTypes = [];\r\n      state.barcodeScanned = undefined;\r\n      state.refeshOfflineServices = undefined;\r\n    },\r\n\r\n    setRenewStockValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof RenewStockState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setRenewStockValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof RenewStockState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.renewStockValueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetRenewStockValueHandler(state, action: PayloadAction) {\r\n      state.renewStockValueHandler = undefined;\r\n    },\r\n    initRenewStock(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: RenewStockParams;\r\n        service?: IOtherServices;\r\n      }>,\r\n    ) {\r\n      state.renewStockState = {\r\n        data: undefined,\r\n        processing: true,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        error: undefined,\r\n      };\r\n      state.renewStockValueHandler = undefined;\r\n    },\r\n    initRenewStock_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        data: IOtherServices;\r\n        isEdit: boolean;\r\n        serviceType: IOfflineServiceFilterDto | null;\r\n      }>,\r\n    ) {\r\n      state.renewStockState.processing = false;\r\n      state.renewStockState.data = ConvertRenewStockToModel(\r\n        action.payload.data,\r\n        action.payload.serviceType,\r\n      );\r\n      state.isEdit = action.payload.isEdit;\r\n    },\r\n    initRenewStock_Error(state, action: PayloadAction<any>) {\r\n      state.renewStockState.processing = false;\r\n    },\r\n    createRenewStock(\r\n      state,\r\n      action: PayloadAction<{\r\n        model: RenewStockState;\r\n        editCreatable: boolean;\r\n        preventRefreshTable?: boolean;\r\n        autoGenerateBatch?: boolean;\r\n        saveCreatable?: boolean;\r\n      }>,\r\n    ) {\r\n      state.renewStockState.processing = true;\r\n      state.renewStockState.completed = undefined;\r\n      state.renewStockState.hasErrors = undefined;\r\n    },\r\n    createRenewStock_Success(\r\n      state,\r\n      action: PayloadAction<{ hasErrors: boolean }>,\r\n    ) {\r\n      state.renewStockState.processing = false;\r\n      state.renewStockState.hasErrors = action.payload.hasErrors;\r\n      state.renewStockState.completed = true;\r\n    },\r\n    createRenewStock_Error(state, action: PayloadAction<any>) {\r\n      state.renewStockState.processing = false;\r\n      state.renewStockState.completed = true;\r\n      state.renewStockState.hasErrors = true;\r\n    },\r\n    updateRenewStock(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: OtherServiceDetailsState;\r\n        original: OtherServiceDetailsState;\r\n        editCreatable: boolean;\r\n        autoGenerateBatch?: boolean;\r\n      }>,\r\n    ) {\r\n      state.renewStockState.processing = true;\r\n      state.renewStockState.completed = undefined;\r\n      state.renewStockState.hasErrors = undefined;\r\n    },\r\n    updateRenewStock_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.renewStockState.processing = false;\r\n      state.renewStockState.hasErrors = action.payload.hasErrors;\r\n      state.renewStockState.completed = true;\r\n    },\r\n    updateRenewStock_Error(state, action: PayloadAction<any>) {\r\n      state.renewStockState.processing = false;\r\n      state.renewStockState.completed = true;\r\n      state.renewStockState.hasErrors = true;\r\n    },\r\n    resetRenewStockState(state, action: PayloadAction) {\r\n      state.renewStockState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        error: undefined,\r\n        dataLength: undefined,\r\n      };\r\n      state.processing = false;\r\n      state.renewStockValueHandler = undefined;\r\n      state.isEdit = undefined;\r\n    },\r\n    setInventoryBatchValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof InventoryBatchState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setInventoryBatchValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof InventoryBatchState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.inventoryBatchValueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetInventoryBatchValueHandler(state, action: PayloadAction) {\r\n      state.inventoryBatchValueHandler = undefined;\r\n    },\r\n    initInventoryBatch(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: InventoryBatchParams;\r\n        batch?: IInventoryBatchDto;\r\n      }>,\r\n    ) {\r\n      state.inventoryBatchState = {\r\n        data: undefined,\r\n        processing: true,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        error: undefined,\r\n      };\r\n      state.inventoryBatchValueHandler = undefined;\r\n    },\r\n    initInventoryBatch_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        data: IInventoryBatchDto;\r\n        isEdit: boolean;\r\n        serviceType: IOfflineServiceFilterDto | null;\r\n        newDate: Date | string;\r\n      }>,\r\n    ) {\r\n      state.inventoryBatchState.processing = false;\r\n      state.inventoryBatchState.data = ConvertInventoryBatchToModel(\r\n        action.payload.data,\r\n        action.payload.serviceType,\r\n        action.payload.newDate,\r\n      );\r\n      state.batchIsEdit = action.payload.isEdit;\r\n    },\r\n    initInventoryBatch_Error(state, action: PayloadAction<any>) {\r\n      state.inventoryBatchState.processing = false;\r\n    },\r\n    createInventoryBatch(\r\n      state,\r\n      action: PayloadAction<{\r\n        model: InventoryBatchState;\r\n        saveCreatable?: boolean;\r\n        preventRefreshTable?: boolean;\r\n      }>,\r\n    ) {\r\n      state.inventoryBatchState.processing = true;\r\n      state.inventoryBatchState.completed = undefined;\r\n      state.inventoryBatchState.hasErrors = undefined;\r\n    },\r\n    createInventoryBatch_Success(\r\n      state,\r\n      action: PayloadAction<{ hasErrors: boolean }>,\r\n    ) {\r\n      state.inventoryBatchState.processing = false;\r\n      state.inventoryBatchState.hasErrors = action.payload.hasErrors;\r\n      state.inventoryBatchState.completed = true;\r\n    },\r\n    createInventoryBatch_Error(state, action: PayloadAction<any>) {\r\n      state.inventoryBatchState.processing = false;\r\n      state.inventoryBatchState.completed = true;\r\n      state.inventoryBatchState.hasErrors = true;\r\n    },\r\n    updateInventoryBatch(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: InventoryBatchState;\r\n        original: InventoryBatchState;\r\n        saveCreatable?: boolean;\r\n        preventRefreshTable?: boolean;\r\n      }>,\r\n    ) {\r\n      state.inventoryBatchState.processing = true;\r\n      state.inventoryBatchState.completed = undefined;\r\n      state.inventoryBatchState.hasErrors = undefined;\r\n    },\r\n    updateInventoryBatch_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.inventoryBatchState.processing = false;\r\n      state.inventoryBatchState.hasErrors = action.payload.hasErrors;\r\n      state.inventoryBatchState.completed = true;\r\n    },\r\n    updateInventoryBatch_Error(state, action: PayloadAction<any>) {\r\n      state.inventoryBatchState.processing = false;\r\n      state.inventoryBatchState.completed = true;\r\n      state.inventoryBatchState.hasErrors = true;\r\n    },\r\n    resetInventoryBatchState(state, action: PayloadAction) {\r\n      state.inventoryBatchState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        error: undefined,\r\n        dataLength: undefined,\r\n      };\r\n      state.processing = false;\r\n      state.inventoryBatchValueHandler = undefined;\r\n      state.batchIsEdit = undefined;\r\n    },\r\n    setInventoryBatchEditable(\r\n      state,\r\n      action: PayloadAction<IInventoryBatchDto | undefined>,\r\n    ) {\r\n      state.inventoryBatchEditable = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: offlineServiceStateActions } = slice;\r\n\r\nexport const useOfflineServiceStateSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: offlineServiceStateSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useOfflineServiceStateSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { BasicTableRefreshEventHandler } from 'app/components/BasicTable/ControlledTable/ControlledTableProps';\r\nimport { Identifiable } from 'types/common';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { RunTypesUnion } from '../../components/RunTypePicker';\r\nimport { RUN_TYPES } from '../../components/RunTypePicker';\r\nimport { ISampleCreateBase } from '../../SamplePlatesPage/slice/types';\r\nimport { samplesListSaga } from './saga';\r\nimport {\r\n  IRunDetails,\r\n  ISample,\r\n  ISampleListTableState,\r\n  ISampleRun,\r\n  ISampleRunUpdate,\r\n  ISampleRunUpdateResponse,\r\n  ISamplesListState,\r\n  ISampleTarget,\r\n} from './types';\r\n\r\nexport const initialState: ISamplesListState = {\r\n  SamplesList: {\r\n    processing: false,\r\n  },\r\n  SamplesListTableState: {\r\n    pageSize: 10,\r\n    pageIndex: 0,\r\n    sortBy: [{ id: 'Id', desc: true }],\r\n    customFilters: [],\r\n    globalFilter: '',\r\n  },\r\n  EditMode: false,\r\n  SamplesSelected: [],\r\n  ShowRunDialog: false,\r\n  ImportStarted: false,\r\n  ImportFinished: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'samplesList',\r\n  initialState,\r\n  reducers: {\r\n    loadSamplesList(state, action: PayloadAction<ISampleListTableState>) {\r\n      state.SamplesList.processing = true;\r\n      state.SamplesListTableState = {\r\n        pageSize: action.payload.pageSize,\r\n        pageIndex: action.payload.pageIndex,\r\n        sortBy: action.payload.sortBy,\r\n        globalFilter: action.payload.globalFilter,\r\n        searchColumns: action.payload.searchColumns,\r\n        customFilters: action.payload.customFilters?.map(filter => ({\r\n          fieldName: filter.fieldName,\r\n          operator: filter.operator,\r\n          value: filter.value,\r\n        })),\r\n        serviceGroups:\r\n          action.payload.serviceGroups?.length !== 0\r\n            ? action.payload.serviceGroups\r\n            : undefined,\r\n      };\r\n    },\r\n    export(state, action: PayloadAction<ISampleListTableState>) {},\r\n    loadSamplesList_Success(state, action: PayloadAction<any>) {\r\n      state.SamplesList.processing = false;\r\n      state.SamplesList.error = undefined;\r\n      state.SamplesList.data = action.payload.value as ISample[];\r\n      state.SamplesList.dataLength = action.payload['@odata.count'];\r\n    },\r\n    loadSamplesList_Error(state, action: PayloadAction<string>) {\r\n      state.SamplesList.processing = false;\r\n      state.SamplesList.error = action.payload;\r\n    },\r\n    setSelectedSamples(state, action: PayloadAction<any>) {\r\n      state.SamplesSelected = action.payload;\r\n    },\r\n    loadAllFilteredSamples(state, action: PayloadAction<any>) {},\r\n    loadAllFilteredSamples_Success(state, action: PayloadAction<any>) {},\r\n\r\n    deleteSamples(\r\n      state,\r\n      action: PayloadAction<{\r\n        selectedRows: ISample[];\r\n        refresh: BasicTableRefreshEventHandler | undefined;\r\n      }>,\r\n    ) {},\r\n\r\n    updateField(state, action: PayloadAction<Partial<ISample>>) {\r\n      // update row in samples list\r\n      const item = state.SamplesList?.data?.find(\r\n        s => s.Id === action.payload.Id,\r\n      );\r\n      if (item !== undefined) {\r\n        Object.assign(item, action.payload);\r\n      }\r\n    },\r\n    updateField_Success(state, action: PayloadAction) {},\r\n    updateField_Error(state, action: PayloadAction) {},\r\n\r\n    loadRunDetqails<TRow extends IRow>(\r\n      state,\r\n      action: PayloadAction<{\r\n        id: number;\r\n        columns: Array<keyof TRow> | undefined;\r\n      }>,\r\n    ) {},\r\n    loadRunDetqails_Success(state, action: PayloadAction<IRunDetails>) {\r\n      state.RunDetails = action.payload;\r\n    },\r\n\r\n    runSelectedSamples(\r\n      state,\r\n      action: PayloadAction<{\r\n        runType?: RunTypesUnion;\r\n        samples: ISample[] | undefined;\r\n      }>,\r\n    ) {\r\n      state.SelectedRunType = action.payload.runType;\r\n    },\r\n    runSelectedSamples_Success(\r\n      state,\r\n      action: PayloadAction<ISampleTarget[]>,\r\n    ) {},\r\n    updateRunSampleValue(state, action: PayloadAction<Partial<ISampleTarget>>) {\r\n      const item = state.RunDetails?.Samples?.find(\r\n        s => s.Id === action.payload.Id,\r\n      );\r\n      if (item !== undefined) {\r\n        // set updated properties on original row\r\n        Object.assign(item, action.payload);\r\n\r\n        // in case of the Labeling run all of the Target* properties should be the same\r\n        // for all of the samples with the same ServiceRequest and same TMT_Set\r\n        // as these are combined into a singel sample upon run completionc\r\n        const rt = Object.keys(RUN_TYPES).find(k => k === 'Labeling');\r\n        if (state.RunDetails?.RunType === rt) {\r\n          const props: (keyof ISampleTarget)[] = [\r\n            'TargetConcentration',\r\n            'TargetPlateId',\r\n            'TargetPosition',\r\n            'TargetVolume',\r\n            'TargetTubeLabel',\r\n            'TargetSampleType',\r\n          ];\r\n          props.forEach(prop => {\r\n            if (action.payload[prop] !== undefined) {\r\n              const payloadWithoutId = {};\r\n              payloadWithoutId[prop] = item[prop];\r\n              state.RunDetails?.Samples?.filter(\r\n                s =>\r\n                  s.TMT_Set === item.TMT_Set &&\r\n                  s.ServiceRequestId === item.ServiceRequestId,\r\n              ).forEach(s => Object.assign(s, payloadWithoutId));\r\n            }\r\n          });\r\n        }\r\n      }\r\n    },\r\n\r\n    setShowRunDialog(state, action: PayloadAction<boolean>) {\r\n      state.ShowRunDialog = action.payload;\r\n    },\r\n    setRunType(state, action: PayloadAction<RunTypesUnion | undefined>) {\r\n      state.SelectedRunType = action.payload;\r\n      if (action.payload === undefined) {\r\n        return;\r\n      }\r\n      const runType = RUN_TYPES[action.payload];\r\n      switch (runType) {\r\n        case RUN_TYPES.StandardRun:\r\n          break;\r\n        case RUN_TYPES.MassSpec:\r\n          break;\r\n        case RUN_TYPES.Labeling:\r\n          break;\r\n      }\r\n    },\r\n    setShowImportDialog(state, action: PayloadAction<boolean>) {\r\n      state.ImportStarted = action.payload;\r\n      state.ImportFinished = false;\r\n    },\r\n    readImportFile(\r\n      state,\r\n      action: PayloadAction<{ file: File; plate: ISampleCreateBase | null }>,\r\n    ) {},\r\n    readImportFile_Success(\r\n      state,\r\n      action: PayloadAction<Array<Identifiable<number> & ISampleTarget>>,\r\n    ) {\r\n      action.payload.forEach(record => {\r\n        const sample = state.RunDetails?.Samples?.find(\r\n          sample => sample.Id === record.Id,\r\n        );\r\n        if (sample !== undefined) {\r\n          sample.TargetPosition = record.TargetPosition;\r\n          sample.TargetPlateId = record.TargetPlateId;\r\n\r\n          sample.TargetTubeLabel = record.TargetTubeLabel;\r\n          sample.TargetSampleType = record.TargetSampleType;\r\n\r\n          sample.TargetConcentration = record.TargetConcentration;\r\n          sample.TargetVolume = record.TargetVolume;\r\n        }\r\n      });\r\n      state.ImportStarted = false;\r\n      state.ImportFinished = true;\r\n    },\r\n\r\n    completeRun(state, aciton: PayloadAction<Partial<IRunDetails>>) {},\r\n    completeRun_Success(state, aciton: PayloadAction) {},\r\n    completeRun_Error(state, aciton: PayloadAction) {},\r\n    updateRun(state, aciton: PayloadAction<ISampleRunUpdate>) {},\r\n    updateRun_Success(\r\n      state,\r\n      aciton: PayloadAction<ISampleRunUpdateResponse | undefined>,\r\n    ) {\r\n      if (state.RunDetails !== undefined && aciton.payload !== undefined) {\r\n        state.RunDetails.Gradient = aciton.payload.Gradient;\r\n        state.RunDetails.Instrument = aciton.payload.Instrument;\r\n        state.RunDetails.SecondaryInstrument =\r\n          aciton.payload.SecondaryInstrument;\r\n        state.RunDetails.ACQUISITION_TYPE = aciton.payload.ACQUISITION_TYPE;\r\n      }\r\n    },\r\n    updateRun_Error(state, aciton: PayloadAction) {},\r\n\r\n    exportRun(state, action: PayloadAction<ISampleRun[]>) {},\r\n    toggleEditMode(state, action: PayloadAction<boolean>) {\r\n      state.EditMode = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: samplesListActions } = slice;\r\n\r\nexport const useSamplesListSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: samplesListSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useSamplesListSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n  selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport {\r\n  BasicTableProps,\r\n  IBasicTableState,\r\n  IRow,\r\n} from 'app/components/BasicTable';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useMemo } from 'react';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport {\r\n  defaultSerializer,\r\n  findIsfilterInversed,\r\n  setisInversedForUrl,\r\n  URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { GetPageFilters } from './BasicFilter/GetPageFilters';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { parseInt, trimEnd } from 'lodash';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport { FilterValueType } from './BasicFilter/FilterValueType';\r\nimport { getDependencyFilters } from './BasicFilter';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { TableSavedListSettings } from './BasicTableProps';\r\nimport { useProfileSetting } from './useProfileSetting';\r\nimport { parseProfileUrl } from './useProfileSetting/parseProfileUrl';\r\nimport { getNextFilter } from './getNextFilter';\r\nimport { getFilterValue } from './getFilterValue';\r\nimport { SAVEDVIEW_SEARCH_KEY } from './BasicFilter/SavedListsDropDown';\r\nimport { useSavedViewSlice } from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { initFilterData } from './initFilterData';\r\n\r\nexport function toURLSearchParams<TRow>(\r\n  items: Array<\r\n    Pick<\r\n      IFilterSettings<TRow>,\r\n      'queryStringSerializer' | 'value' | 'isInversed'\r\n    >\r\n  >,\r\n) {\r\n  var result = new URLSearchParams();\r\n  const serializableItems = items.filter(\r\n    element => element.queryStringSerializer !== undefined,\r\n  );\r\n  serializableItems.forEach(element => {\r\n    var value = element.value;\r\n\r\n    if (value !== undefined) {\r\n      const serializer =\r\n        typeof element.queryStringSerializer == 'string'\r\n          ? defaultSerializer(element.queryStringSerializer)\r\n          : element.queryStringSerializer;\r\n      const stringValue = serializer?.(value);\r\n      if (stringValue !== undefined) {\r\n        if (stringValue instanceof URLSearchParams) {\r\n          (stringValue as URLSearchParams).forEach((v, n) =>\r\n            result.set(n, setisInversedForUrl<string>(v, !!element.isInversed)),\r\n          );\r\n        }\r\n      }\r\n    }\r\n  });\r\n  return result;\r\n}\r\n/**\r\n *\r\n * @param savedFilterKey a key to save/load \"saved filters\" by\r\n * @param GetFiltersDefinition filters settings provider\r\n * @param getDefaultFilter default filters settlings\r\n * @param reservedQueryStringParameterNames query string parameter names to ignore\r\n * @param getRequiredFilter required filter settings provider\r\n * @param getSelectedViewFilter ??? something to do with ListId,AssetId\r\n * @param enableSavedLists adds a dropdown with \"saved list\" of instruments\r\n * @param useSyncSearch controls syncing of the filters state into the url's search parameter\r\n * @returns\r\n */\r\nexport function useFilters<TRow extends IRow>(\r\n  savedFilterKey: string,\r\n  GetFiltersDefinition: GetPageFilters<TRow>,\r\n  getDefaultFilter?: (user: IAuthenticatedUser) => URLSearchParams,\r\n  reservedQueryStringParameterNames?: string[],\r\n  getRequiredFilter?: (\r\n    search: string,\r\n    appSettings?: AppSettings | null,\r\n  ) => string | undefined,\r\n  getSelectedViewFilter?: (\r\n    search: string,\r\n    view: SavedViewSelected,\r\n  ) => string | undefined,\r\n  enableSavedLists?: boolean,\r\n  savedListSettings?: TableSavedListSettings<TRow>,\r\n  useCardsByDefault?: boolean,\r\n  /**\r\n   * Indicates wether filters should return partial results or only return fully loaded filters.\r\n   * By default this will first return Identifiable e.g. {Id:1} and after that the full entity e.g. {Id:1,Name:'Name'} when it'll be ready\r\n   */\r\n  getPartialResults?: boolean,\r\n  useSyncSearch: boolean = true,\r\n) {\r\n  const dispatch = useDispatch();\r\n  const { actions: savedViewActions } = useSavedViewSlice();\r\n  const { actions: appActions } = useAppSettingsSlice();\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const location = useLocation();\r\n  const showFiltersFn = React.useCallback(visibleFiltersFilter, []);\r\n  const rowsKey = savedFilterKey + '_rows';\r\n  const useCardsKey = savedFilterKey + '_useCardsMode';\r\n  const {\r\n    savedValue: savedUrl,\r\n    updateValue: updateSavedFilterValue,\r\n  } = useProfileSetting({\r\n    profileSettingKey: (savedFilterKey ?? location.pathname).toLowerCase(),\r\n  });\r\n  const { search: savedFilterValue } = parseProfileUrl(savedUrl);\r\n  const [filterChange, setFilterChange] = React.useState<boolean>(false);\r\n  React.useEffect(\r\n    () => {\r\n      if (authenticatedUser === undefined) {\r\n        return;\r\n      }\r\n      if (filterChange) {\r\n        setFilterChange(false);\r\n        return;\r\n      }\r\n      const defaultSearch = getPresetFilter(\r\n        savedFilterValue,\r\n        authenticatedUser,\r\n      );\r\n      const isDefault =\r\n        defaultSearch === undefined || (savedFilterValue ?? '') === '';\r\n\r\n      let search = isEmptyOrWhitespace(location.search)\r\n        ? defaultSearch ?? ''\r\n        : location.search;\r\n      const requiredSearch =\r\n        getRequiredFilter !== null && getRequiredFilter !== undefined\r\n          ? getRequiredFilter(search, appSettings)\r\n          : undefined;\r\n      search = requiredSearch === undefined ? search : requiredSearch ?? '';\r\n\r\n      const savedViewId = tryParseInt(\r\n        new URLSearchParamsCI(search).get(SAVEDVIEW_SEARCH_KEY),\r\n      );\r\n      dispatch(savedViewActions.selectSavedView(savedViewId));\r\n\r\n      // get the filters\r\n      const localizedFilters = getLocalizedFilters(search);\r\n      let visibleFilters = localizedFilters\r\n        ?.map(f =>\r\n          isDefault\r\n            ? mapDefaultFilters({\r\n                ...f,\r\n                isInversed: findIsfilterInversed(\r\n                  search,\r\n                  f.urlKey ??\r\n                    (typeof f.queryStringSerializer === 'string'\r\n                      ? f.queryStringSerializer\r\n                      : undefined),\r\n                ),\r\n              })\r\n            : {\r\n                ...f,\r\n                isInversed: findIsfilterInversed(\r\n                  search,\r\n                  f.urlKey ??\r\n                    (typeof f.queryStringSerializer === 'string'\r\n                      ? f.queryStringSerializer\r\n                      : undefined),\r\n                ),\r\n              },\r\n        )\r\n        .filter(showFiltersFn);\r\n      let depFilters = getDependencyFilters(visibleFilters);\r\n      if (getPartialResults !== true) {\r\n        setAppliedFilters(depFilters);\r\n      }\r\n      setAppliedFilters(initFilterData(depFilters, globalServiceGroupFilter));\r\n      if (!isEmptyOrWhitespace(search) && search !== location.search) {\r\n        dispatch(\r\n          routerActions.replace({\r\n            pathname: trimEnd(location.pathname, '?'),\r\n            search: search,\r\n          }),\r\n        );\r\n      }\r\n\r\n      const defaultRows = parseInt(\r\n        userProfileSettings.GetSettingByKeyOrDefault(rowsKey).Value ?? '',\r\n      );\r\n      setPageSize(isNaN(defaultRows) ? 10 : defaultRows);\r\n      if (useCardsByDefault !== undefined) {\r\n        const defaultCardsMode =\r\n          userProfileSettings.GetSettingByKeyOrDefault(useCardsKey).Value ?? '';\r\n        setCardsMode(\r\n          defaultCardsMode === ''\r\n            ? !!useCardsByDefault\r\n            : defaultCardsMode === true.toString(),\r\n        );\r\n      }\r\n    },\r\n    // globalServiceGroupFilter dependency has been added to reload the filters after globalServiceGroupFilter change. This is needed to remove/add service group related filter items from already loaded filters. e.g. a service that does not belong to newly selected service group/s\r\n    // other dependencies are excluded for backwards compatibility (this was previously executed in useEffectOnMount). This should probably changed some time later when there's no prod release around the corner\r\n    // location.pathname, location.search are needed to react for their changes\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [globalServiceGroupFilter, location.pathname, location.search],\r\n  );\r\n\r\n  const userProfileSettings = useSelector(selectUserProfileSettings);\r\n\r\n  const removeEmptyFilters = (\r\n    filter: string | undefined,\r\n  ): string | undefined => {\r\n    if (filter === undefined && filter === null) {\r\n      return undefined;\r\n    } else {\r\n      const params = new URLSearchParams(filter);\r\n      let newParams = new URLSearchParams();\r\n      for (const [name, value] of params) {\r\n        if (value !== undefined) {\r\n          newParams.append(name, value);\r\n        }\r\n      }\r\n      return newParams.toString();\r\n    }\r\n  };\r\n  function getPresetFilter(\r\n    savedFilter: string | undefined | null,\r\n    user: IAuthenticatedUser,\r\n  ): string | undefined {\r\n    const result =\r\n      savedFilter !== undefined && savedFilter !== null\r\n        ? removeEmptyFilters(savedFilter)\r\n        : getDefaultFilter !== undefined && getDefaultFilter !== null\r\n        ? getDefaultFilter(user)?.toString()\r\n        : undefined;\r\n    return result;\r\n  }\r\n\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const getLocalizedFilters = useMemo(() => {\r\n    const result = GetFiltersDefinition(\r\n      t,\r\n      appSettings,\r\n      authenticatedUser ?? null,\r\n      settings,\r\n    );\r\n    return result;\r\n  }, [GetFiltersDefinition, appSettings, authenticatedUser, settings, t]);\r\n\r\n  const allFilters = useMemo(() => {\r\n    var result = isEmptyOrWhitespace(location.search)\r\n      ? getLocalizedFilters('')\r\n      : getLocalizedFilters(location.search);\r\n    return result;\r\n  }, [getLocalizedFilters, location.search]);\r\n\r\n  const [appliedFilters, setAppliedFilters] = useAsyncExtendedState<\r\n    IFilterSettings<TRow>[] | undefined\r\n  >(undefined);\r\n\r\n  const [pageSize, setPageSize] = React.useState<number | undefined>();\r\n  const [pageIndex, setPageIndex] = React.useState<number | undefined>();\r\n\r\n  const [cardsMode, setCardsMode] = React.useState<boolean>(\r\n    !!useCardsByDefault,\r\n  );\r\n\r\n  const syncSearch = React.useCallback(\r\n    (newState: Array<IFilterSettings<TRow>>) => {\r\n      const currentSearch = getNextFilter(\r\n        newState,\r\n        location.search,\r\n        reservedQueryStringParameterNames,\r\n      );\r\n      const originalSearch = new URLSearchParamsCI(location.search);\r\n\r\n      // clear saved view selection when instrument selection changes\r\n      if (enableSavedLists && savedListSettings !== undefined) {\r\n        if (savedListSettings?.savedListSerializedKey !== undefined) {\r\n          const currentInstrumentSelection = currentSearch.get(\r\n            savedListSettings?.savedListSerializedKey,\r\n          );\r\n          const originalInstrumentSelection = originalSearch.get(\r\n            savedListSettings?.savedListSerializedKey,\r\n          );\r\n          if (currentInstrumentSelection !== originalInstrumentSelection) {\r\n            // remove the selection from the search\r\n            currentSearch.delete(SAVEDVIEW_SEARCH_KEY);\r\n            // clear redux state\r\n            dispatch(savedViewActions.selectMyList());\r\n          }\r\n        }\r\n      }\r\n\r\n      // push current filter state to the URL search if it's not equivalent\r\n      if (!originalSearch.equals(currentSearch)) {\r\n        const currentSearchString = currentSearch.toString();\r\n        // trim the question mark in case and for any reason the double question marks ended up saved in the \"saved filter\"\r\n        // in this case the search part will be OK, but the pathname will end with the question mark\r\n        // e.g. /reservations??eid=2 => pathName = \"/reservations?\"\r\n        const pathName = trimEnd(location.pathname, '?');\r\n        const url = pathName + '?' + currentSearchString;\r\n        updateSavedFilterValue(url);\r\n        dispatch(\r\n          routerActions.push({\r\n            pathname: location.pathname,\r\n            search: currentSearchString,\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [\r\n      dispatch,\r\n      enableSavedLists,\r\n      location.pathname,\r\n      location.search,\r\n      reservedQueryStringParameterNames,\r\n      savedListSettings,\r\n      savedViewActions,\r\n      updateSavedFilterValue,\r\n    ],\r\n  );\r\n\r\n  const handleFilterChange: (\r\n    items: IFilterSettings<TRow>[],\r\n  ) => void = React.useCallback(\r\n    items => {\r\n      const newState = [...items.filter(showFiltersFn)];\r\n\r\n      setAppliedFilters(getDependencyFilters(newState));\r\n      if (useSyncSearch) {\r\n        syncSearch(newState);\r\n      }\r\n      setFilterChange(true);\r\n    },\r\n    [setAppliedFilters, showFiltersFn, syncSearch, useSyncSearch],\r\n  );\r\n  const setFilterValueCallback = React.useCallback(\r\n    (id: string, value: FilterValueType) => {\r\n      if (allFilters === undefined) {\r\n        return;\r\n      }\r\n      const filter = allFilters?.find(f => f.id === id);\r\n      // in cases when applied filter is not defined call to setAppliedFilters will just only mutate appliedFilters array and cause duplicate/unnecessary invocation of hooks that have appliedFilters as a dependency\r\n      if (filter !== undefined) {\r\n        filter.value = value;\r\n        const x = allFilters\r\n          .map(f => (f === filter ? { ...filter, ...{ value: value } } : f))\r\n          .filter(showFiltersFn);\r\n        handleFilterChange(x);\r\n      }\r\n    },\r\n    [allFilters, handleFilterChange, showFiltersFn],\r\n  );\r\n  const getFilterValueCallback = React.useCallback(\r\n    (id: string) => {\r\n      const f = getFilterValue(appliedFilters, id);\r\n      return f;\r\n    },\r\n    [appliedFilters],\r\n  );\r\n\r\n  const handelPageSizeChange = (size: number) => {\r\n    if (!isNaN(size) && pageSize !== size && size > 0) {\r\n      setPageSize(size);\r\n      dispatch(appActions.savePageSize({ key: rowsKey, value: size }));\r\n    }\r\n  };\r\n  const handelPageIndexChange = (index: number) => {\r\n    if (!isNaN(index) && pageIndex !== index && index >= 0) {\r\n      setPageIndex(index);\r\n    }\r\n  };\r\n\r\n  const handleCardsModeChange = (isCardsMode: boolean) => {\r\n    if (cardsMode !== isCardsMode) {\r\n      setCardsMode(isCardsMode);\r\n      dispatch(\r\n        appActions.saveCardsMode({ key: useCardsKey, value: isCardsMode }),\r\n      );\r\n    }\r\n  };\r\n  const [defaultFilters, setDefaultFilters] = useAsyncExtendedState<\r\n    IFilterSettings<TRow>[]\r\n  >([]);\r\n  React.useEffect(() => {\r\n    const defaults = getDependencyFilters(\r\n      getLocalizedFilters(\r\n        getDefaultFilter?.(\r\n          authenticatedUser as IAuthenticatedUser,\r\n        )?.toString() ?? '',\r\n      )\r\n        .map(mapDefaultFilters)\r\n        .filter(showFiltersFn),\r\n    );\r\n    setDefaultFilters(defaults);\r\n    setDefaultFilters(initFilterData(defaults, globalServiceGroupFilter));\r\n  }, [\r\n    authenticatedUser,\r\n    getDefaultFilter,\r\n    getLocalizedFilters,\r\n    globalServiceGroupFilter,\r\n    setDefaultFilters,\r\n    showFiltersFn,\r\n  ]);\r\n  const getDefaultFilters = React.useCallback(() => {\r\n    return defaultFilters;\r\n  }, [defaultFilters]);\r\n\r\n  return {\r\n    allfilters: allFilters,\r\n    appliedFilters,\r\n    handleFilterChange,\r\n    handelPageSizeChange,\r\n    pageSize,\r\n    handelPageIndexChange,\r\n    pageIndex,\r\n    getFilterValue: getFilterValueCallback,\r\n    setFilterValue: setFilterValueCallback,\r\n    cardsMode,\r\n    onModeChange: handleCardsModeChange,\r\n    getDefaultFilters,\r\n  };\r\n}\r\n/**\r\n * Filter function to determine if the filter is needs to be shown\r\n * @param item\r\n * @returns\r\n */\r\nexport function visibleFiltersFilter<TRow>(item: IFilterSettings<TRow>) {\r\n  return item.value !== undefined || item.notNullable; //|| item.visible === true,\r\n}\r\n\r\nexport function mapDefaultFilters<TRow>(\r\n  item: IFilterSettings<TRow>,\r\n): IFilterSettings<TRow> {\r\n  return { ...item, value: !item.notDefault ? item.value ?? null : item.value };\r\n}\r\nexport interface IWithSavedHistoryComponentProps<TRow extends IRow> {\r\n  /**\r\n   * Innitial State of the filters container (close / open)\r\n   */\r\n  filterOpen?: boolean;\r\n  /**\r\n   * List of applicable filters\r\n   */\r\n  availableFilters?: IFilterSettings<TRow>[];\r\n\r\n  /**\r\n   * List of applicable filters\r\n   */\r\n  appliedFilters?: IFilterSettings<TRow>[];\r\n  /**\r\n   * Enables data export. On by default.\r\n   */\r\n  onFilterChange?: (items: IFilterSettings<TRow>[]) => void;\r\n\r\n  /**\r\n   * Initial table state. Part of the react-table API\r\n   * Example: \r\n   * {\r\n      sortBy: [{ id: 'Name', desc: false }],\r\n    }\r\n   */\r\n  initialState?: IBasicTableState<TRow>;\r\n  /**\r\n   * Id of the screen that table related to. Required!\r\n   */\r\n  screenId?: ScreensId;\r\n  /**\r\n   * Saved List settings\r\n   */\r\n  savedListSettings?: TableSavedListSettings<TRow>;\r\n  /**\r\n   * Retrieves curent value set in a filter\r\n   */\r\n  getFilterValue?: (id: string) => FilterValueType | undefined;\r\n  /**\r\n   * Updates the value of a filter\r\n   */\r\n  setFilterValue?: (id: string, value: FilterValueType) => void;\r\n  /**\r\n   * should use cards mode by default\r\n   */\r\n  useCardsByDefault?: boolean;\r\n  /**\r\n   * updates the card mode\r\n   */\r\n  onModeChange?: (isCardsMode: boolean) => void;\r\n  /**\r\n   * gets this pages default filters\r\n   */\r\n  getDefaultFilters?: () => IFilterSettings<TRow>[];\r\n}\r\n/**\r\n *\r\n * @param Component\r\n * @param savedFilterKey\r\n * @returns\r\n */\r\nexport function withSavedHistoryT<\r\n  TRow extends IRow,\r\n  TProps extends IWithSavedHistoryComponentProps<TRow> = BasicTableProps<TRow>\r\n>(\r\n  Component: React.FC<TProps>,\r\n  savedFilterKey: string,\r\n  GetFiltersDefinition: GetPageFilters<TRow>,\r\n  getDefaultFilter?: (user: IAuthenticatedUser) => URLSearchParams,\r\n  reservedQueryStringParameterNames?: string[],\r\n  getRequiredFilter?: (\r\n    search: string,\r\n    appSettings?: AppSettings | null,\r\n  ) => string | undefined,\r\n  getSelectedViewFilter?: (\r\n    search: string,\r\n    view: SavedViewSelected,\r\n  ) => string | undefined,\r\n  enableSavedLists?: boolean,\r\n  useCardsByDefault?: boolean,\r\n): React.FC<TProps> {\r\n  return ({\r\n    onFilterChange,\r\n    availableFilters,\r\n    initialState,\r\n    ...props\r\n  }: TProps) => {\r\n    const {\r\n      allfilters,\r\n      appliedFilters,\r\n      handleFilterChange,\r\n      handelPageSizeChange,\r\n      pageSize,\r\n      handelPageIndexChange,\r\n      pageIndex,\r\n      getFilterValue,\r\n      setFilterValue,\r\n      cardsMode,\r\n      onModeChange,\r\n      getDefaultFilters,\r\n    } = useFilters(\r\n      savedFilterKey,\r\n      GetFiltersDefinition,\r\n      getDefaultFilter,\r\n      reservedQueryStringParameterNames,\r\n      getRequiredFilter,\r\n      getSelectedViewFilter,\r\n      enableSavedLists,\r\n      props.savedListSettings,\r\n      useCardsByDefault,\r\n    );\r\n    return (\r\n      <>\r\n        {appliedFilters !== undefined && (\r\n          <Component\r\n            availableFilters={allfilters}\r\n            appliedFilters={appliedFilters}\r\n            onFilterChange={handleFilterChange}\r\n            onPageSizeChanged={handelPageSizeChange}\r\n            onPageIndexChanged={handelPageIndexChange}\r\n            initialState={{\r\n              pageSize: pageSize,\r\n              pageIndex: pageIndex !== undefined ? pageIndex : 0,\r\n              ...initialState,\r\n            }}\r\n            getFilterValue={getFilterValue}\r\n            setFilterValue={setFilterValue}\r\n            useCardsByDefault={cardsMode}\r\n            onModeChange={onModeChange}\r\n            getDefaultFilters={getDefaultFilters}\r\n            {...(props as TProps)}\r\n          />\r\n        )}\r\n      </>\r\n    );\r\n  };\r\n}\r\n\r\nexport function getIgnoredSearch(search: string, ignore: string[]) {\r\n  var p = new URLSearchParams(search);\r\n  [...p.keys()].forEach(key => {\r\n    if (!ignore.includes(key)) {\r\n      p.delete(key);\r\n    }\r\n  });\r\n\r\n  return p;\r\n}\r\nexport function combineSearch(search: string, other?: string) {\r\n  if (other === undefined) {\r\n    return search;\r\n  } else {\r\n    let p = new URLSearchParams(search);\r\n    let o = new URLSearchParams(other);\r\n    for (const key of o.keys()) {\r\n      if (!p.has(key)) {\r\n        const val = o.get(key);\r\n        if (val !== null) {\r\n          p.set(key, val);\r\n        }\r\n      }\r\n    }\r\n    return p.toString();\r\n  }\r\n}\r\n","import * as React from 'react';\r\nimport { StandardInput } from '../BaseInputs/StandardInput';\r\nimport clsx from 'clsx';\r\nimport {\r\n  FormControl,\r\n  FormHelperText,\r\n  InputLabel,\r\n  Select,\r\n  withStyles,\r\n} from '@material-ui/core';\r\nimport { BaseFieldProps } from './BaseFieldDefinition';\r\nimport FilledInput from '../BaseInputs/FilledInput';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport const styles = {\r\n  /* Styles applied to the root element. */\r\n  root: {\r\n    '&.startIcon': {\r\n      '& > label': {\r\n        marginLeft: '24px',\r\n      },\r\n    },\r\n  },\r\n};\r\nconst variantComponent = {\r\n  standard: StandardInput,\r\n  filled: FilledInput,\r\n  outlined: StandardInput,\r\n};\r\nexport const BaseField = React.forwardRef<any, BaseFieldProps>(function (\r\n  props,\r\n  ref,\r\n) {\r\n  const {\r\n    autoComplete,\r\n    autoFocus = false,\r\n    children,\r\n    classes,\r\n    className,\r\n    color = 'primary',\r\n    defaultValue,\r\n    disabled = false,\r\n    error = false,\r\n    FormHelperTextProps,\r\n    fullWidth = false,\r\n    helperText,\r\n    hiddenLabel,\r\n    id,\r\n    InputLabelProps,\r\n    inputProps,\r\n    InputProps,\r\n    inputRef,\r\n    focused,\r\n    label,\r\n    multiline = false,\r\n    name,\r\n    onBlur,\r\n    onChange,\r\n    onFocus,\r\n    placeholder,\r\n    required = false,\r\n    rows,\r\n    rowsMax,\r\n    rowsMin,\r\n    select = false,\r\n    SelectProps,\r\n    type,\r\n    value,\r\n    variant = 'filled',\r\n    info,\r\n    size = 'large',\r\n    ...other\r\n  } = props;\r\n\r\n  let inputMore: any = {};\r\n  if (variant === 'outlined') {\r\n    if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {\r\n      inputMore.notched = InputLabelProps.shrink;\r\n    }\r\n    if (label) {\r\n      const displayRequired = InputLabelProps?.required ?? required;\r\n      inputMore.label = (\r\n        <React.Fragment>\r\n          {label}\r\n          {displayRequired && '\\u00a0*'}\r\n        </React.Fragment>\r\n      );\r\n    }\r\n  }\r\n  // if (info) {\r\n  //   InputProps?.endAdornment = <InfoIcon title={info} />;\r\n  // }\r\n  if (select) {\r\n    // unset defaults from textbox inputs\r\n    if (!SelectProps || !SelectProps.native) {\r\n      inputMore.id = undefined;\r\n    }\r\n    inputMore['aria-describedby'] = undefined;\r\n  }\r\n  const requiredPlaseholder = placeholder !== undefined && required && !label;\r\n  const helperTextId = helperText && id ? `${id}-helper-text` : undefined;\r\n  const inputLabelId = label && id ? `${id}-label` : undefined;\r\n  const InputComponent = variantComponent[variant];\r\n  const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n  const InputElement = (\r\n    <InputComponent\r\n      aria-describedby={helperTextId}\r\n      autoComplete={autoComplete}\r\n      autoFocus={autoFocus}\r\n      defaultValue={defaultValue}\r\n      fullWidth={fullWidth}\r\n      multiline={multiline}\r\n      // margin={sizeLarge ? 'none' : size === undefined ? 'dense' : 'none'}\r\n      className={clsx(className, sizeClass, { noLabel: !label })}\r\n      name={name}\r\n      rows={rows}\r\n      rowsMax={rowsMax}\r\n      rowsMin={rowsMin}\r\n      type={type}\r\n      value={value}\r\n      id={id}\r\n      inputRef={inputRef}\r\n      onBlur={onBlur}\r\n      onChange={onChange}\r\n      onFocus={onFocus}\r\n      placeholder={requiredPlaseholder ? placeholder + '\\u00a0*' : placeholder}\r\n      inputProps={inputProps}\r\n      {...inputMore}\r\n      {...InputProps}\r\n    />\r\n  );\r\n  const LabelElement = (\r\n    <InputLabel\r\n      shrink={\r\n        InputLabelProps?.shrink || variant === 'standard' ? true : undefined\r\n      }\r\n      htmlFor={id}\r\n      id={inputLabelId}\r\n      className={clsx(InputLabelProps?.className, sizeClass)}\r\n      {...InputLabelProps}\r\n    >\r\n      {label}\r\n    </InputLabel>\r\n  );\r\n  return (\r\n    <FormControl\r\n      className={clsx(classes?.root, className, sizeClass, {\r\n        withLabel: !!label && (size === 'medium' || size === 'small'),\r\n      })}\r\n      disabled={disabled}\r\n      error={error}\r\n      fullWidth={fullWidth}\r\n      hiddenLabel={hiddenLabel}\r\n      ref={ref}\r\n      required={required}\r\n      focused={focused}\r\n      color={color}\r\n      variant={variant}\r\n      size={'medium'}\r\n      {...other}\r\n    >\r\n      {label && LabelElement}\r\n\r\n      {select ? (\r\n        <Select\r\n          aria-describedby={helperTextId}\r\n          id={id}\r\n          labelId={inputLabelId}\r\n          value={value}\r\n          input={InputElement}\r\n          variant={variant}\r\n          className={clsx(SelectProps?.className, sizeClass)}\r\n          {...SelectProps}\r\n        >\r\n          {children}\r\n        </Select>\r\n      ) : (\r\n        InputElement\r\n      )}\r\n\r\n      {helperText && (\r\n        <FormHelperText\r\n          id={helperTextId}\r\n          className={clsx(FormHelperTextProps?.className, sizeClass)}\r\n          {...FormHelperTextProps}\r\n        >\r\n          {typeof helperText === 'string'\r\n            ? helperText\r\n            : JSON.stringify(helperText, null, 2)}\r\n        </FormHelperText>\r\n      )}\r\n    </FormControl>\r\n  );\r\n});\r\nexport default withStyles(styles, { name: 'BaseTextField' })(BaseField);\r\n//export default function BaseField(props: BaseFieldProps): JSX.Element;\r\n","import { Menu, MenuProps } from '@material-ui/core';\r\nimport { ReactNode, useState } from 'react';\r\nimport { Button, ButtonProps } from '../BasicButtons/Button';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\n\r\nexport interface DropDownProps extends ButtonProps {\r\n  menuChildren: (onClose: () => void) => ReactNode | ReactNode[];\r\n  addChevron?: boolean;\r\n  menuProps?: Omit<MenuProps, 'children' | 'anchorEl' | 'open'>;\r\n  id?: string;\r\n  onOpen?: () => void;\r\n  onHandleClose?: () => void;\r\n  iconButton?: boolean;\r\n  disablePortal?: boolean;\r\n}\r\n\r\nexport const DropDown = ({\r\n  onClick,\r\n  onMouseDown,\r\n  children,\r\n  menuChildren,\r\n  menuProps,\r\n  addChevron,\r\n  id,\r\n  title,\r\n  onOpen,\r\n  onHandleClose,\r\n  iconButton,\r\n  disablePortal,\r\n  endIcon,\r\n  ...other\r\n}: DropDownProps) => {\r\n  const [open, setOpen] = useState(false);\r\n  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\r\n  const { marginThreshold, anchorOrigin, onClose, ...rest } = menuProps ?? {};\r\n  const handleOpen = e => {\r\n    setAnchorEl(e.currentTarget);\r\n    setOpen(!open);\r\n    if (!!onOpen) {\r\n      onOpen();\r\n    }\r\n  };\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n    setOpen(false);\r\n    if (onHandleClose) {\r\n      onHandleClose();\r\n    }\r\n  };\r\n  return (\r\n    <>\r\n      <React.Fragment>\r\n        {iconButton ? (\r\n          <IconButton\r\n            title={title}\r\n            aria-controls={id || 'custom-menu-button'}\r\n            onClick={e => {\r\n              handleOpen(e);\r\n              onClick?.(e);\r\n            }}\r\n            onMouseDown={e => {\r\n              handleOpen(e);\r\n              onMouseDown?.(e);\r\n            }}\r\n            aria-haspopup=\"true\"\r\n            // endIcon={\r\n            //   addChevron ? (\r\n            //     <Icon icon={open ? 'chevron-up' : 'chevron-down'} />\r\n            //   ) : undefined\r\n            // }\r\n            {...other}\r\n          >\r\n            {children}\r\n          </IconButton>\r\n        ) : (\r\n          <Button\r\n            title={title}\r\n            aria-controls={id || 'custom-menu-button'}\r\n            onClick={e => {\r\n              handleOpen(e);\r\n              onClick?.(e);\r\n            }}\r\n            onMouseDown={e => {\r\n              handleOpen(e);\r\n              onMouseDown?.(e);\r\n            }}\r\n            aria-haspopup=\"true\"\r\n            endIcon={\r\n              <React.Fragment>\r\n                {addChevron && !!endIcon ? (\r\n                  <span\r\n                    style={{\r\n                      display: 'flex',\r\n                      alignItems: 'center',\r\n                      gap: 8,\r\n                      width: '100%',\r\n                    }}\r\n                  >\r\n                    <Icon icon={open ? 'chevron-up' : 'chevron-down'} />\r\n                    {endIcon}\r\n                  </span>\r\n                ) : (\r\n                  <React.Fragment>\r\n                    {addChevron && (\r\n                      <Icon icon={open ? 'chevron-up' : 'chevron-down'} />\r\n                    )}\r\n                    {!!endIcon && endIcon}\r\n                  </React.Fragment>\r\n                )}\r\n              </React.Fragment>\r\n            }\r\n            {...other}\r\n          >\r\n            {children}\r\n          </Button>\r\n        )}\r\n      </React.Fragment>\r\n\r\n      <Menu\r\n        id={id || 'custom-menu-button'}\r\n        marginThreshold={marginThreshold ?? 1}\r\n        anchorEl={anchorEl}\r\n        getContentAnchorEl={null}\r\n        MenuListProps={{ dense: true }}\r\n        open={Boolean(anchorEl)}\r\n        container={document.fullscreenElement ?? document.body}\r\n        disablePortal={disablePortal}\r\n        onClose={(e, r) => {\r\n          handleClose();\r\n          onClose && onClose(e, r);\r\n        }}\r\n        anchorOrigin={\r\n          anchorOrigin ?? {\r\n            vertical: 'bottom',\r\n            horizontal: 'right',\r\n          }\r\n        }\r\n        transformOrigin={{ vertical: 'top', horizontal: 'center' }}\r\n        {...rest}\r\n      >\r\n        {open && menuChildren(handleClose)}\r\n      </Menu>\r\n    </>\r\n  );\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const DateRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n}) => {\r\n  const { t } = useTranslation();\r\n  return value === null || value === undefined ? (\r\n    <>{t(translations.NA)}</>\r\n  ) : (\r\n    <>{dateUtils.shortDateFormat(value)}</>\r\n  );\r\n};\r\nexport default DateRenderer;\r\n","export enum ArticleStatus {\r\n  AwaitingApproval,\r\n  Approved,\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.connectedFilters || initialState;\r\n\r\nexport const selectConnectedFilters = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectConnectedFiltersProcessing = createSelector(\r\n  [selectConnectedFilters],\r\n  state => state.processing,\r\n);\r\n\r\nexport const selectConnectedFiltersError = createSelector(\r\n  [selectConnectedFilters],\r\n  state => state.error,\r\n);\r\n\r\nexport const selectConnectedFiltersData = createSelector(\r\n  [selectConnectedFilters],\r\n  state => state.data,\r\n);\r\nexport const selectConnectedFieldHandler = createSelector(\r\n  [selectConnectedFilters],\r\n  state => state.connectedValueHandler,\r\n);\r\nexport const selectConnectedSettings = createSelector(\r\n  [selectConnectedFilters],\r\n  state => state.connectedSettings,\r\n);\r\n","/**\r\n *\r\n * OnlineServicePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { splitFilterValue } from 'app/components/BasicTable/types/FilterParam';\r\nexport type ServiceUrl = 'base' | 'admin' | 'reserved';\r\nexport interface OnlineServicePickerProps\r\n  extends Omit<AutocompleteMultiPickerExProps<IServiceFilterDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  urlType?: ServiceUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/ServiceFilter';\r\nconst adminUrl = '/api/odata/v4/ServiceFilter/AdminEquipments';\r\nconst reservableUrl = '/api/odata/v4/ServiceFilter/ReservableEquipments';\r\nexport const initOnlineServicesData = (\r\n  initval: string | undefined,\r\n  sourceurl?: ServiceUrl,\r\n  separator?: string,\r\n  serviceGroups?: Identifiable<number>[],\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    let ids = splitFilterValue(initval).map(item => {\r\n      return { Id: parseInt(item) };\r\n    }) as Identifiable<number>[];\r\n\r\n    let foo: string | undefined = undefined;\r\n    const predicates: string | Condition<IServiceFilterDto>[] = [];\r\n    if (ids.length > 0) {\r\n      predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n    }\r\n    // apply only global service group filter related items filter\r\n    // items not related to one of the selected cores are discarded\r\n    if (serviceGroups !== undefined && serviceGroups?.length > 0) {\r\n      predicates.push(\r\n        new Condition(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          serviceGroups.map(f => f.Id),\r\n        ),\r\n      );\r\n    }\r\n    foo = predicates.map(f => f.toString()).join(' and ');\r\n\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n      $expand: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: foo,\r\n      $skip: 0,\r\n      $top: 10,\r\n      $expand: 'WorkingHours',\r\n    };\r\n    let initUrl =\r\n      sourceurl === undefined\r\n        ? url\r\n        : sourceurl === 'reserved'\r\n        ? reservableUrl\r\n        : sourceurl === 'admin'\r\n        ? adminUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IServiceFilterDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  urlType: ServiceUrl | undefined,\r\n) =>\r\n  getAutoCompleteLoadDataFn<IServiceFilterDto>({\r\n    url:\r\n      urlType === 'reserved'\r\n        ? reservableUrl\r\n        : urlType === 'admin'\r\n        ? adminUrl\r\n        : url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'ServiceGroupId',\r\n      'ServiceTypeId',\r\n      'UseServiceGroupTrainingLevels',\r\n      'Color',\r\n      'ImageName',\r\n      'ServiceGroupName',\r\n      'RestrictDurationUnitsAmount',\r\n      'RestrictDurationUnitType',\r\n      'DefaultDuration',\r\n      'ForceFullDayReservations',\r\n      'AssemblyId',\r\n      'TopAssemblyId',\r\n      'AssetCatId',\r\n      'AssetCatName',\r\n      'RestrictReservationToTimeSlots',\r\n      'MinOrderHours',\r\n      'WorkingHours',\r\n    ],\r\n    expand: 'WorkingHours',\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IServiceFilterDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n\r\nexport function OnlineServiceMultiPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  urlType,\r\n  ...props\r\n}: OnlineServicePickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    globalServiceGroupFilter || [],\r\n    urlType,\r\n  );\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      variant={variant}\r\n      loadData={innerLoadData}\r\n      onChange={onChange}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'online-service-multi-filter'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={defaultValue ?? []}\r\n      label={label}\r\n      value={value ?? []}\r\n      ariaLabel={'Equipment search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\nexport function OnlineServiceSinglePicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  urlType,\r\n  ...props\r\n}: OnlineServicePickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    globalServiceGroupFilter || [],\r\n    urlType,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      variant={variant}\r\n      onChange={value => {\r\n        if (!!onChange) {\r\n          if (value !== null) {\r\n            return onChange([value]);\r\n          } else {\r\n            return onChange([]);\r\n          }\r\n        }\r\n      }}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'online-service-single-filter'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={\r\n        !!defaultValue\r\n          ? defaultValue.length > 0\r\n            ? (defaultValue[0] as IServiceFilterDto | undefined | null)\r\n            : undefined\r\n          : undefined\r\n      }\r\n      label={label}\r\n      value={\r\n        !!value\r\n          ? value.length > 0\r\n            ? (value[0] as IServiceFilterDto | undefined | null)\r\n            : undefined\r\n          : undefined\r\n      }\r\n      ariaLabel={'Equipment search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\n\r\nexport function RestrictedByAdminFilter(\r\n  admin?: IUserFilterDto,\r\n): (string | Condition<IServiceFilterDto>)[] {\r\n  const predicates: (string | Condition<IServiceFilterDto>)[] = [];\r\n  if (!!admin) {\r\n    if (!!admin.ServiceGroupIds && admin.ServiceGroupIds.length > 0) {\r\n      let ids = admin.ServiceGroupIds.map(f => {\r\n        return { Id: f } as Identifiable<number>;\r\n      });\r\n      predicates.push(\r\n        new Condition<IServiceFilterDto>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          ids,\r\n        ),\r\n      );\r\n    }\r\n    if (!!admin.Services && admin.Services.length > 0) {\r\n      let ids = admin.Services.filter(\r\n        f => f.ServiceTypeId === (ServiceType.Online as number),\r\n      ).map(f => {\r\n        return { Id: f.Id } as Identifiable<number>;\r\n      });\r\n      predicates.push(\r\n        new Condition<IServiceFilterDto>('Id', ODataOperators.Includes, ids),\r\n      );\r\n    }\r\n    if (predicates.length > 0) {\r\n      return [predicates.map(f => f.toString()).join(' or ')];\r\n    } else {\r\n      if (admin.IsAdminPanel) {\r\n        return [];\r\n      } else {\r\n        return [\r\n          new Condition<IServiceFilterDto>('Id', ODataOperators.Equals, 0),\r\n        ];\r\n      }\r\n    }\r\n  } else {\r\n    return [];\r\n  }\r\n}\r\nexport function ServiceGroupFilter(\r\n  serviceGroupId?: number,\r\n): (string | Condition<IServiceFilterDto>)[] {\r\n  const predicates: (string | Condition<IServiceFilterDto>)[] = [];\r\n  if (!!serviceGroupId) {\r\n    predicates.push(\r\n      new Condition<IServiceFilterDto>(\r\n        'ServiceGroupId',\r\n        ODataOperators.Equals,\r\n        serviceGroupId,\r\n      ),\r\n    );\r\n    return predicates;\r\n  } else {\r\n    return [];\r\n  }\r\n}\r\n","/**\r\n * Defines what the comment is referencing.\r\n * Keep synchronized with enum in backend when changing.\r\n */\r\nexport enum CommentReferenceTypes {\r\n  Alerts = 1,\r\n  Invoice = 2,\r\n  UserTraining = 3,\r\n  Budget = 4,\r\n  ServiceRequest = 5,\r\n  ServiceRequestTicket = 6,\r\n  ServiceRequestRow = 7,\r\n  batches = 8,\r\n  Article = 9,\r\n  Assets = 10,\r\n}\r\n","import { FormControl, FormLabel, styled } from '@material-ui/core';\r\nimport { FieldHookConfig } from 'formik';\r\nimport * as React from 'react';\r\nimport { Body } from '../Typography';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormLabelTextProps {\r\n  text?: React.ReactNode;\r\n  id?: string;\r\n}\r\nexport function FormLabelText({\r\n  label,\r\n  text,\r\n  html,\r\n  info,\r\n  fullWidth = true,\r\n  ...props\r\n}: FieldHookConfig<string> & IFieldProps & FormLabelTextProps) {\r\n  const StyledInfo = styled(InfoIcon)(({ theme }) => ({\r\n    marginLeft: theme.spacing(1),\r\n  }));\r\n  return (\r\n    <FormControl className={'formLabelText'} fullWidth={fullWidth}>\r\n      {label && (\r\n        <FormLabel>\r\n          <>\r\n            {label} {info && <StyledInfo title={info} />}\r\n          </>\r\n        </FormLabel>\r\n      )}\r\n      {text && (\r\n        <Body bold={true} size=\"small\">\r\n          {text}\r\n        </Body>\r\n      )}\r\n      {html}\r\n    </FormControl>\r\n  );\r\n}\r\n// const StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n//   color: theme.palette.common.graySubtitle,\r\n//   fontFamily: `'Lato', sans-serif`,\r\n//   fontStyle: 'normal',\r\n//   fontWeight: 400,\r\n//   fontSize: '12px',\r\n//   lineHeight: '141%',\r\n//   letterSpacing: '0.2px',\r\n//   '.Mui-focused &': {\r\n//     color: theme.palette.common.graySubtitle,\r\n//   },\r\n// }));\r\n","export enum TrainingState {\r\n  SignedUp = 1,\r\n  UnderMinimum = 2,\r\n  Available = 3,\r\n  Maximum = 4,\r\n}\r\n\r\nexport type TrainingStateUnion = keyof typeof TrainingState;\r\n","import {\r\n  OfflineServiceTypeUrl,\r\n  loadOfflineServiceData,\r\n} from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport {\r\n  InventoryBatchParams,\r\n  InventoryBatchResponse,\r\n  OfflineServiceQueryStringParameters,\r\n  OfflineServicesResponse,\r\n  RenewStockParams,\r\n  ServiceChangeStateParameters,\r\n  StockRenewalParams,\r\n} from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nimport { IInventoryBatchDto } from './odata/generated/entities/IInventoryBatchDto';\r\nimport { quoteODataValue } from './odata/ODataFilter';\r\n\r\nexport const OtherServicesApi = {\r\n  initOfflineService: (payload: OfflineServiceQueryStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/OtherServices/InitService`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertOtherService: (otherService: IOtherServices) => {\r\n    const url = '/api/odata/v4/OtherServices';\r\n    return httpClient.post(url, otherService);\r\n  },\r\n  insertConsumableServices: (otherServices: IOtherServices[]) => {\r\n    const url = '/api/odata/v4/OtherServices/CreateConsumables';\r\n    const data = {\r\n      params: otherServices,\r\n    };\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertStockRenewalServices: (otherServices: IOtherServices[]) => {\r\n    const url = '/api/odata/v4/OtherServices/CreateStockRenewals';\r\n    const data = {\r\n      params: otherServices,\r\n    };\r\n    return httpClient.post(url, data);\r\n  },\r\n  updateOtherService: (otherService: IOtherServices, rowId: number) => {\r\n    const url = '/api/odata/v4/OtherServices';\r\n    return httpClient.put<any, IResponseType>(\r\n      url + '(' + rowId + ')',\r\n      otherService,\r\n    );\r\n  },\r\n  deleteService: (Id: number) => {\r\n    const url = `/api/odata/v4/OtherServices/${Id}`;\r\n    return httpClient.deleteCustom<OfflineServicesResponse>(url);\r\n  },\r\n  isBudgetsTurnedOn: (offlineServiceTypeId: number) => {\r\n    const url = '/api/odata/v4/OtherServices/IsBudgetsTurnedOn';\r\n    const data = {\r\n      offlineServiceTypeId,\r\n    };\r\n    return httpClient.post(url, data);\r\n  },\r\n  calculateCredit: (calculateCreditModel: IOtherServices) => {\r\n    const url = '/api/odata/v4/OtherServices/CalculateCredit';\r\n    const data = {\r\n      params: calculateCreditModel,\r\n    };\r\n    return httpClient.post(url, data);\r\n  },\r\n  calculateTotalCredit: (calculateCreditModel: IOtherServices[]) => {\r\n    const url = '/api/odata/v4/OtherServices/CalculateTotalCredit';\r\n    const data = {\r\n      params: calculateCreditModel,\r\n    };\r\n    return httpClient.post(url, data);\r\n  },\r\n  getServiceChangeState: (payload: ServiceChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/OtherServices/GetServiceChangeState`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  getReservationOfflineServices: (reservationId: number, repeat?: boolean) => {\r\n    const url =\r\n      repeat === true\r\n        ? `/api/odata/v4/OtherServices/ReservationOfflineServices(key=${reservationId})`\r\n        : `/api/odata/v4/OtherServices/ReservationOfflineServicesWithParts(key=${reservationId})`;\r\n    return httpClient.get(url);\r\n  },\r\n  initConsumableServices: (payload: OfflineServiceQueryStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/OtherServices/InitConsumableServices`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  initStockRenewalServices: (payload: StockRenewalParams) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/OtherServices/InitStockRenewalServices`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  initRenewStockService: (payload: RenewStockParams) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/OtherServices/InitRenewStock`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  initInventoryBatch: (payload: InventoryBatchParams) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/InventoryBatches/InitInventoryBatch`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertInventoryBatch: (batch: IInventoryBatchDto) => {\r\n    const url = '/api/odata/v4/InventoryBatches';\r\n    return httpClient.post(url, batch);\r\n  },\r\n  updateInventoryBatch: (batch: IInventoryBatchDto, rowId: number) => {\r\n    const url = '/api/odata/v4/InventoryBatches';\r\n    return httpClient.put<any, IResponseType>(url + '(' + rowId + ')', batch);\r\n  },\r\n  deleteInventoryBatch: (batch: IInventoryBatchDto) => {\r\n    const url = `/api/odata/v4/InventoryBatches/${batch.Id}`;\r\n    return httpClient.deleteCustom<InventoryBatchResponse>(url);\r\n  },\r\n  getServiceType: (\r\n    payload: number | null,\r\n    urlType?: OfflineServiceTypeUrl,\r\n  ): Promise<IOfflineServiceFilterDto | null> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      if (payload === null || payload < 1) {\r\n        resolve(null);\r\n      } else {\r\n        try {\r\n          const data = await loadOfflineServiceData(\r\n            [`Id eq ${quoteODataValue(payload)}`],\r\n            'public',\r\n            [],\r\n            undefined,\r\n            'InventoryBatches',\r\n          )(null, undefined);\r\n          resolve(data.value[0] || null);\r\n        } catch (error) {\r\n          resolve(null);\r\n        }\r\n      }\r\n    });\r\n  },\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.workOrder || initialState;\r\n\r\nexport const selectWorkOrder = createSelector([selectSlice], state => state);\r\n\r\nexport const selectWorkOrderProcessing = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.processing,\r\n);\r\nexport const selectCreateWorkOrderProcessing = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.createState.processing,\r\n);\r\nexport const selectUpdateWorkOrderProcessing = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.updateState.processing,\r\n);\r\n\r\nexport const selectCreateWorkOrder = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.createState.data,\r\n);\r\nexport const selectUpdateWorkOrder = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.updateState.data,\r\n);\r\nexport const selectCreateWorkOrderCompleted = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.createState.completed,\r\n);\r\nexport const selectUpdateWorkOrderCompleted = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.updateState.completed,\r\n);\r\nexport const selectCreateWorkOrderHasError = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.createState.hasErrors,\r\n);\r\nexport const selectUpdateWorkOrderHasError = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.updateState.hasErrors,\r\n);\r\nexport const selectSendEmailOnResOffline = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.sendEmailOnOffline,\r\n);\r\nexport const selectReservationOffline = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.reservationOffline,\r\n);\r\nexport const selectFieldHandler = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.valueHandler,\r\n);\r\nexport const selectReservationOfflineData = createSelector(\r\n  [selectReservationOffline],\r\n  state => state.data,\r\n);\r\nexport const selectReservationOfflineProcessing = createSelector(\r\n  [selectReservationOffline],\r\n  state => state.processing,\r\n);\r\nexport const selectReservationOfflineCompleted = createSelector(\r\n  [selectReservationOffline],\r\n  state => state.completed,\r\n);\r\nexport const selectReservationOfflineHasErrors = createSelector(\r\n  [selectReservationOffline],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectReadonlyWorkOrder = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.readonlyState,\r\n);\r\nexport const selectUpdateAllRecurrent = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.updateAllRecurrent,\r\n);\r\nexport const selectOfflineEventStart = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.OfflineEventStart,\r\n);\r\nexport const selectOfflineEventEnd = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.OfflineEventEnd,\r\n);\r\nexport const selectSaveNewComments = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.doSaveNewComments,\r\n);\r\nexport const selectCreatedOrders = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.createdOrders,\r\n);\r\nexport const selectSavedLinkedOrders = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.savedLinkedOrders,\r\n);\r\n\r\nexport const selectCalibrationsChanged = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.calibrationsChanged,\r\n);\r\nexport const selectLinksProcessing = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.linksProcessing,\r\n);\r\nexport const selectDowntimeOverlaps = createSelector(\r\n  [selectWorkOrder],\r\n  state => state.downtimeOverlaps,\r\n);\r\n","import { InputAdornment, InputBaseComponentProps } from '@material-ui/core';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { omit } from 'lodash';\r\nimport * as React from 'react';\r\nimport BaseTextField from '../BaseTextField';\r\nimport { BaseInputFieldProps } from '../BaseTextField/BaseFieldDefinition';\r\nimport clsx from 'clsx';\r\n\r\nexport interface TextControlFieldProps extends BaseInputFieldProps {\r\n  info?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLTextAreaElement | HTMLInputElement>;\r\n  onChange?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\r\n  onFocus?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\r\n  startIcon?: React.ReactNode;\r\n  endIcon?: React.ReactNode;\r\n  autoFocus?: boolean;\r\n  variant?: 'standard' | 'outlined' | 'filled';\r\n  type?: React.InputHTMLAttributes<unknown>['type'];\r\n  min?: number;\r\n  max?: number;\r\n  className?: string;\r\n  inputProps?: InputBaseComponentProps;\r\n}\r\n\r\nexport function TextControlField({\r\n  info,\r\n  startIcon,\r\n  endIcon,\r\n  onBlur,\r\n  onChange,\r\n  onFocus,\r\n  autoFocus,\r\n  variant,\r\n  type,\r\n  inputProps,\r\n  className,\r\n  ...props\r\n}: TextControlFieldProps) {\r\n  const startIconComponent = startIcon && (\r\n    <InputAdornment position=\"start\">{startIcon}</InputAdornment>\r\n  );\r\n\r\n  const endIconComponent = (\r\n    <InputAdornment position=\"end\">{endIcon}</InputAdornment>\r\n  );\r\n  return (\r\n    <BaseTextField\r\n      onBlur={onBlur}\r\n      onChange={onChange}\r\n      onFocus={onFocus}\r\n      autoFocus={autoFocus}\r\n      variant={variant || 'filled'}\r\n      type={type || 'text'}\r\n      inputProps={inputProps}\r\n      placeholder={props.placeholder}\r\n      InputProps={{\r\n        startAdornment: startIcon && startIconComponent,\r\n        endAdornment:\r\n          (info && <InfoIcon title={info} />) || (endIcon && endIconComponent),\r\n      }}\r\n      className={clsx(className, {\r\n        startIcon: !!startIcon,\r\n        endIcon: !!endIcon,\r\n      })}\r\n      {...omit(props, 'DialogProps')}\r\n    ></BaseTextField>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport BaseTextField from '../BasicInputs/BaseTextField';\r\nimport { BaseFieldProps } from '../BasicInputs/BaseTextField/BaseFieldDefinition';\r\n\r\nexport const FormNumberField = ({\r\n  label,\r\n  onChange,\r\n  onBlur,\r\n  value,\r\n  name,\r\n  helperText,\r\n  noWarnOnNuN,\r\n  ...props\r\n}: FieldHookConfig<number> &\r\n  BaseFieldProps &\r\n  IFieldProps & {\r\n    noWarnOnNuN?: boolean;\r\n    customChange?: (val: string) => void;\r\n  }) => {\r\n  const [field, meta] = useField<number>({ name, ...props });\r\n  // const handleChange = e => {\r\n  //   var number = parseFloat(e.target.value);\r\n  //   if (isNaN(number)) {\r\n  //     if (noWarnOnNuN) {\r\n  //       onChange?.(e);\r\n  //       field.onChange(e);\r\n  //     } else {\r\n  //       console.warn(\r\n  //         `NaN value (\"${e.target.value}\") encountered in FormNumberField`,\r\n  //       );\r\n  //     }\r\n  //   } else {\r\n  //     onChange?.(e);\r\n  //     field.onChange(e);\r\n  //   }\r\n  // };\r\n  const handleChange = e => {\r\n    if (onChange !== undefined) {\r\n      onChange(e);\r\n    }\r\n    field.onChange(e);\r\n    props.customChange?.(e.target.value);\r\n  };\r\n  return (\r\n    <BaseTextField\r\n      InputProps={{\r\n        ...props.InputProps,\r\n        endAdornment: (\r\n          <React.Fragment>\r\n            {props.info ? <InfoIcon title={props.info} /> : null}\r\n            {props.InputProps?.endAdornment}\r\n          </React.Fragment>\r\n        ),\r\n      }}\r\n      variant=\"filled\"\r\n      fullWidth\r\n      autoFocus={props.autoFocus}\r\n      inputProps={{\r\n        ...props.inputProps,\r\n        type: 'number',\r\n        min: 0,\r\n        'aria-label': `${label ? undefined : 'number input'}`,\r\n      }}\r\n      value={field.value || ''}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      id={props.id || 'numberfieldId'}\r\n      label={label}\r\n      name={name}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error ?? helperText}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n","export interface ImportData {\r\n  ScreenId: number;\r\n  Columns: ImportColumn[];\r\n  AddOnly: boolean;\r\n  BudgetType?: number;\r\n  Iad?: ImportAdditionalData;\r\n  ImportAssetImageFiles: boolean;\r\n  AutoGenerateAssetNamesBasedOn?: number;\r\n  UpdateQRCode: boolean;\r\n}\r\nexport enum ImportAdditionalData {\r\n  none,\r\n  AssetRanges,\r\n  OfflineServiceTypes,\r\n  SampleTypes,\r\n}\r\nexport interface ImportColumn {\r\n  Include: boolean;\r\n  ExcelName: string | undefined;\r\n  Name: string | undefined;\r\n}\r\n\r\nexport enum ImportResult {\r\n  success,\r\n  error,\r\n  failed,\r\n  default,\r\n}\r\n\r\nexport interface ImportResponseData {\r\n  Result: number;\r\n  Rows: number;\r\n  InsertedRows: number;\r\n  UpdatedRows: number;\r\n  Errors: number;\r\n}\r\n\r\nexport interface TemplateColumns {\r\n  Id: string;\r\n  DisplayName: string;\r\n}\r\n","export enum PurchaseOrderOptions {\r\n  Hidden = 0,\r\n  Optional = 1,\r\n  Mandatory = 2,\r\n}\r\n","import { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport {\r\n  initUnitTypeData,\r\n  UnitType,\r\n  UnitTypePicker,\r\n} from 'app/components/pickers/AutocompletePickers/UnitTypePicker';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { translations } from 'locales/translations';\r\nimport { debounce } from 'lodash';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { valOrNull } from 'utils/typeUtils';\r\nimport { FilterValueType } from '../../BasicFilter/FilterValueType';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport interface AssetRangeType {\r\n  value: number | null;\r\n  unitType: UnitType | null;\r\n}\r\n\r\nexport function isAssetRangeType(\r\n  entity: FilterValueType | undefined,\r\n): entity is AssetRangeType {\r\n  if (valOrNull(entity) === null) return false;\r\n  return (\r\n    valOrNull((entity as AssetRangeType).value) !== null &&\r\n    valOrNull((entity as AssetRangeType).unitType) !== null\r\n  );\r\n}\r\n\r\nexport const initAssetRangeData = async (item: FilterValueType) => {\r\n  if (!isAssetRangeType(item) || valOrNull(item.unitType) === null) {\r\n    return Promise.resolve(item);\r\n  }\r\n  const id = item.unitType?.Id;\r\n  const val = item.value;\r\n  try {\r\n    const data = await initUnitTypeData(id?.toString());\r\n    return {\r\n      value: val,\r\n      unitType: data.length > 0 ? data[0] : null,\r\n    } as AssetRangeType;\r\n  } catch (error) {\r\n    return { value: val, unitType: null } as AssetRangeType;\r\n  }\r\n};\r\n\r\nexport const assetRangeCustomFilter = (\r\n  value: FilterValueType,\r\n  settings: IFilterSettings<IMyAssetsRow>,\r\n) => {\r\n  if (!isAssetRangeType(value)) return '';\r\n  const name = settings.fieldName;\r\n  const val = value.value ?? 1;\r\n  let predicates: string[] = [];\r\n  let filterBySelectedUnit = `${name}/any(g: g/UnitTypeId eq ${\r\n    value.unitType!.Id\r\n  } and g/MinValue le ${val} and g/MaxValue ge ${val})`;\r\n  predicates.push(filterBySelectedUnit);\r\n  if (value.unitType!.SourceUnits.length > 0) {\r\n    let sourceFilter = `${name}/any(g: ${value\r\n      .unitType!.SourceUnits.map(unit => {\r\n        const rate =\r\n          val / (unit.ConversionRate === 0 ? 1 : unit.ConversionRate);\r\n        return `(g/UnitTypeId eq ${unit.TargetId} and g/MinValue le ${rate} and g/MaxValue ge ${rate})`;\r\n      })\r\n      .join(' or ')})`;\r\n    predicates.push(sourceFilter);\r\n  }\r\n  if (value.unitType!.TargetUnits.length > 0) {\r\n    let targetFilter = `${name}/any(g: ${value\r\n      .unitType!.TargetUnits.map(unit => {\r\n        const rate =\r\n          val * (unit.ConversionRate === 0 ? 1 : unit.ConversionRate);\r\n        return `(g/UnitTypeId eq ${unit.TargetId} and g/MinValue le ${rate} and g/MaxValue ge ${rate})`;\r\n      })\r\n      .join(' or ')})`;\r\n    predicates.push(targetFilter);\r\n  }\r\n  // if (value.unitType!.SourceUnits.length === 0) {\r\n  //   res = `${name}/any(g: g/UnitTypeId eq ${\r\n  //     value.unitType!.Id\r\n  //   } and g/MinValue le ${val} and g/MaxValue ge ${val})`;\r\n  // } else {\r\n  //   const sourceConvert1 = value.unitType!.SourceUnits[0];\r\n  //   const unitId1 = sourceConvert1.TargetId;\r\n  //   const convert1 = sourceConvert1.ConversionRate || 1;\r\n  //   const sourceConvert2 = value.unitType!.SourceUnits[1] ?? sourceConvert1;\r\n  //   const unitId2 = sourceConvert2.TargetId;\r\n  //   const convert2 = sourceConvert2.ConversionRate || 1;\r\n  //   res = `${name}/any(g: (g/UnitTypeId eq ${\r\n  //     value.unitType!.Id\r\n  //   } and g/MinValue le ${val} and g/MaxValue ge ${val}) or (g/UnitTypeId eq ${unitId1} and g/MinValue le ${\r\n  //     val / convert1\r\n  //   } and g/MaxValue ge ${\r\n  //     val / convert1\r\n  //   }) or (g/UnitTypeId eq ${unitId2} and g/MinValue le ${\r\n  //     val / convert2\r\n  //   } and g/MaxValue ge ${val * convert2}))`;\r\n  // }\r\n\r\n  // res += ') or (';\r\n\r\n  // if (value.unitType!.TargetUnits.length === 0) {\r\n  //   res += `${name}/any(g: g/UnitTypeId eq ${\r\n  //     value.unitType!.Id\r\n  //   } and g/MinValue le ${val} and g/MaxValue ge ${val})`;\r\n  // } else {\r\n  //   const targetConvert1 = value.unitType!.TargetUnits[0];\r\n  //   const unitId1 = targetConvert1.TargetId;\r\n  //   const convert1 = targetConvert1.ConversionRate || 1;\r\n  //   const sourceConvert2 = value.unitType!.TargetUnits[1] ?? targetConvert1;\r\n  //   const unitId2 = sourceConvert2.TargetId;\r\n  //   const convert2 = sourceConvert2.ConversionRate || 1;\r\n  //   res += `${name}/any(g: (g/UnitTypeId eq ${\r\n  //     value.unitType!.Id\r\n  //   } and g/MinValue le ${val} and g/MaxValue ge ${val}) or (g/UnitTypeId eq ${unitId1} and g/MinValue le ${\r\n  //     val * convert1\r\n  //   } and g/MaxValue ge ${\r\n  //     val * convert1\r\n  //   }) or (g/UnitTypeId eq ${unitId2} and g/MinValue le ${\r\n  //     val * convert2\r\n  //   } and g/MaxValue ge ${val * convert2}))`;\r\n  // }\r\n\r\n  return '(' + predicates.join(' or ') + ')';\r\n};\r\n\r\nexport const assetRangeDisplay = (val: FilterValueType | undefined) => {\r\n  if (!isAssetRangeType(val)) return null;\r\n  return `${val.value} ${val.unitType?.Name}`;\r\n};\r\n\r\n/**\r\n *  must recieve CustomData as number else wont work\r\n */\r\nexport const AssetRangeFilter = ({\r\n  value,\r\n  onChange,\r\n  customData,\r\n  ...props\r\n}: IFilterComponentProps) => {\r\n  const { t } = useTranslation();\r\n  const [stateValue, setValue] = useState<AssetRangeType | null>(value);\r\n  const handleValChange: React.ChangeEventHandler<\r\n    HTMLTextAreaElement | HTMLInputElement\r\n  > = event => {\r\n    const newState = {\r\n      unitType: stateValue?.unitType ?? null,\r\n      value: +event.target.value ?? null,\r\n    };\r\n    setValue(newState);\r\n    if (\r\n      valOrNull(newState.unitType) !== null &&\r\n      valOrNull(newState.value) !== null\r\n    ) {\r\n      handleOnChange(newState);\r\n    }\r\n    // setValue(oldValue => {\r\n    //   const newState = {\r\n    //     unitType: oldValue?.unitType ?? null,\r\n    //     value: +event.target.value ?? null,\r\n    //   };\r\n    //   handleOnChange(newState);\r\n    //   return newState;\r\n    // });\r\n  };\r\n  const handleTypeChange = (val: UnitType | null) => {\r\n    const newState = {\r\n      unitType: val,\r\n      value: stateValue?.value ?? null,\r\n    };\r\n    setValue(newState);\r\n    if (\r\n      valOrNull(newState.unitType) !== null &&\r\n      valOrNull(newState.value) !== null\r\n    ) {\r\n      handleOnChange(newState);\r\n    }\r\n    // setValue(oldVal => {\r\n    //   const newState = {\r\n    //     unitType: val,\r\n    //     value: stateValue?.value ?? null,\r\n    //   };\r\n    //   handleOnChange(newState);\r\n    //   return newState;\r\n    // });\r\n  };\r\n  const handleOnChange = debounce(onChange, 250);\r\n  return (\r\n    <>\r\n      <TextControlField\r\n        value={stateValue?.value ?? ''}\r\n        type=\"number\"\r\n        onChange={handleValChange}\r\n        placeholder={props.label}\r\n        size=\"small\"\r\n        variant=\"standard\"\r\n        inputProps={{ 'aria-label': 'Number Start Filter' }}\r\n      />\r\n      <UnitTypePicker\r\n        placeholder={t(translations.PleaseSelectRangeUnitType)}\r\n        onChange={handleTypeChange}\r\n        value={stateValue?.unitType ?? null}\r\n        size=\"small\"\r\n        variant=\"standard\"\r\n        type={typeof customData === 'number' ? customData : 0}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { Column } from 'react-table';\r\nimport { IRow } from '../IRow';\r\n\r\nexport type ColumnWithDep<TRow extends IRow> = Column<TRow> & {\r\n  deps?: (keyof TRow)[];\r\n  notShowTitle?: boolean;\r\n};\r\n\r\nexport const hasDeps = <TRow extends IRow>(\r\n  column: Column<TRow>,\r\n): column is ColumnWithDep<TRow> => {\r\n  return column['deps'] !== undefined && Array.isArray(column['deps']);\r\n};\r\n","import { Column, SortingRule } from 'react-table';\r\nimport { Entity } from 'types/common';\r\nimport { IRow } from '..';\r\n\r\nexport function SortByComparer<TRow>(\r\n  prev: readonly [SortingRule<TRow>[] | undefined],\r\n  next: readonly [SortingRule<TRow>[] | undefined],\r\n) {\r\n  if (prev[0] === undefined && next[0] === undefined) {\r\n    return true;\r\n  } else if (prev[0] === undefined && next[0] !== undefined) {\r\n    return false;\r\n  } else if (next[0] === undefined && prev[0] !== undefined) {\r\n    return false;\r\n  } else {\r\n    if (prev[0]?.length === next[0]?.length) {\r\n      if (prev[0]?.length === 0 && next[0]?.length === 0) {\r\n        return true;\r\n      } else {\r\n        if (\r\n          prev[0]?.some(\r\n            f => !next[0]?.some(n => n.id === f.id && n.desc === f.desc),\r\n          )\r\n        ) {\r\n          return false;\r\n        } else {\r\n          return true;\r\n        }\r\n      }\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n}\r\nexport function ServiceGroupsComparer(\r\n  prev: readonly [Entity<number>[]],\r\n  next: readonly [Entity<number>[]],\r\n) {\r\n  if (!!prev[0]) {\r\n    if (prev[0].length === next[0].length) {\r\n      if (prev[0].length === 0 && next[0].length === 0) {\r\n        return true;\r\n      } else {\r\n        if (prev[0].some(f => !next[0].some(n => n.Id === f.Id))) {\r\n          return false;\r\n        } else {\r\n          return true;\r\n        }\r\n      }\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n  return false;\r\n}\r\nexport function columnsComparer<TRow extends IRow>(\r\n  prev: readonly [Column<TRow>[]],\r\n  next: readonly [Column<TRow>[]],\r\n) {\r\n  if (!!prev[0]) {\r\n    if (prev[0].length === next[0].length) {\r\n      if (prev[0].length === 0 && next[0].length === 0) {\r\n        return true;\r\n      } else {\r\n        if (prev[0].some(f => !next[0].some(n => n.accessor === f.accessor))) {\r\n          return false;\r\n        } else {\r\n          return true;\r\n        }\r\n      }\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n  return false;\r\n}\r\nexport function ColumnAccesorsComparer<TRow>(\r\n  prev: readonly [(keyof TRow)[] | undefined],\r\n  next: readonly [(keyof TRow)[] | undefined],\r\n) {\r\n  if (prev[0] === undefined && next[0] === undefined) {\r\n    return true;\r\n  } else if (prev[0] === undefined && next[0] !== undefined) {\r\n    return false;\r\n  } else if (next[0] === undefined && prev[0] !== undefined) {\r\n    return false;\r\n  } else {\r\n    if (prev[0]?.length === next[0]?.length) {\r\n      if (prev[0]?.length === 0 && next[0]?.length === 0) {\r\n        return true;\r\n      } else {\r\n        if (prev[0]?.some(f => !next[0]?.some(n => n === f))) {\r\n          return false;\r\n        } else {\r\n          return true;\r\n        }\r\n      }\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n}\r\n","/**\r\n *\r\n * BasicTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  UseSortByState,\r\n  UsePaginationState,\r\n  SortingRule,\r\n  TableState,\r\n  UseGroupByState,\r\n  Column,\r\n  UseRowSelectState,\r\n  UseGlobalFiltersState,\r\n} from 'react-table';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { CancelToken } from 'axios';\r\nimport { BasicTableProps } from './BasicTableProps';\r\nimport { IRow } from './IRow';\r\nimport { IFilterSettings } from './BasicFilter/IFilterSettings';\r\nimport {\r\n  getExportParameters,\r\n  buildURL,\r\n  openExportLink,\r\n  IPathAndQuery,\r\n  getExportForImportParameters,\r\n} from 'utils/url-utils';\r\nimport { Entity } from 'types/common';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n//import { Progress } from '../LoadingIndicator';\r\nimport { buildParams } from 'api/odata/ODataParamsBuilder';\r\nimport { useConfigurableColumns } from './useConfigurableColumns';\r\nimport { ControlledTable } from './ControlledTable';\r\nimport { useMemoFilters } from './useMemoFilters';\r\nimport { selectDoRefreshTable } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport { TableSkeleton } from './components/TableSkeleton';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { hasDeps } from './types/ColumnWithDeps';\r\nimport { notUndefined } from 'utils/typeUtils';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { getColumnAccessors, TryGetExportColumns } from './ConfigurableColumns';\r\nimport { BasicTableRefreshEventHandler } from './ControlledTable/ControlledTableProps';\r\nimport { useCustomCompareMemo } from 'use-custom-compare';\r\nimport {\r\n  ColumnAccesorsComparer,\r\n  columnsComparer,\r\n  ServiceGroupsComparer,\r\n  SortByComparer,\r\n} from './Comparers';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\n\r\nexport type { IRow };\r\nexport type { BasicTableProps };\r\n\r\ntype IPartialTableState<TRow extends IRow> = Partial<\r\n  UseSortByState<TRow> &\r\n    UsePaginationState<TRow> &\r\n    UseGroupByState<TRow> &\r\n    UseRowSelectState<TRow> &\r\n    UseGlobalFiltersState<TRow>\r\n>;\r\n\r\nconst REQUEST_CANCELLED_MESSAGE = 'Request cancelled (race condition)';\r\n/**\r\n * Interface to the (initial) table state\r\n */\r\nexport interface IBasicTableState<TRow extends IRow>\r\n  extends IPartialTableState<TRow> {}\r\n\r\ninterface IDataState<TRow> {\r\n  data?: TRow[];\r\n  dataLength?: number;\r\n  controlledPageCount?: number;\r\n  loading?: boolean;\r\n  initComplete: boolean;\r\n}\r\n\r\nconst defaultRowIdAccessor = <TRow extends IRow>(row: TRow): string =>\r\n  row.Id?.toString();\r\n/**\r\n * Server side driven Table component that will be reused in most of the pages\r\n * @param param0\r\n * @returns\r\n */\r\nexport function BasicTable<TRow extends IRow>({\r\n  id,\r\n  columns,\r\n  initialState,\r\n  api,\r\n  additionalColumns,\r\n  getRowId = defaultRowIdAccessor,\r\n  searchColumns,\r\n  useExport = true,\r\n  rowActions,\r\n  inlineRowActions,\r\n  pageActions,\r\n  screenName,\r\n  selectedRowsActions,\r\n  filterOpen = false,\r\n  screenId,\r\n  serviceGroups = [],\r\n  customParams,\r\n  useImportLink,\r\n  importLink,\r\n  importHandler,\r\n  needRefresh,\r\n  ServiceGroupsOptional,\r\n  topAlertMessage,\r\n  expandedColumns,\r\n  onPageSizeChanged,\r\n  onPageIndexChanged,\r\n  savedListSettings,\r\n  floatingTabSettings,\r\n  useExportForImport,\r\n  customEmptyTableSettings,\r\n  exportForImportFilterKey,\r\n  printing,\r\n  tableContainerSyles,\r\n  ...props\r\n}: BasicTableProps<TRow>) {\r\n  const isMobile = DetectIsMobile();\r\n\r\n  // data received from the server and displayed on the table\r\n  const [dataState, setDataState, extendDataState] = useAsyncExtendedState<\r\n    IDataState<TRow>\r\n  >({ initComplete: false });\r\n  // reference to the show/hide filters button\r\n  // data length - total number of the records\r\n  //const [dataLength, setDataLength] = React.useState(0);\r\n  // page count derived from total number of the records\r\n  // this is passed to the react-table hook\r\n  //const [controlledPageCount, setControlledPageCount] = React.useState(0);\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const dispatch = useDispatch();\r\n  const doRefresh = useSelector(selectDoRefreshTable);\r\n\r\n  const [tableState, setTableState] = React.useState<Partial<TableState<TRow>>>(\r\n    {\r\n      pageIndex: initialState?.pageIndex ?? 0,\r\n      pageSize:\r\n        printing !== undefined && printing.printing === true\r\n          ? 10000\r\n          : initialState?.pageSize ?? 10,\r\n      //sortBy, which is set to undefined, is subsequently changed to [], causing re-rendering.\r\n      //Assigning sortBy a value equal to [] is preventing re-rendering.\r\n      sortBy: initialState?.sortBy !== undefined ? initialState?.sortBy : [],\r\n      globalFilter: initialState?.globalFilter,\r\n    },\r\n  );\r\n  const handleChangeState = React.useCallback(state => {\r\n    setTableState(state);\r\n  }, []);\r\n  // custom useMemo Hook with deps comparision, the service groups array is changed even their contant is the same;\r\n  // to do: make a generic comparer.\r\n  const serviceGroupsCompared = useCustomCompareMemo(\r\n    () => {\r\n      return serviceGroups;\r\n    },\r\n    [serviceGroups],\r\n    ServiceGroupsComparer,\r\n  );\r\n  const additionalColumnsCompared = useCustomCompareMemo(\r\n    () => {\r\n      return additionalColumns;\r\n    },\r\n    [additionalColumns],\r\n    ColumnAccesorsComparer,\r\n  );\r\n  const columnsCompared = useCustomCompareMemo(\r\n    () => {\r\n      return columns;\r\n    },\r\n    [columns],\r\n    columnsComparer,\r\n  );\r\n  // take care of configurable columns\r\n  const {\r\n    configurableColumns,\r\n    handleConfigurableColumns,\r\n    configCompleted,\r\n    refreshConfigurableColumns,\r\n  } = useConfigurableColumns<TRow>({\r\n    screenId: screenId,\r\n    columns: columnsCompared,\r\n  });\r\n\r\n  const getDisplayColumns = React.useCallback(\r\n    ({\r\n      screenId,\r\n      configurableColumns,\r\n      configCompleted,\r\n      columns,\r\n    }): Column<TRow>[] | undefined => {\r\n      if (screenId === undefined) {\r\n        return columns;\r\n      } else if (configCompleted) {\r\n        return configurableColumns;\r\n      } else {\r\n        return undefined;\r\n      }\r\n    },\r\n    [],\r\n  );\r\n\r\n  //columnAccessors is changed several times on load Effect, so transformed to a function to control their content changed.\r\n  // const columnAccessors = React.useMemo(() => {\r\n  //   if (!configCompleted) {\r\n  //     return undefined;\r\n  //   }\r\n  //   const columnAccessors = getDisplayColumns({\r\n  //     screenId,\r\n  //     configurableColumns,\r\n  //     configCompleted,\r\n  //     columns,\r\n  //   });\r\n  //   const result =\r\n  //     columnAccessors === undefined\r\n  //       ? undefined\r\n  //       : getColumnAccessors(columnAccessors);\r\n  //   return result;\r\n  //   // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  // }, [configCompleted, screenId, configurableColumns, columns]);\r\n  const calculateColumnAccessors = React.useCallback(\r\n    (\r\n      columns: Column<TRow>[],\r\n      completed?: boolean,\r\n      screenId?: ScreensId,\r\n      configurableColumns?: Column<TRow>[],\r\n    ) => {\r\n      if (!completed) {\r\n        return undefined;\r\n      }\r\n      const columnAccessors = getDisplayColumns({\r\n        screenId,\r\n        configurableColumns,\r\n        configCompleted,\r\n        columns,\r\n      });\r\n      const result =\r\n        columnAccessors === undefined\r\n          ? undefined\r\n          : getColumnAccessors(columnAccessors);\r\n      return result;\r\n    },\r\n    [configCompleted, getDisplayColumns],\r\n  );\r\n  const getAllAdditionalColumns = React.useCallback(\r\n    (\r\n      columns: Column<TRow>[],\r\n      additionalColumns?: (keyof TRow)[],\r\n      completed?: boolean,\r\n      screenId?: ScreensId,\r\n      configurableColumns?: Column<TRow>[],\r\n    ) => {\r\n      if (!completed) {\r\n        return undefined;\r\n      }\r\n      const res = getDisplayColumns({\r\n        screenId,\r\n        configurableColumns,\r\n        configCompleted,\r\n        columns,\r\n      })\r\n        ?.filter(hasDeps)\r\n        .flatMap(c => c.deps)\r\n        .filter(notUndefined);\r\n      return [...(additionalColumns ?? []), ...(res ?? [])];\r\n    },\r\n    [configCompleted, getDisplayColumns],\r\n  );\r\n  //allAdditionalColumns is changed several times on load Effect, so transformed to a function to control their content changed.\r\n  // const allAdditionalColumns = React.useMemo(() => {\r\n  //   // early return in case and the config is not ready yet to prevent unnecessary fires of effects below that depend on this\r\n  //   if (!configCompleted) {\r\n  //     return undefined;\r\n  //   }\r\n  //   const res = getDisplayColumns({\r\n  //     screenId,\r\n  //     configurableColumns,\r\n  //     configCompleted,\r\n  //     columns,\r\n  //   })\r\n  //     ?.filter(hasDeps)\r\n  //     .flatMap(c => c.deps)\r\n  //     .filter(notUndefined);\r\n  //   return [...(additionalColumns ?? []), ...(res ?? [])];\r\n  // }, [\r\n  //   additionalColumns,\r\n  //   columns,\r\n  //   configCompleted,\r\n  //   configurableColumns,\r\n  //   getDisplayColumns,\r\n  //   screenId,\r\n  // ]);\r\n\r\n  // memo cleaned up filters without the Name which is loaded independently of the filter value and only affects appearance of the filter\r\n  const customFilter = useMemoFilters({ appliedFilters: props.appliedFilters });\r\n\r\n  const handleFilterChange = React.useCallback(\r\n    items => {\r\n      if (props.onFilterChange !== undefined) {\r\n        props.onFilterChange(items);\r\n      }\r\n    },\r\n    [props],\r\n  );\r\n\r\n  /**\r\n   * Fetch data method that retrieves the data according to the current table state\r\n   */\r\n  const fetchData = React.useCallback(\r\n    async (\r\n      state: {\r\n        api: string | IPathAndQuery;\r\n        predicates: Array<Condition<TRow> | string>;\r\n        pageSize: number;\r\n        pageIndex: number;\r\n        sortBy?: SortingRule<TRow>[] | null;\r\n        globalFilterValue?: string;\r\n        customFilter: IFilterSettings<TRow>[];\r\n        serviceGroups: Entity<number>[];\r\n        isOptionalServiceGroup: boolean;\r\n        columns: Array<keyof TRow>;\r\n        additionalColumns: Array<keyof TRow>;\r\n      },\r\n      cancelToken: CancelToken,\r\n    ) => {\r\n      extendDataState({ loading: true });\r\n      try {\r\n        // todo: add support for object notation accessors like 'foo.bar'\r\n        // todo: add support for accessor of type Function(originalRow, rowIndex) => any\r\n        const oDataParams = buildParams<TRow>(\r\n          {\r\n            ...state,\r\n            select: state.columns,\r\n            serviceGroups: state.serviceGroups,\r\n            expandedColumns: expandedColumns,\r\n          },\r\n          searchColumns,\r\n          customParams,\r\n        );\r\n        var { url, params } = getUrlAndParams(state.api, oDataParams);\r\n        const response = await httpClient.get(url, params, cancelToken);\r\n\r\n        const newState: IDataState<TRow> = {\r\n          loading: false,\r\n          initComplete: true,\r\n          data: response.value,\r\n          dataLength: response['@odata.count'],\r\n          controlledPageCount: Math.ceil(\r\n            response['@odata.count'] / state.pageSize,\r\n          ),\r\n        };\r\n        setDataState(newState);\r\n      } catch (error: unknown) {\r\n        // todo: show error message\r\n        const requestCancelled =\r\n          (error as any)?.message === REQUEST_CANCELLED_MESSAGE;\r\n        if (!requestCancelled) {\r\n          // console.error(error);\r\n          extendDataState({ loading: false, initComplete: true });\r\n        }\r\n      }\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [httpClient],\r\n  );\r\n\r\n  const pageIndex = React.useMemo(() => {\r\n    return tableState.pageIndex!;\r\n  }, [tableState.pageIndex]);\r\n  const pageSize = React.useMemo(() => {\r\n    return tableState.pageSize!;\r\n  }, [tableState.pageSize]);\r\n  // const sortBy = React.useMemo(() => {\r\n  //   return tableState.sortBy!;\r\n  // }, [tableState.sortBy]);\r\n  const sortBy = useCustomCompareMemo(\r\n    () => {\r\n      return tableState.sortBy!;\r\n    },\r\n    [tableState.sortBy],\r\n    SortByComparer,\r\n  );\r\n  const globalFilter = React.useMemo(() => {\r\n    return tableState.globalFilter;\r\n  }, [tableState.globalFilter]);\r\n  const titleKey = React.useMemo(() => {\r\n    const columnAccessors = calculateColumnAccessors(\r\n      columnsCompared,\r\n      configCompleted,\r\n      screenId,\r\n      configurableColumns,\r\n    );\r\n    return props.titleKey ?? columnAccessors?.[0] ?? '';\r\n  }, [\r\n    calculateColumnAccessors,\r\n    columnsCompared,\r\n    configCompleted,\r\n    configurableColumns,\r\n    props.titleKey,\r\n    screenId,\r\n  ]);\r\n  // connect table state changes to server data fetch side effect\r\n\r\n  React.useEffect(() => {\r\n    const cancelTokenSource = httpClient.cancelToken.source();\r\n    const allAdditionalColumns = getAllAdditionalColumns(\r\n      columnsCompared,\r\n      additionalColumnsCompared,\r\n      configCompleted,\r\n      screenId,\r\n      configurableColumns,\r\n    );\r\n    const columnAccessors = calculateColumnAccessors(\r\n      columnsCompared,\r\n      configCompleted,\r\n      screenId,\r\n      configurableColumns,\r\n    );\r\n    const columnsConfig = isFetchReady(\r\n      columnAccessors,\r\n      allAdditionalColumns,\r\n      configCompleted,\r\n    );\r\n    if (columnsConfig === false) {\r\n      return;\r\n    }\r\n    try {\r\n      fetchData(\r\n        {\r\n          api,\r\n          predicates: props.predicates ?? [],\r\n          pageIndex,\r\n          pageSize,\r\n          sortBy,\r\n          globalFilterValue: globalFilter as string,\r\n          customFilter: customFilter ?? [],\r\n          serviceGroups: serviceGroupsCompared,\r\n          isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n          ...columnsConfig,\r\n        },\r\n        cancelTokenSource.token,\r\n      );\r\n    } catch (error) {\r\n    } finally {\r\n    }\r\n    return () => {\r\n      cancelTokenSource.cancel(REQUEST_CANCELLED_MESSAGE);\r\n    };\r\n  }, [\r\n    ServiceGroupsOptional,\r\n    additionalColumnsCompared,\r\n    api,\r\n    calculateColumnAccessors,\r\n    columnsCompared,\r\n    configCompleted,\r\n    configurableColumns,\r\n    customFilter,\r\n    fetchData,\r\n    getAllAdditionalColumns,\r\n    globalFilter,\r\n    pageIndex,\r\n    pageSize,\r\n    props.predicates,\r\n    screenId,\r\n    serviceGroupsCompared,\r\n    sortBy,\r\n  ]);\r\n  const handleExportClick = async () => {\r\n    try {\r\n      /**\r\n       * export configurable columns should have been preloaded at this point and available immediately\r\n       * otherwise this could take a bit of the time to refetch columns data from the server\r\n       *  */\r\n      const exportColumnAccessors = await TryGetExportColumns(\r\n        screenId,\r\n        columnsCompared,\r\n        // isAuthenticated,\r\n      );\r\n\r\n      const { $top, $skip, ...tableParams } = buildParams(\r\n        {\r\n          pageIndex,\r\n          pageSize,\r\n          sortBy,\r\n          globalFilterValue: globalFilter as string,\r\n          customFilter: customFilter ?? [],\r\n          select: exportColumnAccessors ?? [],\r\n          additionalColumns: additionalColumnsCompared,\r\n          serviceGroups: serviceGroupsCompared,\r\n          isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n          expandedColumns: expandedColumns,\r\n          predicates: props.predicates ?? [],\r\n        },\r\n        undefined,\r\n        undefined,\r\n        true,\r\n      );\r\n\r\n      //BKT-7579\r\n      if (tableParams.$filter?.startsWith('() and ')) {\r\n        tableParams.$filter = tableParams.$filter.replace('() and ', '');\r\n      }\r\n\r\n      var oDataParams = getExportParameters(tableParams);\r\n      var { url, params } = getUrlAndParams(api, oDataParams);\r\n      if (screenId === undefined) {\r\n        params['unConfigured'] = true;\r\n      }\r\n      const exporturl = buildURL(url, params);\r\n      await openExportLink(exporturl);\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n  };\r\n  const getAllFilteredRows = async (prop: keyof TRow) => {\r\n    return new Promise<TRow[]>((resolve, reject) => {\r\n      const { $top, $skip, ...tableParams } = buildParams(\r\n        {\r\n          pageIndex,\r\n          pageSize,\r\n          sortBy,\r\n          globalFilterValue: globalFilter as string,\r\n          customFilter: customFilter ?? [],\r\n          select: [prop],\r\n          additionalColumns: additionalColumnsCompared,\r\n          serviceGroups: serviceGroupsCompared,\r\n          isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n          expandedColumns: undefined,\r\n          predicates: props.predicates ?? [],\r\n        },\r\n        undefined,\r\n        undefined,\r\n        true,\r\n      );\r\n      if (tableParams.$filter?.startsWith('() and ')) {\r\n        tableParams.$filter = tableParams.$filter.replace('() and ', '');\r\n      }\r\n\r\n      var oDataParams = getExportForImportParameters(tableParams);\r\n      var { url, params } = getUrlAndParams(api, oDataParams);\r\n      httpClient.get(url, params).then(response => {\r\n        resolve(response.value);\r\n      });\r\n      // try {\r\n      //   const response = await httpClient.get(url, params);\r\n      //   const rows: TRow[] = response.value;\r\n      //   resolve(rows.map(f => f.Id as number));\r\n      // } catch (error: unknown) {\r\n      //   resolve([]);\r\n      // }\r\n    });\r\n  };\r\n\r\n  const [allRowsSelected, setAllRowsSelected] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const toggleAllRowsSelected = React.useCallback((value?: boolean) => {\r\n    setAllRowsSelected(value);\r\n\r\n    //resets to undefined if false so that the useEffect will notice a change when next changed to false\r\n    // if (!value) {\r\n    //   setAllRowsSelected(undefined);\r\n    // }\r\n  }, []);\r\n\r\n  /**\r\n   * Reloads the table and unselects all rows\r\n   */\r\n  const handleRefresh = React.useCallback<BasicTableRefreshEventHandler>(\r\n    event => {\r\n      const allAdditionalColumns = getAllAdditionalColumns(\r\n        columnsCompared,\r\n        additionalColumnsCompared,\r\n        configCompleted,\r\n        screenId,\r\n        configurableColumns,\r\n      );\r\n      const columnAccessors = calculateColumnAccessors(\r\n        columnsCompared,\r\n        configCompleted,\r\n        screenId,\r\n        configurableColumns,\r\n      );\r\n      const columnsConfig = isFetchReady(\r\n        columnAccessors,\r\n        allAdditionalColumns,\r\n        configCompleted,\r\n      );\r\n      if (columnsConfig === false) {\r\n        return;\r\n      }\r\n      if (event?.reloadConfigurableColumns === true && screenId !== undefined) {\r\n        refreshConfigurableColumns();\r\n        return;\r\n      }\r\n      if (props.useRowSelect && !initialState?.selectedRowIds) {\r\n        toggleAllRowsSelected(false);\r\n      }\r\n      fetchData(\r\n        {\r\n          api,\r\n          predicates: props.predicates ?? [],\r\n          pageIndex,\r\n          pageSize,\r\n          sortBy,\r\n          globalFilterValue: globalFilter as string,\r\n          customFilter: customFilter ?? [],\r\n          serviceGroups: serviceGroupsCompared,\r\n          isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n          ...columnsConfig,\r\n        },\r\n        httpClient.cancelToken.source().token,\r\n      );\r\n    },\r\n    [\r\n      ServiceGroupsOptional,\r\n      additionalColumnsCompared,\r\n      api,\r\n      calculateColumnAccessors,\r\n      columnsCompared,\r\n      configCompleted,\r\n      configurableColumns,\r\n      customFilter,\r\n      fetchData,\r\n      getAllAdditionalColumns,\r\n      globalFilter,\r\n      initialState?.selectedRowIds,\r\n      pageIndex,\r\n      pageSize,\r\n      props.predicates,\r\n      props.useRowSelect,\r\n      refreshConfigurableColumns,\r\n      screenId,\r\n      serviceGroupsCompared,\r\n      sortBy,\r\n      toggleAllRowsSelected,\r\n    ],\r\n  );\r\n\r\n  const refreshFromState = React.useCallback(() => {\r\n    dispatch(layoutActions.setRefreshTable(false));\r\n    handleRefresh();\r\n  }, [dispatch, layoutActions, handleRefresh]);\r\n\r\n  React.useEffect(() => {\r\n    if (needRefresh !== undefined && needRefresh === true) {\r\n      handleRefresh();\r\n    }\r\n    if (doRefresh === true) {\r\n      refreshFromState();\r\n    }\r\n  }, [doRefresh, needRefresh, handleRefresh, refreshFromState]);\r\n\r\n  React.useEffect(() => {\r\n    onPageSizeChanged?.(pageSize);\r\n  }, [onPageSizeChanged, pageSize]);\r\n\r\n  React.useEffect(() => {\r\n    onPageIndexChanged?.(pageIndex);\r\n  }, [onPageIndexChanged, pageIndex]);\r\n\r\n  const loading = dataState?.loading ?? true;\r\n\r\n  if (dataState.initComplete !== true) {\r\n    return (\r\n      <Box component=\"div\" style={{ padding: 24 }}>\r\n        <TableSkeleton />\r\n      </Box>\r\n    );\r\n  }\r\n  return (\r\n    <ControlledTable\r\n      id={id}\r\n      api=\"foo\"\r\n      columns={configurableColumns || []} //(wrongColumnDefinition ? columns : [])\r\n      compact={props.compactTable ?? isMobile}\r\n      data={dataState?.data || []}\r\n      loading={loading}\r\n      dataLength={dataState?.dataLength || 0}\r\n      onChangeState={handleChangeState}\r\n      onExport={handleExportClick}\r\n      pageCount={dataState?.controlledPageCount || 0}\r\n      screenName={screenName}\r\n      serviceGroups={serviceGroupsCompared}\r\n      ServiceGroupsOptional={ServiceGroupsOptional}\r\n      additionalColumns={additionalColumnsCompared}\r\n      appliedFilters={props.appliedFilters}\r\n      availableFilters={props.availableFilters}\r\n      customParams={customParams}\r\n      filterOpen={filterOpen}\r\n      getRowId={getRowId}\r\n      importHandler={importHandler}\r\n      initialPageSize={pageSize}\r\n      initialState={initialState}\r\n      onDownloadTemplate={props.onDownloadTemplate}\r\n      onFilterChange={handleFilterChange}\r\n      pageActions={pageActions}\r\n      rowActions={rowActions}\r\n      searchColumns={searchColumns}\r\n      selectedRowsActions={selectedRowsActions}\r\n      onSelectedRowsChange={props.onSelectedRowsChange}\r\n      subHeader={props.subHeader}\r\n      topAlertMessage={topAlertMessage}\r\n      useExport={useExport}\r\n      onRefresh={handleRefresh}\r\n      onConfigurableColumns={handleConfigurableColumns}\r\n      useGlobalFilter={true}\r\n      useImportLink={useImportLink}\r\n      useRowSelect={props.useRowSelect}\r\n      screenId={screenId}\r\n      allRowsSelected={allRowsSelected}\r\n      importLink={importLink}\r\n      savedListSettings={savedListSettings}\r\n      imageSrcKey={props.imageSrcKey}\r\n      titleKey={titleKey}\r\n      allowCards={props.allowCards}\r\n      useCardsByDefault={props.useCardsByDefault}\r\n      primaryAction={props.primaryAction}\r\n      onModeChange={props.onModeChange}\r\n      withToolBar={props.withToolBar}\r\n      tabSectionSettings={props.tabSectionSettings}\r\n      floatingTabSettings={floatingTabSettings}\r\n      inlineRowActions={inlineRowActions}\r\n      isRowSelectable={props.isRowSelectable}\r\n      onSelectedChange={props.onSelectedChange}\r\n      hideMenuOnMobile={props.hideMenuOnMobile}\r\n      viewCardsCheck={props.viewCardsCheck}\r\n      cardSize={props.cardSize}\r\n      cardPosition={props.cardPosition}\r\n      useConfigurable={props.useConfigurable}\r\n      customToolbarSettings={props.customToolbarSettings}\r\n      preventInnerClicks={props.preventInnerClicks}\r\n      useExportForImport={useExportForImport}\r\n      customEmptyTableSettings={customEmptyTableSettings}\r\n      getAllFilteredRowsCallback={getAllFilteredRows}\r\n      exportForImportFilterKey={exportForImportFilterKey}\r\n      printing={printing}\r\n      hideFilters={props.hideFilters}\r\n      baseTableActionsOnToolbar={props.baseTableActionsOnToolbar}\r\n      screenNameVariant={props.screenNameVariant}\r\n      customExpandMenu={props.customExpandMenu}\r\n      customScreenName={props.customScreenName}\r\n      showGlobalSearchIconOnToolbar={props.showGlobalSearchIconOnToolbar}\r\n      toggleGlobalSearchIcon={props.toggleGlobalSearchIcon}\r\n      getDefaultFilters={props.getDefaultFilters}\r\n      importMenuItems={props.importMenuItems}\r\n      isContentEditable={props.isContentEditable}\r\n      tablePaddingVariant={props.tablePaddingVariant}\r\n      minCardHeight={props.minCardHeight}\r\n      tableContainerSyles={tableContainerSyles}\r\n    />\r\n  );\r\n}\r\nfunction getUrlAndParams(\r\n  api: string | IPathAndQuery,\r\n  oDataParams: {\r\n    $skip?: number;\r\n    $top?: number;\r\n    $count?: boolean;\r\n    $select?: string;\r\n    $orderby?: string | undefined;\r\n    $filter?: string | undefined;\r\n    $format?: string;\r\n    $expand?: string;\r\n  },\r\n) {\r\n  var url = typeof api === 'string' ? api : (api as IPathAndQuery).path;\r\n  var search = (api as IPathAndQuery).search;\r\n  const params = { ...oDataParams, ...search };\r\n  return { url, params };\r\n}\r\n\r\n/**\r\n * Determines if fetchData function is ready to be called\r\n * @param configCompleted configCompleted - sourced from the configurable columns\r\n * @param columnAccessors column accessors used to fetch data\r\n * @param allAdditionalColumns additional column accessors used to fetch data\r\n * @returns returns either false in the case and configurable columns will return a bit later, or non-undefined accessors that can be used in the fetchData function\r\n */\r\nfunction isFetchReady<TRow extends IRow>(\r\n  columnAccessors: Array<keyof TRow> | undefined,\r\n  allAdditionalColumns: Array<keyof TRow> | undefined,\r\n  configCompleted: boolean,\r\n):\r\n  | false\r\n  | {\r\n      columns: Array<keyof TRow>;\r\n      additionalColumns: Array<keyof TRow>;\r\n    } {\r\n  if (!configCompleted) {\r\n    return false;\r\n  } else if (columnAccessors === undefined) {\r\n    return false;\r\n  } else if (allAdditionalColumns === undefined) {\r\n    return false;\r\n  } else {\r\n    return {\r\n      columns: columnAccessors,\r\n      additionalColumns: allAdditionalColumns,\r\n    };\r\n  }\r\n}\r\n","import React from 'react';\r\nimport { isMobile, useMobileOrientation } from 'react-device-detect';\r\nimport { Theme, useTheme } from '@material-ui/core';\r\nexport interface IMobileDetector {\r\n  checkIsMobile: () => boolean;\r\n  orientation: 'portrait' | 'landscape';\r\n  isLandscape: boolean;\r\n  isPortrait: boolean;\r\n  isMobile: boolean;\r\n}\r\nexport const useIsMobile = (): IMobileDetector => {\r\n  const theme: Theme = useTheme();\r\n  const { orientation, isLandscape, isPortrait } = useMobileOrientation();\r\n  //const [mobile, setMobile] = React.useState<boolean>(false);\r\n\r\n  const checkIsMobile = React.useCallback((): boolean => {\r\n    return (\r\n      (isMobile && window.innerWidth < theme.breakpoints.values.md) ||\r\n      window.innerWidth < theme.breakpoints.values.md\r\n    );\r\n  }, [theme.breakpoints.values.md]);\r\n\r\n  // React.useEffect(() => {\r\n  //   console.log('deviceDetect: ', data);\r\n  //   setMobile(() => {\r\n  //     return (\r\n  //       (isMobile && window.innerWidth < theme.breakpoints.values.sm) ||\r\n  //       window.innerWidth < theme.breakpoints.values.sm\r\n  //     );\r\n  //   });\r\n  // }, [data, theme.breakpoints.values.sm]);\r\n  return { checkIsMobile, orientation, isLandscape, isPortrait, isMobile };\r\n};\r\n","import {\r\n  EquipmentsChangeStateParameters,\r\n  EquipmentSlotParameters,\r\n  ReservationInsertModel,\r\n  ReservationModel,\r\n  ReservationQueryStringParameters,\r\n  TransferToReservation,\r\n} from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { IStatusReservations } from 'app/pages/ReservationHistoryPage/IStatusReservations';\r\nimport { ITrainingReservations } from 'app/pages/ReservationHistoryPage/ITrainingReservations';\r\nimport { GroupedEquipments } from 'types/Equipments/types';\r\nimport { httpClient } from './HttpClient';\r\n\r\nimport { ISharedReservations } from 'app/pages/ReservationHistoryPage/ISharedReservations';\r\nimport { EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport const ReservationsApi = {\r\n  initReservation: (payload: ReservationQueryStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/InitReservation`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertReservation: (payload: ReservationInsertModel) => {\r\n    const url = `/api/odata/v4/Reservations`;\r\n    return httpClient.post(url, payload);\r\n  },\r\n  updateReservation: (payload: ReservationModel) => {\r\n    const url = `/api/odata/v4/Reservations(${payload.Id})`;\r\n    return httpClient.put(url, payload);\r\n  },\r\n  getReservation: (id: number, params: object) => {\r\n    const url = `/api/odata/v4/reservations/${id}`;\r\n    return httpClient.get<ReservationModel>(url, params);\r\n  },\r\n  getReservationUserTrainingEquipments: (id: number, params?: object) => {\r\n    const url = `/api/odata/v4/reservations/${id}/UserTrainingEquipments`;\r\n    return httpClient.get<ReservationModel>(url, params);\r\n  },\r\n  hasAnyFirstReservations: (\r\n    ids: string,\r\n    user: string,\r\n    reservationId: number,\r\n  ) => {\r\n    const url = `/api/odata/v4/Reservations/HasAnyFirstReservation`;\r\n    return httpClient.post(url, { ids: ids, user: user, id: reservationId });\r\n  },\r\n  getEquipmentsChangeState: (payload: EquipmentsChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = '/api/odata/v4/Reservations/GetEquipmentsChangeState';\r\n    return httpClient.post(url, data);\r\n  },\r\n  getValidationState: (payload: EquipmentsChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/GetReservationValidationState`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  getReservationSlots: (payload: EquipmentSlotParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/GetReservationSlots`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  validateDuration: (payload: EquipmentsChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/ValidateDuration`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  validatePrerequisite: (payload: EquipmentsChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/ValidatePrerequisite`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  validatePermissions: (payload: EquipmentsChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/ValidatePermissions`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  changeStatus: (payload: EquipmentsChangeStateParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/ChangeStatus`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  getEquipmentsData: (payload: {\r\n    q?: string;\r\n    value?: string;\r\n    ids?: string;\r\n    sgid?: string;\r\n    avaEqu: boolean;\r\n    resStart?: string;\r\n    resEnd?: string;\r\n    budgetId?: number;\r\n    budgetExperimentId?: number;\r\n    mandatoryIds?: string;\r\n    init?: boolean;\r\n  }) => {\r\n    const url = '/api/scheduler/reservationEquipments';\r\n    return httpClient.get<GroupedEquipments[]>(url, payload);\r\n  },\r\n  createTraining: (payload: ITrainingReservations[]) => {\r\n    const data = {\r\n      reservations: payload,\r\n    };\r\n    const url = '/api/odata/v4/ReservationHistory/CreateTraining';\r\n    return httpClient.post(url, data);\r\n  },\r\n  updateStatus: (payload: IStatusReservations[]) => {\r\n    const data = {\r\n      reservations: payload,\r\n    };\r\n    const url = '/api/odata/v4/ReservationHistory/UpdateStatus';\r\n    return httpClient.post(url, data);\r\n  },\r\n  HasFutureReservationsHttp: (equipmentNames: ISharedReservations[]) => {\r\n    const data = {\r\n      reservations: equipmentNames,\r\n    };\r\n    // '/api/odata/v4/ReservationHistory/HasEquipmentFutureReservations'\r\n    // /api/ICalController/HasFutureReservations\r\n    const url = '/api/odata/v4/ReservationHistory/HasFutureReservations';\r\n    return httpClient.get<boolean>(url, data);\r\n  },\r\n  transferReservation: (payload: TransferToReservation) => {\r\n    const data = {\r\n      params: {\r\n        User: payload.User.Id,\r\n        ReservationId: payload.ReservtionId,\r\n      },\r\n    };\r\n    const url = `/api/odata/v4/Reservations/TransferReservation`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  sendTransferNotification: (payload: TransferToReservation) => {\r\n    const data = {\r\n      params: {\r\n        User: payload.User.Id,\r\n        ReservationId: payload.ReservtionId,\r\n      },\r\n    };\r\n    const url = `/api/odata/v4/Reservations/SendTranserNotification`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  sendCancelTransferNotification: (payload: TransferToReservation) => {\r\n    const data = {\r\n      params: {\r\n        User: payload.User.Id,\r\n        ReservationId: payload.ReservtionId,\r\n      },\r\n    };\r\n    const url = `/api/odata/v4/Reservations/SendCancelTranserNotification`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  cancelTransferReservation: (payload: number) => {\r\n    const url = `/api/odata/v4/Reservations/CancelTranser`;\r\n    return httpClient.post(url, { id: payload });\r\n  },\r\n  sendTerminateNotification: (payload: number[]) => {\r\n    const data = {\r\n      ReservationIds: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/SendTerminateNotification`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  hasUsage: (payload: { resId: number; eqId: number }) => {\r\n    const url = `/api/odata/v4/Reservations/HasUsage`;\r\n    return httpClient.post(url, { id: payload.resId, eqid: payload.eqId });\r\n  },\r\n  endUsage: (id: number, data: EndUsageData): Promise<IResponseType> => {\r\n    const url = `/api/odata/v4/Reservations/EndReservationUsage`;\r\n    const params = {\r\n      id: id,\r\n      remarks: data.remarks ?? '',\r\n      sids:\r\n        data.services.map(s => s.service?.Id + ':' + s.quantity).join(',') ??\r\n        '',\r\n    };\r\n    return httpClient.post(url, params);\r\n  },\r\n  userCanBookEquipment: (payload: number) => {\r\n    const data = {\r\n      equipmentid: payload,\r\n    };\r\n    const url = `/api/odata/v4/Reservations/UserCanBookEquipment`;\r\n    return httpClient.post(url, data);\r\n  },\r\n\r\n  // calculateCredit: (payload: ReservationCreditModel) => {\r\n  //   const url = `/api/odata/v4/Reservations/CalculateReservationCredit`;\r\n  //   // const data = {\r\n  //   //   Id: payload.Id,\r\n  //   //   Services: payload.Services,\r\n  //   //   //AccServices: payload.AccServices,\r\n  //   //   Username: payload.Username,\r\n  //   //   UserGroupId: payload.UserGroupId,\r\n  //   //   BudgetId: payload.BudgetId,\r\n  //   //   Tutoring: payload.Tutoring,\r\n  //   //   TrainingSignUp: payload.TrainingSignUp,\r\n  //   //   BudgetPercent: payload.BudgetPercent,\r\n  //   // };\r\n  //   return httpClient.post(url, payload);\r\n  // },\r\n};\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nexport enum RenderTypes {\r\n  AddToList = 0,\r\n  AddWorkOrder,\r\n  DownWorkOrder,\r\n  BringBackUp,\r\n  OpenCalendar,\r\n  OpenTimeline,\r\n  OpenWorkOrder,\r\n  OpenWorkOrders,\r\n  NewReservation,\r\n  CloneEquipments,\r\n  DownloadImages,\r\n  ExportQRCodes,\r\n  PrintAssetLabels,\r\n  ExportForImport,\r\n}\r\n\r\nexport const AllowedToRender = (\r\n  user: AuthenticatedUser | undefined,\r\n  renderType: RenderTypes,\r\n  asset: IAssetDto,\r\n) => {\r\n  return (\r\n    AllowedByRolePermissions(user, renderType, asset) &&\r\n    AvailableByServiceType(asset.ServiceTypeId ?? -1, renderType) &&\r\n    AvailableByAvailabilityType(\r\n      asset.Availability !== undefined ? asset.Availability.Id : -1,\r\n      renderType,\r\n    )\r\n  );\r\n};\r\nexport const AllowedByRolePermissions = (\r\n  user: AuthenticatedUser | undefined,\r\n  renderType: RenderTypes,\r\n  asset: IAssetDto,\r\n) => {\r\n  switch (renderType) {\r\n    case RenderTypes.AddToList:\r\n    case RenderTypes.AddWorkOrder:\r\n    case RenderTypes.OpenCalendar:\r\n    case RenderTypes.OpenTimeline:\r\n    case RenderTypes.OpenWorkOrder:\r\n    case RenderTypes.OpenWorkOrders:\r\n    case RenderTypes.NewReservation:\r\n      return true;\r\n    case RenderTypes.DownWorkOrder:\r\n    case RenderTypes.BringBackUp:\r\n    case RenderTypes.ExportQRCodes:\r\n    case RenderTypes.PrintAssetLabels:\r\n      if (!user) {\r\n        return false;\r\n      }\r\n      return (\r\n        user.HasAdminGroupPermissions(asset.ServiceGroupId ?? undefined) ||\r\n        user.HasAdminServicePermissions(\r\n          asset.ServiceTypeId ?? 0,\r\n          asset.ServiceId ?? undefined,\r\n        ) ||\r\n        user.HasLabTechGroupPermissions(asset.ServiceGroupId ?? undefined)\r\n      );\r\n    case RenderTypes.CloneEquipments:\r\n    case RenderTypes.DownloadImages:\r\n    case RenderTypes.ExportForImport:\r\n      if (!user) {\r\n        return false;\r\n      }\r\n      return (\r\n        user.HasAdminGroupPermissions(asset.ServiceGroupId ?? undefined) ||\r\n        user.HasAdminServicePermissions(\r\n          asset.ServiceTypeId ?? 0,\r\n          asset.ServiceId ?? 0,\r\n        )\r\n      );\r\n    default:\r\n      return false;\r\n  }\r\n};\r\n\r\nexport const AvailableByServiceType = (\r\n  serviceType: number,\r\n  renderType: RenderTypes,\r\n) => {\r\n  if (serviceType === -1) {\r\n    return false;\r\n  }\r\n  let serType = serviceType as ServiceType;\r\n  switch (renderType) {\r\n    case RenderTypes.AddToList:\r\n    case RenderTypes.AddWorkOrder:\r\n    case RenderTypes.BringBackUp:\r\n    case RenderTypes.OpenCalendar:\r\n    case RenderTypes.OpenTimeline:\r\n    case RenderTypes.OpenWorkOrder:\r\n    case RenderTypes.OpenWorkOrders:\r\n    case RenderTypes.DownWorkOrder:\r\n    case RenderTypes.NewReservation:\r\n    case RenderTypes.CloneEquipments:\r\n      return serType === ServiceType.Online;\r\n    case RenderTypes.DownloadImages:\r\n    case RenderTypes.ExportForImport:\r\n      return (\r\n        serType === ServiceType.Online ||\r\n        serType === ServiceType.Offline ||\r\n        serType === ServiceType.Sample\r\n      );\r\n    case RenderTypes.ExportQRCodes:\r\n    case RenderTypes.PrintAssetLabels:\r\n      return serType === ServiceType.Online || serType === ServiceType.Offline;\r\n    default:\r\n      return false;\r\n  }\r\n};\r\nexport const AvailableByAvailabilityType = (\r\n  availabilityType: number,\r\n  renderType: RenderTypes,\r\n) => {\r\n  if (availabilityType === -1) {\r\n    return false;\r\n  }\r\n  let avType = availabilityType as AvailabilityTypes;\r\n  switch (renderType) {\r\n    case RenderTypes.AddToList:\r\n    case RenderTypes.AddWorkOrder:\r\n    case RenderTypes.BringBackUp:\r\n    case RenderTypes.OpenWorkOrder:\r\n    case RenderTypes.OpenWorkOrders:\r\n    case RenderTypes.DownWorkOrder:\r\n    case RenderTypes.ExportQRCodes:\r\n    case RenderTypes.PrintAssetLabels:\r\n      return [\r\n        //AvailabilityTypes.FreelyBookableBillable,\r\n        //AvailabilityTypes.ApprovalRequiredBillable,\r\n        AvailabilityTypes.FreelyBookable,\r\n        //AvailabilityTypes.BookableWApproval,\r\n        AvailabilityTypes.TrainingProgram,\r\n        AvailabilityTypes.LoanableEquipment,\r\n        AvailabilityTypes.LectureRoom,\r\n        AvailabilityTypes.AvailableNotBookable,\r\n        AvailabilityTypes.NotAvailable,\r\n      ].includes(avType);\r\n    case RenderTypes.OpenCalendar:\r\n    case RenderTypes.OpenTimeline:\r\n    case RenderTypes.NewReservation:\r\n    case RenderTypes.CloneEquipments:\r\n      return [\r\n        //AvailabilityTypes.FreelyBookableBillable,\r\n        //AvailabilityTypes.ApprovalRequiredBillable,\r\n        AvailabilityTypes.FreelyBookable,\r\n        //AvailabilityTypes.BookableWApproval,\r\n        AvailabilityTypes.TrainingProgram,\r\n        AvailabilityTypes.LoanableEquipment,\r\n        AvailabilityTypes.LectureRoom,\r\n      ].includes(avType);\r\n    case RenderTypes.DownloadImages:\r\n      return true;\r\n    case RenderTypes.ExportForImport:\r\n      return [\r\n        //AvailabilityTypes.FreelyBookableBillable,\r\n        //AvailabilityTypes.ApprovalRequiredBillable,\r\n        AvailabilityTypes.FreelyBookable,\r\n        //AvailabilityTypes.BookableWApproval,\r\n        AvailabilityTypes.TrainingProgram,\r\n        AvailabilityTypes.LoanableEquipment,\r\n        AvailabilityTypes.LectureRoom,\r\n        AvailabilityTypes.AvailableNotBookable,\r\n        AvailabilityTypes.NotAvailable,\r\n        AvailabilityTypes.ServiceRelated,\r\n        AvailabilityTypes.RequestRelated,\r\n      ].includes(avType);\r\n    default:\r\n      return false;\r\n  }\r\n};\r\n","import { Theme } from '@material-ui/core/styles';\r\nimport { makeStyles } from '@material-ui/styles';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) => ({\r\n  root: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n  },\r\n}));\r\n","import { Theme } from '@material-ui/core/styles';\r\nimport { MenuItem, MenuItemProps } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n\r\n// export const StyledMenuItem = withStyles({\r\n//   root: {\r\n//     '&:hover': {\r\n//       backgroundColor: 'transparent',\r\n//     },\r\n//   },\r\n// })(MenuItem);\r\nexport const StyledMenuItem = styled(\r\n  ({\r\n    button,\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    button: true | false;\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & MenuItemProps) => (\r\n    <MenuItem disableRipple {...other}>\r\n      {children}\r\n    </MenuItem>\r\n  ),\r\n)`\r\n  &:hover {\r\n    background-color: 'transparent';\r\n  }\r\n  &.hidden-if-empty:empty {\r\n    display: none;\r\n  }\r\n`;\r\n","import * as React from 'react';\r\nimport {\r\n  bindHover,\r\n  bindMenu,\r\n  usePopupState,\r\n  anchorRef,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport HoverMenu from 'material-ui-popup-state/HoverMenu';\r\nimport { ReactActionsProps } from '.';\r\nimport { useStyles } from './useStyles';\r\nimport { StyledMenuItem } from './StyledMenuItem';\r\nimport { useTheme } from '@material-ui/core';\r\n\r\nexport const HoverActions = React.forwardRef<any, ReactActionsProps>(\r\n  function HoverActions(props, ref) {\r\n    const { id, items, size, iconVariant } = props;\r\n    const classes = useStyles();\r\n    const popupState = usePopupState({\r\n      variant: 'popover',\r\n      popupId: id,\r\n    });\r\n    const theme = useTheme();\r\n    const buttons = items.filter(a => a !== undefined);\r\n    return (\r\n      <React.Fragment>\r\n        <div ref={anchorRef(popupState)} className={classes.root}>\r\n          <IconButton\r\n            aria-label={id}\r\n            variant={iconVariant || 'ghost'}\r\n            shape=\"square\"\r\n            size={size}\r\n            {...bindHover(popupState)}\r\n          >\r\n            <Icon icon=\"ellipsis-v\" />\r\n          </IconButton>\r\n          <HoverMenu\r\n            ref={ref}\r\n            {...bindMenu(popupState)}\r\n            anchorOrigin={{ vertical: 'center', horizontal: 'right' }}\r\n            transformOrigin={{ vertical: 'top', horizontal: 'left' }}\r\n            getContentAnchorEl={undefined}\r\n            {...props}\r\n          >\r\n            {buttons.map((item, index) => {\r\n              return (\r\n                <StyledMenuItem\r\n                  key={index}\r\n                  ref={ref}\r\n                  theme={theme}\r\n                  button={false}\r\n                  onClick={() => popupState.close()}\r\n                  {...props}\r\n                >\r\n                  {item}\r\n                </StyledMenuItem>\r\n              );\r\n            })}\r\n          </HoverMenu>\r\n        </div>\r\n      </React.Fragment>\r\n    );\r\n  },\r\n);\r\n","import {\r\n  bindMenu,\r\n  usePopupState,\r\n  bindTrigger,\r\n  anchorRef,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { Menu, useTheme } from '@material-ui/core';\r\nimport { useStyles } from './useStyles';\r\nimport { StyledMenuItem } from './StyledMenuItem';\r\nimport { ReactActionsProps } from './index';\r\n\r\nexport const ClickableActions = React.forwardRef<any, ReactActionsProps>(\r\n  function ClickableActions(props, ref) {\r\n    const { id, items, size, iconVariant, icon } = props;\r\n    const classes = useStyles();\r\n    const theme = useTheme();\r\n    const popupState = usePopupState({\r\n      variant: 'popper',\r\n      popupId: id,\r\n    });\r\n    const buttons = React.useMemo(() => {\r\n      return items.filter(\r\n        f =>\r\n          f !== null &&\r\n          f !== false &&\r\n          f !== undefined &&\r\n          f !== true &&\r\n          f !== '',\r\n      );\r\n    }, [items]);\r\n    return (\r\n      <div ref={anchorRef(popupState)} className={classes.root}>\r\n        <IconButton\r\n          variant={iconVariant || 'ghost'}\r\n          shape=\"square\"\r\n          aria-label=\"Open Menu\"\r\n          size={size}\r\n          {...bindTrigger(popupState)}\r\n        >\r\n          <Icon icon={!!icon ? icon : 'ellipsis-v'} />\r\n        </IconButton>\r\n\r\n        <Menu\r\n          {...bindMenu(popupState)}\r\n          ref={ref}\r\n          container={document.fullscreenElement ?? document.body}\r\n          anchorOrigin={{ vertical: 'center', horizontal: 'right' }}\r\n          transformOrigin={{ vertical: 'top', horizontal: 'left' }}\r\n          getContentAnchorEl={null}\r\n          closeAfterTransition={false}\r\n          onClose={() => popupState.close()}\r\n        >\r\n          {buttons.map((item, index) => {\r\n            return !!item ? (\r\n              <StyledMenuItem\r\n                key={index}\r\n                theme={theme}\r\n                button={false}\r\n                ref={ref}\r\n                className={'hidden-if-empty'}\r\n                /** Ripple is disabled for non button PageActions, e.g. Timeline grouping drop down list. Otherwise the ripple over drop down is pretty confusing */\r\n                //disableRipple={props.disableRipple || true}\r\n                onClick={() => {\r\n                  if (!props.keepOpen) {\r\n                    popupState.close();\r\n                  }\r\n                }}\r\n              >\r\n                {item}\r\n              </StyledMenuItem>\r\n            ) : (\r\n              <></>\r\n            );\r\n          })}\r\n        </Menu>\r\n      </div>\r\n    );\r\n  },\r\n);\r\n","import * as React from 'react';\r\nimport { ButtonsVariant } from '../BasicButtons/Button';\r\nimport { HoverActions } from './HoverActions';\r\nimport { ClickableActions } from './ClickableActions';\r\nimport { IconProp } from 'app/AllIcons';\r\n\r\nexport interface ReactActionsProps {\r\n  id: string;\r\n  items: Array<React.ReactNode>;\r\n  size?: 'large' | 'medium' | 'small' | 'xs';\r\n  iconVariant?: ButtonsVariant;\r\n  hoverMenu?: boolean;\r\n  icon?: IconProp;\r\n  /**\r\n   * Keeps menu open after clicking the menu item.\r\n   */\r\n  keepOpen?: boolean;\r\n  /**\r\n   * Disables ripple on all menu items. Useful for menu items containing more advanced components like drop down.\r\n   */\r\n  disableRipple?: boolean;\r\n}\r\nexport function ReactActions(props: ReactActionsProps) {\r\n  const { hoverMenu, items } = props;\r\n  // filter items that will render something\r\n  const nonEmptyItems = React.useMemo(() => {\r\n    return items.filter(\r\n      f =>\r\n        f !== null && f !== false && f !== undefined && f !== true && f !== '',\r\n    );\r\n  }, [items]);\r\n  // if there's nothing to show in the menu then there's no point to show the menu itself\r\n  if (nonEmptyItems.length === 0) {\r\n    return <></>;\r\n  }\r\n  return (\r\n    <React.Fragment>\r\n      {hoverMenu ? (\r\n        <HoverActions {...props} items={nonEmptyItems} />\r\n      ) : (\r\n        <ClickableActions {...props} items={nonEmptyItems} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * SelectedRowsActionIconButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { useState } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { ActionIconButton } from '../../../BasicButtons/ActionIconButton';\r\nimport { DialogConfirm } from '../../../DialogConfirm';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { DialogTypeVariants } from 'app/components/DialogComponents/DialogTypes';\r\nimport { IResponseType, IResponseTypeWithLink } from 'types/ResponseType';\r\nimport { Notification } from 'types/Notification';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface IRowsActionComponent<TRow> {\r\n  rows: TRow[];\r\n}\r\nexport interface SelectedRowsActionIconButtonProps<TRow>\r\n  extends IRowsActionComponent<TRow>,\r\n    ICanRaiseBasicTableRefreshEvent {\r\n  icon?: IconProp;\r\n  title: string;\r\n  subtitle?: React.ReactNode;\r\n  text?: string;\r\n  action: () => Promise<any>;\r\n  snackBarMessageType?: SnackBarMessageType;\r\n  confirm?: boolean;\r\n  update?: boolean;\r\n  confirmTitle?: string | React.ReactNode;\r\n  confirmBody?: React.ReactNode;\r\n  confirmButtonLabel?: string;\r\n  cancelButtonLabel?: string;\r\n  variantButton?: 'button' | 'icon';\r\n  updateDialogVariant?: DialogTypeVariants;\r\n  validConfirm?: boolean;\r\n  maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;\r\n  onHandleClose?: () => void;\r\n  disabled?: boolean;\r\n  toggleAllRowsSelected?: (value?: boolean) => void;\r\n}\r\n\r\nexport function SelectedRowsActionIconButton<TRow>({\r\n  rows,\r\n  title,\r\n  action,\r\n  snackBarMessageType,\r\n  onRefresh,\r\n  confirm,\r\n  confirmTitle,\r\n  confirmBody,\r\n  confirmButtonLabel,\r\n  cancelButtonLabel,\r\n  variantButton,\r\n  icon,\r\n  text,\r\n  updateDialogVariant,\r\n  subtitle,\r\n  validConfirm,\r\n  maxWidth,\r\n  onHandleClose,\r\n  disabled,\r\n  toggleAllRowsSelected,\r\n  ...rest\r\n}: SelectedRowsActionIconButtonProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const [busy, setBusy] = useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const [showConfirm, setShowConfirm] = React.useState(false);\r\n\r\n  const handleAction = async () => {\r\n    setBusy(true);\r\n    try {\r\n      const response = await action();\r\n      setShowConfirm(false);\r\n      if (onHandleClose !== undefined) {\r\n        onHandleClose();\r\n      }\r\n      if (response?.Id !== undefined && response.link !== undefined) {\r\n        let resp = response as IResponseTypeWithLink;\r\n        const key = response.link;\r\n        var Notification = {\r\n          key: key,\r\n          persist: true,\r\n          variant:\r\n            resp.ErrorMessages.length > 0\r\n              ? 'error'\r\n              : resp.WarningMessages.length > 0\r\n              ? 'warning'\r\n              : resp.SuccessMessages.length > 0\r\n              ? 'success'\r\n              : 'default',\r\n          message:\r\n            resp.ErrorMessages.length > 0\r\n              ? resp.ErrorMessages[0]\r\n              : resp.WarningMessages.length > 0\r\n              ? resp.WarningMessages[0]\r\n              : resp.SuccessMessages.length > 0\r\n              ? resp.SuccessMessages[0]\r\n              : '',\r\n          messageType: SnackBarMessageType.showLinkMessage,\r\n          messageTypeProps: {\r\n            Id: 0,\r\n            created: true,\r\n            itemName:\r\n              resp.ErrorMessages.length > 0\r\n                ? resp.ErrorMessages[0]\r\n                : resp.WarningMessages.length > 0\r\n                ? resp.WarningMessages[0]\r\n                : resp.SuccessMessages.length > 0\r\n                ? resp.SuccessMessages[0]\r\n                : '',\r\n            linkUrl: resp.link,\r\n            linkText: resp.Id?.toString(),\r\n            detailsType: undefined,\r\n            detailsTypeProps: undefined,\r\n          },\r\n        } as Notification;\r\n        if (key !== undefined) {\r\n          Notification = Object.assign(Notification, { key: key });\r\n        }\r\n        dispatch(actions.addNotification(Notification));\r\n      } else {\r\n        let respm = response as IResponseType;\r\n        if (respm.ErrorMessages.length > 0) {\r\n          respm.ErrorMessages.forEach(errmsg =>\r\n            dispatch(\r\n              actions.addNotification({\r\n                variant: 'error',\r\n                message: errmsg,\r\n                messageType: snackBarMessageType,\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n        if (respm.SuccessMessages.length > 0) {\r\n          respm.SuccessMessages.forEach(sccmsg =>\r\n            dispatch(\r\n              actions.addNotification({\r\n                variant: 'success',\r\n                message: sccmsg,\r\n                messageType: snackBarMessageType,\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n        if (respm.WarningMessages.length > 0) {\r\n          respm.WarningMessages.forEach(wrnmsg =>\r\n            dispatch(\r\n              actions.addNotification({\r\n                variant: 'warning',\r\n                message: wrnmsg,\r\n                messageType: snackBarMessageType,\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n      }\r\n      setBusy(false);\r\n      toggleAllRowsSelected?.(false);\r\n      onRefresh?.();\r\n    } catch (error) {\r\n      setShowConfirm(false);\r\n      if (onHandleClose !== undefined) {\r\n        onHandleClose();\r\n      }\r\n\r\n      dispatch(\r\n        actions.addNotification({\r\n          variant: 'error',\r\n          message:\r\n            typeof error === 'string' ? error : t(translations.AnErrorOccurred),\r\n        }),\r\n      );\r\n\r\n      setBusy(false);\r\n    }\r\n  };\r\n  const handleClick = () => {\r\n    if (confirm) {\r\n      setShowConfirm(() => true);\r\n    } else {\r\n      handleAction();\r\n    }\r\n  };\r\n  const handleConfirmClick = () => {\r\n    handleAction();\r\n  };\r\n  const handleCloseClick = () => {\r\n    setShowConfirm(false);\r\n    if (onHandleClose !== undefined) {\r\n      onHandleClose();\r\n    }\r\n  };\r\n\r\n  return (\r\n    <React.Fragment>\r\n      {showConfirm && (\r\n        <DialogConfirm\r\n          maxWidth={maxWidth !== undefined ? maxWidth : 'xs'}\r\n          title={confirmTitle || 'Confirm'}\r\n          subtitle={subtitle}\r\n          body={\r\n            confirmBody || <BasicTypography>{'Are you sure?'}</BasicTypography>\r\n          }\r\n          confirmButtonLabel={confirmButtonLabel || 'Ok'}\r\n          cancelButtonLabel={cancelButtonLabel || 'Cancel'}\r\n          onConfirm={handleConfirmClick}\r\n          onCancel={handleCloseClick}\r\n          isOpen={showConfirm}\r\n          processing={busy}\r\n          disabled={busy || !validConfirm}\r\n        />\r\n      )}\r\n      {variantButton === 'icon' && icon ? (\r\n        <ActionIconButton\r\n          disabled={busy || disabled}\r\n          onClick={handleClick}\r\n          title={title}\r\n          icon={icon}\r\n          {...rest}\r\n        />\r\n      ) : (\r\n        <ActionButton\r\n          processing={busy}\r\n          disabled={busy || disabled}\r\n          onClick={handleClick}\r\n          title={title}\r\n          text={text || title}\r\n          starticon={icon}\r\n          {...rest}\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n * This function has two roles:\r\n * 1) If the `id` is empty it assings something so does i18next doesn't throw error. Typescript should prevent this anyway\r\n * 2) It has a hand-picked name `_t` (to be short) and should only be used while using objects instead of strings for translation keys\r\n * `internals/extractMessages/stringfyTranslations.js` script converts this to `t('a.b.c')` style before `i18next-scanner` scans the file contents\r\n * so that our json objects can also be recognized by the scanner.\r\n */\r\nexport const _t = (id: string, ...rest: any[]): [string, ...any[]] => {\r\n  if (!id) {\r\n    id = '_NOT_TRANSLATED_';\r\n  }\r\n  return [id, ...rest];\r\n};\r\n","import * as React from 'react';\r\nimport { Box, MenuItem } from '@material-ui/core';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IFilterSettings } from './IFilterSettings';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { FilterValueType } from './FilterValueType';\r\n//hide for now all the expressions between the field name and its value (mainly “is”) ? We will go back to these once we implement additional expressions and not just one per each filter\r\n//import { operatorToString } from 'api/odata/ODataFilter';\r\nimport { ButtonLabel } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Entity, EntityType } from 'types/common';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { isArray } from 'lodash';\r\nimport {\r\n  Directions,\r\n  FilterBox,\r\n} from 'app/components/BasicTable/BasicFilter/FilterBox';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { BasicTypography } from 'app/components/Typography/BasicTypography';\r\n\r\nexport interface AppliedFilterComponentProps<T> {\r\n  item: IFilterSettings<T>;\r\n  onRemove: (item: IFilterSettings<T>) => void;\r\n  onApply: (item: IFilterSettings<T>) => void;\r\n  direction: Directions;\r\n}\r\n\r\nexport function IsEntity(\r\n  entity: FilterValueType | undefined,\r\n): entity is Entity<number> {\r\n  if (entity === undefined || entity === null) {\r\n    return false;\r\n  }\r\n  if ((entity as Entity<number>).Id !== undefined) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsEntityType(\r\n  entity: FilterValueType | undefined,\r\n): entity is EntityType {\r\n  if (entity === undefined || entity === null) {\r\n    return false;\r\n  }\r\n  return (entity as EntityType).Id !== undefined;\r\n}\r\n\r\nexport function IsEntityArray(entity: FilterValueType | undefined) {\r\n  if (entity === undefined || entity === null) {\r\n    return false;\r\n  }\r\n  if (!isArray(entity)) {\r\n    return false;\r\n  }\r\n  if ((entity as Entity<number>[])?.some(f => f.Id !== undefined)) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsEntityString(\r\n  entity: FilterValueType | undefined,\r\n): entity is Entity<string> {\r\n  if (entity === undefined || entity === null) {\r\n    return false;\r\n  }\r\n  if ((entity as Entity<string>).Id !== undefined) {\r\n    return typeof (entity as Entity<string>).Id == 'string';\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsEmptyArray(entity: FilterValueType | undefined): boolean {\r\n  return Array.isArray(entity) && !entity.length;\r\n}\r\n\r\nexport function IsNotEmptyArray(\r\n  entity: FilterValueType | undefined,\r\n): entity is Extract<FilterValueType, any[]> {\r\n  return Array.isArray(entity) && !!entity.length;\r\n}\r\n\r\nfunction PureAppliedFilterComponent<TRow>({\r\n  item,\r\n  onRemove,\r\n  onApply,\r\n  direction = 'vertical',\r\n}: AppliedFilterComponentProps<TRow>) {\r\n  const { checkIsMobile, isLandscape } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView = React.useMemo(() => {\r\n    return isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n  }, [isMobile, sidePanelExpanded, sidePanelOpen]);\r\n  const { t } = useTranslation();\r\n  const [value, setValue] = React.useState<FilterValueType | undefined>(\r\n    item.value,\r\n  );\r\n  React.useEffect(() => {\r\n    setValue(item.value);\r\n  }, [item.value]);\r\n\r\n  const [open, setOpen] = React.useState(item.open);\r\n  const [predict, setPredict] = React.useState<(string | Condition<TRow>)[]>(\r\n    !!item.filterData && item.filterData.length > 0 && !!item.filterPredicates\r\n      ? item.filterData.map(f =>\r\n          !!item.filterPredicates\r\n            ? item.filterPredicates(f.depValue, f.depKey)[0]\r\n            : '',\r\n        )\r\n      : [],\r\n  );\r\n  const onOpen = () => {\r\n    setPredict(() =>\r\n      !!item.filterData && item.filterData.length > 0 && !!item.filterPredicates\r\n        ? item.filterData.map(f =>\r\n            !!item.filterPredicates\r\n              ? item.filterPredicates(f.depValue, f.depKey)[0]\r\n              : '',\r\n          )\r\n        : [],\r\n    );\r\n  };\r\n\r\n  const handleChange = value => {\r\n    setValue(value);\r\n    applyItem(value);\r\n  };\r\n\r\n  const applyItem = value => {\r\n    setOpen(false);\r\n    onApply({\r\n      ...item,\r\n      ...{ value: value },\r\n      ...{ open: false },\r\n    });\r\n  };\r\n\r\n  const handleRemoveClick = () => {\r\n    onRemove(item);\r\n  };\r\n  //const handleClickAway = () => {};\r\n\r\n  const labelFunc =\r\n    value instanceof PresetDatesRange\r\n      ? (date: MaterialUiPickersDate, invalidLabel: string) => {\r\n          const res = dateUtils.shortDateTimeFormat(date);\r\n          return res === null ? invalidLabel : res;\r\n        }\r\n      : undefined;\r\n  const canHaveInversed = React.useMemo(() => {\r\n    return !item.customFilter && !item.inversionDisabled;\r\n  }, [item.customFilter, item.inversionDisabled]);\r\n  const toggleInversed = React.useCallback(\r\n    (isInversed: boolean) => {\r\n      if (!!item.isInversed === isInversed) return;\r\n      onApply({ ...item, isInversed: !item.isInversed });\r\n    },\r\n    [item, onApply],\r\n  );\r\n  return (isMobile || showShortView) && !isLandscape ? (\r\n    <React.Fragment>\r\n      <FilterBox\r\n        id={`filter-box-${item.fieldName}-${item.fieldName1 ?? item.id}`}\r\n        direction={direction}\r\n      >\r\n        <div\r\n          style={{\r\n            display: 'flex',\r\n            gap: isMobile ? 'unset' : '16px',\r\n            alignItems: 'center',\r\n            justifyContent: 'space-between',\r\n            width: '100%',\r\n            margin: isMobile ? '0px 0px 8px -16px' : '1px',\r\n          }}\r\n        >\r\n          <BasicTypography\r\n            //htmlFor={item.fieldName as string}\r\n            // ariaId={`${item.fieldName as string}_label`}\r\n            variant={'buttonM'}\r\n            style={{\r\n              overflow: 'hidden',\r\n              textOverflow: 'ellipsis',\r\n              maxWidth: '20ch',\r\n              color: open ? bookitColors.primary.regular : 'initial',\r\n              flexShrink: 0,\r\n              marginLeft: '16px',\r\n            }}\r\n          >\r\n            {item.displayName}\r\n          </BasicTypography>\r\n          <Button\r\n            disabled={item.notNullable}\r\n            title={\r\n              item.notNullable ? t(translations.NonRemovableFilter) : undefined\r\n            }\r\n            color=\"default\"\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            onClick={handleRemoveClick}\r\n            aria-label=\"Remove\"\r\n          >\r\n            <Icon icon={['fas', 'xmark']} />\r\n          </Button>\r\n        </div>\r\n        <div\r\n          style={{\r\n            display: 'flex',\r\n            gap: isMobile ? 'unset' : '16px',\r\n            alignItems: 'flex-start',\r\n            justifyContent: 'flex-start',\r\n            width: '100%',\r\n            flexWrap: 'wrap',\r\n            margin: isMobile ? '0px 0px 8px -16px' : '1px',\r\n          }}\r\n        >\r\n          <span\r\n            style={{\r\n              marginLeft: '16px',\r\n            }}\r\n          >\r\n            <DropDown\r\n              color=\"default\"\r\n              disabled={!canHaveInversed}\r\n              variant=\"white\"\r\n              size=\"small\"\r\n              id={`invers-drop-${item.fieldName}-${item.fieldName1 ?? item.id}`}\r\n              menuChildren={close => [\r\n                <MenuItem\r\n                  button\r\n                  key={'is'}\r\n                  onClick={() => {\r\n                    toggleInversed(false);\r\n                    close();\r\n                  }}\r\n                  selected={!item.isInversed}\r\n                >\r\n                  {'Is'}\r\n                </MenuItem>,\r\n                <MenuItem\r\n                  button\r\n                  key={'is_not'}\r\n                  onClick={() => {\r\n                    toggleInversed(true);\r\n                    close();\r\n                  }}\r\n                  selected={!!item.isInversed}\r\n                >\r\n                  {'Is not'}\r\n                </MenuItem>,\r\n              ]}\r\n            >\r\n              {item.isInversed ? 'Is not' : 'Is'}\r\n            </DropDown>\r\n          </span>\r\n          <span\r\n            style={{\r\n              marginLeft: '16px',\r\n            }}\r\n          >\r\n            <item.component\r\n              id={item.fieldName as string}\r\n              onChange={handleChange}\r\n              //onClose={handleClickAway}\r\n              value={value}\r\n              fullWidth={!isMobile}\r\n              open={false}\r\n              additionalItem={item.additionalItem}\r\n              labelFunc={labelFunc}\r\n              customData={item.customData}\r\n              label={item.displayName}\r\n              dateTimeClear={item.dateTimeClear}\r\n              predicates={predict}\r\n              onOpen={onOpen}\r\n              urlType={item.urlType}\r\n              withoutServiceGroups={item.withoutServiceGroups}\r\n            />\r\n          </span>\r\n        </div>\r\n      </FilterBox>\r\n    </React.Fragment>\r\n  ) : (\r\n    <React.Fragment>\r\n      {/* <ClickAwayListener onClickAway={handleClickAway}> */}\r\n      <FilterBox\r\n        id={`filter-box-${item.fieldName}-${item.fieldName1}`}\r\n        direction={direction}\r\n      >\r\n        <span\r\n          style={{\r\n            marginLeft: '8px',\r\n          }}\r\n        >\r\n          <ButtonLabel\r\n            //htmlFor={item.fieldName as string}\r\n            // ariaId={`${item.fieldName as string}_label`}\r\n            style={{\r\n              color: open ? bookitColors.primary.regular : 'initial',\r\n              flexShrink: 0,\r\n              marginLeft: '8px',\r\n            }}\r\n          >\r\n            {item.displayName}\r\n          </ButtonLabel>\r\n        </span>\r\n        <span\r\n          style={{\r\n            marginLeft: '8px',\r\n          }}\r\n        >\r\n          <DropDown\r\n            color=\"default\"\r\n            disabled={!canHaveInversed}\r\n            variant=\"white\"\r\n            id={`invers-drop-${item.fieldName}-${item.fieldName1 ?? item.id}`}\r\n            size=\"small\"\r\n            menuChildren={close => [\r\n              <MenuItem\r\n                button\r\n                key={'is'}\r\n                onClick={() => {\r\n                  toggleInversed(false);\r\n                  close();\r\n                }}\r\n                selected={!item.isInversed}\r\n              >\r\n                {'Is'}\r\n              </MenuItem>,\r\n              <MenuItem\r\n                button\r\n                key={'is_not'}\r\n                onClick={() => {\r\n                  toggleInversed(true);\r\n                  close();\r\n                }}\r\n                selected={!!item.isInversed}\r\n              >\r\n                {'Is not'}\r\n              </MenuItem>,\r\n            ]}\r\n          >\r\n            {item.isInversed ? 'Is not' : 'Is'}\r\n          </DropDown>\r\n        </span>\r\n        <Box\r\n          style={{\r\n            //maxWidth: 400,\r\n            display: 'flex',\r\n            alignItems: 'center',\r\n            justifyContent: 'start',\r\n            //gap: 8,\r\n            marginLeft: '8px',\r\n          }}\r\n        >\r\n          <item.component\r\n            id={item.fieldName as string}\r\n            onChange={handleChange}\r\n            //onClose={handleClickAway}\r\n            value={value}\r\n            fullWidth={true}\r\n            open={false}\r\n            additionalItem={item.additionalItem}\r\n            labelFunc={labelFunc}\r\n            customData={item.customData}\r\n            label={item.displayName}\r\n            dateTimeClear={item.dateTimeClear}\r\n            predicates={predict}\r\n            onOpen={onOpen}\r\n            urlType={item.urlType}\r\n            withoutServiceGroups={item.withoutServiceGroups}\r\n          />\r\n        </Box>\r\n        <span\r\n          style={{\r\n            marginLeft: '8px',\r\n          }}\r\n        >\r\n          <Button\r\n            disabled={item.notNullable}\r\n            title={\r\n              item.notNullable ? t(translations.NonRemovableFilter) : undefined\r\n            }\r\n            color=\"default\"\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            onClick={handleRemoveClick}\r\n            aria-label=\"Remove\"\r\n          >\r\n            <Icon icon={['fas', 'xmark']} />\r\n          </Button>\r\n        </span>\r\n      </FilterBox>\r\n      {/* </ClickAwayListener> */}\r\n    </React.Fragment>\r\n  );\r\n}\r\n\r\nexport const AppliedFilterComponent = React.memo(\r\n  PureAppliedFilterComponent,\r\n  (prevProps, nextProps) => {\r\n    const x = props =>\r\n      JSON.stringify({\r\n        fieldName: props.item.fieldName,\r\n        fieldName1: props.item.fieldName1,\r\n        value: props.item.value,\r\n        predicates: props.item.predicetes,\r\n        isInversed: props.item.isInversed,\r\n      });\r\n    var result = x(prevProps) === x(nextProps);\r\n\r\n    return result;\r\n  },\r\n) as typeof PureAppliedFilterComponent;\r\n","/**\r\n *\r\n * EditableCell\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { FieldProps } from 'formik';\r\n\r\nexport interface EditableCellProps<TValue, TColumn, TRow extends IRow> {\r\n  value: TValue;\r\n  row: Row<TRow>;\r\n  column: TColumn;\r\n  updateMyData: any; // This is a custom function that we supplied to our table instance\r\n}\r\n\r\nexport interface BaseInputProps<TValue, TElement = Element> {\r\n  onChange: (value: TValue) => void;\r\n  name?: string;\r\n  value: TValue;\r\n  onBlur: React.FocusEventHandler<TElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n}\r\n\r\nexport function withPPP<TValue>(\r\n  Component: React.FunctionComponent<BaseInputProps<TValue>>,\r\n) {\r\n  return ({\r\n    field,\r\n    form,\r\n    meta,\r\n    ...props\r\n  }: React.PropsWithChildren<BaseInputProps<TValue> & FieldProps<TValue>>) => {\r\n    const {\r\n      onChange: formikOnChange,\r\n      multiple,\r\n      checked,\r\n      ...fieldProps\r\n    } = field;\r\n    const { onChange: componentOnChange, ...compProps } = props;\r\n    const handleChange = value => {\r\n      componentOnChange?.(value);\r\n      formikOnChange?.({\r\n        target: {\r\n          name: field.name,\r\n          value: value,\r\n        },\r\n      });\r\n    };\r\n    return <Component onChange={handleChange} {...fieldProps} {...compProps} />;\r\n  };\r\n}\r\n\r\nexport interface EditorProps<TValue> {\r\n  value: TValue;\r\n  onChange: (value: TValue) => void;\r\n  onBlur: (event: React.FocusEvent<any>) => void;\r\n  id?: string;\r\n  label?: string;\r\n  name: string;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  parentValue?: any;\r\n  info?: string;\r\n  autoFocus?: boolean;\r\n}\r\n\r\nexport function EditableCell<T>(\r\n  WrappedComponent: React.FunctionComponent<EditorProps<T>>,\r\n) {\r\n  return function Comp({\r\n    value: initialValue,\r\n    row,\r\n    column: { id },\r\n    updateMyData, // This is a custom function that we supplied to our table instance\r\n    ...props\r\n  }: EditableCellProps<any, { id: any }, any>) {\r\n    const [value, setValue] = React.useState(initialValue);\r\n    const onChange = event => {\r\n      const value = event.target.value;\r\n      setValue(value);\r\n      const payload = { Id: row.original.Id };\r\n      payload[id] = value;\r\n      updateMyData(payload);\r\n    };\r\n\r\n    // We'll only update the external data when the input is blurred\r\n    const onBlur = React.useCallback(() => {\r\n      if (value !== initialValue) {\r\n        const payload = { Id: row.original.Id };\r\n        payload[id] = value;\r\n        // updateMyData(payload);\r\n      }\r\n    }, [id, initialValue, row.original.Id, value]);\r\n    // If the initialValue is changed external, sync it up with our state\r\n    React.useEffect(() => {\r\n      setValue(initialValue);\r\n    }, [initialValue]);\r\n\r\n    return (\r\n      <>\r\n        <WrappedComponent\r\n          {...{ value, onChange, onBlur, name: id }}\r\n          error={false}\r\n        />\r\n      </>\r\n    );\r\n  };\r\n}\r\n","/**\r\n *\r\n * BooleanPickerFilter\r\n *\r\n */\r\nimport { BooleanPicker } from 'app/components/BooleanPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport function BooleanPickerFilter(\r\n  props: IFilterComponentProps & {\r\n    trueName?: string;\r\n    falseName?: string;\r\n    info?: string;\r\n  },\r\n) {\r\n  const handleOnChange = (value: Entity<boolean> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <BooleanPicker\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      trueName={props.trueName}\r\n      falseName={props.falseName}\r\n      info={props.info}\r\n      size=\"small\"\r\n      onChange={handleOnChange}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id || 'booleanpickerid'}\r\n    />\r\n  );\r\n}\r\nexport default BooleanPickerFilter;\r\n","/**\r\n *\r\n * ActionButton\r\n *\r\n */\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { Button, ButtonsVariant } from '../Button';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { PropTypes } from '@material-ui/core';\r\nimport * as rdd from 'react-device-detect';\r\n\r\nexport interface ActionButtonProps {\r\n  onClick?: React.MouseEventHandler<HTMLButtonElement>;\r\n  disabled?: boolean;\r\n  starticon?: IconProp;\r\n  endicon?: IconProp;\r\n  text: string;\r\n  title?: string;\r\n  variant?: ButtonsVariant;\r\n  size?: 'large' | 'medium' | 'small';\r\n  autoFocus?: boolean;\r\n  processing?: boolean;\r\n  type?: 'button' | 'submit' | 'reset';\r\n  target?: string;\r\n  id?: string;\r\n  href?: string | IPathAndQuery;\r\n  color?: PropTypes.Color;\r\n  fullWidth?: boolean;\r\n}\r\nexport function ActionButton({\r\n  disabled,\r\n  onClick,\r\n  title,\r\n  starticon,\r\n  endicon,\r\n  text,\r\n  variant,\r\n  size,\r\n  processing,\r\n  fullWidth,\r\n  id,\r\n  ...other\r\n}: ActionButtonProps) {\r\n  const isSafary = rdd.isSafari || rdd.isIOS;\r\n  return title ? (\r\n    <Tooltip\r\n      title={title}\r\n      placement=\"bottom\"\r\n      PopperProps={!isSafary ? { disablePortal: true } : undefined}\r\n    >\r\n      <span>\r\n        <Button\r\n          aria-label={text}\r\n          variant={variant || 'white'}\r\n          size={size || 'small'}\r\n          disabled={disabled}\r\n          onClick={onClick}\r\n          startIcon={starticon && <Icon icon={starticon} />}\r\n          endIcon={endicon && <Icon icon={endicon} />}\r\n          id={id}\r\n          fullWidth={fullWidth}\r\n          processing={processing}\r\n          {...other}\r\n        >\r\n          <>{text}</>\r\n        </Button>\r\n      </span>\r\n    </Tooltip>\r\n  ) : (\r\n    <Button\r\n      variant={variant || 'white'}\r\n      size={size || 'small'}\r\n      disabled={disabled}\r\n      onClick={onClick}\r\n      startIcon={starticon && <Icon icon={starticon} />}\r\n      endIcon={endicon && <Icon icon={endicon} />}\r\n      id={id}\r\n      processing={processing}\r\n      fullWidth={fullWidth}\r\n      {...other}\r\n    >\r\n      <>{text}</>\r\n    </Button>\r\n  );\r\n}\r\n","import { DependencyList, useEffect, useState } from 'react';\r\n\r\nexport const useAsyncGetWthEffect = <T>(\r\n  load: () => Promise<T>,\r\n  defaultVal: T,\r\n  deps?: DependencyList,\r\n  setBusy?: (busy: boolean) => void,\r\n) => {\r\n  const [val, setVal] = useState<T>(defaultVal);\r\n  useEffect(() => {\r\n    let mounted = true;\r\n    setBusy?.(true);\r\n    (async () => {\r\n      try {\r\n        const res = await load();\r\n        if (mounted) {\r\n          setVal(() => res);\r\n        }\r\n      } catch (e) {\r\n        console.error(e);\r\n        if (mounted) {\r\n          setBusy?.(false);\r\n        }\r\n      } finally {\r\n        if (mounted) {\r\n          setBusy?.(false);\r\n        }\r\n      }\r\n    })();\r\n    return () => {\r\n      mounted = false;\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, deps);\r\n  return val;\r\n};\r\n","import { Roles } from 'app/slice/types';\r\n\r\nexport const allowedroles = [\r\n  Roles.Administrators,\r\n  Roles.InstrumentEventsAdmin,\r\n  Roles.GroupAdministrators,\r\n  Roles.LabTech,\r\n];\r\n","import * as React from 'react';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { intersection } from 'lodash';\r\nimport { useSelector } from 'react-redux';\r\nimport { allowedroles } from './allowedroles';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nexport function useWorkOrdersPermissions() {\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const roles: number[] | undefined = user?.Roles;\r\n\r\n  const callback = React.useCallback(\r\n    (row: IAlertPermissionCheckRecord): boolean =>\r\n      allowedToViewAlert(user, row),\r\n    [user],\r\n  );\r\n\r\n  const hasPermissions: boolean = intersection(roles, allowedroles).length > 0;\r\n  const isMainOrInstrumentEventsAdmin: boolean =\r\n    (user?.Roles.includes(Roles.Administrators) ?? false) ||\r\n    (user?.Roles.includes(Roles.InstrumentEventsAdmin) ?? false);\r\n  return {\r\n    hasPermissions,\r\n    allowedToView: callback,\r\n    isMainOrInstrumentEventsAdmin,\r\n  };\r\n}\r\n\r\nexport type IAlertPermissionCheckRecord = Pick<\r\n  IWorkOrderDetailsDto,\r\n  'ServiceGroupId' | 'ReportedBy' | 'ServiceId' | 'ServiceTypeId'\r\n>;\r\nexport const allowedToViewAlert = (\r\n  user: AuthenticatedUser | undefined,\r\n  row: IAlertPermissionCheckRecord,\r\n) => {\r\n  if (!user) return false;\r\n  return (\r\n    user.HasAdminGroupOnlyPermissions(row.ServiceGroupId ?? undefined) ||\r\n    user.HasAdminServiceOnlyPermissions(\r\n      row.ServiceTypeId ?? 1,\r\n      row.ServiceId ?? undefined,\r\n    ) ||\r\n    user.HasLabTechGroupPermissions(row.ServiceGroupId ?? undefined) ||\r\n    user.HasLabTechServicePermissions(\r\n      row.ServiceTypeId ?? 1,\r\n      row.ServiceId ?? undefined,\r\n    ) ||\r\n    (user.Roles.includes(Roles.InventoryAdmin) &&\r\n      user.HasInstrumentEventsGroupPermissions(\r\n        row.ServiceGroupId ?? undefined,\r\n      )) ||\r\n    user.Roles.includes(Roles.InstrumentEventsAdmin) ||\r\n    user.Id === (row.ReportedBy ?? '')\r\n  );\r\n};\r\n\r\nexport const IsReadOnlyUser = (user: AuthenticatedUser | undefined) => {\r\n  if (!user) return true;\r\n  return (\r\n    user.Roles.includes(Roles.Readonly) ||\r\n    user.Roles.includes(Roles.CalendarOnly)\r\n  );\r\n};\r\n","/**\r\n *\r\n * BudgetPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  IBudgetFilterDto,\r\n  IBudgetMembersDto,\r\n} from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataOperators,\r\n  quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\n\r\nexport interface BudgetPickerProps\r\n  extends Omit<AutocompletePickerProps<IBudgetFilterDto>, 'loadData'> {\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  allActiveBudgets?: boolean;\r\n  useSearchOrPredicate?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/Budgets';\r\nexport const initBudgetData = (\r\n  initval: string | undefined,\r\n  select?: (keyof IBudgetFilterDto)[],\r\n  expand?: (keyof Pick<\r\n    IBudgetFilterDto,\r\n    | 'AllowedServices'\r\n    | 'AdGroupUsers'\r\n    | 'ApprovedUsers'\r\n    | 'DefaultBudgetsUsers'\r\n    | 'ServiceGroupIds'\r\n  >)[],\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n      $select: string;\r\n      $expand?: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n      $select: !!select\r\n        ? select.join(',')\r\n        : [\r\n            'Id',\r\n            'Name',\r\n            'UserGroupId',\r\n            'UserGroupName',\r\n            'Active',\r\n            'IsDefault',\r\n            'HideExperiments',\r\n            'FundingTypeId',\r\n            'PurchaseOrderOptionId',\r\n            'ServiceGroupServicesAllowed',\r\n            'UserGroupBudgetMembersAllowed',\r\n            'StartDate',\r\n            'EndDate',\r\n            'Type',\r\n            'ApprovedUsers',\r\n            'DefaultBudgetsUsers',\r\n            'ServiceGroupIds',\r\n            'AllowedServices',\r\n            'AdGroupUsers',\r\n            'Confidential',\r\n          ].join(','),\r\n      $expand: !!expand ? expand.join(',') : 'AllowedServices,ApprovedUsers',\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IBudgetFilterDto>)[] | undefined,\r\n  queryUrl?: string,\r\n  useSearchOrPredicate?: boolean,\r\n) =>\r\n  getAutoCompleteLoadDataFn<IBudgetFilterDto>({\r\n    url: url ?? queryUrl,\r\n    predicates: predicates,\r\n    maxTop: 20,\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'UserGroupId',\r\n      'UserGroupName',\r\n      'Active',\r\n      'IsDefault',\r\n      'HideExperiments',\r\n      'FundingTypeId',\r\n      'PurchaseOrderOptionId',\r\n      'ServiceGroupServicesAllowed',\r\n      'UserGroupBudgetMembersAllowed',\r\n      'StartDate',\r\n      'EndDate',\r\n      'Type',\r\n      'ApprovedUsers',\r\n      'DefaultBudgetsUsers',\r\n      'ServiceGroupIds',\r\n      'AllowedServices',\r\n      'AdGroupUsers',\r\n      'Confidential',\r\n    ],\r\n    expand: 'AllowedServices,ApprovedUsers',\r\n    useSearchOrPredicate: useSearchOrPredicate,\r\n  });\r\nexport function BudgetPicker(props: BudgetPickerProps) {\r\n  const innerLoadData = (predicates, queryUrl) =>\r\n    loadData(\r\n      !!predicates ? ['Active eq true', ...predicates] : ['Active eq true'],\r\n      queryUrl,\r\n      props.useSearchOrPredicate,\r\n    );\r\n  const queryUrl = props.allActiveBudgets\r\n    ? '/api/odata/v4/Budgets/AllBudgets'\r\n    : '/api/odata/v4/Budgets';\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData(props.predicates, queryUrl)}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'BudgetId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const BudgetByUserGroupFilter = (value: FilterValueType) => {\r\n  if (value !== undefined && value !== null) {\r\n    return [\r\n      `${new Condition<IBudgetFilterDto>(\r\n        'UserGroupId',\r\n        ODataOperators.Equals,\r\n        null,\r\n      ).toString()} or ${new Condition<IBudgetFilterDto>(\r\n        'UserGroupId',\r\n        ODataOperators.Equals,\r\n        (value as Entity<string>).Id,\r\n      ).toString()}`,\r\n    ];\r\n  }\r\n  return [];\r\n};\r\nconst memberTimeFilter = (start?: Date, end?: Date): string => {\r\n  let query = '';\r\n  if (start === undefined && end === undefined) {\r\n    return query;\r\n  } else {\r\n    if (start !== undefined) {\r\n      query += ` and (u/${new Condition<IBudgetMembersDto>(\r\n        'ExpairedDate',\r\n        ODataOperators.Equals,\r\n        null,\r\n      )} or u/${new Condition<IBudgetMembersDto>(\r\n        'ExpairedDate',\r\n        ODataOperators.GreaterThanEqual,\r\n        new CustomDate(new Date(start), 'date'),\r\n      )})`;\r\n    }\r\n    if (end !== undefined) {\r\n      query += ` and (u/${new Condition<IBudgetMembersDto>(\r\n        'ExpairedDate',\r\n        ODataOperators.Equals,\r\n        null,\r\n      )} or u/${new Condition<IBudgetMembersDto>(\r\n        'ExpairedDate',\r\n        ODataOperators.GreaterThanEqual,\r\n        new CustomDate(new Date(end), 'date'),\r\n      )})`;\r\n    }\r\n  }\r\n  return query;\r\n};\r\nexport const loadBudgets = loadData;\r\nexport interface restrictedBudgetFilterProps {\r\n  budgetLimitedByUsers: boolean;\r\n  isBudgetsWithoutUserGroup: boolean;\r\n  userGroupId?: string;\r\n  serviceGroupId?: number;\r\n  services?: IServiceTypeFilterDto[];\r\n  startTime?: Date;\r\n  endTime?: Date;\r\n  user?: string;\r\n  defaultBudgetEnabled?: boolean;\r\n  userDefaultBudgetEnabled?: boolean;\r\n  hideNonDefaultBudgets?: boolean;\r\n  fundingType?: Entity<number> | null;\r\n}\r\nexport function restrictedBudgetFilter({\r\n  budgetLimitedByUsers,\r\n  isBudgetsWithoutUserGroup,\r\n  userGroupId,\r\n  serviceGroupId,\r\n  services,\r\n  startTime,\r\n  endTime,\r\n  user,\r\n  defaultBudgetEnabled,\r\n  userDefaultBudgetEnabled,\r\n  hideNonDefaultBudgets,\r\n  fundingType,\r\n}: restrictedBudgetFilterProps): (string | Condition<IBudgetFilterDto>)[] {\r\n  const predicates: (string | Condition<IBudgetFilterDto>)[] = [];\r\n  if (!!budgetLimitedByUsers && user !== undefined) {\r\n    /**\r\n     * when UserGroupBudgetMembersAllowed, it should give a pass for:\r\n     * - all users in case and budget/usergroup field is turned off\r\n     * - budgets/s user group users if the field is turned on and populated, all users otherwise\r\n     * */\r\n\r\n    let UserGroupBudgetMembersAllowed = new Condition<IBudgetFilterDto>(\r\n      'UserGroupBudgetMembersAllowed',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ).toString();\r\n\r\n    const budgetUserGroupMembers = isBudgetsWithoutUserGroup\r\n      ? undefined\r\n      : `(${new Condition<IBudgetFilterDto>(\r\n          'UserGroupId',\r\n          ODataOperators.Equals,\r\n          null,\r\n        )} or ${new Condition<IBudgetFilterDto>(\r\n          'AdGroupUsers',\r\n          ODataOperators.Any,\r\n          user,\r\n        )})`;\r\n    const u = [UserGroupBudgetMembersAllowed, budgetUserGroupMembers]\r\n      .filter(f => f !== undefined)\r\n      .join(' and ');\r\n\r\n    let usrFilter = `((${u}) or (ApprovedUsers/any(u: u/UserName eq ${quoteODataValue(\r\n      user,\r\n    )} ${memberTimeFilter(startTime, endTime)})))`;\r\n    predicates.push(usrFilter);\r\n  }\r\n  if (!isBudgetsWithoutUserGroup && userGroupId !== undefined) {\r\n    predicates.push(\r\n      new Condition<IBudgetFilterDto>(\r\n        'UserGroupId',\r\n        ODataOperators.Equals,\r\n        userGroupId,\r\n      ),\r\n    );\r\n  }\r\n  const fundingTypeId = fundingType?.Id ?? undefined;\r\n  if (fundingTypeId !== undefined) {\r\n    predicates.push(\r\n      new Condition<IBudgetFilterDto>(\r\n        'FundingTypeId',\r\n        ODataOperators.Equals,\r\n        fundingTypeId,\r\n      ),\r\n    );\r\n  }\r\n\r\n  if (startTime !== undefined || (endTime !== undefined && false)) {\r\n    let startFilter = start =>\r\n      `(${new Condition<IBudgetFilterDto>(\r\n        'StartDate',\r\n        ODataOperators.Equals,\r\n        null,\r\n      )} or ${new Condition<IBudgetFilterDto>(\r\n        'StartDate',\r\n        ODataOperators.LessThanEqual,\r\n        start,\r\n      )}) and (${new Condition<IBudgetFilterDto>(\r\n        'EndDate',\r\n        ODataOperators.Equals,\r\n        null,\r\n      )} or ${new Condition<IBudgetFilterDto>(\r\n        'EndDate',\r\n        ODataOperators.GreaterThanEqual,\r\n        start,\r\n      )})`;\r\n    let endFilter = end =>\r\n      `(${new Condition<IBudgetFilterDto>(\r\n        'StartDate',\r\n        ODataOperators.Equals,\r\n        null,\r\n      )} or ${new Condition<IBudgetFilterDto>(\r\n        'StartDate',\r\n        ODataOperators.LessThanEqual,\r\n        end,\r\n      )}) and (${new Condition<IBudgetFilterDto>(\r\n        'EndDate',\r\n        ODataOperators.Equals,\r\n        null,\r\n      )} or ${new Condition<IBudgetFilterDto>(\r\n        'EndDate',\r\n        ODataOperators.GreaterThanEqual,\r\n        end,\r\n      )})`;\r\n    if (!!startTime && endTime === undefined) {\r\n      predicates.push(startFilter(new CustomDate(new Date(startTime), 'date')));\r\n    } else if (!!endTime && startTime === undefined) {\r\n      predicates.push(endFilter(new CustomDate(new Date(endTime), 'date')));\r\n    } else if (!!startTime && !!endTime) {\r\n      predicates.push(\r\n        `(${startFilter(\r\n          new CustomDate(new Date(startTime), 'date'),\r\n        )} and ${endFilter(new CustomDate(new Date(endTime), 'date'))})`,\r\n      );\r\n    }\r\n  }\r\n  if (serviceGroupId !== undefined) {\r\n    let groupFilter = `${new Condition<IBudgetFilterDto>(\r\n      'ServiceGroupServicesAllowed',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ).toString()} or ${new Condition<IBudgetFilterDto>(\r\n      'ServiceGroupIds',\r\n      ODataOperators.Any,\r\n      serviceGroupId,\r\n    ).toString()}`;\r\n    predicates.push(groupFilter);\r\n  }\r\n  if (services !== undefined && services.length > 0) {\r\n    let list = services\r\n      .map(f => {\r\n        return `(AllowedServices/any(s: s/Id eq ${quoteODataValue(\r\n          f.Id,\r\n        )} and s/ServiceTypeId eq ${\r\n          f.ServiceTypeId\r\n        }) or ServiceGroupIds/any(g: g eq ${quoteODataValue(\r\n          f.ServiceGroupId,\r\n        )}))`;\r\n      })\r\n      .join(' and ');\r\n    let servFilter = `(${new Condition<IBudgetFilterDto>(\r\n      'ServiceGroupServicesAllowed',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ).toString()} or (${list}))`;\r\n    predicates.push(servFilter);\r\n  }\r\n  // if (isDefault) {\r\n  //   predicates.push(\r\n  //     new Condition<IBudgetFilterDto>('IsDefault', ODataOperators.Equals, true),\r\n  //   );\r\n  // }\r\n  if (hideNonDefaultBudgets) {\r\n    let deffFilter: (string | Condition<IBudgetFilterDto>)[] = [];\r\n    if (defaultBudgetEnabled) {\r\n      deffFilter.push(\r\n        new Condition<IBudgetFilterDto>(\r\n          'IsDefault',\r\n          ODataOperators.Equals,\r\n          true,\r\n        ),\r\n      );\r\n    }\r\n    if (userDefaultBudgetEnabled && user !== undefined) {\r\n      deffFilter.push(\r\n        new Condition<IBudgetFilterDto>(\r\n          'DefaultBudgetsUsers',\r\n          ODataOperators.Any,\r\n          user,\r\n        ),\r\n      );\r\n    }\r\n    if (deffFilter.length > 0) {\r\n      predicates.push(deffFilter.map(f => f.toString()).join(' or '));\r\n    }\r\n  }\r\n  predicates.push(\r\n    new Condition<IBudgetFilterDto>('Active', ODataOperators.Equals, true),\r\n  );\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n","import * as React from 'react';\r\n\r\nexport interface BooleanRenderProps {\r\n  value?: boolean | null;\r\n}\r\n\r\nexport const BooleanRender = (props: BooleanRenderProps) => {\r\n  return <React.Fragment>{props.value === true ? 'Yes' : 'No'}</React.Fragment>;\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  BookitDatePicker,\r\n  BookitDatePickerProps,\r\n} from 'app/components/BookitDatePicker';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\n\r\n/**\r\n * TODO:\r\n * A non-serializable value was detected in an action, in the path: `payload.ReceivedAt`. Value: \r\nDate Sun May 02 2021 14:58:00 GMT+0300 (Israel Daylight Time)\r\n \r\nTake a look at the logic that dispatched this action:  \r\nObject { type: \"animals/insertItem\", payload: {…} }\r\n \r\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string…t-least-serializable-why-should-my-action-types-be-constants) \r\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\r\n * */\r\n\r\nexport const FormBookitDatePicker = ({\r\n  label,\r\n  disableFuture,\r\n  disablePast,\r\n  ...props\r\n}: FieldHookConfig<Date | null> &\r\n  Pick<\r\n    BookitDatePickerProps,\r\n    | 'endTime'\r\n    | 'truncateTime'\r\n    | 'minDate'\r\n    | 'maxDate'\r\n    | 'labelFunc'\r\n    | 'clearable'\r\n    | 'fullScreen'\r\n  > &\r\n  IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Date | null>(props);\r\n  return (\r\n    <BookitDatePicker\r\n      id={props.id}\r\n      name={props.name}\r\n      disableFuture={disableFuture}\r\n      disablePast={disablePast}\r\n      label={label}\r\n      inputVariant=\"filled\"\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      fullWidth={true}\r\n      helperText={meta.error}\r\n      labelFunc={props.labelFunc}\r\n      info={props.info}\r\n      disabled={props.disabled}\r\n      clearable={props.clearable}\r\n      fullScreen={props.fullScreen}\r\n      endTime={props.endTime}\r\n      truncateTime={props.truncateTime}\r\n      variant=\"date\"\r\n      autoFocus={props.autoFocus}\r\n      minDate={props.minDate}\r\n      maxDate={props.maxDate}\r\n      required={props.required}\r\n    />\r\n  );\r\n};\r\n","import {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n  selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { UserReservationsRestricted } from 'enums/enums';\r\nimport { MultipleInstrumentReservations } from 'enums/MultipleInstrumentReservations';\r\nimport { intersection } from 'lodash';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { isInRole } from 'types/AuthenticatedUser';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings/AllowedSettings';\r\nexport interface GlobalSettingsType {\r\n  loadCompleted: boolean;\r\n  reservationRestricted: boolean;\r\n  reservationUserGroupGroupByBudgetUserGroup: boolean;\r\n  userGroupReservationRestricted: boolean;\r\n  onlyOwnUserGroupsAllowed: boolean;\r\n  userDefaultBudgetEnabled: boolean;\r\n  defaultBudgetEnabled: boolean;\r\n  hideNonDefaultBudgets: boolean;\r\n  isBudgetsWithoutUserGroup: boolean;\r\n  budgetModuleEnabled: boolean;\r\n  priceSheetPricing: boolean;\r\n  billingModuleEnabled: boolean;\r\n  budgetLimitedByUsers: boolean;\r\n  budgetExperimentModuleEnabled: boolean;\r\n  fundingTypeBudgetEnabled: boolean;\r\n  purchaseOrderBudgetEnabled: boolean;\r\n  purchaseOrderLengthSetting: number | undefined;\r\n  allowPartialProjectCharges: boolean;\r\n  allowPartialSingleProjectCharges: boolean;\r\n  trainingSessionEnabled: boolean;\r\n  assistedReservationsEnabled: boolean;\r\n  resCustomFormEnabled: boolean;\r\n  resMultipleFormsEnabled: boolean;\r\n  multipleInstrumentsEnabled: boolean;\r\n  reservationTerminationEnabled: boolean;\r\n  crossInstrumentTrainingEnabled: boolean;\r\n  userAndGroupPermissionsEnabled: boolean;\r\n  tutoringModulesEnabled: boolean;\r\n  offlineServiceWithReservation: boolean;\r\n  userIsMainAdmin: boolean;\r\n  instituteProjectsEnabled: boolean;\r\n  showReferenceFieldInReservationDetails: boolean;\r\n  accServicesEnabled: boolean;\r\n  showCalcPriceOnOfflineService: boolean;\r\n  allowUsersToViewTheirCharges: boolean;\r\n  allowOngoingReservationModificationEnabled: boolean;\r\n  showCalculatePrice: boolean;\r\n  allowAddRemoveOnEditReservation: boolean;\r\n  allowToRemoveFromMultipleReservation: boolean;\r\n  draftReservationsEnabled: boolean;\r\n  hideReservationCollaborators: boolean;\r\n  MandatoryOfflineServicesOnTrainingSignUps: boolean;\r\n  DoNotAllowReservationUserChangeByStaff: boolean;\r\n  AssemblyPartsEnabled: boolean;\r\n  confidentialBudgetsEnabled: boolean;\r\n  AllowWorkflowBooking: boolean;\r\n  ModifyReservationNameForUsers: boolean;\r\n  ServiceRequestReservationEnabled: boolean;\r\n}\r\n\r\nfunction useGlobalSettingsHook(): GlobalSettingsType {\r\n  const adminRoles = React.useMemo(\r\n    () => [\r\n      Roles.Administrators,\r\n      Roles.EquipmentAdministrator,\r\n      Roles.GroupAdministrators,\r\n      Roles.LabTech,\r\n      Roles.InstituteCoord,\r\n    ],\r\n    [],\r\n  );\r\n  const privateBudgetsRoles = React.useMemo(\r\n    () => [Roles.Administrators, Roles.HeadOfLab],\r\n    [],\r\n  );\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const userRoles: number[] | undefined = User?.Roles;\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const [reservationRestricted, setReservationRestricted] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [budgetModuleEnabled, setBudgetModuleEnabled] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [priceSheetPricing, setPriceSheetPricing] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [billingEnabled, setBillingEnabled] = React.useState<boolean>(false);\r\n  const [\r\n    purchaseOrderLengthSetting,\r\n    setPurchaseOrderLengthSetting,\r\n  ] = React.useState<number | undefined>();\r\n  const [userIsMainAdmin, setUserIsMainAdmin] = React.useState<boolean>(false);\r\n  const userSettings = useSelector(selectUserProfileSettings);\r\n  const [\r\n    allowOngoingReservationModificationEnabled,\r\n    setAllowOngoingReservationModificationEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    doNotAllowReservationUserChangeByStaff,\r\n    setDoNotAllowReservationUserChangeByStaff,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    instituteProjectsEnabled,\r\n    setInstituteProjectsEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    reservationTerminationEnabled,\r\n    setReservationTerminationEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    draftReservationsEnabled,\r\n    setDraftReservationsEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    MandatoryOfflineServicesOnTrainingSignUps,\r\n    setMandatoryOfflineServicesOnTrainingSignUps,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    crossInstrumentTrainingEnabled,\r\n    setCrossInstrumentTrainingEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    userAndGroupPermissionsEnabled,\r\n    setUserAndGroupPermissionsEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [tutoringModulesEnabled, setTutoringModulesEnabled] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [accServicesEnabled, setAccServicesEnabled] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [\r\n    allowUsersToViewTheirCharges,\r\n    setAllowUsersToViewTheirCharges,\r\n  ] = React.useState<boolean>(false);\r\n\r\n  const [\r\n    showReferenceFieldInReservationDetails,\r\n    setShowReferenceFieldInReservationDetails,\r\n  ] = React.useState<boolean>(false);\r\n\r\n  const [\r\n    offlineServiceWithReservation,\r\n    setOfflineServiceWithReservation,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    multipleInstrumentsEnabled,\r\n    setMultipleInstrumentsEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [trainingSessionEnabled, setTrainingSessionEnabled] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [reservationFormEnabled, setReservationFormEnabled] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [resMultipleFormsEnabled, setResMultipleFormsEnabled] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [\r\n    assistedReservationsEnabled,\r\n    setAssistedReservationsEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    showCalcPriceOnOfflineService,\r\n    setShowCalcPriceOnOfflineService,\r\n  ] = React.useState<boolean>(false);\r\n  const [showCalculatePrice, setShowCalculatePrice] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [\r\n    allowPartialProjectCharges,\r\n    setAllowPartialProjectCharges,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    allowPartialSingleProjectCharges,\r\n    setAllowPartialSingleProjectCharges,\r\n  ] = React.useState<boolean>(false);\r\n\r\n  const [\r\n    budgetExperimentModuleEnabled,\r\n    setBudgetExperimentModuleEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    fundingTypeBudgetEnabled,\r\n    setFundingTypeBudgetEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    purchaseOrderBudgetEnabled,\r\n    setPurchaseOrderBudgetEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    isBudgetsWithoutUserGroup,\r\n    setIsBudgetsWithoutUserGroup,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    requestReservationEnabled,\r\n    setRequestReservationEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [budgetLimitedByUsers, setIsBudgetLimitedByUsers] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [hideNonDefaultBudgets, setHideNonDefaultBudgets] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [assemblyPartsEnabled, setAssemblyPartsEnabled] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [\r\n    userDefaultBudgetEnabled,\r\n    setUserDefaultBudgetEnabled,\r\n  ] = React.useState<boolean>(false);\r\n  const [defaultBudgetEnabled, setDefaultBudgetEnabled] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [\r\n    userGroupReservationRestricted,\r\n    setUserGroupReservationRestricted,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    reservationUserGroupGroupByBudgetUserGroup,\r\n    setReservationUserGroupGroupByBudgetUserGroup,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    onlyOwnUserGroupsAllowed,\r\n    setOnlyOwnUserGroupsAllowed,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    allowAddRemoveOnEditReservation,\r\n    setAllowAddRemoveOnEditReservation,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    allowToRemoveFromMultipleReservation,\r\n    setAllowToRemoveFromMultipleReservation,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    hideReservationCollaborators,\r\n    setHideReservationCollaborators,\r\n  ] = React.useState(false);\r\n  const [\r\n    isConfidentialBudgetsEnabled,\r\n    setIsConfidentialBudgetsEnabled,\r\n  ] = React.useState(false);\r\n  const [\r\n    allowWorkflowBookingEnabled,\r\n    setAllowWorkflowBookingEnabled,\r\n  ] = React.useState(false);\r\n  const [\r\n    modifyReservationNameForUsers,\r\n    setModifyReservationNameForUsers,\r\n  ] = React.useState(false);\r\n  const [loadCompleted, setLoadCompleted] = React.useState<boolean>(false);\r\n  React.useEffect(() => {\r\n    setIsBudgetsWithoutUserGroup(() => {\r\n      return !IsBudgetFieldEnabled(appSettings, BudgetFields.UserGroup);\r\n    });\r\n    setIsConfidentialBudgetsEnabled(() => {\r\n      return IsBudgetFieldEnabled(appSettings, BudgetFields.Confidential);\r\n    });\r\n    setUserIsMainAdmin(() => {\r\n      return isInRole(User, Roles.Administrators);\r\n    });\r\n    setAllowAddRemoveOnEditReservation(() => {\r\n      return IsModuleEnabled(\r\n        appSettings,\r\n        KnownModules.MultipleInstruments_AddRemoveOnEditReservation,\r\n      );\r\n    });\r\n    setAllowToRemoveFromMultipleReservation(() => {\r\n      return (\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.AllowToRemoveFromMultipleReservation],\r\n        ) === true\r\n      );\r\n    });\r\n    setTrainingSessionEnabled(() => {\r\n      return (\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.HideTrainingSessionsSettings],\r\n        ) === false\r\n      );\r\n    });\r\n    setAllowWorkflowBookingEnabled(() => {\r\n      return (\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.AllowWorkflowBooking],\r\n        ) === true\r\n      );\r\n    });\r\n    setModifyReservationNameForUsers(() => {\r\n      return (\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.ModifyReservationNameForUsers],\r\n        ) === true\r\n      );\r\n    });\r\n    setInstituteProjectsEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.InstituteProjects);\r\n    });\r\n    setMultipleInstrumentsEnabled(() => {\r\n      const multipleInstrumentsSetting:\r\n        | string\r\n        | null = settings.GetNullableByKey(\r\n        AllowedSettings.MultipleInstrumentReservations,\r\n      );\r\n      return (\r\n        multipleInstrumentsSetting !== null &&\r\n        MultipleInstrumentReservations[multipleInstrumentsSetting] !==\r\n          MultipleInstrumentReservations.NotAllowed\r\n      );\r\n    });\r\n    setReservationTerminationEnabled(() => {\r\n      return settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.TerminateReservation],\r\n      );\r\n    });\r\n    setAccServicesEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.AccServices);\r\n    });\r\n    setAllowOngoingReservationModificationEnabled(() => {\r\n      return IsModuleEnabled(\r\n        appSettings,\r\n        KnownModules.AllowOngoingReservationModification,\r\n      );\r\n    });\r\n    setDoNotAllowReservationUserChangeByStaff(() => {\r\n      return settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.DoNotAllowReservationUserChangeByStaff],\r\n      );\r\n    });\r\n    setShowReferenceFieldInReservationDetails(() => {\r\n      return !settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.HideReferenceFieldInReservationDetails],\r\n      );\r\n    });\r\n    setAllowUsersToViewTheirCharges(() => {\r\n      return settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.AllowUsersToViewCharges],\r\n      );\r\n    });\r\n    setAssistedReservationsEnabled(() => {\r\n      return !settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.HideAssistedReservationsSettings],\r\n      );\r\n    });\r\n    setIsBudgetLimitedByUsers(() => {\r\n      return settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.BudgetLimited_ByUsers],\r\n      );\r\n    });\r\n    setBudgetModuleEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.Budgets);\r\n    });\r\n    setPriceSheetPricing(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.PriceSheetPricing);\r\n    });\r\n    setBillingEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.Billing);\r\n    });\r\n    setPurchaseOrderLengthSetting(() => {\r\n      const stringValue = settings.TryGet(\r\n        AllowedSettings[AllowedSettings.PurchaseOrderLengthSetting],\r\n      );\r\n      if (stringValue === null) {\r\n        return undefined;\r\n      }\r\n      const intValue = parseInt(stringValue);\r\n      if (isNaN(intValue)) {\r\n        return undefined;\r\n      }\r\n      return intValue;\r\n    });\r\n\r\n    setDraftReservationsEnabled(() => {\r\n      return settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.DraftReservationsEnabled],\r\n      );\r\n    });\r\n    setMandatoryOfflineServicesOnTrainingSignUps(() => {\r\n      return settings.GetBoolean(\r\n        AllowedSettings[\r\n          AllowedSettings.MandatoryOfflineServicesOnTrainingSignUps\r\n        ],\r\n      );\r\n    });\r\n    setOfflineServiceWithReservation(() => {\r\n      return IsModuleEnabled(\r\n        appSettings,\r\n        KnownModules.OfflineServiceWithReservation,\r\n      );\r\n    });\r\n    setReservationRestricted(() => {\r\n      const resRestrictedSetting: string | null = settings.GetNullableByKey(\r\n        AllowedSettings.UserReservationsRestricted,\r\n      );\r\n      return (\r\n        resRestrictedSetting !== null &&\r\n        UserReservationsRestricted[resRestrictedSetting] ===\r\n          UserReservationsRestricted.UserOwnRestricted\r\n      );\r\n    });\r\n    setUserGroupReservationRestricted(() => {\r\n      const resUserGroupRestrictedSetting:\r\n        | string\r\n        | null = settings.GetNullableByKey(\r\n        AllowedSettings.UserReservationsRestricted,\r\n      );\r\n      return (\r\n        resUserGroupRestrictedSetting !== null &&\r\n        UserReservationsRestricted[resUserGroupRestrictedSetting] ===\r\n          UserReservationsRestricted.UserGroupRestricted\r\n      );\r\n    });\r\n    setUserAndGroupPermissionsEnabled(() => {\r\n      return (\r\n        IsModuleEnabled(appSettings, KnownModules.UserPermission) ||\r\n        IsModuleEnabled(appSettings, KnownModules.GroupPermissions)\r\n      );\r\n    });\r\n\r\n    setReservationUserGroupGroupByBudgetUserGroup(() =>\r\n      settings.GetBoolean(\r\n        AllowedSettings[\r\n          AllowedSettings.ReservationUserGroupGroupByBudgetUserGroup\r\n        ],\r\n      ),\r\n    );\r\n    setCrossInstrumentTrainingEnabled(() =>\r\n      settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.CrossInstrumentTraining],\r\n      ),\r\n    );\r\n\r\n    setOnlyOwnUserGroupsAllowed(() => {\r\n      return !(intersection(userRoles, adminRoles).length > 0);\r\n      // return (\r\n      //   !(intersection(userRoles, adminRoles).length > 0) ||\r\n      //   userGroupReservationRestricted\r\n      // );\r\n    });\r\n    setUserDefaultBudgetEnabled(() =>\r\n      settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.ShowDefaultBudgetOnUserProfile],\r\n      ),\r\n    );\r\n    setShowCalcPriceOnOfflineService(\r\n      () =>\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.HideCalcPriceOnOfflineService],\r\n        ) !== true,\r\n    );\r\n    setShowCalculatePrice(\r\n      () =>\r\n        IsModuleEnabled(appSettings, KnownModules.Billing) ||\r\n        (IsModuleEnabled(appSettings, KnownModules.Invoices) &&\r\n          IsModuleEnabled(appSettings, KnownModules.PriceSheetPricing)),\r\n    );\r\n    setDefaultBudgetEnabled(() => {\r\n      return IsBudgetFieldEnabled(appSettings, BudgetFields.Default);\r\n    });\r\n    setFundingTypeBudgetEnabled(() => {\r\n      return IsBudgetFieldEnabled(appSettings, BudgetFields.FundingType);\r\n    });\r\n    setPurchaseOrderBudgetEnabled(() => {\r\n      return IsBudgetFieldEnabled(\r\n        appSettings,\r\n        BudgetFields.PurchaseOrderOption,\r\n      );\r\n    });\r\n\r\n    setTutoringModulesEnabled(() => {\r\n      return (\r\n        IsModuleEnabled(appSettings, KnownModules.Tutoring) ||\r\n        IsModuleEnabled(appSettings, KnownModules.TutoringHours)\r\n      );\r\n    });\r\n    setAssemblyPartsEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.EquipmentAssemblies);\r\n    });\r\n    setHideNonDefaultBudgets(() => {\r\n      return (\r\n        IsModuleEnabled(appSettings, KnownModules.HideNonDefaultBudgets) &&\r\n        !(\r\n          intersection(userRoles, privateBudgetsRoles).length > 0 ||\r\n          (isInRole(User, Roles.GroupAdministrators) &&\r\n            settings.GetBoolean(\r\n              AllowedSettings[AllowedSettings.SGACreateProjects],\r\n            ))\r\n        )\r\n      );\r\n    });\r\n    setBudgetExperimentModuleEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.BudgetExperiments);\r\n    });\r\n\r\n    setAllowPartialProjectCharges(() => {\r\n      return (\r\n        IsModuleEnabled(appSettings, KnownModules.Invoices) &&\r\n        IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.AllowPartialMultipleProjectCharges],\r\n        ) &&\r\n        budgetModuleEnabled\r\n      );\r\n    });\r\n    setAllowPartialSingleProjectCharges(() => {\r\n      return (\r\n        IsModuleEnabled(appSettings, KnownModules.Invoices) &&\r\n        IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n        settings.GetBoolean(\r\n          AllowedSettings[AllowedSettings.AllowPartialSingleProjectCharges],\r\n        ) &&\r\n        budgetModuleEnabled\r\n      );\r\n    });\r\n    setReservationFormEnabled(() => {\r\n      return IsModuleEnabled(appSettings, KnownModules.ReservationsCustomForm);\r\n    });\r\n    setResMultipleFormsEnabled(() => {\r\n      return (\r\n        reservationFormEnabled &&\r\n        IsModuleEnabled(appSettings, KnownModules.MultipleCustomForms)\r\n      );\r\n    });\r\n    setHideReservationCollaborators(\r\n      settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.HideReservationCollaborators],\r\n      ),\r\n    );\r\n    setRequestReservationEnabled(\r\n      settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.ServiceRequestReservations],\r\n      ),\r\n    );\r\n    console.debug('Global Settings Called');\r\n    setLoadCompleted(() => true);\r\n  }, [\r\n    User,\r\n    adminRoles,\r\n    appSettings,\r\n    budgetModuleEnabled,\r\n    privateBudgetsRoles,\r\n    reservationFormEnabled,\r\n    reservationRestricted,\r\n    settings,\r\n    userGroupReservationRestricted,\r\n    userRoles,\r\n    userSettings,\r\n  ]);\r\n\r\n  const r: GlobalSettingsType = {\r\n    loadCompleted,\r\n    reservationRestricted,\r\n    reservationUserGroupGroupByBudgetUserGroup,\r\n    userGroupReservationRestricted,\r\n    onlyOwnUserGroupsAllowed,\r\n    userDefaultBudgetEnabled,\r\n    defaultBudgetEnabled,\r\n    hideNonDefaultBudgets,\r\n    isBudgetsWithoutUserGroup,\r\n    budgetModuleEnabled,\r\n    priceSheetPricing,\r\n    billingModuleEnabled: billingEnabled,\r\n    purchaseOrderLengthSetting,\r\n    budgetLimitedByUsers,\r\n    budgetExperimentModuleEnabled: budgetExperimentModuleEnabled,\r\n    fundingTypeBudgetEnabled,\r\n    purchaseOrderBudgetEnabled,\r\n    allowPartialProjectCharges,\r\n    allowPartialSingleProjectCharges,\r\n    trainingSessionEnabled,\r\n    assistedReservationsEnabled,\r\n    resCustomFormEnabled: reservationFormEnabled,\r\n    resMultipleFormsEnabled,\r\n    multipleInstrumentsEnabled,\r\n    reservationTerminationEnabled,\r\n    crossInstrumentTrainingEnabled,\r\n    userAndGroupPermissionsEnabled: userAndGroupPermissionsEnabled,\r\n    tutoringModulesEnabled,\r\n    offlineServiceWithReservation,\r\n    userIsMainAdmin,\r\n    instituteProjectsEnabled,\r\n    showReferenceFieldInReservationDetails,\r\n    accServicesEnabled,\r\n    showCalcPriceOnOfflineService,\r\n    allowUsersToViewTheirCharges,\r\n    allowOngoingReservationModificationEnabled,\r\n    showCalculatePrice,\r\n    allowAddRemoveOnEditReservation,\r\n    allowToRemoveFromMultipleReservation,\r\n    draftReservationsEnabled,\r\n    hideReservationCollaborators,\r\n    MandatoryOfflineServicesOnTrainingSignUps,\r\n    DoNotAllowReservationUserChangeByStaff: doNotAllowReservationUserChangeByStaff,\r\n    AssemblyPartsEnabled: assemblyPartsEnabled,\r\n    confidentialBudgetsEnabled: isConfidentialBudgetsEnabled,\r\n    AllowWorkflowBooking: allowWorkflowBookingEnabled,\r\n    ModifyReservationNameForUsers: modifyReservationNameForUsers,\r\n    ServiceRequestReservationEnabled: requestReservationEnabled,\r\n  };\r\n  return r;\r\n}\r\n\r\nexport default useGlobalSettingsHook;\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\n\r\nexport type OfflineServiceTypeUrl = 'base' | 'public';\r\nexport interface OfflineServiceTypePickerProps\r\n  extends Omit<AutocompletePickerProps<IOfflineServiceFilterDto>, 'loadData'> {\r\n  urlType: OfflineServiceTypeUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/OfflineServiceFilter';\r\nconst publicUrl = '/api/odata/v4/OfflineServiceFilter/AllOfflineServices';\r\n\r\nexport const loadOfflineServiceData = (\r\n  predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n  urlType: OfflineServiceTypeUrl,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  select?: (keyof IOfflineServiceFilterDto)[],\r\n  expand?: keyof Pick<IOfflineServiceFilterDto, 'InventoryBatches'>,\r\n) => {\r\n  const sourceUrl = urlType === 'public' ? publicUrl : url;\r\n  return getAutoCompleteLoadDataFn<IOfflineServiceFilterDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // TODO: narrow down used properties list\r\n    select:\r\n      !!select && select.length > 0\r\n        ? select\r\n        : [\r\n            'Id',\r\n            'Name',\r\n            'ServiceGroupId',\r\n            'ServiceTypeId',\r\n            'Active',\r\n            'IntQuantityOnly',\r\n            'HideProjects',\r\n            'UnitTypeID',\r\n            'UnitTypeName',\r\n            'AllowToUser',\r\n            'Inventory',\r\n            'DefaultQuantity',\r\n            'ReservationOverlappingInventory',\r\n            'BudgetsTurnedOn',\r\n            'IsAdmin',\r\n            'StaffOnly',\r\n            'NotLessThanZero',\r\n            'TrackInventory',\r\n            'InventoryBatchesEnabled',\r\n          ],\r\n    expand: expand,\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IOfflineServiceFilterDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function OfflineServiceTypePicker(props: OfflineServiceTypePickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadOfflineServiceData(\r\n    props.predicates,\r\n    props.urlType,\r\n    globalServiceGroupFilter || [],\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      additionalItem={props.additionalItem}\r\n      id={props.id || 'offServicetypeId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nexport function UsageRelatedFilter(\r\n  Ids: number[],\r\n  excludedIds: number[],\r\n): (string | Condition<IOfflineServiceFilterDto>)[] {\r\n  const predicates: (string | Condition<IOfflineServiceFilterDto>)[] = [];\r\n  if (Ids.length > 0) {\r\n    let ids = Ids.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'Id',\r\n        ODataOperators.Includes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (excludedIds.length > 0) {\r\n    let ids = excludedIds.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'Id',\r\n        ODataOperators.Excludes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    // predicates.push(\r\n    //   new Condition<IOfflineServiceFilterDto>(\r\n    //     'AllowToUser',\r\n    //     ODataOperators.Equals,\r\n    //     true,\r\n    //   ),\r\n    // );\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport function ReservationsRelatedFilter(\r\n  equipmentGroups: number[],\r\n  optionalServiceTypes: Array<Identifiable<number>>,\r\n  hideProject?: boolean,\r\n  allServicesAllowed?: boolean,\r\n  budgetId?: number,\r\n  budgetServiceGroupServicesAllowed?: boolean,\r\n): (string | Condition<IOfflineServiceFilterDto>)[] {\r\n  const predicates: (string | Condition<IOfflineServiceFilterDto>)[] = [];\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'Active',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n  if (equipmentGroups.length > 0) {\r\n    let ids = equipmentGroups.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'ServiceGroupId',\r\n        ODataOperators.Includes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (!!hideProject) {\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'HideProjects',\r\n        ODataOperators.Equals,\r\n        hideProject,\r\n      ),\r\n    );\r\n  }\r\n  let byAdmin = new Condition<IOfflineServiceFilterDto>(\r\n    'IsAdmin',\r\n    ODataOperators.Equals,\r\n    true,\r\n  );\r\n  let byUser = new Condition<IOfflineServiceFilterDto>(\r\n    'StaffOnly',\r\n    ODataOperators.Equals,\r\n    false,\r\n  );\r\n  predicates.push(`(${byAdmin} or ${byUser})`);\r\n  if (!!budgetId && budgetId > 0 && !budgetServiceGroupServicesAllowed) {\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'AllowedBudgets',\r\n        ODataOperators.Any,\r\n        budgetId,\r\n      ),\r\n    );\r\n  }\r\n  if (!allServicesAllowed) {\r\n    if (optionalServiceTypes.length > 0) {\r\n      let ids = optionalServiceTypes.map(f => {\r\n        return { Id: f.Id } as Identifiable<number>;\r\n      });\r\n      predicates.push(\r\n        new Condition<IOfflineServiceFilterDto>(\r\n          'Id',\r\n          ODataOperators.Includes,\r\n          ids,\r\n        ),\r\n      );\r\n    }\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport function OfflineServiceRelatedFilter(\r\n  relatedGroups: number[],\r\n  hideProject?: boolean,\r\n  budgetId?: number,\r\n  budgetServiceGroupServicesAllowed?: boolean,\r\n): (string | Condition<IOfflineServiceFilterDto>)[] {\r\n  const predicates: (string | Condition<IOfflineServiceFilterDto>)[] = [];\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'Active',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'ServiceTypeId',\r\n      ODataOperators.Equals,\r\n      2,\r\n    ),\r\n  );\r\n  if (relatedGroups.length > 0) {\r\n    let ids = relatedGroups.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'ServiceGroupId',\r\n        ODataOperators.Includes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (!!hideProject) {\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'HideProjects',\r\n        ODataOperators.Equals,\r\n        hideProject,\r\n      ),\r\n    );\r\n  }\r\n  let byAdmin = new Condition<IOfflineServiceFilterDto>(\r\n    'IsAdmin',\r\n    ODataOperators.Equals,\r\n    true,\r\n  );\r\n  let byUser = `(${new Condition<IOfflineServiceFilterDto>(\r\n    'StaffOnly',\r\n    ODataOperators.Equals,\r\n    false,\r\n  )} and ${new Condition<IOfflineServiceFilterDto>(\r\n    'AllowToUser',\r\n    ODataOperators.Equals,\r\n    true,\r\n  )})`;\r\n  predicates.push(`(${byAdmin} or ${byUser})`);\r\n  if (!!budgetId && budgetId > 0 && !budgetServiceGroupServicesAllowed) {\r\n    predicates.push(\r\n      new Condition<IOfflineServiceFilterDto>(\r\n        'AllowedBudgets',\r\n        ODataOperators.Any,\r\n        budgetId,\r\n      ),\r\n    );\r\n  }\r\n\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport function RenewStockRelatedFilter(): (\r\n  | string\r\n  | Condition<IOfflineServiceFilterDto>\r\n)[] {\r\n  const predicates: (string | Condition<IOfflineServiceFilterDto>)[] = [];\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'Active',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'ServiceTypeId',\r\n      ODataOperators.Equals,\r\n      2,\r\n    ),\r\n  );\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'TrackInventory',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport function InventoryBatchRelatedFilter(): (\r\n  | string\r\n  | Condition<IOfflineServiceFilterDto>\r\n)[] {\r\n  const predicates: (string | Condition<IOfflineServiceFilterDto>)[] = [];\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'Active',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'ServiceTypeId',\r\n      ODataOperators.Equals,\r\n      2,\r\n    ),\r\n  );\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'TrackInventory',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n  predicates.push(\r\n    new Condition<IOfflineServiceFilterDto>(\r\n      'InventoryBatchesEnabled',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n","/**\r\n *\r\n * DatesRangeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport {\r\n  getPeriodTypesEntity,\r\n  PeriodTypes,\r\n  PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { DatesRange } from 'types/DatesRange';\r\nimport { DatePeriodsPicker } from 'app/components/pickers/DatePeriodsPicker';\r\nimport { BookitDateTimePicker } from 'app/components/BookitDatePicker/BookitDateTimePicker';\r\n\r\n/**\r\n * Date picker to be used as a BasicTable filter component\r\n */\r\nconst allPeriods: Array<PeriodTypes> = [\r\n  'CustomDate',\r\n  'Today',\r\n  'TodayTomorrow',\r\n  'ThisWeek',\r\n  'NextWeek',\r\n  'ThisMonth',\r\n  'NextMonth',\r\n  'ThisQuarter',\r\n  'NextQuarter',\r\n  'ThisYear',\r\n  'NextYear',\r\n  'LastWeek',\r\n  'LastMonth',\r\n  'LastQuarter',\r\n  'LastYear',\r\n];\r\nconst noFuturePeriods: Array<PeriodTypes> = [\r\n  'CustomDate',\r\n  'ThisWeek',\r\n  'ThisMonth',\r\n  'ThisQuarter',\r\n  'ThisYear',\r\n  'LastWeek',\r\n  'LastMonth',\r\n  'LastQuarter',\r\n  'LastYear',\r\n];\r\n\r\nexport interface DatesRangeFilterProps extends IFilterComponentProps {\r\n  noFuturePeriods?: boolean;\r\n}\r\nexport const DatesRangeFilter = (props: DatesRangeFilterProps) => {\r\n  const { t } = useTranslation();\r\n  const [value, setValue] = React.useState<PresetDatesRange>(\r\n    props.value !== undefined ? props.value : new PresetDatesRange(),\r\n  );\r\n  const handleStartOnChange = (date: MaterialUiPickersDate) => {\r\n    const changedValue = Object.assign(new PresetDatesRange(), value, {\r\n      start: date,\r\n    });\r\n    setValue(changedValue);\r\n    if (props.onChange !== undefined) {\r\n      props.onChange(changedValue);\r\n    }\r\n  };\r\n  const handleEndOnChange = (date: MaterialUiPickersDate) => {\r\n    const changedValue = Object.assign(new PresetDatesRange(), value, {\r\n      end: date,\r\n    });\r\n    setValue(changedValue);\r\n    if (props.onChange !== undefined) {\r\n      props.onChange(changedValue);\r\n    }\r\n  };\r\n\r\n  const handleTypeChange = (periodValue: PeriodTypesEntity | null) => {\r\n    let changedValue = Object.assign(\r\n      new PresetDatesRange(),\r\n      {\r\n        type:\r\n          (periodValue as PeriodTypesEntity) ??\r\n          (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n      },\r\n      DatesRange.fromPreset(\r\n        (periodValue as PeriodTypesEntity) ??\r\n          (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n        null,\r\n        null,\r\n      ),\r\n    );\r\n    setValue(state => changedValue);\r\n    props.onChange(changedValue);\r\n  };\r\n  return (\r\n    <>\r\n      {value !== undefined && (\r\n        <div\r\n          style={{\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            alignItems: 'flex-start',\r\n            gap: 8,\r\n            width: 400,\r\n          }}\r\n        >\r\n          <DatePeriodsPicker\r\n            isOpen={props.open !== undefined ? props.open : true}\r\n            onChange={handleTypeChange}\r\n            value={\r\n              props.value instanceof PresetDatesRange\r\n                ? (props.value.type as PeriodTypesEntity | undefined)\r\n                : (props.value as PeriodTypesEntity | undefined)\r\n            }\r\n            periods={\r\n              props.noFuturePeriods !== undefined && props.noFuturePeriods\r\n                ? noFuturePeriods\r\n                : allPeriods\r\n            }\r\n            disableClearable={true}\r\n            placeholder={t(translations.Forever)}\r\n            id=\"datesrangeid\"\r\n            size=\"small\"\r\n            aria-label=\"Date Periods select\"\r\n          />\r\n          {/* <DatePeriods\r\n            value={value?.type}\r\n            size=\"small\"\r\n            onChange={handleTypeChange}\r\n          /> */}\r\n          {value !== undefined &&\r\n            value !== null &&\r\n            value?.type !== undefined &&\r\n            value.type.Id === 'CustomDate' && (\r\n              <>\r\n                <BookitDateTimePicker\r\n                  value={props.value === null ? null : value.start}\r\n                  maxDate={value.end ?? undefined}\r\n                  onChange={handleStartOnChange}\r\n                  label={t(translations.From)}\r\n                  size=\"small\"\r\n                  labelFunc={props.labelFunc}\r\n                  inputVariant={'standard'}\r\n                  minutesStep={15}\r\n                  inputProps={{ 'aria-label': 'Start Period' }}\r\n                  id=\"datesrangestartId\"\r\n                  saveOnSelect\r\n                  maskIfEmpty={false}\r\n                  clearable={\r\n                    props.dateTimeClear === undefined ||\r\n                    props.dateTimeClear === null\r\n                      ? true\r\n                      : props.dateTimeClear\r\n                  }\r\n                />\r\n\r\n                {/* <Icon\r\n                  icon=\"arrow-from-left\"\r\n                  color=\"primary\"\r\n                  style={{ marginLeft: '4px', marginRight: '4px' }}\r\n                /> */}\r\n\r\n                <BookitDateTimePicker\r\n                  value={props.value === null ? null : value.end}\r\n                  minDate={value.start ?? undefined}\r\n                  onChange={handleEndOnChange}\r\n                  labelFunc={props.labelFunc}\r\n                  label={t(translations.To)}\r\n                  inputVariant={'standard'}\r\n                  minutesStep={15}\r\n                  size=\"small\"\r\n                  inputProps={{ 'aria-label': 'End Period' }}\r\n                  id=\"datesrangeendId\"\r\n                  saveOnSelect\r\n                  maskIfEmpty={false}\r\n                  clearable={\r\n                    props.dateTimeClear === undefined ||\r\n                    props.dateTimeClear === null\r\n                      ? true\r\n                      : props.dateTimeClear\r\n                  }\r\n                />\r\n              </>\r\n            )}\r\n        </div>\r\n      )}\r\n    </>\r\n  );\r\n};\r\nexport default DatesRangeFilter;\r\n","import { ListItemIcon, ListItemText, Menu, MenuItem } from '@material-ui/core';\r\nimport { Theme, withStyles } from '@material-ui/core/styles';\r\nimport { makeStyles } from '@material-ui/styles';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { TFunctionResult } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  bindMenu,\r\n  usePopupState,\r\n  bindTrigger,\r\n  anchorRef,\r\n} from 'material-ui-popup-state/hooks';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { PluginHook } from 'react-table';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport { IRow } from '.';\r\nimport { RouterLink } from '../BasicLinks/RouterLink';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { CellRenderer } from './BasicTableProps';\r\nimport { ButtonsVariant } from '../BasicButtons/Button';\r\nimport { omit } from 'lodash';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\n\r\nexport interface RowActionsProps {\r\n  href?: string | IPathAndQuery;\r\n  to?: string;\r\n  text: string;\r\n  icon: IconProp;\r\n  title?: string;\r\n  target?: string;\r\n  renderAsTitle?: boolean;\r\n  localizedText?: string;\r\n  onClick?: () => Promise<void>;\r\n}\r\nexport interface RowActionsMenuProps {\r\n  id: string;\r\n  items: RowActionsProps[];\r\n  icon?: IconProp;\r\n  tooltip?: React.ReactNode | TFunctionResult;\r\n  variant?: ButtonsVariant;\r\n  onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\r\n  getIsOpen?: () => boolean;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n  root: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n  },\r\n}));\r\nconst StyledItemIcon = withStyles({\r\n  root: {\r\n    minWidth: 'unset',\r\n  },\r\n})(ListItemIcon);\r\nconst RowMenuActions = React.forwardRef<any, RowActionsMenuProps>(\r\n  function RowMenuActions(props, ref) {\r\n    const { id, items, variant, icon, tooltip, onClick } = props;\r\n    const classes = useStyles();\r\n    const { t } = useTranslation();\r\n    const popupState = usePopupState({\r\n      variant: 'popper',\r\n      popupId: id,\r\n    });\r\n    const [tooltipOpen, setTooltipOpen] = React.useState(false);\r\n    const toAbsolutePath = (href: string | IPathAndQuery) => {\r\n      return typeof href === 'string'\r\n        ? toRootedURL(href)\r\n        : toRootedURL(\r\n            (href as IPathAndQuery).path,\r\n            (href as IPathAndQuery).search,\r\n          );\r\n    };\r\n    React.useEffect(() => {\r\n      if (popupState.isOpen) {\r\n        setTooltipOpen(false);\r\n      }\r\n    }, [popupState.isOpen]);\r\n    const popupProps = { ...bindTrigger(popupState) };\r\n    return (\r\n      <div ref={anchorRef(popupState)} className={classes.root}>\r\n        {!!tooltip ? (\r\n          <Tooltip\r\n            title={tooltip}\r\n            open={tooltipOpen}\r\n            onOpen={() => {\r\n              setTooltipOpen(!popupState.isOpen);\r\n            }}\r\n            onClose={() => setTooltipOpen(false)}\r\n          >\r\n            <span>\r\n              <IconButton\r\n                variant={variant || 'ghost'}\r\n                shape=\"square\"\r\n                aria-label=\"Open Menu\"\r\n                size=\"xs\"\r\n                onClick={event => {\r\n                  popupProps.onClick(event);\r\n                  if (!!onClick) {\r\n                    onClick(event);\r\n                  }\r\n                }}\r\n                {...omit(popupProps, 'onClick')}\r\n              >\r\n                <Icon icon={icon ?? 'ellipsis-v'} />\r\n              </IconButton>\r\n            </span>\r\n          </Tooltip>\r\n        ) : (\r\n          <IconButton\r\n            variant={variant || 'ghost'}\r\n            shape=\"square\"\r\n            aria-label=\"Open Menu\"\r\n            size=\"xs\"\r\n            onClick={event => {\r\n              popupProps.onClick(event);\r\n              if (!!onClick) {\r\n                onClick(event);\r\n              }\r\n            }}\r\n            {...omit(popupProps, 'onClick')}\r\n          >\r\n            <Icon icon={icon ?? 'ellipsis-v'} />\r\n          </IconButton>\r\n        )}\r\n\r\n        <Menu\r\n          {...bindMenu(popupState)}\r\n          ref={ref}\r\n          anchorOrigin={{ vertical: 'center', horizontal: 'right' }}\r\n          transformOrigin={{ vertical: 'top', horizontal: 'left' }}\r\n          getContentAnchorEl={null}\r\n        >\r\n          {items.map((item, index) => {\r\n            return item.renderAsTitle ? (\r\n              <MenuItem dense component={'li'} key={index} ref={ref}>\r\n                {/* <StyledItemIcon>\r\n                  <Icon icon={item.icon} />\r\n                </StyledItemIcon> */}\r\n                <BasicTypography variant=\"boldS\">\r\n                  {!!item.localizedText ? t(item.localizedText) : item.text}\r\n                </BasicTypography>\r\n                {/* <ListItemText>\r\n                  {!!item.localizedText ? t(item.localizedText) : item.text}\r\n                </ListItemText> */}\r\n              </MenuItem>\r\n            ) : item.href ? (\r\n              <MenuItem\r\n                dense\r\n                //href={toAbsolutePath(item.href)}\r\n                component={'li'}\r\n                key={index}\r\n                ref={ref}\r\n                onClick={() => {\r\n                  if (item.href !== undefined) {\r\n                    let url = toAbsolutePath(item.href);\r\n                    window.open(url, '_blank');\r\n                  }\r\n                  popupState.close();\r\n                }}\r\n              >\r\n                <StyledItemIcon>\r\n                  <Icon icon={item.icon} />\r\n                </StyledItemIcon>\r\n                <ListItemText>{item.text}</ListItemText>\r\n              </MenuItem>\r\n            ) : item.to ? (\r\n              <MenuItem\r\n                dense\r\n                component={RouterLink}\r\n                to={item.to}\r\n                key={index}\r\n                ref={ref}\r\n                onClick={popupState.close}\r\n              >\r\n                <StyledItemIcon>\r\n                  <Icon icon={item.icon} />\r\n                </StyledItemIcon>\r\n                <ListItemText>{item.text}</ListItemText>\r\n              </MenuItem>\r\n            ) : (\r\n              <MenuItem\r\n                dense\r\n                key={index}\r\n                ref={ref}\r\n                onClick={async () => {\r\n                  popupState.close();\r\n                  if (item.onClick) {\r\n                    await item.onClick();\r\n                  }\r\n                }}\r\n              >\r\n                <StyledItemIcon>\r\n                  <Icon icon={item.icon} />\r\n                </StyledItemIcon>\r\n                <ListItemText>{item.text}</ListItemText>\r\n              </MenuItem>\r\n            );\r\n          })}\r\n        </Menu>\r\n      </div>\r\n    );\r\n  },\r\n);\r\n\r\nexport function RowActionsMenu(props: RowActionsMenuProps) {\r\n  return <RowMenuActions {...props} />;\r\n}\r\nexport function useRowActionsColumn<TRow extends IRow>(\r\n  rowActions: CellRenderer<TRow>[] | undefined,\r\n  tablePlugins: PluginHook<TRow>[],\r\n) {\r\n  const { t } = useTranslation();\r\n  if (rowActions !== undefined) {\r\n    if (rowActions.length > 0) {\r\n      const actionColumns = rowActions?.map((column, index) => ({\r\n        id: `ActionColumn_${index}`,\r\n        Header: t(translations.Action),\r\n        disableSortBy: true,\r\n        Cell: column,\r\n      }));\r\n      tablePlugins.push(hooks => {\r\n        hooks.visibleColumns.push(columns => [...columns, ...actionColumns]);\r\n      });\r\n    }\r\n  }\r\n}\r\nexport function useInlineRowActionsColumn<TRow extends IRow>(\r\n  inlineRowActions: CellRenderer<TRow>[] | undefined,\r\n  tablePlugins: PluginHook<TRow>[],\r\n) {\r\n  const { t } = useTranslation();\r\n  if (inlineRowActions !== undefined) {\r\n    if (inlineRowActions.length > 0) {\r\n      const actionColumns = inlineRowActions?.map((column, index) => ({\r\n        id: `InlineActionColumn_${index}`,\r\n        Header: t(translations.Action),\r\n        disableSortBy: true,\r\n        Cell: column,\r\n      }));\r\n      tablePlugins.push(hooks => {\r\n        hooks.visibleColumns.push(columns => [...columns, ...actionColumns]);\r\n      });\r\n    }\r\n  }\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.articles || initialState;\r\n\r\nexport const selectArticles = createSelector([selectSlice], state => state);\r\n\r\nexport const selectArticlesExternalSearchResults = createSelector(\r\n  [selectArticles],\r\n  state => state.externalSearchResults,\r\n);\r\n\r\nexport const selectArticlesExternalSearchForm = createSelector(\r\n  [selectArticles],\r\n  state => state.externalSearchFormDetails,\r\n);\r\nexport const selectArticlesExternalSearchPageIndex = createSelector(\r\n  [selectArticles],\r\n  state => state.externalSearchPageIndex,\r\n);\r\nexport const selectArticlesExternalSearchPageSize = createSelector(\r\n  [selectArticles],\r\n  state => state.externalSearchPageSize,\r\n);\r\nexport const selectArticlesExternalSearchPageData = createSelector(\r\n  [selectArticlesExternalSearchResults, selectArticlesExternalSearchPageIndex],\r\n  (results, page) => results.data?.[page],\r\n);\r\nexport const selectArticleDetails = createSelector(\r\n  [selectArticles],\r\n  state => state.articleDetails,\r\n);\r\nexport const selectRefreshEditArticleAssociation = createSelector(\r\n  [selectArticles],\r\n  state => state.refreshEditArticleAssociation,\r\n);\r\nexport const selectArticleDetailsBusy = createSelector(\r\n  [selectArticles],\r\n  state => state.articleDetailsBusy,\r\n);\r\nexport const selectEditArticleAssociationBusy = createSelector(\r\n  [selectArticles],\r\n  state => state.editArticleAssociationBusy,\r\n);\r\n\r\nexport const selectArticleDetailsForm = createSelector(\r\n  [selectArticleDetails],\r\n  state => ({\r\n    ...state,\r\n    ...{\r\n      ServiceGroupAssets:\r\n        state?.Assets?.filter(\r\n          f => f.Availability?.Id === AvailabilityTypes.ServiceGroup,\r\n        ) ?? [],\r\n      InstrumentAssets:\r\n        state?.Assets?.filter(f => f.ServiceTypeId === ServiceType.Online) ??\r\n        [],\r\n    },\r\n  }),\r\n);\r\n","import { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n  EquipmentsChangeStateParameters,\r\n  IReservationEquipmentDto,\r\n  ReservationDetailsState,\r\n  StatusChangeResult,\r\n} from '../slice/types';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport * as Yup from 'yup';\r\nimport { debounce } from 'lodash';\r\nimport { Entity } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { TFunction } from 'i18next';\r\nimport { PrintPDFItem } from 'app/components/PrintToPDF/slice/types';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport const updateFormValues = (\r\n  original: IFormValueDto[],\r\n  coming: IFormValueDto[],\r\n) => {\r\n  const result = coming.map(v => {\r\n    let orn = original.find(o => o.FormFieldId === v.FormFieldId);\r\n    if (!!orn) {\r\n      return Object.assign({}, orn, {\r\n        Value: v.Value,\r\n      });\r\n    } else {\r\n      return v;\r\n    }\r\n  });\r\n  return result;\r\n};\r\nexport const getEnd = (\r\n  start: Date,\r\n  equipments: IReservationEquipmentDto[],\r\n): Date => {\r\n  const ForceFullDayReservations = equipments.some(\r\n    f => f.ForceFullDayReservations,\r\n  );\r\n  if (ForceFullDayReservations) {\r\n    return dateUtils.addDays(dateUtils.startOfDay(start), 1);\r\n  }\r\n  let defEnd = dateUtils.addHours(\r\n    start,\r\n    equipments\r\n      .map(f => f.DefaultReservationDuration)\r\n      .sort((a, b) => a - b)[0] || 1,\r\n  );\r\n  let minEnd = dateUtils.addHours(\r\n    start,\r\n    equipments.map(f => f.MinOrderHours).sort((a, b) => a - b)[\r\n      equipments.length - 1\r\n    ] || 1,\r\n  );\r\n  return defEnd < minEnd ? minEnd : defEnd;\r\n};\r\nexport const validateReservation = async (\r\n  parameters: EquipmentsChangeStateParameters,\r\n) => {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      let results = await ReservationsApi.getValidationState(parameters);\r\n      resolve(results);\r\n    } catch (e) {\r\n      resolve(undefined);\r\n    }\r\n  });\r\n};\r\nexport const validateDuration = async (\r\n  value: Date | undefined,\r\n  context: Yup.TestContext<any>,\r\n) => {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      let parent = context.parent as ReservationDetailsState;\r\n      let results = await ReservationsApi.validateDuration({\r\n        Equipments: parent.EquipmentsData.map(f => f.Id),\r\n        AccServices: parent.AccServices.map(f => f.Id),\r\n        ReservationId: parent.Id > 0 ? parent.Id : null,\r\n        Start: parent.StartTime,\r\n        End: parent.EndTime,\r\n        Status: parent.Status?.Id || 1,\r\n        TrainingSignUp: parent.TrainingSignUp,\r\n        Tutoring: parent.Tutoring,\r\n        FullDayReservation: parent.FullDayReservation,\r\n        ADGroup: parent.ADGroup?.Id || null,\r\n        BookedBy: parent.BookedBy?.Id || null,\r\n        FundingTypeId: parent.FundingType?.Id || 0,\r\n        CheckStatus: false,\r\n        TrainingSessionId: parent.TrainingSession?.Id || null,\r\n        Remarks: parent.Remarks || null,\r\n        BudgetId: parent.Budget?.Id || null,\r\n        CheckSession: false,\r\n      });\r\n      resolve(results.value);\r\n    } catch (e) {\r\n      resolve([]);\r\n    }\r\n  });\r\n};\r\nexport const validateYupPermissions = async (\r\n  value: Entity<string> | null,\r\n  context: Yup.TestContext<any>,\r\n) => {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      let parent = context.parent as ReservationDetailsState;\r\n      let results = await ReservationsApi.validatePermissions({\r\n        Equipments: parent.EquipmentsData.map(f => f.Id),\r\n        AccServices: parent.AccServices.map(f => f.Id),\r\n        ReservationId: parent.Id > 0 ? parent.Id : null,\r\n        Start: parent.StartTime,\r\n        End: parent.EndTime,\r\n        Status: parent.Status?.Id || 1,\r\n        TrainingSignUp: parent.TrainingSignUp,\r\n        Tutoring: parent.Tutoring,\r\n        FullDayReservation: parent.FullDayReservation,\r\n        ADGroup: parent.ADGroup?.Id || null,\r\n        BookedBy: parent.BookedBy?.Id || null,\r\n        FundingTypeId: parent.FundingType?.Id || 0,\r\n        CheckStatus: false,\r\n        TrainingSessionId: parent.TrainingSession?.Id || null,\r\n        Remarks: parent.Remarks || null,\r\n        BudgetId: parent.Budget?.Id || null,\r\n        CheckSession: false,\r\n      });\r\n      resolve(results);\r\n    } catch (e) {\r\n      resolve([]);\r\n    }\r\n  });\r\n};\r\nexport const validatePermissions = async (values: ReservationDetailsState) => {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      let parent = values;\r\n      let results = await ReservationsApi.validatePermissions({\r\n        Equipments: parent.EquipmentsData.map(f => f.Id),\r\n        AccServices: parent.AccServices.map(f => f.Id),\r\n        ReservationId: parent.Id > 0 ? parent.Id : null,\r\n        Start: parent.StartTime,\r\n        End: parent.EndTime,\r\n        Status: parent.Status?.Id || 1,\r\n        TrainingSignUp: parent.TrainingSignUp,\r\n        Tutoring: parent.Tutoring,\r\n        FullDayReservation: parent.FullDayReservation,\r\n        ADGroup: parent.ADGroup?.Id || null,\r\n        BookedBy: parent.BookedBy?.Id || null,\r\n        FundingTypeId: parent.FundingType?.Id || 0,\r\n        CheckStatus: false,\r\n        TrainingSessionId: parent.TrainingSession?.Id || null,\r\n        Remarks: parent.Remarks || null,\r\n        BudgetId: parent.Budget?.Id || null,\r\n        CheckSession: false,\r\n      });\r\n      resolve(results.value);\r\n    } catch (e) {\r\n      resolve(false);\r\n    }\r\n  });\r\n};\r\nexport const validateMinEnd = async (\r\n  value: any,\r\n  context: Yup.TestContext<any>,\r\n) => {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      let val = value as Date;\r\n      if (!!val) {\r\n        resolve(context.parent.StartTime < val);\r\n      } else {\r\n        resolve(true);\r\n      }\r\n    } catch (e) {\r\n      resolve(true);\r\n    }\r\n  });\r\n};\r\nexport const validatePrerequisite = async (values: ReservationDetailsState) => {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      let parent = values;\r\n      let results = await ReservationsApi.validatePrerequisite({\r\n        Equipments: parent.EquipmentsData.map(f => f.Id),\r\n        AccServices: parent.AccServices.map(f => f.Id),\r\n        ReservationId: parent.Id > 0 ? parent.Id : null,\r\n        Start: parent.StartTime,\r\n        End: parent.EndTime,\r\n        Status: parent.Status?.Id || 1,\r\n        TrainingSignUp: parent.TrainingSignUp,\r\n        Tutoring: parent.Tutoring,\r\n        FullDayReservation: parent.FullDayReservation,\r\n        ADGroup: parent.ADGroup?.Id || null,\r\n        BookedBy: parent.BookedBy?.Id || null,\r\n        FundingTypeId: parent.FundingType?.Id || 0,\r\n        CheckStatus: false,\r\n        TrainingSessionId: parent.TrainingSession?.Id || null,\r\n        Remarks: parent.Remarks || null,\r\n        BudgetId: parent.Budget?.Id || null,\r\n        CheckSession: false,\r\n      });\r\n      resolve(results);\r\n    } catch (e) {\r\n      resolve(false);\r\n    }\r\n  });\r\n};\r\n\r\nexport const validateAccServices = (\r\n  allEquipments: IReservationEquipmentDto[],\r\n): string[] => {\r\n  let allAcc = allEquipments.reduce((acc, next) => {\r\n    let services: IEquipmentAccServiceDto[] = [];\r\n    acc.forEach(c => {\r\n      if (next.AccServices.some(n => n.Id === c.Id)) {\r\n        services.push(c);\r\n      }\r\n    });\r\n    return services;\r\n  }, allEquipments.filter(f => f.AccServices.length > 0)[0].AccServices);\r\n  if (\r\n    allEquipments.some(f => f.AccServices.length > 0) &&\r\n    allEquipments.some(f => f.AccServices.length < 1)\r\n  ) {\r\n    return allEquipments.filter(f => f.AccServices.length > 0).map(f => f.Name);\r\n  } else if (allAcc.length !== allEquipments.length) {\r\n    let wrongEqs = allEquipments.filter(\r\n      f => !allAcc.some(a => a.EquipmentId === f.Id),\r\n    );\r\n    return wrongEqs.map(f => f.Name);\r\n  } else {\r\n    return [];\r\n  }\r\n};\r\nexport const getStatus = async (\r\n  values: ReservationDetailsState,\r\n  trainingSessionOnly: boolean,\r\n): Promise<StatusChangeResult> => {\r\n  return new Promise(async (resolve, reject) => {\r\n    if (trainingSessionOnly) {\r\n      let status = {\r\n        Status: (values.EquipmentsData as IReservationEquipmentDto[])[0]\r\n          .TrainingSignUpApproval,\r\n        Tutoring: false,\r\n      } as StatusChangeResult;\r\n      resolve(status);\r\n    } else {\r\n      try {\r\n        let parent = values;\r\n        let result = await ReservationsApi.changeStatus({\r\n          Equipments: parent.EquipmentsData.map(f => f.Id),\r\n          AccServices: parent.AccServices.map(f => f.Id),\r\n          ReservationId: parent.Id > 0 ? parent.Id : null,\r\n          Start: parent.StartTime,\r\n          End: parent.EndTime,\r\n          Status: parent.Status?.Id || 1,\r\n          TrainingSignUp: parent.TrainingSignUp,\r\n          Tutoring: parent.Tutoring,\r\n          FullDayReservation: parent.FullDayReservation,\r\n          ADGroup: parent.ADGroup?.Id || null,\r\n          BookedBy: parent.BookedBy?.Id || null,\r\n          FundingTypeId: parent.FundingType?.Id || 0,\r\n          CheckStatus: false,\r\n          TrainingSessionId: parent.TrainingSession?.Id || null,\r\n          Remarks: parent.Remarks || null,\r\n          BudgetId: parent.Budget?.Id || null,\r\n          CheckSession: false,\r\n        });\r\n        resolve(result);\r\n      } catch (e) {\r\n        resolve({\r\n          Status: values.Status?.Id || 1,\r\n          Tutoring: values.Tutoring,\r\n        } as StatusChangeResult);\r\n      }\r\n    }\r\n  });\r\n};\r\nexport const formatedToString = (date: Date | string) => {\r\n  return dateUtils.formatISO(dateUtils.dateOrStringToDate(date));\r\n};\r\nexport const toDate = (date: Date | string) => {\r\n  return dateUtils.dateOrStringToDate(date);\r\n};\r\nexport const newDate = (date: Date | string | undefined | null) => {\r\n  if (!date) {\r\n    return new CustomDate(new Date(), 'complete');\r\n  } else {\r\n    return new CustomDate(toDate(date), 'complete');\r\n  }\r\n};\r\nexport const greaterThanDate = (\r\n  compared: Date | string,\r\n  toCompare: Date | string,\r\n) => {\r\n  let first = newDate(compared);\r\n  let second = newDate(toCompare);\r\n  if (first.getTime() > second.getTime()) {\r\n    return true;\r\n  }\r\n  return false;\r\n};\r\nexport const lessThanDate = (\r\n  compared: Date | string,\r\n  toCompare: Date | string,\r\n) => {\r\n  let first = newDate(compared);\r\n  let second = newDate(toCompare);\r\n  if (first.getTime() < second.getTime()) {\r\n    return true;\r\n  }\r\n  return false;\r\n};\r\nexport const getWorkFlowName = (userName: string) => {\r\n  return {\r\n    Id: -1,\r\n    Name: `${userName} ${dateUtils.shortDateTimeFormat(newDate(undefined))}`,\r\n  } as Entity<number>;\r\n};\r\nexport const debounceValidateMinEnd = debounce(validateMinEnd, 300);\r\nexport function getPrintPDFDefaultSections(\r\n  t: TFunction,\r\n  serviceRequestEnabled: boolean,\r\n  hasCustomForm?: boolean,\r\n): PrintPDFItem[] {\r\n  let sections = [\r\n    {\r\n      id: 'ReservationDetails',\r\n      label: t(translations.ReservationDetails),\r\n      checked: true,\r\n    },\r\n    {\r\n      id: 'OfflineServicesDetails',\r\n      label: t(translations.ReservationConsumables),\r\n      checked: false,\r\n    },\r\n  ];\r\n  if (hasCustomForm) {\r\n    sections.push({\r\n      id: 'CustomFormDetails',\r\n      label: t(translations.CustomFormDetails),\r\n      checked: true,\r\n    });\r\n  }\r\n  if (serviceRequestEnabled) {\r\n    sections.push({\r\n      id: 'ServiceRequest',\r\n      label: t(translations.AssociatedServiceRequestDetails),\r\n      checked: false,\r\n    });\r\n  }\r\n  return sections;\r\n}\r\n","import { IUtils } from '@date-io/core/IUtils';\r\nimport { validate } from '@material-ui/pickers';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { DateDropDownValidationProps } from 'app/components/BookitDatePicker/DateDropDown';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const validateError = (\r\n  date: MaterialUiPickersDate | ParsableDate,\r\n  propss: any,\r\n  utils: IUtils<MaterialUiPickersDate>,\r\n) => {\r\n  let error = validate(date, utils, propss);\r\n  if (error === '') {\r\n    return undefined;\r\n  }\r\n  return error;\r\n};\r\nexport const validateDate = (\r\n  day: number,\r\n  month: number,\r\n  year: number,\r\n  props: DateDropDownValidationProps,\r\n  utils: IUtils<MaterialUiPickersDate>,\r\n  currentDate?: Date | string | null,\r\n): React.ReactNode | undefined => {\r\n  if (currentDate !== null && currentDate !== undefined) {\r\n    let date = dateUtils.truncateTime(\r\n      dateUtils.dateOrStringToDate(currentDate),\r\n    );\r\n    let opDate = dateUtils.set(date, {\r\n      year: year,\r\n      month: month,\r\n    });\r\n    let maxMonthDays = dateUtils.getDaysInMonth(opDate);\r\n    if (day > maxMonthDays) {\r\n      return `Invalid Date: The day can not be longer than ${maxMonthDays}.`;\r\n    } else {\r\n      let finalDate = dateUtils.set(opDate, { date: day });\r\n      return validateError(\r\n        finalDate,\r\n        {\r\n          maxDate: props.maxDate,\r\n          minDate: props.minDate,\r\n          disablePast: props.disablePast,\r\n          disableFuture: props.disableFuture,\r\n          maxDateMessage: props.maxDateMessage,\r\n          minDateMessage: props.minDateMessage,\r\n          invalidDateMessage: props.invalidDateMessage,\r\n          strictCompareDates: props.strictCompareDates,\r\n        },\r\n        utils,\r\n      );\r\n    }\r\n  } else {\r\n    return undefined;\r\n  }\r\n};\r\nexport const validateTime = (\r\n  hours: number,\r\n  minutes: number,\r\n  props: DateDropDownValidationProps,\r\n  utils: IUtils<MaterialUiPickersDate>,\r\n  currentDate?: Date | string | null,\r\n  ampm?: boolean,\r\n): React.ReactNode | undefined => {\r\n  if (currentDate !== null && currentDate !== undefined) {\r\n    let date = dateUtils.dateOrStringToDate(currentDate);\r\n    let opDate = dateUtils.set(date, {\r\n      hours: hours,\r\n      minutes: minutes,\r\n    });\r\n    let finalDate = dateUtils.convertToMeridiem(\r\n      opDate,\r\n      dateUtils.getMeridiem(date),\r\n      ampm ?? false,\r\n    );\r\n    return validateError(\r\n      finalDate,\r\n      {\r\n        maxDate: props.maxDate,\r\n        minDate: props.minDate,\r\n        disablePast: props.disablePast,\r\n        disableFuture: props.disableFuture,\r\n        maxDateMessage: props.maxDateMessage,\r\n        minDateMessage: props.minDateMessage,\r\n        invalidDateMessage: props.invalidDateMessage,\r\n        strictCompareDates: props.strictCompareDates,\r\n      },\r\n      utils,\r\n    );\r\n  } else {\r\n    return undefined;\r\n  }\r\n};\r\nexport const checkDateInput = (\r\n  dateStart: 'day' | 'month' | 'year',\r\n  val?: string | null,\r\n) => {\r\n  if (val === null || val === undefined) {\r\n    return true;\r\n  }\r\n  //eslint-disable-next-line\r\n  const regexDDMMYYYY = RegExp(\r\n    //eslint-disable-next-line\r\n    '^(((0[1-9]|[12][0-9]|30)[-/]?(0[13-9]|1[012])|31[-/]?(0[13578]|1[02])|(0[1-9]|1[0-9]|2[0-8])[-/]?02)[-/]?[0-9]{4}|29[-/]?02[-/]?([0-9]{2}(([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00))$',\r\n  );\r\n  const regexYYYYMMdd = RegExp(\r\n    //eslint-disable-next-line\r\n    '^([0-9]{4}[-/]?((0[13-9]|1[012])[-/]?(0[1-9]|[12][0-9]|30)|(0[13578]|1[02])[-/]?31|02[-/]?(0[1-9]|1[0-9]|2[0-8]))|([0-9]{2}(([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00)[-/]?02[-/]?29)$',\r\n  );\r\n  const regexMMDDYYYY = RegExp(\r\n    //eslint-disable-next-line\r\n    `^(((0[13-9]|1[012])[-/]?(0[1-9]|[12][0-9]|30)|(0[13578]|1[02])[-/]?31|02[-/]?(0[1-9]|1[0-9]|2[0-8]))[-/]?[0-9]{4}|02[-/]?29[-/]?([0-9]{2}(([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00))$`,\r\n  );\r\n  let res =\r\n    dateStart === 'day'\r\n      ? regexDDMMYYYY.test(val)\r\n      : dateStart === 'month'\r\n      ? regexMMDDYYYY.test(val)\r\n      : regexYYYYMMdd.test(val);\r\n  return res;\r\n};\r\n","/**\r\n *\r\n * DateTimeLabel\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface DateTimeLabelProps {\r\n  value: Date | string | null;\r\n}\r\n\r\nexport function DateTimeLabel(props: DateTimeLabelProps) {\r\n  return <>{dateUtils.shortDateTimeFormat(props.value)}</>;\r\n}\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { CheckColor } from '.';\r\n\r\nexport const useStyles = makeStyles<\r\n  Theme,\r\n  {\r\n    size?: 'medium' | 'small';\r\n    color?: CheckColor;\r\n    withPadding?: boolean;\r\n    danger?: boolean;\r\n  }\r\n>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      '&[class*=\"PrivateSwitchBase-root\"]': {\r\n        padding: props => (props.withPadding ? 9 : 0),\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: 'transparent',\r\n      },\r\n    },\r\n    icon: {\r\n      borderRadius: 4,\r\n      width: props => (props.size === 'medium' ? 20 : 16),\r\n      height: props => (props.size === 'medium' ? 20 : 16),\r\n      boxShadow: props =>\r\n        props.danger\r\n          ? `inset 0 0 0 1px ${bookitColors.danger.borders}, inset 0 -1px 0 ${bookitColors.danger.borders}`\r\n          : `inset 0 0 0 1px ${bookitColors.grayscale.grayBorders}, inset 0 -1px 0 ${bookitColors.grayscale.grayBorders}`,\r\n      //border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n      backgroundColor: bookitColors.base.white,\r\n      backgroundImage:\r\n        'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))',\r\n      '$root.Mui-focusVisible &': {\r\n        // outline: `1px auto ${blackGray.colorGrayComponentsLight}`,\r\n        // outlineOffset: 1,\r\n        boxShadow: props =>\r\n          props.danger\r\n            ? `inset 0 0 0 2px ${bookitColors.danger.componentsLight}, inset 0 -1px 0 ${bookitColors.danger.componentsLight}`\r\n            : `inset 0 0 0 2px ${bookitColors.grayscale.grayComponentsLight}, inset 0 -1px 0 ${bookitColors.grayscale.grayComponentsLight}`,\r\n      },\r\n      'input:hover ~ &': {\r\n        // backgroundColor: '#ebf1f5',\r\n        //border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n        boxShadow: props =>\r\n          props.danger\r\n            ? `inset 0 0 0 1px ${bookitColors.danger.borders}, inset 0 -1px 0 ${bookitColors.danger.borders}`\r\n            : `inset 0 0 0 1px ${bookitColors.grayscale.grayBorders}, inset 0 -1px 0 ${bookitColors.grayscale.grayBorders}`,\r\n      },\r\n      'input:disabled ~ &': {\r\n        boxShadow: props =>\r\n          props.danger\r\n            ? `inset 0 0 0 1px ${bookitColors.danger.disabled}, inset 0 -1px 0 ${bookitColors.danger.disabled}`\r\n            : `inset 0 0 0 1px ${bookitColors.grayscale.graySelection}, inset 0 -1px 0 ${bookitColors.grayscale.graySelection}`,\r\n        background: props =>\r\n          props.danger\r\n            ? bookitColors.danger.background\r\n            : bookitColors.grayscale.grayBackground,\r\n      },\r\n    },\r\n    checkedIcon: {\r\n      boxShadow: 'unset',\r\n      backgroundColor: props =>\r\n        props.danger\r\n          ? bookitColors.danger.regular\r\n          : // : props.color === 'secondary'\r\n            // ? bookitColors.success.regular\r\n            bookitColors.primary.regular,\r\n      backgroundImage:\r\n        'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',\r\n      '&:before': {\r\n        display: 'block',\r\n        width: props => (props.size === 'medium' ? 20 : 16),\r\n        height: props => (props.size === 'medium' ? 20 : 16),\r\n        backgroundImage:\r\n          \"url(\\\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath\" +\r\n          \" fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 \" +\r\n          \"1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E\\\")\",\r\n        content: '\"\"',\r\n      },\r\n      'input:hover ~ &': {\r\n        backgroundColor: props =>\r\n          props.danger\r\n            ? bookitColors.danger.hover\r\n            : // : props.color === 'secondary'\r\n              // ? bookitColors.success.hover\r\n              bookitColors.primary.hover,\r\n        boxShadow: 'unset',\r\n      },\r\n      'input:disabled ~ &': {\r\n        boxShadow: 'unset', //`inset 0 0 0 1px ${blackGray.colorDividers}, inset 0 -1px 0 ${blackGray.colorDividers}`,\r\n        background: props =>\r\n          props.danger\r\n            ? bookitColors.danger.disabled\r\n            : // : props.color === 'secondary'\r\n              // ? bookitColors.success.disabled\r\n              bookitColors.primary.disabled,\r\n      },\r\n    },\r\n    indeterminateIcon: {\r\n      boxShadow: 'unset',\r\n      backgroundColor: props =>\r\n        props.danger\r\n          ? bookitColors.danger.regular\r\n          : // : props.color === 'secondary'\r\n            // ? bookitColors.success.regular\r\n            bookitColors.primary.regular,\r\n      backgroundImage:\r\n        'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',\r\n      '&:before': {\r\n        display: 'block',\r\n        width: props => (props.size === 'medium' ? 20 : 16),\r\n        height: props => (props.size === 'medium' ? 20 : 16),\r\n        backgroundImage:\r\n          \"url(\\\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-54 -24 516 560'%3E%3Cpath\" +\r\n          \" fill-rule='evenodd' clip-rule='evenodd' d='M400 288h-352c-17.69 \" +\r\n          \"0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z' fill='%23fff'/%3E%3C/svg%3E\\\")\",\r\n        content: '\"\"',\r\n      },\r\n      'input:hover ~ &': {\r\n        backgroundColor: props =>\r\n          props.danger\r\n            ? bookitColors.danger.hover\r\n            : // : props.color === 'secondary'\r\n              // ? bookitColors.success.hover\r\n              bookitColors.primary.hover,\r\n        boxShadow: 'unset',\r\n      },\r\n      'input:disabled ~ &': {\r\n        boxShadow: 'unset', //`inset 0 0 0 1px ${blackGray.colorDividers}, inset 0 -1px 0 ${blackGray.colorDividers}`,\r\n        background: props =>\r\n          props.danger\r\n            ? bookitColors.danger.disabled\r\n            : // : props.color === 'secondary'\r\n              // ? bookitColors.success.disabled\r\n              bookitColors.primary.disabled,\r\n      },\r\n    },\r\n  }),\r\n);\r\n","import { Checkbox, CheckboxProps } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { useStyles } from './styles';\r\n\r\nexport type CheckColor = 'primary';\r\n\r\nexport interface CheckProps extends Omit<CheckboxProps, 'color'> {\r\n  color?: CheckColor;\r\n  checkicon?: React.ReactNode;\r\n  uncheckicon?: React.ReactNode;\r\n  indetermicon?: React.ReactNode;\r\n  withPadding?: boolean;\r\n  danger?: boolean;\r\n  label?: string;\r\n}\r\n\r\nexport function Check(props: CheckProps) {\r\n  const {\r\n    color,\r\n    checkicon,\r\n    uncheckicon,\r\n    indetermicon,\r\n    label,\r\n    withPadding = true,\r\n    danger,\r\n    size = 'medium',\r\n    ...other\r\n  } = props;\r\n  const classes = useStyles({\r\n    size: size,\r\n    color: color,\r\n    withPadding: withPadding,\r\n    danger: danger,\r\n  });\r\n  return (\r\n    <Checkbox\r\n      disableRipple\r\n      classes={{ root: classes.root }}\r\n      checkedIcon={\r\n        !!checkicon ? (\r\n          checkicon\r\n        ) : (\r\n          <span className={clsx(classes.icon, classes.checkedIcon)} />\r\n        )\r\n      }\r\n      icon={!!uncheckicon ? uncheckicon : <span className={classes.icon} />}\r\n      indeterminateIcon={\r\n        !!indetermicon ? (\r\n          indetermicon\r\n        ) : (\r\n          <span className={clsx(classes.icon, classes.indeterminateIcon)} />\r\n        )\r\n      }\r\n      inputProps={{ 'aria-label': !!label ? label : 'decorative checkbox' }}\r\n      size={size}\r\n      color={'default'}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","export enum PriceSheetBy {\r\n  InstrumentsAndServices = 1,\r\n  InstrumentCategoryAndProjectCategory = 2,\r\n}\r\n\r\nexport enum BudgetType {\r\n  Regular = 1,\r\n  Expanses = 2,\r\n}\r\nexport enum UserRegistersToSpecificCoresType {\r\n  UserRegistersToSpecificCores_NA = 1,\r\n  UserRegistersToSpecificCores_Optional = 2,\r\n  UserRegistersToSpecificCores_Mandatory = 3,\r\n}\r\n\r\nexport enum AutomaticAssetNamings {\r\n  No,\r\n  Cat,\r\n  Nick,\r\n}\r\nexport enum UserReservationsRestricted {\r\n  NotRestricted = 0,\r\n  UserGroupRestricted = 1,\r\n  UserOwnRestricted = 2,\r\n}\r\nexport enum SideBarQuickActionsEnum {\r\n  NA = 0,\r\n  CreateReservation = 1,\r\n  CreateWorkOrder = 2,\r\n}\r\n","export enum DraftReservationTypes {\r\n  DraftReservationTypes_SaveForLater = 0,\r\n  DraftReservationTypes_ApprovalRequired = 1,\r\n  DraftReservationTypes_AllUser = 2,\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.Enums.AllowReservationCollaboratorsTypes\r\n *\r\n */\r\n\r\nexport enum AllowReservationCollaboratorsTypes {\r\n  None = 1,\r\n  NotAllowedToStartUsage = 0,\r\n  AllowedToStartUsage = 2,\r\n}\r\nexport const AllowReservationCollaboratorsTypesArray = [\r\n  'None',\r\n  'NotAllowedToStartUsage',\r\n  'AllowedToStartUsage',\r\n];\r\nexport type AllowReservationCollaboratorsTypesUnion = keyof typeof AllowReservationCollaboratorsTypes;\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { DraftReservationTypes } from 'enums/DraftReservationTypes';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport {\r\n  IMandatoryEquipmentsDto,\r\n  IReservationEquipmentDto,\r\n  ServiceSettingsState,\r\n} from './types';\r\nimport { combineOfflineServiceTypes } from './combineOfflineServiceTypes';\r\nimport { AllowReservationCollaboratorsTypes } from 'api/odata/generated/enums/AllowReservationCollaboratorsTypes';\r\nimport { getBudgetVisible } from './getBudgetVisible';\r\nimport { groupBy, values } from 'lodash';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\n\r\nexport function mapSettingsFromServices(\r\n  equipments: IReservationEquipmentDto[],\r\n  accServices: IEquipmentAccServiceDto[],\r\n  globalSettings: GlobalSettingsType,\r\n  authenticatedUser: AuthenticatedUser,\r\n  settings?: ServiceSettingsState,\r\n): ServiceSettingsState {\r\n  const p: Partial<ServiceSettingsState> = {\r\n    HasHideProjects: equipments.every(f => f.HideProjects),\r\n    HasConflictProjects:\r\n      equipments.some(f => f.HideProjects === true) &&\r\n      equipments.some(f => f.HideProjects === false),\r\n    HasMultipleProjects:\r\n      globalSettings.allowPartialProjectCharges &&\r\n      equipments.every(f => f.AllowPartialProjectCharges === true),\r\n    HasPartialSingleProject:\r\n      globalSettings.allowPartialSingleProjectCharges &&\r\n      equipments.every(f => f.AllowPartialSingleProjectCharges === true),\r\n    AllOffServicesAllowed: equipments.every(\r\n      f => f.ReservationOfflineServicesEnabled === null,\r\n    ),\r\n    OfflineServicesVisible: equipments.every(\r\n      f =>\r\n        f.ReservationOfflineServicesEnabled === true ||\r\n        f.ReservationOfflineServicesEnabled === null,\r\n    ),\r\n    AllowReservationCollaborators:\r\n      globalSettings.hideReservationCollaborators !== true &&\r\n      equipments.every(f =>\r\n        [\r\n          AllowReservationCollaboratorsTypes.AllowedToStartUsage,\r\n          AllowReservationCollaboratorsTypes.NotAllowedToStartUsage,\r\n        ].includes(f.AllowReservationCollaborators),\r\n      ),\r\n    budgetExperimentVisible:\r\n      globalSettings.budgetExperimentModuleEnabled &&\r\n      equipments.some(f => f.BudgetExperimentSettings),\r\n    TrainingSignUpApproval:\r\n      equipments.length === 1\r\n        ? equipments[0].TrainingSignUpApproval ?? 1\r\n        : undefined,\r\n    HideTrainingSession: equipments.every(f => f.HideTrainingSession === true),\r\n    HasAttendance: equipments.every(f => f.HasAttendance === true),\r\n    ForceTutoring: equipments.some(\r\n      f =>\r\n        f.ForceTutoring === true &&\r\n        authenticatedUser.IsAdminOf({\r\n          ServiceGroupId: f.ServiceGroupId,\r\n          ServiceId: f.Id,\r\n          ServiceTypeId: ServiceType.Online,\r\n        }) === false,\r\n    ),\r\n    ForceFullDayReservations: equipments.some(f => f.ForceFullDayReservations),\r\n    IsEquipmentTutoring: equipments.some(f => f.IsEquipmentTutoring === true),\r\n    NotAllowReservations: equipments.some(f => f.NotAllowReservations === true),\r\n    AllowOneAccSerOnly: equipments.some(f => f.AllowOneAccSerOnly === true),\r\n    IsAllAdmin: equipments.every(\r\n      f =>\r\n        authenticatedUser.IsAdminOf({\r\n          ServiceGroupId: f.ServiceGroupId,\r\n          ServiceId: f.Id,\r\n          ServiceTypeId: ServiceType.Online,\r\n        }) === true,\r\n    ),\r\n    RestrictReservationToTimeSlots: equipments.every(\r\n      f => f.RestrictReservationToTimeSlots === true,\r\n    ),\r\n    DefaultReservationDuration:\r\n      equipments.length > 0\r\n        ? equipments\r\n            .map(f => f.DefaultReservationDuration)\r\n            .sort((a, b) => a - b)[0]\r\n        : 1,\r\n    MinOrderHours:\r\n      equipments.length > 0\r\n        ? equipments.map(f => f.MinOrderHours).sort((a, b) => a - b)[\r\n            equipments.length - 1\r\n          ]\r\n        : 1,\r\n    MaxOrderHours:\r\n      equipments.length > 0\r\n        ? accServices.length > 0 &&\r\n          accServices.some(f => f.MaxOrderDuration !== null)\r\n          ? accServices\r\n              .map(f => f.MaxOrderDuration ?? 0)\r\n              .sort((a, b) => a - b)[0]\r\n          : equipments.map(f => f.MaxOrderHours).sort((a, b) => a - b)[0]\r\n        : equipments.map(f => f.MaxOrderHours).sort((a, b) => a - b)[0],\r\n\r\n    MinOrderGap:\r\n      equipments.length > 0\r\n        ? accServices.length > 0 &&\r\n          accServices.some(f => f.MinOrderGap !== null)\r\n          ? accServices.map(f => f.MinOrderGap ?? 0).sort((a, b) => a - b)[0]\r\n          : equipments.map(f => f.MinOrderGap).sort((a, b) => a - b)[0]\r\n        : equipments.map(f => f.MinOrderGap).sort((a, b) => a - b)[0],\r\n    RestrictDurationUnitsAmount:\r\n      equipments.length > 0\r\n        ? equipments\r\n            .map(f => f.RestrictDurationUnitsAmount ?? 0)\r\n            .filter(f => f !== 0)\r\n            .sort((a, b) => a - b)[equipments.length - 1]\r\n        : null,\r\n    RestrictDurationUnitType:\r\n      equipments.length > 0\r\n        ? equipments\r\n            .map(f => f.RestrictDurationUnitType ?? 0)\r\n            .filter(f => f !== 0)\r\n            .sort((a, b) => a - b)[equipments.length - 1]\r\n        : null,\r\n    DefaultAccServiceId:\r\n      equipments.length > 0\r\n        ? equipments.every(\r\n            f =>\r\n              f.DefaultAccServiceId === equipments[0].DefaultAccServiceId ?? -1,\r\n          )\r\n          ? equipments[0].DefaultAccServiceId || null\r\n          : null\r\n        : null,\r\n    BudgetsTurnedOn: equipments.some(f => f.BudgetsTurnedOn === true),\r\n    Billable: equipments.some(f => f.Billable === true),\r\n    IsLoanDesc: equipments.some(f => f.LoanTypeId === 1),\r\n    AllowModification: globalSettings.allowOngoingReservationModificationEnabled\r\n      ? equipments\r\n          .filter(f => f.NotAllowReservations === false)\r\n          .every(f => f.AllowModification === true)\r\n      : false,\r\n    AllowExtendReservation: globalSettings.allowOngoingReservationModificationEnabled\r\n      ? equipments\r\n          .filter(f => f.NotAllowReservations === false)\r\n          .every(f => f.AllowExtendReservation === true)\r\n      : false,\r\n    AllowUsersToShortenReservations: equipments.every(\r\n      f => f.AllowUsersToShortenReservations === true,\r\n    ),\r\n    AllowedToTransfer: equipments.every(f => f.AllowedToTransfer === true),\r\n    AllowedToTransferAll: equipments.every(\r\n      f => f.AllowedToTransferAll === true,\r\n    ),\r\n    EnforceReservationRestrictions: equipments.every(\r\n      f => f.EnforceReservationRestrictions === true,\r\n    ),\r\n    LimitlessReservationAllowed: equipments.every(\r\n      f => f.LimitlessReservationAllowed === true,\r\n    ),\r\n    BudgetVisible: getBudgetVisible(\r\n      globalSettings,\r\n      equipments.map(service => ({\r\n        Billable: service.Billable,\r\n        BudgetsTurnedOn: service.BudgetsTurnedOn,\r\n        HideProjects: service.HideProjects,\r\n        ServiceTypeId: ServiceType.Online,\r\n      })),\r\n    ),\r\n    OfflineServiceTypes: combineOfflineServiceTypes(equipments),\r\n\r\n    Groups:\r\n      equipments.length > 0\r\n        ? equipments\r\n            .filter((item, index, arr) => {\r\n              return (\r\n                arr.findIndex(t => t.ServiceGroupId === item.ServiceGroupId) ===\r\n                index\r\n              );\r\n            })\r\n            .map(f => f.ServiceGroupId)\r\n        : [],\r\n    HasAccServices:\r\n      equipments.length > 0 && equipments.some(f => f.AccServices?.length > 0),\r\n    StaffUserVisibleAllways:\r\n      equipments.length > 0 &&\r\n      equipments.some(f => f.StaffUserSelectionVisible === true),\r\n    StaffUserVisibleOnPending:\r\n      equipments.length > 0 &&\r\n      equipments.some(f => f.StaffUserSelectionVisible === false),\r\n    StaffUserRequiredAlwais:\r\n      equipments.length > 0 &&\r\n      equipments.some(f => f.StaffUserSelectionRequired === true),\r\n    StaffUserRequiredOnPending:\r\n      equipments.length > 0 &&\r\n      equipments.some(f => f.StaffUserSelectionRequired === false),\r\n    StaffUserSelection:\r\n      equipments.length > 0 &&\r\n      equipments.some(f => f.StaffUserSelection?.length > 0)\r\n        ? equipments\r\n            .filter(d => d.StaffUserSelection?.length > 0)\r\n            .reduce((acc, next) => {\r\n              return acc.concat(\r\n                next.StaffUserSelection?.filter(\r\n                  f => !acc.some(c => c.Id === f.Id),\r\n                ),\r\n              );\r\n            }, equipments.filter(d => d.StaffUserSelection?.length > 0)[0].StaffUserSelection)\r\n        : [],\r\n    RequireUserGroupCoordApproval:\r\n      equipments.length > 0 &&\r\n      equipments.some(f => f.RequireUserGroupCoordApproval === true),\r\n    DraftForAll:\r\n      equipments.length > 0 &&\r\n      equipments.every(\r\n        f =>\r\n          f.DraftReservationsTypeId ===\r\n          DraftReservationTypes.DraftReservationTypes_AllUser,\r\n      ),\r\n    DraftApprovalRequred:\r\n      equipments.length > 0 &&\r\n      equipments.every(\r\n        f =>\r\n          f.DraftReservationsTypeId ===\r\n          DraftReservationTypes.DraftReservationTypes_ApprovalRequired,\r\n      ),\r\n    DraftSaveForLater:\r\n      equipments.length > 0 &&\r\n      equipments.every(\r\n        f =>\r\n          f.DraftReservationsTypeId ===\r\n          DraftReservationTypes.DraftReservationTypes_SaveForLater,\r\n      ),\r\n  };\r\n  const result = Object.assign({}, settings, p);\r\n  return result;\r\n}\r\nexport function combineOptionalEquipments(\r\n  services: IMandatoryEquipmentsDto[] | undefined,\r\n): IMandatoryEquipmentsDto[] | undefined {\r\n  if (services === undefined) {\r\n    return undefined;\r\n  }\r\n  return values(groupBy(services, f => f.Id)).map(f => {\r\n    return f[0];\r\n  });\r\n}\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n  ReservationDetailsState,\r\n  ReservationSettingsState,\r\n  ReservationEquipment,\r\n  CustomFormValueModel,\r\n  ReservationUpdateModel,\r\n  OfflineservicesModel,\r\n} from './types';\r\n\r\nexport function ConvertModelToUpdateEntity(\r\n  original: ReservationDetailsState,\r\n  current: ReservationDetailsState,\r\n  settings: ReservationSettingsState | undefined,\r\n  offlineServices: IOtherServices[],\r\n  user: AuthenticatedUser | undefined,\r\n  terminate?: boolean,\r\n) {\r\n  let entity = {\r\n    Id: original.Id,\r\n    Services: current.EquipmentsData.map(item => {\r\n      return {\r\n        EquipmentId: item.Id,\r\n        EquipmentName: item.Name,\r\n        AccServiceIds:\r\n          current.AccServices.length > 0\r\n            ? current.AccServices.filter(\r\n                a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n              ).map(a => a.Id)\r\n            : [],\r\n        AssemblyId: null,\r\n        ReservationId: original.Id,\r\n      } as ReservationEquipment;\r\n    }),\r\n    StartTime: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(current.StartTime),\r\n    ),\r\n    EndTime: dateUtils.formatISO(dateUtils.dateOrStringToDate(current.EndTime)),\r\n    Remarks: current.Remarks || null,\r\n    SampleRunId: current.SampleRunId,\r\n    SampleIds: current.SampleIds,\r\n    BudgetId: current.Budget?.Id,\r\n    BudgetExperimentId: current.BudgetExperiment?.Id,\r\n    Collaborators: current.CollaboratedUsers.map(f => f.Id),\r\n    ExternalCustomerId: current.ExternalCustomer?.Id,\r\n    FundingTypeId: current.FundingType?.Id ?? 0,\r\n    InstituteProjectId: current.InstituteProject?.Id,\r\n    Name: current.DisplayName,\r\n    PartialAttendance: current.PartialAttendance,\r\n    PartialAttendanceStart: current.PartialAttendanceStart || null,\r\n    PartialAttendanceEnd: current.PartialAttendanceEnd || null,\r\n    Tutoring: current.Tutoring,\r\n    FullDayReservation: current.FullDayReservation,\r\n    Username: current.BookedBy?.Id,\r\n    StaffUser: current.StaffUser?.Id,\r\n    UserGroupId: current.ADGroup?.Id,\r\n    TrainingSignUp: current.TrainingSignUp,\r\n    TrainingSessionId: current.TrainingSession?.Id,\r\n    PurchaseOrder: current.PurchaseOrder,\r\n    Reference: current.Reference,\r\n    Status: current.Status?.Id,\r\n    TransferFromId: current.TransferFromId,\r\n    UserRequestedByApproval: settings?.UserRequestedByApproval,\r\n    TransferredTo: current.TransferredTo?.Id,\r\n    WorkflowBooking: current.WorkflowBooking || null,\r\n    RecurringUpdateOption: settings?.RecurringUpdateOption || 1,\r\n    AllStartTimes: [],\r\n    BudgetIds: [],\r\n    OfflineServices: offlineServices.map(f => {\r\n      return {\r\n        OfflineServiceTypeId: f.ServiceTypeID,\r\n        ServiceTypeName: f.ServiceType,\r\n        UnitsName: f.Units,\r\n        Factor: f.DiscountFactor,\r\n        Quantity: f.Quantity,\r\n        Remarks: f.Remarks,\r\n        InventoryBatchId: f.InventoryBatchId,\r\n        BudgetId: f.BudgetID,\r\n        BudgetExperimentId: f.BudgetExperimentId,\r\n        UserGroup: f.UserGroup,\r\n      } as OfflineservicesModel;\r\n    }),\r\n    TransferInProgress: settings?.TransferInProgress,\r\n    WaitingTransferApproval: current.WaitingTransferApproval,\r\n    InsertedAt: settings?.Entered,\r\n    InsertedBy: settings?.RecordDate,\r\n    UpdatedAt: new Date(),\r\n    UpdatedBy: user?.Id,\r\n    CancelledAt: settings?.Cancelled,\r\n    CustomFormValues: current.FormValues.map(f => {\r\n      return {\r\n        FieldId: f.FormFieldId,\r\n        Value: f.Value,\r\n        DisplayValue: f.DisplayValue,\r\n      } as CustomFormValueModel;\r\n    }),\r\n    Parts: [],\r\n    TutorName: settings?.TutorName,\r\n    Terminated: terminate ?? false,\r\n    TotalCost: settings?.TotalCost ?? 0,\r\n    SavedForLater: settings?.SaveForLater,\r\n  } as ReservationUpdateModel;\r\n  return entity;\r\n}\r\n","import { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n  ReservationGlobalState,\r\n  ReservationEquipment,\r\n  ReservationStatus,\r\n  RecurringReservationUpdateOptions,\r\n  ReservationBudgetModel,\r\n  CustomFormValueModel,\r\n  OfflineservicesModel,\r\n  ReservationRepeatModel,\r\n  ReservationInsertModel,\r\n} from './types';\r\n\r\nexport function ConvertModelToInsertEntity(\r\n  state: ReservationGlobalState,\r\n  user: AuthenticatedUser | undefined,\r\n) {\r\n  const entity = {\r\n    Id: state.details.Id,\r\n    Services: state.details.EquipmentsData.map(item => {\r\n      return {\r\n        EquipmentId: item.Id,\r\n        EquipmentName: item.Name,\r\n        AccServiceIds:\r\n          state.details.AccServices.length > 0\r\n            ? state.details.AccServices.filter(\r\n                a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n              ).map(a => a.Id)\r\n            : [],\r\n        AssemblyId: null,\r\n        ReservationId: state.details.Id,\r\n      } as ReservationEquipment;\r\n    }),\r\n    StartTime: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(\r\n        state.details.TrainingSession !== null\r\n          ? (state.details.TrainingSession as ITrainingSessionDto).StartDate ??\r\n              state.details.StartTime\r\n          : state.details.StartTime,\r\n      ),\r\n    ),\r\n    EndTime: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(\r\n        state.details.TrainingSession !== null\r\n          ? (state.details.TrainingSession as ITrainingSessionDto).EndDate ??\r\n              state.details.EndTime\r\n          : state.details.EndTime,\r\n      ),\r\n    ),\r\n    Remarks: state.details.Remarks || null,\r\n    SampleRunId: state.details.SampleRunId,\r\n    BudgetId: state.details.Budget?.Id,\r\n    BudgetExperimentId: state.details.BudgetExperiment?.Id,\r\n    Collaborators: state.details.CollaboratedUsers.map(f => f.Id),\r\n    ExternalCustomerId: state.details.ExternalCustomer?.Id,\r\n    FundingTypeId: state.details.FundingType?.Id ?? 0,\r\n    InstituteProjectId: state.details.InstituteProject?.Id,\r\n    Name: state.details.DisplayName,\r\n    PartialAttendance: state.details.PartialAttendance,\r\n    PartialAttendanceStart: state.details.PartialAttendanceStart || null,\r\n    PartialAttendanceEnd: state.details.PartialAttendanceEnd || null,\r\n    Tutoring: state.details.Tutoring,\r\n    FullDayReservation: state.details.FullDayReservation,\r\n    Username: state.details.BookedBy?.Id,\r\n    StaffUser: state.details.StaffUser?.Id,\r\n    UserGroupId: state.details.ADGroup?.Id,\r\n    TrainingSignUp: state.details.TrainingSignUp,\r\n    TrainingSessionId: state.details.TrainingSession?.Id,\r\n    PurchaseOrder: state.details.PurchaseOrder,\r\n    Reference: state.details.Reference,\r\n    Status: (state.details.Status?.Id || 1) as ReservationStatus,\r\n    TransferFromId: state.details.TransferFromId,\r\n    UserRequestedByApproval: state.settings.UserRequestedByApproval,\r\n    TransferredTo: state.details.TransferredTo?.Id,\r\n    WorkflowBooking: state.details.WorkflowBooking || null,\r\n    RecurringUpdateOption: (state.settings.RecurringUpdateOption ||\r\n      1) as RecurringReservationUpdateOptions,\r\n    AllStartTimes: [],\r\n    BudgetIds: state.settings.PartReservations?.map(f => {\r\n      return {\r\n        id: f.BudgetID,\r\n        text: f.BudgetName,\r\n        ReservationId: f.Id,\r\n      } as ReservationBudgetModel;\r\n    }),\r\n    TransferInProgress: false,\r\n    WaitingTransferApproval: state.details.WaitingTransferApproval,\r\n    InsertedAt: dateUtils.formatISO(new Date()),\r\n    InsertedBy: user?.Id,\r\n    UpdatedAt: dateUtils.formatISO(new Date()),\r\n    UpdatedBy: user?.Id,\r\n    CancelledAt: null,\r\n    CustomFormValues: state.details.FormValues.map(f => {\r\n      return {\r\n        FieldId: f.FormFieldId,\r\n        Value: f.Value,\r\n        DisplayValue: f.DisplayValue,\r\n      } as CustomFormValueModel;\r\n    }),\r\n    Parts: [],\r\n    OfflineServices: state.offlineServices.map(f => {\r\n      return {\r\n        OfflineServiceTypeId: f.ServiceTypeID,\r\n        ServiceTypeName: f.ServiceType,\r\n        UnitsName: f.Units,\r\n        Factor: f.DiscountFactor,\r\n        Quantity: f.Quantity,\r\n        Remarks: f.Remarks,\r\n        InventoryBatchId: f.InventoryBatchId,\r\n        BudgetId: f.BudgetID,\r\n        BudgetExperimentId: f.BudgetExperimentId,\r\n        UserGroup: f.UserGroup,\r\n      } as OfflineservicesModel;\r\n    }),\r\n    TutorName: state.settings.TutorName,\r\n    AssignToServiceRequestId: state.settings.AssignToServiceRequestId,\r\n    AssignToServiceRequestRowIds: state.settings.AssignToServiceRequestRowIds,\r\n    AssignToServiceRequestSampleIds:\r\n      state.settings.AssignToServiceRequestSampleIds,\r\n    Repeat:\r\n      state?.RepetitiveOptions?.RecurringEvents?.Id &&\r\n      state?.RepetitiveOptions?.RecurringEvents?.Id !==\r\n        (RepetitiveOptions.DoNotRepeat as number)\r\n        ? ({\r\n            RepeatsEveryType: state.RepetitiveOptions?.RepeatsEveryPeriod?.Id,\r\n            RepeatsEveryNum: state.RepetitiveOptions?.RepeatsEveryDay?.Id,\r\n            RepeatEndTime: dateUtils.formatISO(\r\n              dateUtils.dateOrStringToDate(\r\n                state.RepetitiveOptions?.RecurringEndDate ??\r\n                  dateUtils.addDays(new Date(), 7),\r\n              ),\r\n            ),\r\n            RepeatOption: state.RepetitiveOptions?.RecurringEvents?.Id || 0,\r\n            Repeat_Period: state.settings.Repeat_Period,\r\n            RepeatsBy: state.RepetitiveOptions?.RepeatsMonthlyBy?.Id,\r\n            RepeatsOn: state.RepetitiveOptions?.RepeatsOnDays.filter(\r\n              d => d.checked === true,\r\n            ).map(f => f.Id),\r\n          } as ReservationRepeatModel)\r\n        : null,\r\n    Terminated: false,\r\n    TotalCost: state.settings.TotalCost ?? 0,\r\n    SavedForLater: state.settings.SaveForLater,\r\n  } as ReservationInsertModel;\r\n  if ((state.settings.MandatoriesEquipments?.length ?? 0) > 0) {\r\n    entity.Services = [\r\n      ...entity.Services,\r\n      ...state.settings.MandatoriesEquipments.map(item => {\r\n        return {\r\n          EquipmentId: item.Id,\r\n          EquipmentName: item.Name,\r\n          AccServiceIds:\r\n            state.details.AccServices.length > 0\r\n              ? state.details.AccServices.filter(\r\n                  a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n                ).map(a => a.Id)\r\n              : [],\r\n        } as ReservationEquipment;\r\n      }),\r\n    ];\r\n  }\r\n  if ((state.details.OptionalsEquipments?.length ?? 0) > 0) {\r\n    if (state.details.OptionalsEquipments.some(f => f.checked === true)) {\r\n      entity.Services = [\r\n        ...entity.Services,\r\n        ...state.details.OptionalsEquipments.filter(\r\n          f => f.checked === true,\r\n        ).map(item => {\r\n          return {\r\n            EquipmentId: item.Id,\r\n            EquipmentName: item.Name,\r\n            AccServiceIds:\r\n              state.details.AccServices.length > 0\r\n                ? state.details.AccServices.filter(\r\n                    a => (a as IEquipmentAccServiceDto).EquipmentId === item.Id,\r\n                  ).map(a => a.Id)\r\n                : [],\r\n          } as ReservationEquipment;\r\n        }),\r\n      ];\r\n    }\r\n  }\r\n  return entity;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  fork,\r\n  call,\r\n  put,\r\n  select,\r\n  takeLatest,\r\n  takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { reservationActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { ReservationsApi as api } from 'api/ReservationsApi';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  EquipmentsChangeStateParameters,\r\n  IMandatoryEquipmentsDto,\r\n  IReservationDto,\r\n  IReservationEquipmentDto,\r\n  ReservationDetailsResponseModel,\r\n  ReservationDetailsState,\r\n  ReservationEquipmentsChangeResult,\r\n  ReservationGlobalState,\r\n  ReservationInsertModel,\r\n  ReservationQueryStringParameters,\r\n  ReservationSettingsState,\r\n  ReservationUpdateModel,\r\n  ServiceSettingsState,\r\n  TransferToReservation,\r\n  UserTrainingReservationData,\r\n} from './types';\r\nimport { mapSettingsFromServices } from './mapSettingsFromServices';\r\nimport { ConvertModelToUpdateEntity } from './ConvertModelToUpdateEntity';\r\nimport { ConvertModelToInsertEntity } from './ConvertModelToInsertEntity';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectGlobalSettingBool,\r\n  selectOffsetDate,\r\n} from 'app/slice/selectors';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport { ReservationDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { FileTypes } from 'api/odata/generated/enums/FileTypes';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FileStoreApi } from 'api/fileStoreApi';\r\nimport { getFilesModel, UpdateFilesModel } from 'utils/fileStoreHelper';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { Entity } from 'types/common';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport {\r\n  selectCloneReservations,\r\n  selectReservationDtoState,\r\n} from './selectors';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { OtherServicesApi } from 'api/OtherServicesApi';\r\nimport { ConsumableServicesResponse } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { tryParseBool, tryParseInt } from 'utils/string-utils';\r\nimport { repetitiveActions } from 'app/components/Forms/FormRepetitive/slice';\r\nimport { newDate } from '../components/utils';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nfunction* doInitReservation(\r\n  action: PayloadAction<{\r\n    query: ReservationQueryStringParameters;\r\n    globalSettings: GlobalSettingsType;\r\n    prevState?: ReservationDetailsState;\r\n  }>,\r\n) {\r\n  try {\r\n    const user: AuthenticatedUser | undefined = yield select(\r\n      selectAuthenticatedUser,\r\n    );\r\n    if (action.payload.query.id !== undefined) {\r\n      yield* doInitReservationEdit({\r\n        type: action.type,\r\n        payload: {\r\n          id: parseInt(action.payload.query.id),\r\n          globalSettings: action.payload.globalSettings,\r\n          UpdateToNow: tryParseBool(action.payload.query.UpdateToNow) ?? false,\r\n        },\r\n      });\r\n      return;\r\n    }\r\n\r\n    const result = yield call(api.initReservation, action.payload.query);\r\n    console.debug('reseration result: ', result);\r\n    let isChange = action.payload.query.resourceChanged === 'true';\r\n    let response = result as ReservationDetailsResponseModel;\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.SuccessMessages.map(item => {\r\n            return {\r\n              key: 'initReservationSucc',\r\n              message: item,\r\n              variant: 'success',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    let equipments =\r\n      response.model.EquipmentsData.length > 0\r\n        ? response.model.EquipmentsData\r\n        : !!response.model.BaseEquipment\r\n        ? [response.model.BaseEquipment]\r\n        : [];\r\n    if (equipments.length > 0) {\r\n      yield put(\r\n        actions.extendEquipmentSettingsState({\r\n          equipments: equipments,\r\n          mandatories: response.model.MandatoriesEquipments,\r\n          accServices: response.model.AccServices,\r\n          globalSettings: action.payload.globalSettings,\r\n          settings: {} as ServiceSettingsState,\r\n        }),\r\n      );\r\n    }\r\n    if (!isChange) {\r\n      if (action.payload.query.Start !== undefined) {\r\n        response.model.StartTime = dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(action.payload.query.Start),\r\n          {\r\n            format: 'basic',\r\n            representation: 'complete',\r\n          },\r\n        );\r\n        //  dateUtils.formatQueryStringDate(\r\n        //   dateUtils.parseISO(action.payload.query.Start),\r\n        // );\r\n      }\r\n      if (action.payload.query.End !== undefined) {\r\n        response.model.EndTime = dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(action.payload.query.End),\r\n          {\r\n            format: 'basic',\r\n            representation: 'complete',\r\n          },\r\n        );\r\n        //  dateUtils.formatQueryStringDate(\r\n        //   dateUtils.parseISO(action.payload.query.End),\r\n        // );\r\n      }\r\n      // copy query options to the model\r\n      if (action.payload.query.id === undefined) {\r\n        // set reservation's sample run id to requested value so that it will be later sent to the server during reservation insert\r\n        const sampleRunId = tryParseInt(action.payload.query.sampleRunId);\r\n        if (sampleRunId !== undefined) {\r\n          response.model.SampleRunId = sampleRunId;\r\n        }\r\n      }\r\n    }\r\n\r\n    yield put(\r\n      actions.initReservation_Success({\r\n        hasErrors: response.ErrorMessages.length > 0,\r\n        model: response.model,\r\n        isChanged: isChange,\r\n        isEdit: response.model.Id > 0,\r\n        globalSettings: action.payload.globalSettings,\r\n        userTrainigData: response.userTrainingsApprovalData,\r\n      }),\r\n    );\r\n    if (equipments.length > 0 && !(response.model.Id > 0)) {\r\n      let allEquipments = [\r\n        ...response.model.EquipmentsData,\r\n        ...((response.model.MandatoriesEquipments as Entity<\r\n          number\r\n        >[]) as IReservationEquipmentDto[]),\r\n      ];\r\n      const parameters: EquipmentsChangeStateParameters = {\r\n        AccServices:\r\n          response.model.AccServices.length > 0\r\n            ? response.model.AccServices.map(f => f.Id)\r\n            : [],\r\n        Equipments: allEquipments.map(f => f.Id),\r\n        ReservationId: (response.model.Id ?? 0) > 0 ? response.model.Id : null,\r\n        Start:\r\n          // preserve requested start time\r\n          dateUtils.tryFormatIso(action.payload.query.Start) ??\r\n          // use the server value if time was not requested\r\n          dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(response.model.StartTime),\r\n            { representation: 'complete' },\r\n          ),\r\n        End:\r\n          // preserve requested end time\r\n          dateUtils.tryFormatIso(action.payload.query.End) ??\r\n          // use the server value if time was not requested\r\n          dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(response.model.EndTime),\r\n            { representation: 'complete' },\r\n          ),\r\n        BookedBy: response.model.BookedBy?.Id || user?.Id || null,\r\n        Status: response.model.StatusId,\r\n        TrainingSignUp: response.model.TrainingSignUp,\r\n        Tutoring: response.model.Tutoring,\r\n        ADGroup:\r\n          response.model.ADGroup?.Id || user?.ActiveUserGroup?.Id || null,\r\n        FundingTypeId: response.model.FundingTypeId || 0,\r\n        CheckStatus: false,\r\n        TrainingSessionId: response.model.TrainingSession?.Id || null,\r\n        Remarks: response.model.Remarks || null,\r\n        BudgetId:\r\n          response.model.Budget?.Id ||\r\n          (isChange &&\r\n            !!action.payload.prevState &&\r\n            !!action.payload.prevState.Budget)\r\n            ? action.payload?.prevState?.Budget?.Id ?? null\r\n            : action.payload.query.bid ?? null,\r\n        CheckSession: false,\r\n        FullDayReservation: response.model.FullDayReservation,\r\n      } as EquipmentsChangeStateParameters;\r\n      yield put(\r\n        actions.initValidationData({\r\n          parameters: parameters,\r\n          warnings: response.WarningMessages,\r\n          errors: response.ErrorMessages,\r\n        }),\r\n      );\r\n    }\r\n  } catch (error: unknown) {\r\n    yield put(actions.initReservation_Error(error));\r\n  }\r\n}\r\nfunction* doInitReservationEdit(\r\n  action: PayloadAction<{\r\n    id: number;\r\n    globalSettings: GlobalSettingsType;\r\n    UpdateToNow: boolean;\r\n  }>,\r\n) {\r\n  try {\r\n    var s: AppSettings = yield select(selectAppSettings);\r\n\r\n    const AllowWorkflowBooking = yield select(state =>\r\n      selectGlobalSettingBool(state, AllowedSettings.AllowWorkflowBooking),\r\n    );\r\n    const expand: Array<string | boolean> = [\r\n      action.payload.globalSettings.budgetModuleEnabled && 'Budget',\r\n      action.payload.globalSettings.trainingSessionEnabled && 'TrainingSession',\r\n      'StaffUser',\r\n      'BookedBy',\r\n      'ADGroup',\r\n      action.payload.globalSettings.instituteProjectsEnabled &&\r\n        'InstituteProject',\r\n      // 'WorkflowBooking',\r\n      //ExternalCustomer\r\n      action.payload.globalSettings.budgetExperimentModuleEnabled &&\r\n        'BudgetExperiment',\r\n      'TransferredTo',\r\n      !action.payload.globalSettings.hideReservationCollaborators &&\r\n        'CollaboratedUsers',\r\n      s.Modules.includes(KnownModules.SamplesAutomation) && 'SampleIds',\r\n      'LastUpdateAdmin',\r\n      'FormValues',\r\n      action.payload.globalSettings.accServicesEnabled && 'AccServices',\r\n      //'BaseEquipment',\r\n      `EquipmentsData($expand=${[\r\n        action.payload.globalSettings.accServicesEnabled && 'AccServices',\r\n        'OfflineServices',\r\n        'CustomForms',\r\n        'StaffUserSelection',\r\n      ]\r\n        .filter(f => typeof f === 'string')\r\n        .join(',')})`,\r\n      AllowWorkflowBooking && 'WorkflowBooking',\r\n    ];\r\n    const result: IReservationDto = yield call(\r\n      api.getReservation,\r\n      action.payload.id,\r\n      {\r\n        $expand: expand.filter(f => typeof f === 'string').join(','),\r\n      },\r\n    );\r\n    console.debug('reseration result: ', result);\r\n\r\n    result.TerminateReservation = action.payload.UpdateToNow;\r\n    if (result.TerminateReservation) {\r\n      result.EndTime = dateUtils.formatISO(newDate(null));\r\n    }\r\n\r\n    result.OfflineMandatory = [];\r\n\r\n    yield put(\r\n      actions.initReservation_Success({\r\n        hasErrors: false,\r\n        model: result,\r\n        isChanged: false,\r\n        isEdit: true,\r\n        globalSettings: action.payload.globalSettings,\r\n        userTrainigData: null,\r\n      }),\r\n    );\r\n\r\n    const equipments: IReservationEquipmentDto[] =\r\n      result.EquipmentsData.length > 0\r\n        ? result.EquipmentsData\r\n        : !!result.BaseEquipment\r\n        ? [result.BaseEquipment]\r\n        : [];\r\n    if (equipments.length > 0) {\r\n      yield put(\r\n        actions.extendEquipmentSettingsState({\r\n          equipments: equipments,\r\n          mandatories: result.MandatoriesEquipments ?? [],\r\n          accServices: result.AccServices ?? [],\r\n          globalSettings: action.payload.globalSettings,\r\n          settings: {} as ServiceSettingsState,\r\n        }),\r\n      );\r\n    }\r\n\r\n    // if (\r\n    //   action.payload.globalSettings.accServicesEnabled &&\r\n    //   (result.AccServiceId !== null ||\r\n    //     !isEmptyOrWhitespace(result.AccServiceId))\r\n    // ) {\r\n    //   try {\r\n    //     var AccServices: Array<IEquipmentAccServiceDto> = yield call(\r\n    //       getReservationProperty,\r\n    //       result.Id,\r\n    //       'AccServices',\r\n    //     );\r\n    //     if (AccServices.length > 0) {\r\n    //       yield put(\r\n    //         actions.setAnyValue({\r\n    //           fieldKey: 'AccServices',\r\n    //           fieldValue: AccServices,\r\n    //         }),\r\n    //       );\r\n    //       yield put(\r\n    //         actions.extendEquipmentSettingsState({\r\n    //           equipments: equipments,\r\n    //           mandatories: result.MandatoriesEquipments ?? [],\r\n    //           accServices: result.AccServices ?? [],\r\n    //           globalSettings: action.payload.globalSettings,\r\n    //           settings: {} as ServiceSettingsState,\r\n    //         }),\r\n    //       );\r\n    //     }\r\n    //   } catch (error) {\r\n    //     console.error(error);\r\n    //   }\r\n    // }\r\n    try {\r\n      if (result.BookedBy !== null) {\r\n        const userTrainingEquipments = yield call(\r\n          api.getReservationUserTrainingEquipments,\r\n          result.Id,\r\n        );\r\n        const trainingsData: UserTrainingReservationData = {\r\n          StartTime: result.StartTime,\r\n          EndTime: result.EndTime,\r\n          FatherId: result.FatherId,\r\n          ReservationId: result.Id,\r\n          Tutoring: result.Tutoring,\r\n          UserName: result.BookedBy.Id,\r\n          Equipments: userTrainingEquipments.value,\r\n        };\r\n        yield put(actions.setTrainingsData(trainingsData));\r\n      }\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n\r\n    if (s.Modules.includes(KnownModules.OfflineServices)) {\r\n      yield fork(doInitReservationEdit_Load_OfflineMandatory, result);\r\n    }\r\n  } catch (error: unknown) {\r\n    console.error(error);\r\n    if ((error as AxiosError)?.response?.status === 404) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'reservationInit',\r\n          message: 'Reservation Not Found',\r\n          variant: 'error',\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.initReservation_Error(error));\r\n  }\r\n\r\n  function* doInitReservationEdit_Load_OfflineMandatory(\r\n    result: IReservationDto,\r\n  ) {\r\n    try {\r\n      var OfflineMandatory = yield call(\r\n        getReservationProperty,\r\n        result.Id,\r\n        'OfflineMandatory',\r\n      );\r\n      yield put(\r\n        actions.extendReservationSettings({\r\n          OfflineMandatory: OfflineMandatory,\r\n        }),\r\n      );\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n  }\r\n}\r\n\r\nfunction* getReservationProperty(\r\n  result: number,\r\n  fieldName: keyof IReservationDto,\r\n) {\r\n  return yield call(\r\n    httpClient.get,\r\n    `/api/odata/v4/reservations/${result}/${fieldName}`,\r\n  );\r\n}\r\n\r\nfunction* doCreate(\r\n  action: PayloadAction<{\r\n    state: ReservationGlobalState;\r\n    calcCredit?: boolean;\r\n  }>,\r\n) {\r\n  const user: AuthenticatedUser | undefined = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const newDate = yield select(state => selectOffsetDate(state, new Date()));\r\n  const isCloned = yield select(selectCloneReservations);\r\n  const httpPayloads: ReservationInsertModel = ConvertModelToInsertEntity(\r\n    action.payload.state,\r\n    user,\r\n  );\r\n  if (action.payload.calcCredit === true) {\r\n    httpPayloads.Remarks = 'CalculateCredit';\r\n  }\r\n  const customFormFiles = action.payload.state.customFormFiles;\r\n  try {\r\n    const result = yield call(api.insertReservation, httpPayloads);\r\n    let response = result as ReservationDetailsResponseModel;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length === 0 && !action.payload.calcCredit) {\r\n      if (customFormFiles.length > 0) {\r\n        let data = getFilesModel(\r\n          [],\r\n          customFormFiles,\r\n          FileTypes.ReservationFile,\r\n          response.Id || -1,\r\n          CustomFormTypeEnum.Reservation,\r\n          httpPayloads.RecurringUpdateOption,\r\n          null,\r\n          null,\r\n          null,\r\n        );\r\n        const fileRes = yield call(FileStoreApi.saveFormFiles, data);\r\n        let fileResponse = fileRes as IResponseType;\r\n        if (fileResponse.ErrorMessages.length > 0) {\r\n          responseErrors = [...responseErrors, ...fileResponse.ErrorMessages];\r\n        }\r\n      }\r\n    }\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors\r\n            .filter((value, index, self) => self.indexOf(value) === index)\r\n            .map(item => {\r\n              return {\r\n                key: 'reservationInsertError',\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n        ),\r\n      );\r\n      if (isCloned) {\r\n        yield put(actions.setCloneReservation(false));\r\n      }\r\n      if (action.payload.calcCredit) {\r\n        yield put(actions.getCredit_Success({ credit: 0, balance: null }));\r\n      }\r\n    } else {\r\n      if (action.payload.calcCredit) {\r\n        yield put(\r\n          actions.getCredit_Success({\r\n            credit: response.credit ?? 0,\r\n            balance: response.balance,\r\n          }),\r\n        );\r\n      } else {\r\n        if (responseSuccess.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              message: responseSuccess[0],\r\n              variant: 'success',\r\n            }),\r\n          );\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              key: 'reservationInsertSuccess',\r\n              message: responseSuccess[0],\r\n              messageType: SnackBarMessageType.openSidepanelDetails,\r\n              messageTypeProps: {\r\n                Id: response.Id ?? undefined,\r\n                created: true,\r\n                itemName: i18next.t(translations.ReservationDetails),\r\n                detailsType: RenderPageType.ReservationDetails,\r\n                detailsTypeProps: {\r\n                  useSidePanel: true,\r\n                  queryParams: {\r\n                    id: '' + response.Id ?? -1,\r\n                  },\r\n                } as ReservationDetailsProps,\r\n              },\r\n              variant: 'success',\r\n            }),\r\n          );\r\n        }\r\n        if (responseWarnings.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotifications(\r\n              responseWarnings.map(item => {\r\n                return {\r\n                  key: 'reservationInsertWarning',\r\n                  message: item,\r\n                  variant: 'warning',\r\n                };\r\n              }),\r\n            ),\r\n          );\r\n        }\r\n        if (response.warnOnTrainingSession) {\r\n          let linkUrl = `/trainingsessions?eqid=${response.FirstEquipmentId}&nextonly=true`;\r\n          let linkText = i18next.t(translations.ClickHere) as string;\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              key: 'warnOnTrainingSession',\r\n              persist: true,\r\n              message: '',\r\n              messageType: SnackBarMessageType.showLinkMessage,\r\n              messageTypeProps: {\r\n                Id: 0,\r\n                created: true,\r\n                itemName: i18next.t(translations.UpcomingTrainingSessions),\r\n                linkUrl: linkUrl,\r\n                linkText: linkText,\r\n                afterLinkText: i18next.t(\r\n                  translations.res_futureTrainingSession_LinkTitle,\r\n                ),\r\n                detailsType: undefined,\r\n                detailsTypeProps: undefined,\r\n              },\r\n              variant: 'warning',\r\n            }),\r\n          );\r\n        }\r\n        yield put(\r\n          repetitiveActions.resetState(\r\n            dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate)),\r\n          ),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n    if (!action.payload.calcCredit) {\r\n      let hasErrors = responseErrors.length > 0;\r\n      if (!isCloned) {\r\n        yield put(layoutActions.setNotSavedChanges(false));\r\n      }\r\n\r\n      yield put(\r\n        actions.createReservation_Success({\r\n          hasErrors: hasErrors,\r\n          reservationIds: response.ReservationIds,\r\n          insertModel: response.insertedModel,\r\n        }),\r\n      );\r\n    }\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'reservationInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createReservation_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: ReservationDetailsState;\r\n    original: ReservationDetailsState;\r\n    currentCustomFormFiles: IFormFileValue[];\r\n    originalCustomFormFiles: IFormFileValue[];\r\n    offlineServices: IOtherServices[];\r\n    settings: ReservationSettingsState | undefined;\r\n    terminate?: boolean;\r\n  }>,\r\n) {\r\n  const user: AuthenticatedUser | undefined = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const isCloned = yield select(selectCloneReservations);\r\n  const reservationDto = yield select(selectReservationDtoState);\r\n  const reccurentUpdateOption =\r\n    action.payload.settings?.RecurringUpdateOption || 1;\r\n  const httpPayloads: ReservationUpdateModel = ConvertModelToUpdateEntity(\r\n    action.payload.original,\r\n    action.payload.current,\r\n    action.payload.settings,\r\n    action.payload.offlineServices,\r\n    user,\r\n    action.payload.terminate,\r\n  );\r\n  let filesData: UpdateFilesModel[] = [];\r\n  if (\r\n    action.payload.originalCustomFormFiles.length > 0 ||\r\n    action.payload.currentCustomFormFiles.length > 0\r\n  ) {\r\n    filesData = getFilesModel(\r\n      action.payload.originalCustomFormFiles,\r\n      action.payload.currentCustomFormFiles,\r\n      FileTypes.ReservationFile,\r\n      action.payload.current.Id,\r\n      CustomFormTypeEnum.Reservation,\r\n      reccurentUpdateOption,\r\n      null,\r\n      null,\r\n      null,\r\n    );\r\n  }\r\n  try {\r\n    const results = yield call(api.updateReservation, httpPayloads);\r\n    let response = results as ReservationDetailsResponseModel;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length === 0) {\r\n      if (filesData.length > 0) {\r\n        let fileRes = yield call(FileStoreApi.updateFormFiles, filesData);\r\n        let fileResponses = fileRes as IResponseType;\r\n        if (fileResponses.ErrorMessages.length > 0) {\r\n          respErrors = [...respErrors, ...fileResponses.ErrorMessages];\r\n        }\r\n      }\r\n    }\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'reservationUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n      if (isCloned) {\r\n        yield put(actions.setCloneReservation(false));\r\n      }\r\n      if (action.payload.terminate) {\r\n        yield put(actions.terminateReservation_error());\r\n      }\r\n    } else {\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'reservationUpdateSuccess',\r\n            message:\r\n              action.payload.terminate === true\r\n                ? i18next.t(translations.Succes_ReservationTerminated)\r\n                : response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: false,\r\n              itemName: i18next.t(translations.ReservationDetails),\r\n              detailsType: RenderPageType.ReservationDetails,\r\n              itemEndName: action.payload.terminate\r\n                ? ' end time updated'\r\n                : undefined,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id,\r\n                },\r\n              } as ReservationDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        if (action.payload.terminate === true) {\r\n          yield call(api.sendTerminateNotification, response.ReservationIds);\r\n          yield put(actions.terminateReservation_success());\r\n        }\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: 'reservationUpdateWarn',\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.userTrainingsApprovalData === null) {\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n      if (\r\n        action.payload.offlineServices.length > 0 &&\r\n        action.payload.offlineServices.some(f => f.Id < 1)\r\n      ) {\r\n        const offRes = yield call(\r\n          OtherServicesApi.insertConsumableServices,\r\n          action.payload.offlineServices.filter(f => f.Id < 1),\r\n        );\r\n        let offResponse = offRes as ConsumableServicesResponse;\r\n        let offErrors = offResponse.ErrorMessages;\r\n        let offWarnings = offResponse.WarningMessages;\r\n        if (offErrors.length > 0) {\r\n          yield put(\r\n            appSettingsActions.addNotifications(\r\n              offErrors.map(item => {\r\n                return {\r\n                  key: 'serviceInsertError',\r\n                  message: item,\r\n                  variant: 'error',\r\n                };\r\n              }),\r\n            ),\r\n          );\r\n        } else {\r\n          if (offWarnings.length > 0) {\r\n            yield put(\r\n              appSettingsActions.addNotifications(\r\n                offWarnings.map(item => {\r\n                  return {\r\n                    key: 'serviceInsertWarning',\r\n                    message: item,\r\n                    variant: 'warning',\r\n                  };\r\n                }),\r\n              ),\r\n            );\r\n          }\r\n        }\r\n      }\r\n      yield put(layoutActions.setNotSavedChanges(false));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n\r\n    if (isCloned) {\r\n      yield put(\r\n        actions.initClonedReservation_Success({\r\n          model: reservationDto,\r\n          reservation: action.payload.current,\r\n          settings: action.payload.settings,\r\n        }),\r\n      );\r\n    }\r\n    yield put(\r\n      actions.updateReservation_Success({\r\n        hasErrors: hasErrors,\r\n        userTrainigData: response.userTrainingsApprovalData,\r\n        insertModel: response.insertedModel,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'reservationUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateReservation_Error(Error));\r\n    if (action.payload.terminate) {\r\n      yield put(actions.terminateReservation_error());\r\n    }\r\n  }\r\n}\r\nfunction* doUpdateSettigs(action: PayloadAction<any>) {\r\n  yield put(actions.updateReservationSettings(action.payload));\r\n}\r\nfunction* doUpdateEquipmentSettigs(\r\n  action: PayloadAction<{\r\n    equipments: IReservationEquipmentDto[];\r\n    mandatories: IMandatoryEquipmentsDto[];\r\n    accServices: IEquipmentAccServiceDto[];\r\n    globalSettings: GlobalSettingsType;\r\n    settings?: ServiceSettingsState;\r\n  }>,\r\n) {\r\n  try {\r\n    let allEquipments = [\r\n      ...action.payload.equipments,\r\n      ...((action.payload.mandatories as Entity<\r\n        number\r\n      >[]) as IReservationEquipmentDto[]),\r\n    ];\r\n    const authenticatedUser = yield select(selectAuthenticatedUser);\r\n    let newSettings = mapSettingsFromServices(\r\n      allEquipments,\r\n      action.payload.accServices,\r\n      action.payload.globalSettings,\r\n      authenticatedUser,\r\n      action.payload.settings,\r\n    );\r\n    yield put(actions.updateEquipmentSettingsState(newSettings));\r\n  } catch (error) {\r\n    console.log(error);\r\n  }\r\n}\r\nfunction* doLoadValidationData(\r\n  action: PayloadAction<{\r\n    parameters: EquipmentsChangeStateParameters;\r\n    warnings: string[];\r\n    errors: string[];\r\n  }>,\r\n) {\r\n  try {\r\n    let res = yield call(\r\n      api.getEquipmentsChangeState,\r\n      action.payload.parameters,\r\n    );\r\n    let response = res as ReservationEquipmentsChangeResult;\r\n    if (!!response?.CustomForms) {\r\n      if (response?.CustomForms?.IsValid) {\r\n        yield put(\r\n          actions.extendReservationSettings({\r\n            CustomForms: response.CustomForms.CustomForms || [],\r\n          }),\r\n        );\r\n      }\r\n    }\r\n    if (!!response.StatusChange && response.StatusChange !== null) {\r\n      yield put(\r\n        actions.extendReservationSettings({\r\n          IsForceTutoring: response.StatusChange.IsForceTutoring,\r\n        }),\r\n      );\r\n    }\r\n    response.WarningMessages = [\r\n      ...response.WarningMessages,\r\n      ...action.payload.warnings,\r\n    ];\r\n    response.ErrorMessages = [\r\n      ...response.ErrorMessages,\r\n      ...action.payload.errors,\r\n    ];\r\n    yield put(actions.initValidationData_Success(response));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initValidationData_Error());\r\n  }\r\n}\r\nfunction* doSetStart(action: PayloadAction<Date | string>) {\r\n  yield put(\r\n    actions.setStartSuccess(\r\n      dateUtils.formatISO(dateUtils.dateOrStringToDate(action.payload), {\r\n        format: 'basic',\r\n        representation: 'complete',\r\n      }),\r\n      //dateUtils.formatQueryStringDate(dateUtils.parseISO(action.payload)),\r\n    ),\r\n  );\r\n}\r\nfunction* doSetEnd(action: PayloadAction<Date | string>) {\r\n  yield put(\r\n    actions.setEndSuccess(\r\n      dateUtils.formatISO(dateUtils.dateOrStringToDate(action.payload), {\r\n        format: 'basic',\r\n        representation: 'complete',\r\n      }),\r\n      //dateUtils.formatQueryStringDate(dateUtils.parseISO(action.payload)),\r\n    ),\r\n  );\r\n}\r\nfunction* doSetAny(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof ReservationDetailsState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setAnyValueSuccess(action.payload));\r\n}\r\nfunction* doTransferReservation(action: PayloadAction<TransferToReservation>) {\r\n  try {\r\n    let res = yield call(api.transferReservation, action.payload);\r\n    let response = res as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'transferError',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n      yield put(actions.transferReservation_Error(response.ErrorMessages[0]));\r\n    } else {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'transferSuccess',\r\n          message: response.SuccessMessages[0],\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield* doSetAny({\r\n        payload: {\r\n          fieldKey: 'WaitingTransferApproval',\r\n          fieldValue: true,\r\n        },\r\n        type: action.type,\r\n      });\r\n      yield* doSetAny({\r\n        payload: {\r\n          fieldKey: 'TransferredTo',\r\n          fieldValue: action.payload.User,\r\n        },\r\n        type: action.type,\r\n      });\r\n      yield put(layoutActions.setNotSavedChanges(false));\r\n      yield put(actions.transferReservation_Success(action.payload));\r\n      yield call(api.sendTransferNotification, action.payload);\r\n    }\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'transferError',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.transferReservation_Error(Error));\r\n  }\r\n}\r\nfunction* doCancelTransferReservation(\r\n  action: PayloadAction<TransferToReservation>,\r\n) {\r\n  try {\r\n    let res = yield call(\r\n      api.cancelTransferReservation,\r\n      action.payload.ReservtionId,\r\n    );\r\n    let response = res as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'transferError',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n      yield put(actions.cancelTransfer_Error(response.ErrorMessages[0]));\r\n    } else {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'transferSuccess',\r\n          message: response.SuccessMessages[0],\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield* doSetAny({\r\n        payload: {\r\n          fieldKey: 'WaitingTransferApproval',\r\n          fieldValue: false,\r\n        },\r\n        type: action.type,\r\n      });\r\n      yield* doSetAny({\r\n        payload: {\r\n          fieldKey: 'TransferredTo',\r\n          fieldValue: null,\r\n        },\r\n        type: action.type,\r\n      });\r\n      yield put(layoutActions.setNotSavedChanges(false));\r\n      yield put(actions.cancelTransfer_Success());\r\n      yield call(api.sendCancelTransferNotification, action.payload);\r\n    }\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'transferError',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.cancelTransfer_Error(Error));\r\n  }\r\n}\r\nfunction* doTerminateReservation(\r\n  action: PayloadAction<{\r\n    current: ReservationDetailsState;\r\n    original: ReservationDetailsState;\r\n    currentCustomFormFiles: IFormFileValue[];\r\n    originalCustomFormFiles: IFormFileValue[];\r\n    settings: ReservationSettingsState | undefined;\r\n  }>,\r\n) {\r\n  yield* doUpdate({\r\n    payload: {\r\n      current: action.payload.current,\r\n      original: action.payload.original,\r\n      currentCustomFormFiles: action.payload.currentCustomFormFiles,\r\n      originalCustomFormFiles: action.payload.originalCustomFormFiles,\r\n      offlineServices: [],\r\n      settings: action.payload.settings,\r\n      terminate: true,\r\n    },\r\n    type: action.type,\r\n  });\r\n}\r\nexport function* reservationSaga() {\r\n  yield takeLeading(actions.initReservation.type, doInitReservation);\r\n  yield takeLatest(actions.createReservation.type, doCreate);\r\n  yield takeLatest(actions.updateReservation.type, doUpdate);\r\n  yield takeLatest(actions.extendReservationSettings.type, doUpdateSettigs);\r\n  yield takeLatest(\r\n    actions.extendEquipmentSettingsState.type,\r\n    doUpdateEquipmentSettigs,\r\n  );\r\n  yield takeLatest(actions.initValidationData.type, doLoadValidationData);\r\n  yield takeLatest(actions.setStartDate.type, doSetStart);\r\n  yield takeLatest(actions.setEndDate.type, doSetEnd);\r\n  yield takeLatest(actions.setAnyValue.type, doSetAny);\r\n  yield takeLatest(actions.transferReservation.type, doTransferReservation);\r\n  yield takeLatest(actions.cancelTransfer.type, doCancelTransferReservation);\r\n  yield takeLatest(actions.terminateReservation.type, doTerminateReservation);\r\n}\r\n","import { IReservationEquipmentDto } from './types';\r\n\r\nexport function TryDisableRemoveableEquipments(\r\n  equipments: IReservationEquipmentDto[],\r\n  condition: (item: IReservationEquipmentDto) => boolean,\r\n  title?: string,\r\n): IReservationEquipmentDto[] {\r\n  let disabled = equipments\r\n    .filter(f => condition(f) === true)\r\n    .map(f =>\r\n      Object.assign({}, f, {\r\n        noremoved: true,\r\n        titleInfo: title,\r\n      }),\r\n    );\r\n  let other = equipments.filter(f => condition(f) === false);\r\n  return [...disabled, ...other];\r\n}\r\n","import { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { generateTrainingSessionName } from 'app/components/pickers/AutocompletePickers/TrainingSessionPicker';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { Entity } from 'types/common';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { combineOptionalEquipments } from './mapSettingsFromServices';\r\nimport { TryDisableRemoveableEquipments } from './TryDisableRemoveableEquipments';\r\nimport {\r\n  IReservationDto,\r\n  getSingleReservationStatus,\r\n  ReservationDetailsState,\r\n} from './types';\r\n\r\nexport function ConvertDtoToModel(\r\n  dto: IReservationDto,\r\n  globalSettings?: GlobalSettingsType,\r\n) {\r\n  let equipments =\r\n    dto.EquipmentsData.length > 0\r\n      ? dto.EquipmentsData\r\n      : dto.BaseEquipment === null\r\n      ? []\r\n      : [dto.BaseEquipment];\r\n  if (dto.Id > 0) {\r\n    if (dto.StaffMandatoryEquipment !== null) {\r\n      equipments = TryDisableRemoveableEquipments(\r\n        equipments,\r\n        f => f.Id === dto.StaffMandatoryEquipment?.Id,\r\n        `Mandatory instrument for ${dto.StaffUser?.Name}`,\r\n      );\r\n    }\r\n    if (!globalSettings?.allowToRemoveFromMultipleReservation) {\r\n      equipments = TryDisableRemoveableEquipments(\r\n        equipments,\r\n        f => f.Id > 0,\r\n        `Not removeable service`,\r\n      );\r\n    }\r\n  }\r\n  let model: ReservationDetailsState = {\r\n    Id: dto.Id,\r\n    FatherId: dto.FatherId,\r\n    BookedBy: (dto.BookedBy as Entity<string>) || null,\r\n    AccServices: (dto.AccServices as Entity<number>[]) || [],\r\n    Budget: (dto.Budget as Entity<number>) || null,\r\n    CollaboratedUsers: (dto.CollaboratedUsers as Entity<string>[]) || [],\r\n    EndTime: dto.EndTime,\r\n    EquipmentsData: equipments as Entity<number>[],\r\n    FormValues: dto.FormValues,\r\n    InstituteProject: (dto.InstituteProject as Entity<number>) || null,\r\n    PartialAttendance: dto.PartialAttendance,\r\n    SampleIds: dto.SampleIds,\r\n    StaffUser: (dto.StaffUser as Entity<string>) || null,\r\n    StartTime: dto.StartTime,\r\n    TrainingSession:\r\n      dto.TrainingSession === null\r\n        ? null\r\n        : generateTrainingSessionName(dto.TrainingSession),\r\n    TrainingSignUp: dto.TrainingSignUp,\r\n    TransferredTo: (dto.TransferredTo as Entity<string>) || null,\r\n    WaitingTransferApproval: dto.WaitingTransferApproval,\r\n    TransferFromId: dto.TransferFromId,\r\n    Tutoring: dto.Tutoring,\r\n    FullDayReservation: dto.FullDayReservation,\r\n    ADGroup: (dto.ADGroup as Entity<string>) || null,\r\n    BudgetExperiment: (dto.BudgetExperiment as Entity<number>) || null,\r\n    DisplayName: dto.DisplayName,\r\n    ExternalCustomer: (dto.ExternalCustomer as Entity<number>) || null,\r\n    FundingType: getSingleInvoiceFundingType(dto.FundingTypeId || 0),\r\n    PartialAttendanceEnd: dto.PartialAttendanceEnd,\r\n    PartialAttendanceStart: dto.PartialAttendanceStart,\r\n    PurchaseOrder: dto.PurchaseOrder,\r\n    Reference: dto.Reference,\r\n    Remarks: dto.Remarks,\r\n    SampleRunId: dto.SampleRunId,\r\n    Status: getSingleReservationStatus(dto.StatusId),\r\n    WorkflowBooking: (dto.WorkflowBooking as Entity<number>) || null,\r\n    OptionalsEquipments: (\r\n      combineOptionalEquipments(dto.OptionalsEquipments) ?? []\r\n    ).map(op => {\r\n      if (dto.EquipmentsData.some(f => f.Id === op.Id)) {\r\n        return Object.assign({}, op, { disabled: true, checked: false });\r\n      } else {\r\n        return Object.assign({}, op, { disabled: false, checked: false });\r\n      }\r\n    }) as CheckEntity[],\r\n    AssemblyParts: dto.AssemblyParts,\r\n  };\r\n  return model;\r\n}\r\n","import {\r\n  IReservationDto,\r\n  RecurringReservationUpdateOptions,\r\n  ReservationSettingsState,\r\n} from './types';\r\n\r\nexport function getReservationSettings(dto: IReservationDto) {\r\n  let settings = {\r\n    BaseEquipment: dto.BaseEquipment,\r\n    FatherId: dto.FatherId,\r\n    Repeat_Period: dto.Repeat_Period,\r\n    TrainingSessionOnly: dto.TrainingSessionOnly,\r\n    SessionId: dto.SessionId,\r\n    RecordDate: dto.RecordDate,\r\n    LastUpdateDate: dto.LastUpdateDate,\r\n    Entered: dto.Entered,\r\n    Cancelled: dto.Cancelled,\r\n    LastUpdateAdmin: dto.LastUpdateAdmin,\r\n    RepeatEndTime: dto.RepeatEndTime,\r\n    Repeat: dto.Repeat,\r\n    HasCharges: dto.HasCharges,\r\n    FundingTypeId: dto.FundingTypeId,\r\n    ParentAssemblyReservationId: dto.ParentAssemblyReservationId,\r\n    TopAssemblyReservationId: dto.TopAssemblyReservationId,\r\n    TransferInProgress: dto.TransferInProgress,\r\n    HasOfflineServices: dto.HasOfflineServices,\r\n    HasTrainingSession: dto.HasTrainingSession,\r\n    NextReservationTime: dto.NextReservationTime,\r\n    PartReservations: dto.PartReservations,\r\n    AssignToServiceRequestId: dto.AssignToServiceRequestId,\r\n    AssignToServiceRequestRowIds: dto.AssignToServiceRequestRowIds,\r\n    AssignToServiceRequestSampleIds: dto.AssignToServiceRequestSampleIds,\r\n    TutorName: dto.TutorName,\r\n    UserRequestedByApproval: false,\r\n    RecurringUpdateOption: RecurringReservationUpdateOptions.CurrentReservation,\r\n    CustomForms: dto.CustomForms,\r\n    MandatoriesEquipments: dto.MandatoriesEquipments,\r\n    OptionalsEquipments: dto.OptionalsEquipments,\r\n    TerminateReservation: dto.TerminateReservation,\r\n    FirstInitEquipments: dto.FirstInitEquipments,\r\n    OfflineMandatory: dto.OfflineMandatory,\r\n    IsForceTutoring: dto.IsForceTutoring,\r\n    ForceFullDayReservations: dto.ForceFullDayReservations,\r\n    FutureReservation: dto.IsFuture,\r\n    Ongoing: dto.IsOngoing,\r\n    PastReservation: dto.IsPast,\r\n    StaffMandatoryEquipment: dto.StaffMandatoryEquipment,\r\n  } as ReservationSettingsState;\r\n\r\n  return settings;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { reservationSaga } from './saga';\r\nimport {\r\n  createReservation_Success_Action,\r\n  EquipmentsChangeStateParameters,\r\n  IMandatoryEquipmentsDto,\r\n  IReservationDto,\r\n  IReservationEquipmentDto,\r\n  PricingState,\r\n  ReservationDetailsState,\r\n  ReservationEquipmentsChangeResult,\r\n  ReservationGlobalState,\r\n  ReservationInsertModel,\r\n  ReservationQueryStringParameters,\r\n  ReservationSettingsState,\r\n  ReservationState,\r\n  ServiceSettingsState,\r\n  TransferToReservation,\r\n  UserTrainingReservationData,\r\n} from './types';\r\nimport { ConvertDtoToModel } from './ConvertDtoToModel';\r\nimport { getReservationSettings } from './getReservationSettings';\r\nimport { AxiosError } from 'axios';\r\n\r\nexport const initialState: ReservationState = {\r\n  detailsState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  isEdit: false,\r\n  confirmAssistedReservations: undefined,\r\n  processing: false,\r\n  reservationSettingsState: undefined,\r\n  equipmentsSettingsState: undefined,\r\n  trainingsData: null,\r\n  valueHandler: undefined,\r\n  requestedValueFor: undefined,\r\n  requestedValue: undefined,\r\n  equipmentChangeResultState: undefined,\r\n  isChangeCompleted: undefined,\r\n  transferState: {\r\n    User: null,\r\n    ReservtionId: undefined,\r\n    WaitingTransferApproval: undefined,\r\n    transferProcessing: undefined,\r\n    transferStepCompleted: undefined,\r\n  },\r\n  creditState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n    error: undefined,\r\n  },\r\n  hasCharges: undefined,\r\n  savedOfflineServices: [],\r\n  refeshOfflineService: undefined,\r\n  terminationState: {\r\n    terminatProcessing: undefined,\r\n    terminateCompleted: undefined,\r\n  },\r\n  cloneReservation: undefined,\r\n  reservationDtoState: undefined,\r\n  asyncChangeLoading: undefined,\r\n  submitCredit: undefined,\r\n  refreshWorkOrderLink: undefined,\r\n  notFound: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'reservation',\r\n  initialState,\r\n  reducers: {\r\n    /**\r\n     * Resets reservation details to it's initial state\r\n     * @param state\r\n     * @param action\r\n     */\r\n    reset(state, action: PayloadAction) {\r\n      Object.assign(state, initialState);\r\n    },\r\n    initReservation(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: ReservationQueryStringParameters;\r\n        globalSettings: GlobalSettingsType;\r\n        prevState?: ReservationDetailsState;\r\n      }>,\r\n    ) {\r\n      let isChange = action.payload.query.resourceChanged === 'true';\r\n      state.processing = isChange ? false : true;\r\n      if (isChange) {\r\n        state.detailsState = Object.assign(state.detailsState, {\r\n          processing: true,\r\n          completed: undefined,\r\n          hasErrors: undefined,\r\n        });\r\n        state.isChangeCompleted = false;\r\n      } else {\r\n        state.detailsState = {\r\n          data: undefined,\r\n          processing: undefined,\r\n          completed: undefined,\r\n          hasErrors: undefined,\r\n        };\r\n        state.equipmentsSettingsState = undefined;\r\n      }\r\n      state.confirmAssistedReservations = undefined;\r\n      state.reservationSettingsState = undefined;\r\n      state.trainingsData = null;\r\n    },\r\n    initReservation_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        model: IReservationDto;\r\n        isChanged: boolean;\r\n        isEdit: boolean;\r\n        globalSettings: GlobalSettingsType;\r\n        userTrainigData: UserTrainingReservationData | null;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.detailsState.data = ConvertDtoToModel(\r\n        action.payload.model,\r\n        action.payload.globalSettings,\r\n      );\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.reservationSettingsState = getReservationSettings(\r\n        action.payload.model,\r\n      );\r\n      state.isChangeCompleted =\r\n        action.payload.isChanged === true ? true : undefined;\r\n      state.transferState.WaitingTransferApproval =\r\n        action.payload.model.WaitingTransferApproval;\r\n      state.transferState.ReservtionId = action.payload.model.Id;\r\n      state.transferState.User = action.payload.model.TransferredTo;\r\n      state.reservationDtoState = action.payload.model;\r\n      state.isEdit = action.payload.isEdit;\r\n      state.trainingsData = action.payload.userTrainigData;\r\n      if (action.payload.isEdit) {\r\n        state.savedOfflineServices = [];\r\n      }\r\n    },\r\n    setTrainingsData(\r\n      state,\r\n      action: PayloadAction<UserTrainingReservationData | null>,\r\n    ) {\r\n      state.trainingsData = action.payload;\r\n    },\r\n    initClonedReservation_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        model: IReservationDto;\r\n        reservation: ReservationDetailsState;\r\n        settings?: ReservationSettingsState;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.detailsState.data = ConvertDtoToModel(action.payload.model); //action.payload.reservation;\r\n      state.detailsState.processing = false;\r\n      state.reservationSettingsState = getReservationSettings(\r\n        action.payload.model,\r\n      );\r\n      state.isEdit = false;\r\n      state.refeshOfflineService = true;\r\n    },\r\n    initReservation_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n      state.isChangeCompleted = undefined;\r\n      if ((action.payload as AxiosError)?.response?.status === 404) {\r\n        state.detailsState.hasErrors = true;\r\n        state.notFound = true;\r\n      }\r\n    },\r\n    initValidationData(\r\n      state,\r\n      action: PayloadAction<{\r\n        parameters: EquipmentsChangeStateParameters;\r\n        warnings: string[];\r\n        errors: string[];\r\n      }>,\r\n    ) {\r\n      state.asyncChangeLoading = true;\r\n    },\r\n    initValidationData_Success(\r\n      state,\r\n      action: PayloadAction<ReservationEquipmentsChangeResult>,\r\n    ) {\r\n      state.equipmentChangeResultState = action.payload;\r\n      state.asyncChangeLoading = undefined;\r\n    },\r\n    initValidationData_Error(state, action: PayloadAction) {\r\n      state.equipmentChangeResultState = undefined;\r\n      state.asyncChangeLoading = undefined;\r\n    },\r\n    resetDetailsState(state, action: PayloadAction) {\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.reservationSettingsState = undefined;\r\n      state.confirmAssistedReservations = undefined;\r\n      state.equipmentsSettingsState = undefined;\r\n      state.trainingsData = null;\r\n      state.transferState = {\r\n        User: null,\r\n        ReservtionId: undefined,\r\n        WaitingTransferApproval: undefined,\r\n        transferProcessing: undefined,\r\n      };\r\n      state.reservationDtoState = undefined;\r\n      state.savedOfflineServices = [];\r\n      state.submitCredit = undefined;\r\n      state.ByApprovalErrors = undefined;\r\n      state.userCanRequestApproval = undefined;\r\n      state.refreshWorkOrderLink = undefined;\r\n      state.notFound = undefined;\r\n    },\r\n    resetOperateState(state, action: PayloadAction) {\r\n      state.detailsState.hasErrors = false;\r\n      state.detailsState.completed = false;\r\n    },\r\n    createReservation(\r\n      state,\r\n      action: PayloadAction<{\r\n        state: ReservationGlobalState;\r\n        calcCredit?: boolean;\r\n        ByApproval?: boolean;\r\n      }>,\r\n    ) {\r\n      if (action.payload.calcCredit === true) {\r\n        state.creditState.processing = true;\r\n        state.creditState.completed = undefined;\r\n        state.creditState.hasErrors = undefined;\r\n      } else {\r\n        state.detailsState.processing = true;\r\n        state.detailsState.completed = false;\r\n        state.detailsState.hasErrors = false;\r\n      }\r\n    },\r\n    createReservation_Success(state, action: createReservation_Success_Action) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n      if (!action.payload.hasErrors) {\r\n        state.savedOfflineServices = [];\r\n      }\r\n    },\r\n    createReservation_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n      state.cloneReservation = false;\r\n    },\r\n    updateReservation(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: ReservationDetailsState;\r\n        original: ReservationDetailsState;\r\n        currentCustomFormFiles: IFormFileValue[];\r\n        originalCustomFormFiles: IFormFileValue[];\r\n        offlineServices: IOtherServices[];\r\n        settings: ReservationSettingsState | undefined;\r\n        terminate?: boolean;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    updateReservation_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        userTrainigData: UserTrainingReservationData | null;\r\n        insertModel: ReservationInsertModel;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n      state.confirmAssistedReservations =\r\n        action.payload.userTrainigData !== null;\r\n      state.trainingsData = action.payload.userTrainigData;\r\n      if (!action.payload.hasErrors) {\r\n        state.savedOfflineServices = [];\r\n      }\r\n    },\r\n    updateReservation_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n    extendReservationSettings(\r\n      state,\r\n      action: PayloadAction<Partial<ReservationSettingsState>>,\r\n    ) {},\r\n    updateReservationSettings(\r\n      state,\r\n      action: PayloadAction<Partial<ReservationSettingsState>>,\r\n    ) {\r\n      state.reservationSettingsState = Object.assign(\r\n        {},\r\n        state.reservationSettingsState,\r\n        action.payload,\r\n      );\r\n    },\r\n    extendEquipmentSettingsState(\r\n      state,\r\n      action: PayloadAction<{\r\n        equipments: IReservationEquipmentDto[];\r\n        mandatories: IMandatoryEquipmentsDto[];\r\n        accServices: IEquipmentAccServiceDto[];\r\n        globalSettings: GlobalSettingsType;\r\n        settings?: ServiceSettingsState;\r\n      }>,\r\n    ) {\r\n      state.asyncChangeLoading = true;\r\n    },\r\n    updateEquipmentSettingsState(\r\n      state,\r\n      action: PayloadAction<ServiceSettingsState>,\r\n    ) {\r\n      state.equipmentsSettingsState = action.payload;\r\n      state.asyncChangeLoading = undefined;\r\n    },\r\n    resetAssisteTrainingData(state, action: PayloadAction) {\r\n      state.confirmAssistedReservations = undefined;\r\n      state.trainingsData = null;\r\n    },\r\n    resetEquipmentChangeState(state, action: PayloadAction) {\r\n      state.equipmentChangeResultState = undefined;\r\n    },\r\n    setStartDate(state, action: PayloadAction<Date | string>) {},\r\n    setStartSuccess(state, action: PayloadAction<Date | string>) {\r\n      state.valueHandler = {\r\n        run: true,\r\n        fieldKey: 'StartTime',\r\n        fieldValue: action.payload,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    setEndDate(state, action: PayloadAction<Date | string>) {},\r\n    setEndSuccess(state, action: PayloadAction<Date | string>) {\r\n      state.valueHandler = {\r\n        run: true,\r\n        fieldKey: 'EndTime',\r\n        fieldValue: action.payload,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    setAnyValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof ReservationDetailsState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setAnyValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof ReservationDetailsState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.valueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetValueHandler(state, action: PayloadAction) {\r\n      state.valueHandler = undefined;\r\n    },\r\n    getAnyValue(state, action: PayloadAction<keyof ReservationDetailsState>) {\r\n      state.requestedValueFor = action.payload;\r\n    },\r\n    getAnyValueSuccess(state, action: PayloadAction<any>) {\r\n      state.requestedValue = action.payload;\r\n    },\r\n    resetRequestedFor(state, action: PayloadAction) {\r\n      state.requestedValueFor = undefined;\r\n    },\r\n    transferReservation(state, action: PayloadAction<TransferToReservation>) {\r\n      state.transferState.transferProcessing = true;\r\n      state.transferState.transferStepCompleted = undefined;\r\n    },\r\n    transferReservation_Success(\r\n      state,\r\n      action: PayloadAction<TransferToReservation>,\r\n    ) {\r\n      state.transferState.transferProcessing = false;\r\n      state.transferState.User = action.payload.User;\r\n      state.transferState.ReservtionId = action.payload.ReservtionId;\r\n      state.transferState.WaitingTransferApproval = true;\r\n      state.transferState.transferStepCompleted = true;\r\n    },\r\n    transferReservation_Error(state, action: PayloadAction<any>) {\r\n      state.transferState.transferProcessing = false;\r\n      state.transferState.transferStepCompleted = false;\r\n    },\r\n    resetTransferState(state, action: PayloadAction) {\r\n      state.transferState.transferProcessing = undefined;\r\n      state.transferState.User = null;\r\n      state.transferState.ReservtionId = undefined;\r\n      state.transferState.WaitingTransferApproval = undefined;\r\n      state.transferState.transferStepCompleted = undefined;\r\n    },\r\n    cancelTransfer(state, action: PayloadAction<TransferToReservation>) {\r\n      state.transferState.transferProcessing = true;\r\n      state.transferState.transferStepCompleted = undefined;\r\n    },\r\n    cancelTransfer_Success(state, action: PayloadAction) {\r\n      state.transferState.transferProcessing = false;\r\n      state.transferState.User = null;\r\n      state.transferState.WaitingTransferApproval = false;\r\n      state.transferState.ReservtionId = undefined;\r\n      state.transferState.transferStepCompleted = true;\r\n    },\r\n    cancelTransfer_Error(state, action: PayloadAction<any>) {\r\n      state.transferState.transferProcessing = false;\r\n      state.transferState.transferStepCompleted = false;\r\n    },\r\n    getCredit(state, action: PayloadAction<ReservationGlobalState>) {\r\n      state.creditState.processing = true;\r\n      state.creditState.completed = undefined;\r\n      state.creditState.hasErrors = undefined;\r\n      state.submitCredit = undefined;\r\n    },\r\n    getCredit_Success(state, action: PayloadAction<PricingState>) {\r\n      state.creditState.processing = false;\r\n      state.creditState.completed = true;\r\n      state.creditState.data = action.payload;\r\n    },\r\n    getCredit_Error(state, action: PayloadAction<any>) {\r\n      state.creditState.processing = false;\r\n      state.creditState.completed = true;\r\n      state.creditState.data = undefined;\r\n    },\r\n    resetCreditState(state, action: PayloadAction) {\r\n      state.creditState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.submitCredit = undefined;\r\n    },\r\n    setSavedOfflineServices(state, action: PayloadAction<IOtherServices[]>) {\r\n      state.savedOfflineServices = action.payload;\r\n    },\r\n    setRefreshOfflineServices(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.refeshOfflineService = action.payload;\r\n    },\r\n    terminateReservation(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: ReservationDetailsState;\r\n        original: ReservationDetailsState;\r\n        currentCustomFormFiles: IFormFileValue[];\r\n        originalCustomFormFiles: IFormFileValue[];\r\n        settings: ReservationSettingsState | undefined;\r\n      }>,\r\n    ) {\r\n      state.terminationState.terminatProcessing = true;\r\n      state.terminationState.terminateCompleted = undefined;\r\n    },\r\n    terminateReservation_success(state, action: PayloadAction) {\r\n      state.terminationState.terminatProcessing = false;\r\n      state.terminationState.terminateCompleted = true;\r\n    },\r\n    terminateReservation_error(state, action: PayloadAction) {\r\n      state.terminationState.terminatProcessing = false;\r\n      state.terminationState.terminateCompleted = true;\r\n    },\r\n    resetTerminateState(state, action: PayloadAction) {\r\n      state.terminationState = {\r\n        terminatProcessing: undefined,\r\n        terminateCompleted: undefined,\r\n      };\r\n    },\r\n    setCloneReservation(state, action: PayloadAction<boolean | undefined>) {\r\n      state.cloneReservation = action.payload;\r\n    },\r\n    setAsyncChangeLoading(state, action: PayloadAction<boolean | undefined>) {\r\n      state.asyncChangeLoading = action.payload;\r\n    },\r\n    setSubmitCredit(state, action: PayloadAction<boolean | undefined>) {\r\n      state.submitCredit = action.payload;\r\n    },\r\n    setByApprovalErrors(\r\n      state,\r\n      action: PayloadAction<Array<string> | undefined>,\r\n    ) {\r\n      state.ByApprovalErrors = action.payload;\r\n    },\r\n    setUserCanRequestApproval(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.userCanRequestApproval = action.payload;\r\n    },\r\n    setRefreshWorkOrderLink(state, action: PayloadAction<boolean | undefined>) {\r\n      state.refreshWorkOrderLink = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: reservationActions } = slice;\r\n\r\nexport const useReservationSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: reservationSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useReservationSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { FormLabel } from '@material-ui/core';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport clsx from 'clsx';\r\n\r\nexport interface GhostInputProps {\r\n  label?: React.ReactNode;\r\n  valueHtml?: React.ReactNode;\r\n  valueText?: React.ReactNode;\r\n  id?: string;\r\n  fullWidth?: boolean;\r\n  info?: string;\r\n  labelBolder?: boolean;\r\n}\r\nexport function GhostInput(props: GhostInputProps) {\r\n  const {\r\n    label,\r\n    valueHtml,\r\n    valueText,\r\n    info,\r\n    labelBolder,\r\n    fullWidth = true,\r\n  } = props;\r\n\r\n  return (\r\n    <FormControl className={'ghostInput'} fullWidth={fullWidth}>\r\n      <span className={'ghosInputText'}>\r\n        {label && (\r\n          <FormLabel\r\n            className={clsx('ghosInputLabel', {\r\n              ghosInputLabelBold: labelBolder,\r\n            })}\r\n          >\r\n            {label} {info && <InfoIcon title={info} />}\r\n          </FormLabel>\r\n        )}\r\n        {valueText && (\r\n          <BasicTypography component={'span'} variant={'bodyS'}>\r\n            {valueText}\r\n          </BasicTypography>\r\n        )}\r\n        {valueHtml}\r\n      </span>\r\n    </FormControl>\r\n  );\r\n}\r\n","/**\r\n * A copy of local\\Bookit.Data\\Enums\\BudgetFields.cs\r\n * replace attributes: ^ *\\[[^\\]]+\\]\\n\r\n */\r\nexport enum BudgetFields {\r\n  Active = 1,\r\n\r\n  Number = 2,\r\n\r\n  BudgetManager = 3,\r\n\r\n  UserGroup = 4,\r\n\r\n  BudgetCat = 5,\r\n\r\n  HideExperiments = 6,\r\n\r\n  StartDate = 7,\r\n\r\n  EndDate = 8,\r\n\r\n  Confidential = 9,\r\n\r\n  FundingType = 10,\r\n\r\n  AllowJoinRequests = 11,\r\n\r\n  DefaultExperimentTemplate = 12,\r\n\r\n  Default = 13,\r\n\r\n  BudgetIsOnline = 14,\r\n\r\n  BudgetFund = 15,\r\n\r\n  FacilityProject = 16,\r\n\r\n  BudgetInternalId = 17,\r\n\r\n  BudgetStatus = 18,\r\n\r\n  ExternalEndDate = 19,\r\n\r\n  ExternalUpdatedAt = 20,\r\n\r\n  BudgetLeader = 21,\r\n\r\n  BudgetInitialCost = 22,\r\n\r\n  BudgetBudget = 23,\r\n\r\n  BudgetOwner = 24,\r\n\r\n  BdmUsername = 25,\r\n\r\n  SubsidyProfit = 26,\r\n\r\n  SubsProfProjectNumber = 27,\r\n\r\n  SubsProfCostCenter = 28,\r\n  SubsProfActivity = 29,\r\n\r\n  SubsProfAccountNumber = 30,\r\n  SubsidyFinAccountType = 31,\r\n  BudgetRemarks = 32,\r\n\r\n  Company = 33,\r\n\r\n  BudgetManagerCanApproveExperiment = 34,\r\n\r\n  BudgetAmount = 35,\r\n\r\n  HardLimit = 36,\r\n\r\n  SoftLimit = 37,\r\n\r\n  BudgetLimitsNotificationSettings = 38,\r\n\r\n  BudgetExtraTextField1 = 39,\r\n\r\n  BudgetExtraTextField2 = 40,\r\n\r\n  BudgetExtraTextField3 = 41,\r\n\r\n  BudgetExtraTextField4 = 42,\r\n\r\n  BudgetExtraTextField5 = 43,\r\n\r\n  BudgetExtraBoolField1 = 44,\r\n\r\n  BudgetExtraBoolField2 = 45,\r\n\r\n  BudgetExtraBoolField3 = 46,\r\n\r\n  BudgetExtraBoolField4 = 47,\r\n\r\n  BudgetExtraBoolField5 = 48,\r\n\r\n  BudgetExtraDateField1 = 49,\r\n\r\n  BudgetExtraDateField2 = 50,\r\n\r\n  BudgetExtraDateField3 = 51,\r\n\r\n  BudgetExtraDateField4 = 52,\r\n\r\n  BudgetExtraDateField5 = 53,\r\n\r\n  BudgetExtraNumField1 = 54,\r\n\r\n  BudgetExtraNumField2 = 55,\r\n\r\n  BudgetExtraNumField3 = 56,\r\n\r\n  BudgetExtraNumField4 = 57,\r\n\r\n  BudgetExtraNumField5 = 58,\r\n\r\n  InvoicingRemarks = 59,\r\n  ProjectBilingEmail = 60,\r\n  PendingProjectAmount = 61,\r\n  SecondaryCoordinators = 62,\r\n  PurchaseOrderOption = 63,\r\n}\r\n","import {\r\n  Chip,\r\n  ChipProps,\r\n  darken,\r\n  fade,\r\n  Theme,\r\n  withStyles,\r\n} from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { WithStylesOptions } from '@material-ui/styles';\r\nimport { inputLabelM, inputLabelXS } from 'styles/typography/bookitTypography';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Check } from '../BasicInputs/Check';\r\n\r\nexport interface BookitChipProps extends ChipProps {\r\n  customcolor?: string;\r\n  custombgcolor?: string;\r\n  customiconcolor?: string;\r\n  fullwidth?: boolean;\r\n  customwidth?: number | string;\r\n  shape?: 'squar' | 'circle';\r\n  customsize?: 'xs' | 'small' | 'medium';\r\n  notremoved?: boolean;\r\n}\r\nexport interface BookitChipWithInfoProps extends BookitChipProps {\r\n  info?: React.ReactNode;\r\n}\r\nconst StyledChip = withStyles<\r\n  | 'root'\r\n  | 'disabled'\r\n  | 'label'\r\n  | 'labelSmall'\r\n  | 'clickable'\r\n  | 'sizeSmall'\r\n  | 'deleteIcon',\r\n  WithStylesOptions<Theme>,\r\n  {\r\n    shape?: 'squar' | 'circle';\r\n    custombgcolor?: string;\r\n    customsize?: 'xs' | 'small' | 'medium';\r\n    customcolor?: string;\r\n    customiconcolor?: string;\r\n    fullwidth?: boolean;\r\n    customwidth?: number | string;\r\n    notremoved?: boolean;\r\n    size?: 'small' | 'medium';\r\n    disabled?: boolean;\r\n  }\r\n>((theme: Theme) => ({\r\n  root: {\r\n    justifyContent: 'space-around',\r\n    borderRadius: props =>\r\n      props.shape === 'squar' ? 4 : props.shape === 'circle' ? 50 : 4,\r\n    backgroundColor: props => props.custombgcolor ?? theme.palette.primary.main,\r\n    height: props =>\r\n      props.customsize === 'xs'\r\n        ? 20\r\n        : props.customsize === 'small'\r\n        ? 24\r\n        : props.customsize === 'medium'\r\n        ? 32\r\n        : 24,\r\n    color: props => props.customcolor ?? theme.palette.common.white,\r\n    gap: 4,\r\n    paddingBlock: props =>\r\n      props.customsize === 'xs'\r\n        ? '2px'\r\n        : props.customsize === 'small'\r\n        ? '6px'\r\n        : props.customsize === 'medium'\r\n        ? '8px'\r\n        : '4px',\r\n    '&$disabled': {\r\n      opacity: 1,\r\n      backgroundColor: theme.palette.common.grayComponents,\r\n      color: theme.palette.common.white,\r\n      pointerEvents: 'visible',\r\n    },\r\n    '&:hover, &:focus': {\r\n      backgroundColor: props =>\r\n        props.custombgcolor === undefined\r\n          ? theme.palette.primary.dark\r\n          : darken(props.custombgcolor, 0.2),\r\n      color: props =>\r\n        props.customcolor === undefined\r\n          ? theme.palette.common.white\r\n          : props.customcolor,\r\n    },\r\n    width: props =>\r\n      props.fullwidth\r\n        ? '100%'\r\n        : props.customwidth\r\n        ? props.customwidth\r\n        : undefined,\r\n    maxWidth: props => (props.notremoved ? '100%' : 'calc(100% - 6px)'),\r\n  },\r\n  disabled: {\r\n    backgroundColor: theme.palette.common.grayComponents,\r\n    color: theme.palette.common.white,\r\n  },\r\n  label: inputLabelM,\r\n  labelSmall: inputLabelXS,\r\n  clickable: {\r\n    backgroundColor: props => props.custombgcolor ?? theme.palette.primary.main,\r\n    color: props => props.customcolor ?? theme.palette.common.white,\r\n  },\r\n  sizeSmall: {\r\n    height: 20,\r\n  },\r\n  deleteIcon: {\r\n    color: props =>\r\n      props.customiconcolor === undefined\r\n        ? theme.palette.primary.contrastText\r\n        : props.customiconcolor,\r\n    height: 16,\r\n    width: 16,\r\n    margin: props =>\r\n      props.size === 'small' ? '0 4px 0 -4px' : '0 12px 0 -12px',\r\n    display: props => (props.notremoved ? 'none' : 'inline-block'),\r\n    '&:hover': {\r\n      color: props =>\r\n        props.customiconcolor === undefined\r\n          ? fade(theme.palette.primary.contrastText, 0.8)\r\n          : fade(props.customiconcolor, 0.8),\r\n    },\r\n    pointerEvents: props => (props.disabled ? 'none' : 'auto'),\r\n  },\r\n}))(Chip);\r\n\r\nexport const BookitChip = (props: BookitChipProps) => {\r\n  const {\r\n    deleteIcon,\r\n    notremoved,\r\n    fullwidth,\r\n    disabled,\r\n    customcolor,\r\n    custombgcolor,\r\n    customiconcolor,\r\n    customwidth,\r\n    shape,\r\n    customsize,\r\n    ...other\r\n  } = props;\r\n  return (\r\n    <StyledChip\r\n      deleteIcon={\r\n        !!deleteIcon ? (\r\n          deleteIcon\r\n        ) : notremoved ? undefined : (\r\n          <Icon icon=\"times\" aria-disabled={disabled} />\r\n        )\r\n      }\r\n      onDelete={event => {\r\n        notremoved\r\n          ? event.preventDefault()\r\n          : !!props.onDelete && props.onDelete(event);\r\n      }}\r\n      fullwidth={fullwidth}\r\n      custombgcolor={custombgcolor}\r\n      customiconcolor={customiconcolor}\r\n      shape={shape}\r\n      customsize={customsize}\r\n      customwidth={customwidth}\r\n      customcolor={customcolor}\r\n      disabled={disabled}\r\n      notremoved={notremoved}\r\n      {...other}\r\n    />\r\n  );\r\n};\r\nexport interface BookitChipWithCheckProps extends BookitChipProps {\r\n  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n  color?: 'primary' | 'secondary' | 'default';\r\n  checked?: boolean;\r\n  checkid?: string;\r\n  checkname?: string;\r\n  label?: string;\r\n  info?: string;\r\n}\r\nexport const BookitChipWithCheck = (props: BookitChipWithCheckProps) => {\r\n  return (\r\n    <BookitChipWithInfo\r\n      icon={\r\n        <Check\r\n          name={props.checkname}\r\n          id={props.checkid}\r\n          onChange={props.onChange}\r\n          disabled={props.disabled}\r\n          checked={props.checked ?? false}\r\n          size=\"small\"\r\n        />\r\n      }\r\n      label={props.label}\r\n      fullwidth={props.fullwidth}\r\n      info={props.info}\r\n      notremoved={props.notremoved}\r\n      custombgcolor={props.custombgcolor}\r\n      customcolor={props.customcolor}\r\n      customiconcolor={props.customiconcolor}\r\n      customsize={props.customsize}\r\n      customwidth={props.customwidth}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n\r\nexport const BookitChipWithInfo = (props: BookitChipWithInfoProps) => {\r\n  const {\r\n    info,\r\n    fullwidth,\r\n    customcolor,\r\n    custombgcolor,\r\n    customiconcolor,\r\n    customwidth,\r\n    shape,\r\n    customsize,\r\n    notremoved,\r\n    ...other\r\n  } = props;\r\n  return info ? (\r\n    <Tooltip title={info} style={{ width: 'inherit' }}>\r\n      <span>\r\n        <BookitChip\r\n          fullwidth={fullwidth}\r\n          customcolor={customcolor}\r\n          custombgcolor={custombgcolor}\r\n          customiconcolor={customiconcolor}\r\n          customwidth={customwidth}\r\n          shape={shape}\r\n          customsize={customsize}\r\n          notremoved={notremoved}\r\n          {...other}\r\n        />\r\n      </span>\r\n    </Tooltip>\r\n  ) : (\r\n    <StyledChip\r\n      deleteIcon={<Icon icon=\"times\" />}\r\n      fullwidth={fullwidth}\r\n      customcolor={customcolor}\r\n      custombgcolor={custombgcolor}\r\n      customiconcolor={customiconcolor}\r\n      customwidth={customwidth}\r\n      shape={shape}\r\n      customsize={customsize}\r\n      notremoved={notremoved}\r\n      {...other}\r\n    />\r\n  );\r\n};\r\n","export function* largeFilesUploadSaga() {}\r\n","import { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { LargeFilesUploadState } from './types';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { largeFilesUploadSaga } from './saga';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\n\r\nexport const initialState: LargeFilesUploadState = {\r\n  selectedFiles: 0,\r\n  canUpload: false,\r\n  uploading: false,\r\n  targetId: 0,\r\n  startedToUpload: false,\r\n  files: [],\r\n  currentNumberOfUploadedFiles: 0,\r\n  numberOfUploadedFiles: 0,\r\n  commentType: undefined,\r\n  referenceId: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'largeFilesUpload',\r\n  initialState,\r\n  reducers: {\r\n    setSeletedFiles(state, action: PayloadAction<number>) {\r\n      state.selectedFiles = action.payload;\r\n    },\r\n    setCommentProperties(\r\n      state,\r\n      action: PayloadAction<{\r\n        commentType: CommentReferenceTypes;\r\n        referenceId: number;\r\n      }>,\r\n    ) {\r\n      state.commentType = action.payload.commentType;\r\n      state.referenceId = action.payload.referenceId;\r\n    },\r\n    setCanUpload(state, action: PayloadAction<number>) {\r\n      if (action.payload > 0) {\r\n        state.targetId = action.payload;\r\n        state.canUpload = true;\r\n        state.startedToUpload = false;\r\n        state.uploading = false;\r\n        state.currentNumberOfUploadedFiles = 0;\r\n        state.numberOfUploadedFiles = 0;\r\n      } else {\r\n        state.canUpload = false;\r\n        state.startedToUpload = false;\r\n        state.uploading = false;\r\n        state.targetId = 0;\r\n        state.files = [];\r\n        state.currentNumberOfUploadedFiles = 0;\r\n        state.numberOfUploadedFiles = 0;\r\n      }\r\n    },\r\n    addFile(state, action: PayloadAction<string>) {\r\n      state.files.push(action.payload);\r\n      if (state.canUpload && state.files.length === 1) {\r\n        state.startedToUpload = true;\r\n        state.currentNumberOfUploadedFiles = 0;\r\n        state.numberOfUploadedFiles = 0;\r\n        state.selectedFiles = 0;\r\n      }\r\n      state.uploading = state.canUpload && state.files.length > 0;\r\n    },\r\n    removeFile(state, action: PayloadAction<string>) {\r\n      const index = state.files.findIndex(item => item === action.payload);\r\n      if (index >= 0) {\r\n        state.files.splice(index, 1);\r\n        state.currentNumberOfUploadedFiles++;\r\n      }\r\n      if (state.files.length === 0 && state.uploading) {\r\n        state.numberOfUploadedFiles = state.currentNumberOfUploadedFiles;\r\n        state.currentNumberOfUploadedFiles = 0;\r\n        state.uploading = false;\r\n      }\r\n    },\r\n    resetNumberOfUploadedFiles(state) {\r\n      state.selectedFiles = 0;\r\n      state.numberOfUploadedFiles = 0;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: largeFilesUploadActions } = slice;\r\n\r\nexport const useLargeFilesUploadSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: largeFilesUploadSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import {\r\n  IComment,\r\n  NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { httpClient } from './HttpClient';\r\nconst url = '/api/odata/v4/Comments';\r\nexport const CommentsApi = {\r\n  GetComments: (type: number, reference: number, Id?: number) => {\r\n    return httpClient\r\n      .get(url, {\r\n        reference,\r\n        type,\r\n        $filter: Id !== undefined ? 'Id eq ' + Id?.toString() : undefined,\r\n        $expand: ['Files', 'CreatedBy'].join(','),\r\n      })\r\n      .then(v => v.value as IComment[]);\r\n  },\r\n  SendComment: (\r\n    typeId: number,\r\n    referenceId: number,\r\n    { Files, Text, IsInternal }: Omit<NewComment, 'Users'>,\r\n  ) => {\r\n    const form = new FormData();\r\n    for (let i = 0; !!Files && i < Files?.length; i++) {\r\n      let item = Files?.item(i);\r\n      if (!!item) {\r\n        form.append('file' + i, item);\r\n      }\r\n    }\r\n    form.append('TypeId', typeId as any);\r\n    form.append('ReferenceId', referenceId as any);\r\n    form.append('Text', Text ?? '');\r\n    form.append('IsInternal', !!IsInternal as any);\r\n\r\n    return httpClient.post(url, form);\r\n  },\r\n  removeFile: (id: string) => {\r\n    const delteUrl = `/odata.svc/Files(guid'${id}')`;\r\n    return httpClient.delete(delteUrl);\r\n  },\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { getBudgetVisible } from 'app/pages/ReservationDetails/Details/slice/getBudgetVisible';\r\nimport { FundingTypes } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { Roles } from 'app/slice/types';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AsyncDataState } from 'types/common';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { FieldHandlerProps } from '../../FormRender/FormRenderer';\r\n\r\n/* --- STATE --- */\r\nexport interface ConnectedFiltersState\r\n  extends AsyncDataState<IConnectedFiltersDto> {\r\n  connectedValueHandler?: FieldHandlerProps<IConnectedFiltersDto>;\r\n  connectedSettings: ConnectedFiltersSettings;\r\n}\r\nexport interface ConnectedFiltersSettings {\r\n  startTimeVisible?: boolean;\r\n  endTimeVisible?: boolean;\r\n  budgetVisible?: boolean;\r\n  userVisible?: boolean;\r\n  userGroupVisible?: boolean;\r\n  fundingTypeVisible?: boolean;\r\n  budgetExpirementVisible?: boolean;\r\n  instProjVisible?: boolean;\r\n  extCustomerVisible?: boolean;\r\n  purchaseOrderVisible?: boolean;\r\n  referenceVisible?: boolean;\r\n  onlyOwnUserGroupsAllowed?: boolean;\r\n  ReservationUserGroupGroupByBudgetUserGroup?: boolean;\r\n  budgetLimitedByUsers?: boolean;\r\n  isBudgetsWithoutUserGroup?: boolean;\r\n  hideProject?: boolean;\r\n  isServiceAdmin?: boolean;\r\n  isUserGroupCoordinator?: boolean;\r\n  chargesViewAllowed?: boolean;\r\n  hasConflictProjects?: boolean;\r\n}\r\nexport function mapSettings(\r\n  services: IServiceTypeFilterDto[],\r\n  globalSettings: GlobalSettingsType,\r\n  settings: ConnectedFiltersSettings,\r\n  isEditMode: boolean,\r\n  user: AuthenticatedUser | undefined,\r\n  data?: IConnectedFiltersDto,\r\n): ConnectedFiltersSettings {\r\n  let budgetEnabled = getBudgetVisible(\r\n    globalSettings,\r\n    services.map(service => ({\r\n      Billable: service.Billable,\r\n      BudgetsTurnedOn: service.BudgetsTurnedOn,\r\n      HideProjects: service.HideProject,\r\n      ServiceTypeId: service.ServiceTypeId,\r\n    })),\r\n  );\r\n\r\n  let resUGEnabled =\r\n    services.length > 0\r\n      ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n        budgetEnabled\r\n      : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n  let isServiceAdmin = user?.IsAllGroupOrLabTechAdmin(\r\n    services.map(f => f.ServiceGroupId ?? 0),\r\n    services,\r\n  );\r\n  let isRoleAdmin =\r\n    user?.Roles.includes(Roles.Administrators) ||\r\n    user?.Roles.includes(Roles.GroupAdministrators) ||\r\n    user?.Roles.includes(Roles.LabTech);\r\n  let isUserGroupCoordinator =\r\n    user &&\r\n    user.Roles.includes(Roles.UserGroupCoord) &&\r\n    (isEditMode ? !!data && data.UserGroup?.Id === user.ActiveUserGroup : true);\r\n  let btExpEnabled =\r\n    globalSettings.budgetExperimentModuleEnabled && budgetEnabled;\r\n  // && !!data\r\n  //   ? data.Budget !== null\r\n  //     ? !((data.Budget as IBudgetFilterDto).HideExperiments === true)\r\n  //     : false\r\n  //   : false;\r\n  let chargesViewAllowed =\r\n    (user && user.Roles.includes(Roles.FinAdmin)) ||\r\n    isServiceAdmin ||\r\n    (user &&\r\n      user.Roles.includes(Roles.InvoicesReader) &&\r\n      user.ActiveUserGroup?.Id === data?.UserGroup?.Id);\r\n  const result = Object.assign({}, settings, {\r\n    hideProject:\r\n      services.length > 0 ? services.every(f => f.HideProject) : undefined,\r\n    isUserGroupCoordinator: isUserGroupCoordinator,\r\n    hasConflictProjects:\r\n      services.some(f => f.HideProject === true) &&\r\n      services.some(f => f.HideProject === false),\r\n    budgetVisible: budgetEnabled,\r\n    fundingTypeVisible:\r\n      globalSettings.fundingTypeBudgetEnabled &&\r\n      budgetEnabled &&\r\n      // funding type is not needed unless the PurchaseOrder is also enabled\r\n      globalSettings.purchaseOrderBudgetEnabled,\r\n    ReservationUserGroupGroupByBudgetUserGroup: resUGEnabled,\r\n    userGroupVisible:\r\n      (isServiceAdmin || isRoleAdmin) &&\r\n      !isEditMode &&\r\n      !isUserGroupCoordinator &&\r\n      !resUGEnabled,\r\n    userVisible:\r\n      isServiceAdmin || isUserGroupCoordinator || (!isEditMode && isRoleAdmin),\r\n    budgetExpirementVisible: btExpEnabled,\r\n    instProjVisible: globalSettings.instituteProjectsEnabled,\r\n    // looks like the external customers are being deprecated\r\n    extCustomerVisible: false,\r\n    purchaseOrderVisible:\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      ((data?.Budget as IBudgetFilterDto)?.PurchaseOrderOptionId ??\r\n        PurchaseOrderOptions.Hidden) !== PurchaseOrderOptions.Hidden,\r\n    referenceVisible:\r\n      globalSettings.showReferenceFieldInReservationDetails && !!data\r\n        ? data.FundingType?.Id === FundingTypes.External\r\n        : false,\r\n    onlyOwnUserGroupsAllowed: globalSettings.onlyOwnUserGroupsAllowed,\r\n    budgetLimitedByUsers: globalSettings.budgetLimitedByUsers,\r\n    isBudgetsWithoutUserGroup: globalSettings.isBudgetsWithoutUserGroup,\r\n    isServiceAdmin: isServiceAdmin,\r\n    endTimeVisible: false,\r\n    startTimeVisible: true,\r\n    chargesViewAllowed:\r\n      globalSettings.allowUsersToViewTheirCharges || chargesViewAllowed,\r\n  });\r\n  return result;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, select, takeLatest } from 'redux-saga/effects';\r\nimport { connectedFiltersActions as actions } from '.';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ConnectedFiltersSettings, mapSettings } from './types';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectConnectedFiltersData } from './selectors';\r\n\r\nfunction* doSetConnectedValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof IConnectedFiltersDto;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setConnectedValueSuccess(action.payload));\r\n}\r\nfunction* doUpdateEquipmentSettigs(\r\n  action: PayloadAction<{\r\n    services: IServiceTypeFilterDto[];\r\n    globalSettings: GlobalSettingsType;\r\n    settings: ConnectedFiltersSettings;\r\n    isEdit: boolean;\r\n    data?: IConnectedFiltersDto;\r\n  }>,\r\n) {\r\n  const user: AuthenticatedUser | undefined = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const currentData: IConnectedFiltersDto = yield select(\r\n    selectConnectedFiltersData,\r\n  );\r\n  let newSettings = mapSettings(\r\n    action.payload.services,\r\n    action.payload.globalSettings,\r\n    action.payload.settings,\r\n    action.payload.isEdit,\r\n    user,\r\n    action.payload.data || currentData,\r\n  );\r\n\r\n  yield put(actions.updateSettingsState(newSettings));\r\n}\r\nfunction* doResetState(action: PayloadAction) {\r\n  yield put(actions.resetConnectedState_success());\r\n}\r\nexport function* connectedFiltersSaga() {\r\n  yield takeLatest(actions.setConnectedValue.type, doSetConnectedValue);\r\n  yield takeLatest(actions.extendSettingsState.type, doUpdateEquipmentSettigs);\r\n  yield takeLatest(actions.resetConnectedState.type, doResetState);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport {\r\n  ConnectedFiltersInit,\r\n  IConnectedFiltersDto,\r\n} from 'types/IConnectedFiltersDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { connectedFiltersSaga } from './saga';\r\nimport { ConnectedFiltersSettings, ConnectedFiltersState } from './types';\r\n\r\nexport const initialState: ConnectedFiltersState = {\r\n  processing: false,\r\n  data: {\r\n    StartTime: new CustomDate(new Date()).toISOString(),\r\n    EndTime: undefined,\r\n    User: null,\r\n    UserGroup: null,\r\n    Budget: null,\r\n    BudgetExperiment: null,\r\n    InstituteProject: null,\r\n    ExternalCustomer: null,\r\n    FundingType: getSingleInvoiceFundingType(0),\r\n    PurchaseOrder: undefined,\r\n    Reference: undefined,\r\n  },\r\n  connectedValueHandler: undefined,\r\n  connectedSettings: {\r\n    budgetExpirementVisible: undefined,\r\n    budgetLimitedByUsers: undefined,\r\n    budgetVisible: undefined,\r\n    endTimeVisible: undefined,\r\n    extCustomerVisible: undefined,\r\n    fundingTypeVisible: undefined,\r\n    hideProject: undefined,\r\n    instProjVisible: undefined,\r\n    isBudgetsWithoutUserGroup: undefined,\r\n    isServiceAdmin: undefined,\r\n    onlyOwnUserGroupsAllowed: undefined,\r\n    purchaseOrderVisible: undefined,\r\n    referenceVisible: undefined,\r\n    ReservationUserGroupGroupByBudgetUserGroup: undefined,\r\n    startTimeVisible: undefined,\r\n    userGroupVisible: undefined,\r\n    userVisible: undefined,\r\n    isUserGroupCoordinator: undefined,\r\n    chargesViewAllowed: undefined,\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'connectedFilters',\r\n  initialState,\r\n  reducers: {\r\n    resetState(state, action: PayloadAction<Date | null>) {\r\n      state.data = ConnectedFiltersInit();\r\n    },\r\n    saveState(state, action: PayloadAction<IConnectedFiltersDto>) {\r\n      state.data = {\r\n        StartTime: action.payload.StartTime,\r\n        EndTime: action.payload.EndTime,\r\n        User: action.payload.User,\r\n        UserGroup: action.payload.UserGroup,\r\n        Budget: action.payload.Budget,\r\n        BudgetExperiment: action.payload.BudgetExperiment,\r\n        InstituteProject: action.payload.InstituteProject,\r\n        ExternalCustomer: action.payload.ExternalCustomer,\r\n        FundingType: action.payload.FundingType,\r\n        PurchaseOrder: action.payload.PurchaseOrder,\r\n        Reference: action.payload.PurchaseOrder,\r\n      };\r\n    },\r\n    setSubmit(state, action: PayloadAction<boolean>) {\r\n      state.processing = action.payload;\r\n    },\r\n    resetConnectedState(state, action: PayloadAction) {},\r\n    resetConnectedState_success(state, action: PayloadAction) {\r\n      state.connectedSettings = {\r\n        budgetExpirementVisible: undefined,\r\n        budgetLimitedByUsers: undefined,\r\n        budgetVisible: undefined,\r\n        endTimeVisible: undefined,\r\n        extCustomerVisible: undefined,\r\n        fundingTypeVisible: undefined,\r\n        hideProject: undefined,\r\n        instProjVisible: undefined,\r\n        isBudgetsWithoutUserGroup: undefined,\r\n        isServiceAdmin: undefined,\r\n        onlyOwnUserGroupsAllowed: undefined,\r\n        purchaseOrderVisible: undefined,\r\n        referenceVisible: undefined,\r\n        ReservationUserGroupGroupByBudgetUserGroup: undefined,\r\n        startTimeVisible: undefined,\r\n        userGroupVisible: undefined,\r\n        userVisible: undefined,\r\n        isUserGroupCoordinator: undefined,\r\n        chargesViewAllowed: undefined,\r\n      };\r\n      state.data = {\r\n        StartTime: new CustomDate(new Date()).toISOString(),\r\n        EndTime: undefined,\r\n        User: null,\r\n        UserGroup: null,\r\n        Budget: null,\r\n        BudgetExperiment: null,\r\n        InstituteProject: null,\r\n        ExternalCustomer: null,\r\n        FundingType: getSingleInvoiceFundingType(0),\r\n        PurchaseOrder: undefined,\r\n        Reference: undefined,\r\n      };\r\n      state.connectedValueHandler = undefined;\r\n      state.completed = undefined;\r\n      state.processing = undefined;\r\n      state.hasErrors = undefined;\r\n    },\r\n    setConnectedValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof IConnectedFiltersDto;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setConnectedValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof IConnectedFiltersDto;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.connectedValueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetConnectedHandler(state, action: PayloadAction) {\r\n      state.connectedValueHandler = undefined;\r\n    },\r\n    extendSettingsState(\r\n      state,\r\n      action: PayloadAction<{\r\n        services: IServiceTypeFilterDto[];\r\n        globalSettings: GlobalSettingsType;\r\n        settings: ConnectedFiltersSettings;\r\n        isEdit: boolean;\r\n        data?: IConnectedFiltersDto;\r\n      }>,\r\n    ) {},\r\n    updateSettingsState(\r\n      state,\r\n      action: PayloadAction<ConnectedFiltersSettings>,\r\n    ) {\r\n      state.connectedSettings = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: connectedFiltersActions } = slice;\r\n\r\nexport const useConnectedFiltersSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: connectedFiltersSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","export const DRAWER_WIDTH: number = 240;\r\nexport const DRAWER_MOBILE_WIDTH: number = 350;\r\nexport const SIDE_PANEL_WIDTH: number = 370;\r\nexport const COVER_WIDTH: number = 360;\r\n","/**\r\n *\r\n * ExtraDDLPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IExtraDDLDto } from 'api/odata/generated/entities/IExtraDDLDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nexport type CatUrl = 'base' | 'assetBase' | 'public';\r\nexport interface ExtraDDLPickerProps\r\n  extends Omit<AutocompletePickerProps<IExtraDDLDto>, 'loadData'> {\r\n  urlType?: any;\r\n}\r\n\r\nconst url = '/api/odata/v4/ExtraDDL';\r\nexport const initExtraDDLData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: string,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IExtraDDLDto[]>((resolve, reject) => {\r\n      resolve([] as IExtraDDLDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,Active,ExtraDdlId',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl = `${url}?key=${sourceUrl ?? ''}`;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IExtraDDLDto[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IExtraDDLDto>)[] | undefined,\r\n  urlType?: string,\r\n) => {\r\n  const sourceUrl = `${url}?key=${urlType ?? ''}`;\r\n  return getAutoCompleteLoadDataFn<IExtraDDLDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'Active', 'ExtraDdlId'],\r\n    globalServiceGroupFilter: [],\r\n  });\r\n};\r\n\r\nexport function ExtraDDLPicker(props: ExtraDDLPickerProps) {\r\n  const { predicates, urlType, ...other } = props;\r\n\r\n  const innerLoadData = loadData(predicates, urlType);\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || `ExtraDDL_${urlType}Id`}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","import { CircularProgress } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n  Autocomplete,\r\n  AutocompleteGetTagProps,\r\n  AutocompleteProps,\r\n  AutocompleteRenderOptionState,\r\n} from '@material-ui/lab';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport React from 'react';\r\nimport { CSSProperties } from 'styled-components';\r\nimport { autocompleteStyles } from 'styles/MUIExtend/autocompleteStyles';\r\nimport { Entity } from 'types/common';\r\nimport clsx from 'clsx';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\n\r\nexport interface AutocompleteMultiPickerProps<\r\n  TKey,\r\n  TValue extends Entity<TKey> = Entity<TKey>\r\n> extends Omit<\r\n    AutocompleteProps<TValue, true, boolean | undefined, false>,\r\n    | 'multiple'\r\n    | 'loading'\r\n    | 'open'\r\n    | 'options'\r\n    | 'renderInput'\r\n    | 'onChange'\r\n    | 'classes'\r\n    | 'renderTags'\r\n    | 'renderOptionLabel'\r\n    | 'renderOptions'\r\n  > {\r\n  value?: TValue[];\r\n  label?: string;\r\n  loadData: (searchTerm: string | null) => Promise<TValue[]>;\r\n  size?: 'medium' | 'small';\r\n  mini?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  isOpen?: boolean;\r\n  style?: CSSProperties;\r\n  name?: string;\r\n  placeholder?: string;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  onChange: (value: TValue[]) => void;\r\n  required?: boolean;\r\n  info?: string;\r\n  id?: string;\r\n  renderTags?: (\r\n    value: TValue[],\r\n    getTagProps: AutocompleteGetTagProps,\r\n  ) => React.ReactNode | undefined;\r\n  renderOptionLabel?: (value: TValue) => string | undefined;\r\n  renderOptions?: (\r\n    option: TValue,\r\n    state: AutocompleteRenderOptionState,\r\n  ) => React.ReactNode | undefined;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  onChipClick?: (chip: TValue) => void;\r\n  ariaLabel?: string;\r\n  /**\r\n   * Controls width of selected option chips. If true, every selected option will occupy full width of the picker, otherwise width will depend on option text content length\r\n   */\r\n  fullWdithOptions?: boolean;\r\n  onPickerOpen?: () => void;\r\n}\r\n\r\nexport function AutocompleteMultiPicker<\r\n  TKey,\r\n  TValue extends Entity<TKey> = Entity<TKey>\r\n>({\r\n  isOpen,\r\n  size,\r\n  mini,\r\n  onOpen,\r\n  onClose,\r\n  label,\r\n  fullWidth,\r\n  fullWdithOptions,\r\n  variant,\r\n  name,\r\n  placeholder,\r\n  error,\r\n  helperText,\r\n  required,\r\n  renderTags,\r\n  loadData,\r\n  disableClearable,\r\n  onChange,\r\n  onInputChange,\r\n  getOptionSelected,\r\n  getOptionLabel,\r\n  renderOptionLabel,\r\n  renderOptions,\r\n  onBlur,\r\n  value,\r\n  defaultValue,\r\n  info,\r\n  id,\r\n  onChipClick,\r\n  ariaLabel,\r\n  inputValue,\r\n  onPickerOpen,\r\n  ...props\r\n}: AutocompleteMultiPickerProps<TKey, TValue>) {\r\n  const classes = autocompleteStyles();\r\n  let firstOpen = isOpen;\r\n  const [open, setOpen] = React.useState(firstOpen);\r\n  const [options, setOptions] = React.useState<TValue[] | null>(null);\r\n  const [searchTerm, setSearchTerm] = React.useState<string | null>(null);\r\n  const [hasSelected, setSelected] = React.useState(\r\n    defaultValue && defaultValue.length > 0,\r\n  );\r\n  const [newInputValue, setInputValue] = React.useState(inputValue || '');\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n  const loading = open && options === null;\r\n  useEffectOnMount(() => {\r\n    setSelected((value || []).length > 0);\r\n  });\r\n  React.useEffect(() => {\r\n    let active = true;\r\n    if (!loading) return undefined;\r\n\r\n    (async () => {\r\n      try {\r\n        const data = await loadData(searchTerm);\r\n        active && setOptions(data as TValue[]);\r\n      } catch {}\r\n    })();\r\n\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [loading, loadData, searchTerm]);\r\n\r\n  React.useEffect(() => {\r\n    if (!open) setOptions(null);\r\n  }, [open]);\r\n\r\n  const handleRenderTags = (\r\n    value: TValue[],\r\n    getTagProps: AutocompleteGetTagProps,\r\n  ) => {\r\n    if (renderTags === undefined) {\r\n      return value.map((option: TValue, index: number) => {\r\n        const color = ((option as unknown) as IServiceFilterDto).Color;\r\n        return (\r\n          <BookitChip\r\n            onClick={() => onChipClick?.(option)}\r\n            variant=\"default\"\r\n            size=\"small\"\r\n            label={option.Name}\r\n            custombgcolor={color ?? undefined}\r\n            fullwidth={fullWdithOptions}\r\n            {...getTagProps({ index })}\r\n          />\r\n        );\r\n      });\r\n    } else {\r\n      return renderTags(value, getTagProps);\r\n    }\r\n  };\r\n  const handleRenderOptionLabel = (option: TValue) => {\r\n    return renderOptionLabel === undefined\r\n      ? option.Name\r\n      : (renderOptionLabel(option) as string);\r\n  };\r\n  return (\r\n    <Autocomplete\r\n      id={id || 'base-multi-autocomplete'}\r\n      multiple\r\n      classes={{\r\n        ...classes,\r\n        root: clsx(\r\n          classes.root,\r\n          'multiSelect',\r\n          showShortView ? 'shortView' : undefined,\r\n          !!label ? 'hasLabel' : undefined,\r\n        ),\r\n      }}\r\n      loading={loading}\r\n      options={options ?? []}\r\n      open={open || false}\r\n      onOpen={e => {\r\n        //onOpen && onOpen(e);\r\n        !disableClearable && setOptions(null);\r\n        setSearchTerm(null);\r\n        setOpen(true);\r\n        !!onPickerOpen && onPickerOpen();\r\n      }}\r\n      onClose={(e, r) => {\r\n        //onClose && onClose(e, r);\r\n        setSearchTerm(null);\r\n        setOpen(false);\r\n      }}\r\n      onChange={(e, v, r, d) => {\r\n        setSearchTerm(null);\r\n        setInputValue('');\r\n        setSelected(v.length > 0);\r\n        onChange(v);\r\n      }}\r\n      onInputChange={(event, newValue, reason) => {\r\n        if (reason === 'reset') return;\r\n        setOptions(null);\r\n        setInputValue(newValue);\r\n        if (reason === 'input') setSearchTerm(newValue);\r\n        //onInputChange && onInputChange(event, newValue, reason);\r\n      }}\r\n      getOptionSelected={\r\n        getOptionSelected ?? ((option, value) => option.Id === value.Id)\r\n      }\r\n      getOptionLabel={handleRenderOptionLabel}\r\n      renderTags={handleRenderTags}\r\n      size={size}\r\n      fullWidth={fullWidth}\r\n      disableClearable={disableClearable}\r\n      value={value ?? []}\r\n      inputValue={newInputValue}\r\n      popupIcon={<Icon icon=\"chevron-down\" size=\"xs\" />}\r\n      closeIcon={<Icon icon=\"circle-xmark\" size=\"xs\" />}\r\n      selectOnFocus={isMobile ? false : true}\r\n      renderInput={params => (\r\n        <BaseTextField\r\n          {...params}\r\n          label={label}\r\n          fullWidth={fullWidth}\r\n          size={size}\r\n          variant={variant || 'standard'}\r\n          name={name}\r\n          placeholder={placeholder}\r\n          error={error}\r\n          helperText={helperText}\r\n          required={required}\r\n          inputProps={{\r\n            ...params.inputProps,\r\n            'aria-label': label\r\n              ? undefined\r\n              : `${ariaLabel ? ariaLabel : 'search input'}`,\r\n          }}\r\n          InputLabelProps={{\r\n            classes: { root: 'multiSelect' },\r\n            ...params.InputLabelProps,\r\n          }}\r\n          InputProps={{\r\n            autoFocus: firstOpen,\r\n            classes: {\r\n              root: clsx(\r\n                'multiSelect',\r\n                showShortView ? 'shortView' : undefined,\r\n                !!label ? 'hasLabel' : undefined,\r\n              ),\r\n            },\r\n            ...params.InputProps,\r\n            endAdornment: (\r\n              <React.Fragment>\r\n                {loading ? (\r\n                  <CircularProgress\r\n                    color=\"inherit\"\r\n                    size={params.size === 'small' ? 12 : 16}\r\n                    style={{\r\n                      position: 'absolute',\r\n                      right: 32,\r\n                      top: 'calc(50% - 8px)',\r\n                    }}\r\n                  />\r\n                ) : info ? (\r\n                  <Tooltip\r\n                    arrow\r\n                    title={info}\r\n                    style={{\r\n                      cursor: 'auto',\r\n                      position: 'absolute',\r\n                      top: 'calc(50% - 10.5px)',\r\n                      right: hasSelected ? 52 : 32,\r\n                    }}\r\n                  >\r\n                    <span>\r\n                      <Icon\r\n                        icon=\"info-circle\"\r\n                        color={error ? 'danger' : 'default'}\r\n                        colorExtend=\"textHover\"\r\n                        style={{\r\n                          width: 12,\r\n                          height: 12,\r\n                        }}\r\n                      />\r\n                    </span>\r\n                  </Tooltip>\r\n                ) : null}\r\n                {params.InputProps.endAdornment}\r\n              </React.Fragment>\r\n            ),\r\n            startAdornment: params.InputProps.startAdornment,\r\n          }}\r\n        />\r\n      )}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * MultiSelectBasicPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, EntityType } from 'types/common';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from '../AutocompletePicker';\r\n\r\nexport interface BaseURLPickerProps<T extends EntityType>\r\n  extends Omit<AutocompletePickerProps<T>, 'loadData'> {\r\n  url: string;\r\n  queryfilter?: string | undefined;\r\n}\r\n\r\nexport function BaseURLPicker<T extends EntityType>(\r\n  props: BaseURLPickerProps<T>,\r\n) {\r\n  const { url, queryfilter, ...other } = props;\r\n  const loadData = async (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $top: number; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n      $top: 100,\r\n    };\r\n    const predicates: string[] = [];\r\n    if (queryfilter !== undefined && queryfilter !== '') {\r\n      predicates.push(queryfilter);\r\n    }\r\n    if (searchTerm !== null || predicates.length > 0) {\r\n      params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n        predicates: predicates,\r\n        stringColumns: ['Name'],\r\n        stringSearch: searchTerm ?? undefined,\r\n      }).toString();\r\n    }\r\n    const response = await httpClient.get(url, params);\r\n    return response.value;\r\n  };\r\n  return <AutocompletePicker loadData={loadData} {...other} />;\r\n}\r\n","import { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\n/* --- STATE --- */\r\nexport interface SavedViewState {\r\n  createState: AsyncDataState<SavedViewDetailsState>;\r\n  updateState: AsyncDataState<SavedViewDetailsState>;\r\n  processing: boolean;\r\n  selectedSavedView?: ISavedViewDto;\r\n  savedViewUserName?: string;\r\n  SavedViewExtraData?: SavedViewExtraData;\r\n}\r\nexport interface SavedViewSelected {\r\n  listId: number | undefined;\r\n  ids: string | undefined;\r\n  assetIds: string | undefined;\r\n  multiple: boolean;\r\n}\r\nexport interface SavedViewResponse extends IResponseType {\r\n  Id?: number;\r\n}\r\nexport interface SavedViewDetailsState {\r\n  Id: number;\r\n  Name: string;\r\n  Assets: Entity<number>[];\r\n  Shared?: boolean;\r\n  Multiple?: boolean;\r\n  // SharedTo: Entity<number> | null;\r\n  // SharedUsers: Entity<string>[];\r\n  // SharedCores: Entity<number>[];\r\n}\r\nexport function ConvertEntityToModel(\r\n  entity: ISavedViewDto,\r\n): SavedViewDetailsState | undefined {\r\n  if (!entity) {\r\n    return undefined;\r\n  } else {\r\n    return {\r\n      Id: entity.Id,\r\n      Name: entity.Name,\r\n      Assets: entity.Assets,\r\n      Shared: entity.Shared,\r\n      Multiple: entity.Multiple,\r\n      // SharedTo: getSingleSharedTo(entity.SharedTo),\r\n      // SharedUsers: entity.SharedUsers,\r\n      // SharedCores: entity.SharedCores,\r\n    } as SavedViewDetailsState;\r\n  }\r\n}\r\nexport function ConvertModelToEntity(\r\n  model: SavedViewDetailsState,\r\n  original: SavedViewDetailsState | undefined,\r\n): ISavedViewDto {\r\n  let entity = {\r\n    Id: original?.Id === undefined ? model.Id : original.Id,\r\n    Name: model.Name,\r\n    Shared: model.Shared,\r\n    Multiple: model.Multiple,\r\n    Assets: model.Assets,\r\n    // SharedTo: model.SharedTo?.Id ?? 0,\r\n    // SharedUsers: model.SharedUsers as IUserFilterDto[],\r\n    // SharedCores: model.SharedCores as IServiceGroupDto[],\r\n  } as ISavedViewDto;\r\n  return entity;\r\n}\r\n\r\nexport function GetExtraData(model: ISavedViewDto): SavedViewExtraData {\r\n  return {\r\n    userName: model.UserNameDisplay,\r\n    createdAt: model.CreatedAt,\r\n    usages: model.UsageCount,\r\n  };\r\n}\r\n\r\nexport interface SavedViewExtraData {\r\n  userName: string;\r\n  createdAt: Date | null;\r\n  usages: number;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest, select } from 'redux-saga/effects';\r\nimport { savedViewActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport {\r\n  ConvertModelToEntity,\r\n  SavedViewDetailsState,\r\n  SavedViewResponse,\r\n} from './types';\r\nimport { savedViewsApi as api, savedViewsApi } from 'api/savedViewsApi';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { SavedViewDetailsProps } from '../Details';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { Entity } from 'types/common';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\n\r\nconst loadNew = async (eid?: string): Promise<SavedViewDetailsState> => {\r\n  if (!!eid && eid !== '') {\r\n    return initAssetsData(eid, true).then(data => {\r\n      return {\r\n        Id: -1,\r\n        Name: '',\r\n        Assets: data,\r\n        Shared: false,\r\n        Multiple: false,\r\n        // SharedTo: null,\r\n        // SharedUsers: [] as Entity<string>[],\r\n        // SharedCores: [] as Entity<number>[],\r\n      } as SavedViewDetailsState;\r\n    });\r\n  } else {\r\n    return new Promise<SavedViewDetailsState>(resolve => {\r\n      resolve({\r\n        Id: -1,\r\n        Name: '',\r\n        Assets: [] as Entity<number>[],\r\n        Shared: false,\r\n        Multiple: false,\r\n        // SharedTo: null,\r\n        // SharedUsers: [] as Entity<string>[],\r\n        // SharedCores: [] as Entity<number>[],\r\n      } as SavedViewDetailsState);\r\n    });\r\n  }\r\n};\r\n\r\nfunction* doInitNewDetails(action: PayloadAction<string | undefined>) {\r\n  try {\r\n    const data = yield call(loadNew, action.payload);\r\n    yield put(actions.initNewDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initNewDetails_Error(Error));\r\n  }\r\n}\r\nfunction* doInitDetails(action: PayloadAction<number>) {\r\n  try {\r\n    const data = yield call(api.initUpdateData, action.payload);\r\n    console.log(data);\r\n    yield put(actions.initDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initDetails_Error(Error));\r\n  }\r\n}\r\nfunction* doCreate(action: PayloadAction<SavedViewDetailsState>) {\r\n  const httpPayload: ISavedViewDto = ConvertModelToEntity(\r\n    action.payload,\r\n    undefined,\r\n  );\r\n  try {\r\n    let responses: SavedViewResponse[] = [];\r\n    const result = yield call(api.createSavedView, httpPayload);\r\n    responses.push(result);\r\n\r\n    let responseErrors = responses\r\n      .filter(err => err.ErrorMessages.length > 0)\r\n      .flatMap(f => f.ErrorMessages);\r\n\r\n    let responseWarnings = responses\r\n      .filter(err => err.WarningMessages.length > 0)\r\n      .flatMap(f => f.WarningMessages);\r\n    let responseSuccess = responses\r\n      .filter(err => err.SuccessMessages.length > 0)\r\n      .flatMap(f => f.SuccessMessages);\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: 'savedViewInsert',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (responseWarnings.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseWarnings.map(item => {\r\n            return {\r\n              key: 'savedViewInsert',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (responseSuccess.length > 0) {\r\n      let res = responses[0];\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'savedViewInsert',\r\n          message: responseSuccess[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: res.Id,\r\n            created: true,\r\n            itemName: i18next.t(translations.MyInstrumentList),\r\n            detailsType: RenderPageType.SavedViewDetails,\r\n            detailsTypeProps: {\r\n              id: '' + res.Id,\r\n              useSidePanel: true,\r\n            } as SavedViewDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors =\r\n      responses.filter(f => f.ErrorMessages.length > 0).length > 0;\r\n    yield put(\r\n      actions.createView_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'savedViewInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createView_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: SavedViewDetailsState;\r\n    original: SavedViewDetailsState | undefined;\r\n  }>,\r\n) {\r\n  const httpPayload: ISavedViewDto = ConvertModelToEntity(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n  // const currentSelected = yield select(selectMyListSelected);\r\n  // const userProfileSettings = yield select(selectUserProfileSettings);\r\n  // let listViewSelected = currentSelected;\r\n  // if (!listViewSelected) {\r\n  //   let proffSettings = userProfileSettings.GetSettingValueBy(\r\n  //     f => f.Key.toLowerCase() === 'myListSelected'.toLowerCase(),\r\n  //   );\r\n  //   listViewSelected = !!proffSettings\r\n  //     ? {\r\n  //         listId:\r\n  //           proffSettings.Name === null\r\n  //             ? undefined\r\n  //             : parseInt(proffSettings.Name),\r\n  //         ids: proffSettings.Value ?? undefined,\r\n  //         assetIds: proffSettings.DefaultGroups ?? undefined,\r\n  //       }\r\n  //     : undefined;\r\n  // }\r\n  try {\r\n    const results = yield call(api.updateSavedView, httpPayload);\r\n    let response = results as SavedViewResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'savedViewUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'savedViewUpdateWarn',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'savedViewUpdate',\r\n          message: response.SuccessMessages[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: response.Id,\r\n            created: false,\r\n            itemName: i18next.t(translations.MyInstrumentList),\r\n            detailsType: RenderPageType.SavedViewDetails,\r\n            detailsTypeProps: {\r\n              id: '' + response.Id,\r\n              useSidePanel: true,\r\n            } as SavedViewDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      // if (!!listViewSelected && !!listViewSelected.listId) {\r\n      //   if (listViewSelected.listId === action.payload.original?.Id) {\r\n      //     yield call(doSelectView, {\r\n      //       payload: httpPayload,\r\n      //       type: actions.selectMyList.type,\r\n      //     });\r\n      //   }\r\n      // }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateView_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'savedViewUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateView_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdateViewAssets(\r\n  action: PayloadAction<{ assets: Entity<number>[]; view: ISavedViewDto }>,\r\n) {\r\n  const newAssets: Entity<number>[] = [];\r\n  // const currentSelected = yield select(selectMyListSelected);\r\n  // const userProfileSettings = yield select(selectUserProfileSettings);\r\n  // let listViewSelected = currentSelected;\r\n  // if (!listViewSelected) {\r\n  //   let proffSettings = userProfileSettings.GetSettingValueBy(\r\n  //     f => f.Key.toLowerCase() === 'myListSelected'.toLowerCase(),\r\n  //   );\r\n  //   listViewSelected = !!proffSettings\r\n  //     ? {\r\n  //         listId:\r\n  //           proffSettings.Name === null\r\n  //             ? undefined\r\n  //             : parseInt(proffSettings.Name),\r\n  //         ids: proffSettings.Value ?? undefined,\r\n  //         assetIds: proffSettings.DefaultGroups ?? undefined,\r\n  //       }\r\n  //     : undefined;\r\n  // }\r\n  action.payload.assets.forEach(el => {\r\n    let a = action.payload.view.Assets.find(a => a.Id === el.Id);\r\n    if (a === undefined) {\r\n      newAssets.push(el);\r\n    }\r\n  });\r\n  let groupId = (newAssets[0] as IAssetDto).ServiceGroupId;\r\n  const shared =\r\n    action.payload.view.Shared === true\r\n      ? !newAssets.some(f => (f as IAssetDto).ServiceGroupId !== groupId)\r\n      : false;\r\n  const httpPayload: ISavedViewDto = Object.assign({}, action.payload.view, {\r\n    Assets: newAssets.concat(action.payload.view.Assets),\r\n    Shared: shared,\r\n  });\r\n\r\n  try {\r\n    const results = yield call(api.updateSavedView, httpPayload);\r\n    let response = results as SavedViewResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'savedViewUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'savedViewUpdateWarn',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'savedViewUpdate',\r\n          message: response.SuccessMessages[0],\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      // if (!!listViewSelected && !!listViewSelected.listId) {\r\n      //   if (listViewSelected.listId === action.payload.view.Id) {\r\n      //     yield call(doSelectView, {\r\n      //       payload: httpPayload,\r\n      //       type: actions.selectMyList.type,\r\n      //     });\r\n      //   }\r\n      // }\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateViewAssets_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'savedViewUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateViewAssets_Error(Error));\r\n  }\r\n}\r\nfunction* doSelectSavedView(action: PayloadAction<number | undefined>) {\r\n  try {\r\n    if (action.payload === undefined) {\r\n      yield put(actions.selectSavedView_Success());\r\n      return;\r\n    }\r\n\r\n    const x: ISavedViewDto = yield call(\r\n      savedViewsApi.initUpdateData,\r\n      action.payload,\r\n    );\r\n    // check if the saved view belongs to current service groups selection\r\n    const serviceGroups: Array<Entity<number>> | undefined = yield select(\r\n      selectGlobalServiceGroupFilter,\r\n    );\r\n    const serviceGroupIds = serviceGroups?.map(f => f.Id);\r\n    const belongsToServiceGroupsSelection =\r\n      serviceGroups === undefined ||\r\n      serviceGroups?.length === 0 ||\r\n      x.Assets.every(\r\n        asset => serviceGroupIds?.includes(asset.ServiceGroupId ?? 0) === true,\r\n      );\r\n    if (belongsToServiceGroupsSelection) {\r\n      yield put(actions.selectSavedView_Success(x));\r\n    } else {\r\n      yield put(actions.selectSavedView_Success());\r\n    }\r\n  } catch (error) {\r\n    yield put(actions.selectSavedView_Success());\r\n  }\r\n}\r\nfunction* doPatch(action: PayloadAction<Partial<ISavedViewDto>>) {\r\n  try {\r\n    yield call(savedViewsApi.patch, action.payload);\r\n    yield put(actions.patch_success(action.payload));\r\n  } catch (error) {\r\n    //noop\r\n    console.log(error);\r\n  }\r\n}\r\n\r\nfunction* doUseSavedView(action: PayloadAction<number | undefined>) {\r\n  try {\r\n    const res = yield call(api.useSavedView, action.payload);\r\n    if (!res) return;\r\n    yield put(actions.useSavedView_success(res.value));\r\n  } catch (error) {}\r\n}\r\n\r\nexport function* savedViewSaga() {\r\n  yield takeLatest(actions.initNewDetails.type, doInitNewDetails);\r\n  yield takeLatest(actions.initDetails.type, doInitDetails);\r\n  yield takeLatest(actions.createView.type, doCreate);\r\n  yield takeLatest(actions.updateView.type, doUpdate);\r\n  yield takeLatest(actions.updateViewAssets.type, doUpdateViewAssets);\r\n  yield takeLatest(actions.selectSavedView.type, doSelectSavedView);\r\n  yield takeLatest(actions.patch.type, doPatch);\r\n  yield takeLatest(actions.useSavedView.type, doUseSavedView);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { Entity } from 'types/common';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { savedViewSaga } from './saga';\r\nimport {\r\n  ConvertEntityToModel,\r\n  GetExtraData,\r\n  SavedViewDetailsState,\r\n  SavedViewState,\r\n} from './types';\r\n\r\nexport const initialState: SavedViewState = {\r\n  processing: false,\r\n  createState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  updateState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'savedView',\r\n  initialState,\r\n  reducers: {\r\n    initNewDetails(state, action: PayloadAction<string | undefined>) {\r\n      state.processing = true;\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initNewDetails_Success(\r\n      state,\r\n      action: PayloadAction<SavedViewDetailsState>,\r\n    ) {\r\n      state.processing = false;\r\n      state.createState.data = action.payload;\r\n    },\r\n    initNewDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n      state.createState.data = {\r\n        Id: -1,\r\n        Name: '',\r\n        Assets: [] as Entity<number>[],\r\n        Shared: false,\r\n        Multiple: false,\r\n        // SharedTo: null,\r\n        // SharedUsers: [] as Entity<string>[],\r\n        // SharedCores: [] as Entity<number>[],\r\n      } as SavedViewDetailsState;\r\n    },\r\n    initDetails(state, action: PayloadAction<number>) {\r\n      state.processing = true;\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initDetails_Success(state, action: PayloadAction<ISavedViewDto>) {\r\n      state.processing = false;\r\n      state.updateState.data = ConvertEntityToModel(action.payload);\r\n      state.savedViewUserName = action.payload?.UserName;\r\n      state.SavedViewExtraData = GetExtraData(action.payload);\r\n    },\r\n    initDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    createView(state, action: PayloadAction<SavedViewDetailsState>) {\r\n      state.createState.processing = true;\r\n      state.createState.completed = undefined;\r\n      state.createState.hasErrors = undefined;\r\n    },\r\n    createView_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.createState.processing = false;\r\n      state.createState.hasErrors = action.payload.hasErrors;\r\n      state.createState.completed = true;\r\n    },\r\n    createView_Error(state, action: PayloadAction<any>) {\r\n      state.createState.processing = false;\r\n      state.createState.completed = true;\r\n      state.createState.hasErrors = true;\r\n    },\r\n    updateView(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: SavedViewDetailsState;\r\n        original: SavedViewDetailsState | undefined;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateView_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.hasErrors = action.payload.hasErrors;\r\n      state.updateState.completed = true;\r\n    },\r\n    updateView_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      state.updateState.hasErrors = true;\r\n    },\r\n    updateViewAssets(\r\n      state,\r\n      action: PayloadAction<{ assets: Entity<number>[]; view: ISavedViewDto }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateViewAssets_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.hasErrors = action.payload.hasErrors;\r\n      state.updateState.completed = true;\r\n    },\r\n    updateViewAssets_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      state.updateState.hasErrors = true;\r\n    },\r\n    resetCreateSavedViewState(state, action: PayloadAction) {\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    resetUpdateSavedViewState(state, action: PayloadAction) {\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    selectMyList(state, action: PayloadAction<ISavedViewDto | undefined>) {},\r\n\r\n    selectSavedView(state, action: PayloadAction<number | undefined>) {\r\n      state.selectedSavedView = undefined;\r\n    },\r\n    selectSavedView_Success(\r\n      state,\r\n      action: PayloadAction<ISavedViewDto | undefined>,\r\n    ) {\r\n      state.selectedSavedView = action.payload;\r\n    },\r\n    selectSavedView_Error(state, action: PayloadAction<string>) {\r\n      state.selectedSavedView = undefined;\r\n    },\r\n    patch(state, action: PayloadAction<Partial<ISavedViewDto>>) {},\r\n    patch_success(state, action: PayloadAction<Partial<ISavedViewDto>>) {\r\n      state.selectedSavedView = Object.assign(\r\n        state.selectedSavedView,\r\n        action.payload,\r\n      );\r\n    },\r\n    useSavedView(state, action: PayloadAction<number | undefined>) {},\r\n    useSavedView_success(state, action: PayloadAction<number>) {\r\n      if (state.SavedViewExtraData?.usages !== undefined) {\r\n        state.SavedViewExtraData.usages = action.payload;\r\n      }\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: savedViewActions } = slice;\r\n\r\nexport const useSavedViewSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: savedViewSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useSavedViewSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import {\r\n  SendEmailOnOffline,\r\n  WorkOrderQueryStringParameters,\r\n} from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { httpClient } from './HttpClient';\r\nimport { IWorkOrderDetailsDto } from './odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\n\r\nexport const WorkOrderApi = {\r\n  initCreateData: (payload: WorkOrderQueryStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/workorders/InitWorkOrder`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  initUpdateData: (payload: WorkOrderQueryStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/workorders/InitWorkOrder`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertWorkOrder: (payload: IWorkOrderDetailsDto) => {\r\n    const url = `/api/odata/v4/workorders`;\r\n    return httpClient.post(url, payload);\r\n  },\r\n  updateWorkOrder: (payload: IWorkOrderDetailsDto) => {\r\n    const url = `/api/odata/v4/workorders(${payload.Id})`;\r\n    return httpClient.put(url, payload);\r\n  },\r\n  sendEmailOnOffline: (payload: SendEmailOnOffline) => {\r\n    const data = {\r\n      offData: payload,\r\n    };\r\n    console.debug('offlinedata', payload);\r\n    const url = `/api/odata/v4/workorders/SendEmailOnResOffline`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  getNewWorkOrderStatus: (payload: number) => {\r\n    const url = '/api/odata/v4/WorkOrderStatus';\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Order asc',\r\n      $filter: `(WorkOrderTypeId eq  ${payload} and New eq true)`,\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient.get(url, params).then(response => response.value);\r\n  },\r\n  deleteOrders: (payload: { Id: number; all: boolean | null }) => {\r\n    const url = '/api/odata/v4/WorkOrders/DeleteWorkOrder';\r\n    return httpClient.post(url, payload);\r\n  },\r\n  DowntimeOrders: (payload: number[]) => {\r\n    const filters = (assetIds: number[]) => {\r\n      const predicates: string | Condition<IWorkOrderDetailsDto>[] = [];\r\n      let foo: string | undefined = undefined;\r\n      if (assetIds.length > 0) {\r\n        let ids = assetIds.map(item => {\r\n          return { Id: item };\r\n        }) as Identifiable<number>[];\r\n        let nowDate = new CustomDate(new Date(), 'complete');\r\n        predicates.push(new Condition('AssetId', ODataOperators.Includes, ids));\r\n        predicates.push(\r\n          new Condition('OfflineEventStart', ODataOperators.LessThan, nowDate),\r\n        );\r\n        predicates.push(\r\n          new Condition('OfflineEventEnd', ODataOperators.GreaterThan, nowDate),\r\n        );\r\n        predicates.push(\r\n          new Condition<IWorkOrderDetailsDto>(\r\n            'DoneDate',\r\n            ODataOperators.Equals,\r\n            null,\r\n          ),\r\n        );\r\n        predicates.push(\r\n          new Condition<IWorkOrderDetailsDto>(\r\n            'WorkingHoursId',\r\n            ODataOperators.NotEquals,\r\n            null,\r\n          ),\r\n        );\r\n        predicates.push(\r\n          new Condition<IWorkOrderDetailsDto>(\r\n            'IsClosed',\r\n            ODataOperators.Equals,\r\n            false,\r\n          ),\r\n        );\r\n        foo = predicates.map(f => f.toString()).join(' and ');\r\n      }\r\n      return foo;\r\n    };\r\n    const url = '/api/odata/v4/WorkOrders';\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n    } = {\r\n      $orderby: 'Id asc',\r\n      $filter: filters(payload),\r\n    };\r\n    return httpClient.get(url, params).then(response => response.value);\r\n  },\r\n  removefromLinks: (id: number) => {\r\n    const url = '/api/odata/v4/workorders/RemoveFromLinks';\r\n    const params = { linkedId: id };\r\n    return httpClient.post(url, params).then(v => v.value);\r\n  },\r\n  addToLinked: (data: { id: number; link: number }) => {\r\n    const params = { params: { Id: data.id, Link: data.link } };\r\n    const url = '/api/odata/v4/workorders/AddToLinked';\r\n    return httpClient.post(url, params);\r\n  },\r\n  removeLinkedCalibration: (data: { id: number; link: number }) => {\r\n    const url = '/api/odata/v4/workorders/RemoveLinkedCalibr';\r\n    const params = { params: { Id: data.id, Link: data.link } };\r\n    return httpClient.post(url, params);\r\n  },\r\n  addLinkedToCalibration: (data: { id: number; link: number }) => {\r\n    const params = { params: { Id: data.id, Link: data.link } };\r\n    const url = '/api/odata/v4/workorders/AddLinkedCalibr';\r\n    return httpClient.post(url, params);\r\n  },\r\n  getLinkedToCalibration: (id: number) => {\r\n    const params = { key: id };\r\n    const url = '/api/odata/v4/workorders/InitLinkedCalibrations';\r\n    return httpClient.post(url, params);\r\n  },\r\n  getOverlappingDowntimes: (id: number) => {\r\n    const params = { id: id };\r\n    const url = '/api/odata/v4/workorders/GetOverlappingDowntimes';\r\n    return httpClient.post(url, params);\r\n  },\r\n  updateWorkOrdersStatus: (\r\n    rows: IWorkOrderDetailsDto[],\r\n    workOrderStatus: Entity<number> | null,\r\n  ) => {\r\n    const workOrdersIds: number[] = rows.map(item => item.Id);\r\n    const statusId: number = !!workOrderStatus ? workOrderStatus?.Id : 0;\r\n    const data = { workOrdersIds, statusId };\r\n    const url = '/api/odata/v4/WorkOrderStatus/UpdateWorkOrdersStatus';\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","export enum EmptySlotAdminClick {\r\n  WhatToAdd = 0,\r\n  ReservationsOnly = 1,\r\n  DownTimeOnly = 2,\r\n}\r\n","import * as React from 'react';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nexport interface IUseProfileProps {\r\n  profileSettingKey: string;\r\n}\r\nexport const useProfileSetting = (\r\n  props: IUseProfileProps,\r\n): {\r\n  savedValue: string | undefined;\r\n  updateValue: (value: string) => void;\r\n  savedEnabled: boolean | undefined;\r\n  updateEnabled: (enabled: boolean) => void;\r\n} => {\r\n  const { actions } = useAppSettingsSlice();\r\n  const dispatch = useDispatch();\r\n  const userProfileSettings = useSelector(selectUserProfileSettings);\r\n  const key = props.profileSettingKey.toLowerCase();\r\n  const userProfileSetting = userProfileSettings.GetSettingValueBy(\r\n    f => f.Key.toLowerCase() === key,\r\n  );\r\n\r\n  const savedValue = userProfileSetting?.Value ?? undefined;\r\n  const savedEnabled = userProfileSetting?.Enabled ?? undefined;\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n  const updateValue = React.useCallback(\r\n    (value: string) => {\r\n      if (authenticatedUser === undefined) {\r\n        return;\r\n      }\r\n      dispatch(\r\n        actions.saveUserProfileSetting({\r\n          Key: props.profileSettingKey,\r\n          Value: value,\r\n          UserName: authenticatedUser?.Id,\r\n          Enabled: true,\r\n        }),\r\n      );\r\n    },\r\n    [actions, authenticatedUser, dispatch, props.profileSettingKey],\r\n  );\r\n  const updateEnabled = React.useCallback(\r\n    (value: boolean) => {\r\n      if (authenticatedUser === undefined) {\r\n        return;\r\n      }\r\n      if (value === savedEnabled) {\r\n        return;\r\n      }\r\n      dispatch(\r\n        actions.saveUserProfileSetting({\r\n          Key: props.profileSettingKey,\r\n          Value: savedValue || null,\r\n          UserName: authenticatedUser?.Id,\r\n          Enabled: value,\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      actions,\r\n      authenticatedUser,\r\n      dispatch,\r\n      props.profileSettingKey,\r\n      savedEnabled,\r\n      savedValue,\r\n    ],\r\n  );\r\n  return { savedValue, updateValue, savedEnabled, updateEnabled };\r\n};\r\n","import { useDispatch } from 'react-redux';\r\nimport { useLargeFilesUploadSlice } from '../slice';\r\nimport { useCallback } from 'react';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const useUploadToNewComment = () => {\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const onCommentAdded = useCallback(\r\n    (comment: Identifiable<number>) => {\r\n      dispatch(largeFileActions.setCanUpload(comment.Id));\r\n    },\r\n    [dispatch, largeFileActions],\r\n  );\r\n  return { onCommentAdded };\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { SwitchProps } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { BasicToggle } from '../BasicToggle';\r\n\r\nexport interface FormSwitchProps extends SwitchProps {\r\n  label?: string;\r\n  helperText?: string;\r\n  boldLebel?: boolean;\r\n  maxLabelWidth?: string | number;\r\n  boxed?: boolean;\r\n}\r\nexport const FormSwitch = ({\r\n  label,\r\n  name,\r\n  onBlur,\r\n  onChange,\r\n  boldLebel,\r\n  maxLabelWidth,\r\n  ...props\r\n}: FormSwitchProps & FieldHookConfig<boolean> & IFieldProps) => {\r\n  const [field, meta] = useField<boolean>({ name, ...props });\r\n  const handleChange = (value, event) => {\r\n    if (onChange !== undefined) {\r\n      onChange(event);\r\n    }\r\n    field.onChange(event);\r\n  };\r\n  return (\r\n    <BasicToggle\r\n      error={meta?.error}\r\n      boldLabel={boldLebel}\r\n      label={label}\r\n      info={props.info}\r\n      name={name}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      checked={field.value ?? false}\r\n      maxLabelWidth={maxLabelWidth}\r\n      boxed={props.boxed}\r\n      size={props.size}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.savedView || initialState;\r\n\r\nexport const selectSavedView = createSelector([selectSlice], state => state);\r\n\r\nexport const selectSavedViewProcessing = createSelector(\r\n  [selectSavedView],\r\n  state => state.processing,\r\n);\r\nexport const selectCreateSavedViewProcessing = createSelector(\r\n  [selectSavedView],\r\n  state => state.createState.processing,\r\n);\r\nexport const selectUpdateSavedViewProcessing = createSelector(\r\n  [selectSavedView],\r\n  state => state.updateState.processing,\r\n);\r\nexport const selectCreateSavedView = createSelector(\r\n  [selectSavedView],\r\n  state => state.createState.data,\r\n);\r\nexport const selectUpdateSavedView = createSelector(\r\n  [selectSavedView],\r\n  state => state.updateState.data,\r\n);\r\nexport const selectUpdateUserName = createSelector(\r\n  [selectSavedView],\r\n  state => state.savedViewUserName,\r\n);\r\nexport const selectExtraData = createSelector(\r\n  [selectSavedView],\r\n  state => state.SavedViewExtraData,\r\n);\r\nexport const selectCreateSavedViewCompleted = createSelector(\r\n  [selectSavedView],\r\n  state => state.createState.completed,\r\n);\r\nexport const selectUpdateSavedViewCompleted = createSelector(\r\n  [selectSavedView],\r\n  state => state.updateState.completed,\r\n);\r\nexport const selectCreateSavedViewHasError = createSelector(\r\n  [selectSavedView],\r\n  state => state.createState.hasErrors,\r\n);\r\nexport const selectUpdateSavedViewHasError = createSelector(\r\n  [selectSavedView],\r\n  state => state.updateState.hasErrors,\r\n);\r\nexport const selectSelectedSavedView = createSelector(\r\n  [selectSavedView],\r\n  state => state.selectedSavedView,\r\n);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { BookitDatePickerProps } from 'app/components/BookitDatePicker';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\nimport { BookitDateTimePicker } from 'app/components/BookitDatePicker/BookitDateTimePicker';\r\n\r\n/**\r\n * TODO:\r\n * A non-serializable value was detected in an action, in the path: `payload.ReceivedAt`. Value: \r\nDate Sun May 02 2021 14:58:00 GMT+0300 (Israel Daylight Time)\r\n \r\nTake a look at the logic that dispatched this action:  \r\nObject { type: \"animals/insertItem\", payload: {…} }\r\n \r\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string…t-least-serializable-why-should-my-action-types-be-constants) \r\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\r\n * */\r\n\r\nexport const FormBookitDateTimePicker = ({\r\n  label,\r\n  disableFuture,\r\n  disablePast,\r\n  ...props\r\n}: FieldHookConfig<Date | null> &\r\n  Pick<\r\n    BookitDatePickerProps,\r\n    | 'endTime'\r\n    | 'truncateTime'\r\n    | 'minDate'\r\n    | 'maxDate'\r\n    | 'labelFunc'\r\n    | 'clearable'\r\n    | 'fullScreen'\r\n    | 'minutesStep'\r\n    | 'dateLabel'\r\n    | 'timeLabel'\r\n    | 'maskIfEmpty'\r\n    | 'saveOnSelect'\r\n  > & { labelInline?: boolean } & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Date | null>(props);\r\n  return (\r\n    <BookitDateTimePicker\r\n      id={props.id}\r\n      name={props.name}\r\n      disableFuture={disableFuture}\r\n      disablePast={disablePast}\r\n      label={label}\r\n      labelInline={props.labelInline}\r\n      inputVariant=\"filled\"\r\n      maskIfEmpty={props.maskIfEmpty}\r\n      saveOnSelect={props.saveOnSelect}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      fullWidth={true}\r\n      helperText={meta.error}\r\n      dateLabel={props.dateLabel}\r\n      timeLabel={props.timeLabel}\r\n      labelFunc={props.labelFunc}\r\n      info={props.info}\r\n      disabled={props.disabled}\r\n      clearable={props.clearable}\r\n      fullScreen={props.fullScreen}\r\n      endTime={props.endTime}\r\n      truncateTime={props.truncateTime}\r\n      autoFocus={props.autoFocus}\r\n      minDate={props.minDate}\r\n      maxDate={props.maxDate}\r\n      minutesStep={props.minutesStep || 15}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * ExtraDDLFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { ExtraDDLPicker } from 'app/components/pickers/AutocompletePickers/ExtraddlPicker';\r\n\r\nexport const ExtraDDLFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      <ExtraDDLPicker\r\n        ariaLabel={props.label}\r\n        id={props.id}\r\n        value={props.value}\r\n        onChange={handleOnChange}\r\n        isOpen={props.open}\r\n        placeholder={t(translations.AllValues)}\r\n        predicates={props.predicates}\r\n        onPickerOpen={props.onOpen}\r\n        size=\"small\"\r\n        urlType={props.urlType}\r\n      />\r\n    </>\r\n  );\r\n};\r\nexport default ExtraDDLFilter;\r\n","import { CircularProgress } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n  Autocomplete,\r\n  AutocompleteGetTagProps,\r\n  AutocompleteProps,\r\n  AutocompleteRenderOptionState,\r\n} from '@material-ui/lab';\r\nimport { BookitChip, BookitChipWithInfo } from 'app/components/BasicChip';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport React from 'react';\r\nimport { CSSProperties } from 'styled-components';\r\nimport { autocompleteStyles } from 'styles/MUIExtend/autocompleteStyles';\r\nimport { EntityType } from 'types/common';\r\nimport clsx from 'clsx';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n  ColoredOption,\r\n  extractDataFromResponse,\r\n  IDisableable,\r\n  InfoOption,\r\n  loadDataAndPrepareOptions,\r\n  NonRemoveableOption,\r\n  NonSelectableOption,\r\n  OptionType,\r\n} from '../Utils/autoCompletePickerUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\n\r\nexport interface AutocompleteMultiPickerExProps<TEntity extends EntityType>\r\n  extends Omit<\r\n    AutocompleteProps<OptionType<TEntity>, true, boolean | undefined, false>,\r\n    | 'multiple'\r\n    | 'loading'\r\n    | 'open'\r\n    | 'options'\r\n    | 'renderInput'\r\n    | 'onChange'\r\n    | 'classes'\r\n    | 'renderTags'\r\n    | 'renderOptionLabel'\r\n    | 'renderOptions'\r\n  > {\r\n  value?: TEntity[];\r\n  label?: string;\r\n  loadData: (\r\n    searchTerm: string | null,\r\n    predicates?: (string | Condition<TEntity>)[],\r\n    expandedColumns?: string,\r\n  ) => Promise<TEntity[] | { value: TEntity[]; more: boolean }>;\r\n  size?: 'medium' | 'small';\r\n  mini?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  isOpen?: boolean;\r\n  style?: CSSProperties;\r\n  name?: string;\r\n  placeholder?: string;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  onChange?: (value: TEntity[]) => void;\r\n  required?: boolean;\r\n  info?: string;\r\n  id?: string;\r\n  renderTags?: (\r\n    value: TEntity[],\r\n    getTagProps: AutocompleteGetTagProps,\r\n  ) => React.ReactNode | undefined;\r\n  renderOptionLabel?: (value: TEntity) => string | undefined;\r\n  renderOptions?: (\r\n    option: TEntity,\r\n    state: AutocompleteRenderOptionState,\r\n  ) => React.ReactNode | undefined;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  onChipClick?: (chip: TEntity) => void;\r\n  ariaLabel?: string;\r\n  predicates?: (string | Condition<TEntity>)[];\r\n  additionalItem?: TEntity | null;\r\n  expandedColumns?: string;\r\n  onPickerOpen?: () => void;\r\n}\r\n\r\n/**\r\n * A copy of AutocompleteMultiPicker with addition of limiting the length of options shown\r\n * TODO: merge with AutocompleteMultiPicker + apply to BaseURLMultiPicker\r\n */\r\nexport function AutocompleteMultiPickerEx<TEntity extends EntityType>({\r\n  isOpen,\r\n  size,\r\n  mini,\r\n  onOpen,\r\n  onClose,\r\n  label,\r\n  fullWidth,\r\n  variant,\r\n  name,\r\n  placeholder,\r\n  error,\r\n  helperText,\r\n  required,\r\n  renderTags,\r\n  loadData,\r\n  disableClearable,\r\n  onChange,\r\n  onInputChange,\r\n  getOptionSelected,\r\n  getOptionLabel,\r\n  renderOptionLabel,\r\n  renderOptions,\r\n  onBlur,\r\n  value,\r\n  defaultValue,\r\n  info,\r\n  id,\r\n  onChipClick,\r\n  ariaLabel,\r\n  predicates,\r\n  additionalItem,\r\n  expandedColumns,\r\n  onPickerOpen,\r\n  ...props\r\n}: AutocompleteMultiPickerExProps<TEntity>) {\r\n  const { t } = useTranslation();\r\n  const classes = autocompleteStyles();\r\n  let firstOpen = isOpen;\r\n  const [open, setOpen] = React.useState(firstOpen);\r\n  const [options, setOptions] = React.useState<OptionType<TEntity>[] | null>(\r\n    null,\r\n  );\r\n  const [searchTerm, setSearchTerm] = React.useState<string | null>(null);\r\n  const [hasSelected, setSelected] = React.useState(\r\n    defaultValue && defaultValue.length > 0,\r\n  );\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n  const loading = open && options === null;\r\n  useEffectOnMount(() => {\r\n    setSelected((value || []).length > 0);\r\n  });\r\n  React.useEffect(() => {\r\n    let active = true;\r\n    if (!loading) return undefined;\r\n\r\n    (async () => {\r\n      try {\r\n        const rawResponse = await loadData(\r\n          searchTerm,\r\n          predicates,\r\n          expandedColumns,\r\n        );\r\n        const response = extractDataFromResponse(rawResponse);\r\n        const optionsData = loadDataAndPrepareOptions({\r\n          response,\r\n          additionalItem,\r\n          t,\r\n        });\r\n        active && setOptions(optionsData);\r\n      } catch {}\r\n    })();\r\n\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    loading,\r\n    loadData,\r\n    searchTerm,\r\n    t,\r\n    predicates,\r\n    additionalItem,\r\n    expandedColumns,\r\n  ]);\r\n\r\n  React.useEffect(() => {\r\n    if (!open) setOptions(null);\r\n  }, [open]);\r\n\r\n  const handleRenderTags = (\r\n    value: OptionType<TEntity>[],\r\n    getTagProps: AutocompleteGetTagProps,\r\n  ) => {\r\n    const selectable = value.filter(\r\n      option => (option as NonSelectableOption)?.disabled !== true,\r\n    );\r\n    if (renderTags === undefined) {\r\n      return selectable.map((option: OptionType<TEntity>, index: number) =>\r\n        !!(option as InfoOption).titleInfo ? (\r\n          <BookitChipWithInfo\r\n            onClick={() => onChipClick?.(option as TEntity)}\r\n            variant=\"default\"\r\n            size=\"small\"\r\n            label={option.Name}\r\n            custombgcolor={\r\n              undefinedIfIsEmpty((option as ColoredOption)?.Color) ?? undefined\r\n            }\r\n            info={(option as InfoOption).titleInfo}\r\n            notremoved={(option as NonRemoveableOption)?.noremoved}\r\n            {...getTagProps({ index })}\r\n          />\r\n        ) : (\r\n          <BookitChip\r\n            onClick={() => onChipClick?.(option as TEntity)}\r\n            variant=\"default\"\r\n            size=\"small\"\r\n            label={option.Name}\r\n            custombgcolor={\r\n              undefinedIfIsEmpty((option as ColoredOption)?.Color) ?? undefined\r\n            }\r\n            notremoved={(option as NonRemoveableOption)?.noremoved}\r\n            {...getTagProps({ index })}\r\n          />\r\n        ),\r\n      );\r\n    } else {\r\n      return renderTags(selectable as TEntity[], getTagProps);\r\n    }\r\n  };\r\n  const handleRenderOptionLabel = (option: OptionType<TEntity>) => {\r\n    return renderOptionLabel === undefined\r\n      ? option.Name\r\n      : (renderOptionLabel(option as TEntity) as string);\r\n  };\r\n  const getIsOptionSelected_Internal = (\r\n    option: OptionType<TEntity>,\r\n    value: OptionType<TEntity>,\r\n  ) => {\r\n    if ((option as NonSelectableOption).disabled !== undefined) {\r\n      return false;\r\n    }\r\n    var id = (option as TEntity)?.Id;\r\n    var selectable = id !== undefined;\r\n\r\n    if (!selectable) {\r\n      return false;\r\n    } else if (getOptionSelected !== undefined) {\r\n      return getOptionSelected(option as TEntity, value as TEntity);\r\n    } else {\r\n      return id === (value as TEntity)?.Id;\r\n    }\r\n  };\r\n  const getOptionDisabled = (option: OptionType<TEntity>) =>\r\n    (option as IDisableable)?.disabled ?? false;\r\n\r\n  return (\r\n    <Autocomplete\r\n      id={id || 'base-multi-autocomplete'}\r\n      multiple={true}\r\n      classes={{\r\n        ...classes,\r\n        root: clsx(\r\n          classes.root,\r\n          'multiSelect',\r\n          showShortView ? 'shortView' : undefined,\r\n          !!label ? 'hasLabel' : undefined,\r\n        ),\r\n      }}\r\n      loading={loading}\r\n      options={(options as OptionType<TEntity>[]) ?? []}\r\n      open={open || false}\r\n      onOpen={e => {\r\n        //onOpen && onOpen(e);\r\n        !disableClearable && setOptions(null);\r\n        setSearchTerm(null);\r\n        setOpen(true);\r\n        !!onPickerOpen && onPickerOpen();\r\n      }}\r\n      onClose={(e, r) => {\r\n        //onClose && onClose(e, r);\r\n        setSearchTerm(null);\r\n        setOpen(false);\r\n      }}\r\n      onChange={(e, v, r, d) => {\r\n        setSearchTerm(null);\r\n        setSelected(v.length > 0);\r\n        if (onChange) {\r\n          onChange(v as TEntity[]);\r\n        }\r\n      }}\r\n      onInputChange={(event, newValue, reason) => {\r\n        setOptions(null);\r\n        if (reason === 'input') setSearchTerm(newValue);\r\n        //onInputChange && onInputChange(event, newValue, reason);\r\n      }}\r\n      getOptionSelected={getIsOptionSelected_Internal}\r\n      getOptionDisabled={getOptionDisabled}\r\n      getOptionLabel={handleRenderOptionLabel}\r\n      renderTags={handleRenderTags}\r\n      size={size}\r\n      fullWidth={fullWidth}\r\n      disableClearable={disableClearable}\r\n      value={value || undefined}\r\n      popupIcon={<Icon icon=\"chevron-down\" size=\"xs\" />}\r\n      closeIcon={<Icon icon=\"circle-xmark\" size=\"xs\" />}\r\n      selectOnFocus={isMobile ? false : true}\r\n      renderInput={params => (\r\n        <BaseTextField\r\n          {...params}\r\n          label={label}\r\n          fullWidth={fullWidth}\r\n          size={size}\r\n          variant={variant || 'standard'}\r\n          name={name}\r\n          placeholder={placeholder}\r\n          error={error}\r\n          helperText={helperText}\r\n          required={required}\r\n          inputProps={{\r\n            ...params.inputProps,\r\n            'aria-label': label\r\n              ? undefined\r\n              : `${ariaLabel ? ariaLabel : 'search input'}`,\r\n          }}\r\n          InputLabelProps={{\r\n            classes: { root: 'multiSelect' },\r\n            ...params.InputLabelProps,\r\n          }}\r\n          InputProps={{\r\n            autoFocus: firstOpen,\r\n            classes: {\r\n              root: clsx(\r\n                'multiSelect',\r\n                showShortView ? 'shortView' : undefined,\r\n                !!label ? 'hasLabel' : undefined,\r\n              ),\r\n            },\r\n            ...params.InputProps,\r\n            endAdornment: (\r\n              <React.Fragment>\r\n                {loading ? (\r\n                  <CircularProgress\r\n                    color=\"inherit\"\r\n                    size={params.size === 'small' ? 12 : 16}\r\n                    style={{\r\n                      position: 'absolute',\r\n                      right: 32,\r\n                      top: 'calc(50% - 8px)',\r\n                    }}\r\n                  />\r\n                ) : info ? (\r\n                  <Tooltip\r\n                    arrow\r\n                    title={info}\r\n                    style={{\r\n                      cursor: 'auto',\r\n                      position: 'absolute',\r\n                      top: 'calc(50% - 10.5px)',\r\n                      right: hasSelected ? 52 : 32,\r\n                    }}\r\n                  >\r\n                    <span>\r\n                      <Icon\r\n                        icon=\"info-circle\"\r\n                        color={error ? 'danger' : 'default'}\r\n                        colorExtend=\"textHover\"\r\n                        style={{\r\n                          width: 12,\r\n                          height: 12,\r\n                        }}\r\n                      />\r\n                    </span>\r\n                  </Tooltip>\r\n                ) : null}\r\n                {params.InputProps.endAdornment}\r\n              </React.Fragment>\r\n            ),\r\n            startAdornment: params.InputProps.startAdornment,\r\n          }}\r\n        />\r\n      )}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { generatePath } from 'react-router';\r\n\r\nexport const ServiceRequestDetailsPath = '/requests/:id';\r\nexport const GetServiceRequestDetailsPath = (serviceRequestId: number) =>\r\n  generatePath(ServiceRequestDetailsPath, {\r\n    id: serviceRequestId,\r\n  });\r\n","import { toRootedURL } from 'utils/url-utils';\r\nexport type ImageSize =\r\n  | 'full'\r\n  | 'thumb'\r\n  | 'thumbSmall'\r\n  | 'thumbLarge'\r\n  | 'horizontal'\r\n  | 'horizontalLarge'\r\n  | 'vertical'\r\n  | 'verticalLarge';\r\n\r\nexport function getAssetImageThumbSrc(\r\n  imageName: string | null,\r\n  imageSize?: ImageSize,\r\n  imageExist?: boolean,\r\n  defaultImage?: string,\r\n): string | undefined {\r\n  if (imageName === null || imageExist === false) {\r\n    return toRootedURL(defaultImage ?? getDefaultImage(imageSize));\r\n  }\r\n  switch (imageSize) {\r\n    case 'full':\r\n      return toRootedURL(`/uploads/assets/${imageName}`);\r\n    case 'horizontal':\r\n      return toRootedURL(`/uploads/assets/cardhorizontal/${imageName}`);\r\n    case 'horizontalLarge':\r\n      return toRootedURL(`/uploads/assets/cardhorizontallarge/${imageName}`);\r\n    case 'vertical':\r\n      return toRootedURL(`/uploads/assets/cardvertical/${imageName}`);\r\n    case 'verticalLarge':\r\n      return toRootedURL(`/uploads/assets/cardverticallarge/${imageName}`);\r\n    case 'thumbSmall':\r\n      return toRootedURL(`/uploads/assets/thumbsSmall/${imageName}`);\r\n    case 'thumbLarge':\r\n      return toRootedURL(`/uploads/assets/thumbsLarge/${imageName}`);\r\n    case 'thumb':\r\n    default:\r\n      return toRootedURL(`/uploads/assets/thumbs/${imageName}`);\r\n  }\r\n}\r\nexport function getDefaultImage(size?: ImageSize) {\r\n  switch (size) {\r\n    case 'full':\r\n      return `/images/200x150.png`;\r\n    case 'thumb':\r\n      return `/images/64x64.png`;\r\n    case 'thumbSmall':\r\n      return `/images/64x38.png`;\r\n    case 'thumbLarge':\r\n      return `/images/80x80.png`;\r\n    case 'vertical':\r\n      return `/images/278x174.png`;\r\n    case 'verticalLarge':\r\n      return `/images/457x240.png`;\r\n    case 'horizontal':\r\n      return `/images/180x201.png`;\r\n    case 'horizontalLarge':\r\n      return `/images/207x201.png`;\r\n    case undefined:\r\n    default:\r\n      return `/images/64x64.png`;\r\n  }\r\n}\r\nexport function getAssetImageSrc(\r\n  imageName: string | null,\r\n  imageExist?: boolean,\r\n  defaultImage?: string,\r\n): string | undefined {\r\n  if (imageName === null || imageExist === false) {\r\n    return toRootedURL(defaultImage ?? `/images/200x150.png`);\r\n  }\r\n  return toRootedURL(`/uploads/assets/${imageName}`);\r\n}\r\n","/**\r\n * Parses the stored relative HRef without in a way to match how URL is parsed to produce the pathName + search\r\n * Used to save the stored filters/pathnames in the pages with the filters.\r\n * Has to be backward compatible with the aspx filters where only the search without the path was stored (e.g. foo=bar&baz=...)\r\n * @param value stored \"saved url\" value\r\n * @returns pathName + search\r\n */\r\nexport const parseProfileUrl = (\r\n  value?: string,\r\n): {\r\n  pathName?: string;\r\n  search?: string;\r\n} => {\r\n  if (value === undefined || value === null) {\r\n    return {\r\n      pathName: undefined,\r\n      search: undefined,\r\n    };\r\n  }\r\n  const i = value.indexOf('?');\r\n  if (i < 0) {\r\n    return {\r\n      pathName: undefined,\r\n      search: '?' + value,\r\n    };\r\n  }\r\n\r\n  const part1 = value.slice(0, i);\r\n  const part2 = value.slice(i + 1);\r\n\r\n  return {\r\n    pathName: undefinedIfIsEmpty(part1),\r\n    search: undefinedIfIsEmpty(part2),\r\n  };\r\n};\r\n\r\nexport const undefinedIfIsEmpty = (\r\n  s: string | null | undefined,\r\n): string | undefined => (isEmpty(s) ? undefined : s ?? undefined);\r\n\r\nexport const isEmpty = (s: string | null | undefined): boolean => {\r\n  if (s === null || s === undefined) {\r\n    return true;\r\n  }\r\n  if (s.trim() === '') {\r\n    return true;\r\n  }\r\n  return false;\r\n};\r\n","export enum PartOfDay {\r\n  Undefined = -1,\r\n  /// <summary>\r\n  /// Combines what was perviously named as Day/Night. Replaced by the TimeSlotTypes\r\n  /// </summary>\r\n  BusinessHours = 0,\r\n  OffLine = 2,\r\n  Tutoring = 3,\r\n  NoTutoring = 4,\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  call,\r\n  put,\r\n  select,\r\n  takeEvery,\r\n  takeLatest,\r\n  debounce,\r\n  all,\r\n} from 'redux-saga/effects';\r\nimport { schedulerActions as actions } from '.';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  ReservationDetailsState,\r\n  ReservationQueryStringParameters,\r\n} from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport {\r\n  ChangeServicesAction,\r\n  ChangeViewModeAction,\r\n  GetServicesAction,\r\n  IEditEvent,\r\n  INewEvent,\r\n  ISchedulerService,\r\n  ISerializableFilterSettings,\r\n  IViewState,\r\n  SetFilterAction,\r\n} from './types';\r\nimport { BatchResponses, httpClient } from 'api/HttpClient';\r\nimport {\r\n  selectSchedulerViewStartDate,\r\n  selectSchedulerViewEndDate,\r\n  selectSchedulerPreviousViewState,\r\n  selectSchedulerFilters,\r\n  selectMultipleModeState,\r\n  selectNotUseLocation,\r\n  selectEmptySlotAdminClick,\r\n  selectSchedulerNewEventServices,\r\n  selectLoadedServices,\r\n  selectCalendarReservationColumns,\r\n  selectWithReservationsOnly,\r\n  selectSchedulerViewState,\r\n} from './selectors';\r\n\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n  withisInversed,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelState,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n  selectGlobalSetting,\r\n  selectglobalSettings,\r\n  selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { getLogger } from 'loglevel';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { isArray, isEqual, omit, uniq } from 'lodash';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { selectSidePanelState } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectReservationData } from 'app/pages/ReservationDetails/Details/slice/selectors';\r\nimport { reservationActions } from 'app/pages/ReservationDetails/Details/slice';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { PartOfDay } from 'enums/WorkingHoursTypes';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport {\r\n  WorkOrderDetailsState,\r\n  WorkOrderQueryStringParameters,\r\n} from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { GetCalendarPagePath } from '../../GetCalendarPagePath';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { Entity } from 'types/common';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { workOrderActions } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { selectSelectedSavedView } from 'app/pages/SavedViewsPage/SavedViewPage/slice/selectors';\r\nimport { savedViewActions } from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { ReservationOrDowntimeEnum } from 'enums/ReservationOrDowntimeEnum';\r\nimport { FilterValue } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  groupByFilterFieldName,\r\n  periodFilterFieldName,\r\n} from '../../parseCalendarPageParams';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\n\r\nconst log = getLogger('SchedulerSaga');\r\nfunction* doChangeViewMode(action: ChangeViewModeAction) {\r\n  const previous: IViewState | undefined = yield select(\r\n    selectSchedulerPreviousViewState,\r\n  );\r\n  const { current } = action.payload;\r\n  log.debug('doChangeViewMode', previous, current);\r\n  const notUseLocation = yield select(selectNotUseLocation);\r\n  if (!notUseLocation) {\r\n    yield* changeLocation(current, previous);\r\n  }\r\n  // skip unnecessary data reload during calendar/timeline switch\r\n  // fool proofing against duplicate calls to change view state of the scheduler\r\n  const isSameState = isStateEqual(previous, current);\r\n  if (!isSameState || action.payload.forceEvents) {\r\n    yield put(actions.getEvents());\r\n  }\r\n  yield put(actions.setPreviousViewState(current));\r\n}\r\n\r\nfunction* doChangeViewModePartial(action: PayloadAction<Partial<IViewState>>) {\r\n  const current: IViewState = yield select(selectSchedulerViewState);\r\n  yield* doChangeViewMode({\r\n    type: action.type,\r\n    payload: {\r\n      current,\r\n    },\r\n  });\r\n}\r\n\r\n/**\r\n * Determines if the viewstate have changed from the perspective of the scheduler saga\r\n * Used in order to fool proof the doChangeViewMode from rouge duplicate calls to change the viewstate causing to duplicate calls to fetch events\r\n * @param previous\r\n * @param current\r\n * @returns\r\n */\r\nfunction isStateEqual(previous: IViewState | undefined, current: IViewState) {\r\n  try {\r\n    const pickViewState = (a?: IViewState) => ({\r\n      viewLength: a?.viewLength,\r\n      // guards from one second changes to the viewstate regardless of their origin\r\n      // lowest denominator for the purpose of fetching events is one day currently\r\n      // in future, if the scheduler resolution will be lowered to > 1 day, this will need to be adjusted accordingly\r\n      date:\r\n        a?.date === undefined\r\n          ? undefined\r\n          : dateUtils.formatISO(\r\n              dateUtils.startOfDay(dateUtils.parseISO(a.date)),\r\n            ),\r\n    });\r\n    const isSameState = isEqual(\r\n      pickViewState(previous),\r\n      pickViewState(current),\r\n    );\r\n    return isSameState;\r\n  } catch (error) {\r\n    return false;\r\n  }\r\n}\r\nexport function applyStateSearchParams(current: IViewState) {\r\n  const params = new URLSearchParamsCI(current.search);\r\n  if (current.preset === null) {\r\n    params.delete(periodFilterFieldName);\r\n  } else {\r\n    params.set(periodFilterFieldName, current.preset);\r\n  }\r\n\r\n  params.set(groupByFilterFieldName, current.groupBy);\r\n\r\n  return params.toString();\r\n}\r\n\r\nfunction* changeLocation(\r\n  current: IViewState,\r\n  previous: IViewState | undefined,\r\n) {\r\n  const currentMode = {\r\n    groupBy: current.groupBy,\r\n    type: current.viewType,\r\n    search: current.search,\r\n  };\r\n  const previousMode = {\r\n    groupBy: previous?.groupBy,\r\n    type: previous?.viewType,\r\n    search: previous?.search,\r\n  };\r\n\r\n  if (!isEqual(previousMode, currentMode)) {\r\n    const path = GetCalendarPagePath(current);\r\n\r\n    yield put(\r\n      routerActions.push({ pathname: path, search: currentMode.search }),\r\n    );\r\n  }\r\n}\r\n\r\nconst reservationHistoryAPIURL = '/api/odata/v4/CalendarReservations';\r\n\r\nfunction eventsParams({\r\n  start,\r\n  end,\r\n  allFilters,\r\n  selectedServices,\r\n  serviceGroups,\r\n}: {\r\n  start: Date | undefined;\r\n  end: Date | undefined;\r\n  allFilters: ISerializableFilterSettings | undefined;\r\n  selectedServices: Array<ISchedulerService> | undefined;\r\n  serviceGroups: Array<Entity<number>> | undefined;\r\n}) {\r\n  const { events: eventFilters, training } = splitFilter(allFilters);\r\n  const ReservationOrDowntime =\r\n    allFilters?.['ReservationOrDowntime']?.value?.Id;\r\n\r\n  // filters shared across all type of events reservations/working hours/training sessions/etc.\r\n  // this filter can be sources either from the \"Filter\" or from scheduler state\r\n  const sharedFilter: Array<Condition<ICalendarReservationDto>> = [\r\n    new Condition<ICalendarReservationDto>(\r\n      'StartTime',\r\n      ODataOperators.LessThan,\r\n      end as FilterValue,\r\n    ),\r\n    new Condition<ICalendarReservationDto>(\r\n      'EndTime',\r\n      ODataOperators.GreaterThan,\r\n      start as FilterValue,\r\n    ),\r\n  ];\r\n\r\n  const servicesFilter: Array<Condition<ICalendarReservationDto>> = [];\r\n\r\n  if (selectedServices !== undefined && selectedServices.length > 0) {\r\n    const equipmentIdArray = selectedServices.map(f => f.Id);\r\n    servicesFilter.push(\r\n      new Condition<ICalendarReservationDto>(\r\n        'EquipmentId',\r\n        ODataOperators.Includes,\r\n        equipmentIdArray,\r\n      ),\r\n    );\r\n  }\r\n\r\n  if (serviceGroups !== undefined && serviceGroups.length > 0) {\r\n    servicesFilter.push(\r\n      new Condition<ICalendarReservationDto>(\r\n        'ServiceGroupId',\r\n        ODataOperators.Includes,\r\n        serviceGroups,\r\n      ),\r\n    );\r\n  }\r\n  return {\r\n    ReservationOrDowntime,\r\n    training,\r\n    sharedFilter,\r\n    servicesFilter,\r\n    eventFilters,\r\n  };\r\n}\r\n\r\nfunction* doGetEvents(action: PayloadAction) {\r\n  const start = yield select(selectSchedulerViewStartDate);\r\n  const end = yield select(selectSchedulerViewEndDate);\r\n  const allFilters: ISerializableFilterSettings | undefined = yield select(\r\n    selectSchedulerFilters,\r\n  );\r\n  const selectedServices: Array<ISchedulerService> | undefined = yield select(\r\n    selectLoadedServices,\r\n  );\r\n  const serviceGroups: Array<Entity<number>> | undefined = yield select(\r\n    selectGlobalServiceGroupFilter,\r\n  );\r\n  const withReservationsOnly = yield select(selectWithReservationsOnly);\r\n  const {\r\n    ReservationOrDowntime,\r\n    training,\r\n    sharedFilter,\r\n    servicesFilter,\r\n    eventFilters,\r\n  } = eventsParams({\r\n    start,\r\n    end,\r\n    allFilters,\r\n    selectedServices,\r\n    serviceGroups,\r\n  });\r\n\r\n  // track fetched services\r\n  const fetchedServices: number[] = [];\r\n\r\n  const reservations_fields = yield select(selectCalendarReservationColumns);\r\n  const effects: Array<unknown> = [\r\n    fetchEvents(\r\n      ReservationOrDowntime,\r\n      sharedFilter,\r\n      servicesFilter,\r\n      eventFilters,\r\n      reservations_fields,\r\n    ),\r\n    fetchTrainingSessions(\r\n      ReservationOrDowntime,\r\n      training,\r\n      sharedFilter,\r\n      servicesFilter,\r\n      selectedServices,\r\n      fetchedServices,\r\n    ),\r\n  ];\r\n  const noServicesSelected =\r\n    selectedServices === undefined || selectedServices.length === 0;\r\n  const loadWorkingHoursForFetchedEvents = !(\r\n    noServicesSelected && withReservationsOnly\r\n  );\r\n\r\n  // working hours can be fetched early if they don't depend on fetched events\r\n  if (loadWorkingHoursForFetchedEvents) {\r\n    effects.push(\r\n      fetchWorkingHours(\r\n        ReservationOrDowntime,\r\n        sharedFilter,\r\n        servicesFilter,\r\n        eventFilters,\r\n      ),\r\n    );\r\n  }\r\n  try {\r\n    const [\r\n      fetchedEventsEffect,\r\n      fetchedTrainingSessionsEffect,\r\n      fetchWorkingHoursEffect,\r\n    ] = yield all(effects);\r\n    const fetchedEvents = fetchedEventsEffect as IODataQueryResponse<\r\n      ICalendarReservationDto\r\n    > | null;\r\n    if (noServicesSelected && fetchedEvents != null) {\r\n      fetchedServices.push(\r\n        ...uniq(fetchedEvents.value.map(f => f.EquipmentId)),\r\n      );\r\n    }\r\n\r\n    const fetchedTrainingSessions = fetchedTrainingSessionsEffect as IODataQueryResponse<\r\n      ITrainingSessionSlotDto\r\n    > | null;\r\n    if (noServicesSelected && fetchedTrainingSessions != null) {\r\n      fetchedServices.push(\r\n        ...uniq(fetchedTrainingSessions.value.map(f => f.EquipmentId)),\r\n      );\r\n    }\r\n\r\n    const fetchedWorkingHours = fetchWorkingHoursEffect as IODataQueryResponse<\r\n      IWorkingHoursDto\r\n    > | null;\r\n\r\n    yield put(\r\n      actions.getEvents_Success({\r\n        reservations: fetchedEvents?.value ?? [],\r\n        trainingSessions: fetchedTrainingSessions?.value ?? [],\r\n        offlineHours: fetchedWorkingHours?.value ?? [],\r\n      }),\r\n    );\r\n\r\n    if (loadWorkingHoursForFetchedEvents) {\r\n      if (noServicesSelected && fetchedWorkingHours != null) {\r\n        fetchedServices.push(\r\n          ...uniq(fetchedWorkingHours.value.map(f => f.EquipmentId)),\r\n        );\r\n      }\r\n    } else {\r\n      const offlineServicesFilter =\r\n        withReservationsOnly === true\r\n          ? [\r\n              new Condition<IWorkingHoursDto>(\r\n                'EquipmentId',\r\n                ODataOperators.Includes,\r\n                [\r\n                  ...new Set(\r\n                    (fetchedEvents?.value ?? []).map(f => f.EquipmentId),\r\n                  ),\r\n                ],\r\n              ),\r\n            ]\r\n          : servicesFilter;\r\n      // fetch offline hours (alerts) for all displayed services\r\n      var result: IODataQueryResponse<IWorkingHoursDto> = yield fetchWorkingHours(\r\n        ReservationOrDowntime,\r\n        sharedFilter,\r\n        offlineServicesFilter,\r\n        eventFilters,\r\n      );\r\n      fetchedServices.push(...uniq(result.value.map(f => f.EquipmentId)));\r\n      yield put(actions.getOfflineHours_Success(result.value));\r\n    }\r\n\r\n    if (noServicesSelected) {\r\n      const distinctEquipmentIds = uniq(fetchedServices);\r\n      yield put(actions.getDerivedServices(distinctEquipmentIds));\r\n    }\r\n\r\n    // fetch non working hours only if a service has been selected\r\n    if (selectedServices !== undefined && selectedServices.length > 0) {\r\n      try {\r\n        const nonWorking = yield call(\r\n          getNonWorkingHours,\r\n          selectedServices.map(f => f.Id),\r\n          start,\r\n          end,\r\n        );\r\n        yield put(actions.getNonWorkingHours_Success(nonWorking));\r\n      } catch {\r\n        yield put(actions.getNonWorkingHours_Success([]));\r\n      }\r\n    }\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n}\r\n\r\nfunction fetchWorkingHours(\r\n  ReservationOrDowntime: any,\r\n  sharedFilter: Condition<ICalendarReservationDto>[],\r\n  offlineServicesFilter:\r\n    | Condition<ICalendarReservationDto>[]\r\n    | Condition<IWorkingHoursDto>[],\r\n  eventFilters: string[],\r\n) {\r\n  if (ReservationOrDowntime === ReservationOrDowntimeEnum.ReservationsOnly) {\r\n    return call(() => null);\r\n  } else {\r\n    const url = `/api/odata/v4/WorkingHours`;\r\n    // when the \"With reservations only\" is enabled - the offline hours need to be fetched only for those services that have reservations on them\r\n    // so in this case reservations fetched here are used to extract the service ids and filter by them\r\n    // otherwise the standard shared servicesFilter is used so that offline hours & reservations will be fetched on the same services\r\n    const b = new ODataFilterBuilder<IWorkingHoursDto>({\r\n      predicates: [\r\n        new Condition<IWorkingHoursDto>(\r\n          'PeriodTypeId',\r\n          ODataOperators.Equals,\r\n          PartOfDay.OffLine,\r\n        ).toString() || '',\r\n        ...sharedFilter,\r\n        ...offlineServicesFilter.map(f => f.toString()),\r\n        ...Object.entries(eventFilters ?? {})\r\n          // exclude the EquipmentId & ServiceGroupId filters applied separately in the shared filters\r\n          .filter(([key]) => !['service', 'period'].includes(key))\r\n          // exclude filters not applicable to the offline hours like the BudgetManager\r\n          .filter(([key]) => {\r\n            const value = eventFilters[key];\r\n            return (\r\n              !value.includes('BudgetManager') && !value.includes('BudgetId')\r\n            );\r\n          })\r\n          .map(([, value]) => value),\r\n      ],\r\n      stringColumns: [],\r\n      globalServiceGroupFilter: [],\r\n      isOptionalServiceGroup: true,\r\n    });\r\n    return call(httpClient.get, url, { $filter: b.toString() });\r\n  }\r\n}\r\n\r\nfunction fetchTrainingSessions(\r\n  ReservationOrDowntime: any,\r\n  training: string[],\r\n  sharedFilter: Condition<ICalendarReservationDto>[],\r\n  servicesFilter: Condition<ICalendarReservationDto>[],\r\n  selectedServices: IServiceFilterDto[] | undefined,\r\n  fetchedServices: number[],\r\n) {\r\n  if (ReservationOrDowntime !== ReservationOrDowntimeEnum.DownTimeOnly) {\r\n    const ff = Object.keys(training || {}).includes('BudgetManager');\r\n    if (ff) {\r\n      return call(() => null);\r\n    } else {\r\n      const trainingFilterBuilder = new ODataFilterBuilder<\r\n        ICalendarReservationDto\r\n      >({\r\n        predicates: [\r\n          ...sharedFilter,\r\n          ...servicesFilter,\r\n          ...Object.entries(training ?? {})\r\n            // exclude the EquipmentId & ServiceGroupId filters applied separately in the shared filters\r\n            .filter(([key]) => !['service', 'period'].includes(key))\r\n            .map(([, value]) => value),\r\n        ],\r\n        stringColumns: [],\r\n        globalServiceGroupFilter: [],\r\n        isOptionalServiceGroup: true,\r\n      });\r\n      return call(httpClient.get, '/api/odata/v4/TrainingSessionSlots', {\r\n        $filter: trainingFilterBuilder.toString(),\r\n      });\r\n    }\r\n  }\r\n}\r\n\r\nfunction fetchEvents(\r\n  ReservationOrDowntime: any,\r\n  sharedFilter: Condition<ICalendarReservationDto>[],\r\n  servicesFilter: Condition<ICalendarReservationDto>[],\r\n  eventFilters: string[],\r\n  reservations_fields: Array<keyof ICalendarReservationDto>,\r\n) {\r\n  if (ReservationOrDowntime !== ReservationOrDowntimeEnum.DownTimeOnly) {\r\n    const b = new ODataFilterBuilder<ICalendarReservationDto>({\r\n      predicates: [\r\n        ...sharedFilter,\r\n        ...servicesFilter,\r\n        ...Object.entries(eventFilters ?? {})\r\n          // exclude the EquipmentId & ServiceGroupId filters applied separately in the shared filters\r\n          .filter(([key]) => !['service', 'period'].includes(key))\r\n          .map(([, value]) => value),\r\n      ],\r\n      stringColumns: [],\r\n      globalServiceGroupFilter: [],\r\n      isOptionalServiceGroup: true,\r\n    });\r\n\r\n    return call(httpClient.get, reservationHistoryAPIURL, {\r\n      $filter: b.toString(),\r\n      $select: reservations_fields.join(','),\r\n    });\r\n  }\r\n  return call(() => null);\r\n}\r\n\r\nasync function getNonWorkingHours(\r\n  selectedServices: Array<number>,\r\n  start: Timestamp,\r\n  end: Timestamp,\r\n) {\r\n  const serviceIdParameter = selectedServices;\r\n  const prepareDateParameter = date =>\r\n    dateUtils.formatISO(date, { format: 'basic', representation: 'date' });\r\n  const startParameter = prepareDateParameter(start);\r\n  const endParameter = prepareDateParameter(\r\n    dateUtils.addDays(dateUtils.startOfDay(dateUtils.parseISO(end)), 1),\r\n  );\r\n  var url = `/api/odata/v4/WorkingHours/GetNonWorking(ServiceId=${JSON.stringify(\r\n    serviceIdParameter,\r\n  )},Start=${startParameter},End=${endParameter})`;\r\n\r\n  // use batch POST instead of GET to overcome 400 response for long urls\r\n  const batchResponse: BatchResponses = await httpClient.batch([\r\n    {\r\n      method: 'GET',\r\n      pathName: url,\r\n    },\r\n  ]);\r\n  const result = batchResponse.responses[0].body as IODataQueryResponse<\r\n    IEquipmentTimeSlot\r\n  >;\r\n  return result.value;\r\n}\r\n\r\nasync function getServiceDetails(ids: Array<number>) {\r\n  const result: IODataQueryResponse<IServiceFilterDto> = await httpClient.get(\r\n    '/api/odata/v4/ServiceFilter/ReservableEquipments',\r\n    {\r\n      $filter: new Condition<IServiceFilterDto>(\r\n        'Id',\r\n        ODataOperators.Includes,\r\n        ids.filter(f => f !== undefined),\r\n      ).toString(),\r\n      $expand: 'WorkingHours',\r\n    },\r\n  );\r\n  return result.value;\r\n}\r\n\r\nfunction* doGetServices(action: GetServicesAction) {\r\n  try {\r\n    if (action.payload === undefined) {\r\n      yield put(actions.getServices_Success([]));\r\n      return;\r\n    }\r\n    if (action.payload.length === 0) {\r\n      yield put(actions.getServices_Success([]));\r\n      return;\r\n    }\r\n    const needMoreProps = needMoreServiceProps({ services: action.payload });\r\n    if (!needMoreProps) {\r\n      yield put(\r\n        actions.getServices_Success(action.payload as Array<IServiceFilterDto>),\r\n      );\r\n    } else {\r\n      try {\r\n        // fetch service details only for services that haven't been loaded previously\r\n\r\n        const servicesResponse: Array<IServiceFilterDto> = yield call(\r\n          getServiceDetails,\r\n          action.payload.map(f => f.Id),\r\n        );\r\n\r\n        yield put(actions.getServices_Success(servicesResponse));\r\n      } catch (error) {\r\n        log.error('doGetServices', action, error);\r\n      }\r\n    }\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n  yield put(actions.getEvents());\r\n}\r\n\r\nfunction needMoreServiceProps(props: {\r\n  services: IServiceFilterDto[] | undefined;\r\n}) {\r\n  const requiredProps: Array<keyof IServiceFilterDto> = [\r\n    'Id',\r\n    'Name',\r\n    'ServiceGroupId',\r\n    'ServiceTypeId',\r\n    'Color',\r\n    'UseServiceGroupTrainingLevels',\r\n    'ServiceGroupName',\r\n    'RestrictDurationUnitsAmount',\r\n    'RestrictDurationUnitType',\r\n    'ImageName',\r\n    'DefaultDuration',\r\n    'AssemblyId',\r\n    'TopAssemblyId',\r\n    'AssetCatId',\r\n    'AssetCatName',\r\n    'RestrictReservationToTimeSlots',\r\n    'MinOrderHours',\r\n    'WorkingHours',\r\n  ];\r\n  const needMoreProps = props.services?.some(f => {\r\n    const actualProps = Object.keys(f).sort();\r\n    const iss = isEqual(actualProps, requiredProps.sort());\r\n    return !iss;\r\n  });\r\n  return needMoreProps;\r\n}\r\n\r\nfunction* doGetDerivedServices(action: ChangeServicesAction) {\r\n  try {\r\n    if (action.payload === undefined) {\r\n      return undefined;\r\n    }\r\n    const servicesResponse: Array<IServiceFilterDto> = yield call(\r\n      getServiceDetails,\r\n      action.payload,\r\n    );\r\n\r\n    yield put(actions.getDerivedServices_Success(servicesResponse));\r\n  } catch (error) {\r\n    log.error('doGetServices', action, error);\r\n  }\r\n}\r\nfunction* doEdit(action: PayloadAction<IEditEvent>) {\r\n  if (action.payload.type === undefined) {\r\n    return;\r\n  }\r\n  switch (action.payload.type) {\r\n    case 'offline':\r\n      if (action.payload.alert_id !== undefined) {\r\n        yield* doEditAlert(action);\r\n      }\r\n      break;\r\n    case 'reservation':\r\n      yield* doEditReservation(action);\r\n      break;\r\n    case 'trainingsession':\r\n      if (action.payload.reservation_id === undefined) {\r\n        yield* doEditTrainingSession(action);\r\n      } else {\r\n        yield doEditReservation(action);\r\n      }\r\n      break;\r\n    default:\r\n      assertExhaustive(action.payload.type);\r\n  }\r\n}\r\nfunction* doEditTrainingSession(action: PayloadAction<IEditEvent>) {\r\n  const trainingSession = action.payload.original as ITrainingSessionSlotDto;\r\n  const authenticatedUser: AuthenticatedUser = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n\r\n  const queryParams: ReservationQueryStringParameters = {\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    Start: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(trainingSession.StartTime),\r\n    ),\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    End: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(trainingSession.EndTime),\r\n    ),\r\n    selectedIds: String(action.payload.service_id),\r\n    un: authenticatedUser.Id,\r\n    tsid: String((action.payload as any).trainingsession_id),\r\n  };\r\n  // undefined can't be processed by the reservation details\r\n  if (action.payload.reservation_id !== undefined) {\r\n    queryParams.id = String(action.payload.reservation_id);\r\n  }\r\n  // const x: SidePanelState | undefined = yield select(selectSidePanelState);\r\n  // const reservationSidePanelOpened =\r\n  //   x?.sidePanelOpen && x?.pageType === RenderPageType.ReservationDetails;\r\n\r\n  // if (reservationSidePanelOpened) {\r\n  //   if (action.payload.start_date !== undefined) {\r\n  //     yield put(reservationActions.setStartDate(action.payload.start_date));\r\n  //   }\r\n  //   if (action.payload.end_date !== undefined) {\r\n  //     yield put(reservationActions.setEndDate(action.payload.end_date));\r\n  //   }\r\n  // } else {\r\n\r\n  // }\r\n  yield put(\r\n    layoutActions.openSidePanel({\r\n      type: RenderPageType.ReservationDetails,\r\n      props: {\r\n        useSidePanel: true,\r\n        queryParams,\r\n      } as ReservationDetailsProps,\r\n    }),\r\n  );\r\n}\r\nfunction* doEditReservation(action: PayloadAction<IEditEvent>) {\r\n  if (action.payload.reservation_id === undefined) {\r\n    log.error('doEditReservation: ReservationId not found', action.payload);\r\n    return;\r\n  }\r\n  const queryParams: ReservationQueryStringParameters = {\r\n    id: String(action.payload.reservation_id),\r\n    Start: action.payload.start_date,\r\n    End: action.payload.end_date,\r\n  };\r\n  const sidePanelState: SidePanelState | undefined = yield select(\r\n    selectSidePanelState,\r\n  );\r\n  const reservationDetailsState:\r\n    | ReservationDetailsState\r\n    | undefined = yield select(selectReservationData);\r\n  const reservationSidePanelOpened =\r\n    sidePanelState?.sidePanelOpen &&\r\n    sidePanelState?.pageType === RenderPageType.ReservationDetails;\r\n  if (reservationSidePanelOpened) {\r\n    if (action.payload.reservation_id !== reservationDetailsState?.Id) {\r\n      if (reservationDetailsState?.Id !== undefined) {\r\n        // reset previously opened reservation/alert details before showing new one\r\n        yield put(layoutActions.resetSidePanel());\r\n      }\r\n    }\r\n  }\r\n\r\n  if (\r\n    reservationSidePanelOpened &&\r\n    action.payload.reservation_id === reservationDetailsState?.Id\r\n  ) {\r\n    if (action.payload.start_date !== undefined) {\r\n      yield put(reservationActions.setStartDate(action.payload.start_date));\r\n    }\r\n    if (action.payload.end_date !== undefined) {\r\n      yield put(reservationActions.setEndDate(action.payload.end_date));\r\n    }\r\n  } else {\r\n    yield put(\r\n      layoutActions.openSidePanel({\r\n        type: RenderPageType.ReservationDetails,\r\n        props: {\r\n          useSidePanel: true,\r\n          queryParams,\r\n        } as ReservationDetailsProps,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doEditAlert(action: PayloadAction<IEditEvent>) {\r\n  const queryParams: WorkOrderQueryStringParameters = {\r\n    id: String(action.payload.alert_id),\r\n    offStart: action.payload.start_date,\r\n    offEnd: action.payload.end_date,\r\n  };\r\n  const props: WorkOrderDetailsProps = {\r\n    queryParams: queryParams,\r\n\r\n    useSidePanel: true,\r\n  };\r\n\r\n  const sidePanelState: SidePanelState | undefined = yield select(\r\n    selectSidePanelState,\r\n  );\r\n\r\n  if (sidePanelState?.sidePanelOpen && action.payload.alert_id === undefined) {\r\n    yield put(\r\n      workOrderActions.setOfflineEventStart(\r\n        dateUtils.formatQueryStringDate(\r\n          dateUtils.parseISO(action.payload.start_date),\r\n        ),\r\n      ),\r\n    );\r\n\r\n    yield put(\r\n      workOrderActions.setOfflineEventEnd(\r\n        dateUtils.formatQueryStringDate(\r\n          dateUtils.parseISO(action.payload.end_date),\r\n        ),\r\n      ),\r\n    );\r\n  } else {\r\n    yield put(\r\n      layoutActions.openSidePanel({\r\n        type: RenderPageType.WorkOrderDetails,\r\n        props: props,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doCreate(action: PayloadAction<INewEvent | undefined>) {\r\n  if (action.payload === undefined) {\r\n    return;\r\n  }\r\n  const authenticatedUser: AuthenticatedUser = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const requestedServices = yield select(selectSchedulerNewEventServices);\r\n  const defaultMulti: boolean | undefined = yield select(\r\n    selectMultipleModeState,\r\n  );\r\n  const defaultMultiModeBehavior = action.payload.defaultMulti ?? defaultMulti;\r\n  const emptySlotAdminClick: EmptySlotAdminClick = yield select(\r\n    selectEmptySlotAdminClick,\r\n  );\r\n  const isAdmin = authenticatedUser.IsAllGroupOrLabTechAdmin(\r\n    requestedServices.map(f => f.ServiceGroupId),\r\n    requestedServices.map(f => {\r\n      return {\r\n        Id: f.Id,\r\n        Name: f.Name,\r\n        ServiceTypeId: f.ServiceTypeId,\r\n      } as IServiceTypeFilterDto;\r\n    }),\r\n  );\r\n  const sidePanelState: SidePanelState | undefined = yield select(\r\n    selectSidePanelState,\r\n  );\r\n  const reservationDetailsState:\r\n    | ReservationDetailsState\r\n    | undefined = yield select(selectReservationData);\r\n  const reservationSidePanelOpened =\r\n    sidePanelState?.sidePanelOpen &&\r\n    sidePanelState?.pageType === RenderPageType.ReservationDetails;\r\n  if (reservationSidePanelOpened) {\r\n    if (reservationDetailsState?.Id !== 0) {\r\n      // reset previously opened reservation/alert details before showing new one\r\n      yield put(layoutActions.resetSidePanel());\r\n    }\r\n  }\r\n\r\n  // equipment is changed here when a new reservation is dragged to another service on the timeline\r\n  const equipmentChanged =\r\n    action.payload.service_id !== undefined &&\r\n    reservationDetailsState?.EquipmentsData?.some(\r\n      equipment => equipment.Id === action.payload?.service_id,\r\n    ) === false;\r\n\r\n  if (\r\n    reservationSidePanelOpened &&\r\n    reservationDetailsState?.Id === 0 &&\r\n    !equipmentChanged\r\n  ) {\r\n    if (action.payload.start_date !== undefined) {\r\n      yield put(reservationActions.setStartDate(action.payload.start_date));\r\n    }\r\n    if (action.payload.end_date !== undefined) {\r\n      yield put(reservationActions.setEndDate(action.payload.end_date));\r\n    }\r\n    return;\r\n  }\r\n  const settings: AppSettings = yield select(selectAppSettings);\r\n  if (settings.Modules.includes(KnownModules.EquipmentAssemblies)) {\r\n  }\r\n\r\n  /**\r\n   * service_id from the payload might be:\r\n   * * number if reservation is placed on the service slot (timeline/unit view)\r\n   * * or an array of numbers (where from?)\r\n   * */\r\n\r\n  const payloadServiceIds = isArray(action.payload.service_id)\r\n    ? action.payload.service_id\r\n    : [action.payload.service_id];\r\n\r\n  var requestedServicesAssemblyIds = uniq(\r\n    requestedServices.map(\r\n      (f: Pick<IServiceFilterDto, 'Id' | 'TopAssemblyId'>) =>\r\n        f.TopAssemblyId ?? f.Id,\r\n    ),\r\n  );\r\n\r\n  const useRequestedServices = requestedServices.length > 0;\r\n\r\n  if (useRequestedServices) {\r\n    if (\r\n      requestedServices.some(\r\n        (service: IServiceFilterDto) => service.AssemblyId !== null,\r\n      ) &&\r\n      settings.Modules.includes(KnownModules.EquipmentAssemblies)\r\n    ) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'Scheduler_AssemblyPartSelected_InfoMessage',\r\n          variant: 'info',\r\n          message: i18next.t(\r\n            translations.Scheduler_AssemblyPartSelected_InfoMessage,\r\n          ),\r\n        }),\r\n      );\r\n    }\r\n  }\r\n\r\n  // push all selected services if event was not created on dedicated service strip, e.g. on weekly calendar with no separate headers for each service\r\n  const serviceIds = useRequestedServices\r\n    ? requestedServicesAssemblyIds\r\n    : payloadServiceIds;\r\n\r\n  /**\r\n   * Reservation side panel expects the service ids to be a csv e.g. \"1,2,3\"\r\n   */\r\n  const reservationSidePanelServiceId = String(serviceIds.join(','));\r\n  const queryParams: ReservationQueryStringParameters = {\r\n    selectedIds: reservationSidePanelServiceId,\r\n    bid:\r\n      action.payload.bid !== undefined ? String(action.payload.bid) : undefined,\r\n    srid:\r\n      action.payload.srid !== undefined\r\n        ? String(action.payload.srid)\r\n        : undefined,\r\n    srrid:\r\n      action.payload.srrid !== undefined\r\n        ? String(action.payload.srrid)\r\n        : undefined,\r\n    un: action.payload.un ?? authenticatedUser?.Id,\r\n    ug:\r\n      action.payload.un !== undefined\r\n        ? undefined\r\n        : authenticatedUser?.ActiveUserGroup?.Id,\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    Start: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(action.payload.start_date),\r\n    ),\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    End: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(action.payload.end_date),\r\n    ),\r\n    defaultMulti:\r\n      defaultMultiModeBehavior === undefined\r\n        ? undefined\r\n        : defaultMultiModeBehavior.toString(),\r\n    sampleRunId: action.payload.sample_run_id?.toString(),\r\n  };\r\n  const alertQueryParams: WorkOrderQueryStringParameters = {\r\n    eqid: reservationSidePanelServiceId,\r\n    down: 'true',\r\n    offH: 'true',\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    eStart: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(action.payload.start_date),\r\n    ),\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    offStart: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(action.payload.start_date),\r\n    ),\r\n    // reservation details does not understand the ISO time, the value must be without the \"z\"\r\n    offEnd: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(action.payload.end_date),\r\n    ),\r\n    defaultMulti:\r\n      defaultMultiModeBehavior === undefined\r\n        ? undefined\r\n        : defaultMultiModeBehavior.toString(),\r\n    aType:\r\n      action.payload.alert_type === undefined\r\n        ? undefined\r\n        : action.payload.alert_type.toString(),\r\n  };\r\n  // workaround to skip side panel close confirmation\r\n  // otherwise a reset is called after confirmation causing the reservation/event to disappear from the scheduler\r\n  yield put(layoutActions.setNotSavedChanges(false));\r\n  if (\r\n    isAdmin &&\r\n    EmptySlotAdminClick[emptySlotAdminClick.toString()] ===\r\n      EmptySlotAdminClick.DownTimeOnly\r\n  ) {\r\n    let params = {\r\n      useSidePanel: true,\r\n      useSwithButtons: true,\r\n      queryParams: alertQueryParams,\r\n    } as WorkOrderDetailsProps;\r\n    yield put(\r\n      layoutActions.openSidePanel({\r\n        type: RenderPageType.WorkOrderDetails,\r\n        props: params,\r\n      }),\r\n    );\r\n  } else {\r\n    let params = {\r\n      useSidePanel: true,\r\n      useSwitchButtons: isAdmin,\r\n      queryParams,\r\n    } as ReservationDetailsProps;\r\n    yield put(\r\n      layoutActions.openSidePanel({\r\n        type: RenderPageType.ReservationDetails,\r\n        props: params,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doReset(action: PayloadAction<unknown>) {\r\n  yield put(actions.create());\r\n}\r\nfunction* doUpdateMultipleMode(action: PayloadAction<boolean | undefined>) {\r\n  const authenticatedUser: AuthenticatedUser = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const selectedSavedView: ISavedViewDto | undefined = yield select(\r\n    selectSelectedSavedView,\r\n  );\r\n  if (selectedSavedView === undefined) {\r\n    yield put(\r\n      appSettingsActions.updateUserProfileSettings({\r\n        key: 'BookMultipleInstruments',\r\n        model: {\r\n          UserName: authenticatedUser?.Id,\r\n          Key: 'BookMultipleInstruments',\r\n          IsMultiple: action.payload === undefined ? null : action.payload,\r\n        } as UserProfileSettings,\r\n      }),\r\n    );\r\n  } else {\r\n    yield put(\r\n      savedViewActions.patch({\r\n        Id: selectedSavedView.Id,\r\n        Multiple: action.payload,\r\n      }),\r\n    );\r\n  }\r\n  yield put(actions.updateMultiMode_Success(action.payload));\r\n}\r\n\r\nfunction* doUpdateEmptySlotClick(action: PayloadAction<EmptySlotAdminClick>) {\r\n  const authenticatedUser: AuthenticatedUser = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  yield put(\r\n    appSettingsActions.updateUserProfileSettings({\r\n      key: 'EmptySlotAdminClick',\r\n      model: {\r\n        UserName: authenticatedUser?.Id,\r\n        Key: 'EmptySlotAdminClick',\r\n        Value: action.payload.toString(),\r\n      } as UserProfileSettings,\r\n    }),\r\n  );\r\n  yield put(actions.updateEmptySlotSettings_success(action.payload));\r\n}\r\nfunction* doGetEmptySlotAdminClick() {\r\n  const sett: UserProfile = yield select(selectUserProfileSettings);\r\n  const gsettings: GlobalSettings = yield select(selectglobalSettings);\r\n  const defaultEmptySlotSetting = gsettings.GetNullableByKey(\r\n    AllowedSettings.CalendarTimelineEmptySlotClickSettings,\r\n  );\r\n  const defaultEmptySlotClick =\r\n    defaultEmptySlotSetting === null\r\n      ? EmptySlotAdminClick.ReservationsOnly\r\n      : EmptySlotAdminClick[defaultEmptySlotSetting] ===\r\n        EmptySlotAdminClick.WhatToAdd\r\n      ? EmptySlotAdminClick.ReservationsOnly\r\n      : EmptySlotAdminClick[defaultEmptySlotSetting];\r\n  const userEmptySlotAdminClick = sett.GetSettingValueBy(\r\n    (f: { Key: string }) =>\r\n      f.Key.toLowerCase() === 'EmptySlotAdminClick'.toLowerCase(),\r\n  )?.Value;\r\n  const userSetting =\r\n    userEmptySlotAdminClick === undefined || userEmptySlotAdminClick === null\r\n      ? defaultEmptySlotClick\r\n      : isNaN(parseInt(userEmptySlotAdminClick))\r\n      ? EmptySlotAdminClick[userEmptySlotAdminClick]\r\n      : EmptySlotAdminClick[parseInt(userEmptySlotAdminClick)];\r\n  yield put(actions.updateEmptySlotSettings_success(userSetting));\r\n}\r\n\r\n/**\r\n * Splits scheduler filters into 2 groups - one to be applied to the services the other one - to the events\r\n * @param filters scheduler filters\r\n * @returns\r\n */\r\nfunction splitFilter(filters?: ISerializableFilterSettings) {\r\n  const result: {\r\n    events: Array<string>;\r\n    service: Array<string>;\r\n    training: Array<string>;\r\n  } = {\r\n    service: [],\r\n    events: [],\r\n    training: [],\r\n  };\r\n  if (filters === undefined) {\r\n    return result;\r\n  }\r\n  const getPredicate = (filters: ISerializableFilterSettings, key: string) =>\r\n    withisInversed<string>(\r\n      String(filters[key].predicate),\r\n      filters[key].predicate['isInversed'],\r\n    );\r\n  return Object.keys(filters).reduce((acc, key) => {\r\n    switch (key) {\r\n      case 'BudgetManager':\r\n      case 'BookedById':\r\n      case 'BudgetId':\r\n        acc.events.push(getPredicate(filters, key));\r\n        acc.events.push(getPredicate(filters, key));\r\n        break;\r\n\r\n      case 'service':\r\n      case 'campus':\r\n      case 'AssetRoomId':\r\n      case 'AssetBuildingId':\r\n      case 'AssetGroupId':\r\n      case 'AssetCatId':\r\n      case 'AvailabilityTypeId':\r\n        acc.service.push(getPredicate(filters, key));\r\n        break;\r\n      case 'TrainingStateId':\r\n        acc.training.push(getPredicate(filters, key));\r\n        break;\r\n      case 'WithReservationsOnly':\r\n        // noop - WithReservationsOnly is not applied to any API and only affects the services displayed based on the fetched services and reservations\r\n        break;\r\n      default:\r\n        log.warn(`splitFilter: missing case for ${key}`, filters[key]);\r\n        break;\r\n    }\r\n    return acc;\r\n  }, result);\r\n}\r\nfunction* doSetFilters(action: SetFilterAction) {\r\n  try {\r\n    const serviceGroups: Array<Entity<number>> | undefined = yield select(\r\n      selectGlobalServiceGroupFilter,\r\n    );\r\n    // handle the global service groups filter\r\n    const predicates: Array<string | Condition<IServiceFilterDto>> = [];\r\n    if (serviceGroups !== undefined && serviceGroups.length > 0) {\r\n      predicates.push(\r\n        new Condition<IServiceFilterDto>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          serviceGroups,\r\n        ),\r\n      );\r\n    }\r\n    // apply the rest of the \"filters\" applicable to the services here\r\n    if (action.payload !== undefined) {\r\n      // The Service filter can't be applied directly as it filters by the EquipmentId column instead of the Id\r\n      const serviceRelatedFilters = splitFilter(\r\n        omit(action.payload, 'service'),\r\n      );\r\n      predicates.push(...serviceRelatedFilters.service);\r\n\r\n      // service selected in the main filter need some special treatment\r\n      if (action.payload.service !== undefined) {\r\n        const filteredServices = action.payload?.service?.value?.map(f => f.Id);\r\n        if (filteredServices?.length > 0) {\r\n          predicates.push(\r\n            new Condition<IServiceFilterDto>(\r\n              'Id',\r\n              ODataOperators.Includes,\r\n              filteredServices,\r\n            ),\r\n          );\r\n        }\r\n      }\r\n    }\r\n\r\n    var serviceFilterValue = action.payload?.['service']?.value;\r\n    const servicesLoaded =\r\n      Array.isArray(serviceFilterValue) &&\r\n      needMoreServiceProps({ services: serviceFilterValue }) === true;\r\n\r\n    if (!servicesLoaded) {\r\n      // max number of services allowed to be shown on the timeline\r\n      const maxTimelineServices = yield select(state =>\r\n        selectGlobalSetting(state, AllowedSettings.MaximumTimelineRowsLimit),\r\n      );\r\n      // max number of services allowed to be shown on the calendar\r\n      const maxCalendarServices = yield select(state =>\r\n        selectGlobalSetting(\r\n          state,\r\n          AllowedSettings.CalendarServicesPickerCapacity,\r\n        ),\r\n      );\r\n      // take max + 1 in order to determine that the maximum limit has been reached for calendar/timeline\r\n      const maxServices =\r\n        Math.max(\r\n          tryParseInt(maxTimelineServices) ?? 50,\r\n          tryParseInt(maxCalendarServices) ?? 10,\r\n        ) + 1;\r\n\r\n      const x: IODataQueryResponse<IServiceFilterDto> = yield call(\r\n        httpClient.get,\r\n        '/api/odata/v4/ServiceFilter/ReservableEquipments',\r\n        {\r\n          $filter: undefinedIfIsEmpty(predicates.join(' and ')),\r\n          $orderby: 'Name',\r\n          $top: maxServices + 1,\r\n        },\r\n      );\r\n\r\n      yield put(actions.getServices_Success(x.value));\r\n    } else {\r\n      yield put(actions.getServices_Success(serviceFilterValue));\r\n    }\r\n\r\n    yield put(actions.getEvents());\r\n  } catch (error) {\r\n    log.error(error);\r\n  }\r\n}\r\nfunction* doResetWorkOrder(\r\n  action: PayloadAction<WorkOrderDetailsState | undefined>,\r\n) {\r\n  // todo: use the payload/state to reset the start/end time of the offline/alert that was edited by drag/resize instead of refetching all events\r\n  yield put(actions.create());\r\n  yield put(actions.getEvents());\r\n}\r\nexport function* schedulerSaga() {\r\n  yield debounce(100, actions.getEvents.type, doGetEvents);\r\n  yield takeLatest(actions.changeViewMode.type, doChangeViewMode);\r\n  yield takeLatest(actions.changeViewModePartial.type, doChangeViewModePartial);\r\n  yield takeLatest(actions.setDate.type, doGetEvents);\r\n  yield takeLatest(actions.edit.type, doEdit);\r\n\r\n  yield takeLatest(actions.create.type, doCreate);\r\n  // refresh after reservation has been created\r\n  yield takeEvery(\r\n    reservationActions.createReservation_Success.type,\r\n    doGetEvents,\r\n  );\r\n  // refresh after reservation has been updated\r\n  yield takeEvery(\r\n    reservationActions.updateReservation_Success.type,\r\n    doGetEvents,\r\n  );\r\n\r\n  // process change in the service groups global filter - refresh events shown\r\n  yield takeLatest(\r\n    appSettingsActions.saveGlobalServiceGroupFilter.type,\r\n    doGetEvents,\r\n  );\r\n  // removes temporary \"new event\" from the scheduler on workorder creation\r\n  yield takeEvery(workOrderActions.createWorkOrder_Success.type, doReset);\r\n  // refresh after alert was created\r\n  yield takeEvery(workOrderActions.createWorkOrder_Success.type, doGetEvents);\r\n  // refresh after alert was updated\r\n  yield takeEvery(workOrderActions.updateWorkOrder_Success.type, doGetEvents);\r\n\r\n  yield takeLatest(reservationActions.resetDetailsState, doReset);\r\n  yield takeLatest(\r\n    workOrderActions.resetUpdateWorkOrderState.type,\r\n    doResetWorkOrder,\r\n  );\r\n  yield takeLatest(\r\n    workOrderActions.resetCreateWorkOrderState.type,\r\n    doResetWorkOrder,\r\n  );\r\n\r\n  yield takeLatest(actions.getDerivedServices.type, doGetDerivedServices);\r\n  yield takeLatest(actions.getServices.type, doGetServices);\r\n  yield takeLatest(actions.setFilters.type, doSetFilters);\r\n\r\n  yield takeLatest(actions.updateMultiMode.type, doUpdateMultipleMode);\r\n\r\n  yield takeLatest(\r\n    actions.updateEmptySlotSettings.type,\r\n    doUpdateEmptySlotClick,\r\n  );\r\n  yield takeLatest(\r\n    actions.getEmptySlotAdminClick.type,\r\n    doGetEmptySlotAdminClick,\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { applyStateSearchParams, schedulerSaga } from './saga';\r\n\r\nimport {\r\n  SchedulerState,\r\n  IViewState,\r\n  INewEvent,\r\n  ChangeServicesAction,\r\n  ChangeViewModeAction,\r\n  ISchedulerService,\r\n  GetServicesAction,\r\n  SetFilterAction,\r\n  IEditEvent,\r\n} from './types';\r\n\r\nexport const initialState: SchedulerState = {\r\n  events: {},\r\n  offlineHours: {},\r\n  trainingSessions: {},\r\n  emptySlotAdminClick: EmptySlotAdminClick.ReservationsOnly,\r\n  selectedReservationEvents: [],\r\n  TimelineGroupBy: 'NoTimelineGrouped',\r\n  exportToPDF: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'scheduler',\r\n  initialState,\r\n  reducers: {\r\n    init(state, action: PayloadAction<IViewState | undefined>) {\r\n      const result = { ...initialState, ...{ viewState: action.payload } };\r\n      return result;\r\n    },\r\n    changeViewModePartial(state, action: PayloadAction<Partial<IViewState>>) {\r\n      state.viewState = Object.assign({}, state.viewState, action.payload);\r\n      state.viewState.search = applyStateSearchParams(state.viewState);\r\n    },\r\n    changeViewMode(state, action: ChangeViewModeAction) {\r\n      state.notUseLocation = action.payload.withNoChangeLocation;\r\n      state.viewState = Object.assign({}, state.viewState, {\r\n        preset: action.payload.current.preset,\r\n        viewType: action.payload.current.viewType,\r\n        viewLength: action.payload.current.viewLength,\r\n        date: action.payload.current.date,\r\n        search: applyStateSearchParams(action.payload.current),\r\n        customDays: action.payload.current.customDays,\r\n        customStart: action.payload.current.customStart,\r\n      });\r\n    },\r\n    setPreviousViewState(state, action: PayloadAction<IViewState>) {\r\n      state.previousViewState = action.payload;\r\n    },\r\n    changeGroupBy(state, action: PayloadAction<TimelineGroupByUnion>) {},\r\n    setDate(state, action: PayloadAction<Timestamp>) {\r\n      if (state.viewState !== undefined) {\r\n        state.viewState.date = action.payload;\r\n      }\r\n    },\r\n\r\n    getServices(state, action: GetServicesAction) {\r\n      state.selectedServices = undefined;\r\n    },\r\n    getServices_Success(\r\n      state,\r\n      action: PayloadAction<Array<ISchedulerService>>,\r\n    ) {\r\n      state.selectedServices = action.payload;\r\n    },\r\n\r\n    getDerivedServices(state, action: ChangeServicesAction) {},\r\n    getDerivedServices_Success(\r\n      state,\r\n      action: PayloadAction<Array<ISchedulerService>>,\r\n    ) {\r\n      state.derivedServices = action.payload;\r\n    },\r\n\r\n    getEvents(state, action: PayloadAction) {\r\n      state.loadingEvents = true;\r\n    },\r\n    getEvents_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        reservations: Array<ICalendarReservationDto>;\r\n        trainingSessions: Array<ITrainingSessionSlotDto>;\r\n        offlineHours: Array<IWorkingHoursDto>;\r\n      }>,\r\n    ) {\r\n      if (state?.viewState?.date !== undefined) {\r\n        state.events[state.viewState.date] = action.payload.reservations;\r\n        state.trainingSessions[state.viewState.date] =\r\n          action.payload.trainingSessions;\r\n        state.offlineHours[state.viewState.date] = action.payload.offlineHours;\r\n      }\r\n      state.loadingEvents = false;\r\n    },\r\n    getEvents_Error(state, action: PayloadAction<any>) {},\r\n\r\n    getOfflineHours_Success(\r\n      state,\r\n      action: PayloadAction<Array<IWorkingHoursDto>>,\r\n    ) {\r\n      if (state?.viewState?.date !== undefined) {\r\n        state.offlineHours[state.viewState.date] = action.payload;\r\n      }\r\n    },\r\n    getNonWorkingHours_Success(\r\n      state,\r\n      action: PayloadAction<Array<IEquipmentTimeSlot>>,\r\n    ) {\r\n      state.nonWorkingHours = action.payload;\r\n    },\r\n    getTrainingSessions_Success(\r\n      state,\r\n      action: PayloadAction<Array<ITrainingSessionSlotDto>>,\r\n    ) {\r\n      if (state?.viewState?.date !== undefined) {\r\n        state.trainingSessions[state.viewState.date] = action.payload;\r\n      }\r\n    },\r\n\r\n    setFilters(state, action: SetFilterAction) {\r\n      // reset the events\r\n      state.events = {};\r\n      state.offlineHours = {};\r\n      state.trainingSessions = {};\r\n      state.loadingEvents = true;\r\n      state.filters = action.payload;\r\n    },\r\n\r\n    edit(state, action: PayloadAction<IEditEvent>) {\r\n      switch (action.payload.type) {\r\n        case 'offline':\r\n          // store the updated start/end of the offline event in the state\r\n          // this might prevent event jumping back after it's been dragged for the first time after the scheduler has been loaded\r\n          const entity = Object.values(state.offlineHours)\r\n            ?.flat()\r\n            ?.find(f => f.AlertId === action.payload.alert_id);\r\n          if (entity !== undefined) {\r\n            entity.StartTime = action.payload.start_date;\r\n            entity.EndTime = action.payload.end_date;\r\n          }\r\n      }\r\n    },\r\n    create(state, action: PayloadAction<INewEvent | undefined>) {\r\n      state.tempReservations = action.payload;\r\n    },\r\n    updateMultiMode(state, action: PayloadAction<boolean | undefined>) {},\r\n    updateMultiMode_Success(state, action: PayloadAction<boolean | undefined>) {\r\n      state.multipleInstrumentsMode = action.payload;\r\n    },\r\n    updateEmptySlotSettings(\r\n      state,\r\n      action: PayloadAction<EmptySlotAdminClick>,\r\n    ) {},\r\n    updateEmptySlotSettings_success(\r\n      state,\r\n      action: PayloadAction<EmptySlotAdminClick>,\r\n    ) {\r\n      state.emptySlotAdminClick = action.payload;\r\n    },\r\n    getEmptySlotAdminClick(state, action: PayloadAction) {},\r\n    setNotUseLocation(state, action: PayloadAction<boolean | undefined>) {\r\n      state.notUseLocation = action.payload;\r\n    },\r\n    setSelectedReservationEvents(\r\n      state,\r\n      action: PayloadAction<Array<IEditEvent>>,\r\n    ) {\r\n      state.selectedReservationEvents = action.payload;\r\n    },\r\n    exportToPDF(state, action: PayloadAction) {\r\n      state.exportToPDF = true;\r\n    },\r\n    resetExportToPDF(state, action: PayloadAction) {\r\n      state.exportToPDF = false;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: schedulerActions } = slice;\r\n\r\nexport const useSchedulerSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: schedulerSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useSchedulerSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { IsEmptyArray } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport {\r\n  findIsfilterInversed,\r\n  URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { initFilterData } from 'app/components/BasicTable/initFilterData';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { savedViewActions } from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useEffect, useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { SAVEDVIEW_SEARCH_KEY } from '../BasicFilter/SavedListsDropDown';\r\nimport { getDependencyFilters } from '../BasicFilter';\r\nimport { BasicTableProps, IRow } from './UnconfigurableTable';\r\nimport React from 'react';\r\n\r\nfunction visibleFiltersFilter<TRow>(item: IFilterSettings<TRow>) {\r\n  return (\r\n    (item.value !== undefined && !IsEmptyArray(item.value)) || item.notNullable\r\n  );\r\n}\r\n\r\nexport function filterHandler<TRow extends IRow, P extends object>(\r\n  Component: React.ComponentType<\r\n    BasicTableProps<TRow> & { exportNotConfigurable?: boolean }\r\n  >,\r\n  GetFiltersDefinition: GetPageFilters<TRow>,\r\n  other?: {\r\n    getDefaultFilter?: (user: IAuthenticatedUser) => URLSearchParams;\r\n    reservedQueryStringParameterNames?: string[];\r\n    isSidePanel?: boolean;\r\n    setFilters?: (appliedFilters: IFilterSettings<TRow>[] | undefined) => void;\r\n    getRequiredFilter?: (\r\n      search: string,\r\n      appSettings?: AppSettings | null,\r\n    ) => string | undefined;\r\n    getSelectedViewFilter?: (\r\n      search: string,\r\n      view: SavedViewSelected,\r\n    ) => string | undefined;\r\n    enableSavedLists?: boolean;\r\n  },\r\n): React.FC<P & BasicTableProps<TRow> & { exportNotConfigurable?: boolean }> {\r\n  return ({\r\n    onFilterChange,\r\n    availableFilters,\r\n    savedListSettings,\r\n    ...props\r\n  }: BasicTableProps<TRow> & { exportNotConfigurable?: boolean }) => {\r\n    const dispatch = useDispatch();\r\n    const { t } = useTranslation();\r\n    const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n    const showFiltersFn = React.useCallback(visibleFiltersFilter, []);\r\n    const {\r\n      isSidePanel,\r\n      getDefaultFilter,\r\n      setFilters,\r\n      reservedQueryStringParameterNames,\r\n      getRequiredFilter,\r\n      // getSelectedViewFilter,\r\n      enableSavedLists,\r\n    } = useMemo(() => other ?? {}, []);\r\n    if (authenticatedUser === undefined) {\r\n      return <>not authenticated</>;\r\n    }\r\n\r\n    useEffectOnMount(() => {\r\n      const cancelToken = { mounted: true };\r\n      const preset = getPresetFilter(\r\n        isSidePanel\r\n          ? undefined\r\n          : withoutReserved(location.search, reservedQueryStringParameterNames),\r\n        authenticatedUser,\r\n      );\r\n      const defaultSearch =\r\n        getDefaultFilter !== undefined && getDefaultFilter !== null\r\n          ? getDefaultFilter(authenticatedUser)?.toString()\r\n          : undefined;\r\n      let search =\r\n        isSidePanel || isEmptyOrWhitespace(preset)\r\n          ? defaultSearch ?? ''\r\n          : location.search;\r\n      const requiredSearch =\r\n        getRequiredFilter !== null && getRequiredFilter !== undefined\r\n          ? getRequiredFilter(search, appSettings)\r\n          : undefined;\r\n      search = requiredSearch === undefined ? search : requiredSearch ?? '';\r\n\r\n      const savedViewId = tryParseInt(\r\n        new URLSearchParamsCI(search).get(SAVEDVIEW_SEARCH_KEY),\r\n      );\r\n      dispatch(savedViewActions.selectSavedView(savedViewId));\r\n      // const savedViewSearch = !!getSelectedViewFilter ? getSelectedViewFilter()\r\n\r\n      const localizedFilters = getLocalizedFilters(search);\r\n      // let fooFilters = foo?.filter(\r\n      //   item => item.value !== undefined && !IsEmptyArray(item.value),\r\n      // );\r\n      // let depFilters = getDependencyFilters(fooFilters);\r\n      let visibleFilters = localizedFilters\r\n        ?.map(f => {\r\n          return {\r\n            ...f,\r\n            isInversed: findIsfilterInversed(\r\n              search,\r\n              f.urlKey ??\r\n                (typeof f.queryStringSerializer === 'string'\r\n                  ? f.queryStringSerializer\r\n                  : undefined),\r\n            ),\r\n          };\r\n        })\r\n        .filter(showFiltersFn);\r\n      let depFilters = getDependencyFilters(visibleFilters);\r\n\r\n      setAppliedFilters(depFilters);\r\n      setAppliedFilters(initFilterData(depFilters), cancelToken);\r\n      if (!isSidePanel) {\r\n        if (\r\n          isEmptyOrWhitespace(\r\n            withoutReserved(location.search, reservedQueryStringParameterNames),\r\n          )\r\n        ) {\r\n          if (defaultSearch !== undefined) {\r\n            const withReserved = addReserved(\r\n              new URLSearchParams(defaultSearch),\r\n              location.search,\r\n              reservedQueryStringParameterNames,\r\n            ).toString();\r\n            dispatch(\r\n              routerActions.replace({\r\n                pathname: location.pathname,\r\n                search: withReserved,\r\n              }),\r\n            );\r\n          }\r\n        }\r\n      }\r\n      return () => {\r\n        cancelToken.mounted = false;\r\n      };\r\n    });\r\n\r\n    const location = useLocation();\r\n    const removeEmptyFilters = (\r\n      filter: string | undefined,\r\n    ): string | undefined => {\r\n      if (filter === undefined || filter === null) {\r\n        return undefined;\r\n      } else {\r\n        const params = new URLSearchParams(filter);\r\n        let newParams = new URLSearchParams();\r\n        for (const [name, value] of params) {\r\n          if (value !== undefined && value !== null && value !== '') {\r\n            newParams.append(name, value);\r\n          }\r\n        }\r\n        return newParams.toString();\r\n      }\r\n    };\r\n\r\n    function getPresetFilter(\r\n      savedFilter: string | undefined | null,\r\n      user: IAuthenticatedUser,\r\n    ): string | undefined {\r\n      const saved =\r\n        savedFilter !== undefined &&\r\n        savedFilter !== null &&\r\n        !isEmptyOrWhitespace(savedFilter)\r\n          ? removeEmptyFilters(savedFilter)\r\n          : undefined;\r\n      const result = saved === undefined || saved === '' ? undefined : saved;\r\n\r\n      return result;\r\n    }\r\n\r\n    const appSettings = useSelector(selectAppSettings);\r\n    const settings = useSelector(selectglobalSettings);\r\n    const getLocalizedFilters = useMemo(() => {\r\n      const result = GetFiltersDefinition(\r\n        t,\r\n        appSettings,\r\n        authenticatedUser,\r\n        settings,\r\n      );\r\n      return result;\r\n    }, [appSettings, authenticatedUser, settings, t]);\r\n    const [appliedFilters, setAppliedFilters] = useAsyncExtendedState<\r\n      IFilterSettings<TRow>[] | undefined\r\n    >(undefined);\r\n\r\n    const allfilters = useMemo(() => {\r\n      var result = !appliedFilters\r\n        ? getLocalizedFilters('')\r\n        : getLocalizedFilters(\r\n            toURLSearchParams<TRow>(appliedFilters).toString(),\r\n          );\r\n      return result;\r\n    }, [getLocalizedFilters, appliedFilters]);\r\n\r\n    useEffect(() => {\r\n      setFilters?.(appliedFilters);\r\n    }, [appliedFilters, setFilters]);\r\n\r\n    const handleFilterChange: (\r\n      items: IFilterSettings<TRow>[],\r\n    ) => void = items => {\r\n      const currentSearch = toURLSearchParams<TRow>(appliedFilters ?? []);\r\n      if (!isSidePanel && reservedQueryStringParameterNames) {\r\n        const p = new URLSearchParams(location.search);\r\n        [...p.keys()].forEach(key => {\r\n          if (reservedQueryStringParameterNames.includes(key)) {\r\n            const val = p.get(key);\r\n            if (val !== null) {\r\n              currentSearch.set(key, val);\r\n            }\r\n          }\r\n        });\r\n      }\r\n      const filterSearch = toURLSearchParams<TRow>(items);\r\n      for (const key of filterSearch.keys()) {\r\n        const filterValue = filterSearch.get(key);\r\n        if (filterValue !== null) {\r\n          currentSearch.set(key, filterValue);\r\n        }\r\n      }\r\n      const originalSearch = new URLSearchParamsCI(location.search);\r\n\r\n      // clear saved view selection when instrument selection changes\r\n      if (enableSavedLists && savedListSettings !== undefined) {\r\n        if (savedListSettings?.savedListSerializedKey !== undefined) {\r\n          const currentInstrumentSelection = currentSearch.get(\r\n            savedListSettings?.savedListSerializedKey,\r\n          );\r\n          const originalInstrumentSelection = originalSearch.get(\r\n            savedListSettings?.savedListSerializedKey,\r\n          );\r\n          if (currentInstrumentSelection !== originalInstrumentSelection) {\r\n            // remove the selection from the search\r\n            currentSearch.delete(SAVEDVIEW_SEARCH_KEY);\r\n            // clear redux state\r\n            dispatch(savedViewActions.selectMyList());\r\n          }\r\n        }\r\n      }\r\n\r\n      setAppliedFilters(getDependencyFilters([...items]));\r\n      // push current filter state to the URL search if it's not equivalent\r\n      if (!originalSearch.equals(currentSearch) && !isSidePanel) {\r\n        dispatch(\r\n          routerActions.replace({\r\n            pathname: location.pathname,\r\n            search: currentSearch.toString(),\r\n          }),\r\n        );\r\n      }\r\n    };\r\n\r\n    return (\r\n      <>\r\n        {appliedFilters !== undefined && (\r\n          <Component\r\n            availableFilters={allfilters}\r\n            appliedFilters={appliedFilters}\r\n            onFilterChange={handleFilterChange}\r\n            savedListSettings={savedListSettings}\r\n            {...(props as BasicTableProps<TRow> & {\r\n              exportNotConfigurable?: boolean;\r\n            })}\r\n          />\r\n        )}\r\n      </>\r\n    );\r\n  };\r\n}\r\n\r\nconst withoutReserved = (\r\n  search: string,\r\n  reserved: string[] | undefined,\r\n): string => {\r\n  if (reserved === undefined || reserved.length === 0) return search;\r\n  const originalSearch = new URLSearchParamsCI(search);\r\n  reserved.forEach(f => originalSearch.delete(f));\r\n  return originalSearch.toString();\r\n};\r\n\r\nconst addReserved = (\r\n  current: URLSearchParams,\r\n  search: string,\r\n  reserved: string[] | undefined,\r\n) => {\r\n  if (reserved === undefined || reserved.length === 0) return current;\r\n  const p = new URLSearchParams(search);\r\n  [...p.keys()].forEach(key => {\r\n    if (reserved.includes(key)) {\r\n      const val = p.get(key);\r\n      if (val !== null) {\r\n        current.set(key, val);\r\n      }\r\n    }\r\n  });\r\n  return current;\r\n};\r\n\r\n// function getIgnoredSearch(search: string, ignore: string[]) {\r\n//   var p = new URLSearchParams(search);\r\n//   [...p.keys()].forEach(key => {\r\n//     if (!ignore.includes(key)) {\r\n//       p.delete(key);\r\n//     }\r\n//   });\r\n\r\n//   return p;\r\n// }\r\n","/**\r\n *\r\n * FormUserPicker\r\n *\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { UserPicker, UserUrl } from '../pickers/AutocompletePickers/UserPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport const FormUserPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IUserFilterDto | null> & {\r\n  selectArray?: Array<keyof IUserFilterDto>;\r\n  urlType?: UserUrl;\r\n} & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<IUserFilterDto | null>(props);\r\n  return (\r\n    <>\r\n      <UserPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        disabled={props.disabled}\r\n        predicates={props.predicates}\r\n        selectArray={props.selectArray}\r\n        urlType={props.urlType}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { Collapse } from '@material-ui/core';\r\nimport { Alert } from '@material-ui/lab';\r\nimport * as React from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { Caption } from '../Typography';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\n\r\nexport type AlertVariant = 'success' | 'info' | 'warning' | 'error';\r\nexport type AlertContentType = {\r\n  message?: string;\r\n  type: AlertVariant;\r\n  closable: boolean;\r\n  children?: React.ReactNode;\r\n  variant?: 'outlined' | 'filled' | 'standard';\r\n};\r\n\r\nexport interface BasicAlertProps {\r\n  content: AlertContentType;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  className?: string;\r\n  showMore?: boolean;\r\n  style?: React.CSSProperties;\r\n  collapsedMinHeight?: number;\r\n  onClose?: (event: React.SyntheticEvent<Element, Event>) => void;\r\n}\r\n\r\nconst MessageText = styled.div`\r\n  ${(props: { showMore: boolean; minHeight: number }) => {\r\n    return css`\r\n      display: block;\r\n      overflow: ${props.showMore ? 'auto' : 'hidden'};\r\n      text-overflow: ellipsis;\r\n      white-space: normal;\r\n      word-wrap: normal;\r\n      -webkit-box-orient: horizontal;\r\n      max-height: ${props.showMore ? '300px' : props.minHeight + 'px'};\r\n    `;\r\n  }}\r\n`;\r\nconst defaultIconMapping = {\r\n  success: <Icon icon={['fal', 'circle-check']} fontSize=\"inherit\" size=\"xs\" />,\r\n  warning: (\r\n    <Icon icon={['fal', 'triangle-exclamation']} fontSize=\"inherit\" size=\"xs\" />\r\n  ),\r\n  error: (\r\n    <Icon icon={['fal', 'circle-quarters']} fontSize=\"inherit\" size=\"xs\" />\r\n  ),\r\n  info: (\r\n    <Icon icon={['fal', 'circle-exclamation']} fontSize=\"inherit\" size=\"xs\" />\r\n  ),\r\n};\r\nexport function BasicAlert(props: BasicAlertProps) {\r\n  const {\r\n    content,\r\n    variant,\r\n    className,\r\n    showMore,\r\n    collapsedMinHeight,\r\n    style,\r\n    onClose,\r\n  } = props;\r\n  const [isShowMore, setIsShowMore] = React.useState(false);\r\n  const toggleReadMore = () => setIsShowMore(show => !show);\r\n  const [open, setOpen] = React.useState(true);\r\n  return (\r\n    <Collapse in={open}>\r\n      <Alert\r\n        style={style}\r\n        variant={variant || content.variant}\r\n        severity={content.type}\r\n        className={clsx(className, { showMore: !showMore })}\r\n        iconMapping={defaultIconMapping}\r\n        onClose={onClose}\r\n        action={\r\n          <React.Fragment>\r\n            {content.closable && (\r\n              <IconButton\r\n                aria-label=\"close\"\r\n                variant=\"text\"\r\n                size=\"small\"\r\n                shape=\"square\"\r\n                onClick={() => {\r\n                  setOpen(false);\r\n                }}\r\n              >\r\n                <Icon icon=\"times\" />\r\n              </IconButton>\r\n            )}\r\n            {showMore && (\r\n              <IconButton\r\n                aria-label=\"more\"\r\n                variant=\"text\"\r\n                size=\"small\"\r\n                shape=\"square\"\r\n                title={isShowMore ? 'show less' : 'show more'}\r\n                onClick={() => {\r\n                  toggleReadMore();\r\n                }}\r\n              >\r\n                <Icon\r\n                  icon={\r\n                    isShowMore ? 'chevron-double-up' : 'chevron-double-down'\r\n                  }\r\n                />\r\n              </IconButton>\r\n            )}\r\n          </React.Fragment>\r\n        }\r\n      >\r\n        {showMore ? (\r\n          <MessageText\r\n            showMore={isShowMore}\r\n            minHeight={collapsedMinHeight || 45}\r\n          >\r\n            {!!content.message && <Caption>{content.message}</Caption>}\r\n            {!!content.children && (\r\n              <React.Fragment>{content.children}</React.Fragment>\r\n            )}\r\n          </MessageText>\r\n        ) : (\r\n          <React.Fragment>\r\n            {!!content.message && <Caption>{content.message}</Caption>}\r\n            {!!content.children && (\r\n              <React.Fragment>{content.children}</React.Fragment>\r\n            )}\r\n          </React.Fragment>\r\n        )}\r\n      </Alert>\r\n    </Collapse>\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { workOrderActions as actions } from '.';\r\nimport { WorkOrderApi as api } from 'api/WorkOrderApi';\r\nimport { FileStoreApi } from 'api/fileStoreApi';\r\nimport {\r\n  ConvertModelToEntity,\r\n  ConvertNewWorkOrdersToModel,\r\n  DowntimeOverlaps,\r\n  ReservationsOfflineData,\r\n  SendEmailOnOffline,\r\n  WorkOrderDetailsState,\r\n  WorkOrderGlobalState,\r\n  WorkOrderQueryStringParameters,\r\n  WorkOrderResponse,\r\n} from './types';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { AxiosError } from 'axios';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from '..';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { selectSavedLinkedOrders, selectUpdateAllRecurrent } from './selectors';\r\nimport { FileTypes } from 'api/odata/generated/enums/FileTypes';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { getFilesModel, UpdateFilesModel } from 'utils/fileStoreHelper';\r\nimport { IsEntity } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { UserProfileSettings } from 'types/UserProfileSettings';\r\nimport { routerActions } from 'connected-react-router';\r\n\r\nfunction* doInitCreate(action: PayloadAction<WorkOrderQueryStringParameters>) {\r\n  try {\r\n    const data = yield call(api.initCreateData, action.payload);\r\n    yield put(actions.initWorkOrder_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initWorkOrder_Error(error));\r\n  }\r\n}\r\nfunction* doInitUpdate(action: PayloadAction<WorkOrderQueryStringParameters>) {\r\n  try {\r\n    const data: IWorkOrderDetailsDto = yield call(\r\n      api.initUpdateData,\r\n      action.payload,\r\n    );\r\n    if (!data || data === null) {\r\n      yield put(routerActions.push({ pathname: '/notallowed', search: '' }));\r\n    } else {\r\n      // set the offline event start to value provided through the params\r\n      // for example, if an alert is edited from the scheduler, params will have an alert id and new start/end dates\r\n      // these dates should override current alert offline event start/end\r\n      // the values have to pass through formatQueryStringDate since alert details does not accept ISO properly and will shift the dates otherwise\r\n      if (action.payload.offStart !== undefined) {\r\n        data.OfflineEventStart = action.payload.offStart;\r\n      }\r\n      if (action.payload.offEnd !== undefined) {\r\n        data.OfflineEventEnd = action.payload.offEnd;\r\n      }\r\n\r\n      yield put(actions.initUpdateWorkOrder_Success(data));\r\n    }\r\n  } catch (error: unknown) {\r\n    yield put(actions.initUpdateWorkOrder_Error(Error));\r\n  }\r\n}\r\nfunction* doCreate(action: PayloadAction<WorkOrderGlobalState>) {\r\n  const user: AuthenticatedUser | undefined = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const httpPayloads: IWorkOrderDetailsDto[] = ConvertNewWorkOrdersToModel(\r\n    action.payload,\r\n    user,\r\n  );\r\n  const submissionFormFiles =\r\n    action.payload.workOrderDetails.SubmissionFormFiles;\r\n  const savedLinkeCalibrations = yield select(selectSavedLinkedOrders);\r\n  //console.log(httpPayloads);\r\n  try {\r\n    let responses: WorkOrderResponse[] = [];\r\n    for (let idx = 0; idx < httpPayloads.length; idx++) {\r\n      const result = yield call(api.insertWorkOrder, httpPayloads[idx]);\r\n      responses.push(result);\r\n    }\r\n    let fileResponses: IResponseType[] = [];\r\n    if (submissionFormFiles.length > 0) {\r\n      let resp = responses.filter(f => f.Id !== undefined);\r\n      for (let i = 0; i < resp.length; i++) {\r\n        let data = getFilesModel(\r\n          [],\r\n          submissionFormFiles,\r\n          FileTypes.AlertTypeFile,\r\n          resp[i].Id || -1,\r\n          CustomFormTypeEnum.AlertType,\r\n          1,\r\n          null,\r\n          null,\r\n          resp[i].WorkOrderTypeId || null,\r\n        );\r\n        let fileRes = yield call(FileStoreApi.saveFormFiles, data);\r\n        fileResponses.push(fileRes);\r\n      }\r\n    }\r\n\r\n    let responseErrors = responses\r\n      .filter(err => err.ErrorMessages.length > 0)\r\n      .flatMap(f => f.ErrorMessages);\r\n\r\n    if (fileResponses.length > 0) {\r\n      fileResponses.forEach(f => {\r\n        if (f.ErrorMessages.length > 0) {\r\n          responseErrors = [...responseErrors, ...f.ErrorMessages];\r\n        }\r\n      });\r\n    }\r\n    let responseWarnings = responses\r\n      .filter(err => err.WarningMessages.length > 0)\r\n      .flatMap(f => f.WarningMessages);\r\n    let responseSuccess = responses\r\n      .filter(err => err.SuccessMessages.length > 0)\r\n      .flatMap(f => f.SuccessMessages);\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: 'workOrderInsertError',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (responseWarnings.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseWarnings.map(item => {\r\n            return {\r\n              key: 'workOrderInsertWarning',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n\r\n    if (responseSuccess.length > 0) {\r\n      yield put(layoutActions.setNotSavedChanges(false));\r\n      yield put(actions.setSaveNewComments(true));\r\n      yield put(\r\n        actions.setOrderNumbers(\r\n          responses.map(f => f.Id ?? 0).filter(f => f !== 0),\r\n        ),\r\n      );\r\n      for (let i = 0; i < responseSuccess.length; i++) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'workOrderInsertSuccess_' + i,\r\n            message: responseSuccess[i],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: responses[i].Id,\r\n              created: true,\r\n              itemName: i18next.t(translations.WorkOrdersPageName),\r\n              detailsType: RenderPageType.WorkOrderDetails,\r\n              detailsTypeProps: {\r\n                queryParams: {\r\n                  id: '' + responses[i].Id,\r\n                } as WorkOrderQueryStringParameters,\r\n                useSidePanel: true,\r\n              } as WorkOrderDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        if (savedLinkeCalibrations.length > 0) {\r\n          for (let idx = 0; idx < savedLinkeCalibrations.length; idx++) {\r\n            for (let widx = 0; widx < responses.length; widx++) {\r\n              yield put(\r\n                actions.addLinkedCalibration({\r\n                  id: responses[widx].Id ?? 0,\r\n                  link: savedLinkeCalibrations[idx].Id,\r\n                }),\r\n              );\r\n            }\r\n          }\r\n        }\r\n      }\r\n      yield put(\r\n        appSettingsActions.updateUserProfileSettings({\r\n          key: 'LastUsedDowntimeType',\r\n          model: {\r\n            UserName: user?.Id,\r\n            Key: 'LastUsedDowntimeType',\r\n            Value: action.payload.workOrderDetails.WorkOrderType?.Id?.toString(),\r\n          } as UserProfileSettings,\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    //REPLACED WITH THIS^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    //TO SHOW MULTIPLE NOTIFICATIONS FOR EACH CREATED WORK ORDER\r\n    /* if (responseSuccess.length > 0) {\r\n      let res = responses[0];\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'workOrderInsertSuccess',\r\n          message: responseSuccess[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: res.Id,\r\n            created: true,\r\n            itemName: i18next.t(translations.WorkOrdersPageName),\r\n            detailsType: RenderPageType.workOrderDetails,\r\n            detailsTypeProps: {\r\n              queryParams: {\r\n                id: '' + res.Id,\r\n              } as WorkOrderQueryStringParameters,\r\n              useSidePanel: true,\r\n            } as WorkOrderDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    } */\r\n    let hasErrors =\r\n      responses.filter(f => f.ErrorMessages.length > 0).length > 0;\r\n    let hasResOffline =\r\n      responses.filter(f => f.sendEmailOnOffline === true).length > 0;\r\n    let offData = responses\r\n      .map(m => {\r\n        return isNullOrUndefined<ReservationsOfflineData>(\r\n          m.ReservationOffline[0],\r\n        )\r\n          ? undefined\r\n          : {\r\n              AlertId: m.ReservationOffline[0]?.AlertId,\r\n              offStart: dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(m.ReservationOffline[0]?.offStart),\r\n              ),\r\n              offEnd: dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(m.ReservationOffline[0]?.offEnd),\r\n              ),\r\n              ReasonName: m.ReservationOffline[0].ReasonName,\r\n              Remarks: m.ReservationOffline[0].Remarks,\r\n              reservationIds: m.ReservationOffline[0].reservationIds,\r\n            };\r\n      })\r\n      .filter(f => f !== undefined) as ReservationsOfflineData[];\r\n    yield put(\r\n      actions.createWorkOrder_Success({\r\n        hasErrors: hasErrors,\r\n        sendEmailOnOffline: hasResOffline,\r\n        reservationOffline: offData,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'workOrderInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createWorkOrder_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: WorkOrderDetailsState;\r\n    original: WorkOrderDetailsState | undefined;\r\n    originalSubFormFiles: IFormFileValue[];\r\n    originalStaffFormFiles: IFormFileValue[];\r\n  }>,\r\n) {\r\n  const httpPayloads: IWorkOrderDetailsDto = ConvertModelToEntity(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n  const submissionFormFiles = action.payload.current.SubmissionFormFiles;\r\n  const staffFormFiles = action.payload.current.StaffFormFiles;\r\n  const updateAll = yield select(selectUpdateAllRecurrent);\r\n  httpPayloads.UpdateAll = updateAll;\r\n  let filesData: UpdateFilesModel[] = [];\r\n  if (\r\n    submissionFormFiles.length > 0 ||\r\n    action.payload.originalSubFormFiles.length > 0\r\n  ) {\r\n    filesData = getFilesModel(\r\n      action.payload.originalSubFormFiles,\r\n      submissionFormFiles,\r\n      FileTypes.AlertTypeFile,\r\n      action.payload.current.Id,\r\n      CustomFormTypeEnum.AlertType,\r\n      updateAll === true ? 3 : 1,\r\n      action.payload.current.RecurringAssetId,\r\n      action.payload.current.RecurringGroupId,\r\n      action.payload.current.WorkOrderType?.Id || null,\r\n    );\r\n  }\r\n  if (\r\n    staffFormFiles.length > 0 ||\r\n    action.payload.originalStaffFormFiles.length > 0\r\n  ) {\r\n    filesData = [\r\n      ...filesData,\r\n      ...getFilesModel(\r\n        action.payload.originalStaffFormFiles,\r\n        staffFormFiles,\r\n        FileTypes.AlertFile,\r\n        action.payload.current.Id,\r\n        CustomFormTypeEnum.Alert,\r\n        updateAll === true ? 3 : 1,\r\n        action.payload.current.RecurringAssetId,\r\n        action.payload.current.RecurringGroupId,\r\n        null,\r\n      ),\r\n    ];\r\n  }\r\n  try {\r\n    const results = yield call(api.updateWorkOrder, httpPayloads);\r\n    let response = results as WorkOrderResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (filesData.length > 0) {\r\n      let fileRes = yield call(FileStoreApi.updateFormFiles, filesData);\r\n      let fileResponses = fileRes as IResponseType;\r\n      if (fileResponses.ErrorMessages.length > 0) {\r\n        respErrors = [...respErrors, ...fileResponses.ErrorMessages];\r\n      }\r\n    }\r\n\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'workOrderUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'workOrderUpdateWarn',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'workOrderUpdate',\r\n          message: response.SuccessMessages[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: response.Id,\r\n            created: false,\r\n            itemName: i18next.t(translations.WorkOrdersPageName),\r\n            detailsType: RenderPageType.WorkOrderDetails,\r\n            detailsTypeProps: {\r\n              queryParams: {\r\n                id: '' + response.Id,\r\n              } as WorkOrderQueryStringParameters,\r\n              useSidePanel: true,\r\n            } as WorkOrderDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n      yield put(layoutActions.setNotSavedChanges(false));\r\n      if (response.AutoCreatedOrders.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: `workOrderUpdateAuto-${response.AutoCreatedOrders[0].AlertId}`,\r\n            message: response.SuccessMessages[0],\r\n            messageTypeProps: {\r\n              Id: response.Id,\r\n              created: false,\r\n              itemName: 'The following next Work Order',\r\n              itemEndName: `has been created and set to start at ${\r\n                dateUtils.longDateTimeFormat(\r\n                  response.AutoCreatedOrders[0].Date,\r\n                ) ?? ''\r\n              }`,\r\n              detailsType: RenderPageType.WorkOrderDetails,\r\n              detailsTypeProps: {\r\n                queryParams: {\r\n                  id: '' + response.AutoCreatedOrders[0].AlertId,\r\n                } as WorkOrderQueryStringParameters,\r\n                useSidePanel: true,\r\n              } as WorkOrderDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    let hasResOffline = response.sendEmailOnOffline === true;\r\n    let offData =\r\n      response.ReservationOffline.length > 0\r\n        ? response.ReservationOffline.map(m => {\r\n            return {\r\n              AlertId: m.AlertId,\r\n              offStart: dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(m.offStart),\r\n              ),\r\n              offEnd: dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(m.offEnd),\r\n              ),\r\n              ReasonName: m.ReasonName,\r\n              Remarks: m.Remarks,\r\n              reservationIds: m.reservationIds,\r\n            };\r\n          })\r\n        : ([] as ReservationsOfflineData[]);\r\n    yield put(\r\n      actions.updateWorkOrder_Success({\r\n        hasErrors: hasErrors,\r\n        sendEmailOnOffline: hasResOffline,\r\n        reservationOffline: offData,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'workOrderUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateWorkOrder_Error(Error));\r\n  }\r\n}\r\nfunction* doSendReservationsOfflineEmail(\r\n  action: PayloadAction<{\r\n    cancel: boolean;\r\n    deleted: boolean;\r\n    insert: boolean;\r\n    doNotNotifyUsers: boolean;\r\n    allAffectedUsers: boolean;\r\n    reservationOffline: ReservationsOfflineData[];\r\n  }>,\r\n) {\r\n  try {\r\n    const paload = {\r\n      cancel: action.payload.cancel,\r\n      deleted: action.payload.deleted,\r\n      insert: action.payload.insert,\r\n      doNotNotifyUsers: action.payload.doNotNotifyUsers,\r\n      allAffectedUsers: action.payload.allAffectedUsers,\r\n      sendData: action.payload.reservationOffline,\r\n    } as SendEmailOnOffline;\r\n    const result = yield call(api.sendEmailOnOffline, paload);\r\n    let response = result as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'sendOfflineEmail',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'sendOfflineEmail',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.SuccessMessages.map(item => {\r\n            return {\r\n              key: 'sendOfflineEmail',\r\n              message: item,\r\n              variant: 'success',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    yield put(\r\n      actions.sendReservationsOfflineEmail_Success(\r\n        response.ErrorMessages.length > 0,\r\n      ),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'sendOfflineEmail',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.sendReservationsOfflineEmail_Error(Error));\r\n  }\r\n}\r\nfunction* doRemoveFromLinked(action: PayloadAction<number>) {\r\n  const res = yield call(api.removefromLinks, action.payload);\r\n  if (typeof res === 'number') {\r\n    yield put(actions.removeFromLinked_success(res));\r\n    return;\r\n  }\r\n  const response = res as IResponseType;\r\n  yield put(\r\n    appSettingsActions.addNotifications(\r\n      response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n    ),\r\n  );\r\n}\r\nfunction* doAddToLinked(action: PayloadAction<{ id: number; link: number }>) {\r\n  try {\r\n    const res = yield call(api.addToLinked, action.payload);\r\n    if (IsEntity(res)) {\r\n      yield put(actions.addToLink_success(res));\r\n      return;\r\n    }\r\n    const response = res.value as IResponseType;\r\n    yield put(\r\n      appSettingsActions.addNotifications(\r\n        response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n      ),\r\n    );\r\n  } catch (error) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doRemoveLinkedCalibration(\r\n  action: PayloadAction<{ id: number; link: number }>,\r\n) {\r\n  const res = yield call(api.removeLinkedCalibration, action.payload);\r\n  const response = res as IResponseType;\r\n  if (response.ErrorMessages.length > 0) {\r\n    yield put(\r\n      appSettingsActions.addNotifications(\r\n        response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n      ),\r\n    );\r\n  }\r\n  yield put(actions.removeLinkedCalibration_success());\r\n}\r\nfunction* doaddLinkedCalibration(\r\n  action: PayloadAction<{ id: number; link: number }>,\r\n) {\r\n  try {\r\n    const res = yield call(api.addLinkedToCalibration, action.payload);\r\n    const response = res as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(r => ({ message: r, variant: 'error' })),\r\n        ),\r\n      );\r\n    }\r\n    yield put(actions.addLinkedCalibration_success());\r\n  } catch (error) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doSetAny(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof WorkOrderDetailsState;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setAnyValueSuccess(action.payload));\r\n}\r\nfunction* doSetCreatedOrders(action: PayloadAction<number[]>) {\r\n  yield put(actions.setOrderNumbers_success(action.payload));\r\n}\r\nfunction* doCheckDowntimeOverlaps(action: PayloadAction<number>) {\r\n  try {\r\n    const res = yield call(api.getOverlappingDowntimes, action.payload);\r\n    const response = res as DowntimeOverlaps[];\r\n    yield put(actions.checkDowntimeOverlaps_Success(response));\r\n  } catch (error) {\r\n    yield put(actions.checkDowntimeOverlaps_Success(undefined));\r\n  }\r\n}\r\nexport function* workOrderSaga() {\r\n  yield takeLatest(actions.initWorkOrder.type, doInitCreate);\r\n  yield takeLatest(actions.initUpdateWorkOrder.type, doInitUpdate);\r\n  yield takeLatest(actions.createWorkOrder.type, doCreate);\r\n  yield takeLatest(actions.updateWorkOrder.type, doUpdate);\r\n  yield takeLatest(\r\n    actions.sendReservationsOfflineEmail.type,\r\n    doSendReservationsOfflineEmail,\r\n  );\r\n  yield takeLatest(actions.removeFromLinked.type, doRemoveFromLinked);\r\n  yield takeLatest(actions.addToLinked.type, doAddToLinked);\r\n  yield takeLatest(\r\n    actions.removeLinkedCalibration.type,\r\n    doRemoveLinkedCalibration,\r\n  );\r\n  yield takeLatest(actions.addLinkedCalibration.type, doaddLinkedCalibration);\r\n  yield takeLatest(actions.setAnyValue.type, doSetAny);\r\n  yield takeLatest(actions.setOrderNumbers.type, doSetCreatedOrders);\r\n  yield takeLatest(actions.checkDowntimeOverlaps.type, doCheckDowntimeOverlaps);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { Entity } from 'types/common';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { workOrderSaga } from './saga';\r\nimport {\r\n  ConvertEntityToModel,\r\n  DowntimeOverlaps,\r\n  ReservationsOfflineData,\r\n  WorkOrderDetailsState,\r\n  WorkOrderGlobalState,\r\n  WorkOrderQueryStringParameters,\r\n  WorkOrderReadonlyState,\r\n  WorkOrderState,\r\n} from './types';\r\n\r\nexport const initialState: WorkOrderState = {\r\n  processing: false,\r\n  createState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  updateState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  reservationOffline: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  sendEmailOnOffline: false,\r\n  readonlyState: undefined,\r\n  updateAllRecurrent: false,\r\n  valueHandler: undefined,\r\n  doSaveNewComments: undefined,\r\n  createdOrders: [],\r\n  savedLinkedOrders: [],\r\n  calibrationsChanged: undefined,\r\n  linksProcessing: undefined,\r\n  downtimeOverlaps: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'workOrder',\r\n  initialState,\r\n  reducers: {\r\n    initWorkOrder(\r\n      state,\r\n      action: PayloadAction<WorkOrderQueryStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.downtimeOverlaps = undefined;\r\n    },\r\n    initWorkOrder_Success(state, action: PayloadAction<IWorkOrderDetailsDto>) {\r\n      state.processing = false;\r\n      state.createState.data = ConvertEntityToModel(\r\n        action.payload,\r\n        action.payload.ToDown,\r\n      );\r\n    },\r\n    initWorkOrder_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    initUpdateWorkOrder(\r\n      state,\r\n      action: PayloadAction<WorkOrderQueryStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUpdateWorkOrder_Success(\r\n      state,\r\n      action: PayloadAction<IWorkOrderDetailsDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.updateState.data = ConvertEntityToModel(action.payload, undefined);\r\n      state.readonlyState = action.payload as WorkOrderReadonlyState;\r\n    },\r\n    initUpdateWorkOrder_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n      // state.updateState.data = undefined;\r\n      // state.readonlyState = undefined;\r\n    },\r\n    createWorkOrder(state, action: PayloadAction<WorkOrderGlobalState>) {\r\n      state.createState.processing = true;\r\n      state.createState.completed = undefined;\r\n      state.createState.hasErrors = undefined;\r\n    },\r\n    createWorkOrder_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        sendEmailOnOffline: boolean;\r\n        reservationOffline: ReservationsOfflineData[];\r\n      }>,\r\n    ) {\r\n      state.createState.processing = false;\r\n      state.createState.hasErrors = action.payload.hasErrors;\r\n      state.createState.completed = true;\r\n\r\n      state.reservationOffline.data = action.payload.reservationOffline;\r\n      state.sendEmailOnOffline = action.payload.sendEmailOnOffline;\r\n    },\r\n    createWorkOrder_Error(state, action: PayloadAction<any>) {\r\n      state.createState.processing = false;\r\n      state.createState.completed = true;\r\n      state.createState.hasErrors = true;\r\n    },\r\n    updateWorkOrder(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: WorkOrderDetailsState;\r\n        original: WorkOrderDetailsState | undefined;\r\n        originalSubFormFiles: IFormFileValue[];\r\n        originalStaffFormFiles: IFormFileValue[];\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateWorkOrder_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        sendEmailOnOffline: boolean;\r\n        reservationOffline: ReservationsOfflineData[];\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.hasErrors = action.payload.hasErrors;\r\n      state.updateState.completed = true;\r\n      state.reservationOffline.data = action.payload.reservationOffline;\r\n      state.sendEmailOnOffline = action.payload.sendEmailOnOffline;\r\n    },\r\n    updateWorkOrder_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      state.updateState.hasErrors = true;\r\n    },\r\n    resetCreateWorkOrderState(state, action: PayloadAction) {\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.OfflineEventStart = undefined;\r\n      state.OfflineEventEnd = undefined;\r\n      state.savedLinkedOrders = [];\r\n      state.downtimeOverlaps = undefined;\r\n    },\r\n    resetUpdateWorkOrderState(state, action: PayloadAction) {\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.readonlyState = undefined;\r\n      state.savedLinkedOrders = [];\r\n      state.downtimeOverlaps = undefined;\r\n    },\r\n    resetReservationsOfflineState(state, action: PayloadAction) {\r\n      state.sendEmailOnOffline = false;\r\n      state.reservationOffline = {\r\n        data: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n        processing: false,\r\n      };\r\n      state.OfflineEventStart = undefined;\r\n      state.OfflineEventEnd = undefined;\r\n    },\r\n    sendReservationsOfflineEmail(\r\n      state,\r\n      action: PayloadAction<{\r\n        cancel: boolean;\r\n        deleted: boolean;\r\n        insert: boolean;\r\n        doNotNotifyUsers: boolean;\r\n        allAffectedUsers: boolean;\r\n        reservationOffline: ReservationsOfflineData[];\r\n      }>,\r\n    ) {\r\n      state.reservationOffline.processing = true;\r\n      state.reservationOffline.completed = undefined;\r\n      state.reservationOffline.hasErrors = undefined;\r\n    },\r\n    sendReservationsOfflineEmail_Success(\r\n      state,\r\n      action: PayloadAction<boolean>,\r\n    ) {\r\n      state.reservationOffline.processing = false;\r\n      state.reservationOffline.hasErrors = action.payload;\r\n      state.reservationOffline.completed = true;\r\n    },\r\n    sendReservationsOfflineEmail_Error(state, action: PayloadAction<any>) {\r\n      state.reservationOffline.processing = false;\r\n      state.reservationOffline.completed = true;\r\n      state.reservationOffline.hasErrors = true;\r\n    },\r\n    setUpdateAllRecurrent(state, action: PayloadAction<boolean>) {\r\n      state.updateAllRecurrent = action.payload;\r\n    },\r\n    removeFromLinked(state, action: PayloadAction<number>) {\r\n      state.processing = true;\r\n    },\r\n    removeFromLinked_success(state, action: PayloadAction<number>) {\r\n      state.processing = false;\r\n      if (state.readonlyState === undefined) return;\r\n      state.readonlyState.LinkedAlerts = state.readonlyState.LinkedAlerts.filter(\r\n        f => f.Id !== action.payload,\r\n      );\r\n    },\r\n    addToLinked(state, action: PayloadAction<{ id: number; link: number }>) {\r\n      state.processing = true;\r\n    },\r\n    addToLink_success(state, action: PayloadAction<Entity<number>>) {\r\n      state.processing = false;\r\n      if (state.readonlyState === undefined) return;\r\n      state.readonlyState.LinkedAlerts.push(action.payload);\r\n    },\r\n    setAnyValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof WorkOrderDetailsState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setAnyValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof WorkOrderDetailsState;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.valueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetValueHandler(state, action: PayloadAction) {\r\n      state.valueHandler = undefined;\r\n    },\r\n    /**\r\n     * Sets the offline event start\r\n     * @param state\r\n     * @param action\r\n     */\r\n    setOfflineEventStart(state, action: PayloadAction<Timestamp | undefined>) {\r\n      state.OfflineEventStart = action.payload;\r\n    },\r\n    /**\r\n     * Sets the offline event end\r\n     * @param state\r\n     * @param action\r\n     */\r\n    setOfflineEventEnd(state, action: PayloadAction<Timestamp | undefined>) {\r\n      state.OfflineEventEnd = action.payload;\r\n    },\r\n    setSaveNewComments(state, action: PayloadAction<boolean | undefined>) {\r\n      state.doSaveNewComments = action.payload;\r\n    },\r\n    setOrderNumbers(state, action: PayloadAction<number[]>) {},\r\n    setOrderNumbers_success(state, action: PayloadAction<number[]>) {\r\n      state.createdOrders = action.payload;\r\n    },\r\n    setSavedLinkedOrders(\r\n      state,\r\n      action: PayloadAction<Array<IWorkOrderDetailsDto>>,\r\n    ) {\r\n      state.savedLinkedOrders = action.payload;\r\n    },\r\n    resetSavedLinkedOrders(state, action: PayloadAction) {\r\n      state.savedLinkedOrders = [];\r\n    },\r\n    removeLinkedCalibration(\r\n      state,\r\n      action: PayloadAction<{ id: number; link: number }>,\r\n    ) {\r\n      state.linksProcessing = true;\r\n    },\r\n    removeLinkedCalibration_success(state, action: PayloadAction) {\r\n      state.linksProcessing = false;\r\n      state.calibrationsChanged = true;\r\n    },\r\n    addLinkedCalibration(\r\n      state,\r\n      action: PayloadAction<{ id: number; link: number }>,\r\n    ) {\r\n      state.linksProcessing = true;\r\n    },\r\n    addLinkedCalibration_success(state, action: PayloadAction) {\r\n      state.linksProcessing = false;\r\n      state.calibrationsChanged = true;\r\n    },\r\n    setCalibrationChanged(state, action: PayloadAction<boolean | undefined>) {\r\n      state.calibrationsChanged = action.payload;\r\n    },\r\n    checkDowntimeOverlaps(state, action: PayloadAction<number>) {},\r\n    checkDowntimeOverlaps_Success(\r\n      state,\r\n      action: PayloadAction<DowntimeOverlaps[] | undefined>,\r\n    ) {\r\n      state.downtimeOverlaps = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: workOrderActions } = slice;\r\n\r\nexport const useWorkOrderSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: workOrderSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { InputAdornment } from '@material-ui/core';\r\nimport { TextField as BasicTextField } from 'app/components/TextField';\r\nimport * as React from 'react';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { EditorProps } from '../../EditableCell';\r\n\r\n// 'ShortText':\r\n\r\nexport function TextField({\r\n  parentValue,\r\n  error,\r\n  helperText,\r\n  info,\r\n  autoFocus,\r\n  ...props\r\n}: EditorProps<string>) {\r\n  const handleChange: React.ChangeEventHandler<\r\n    HTMLInputElement | HTMLTextAreaElement\r\n  > = e => {\r\n    props.onChange(e.target.value);\r\n  };\r\n\r\n  return (\r\n    <>\r\n      <BasicTextField\r\n        className={'textTable'}\r\n        InputProps={{\r\n          disableUnderline: true,\r\n          endAdornment: ((!!info && info !== '') ||\r\n            (error && !!helperText)) && (\r\n            <InputAdornment position=\"end\">\r\n              {!!info && info !== '' && <InfoIcon title={info} error={error} />}\r\n              {error && helperText && (\r\n                <InfoIcon title={helperText || ''} error={error} />\r\n              )}\r\n            </InputAdornment>\r\n          ),\r\n        }}\r\n        variant=\"standard\"\r\n        fullWidth\r\n        error={error}\r\n        inputProps={{\r\n          type: 'text',\r\n        }}\r\n        value={props.value || ''}\r\n        onChange={handleChange}\r\n        onBlur={props.onBlur}\r\n        id={props.id}\r\n        label={props.label}\r\n        autoFocus={autoFocus}\r\n        name={props.name}\r\n      />\r\n      {/* <StyledInput\r\n        type=\"text\"\r\n        value={props.value || ''}\r\n        onChange={handleChange}\r\n        onBlur={props.onBlur}\r\n        error={props.error}\r\n      /> */}\r\n    </>\r\n  );\r\n}\r\n","import { Entity } from 'types/common';\r\n\r\nexport enum messageType {\r\n  Announcment,\r\n  reservationStarted,\r\n  usageReservation,\r\n  loadDesk,\r\n  removableAnnouncment,\r\n  calendar,\r\n}\r\n\r\nexport interface StartedReservation {\r\n  Id: number;\r\n  Asset: Entity<number>;\r\n  AllowModification: boolean;\r\n  AllowExtendReservation: boolean;\r\n  AllowUsersToShortenReservations: boolean;\r\n  Tutoring: boolean;\r\n  AllUsagesEnded: boolean;\r\n}\r\n\r\nexport interface LoanDesk {\r\n  Id: number;\r\n  AssetDetails: Entity<number>;\r\n}\r\n\r\nexport interface UsageReservation extends Entity<number> {}\r\n\r\nexport interface CalendarMessageProps {\r\n  Id: number;\r\n  ServiceGroupId: number | null;\r\n  EquipmentId: number | null;\r\n  Title: string | null;\r\n  Body: string | null;\r\n  StartDate: Date | null;\r\n  EndDate: Date | null;\r\n}\r\n\r\ntype Messageprops =\r\n  | StartedReservation\r\n  | UsageReservation\r\n  | LoanDesk\r\n  | string\r\n  | CalendarMessageProps;\r\n\r\nexport interface Message {\r\n  type: messageType;\r\n  props?: Messageprops;\r\n  key: string;\r\n}\r\n\r\nexport interface MessagesState {\r\n  messages: Message[];\r\n  initialized: number;\r\n  processing?: boolean;\r\n}\r\n","import { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport { IMyAssetsRow } from '../MyAssetsPage/IMyAssetsRow';\r\n\r\nexport type IAsset = IAssetDetails2Dto;\r\n\r\nexport interface AlertInfo {\r\n  show: boolean;\r\n  hasActive: boolean;\r\n  hasDownActive: boolean;\r\n  noAlerts: boolean;\r\n  assetId?: number;\r\n  alertId?: number;\r\n  isAdmin: boolean;\r\n}\r\n\r\nexport interface AssetUser extends Entity<number> {\r\n  DisplayName: string;\r\n  Email: string;\r\n  OfficeTel: string;\r\n}\r\n\r\nexport interface IRestrictions {\r\n  Id: number;\r\n  Name: string;\r\n  AssetId: number | null;\r\n  ServiceGroupId: number;\r\n  LimitlessReservationAllowed: boolean | null;\r\n  PrerequisiteEquipments: IAssetDto[];\r\n  ForceTutoring: boolean;\r\n  RestrictionsOverview: string | null;\r\n  ReservationRestrictions: string | null;\r\n  MinReservationOrder: number | null;\r\n  MaxReservationOrder: number | null;\r\n  ReservationMinimumGap: number | null;\r\n  MinTimeAheadPeriodValue: number | null;\r\n  MinTimeAheadPeriodType: number | null;\r\n  MinTimeAheadMinutesSinceMidnight: number | null;\r\n  BypassQuotas: boolean;\r\n  BypassUserQuotasAndGaps: boolean;\r\n  BypassMinResDurationD: boolean;\r\n  BypassMinResDurationT: number | null;\r\n  BypassUserQuotasAndGapsD: number | null;\r\n  MinReservationOrderGap: number;\r\n  UserReservationGap: number;\r\n  UserGroupReservationGap: number;\r\n  InstituteReservationGap: number;\r\n  CarryOverTimeSlotGap: number | null;\r\n  CarryOverTimeSlotTypeId: number | null;\r\n  CarryOverTimeSlotTypeName: string | null;\r\n}\r\nexport const mapToAssetDto = (myAsset: IMyAssetsRow): IAssetDto => {\r\n  return {\r\n    Id: myAsset.Id,\r\n    Name: myAsset.Name,\r\n    AssetCatId: myAsset.AssetCatId,\r\n    Availability: {\r\n      Id: myAsset.AvailabilityTypeId,\r\n      Name: myAsset.AvailabilityTypeName,\r\n    },\r\n    ServiceGroupId: myAsset.ServiceGroupId,\r\n    ServiceGroupName: myAsset.ServiceGroupName,\r\n    ServiceId: myAsset.ServiceId,\r\n    ServiceTypeId: myAsset.ServiceTypeId,\r\n    ServiceGroupAssetId: myAsset.ServiceGroupAssetId,\r\n  } as IAssetDto;\r\n};\r\n","import Box from '@material-ui/core/Box';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface UserProfileLinkProps {\r\n  UserId: string | null;\r\n  DisplayName?: string | null;\r\n  twoRows?: boolean;\r\n  isAdmin?: boolean;\r\n}\r\n\r\nexport const UserProfileLink = React.forwardRef<any, UserProfileLinkProps>(\r\n  function UserProfileLink(props, ref) {\r\n    const { t } = useTranslation();\r\n    const { UserId, DisplayName, isAdmin, twoRows = true, ...rest } = props;\r\n    const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n    const settings = useSelector(selectglobalSettings);\r\n    const isServiceAdmin: boolean = React.useMemo(\r\n      () =>\r\n        authenticatedUser !== undefined &&\r\n        ((authenticatedUser.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n          isAdmin) ??\r\n          false),\r\n      [authenticatedUser, isAdmin],\r\n    );\r\n    const format = settings.GetString(AllowedSettings.UserFormatResult);\r\n    const url = `/userprofile.aspx?id=${UserId}`;\r\n    if ((DisplayName ?? null) == null) {\r\n      return <></>;\r\n    }\r\n\r\n    const text =\r\n      format === 'DisplayNameUserName' && DisplayName !== undefined ? (\r\n        <Box marginLeft={1} component=\"span\">\r\n          {DisplayName}\r\n          {UserId === 'undefined' ? (\r\n            <></>\r\n          ) : (\r\n            <>\r\n              {twoRows && <br />}\r\n              <Box component=\"span\">{' (' + UserId + ') '}</Box>\r\n            </>\r\n          )}\r\n        </Box>\r\n      ) : (\r\n        <Box marginLeft={1} component=\"span\">\r\n          {DisplayName || UserId}\r\n        </Box>\r\n      );\r\n    return isServiceAdmin && UserId !== 'undefined' ? (\r\n      <Tooltip {...rest} title={t(translations.UserProfile) as string} arrow>\r\n        <span>\r\n          <ExternalLink ref={ref} href={url} {...rest}>\r\n            <Icon icon=\"user\" />\r\n            {text}\r\n          </ExternalLink>\r\n        </span>\r\n      </Tooltip>\r\n    ) : (\r\n      <React.Fragment>{text}</React.Fragment>\r\n    );\r\n  },\r\n);\r\n","import { ConfigurableColumns } from 'app/components/BasicTable/ConfigurableColumns';\r\nimport { ExportImportApi } from './Api';\r\nimport { ImportAdditionalData, ImportData, TemplateColumns } from './Types';\r\n\r\nconst Api = new ExportImportApi();\r\nexport const ExportImportActions = {\r\n  Export: (url: string, data?: any) => {\r\n    return Api.export(url, data);\r\n  },\r\n  Import: (url: string, file, data?: ImportData) => {\r\n    return Api.import(url, file, data);\r\n  },\r\n  TemplateColumns: (\r\n    screenId: number,\r\n    Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n  ) => {\r\n    return Api.TemplateColumns<TemplateColumns>(screenId, Iad);\r\n  },\r\n  ConfigurableColumns: (\r\n    url: string,\r\n    listId: number,\r\n    configurableType: number,\r\n  ) => {\r\n    return Api.ConfigurableColumns<ConfigurableColumns>(\r\n      url,\r\n      listId,\r\n      configurableType,\r\n    );\r\n  },\r\n  ImportTemplate: (\r\n    screenId: number,\r\n    ext: string,\r\n    Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n  ) => {\r\n    return Api.ImportTemplate(screenId, ext, Iad);\r\n  },\r\n  ExportForImport: (\r\n    ScreenId: number,\r\n    Ids: number[],\r\n    Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n  ) => {\r\n    return Api.ExportForImport(ScreenId, Ids, Iad);\r\n  },\r\n  ImportImages: (files: File[], ScreenId: number) => {\r\n    return Api.importImages(files, ScreenId);\r\n  },\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport axios from 'axios';\r\nimport { ImportAdditionalData, ImportData } from './Types';\r\n\r\nexport class ExportImportApi {\r\n  export = (url: string, data?: any) => {\r\n    return axios.post(url, data, {\r\n      responseType: 'blob',\r\n      timeout: undefined,\r\n    });\r\n  };\r\n  import = async (url: string, file, data?: ImportData) => {\r\n    const formData = new FormData();\r\n    formData.append('File', file);\r\n    if (data !== undefined) {\r\n      formData.append('importData', JSON.stringify(data));\r\n    }\r\n    try {\r\n      const response = await axios.post(url, formData, {\r\n        responseType: 'blob',\r\n        timeout: undefined,\r\n        headers: {\r\n          'Content-Type': 'multipart/form-data',\r\n        },\r\n      });\r\n      return response;\r\n    } catch (error: unknown) {\r\n      throw error;\r\n    }\r\n  };\r\n  ConfigurableColumns = <T>(\r\n    url: string,\r\n    listId: number,\r\n    configurableType: number,\r\n  ) => {\r\n    return httpClient.get<T>(url, {\r\n      ListID: listId,\r\n      ConfigurableType: configurableType,\r\n    });\r\n  };\r\n  TemplateColumns = <T>(\r\n    ScreenId: number,\r\n    Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n  ) => {\r\n    const url = 'api/GenericImport/TemplateNames';\r\n    return httpClient.get<T>(url, {\r\n      screenId: ScreenId,\r\n      iad: Iad,\r\n    });\r\n  };\r\n  ImportTemplate = (\r\n    ScreenId: number,\r\n    Ext: string,\r\n    Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n  ) => {\r\n    const url = 'api/GenericImport/ImportTemplate';\r\n    return axios.get(url, {\r\n      responseType: 'blob',\r\n      timeout: undefined,\r\n      headers: {\r\n        'Content-Type': 'multipart/form-data',\r\n      },\r\n      params: { screenId: ScreenId, ext: Ext, iad: Iad },\r\n    });\r\n  };\r\n  // Ids count may be too large.\r\n  // Therefore, Ids are sent in the request body.\r\n  ExportForImport = (\r\n    ScreenId: number,\r\n    Ids: number[],\r\n    Iad: ImportAdditionalData = ImportAdditionalData.none,\r\n  ) => {\r\n    const data = { ScreenId: ScreenId, Ids: Ids, Iad: Iad };\r\n    const formData = new FormData();\r\n    formData.append('importData', JSON.stringify(data));\r\n    const url = 'api/GenericImport/ExportForImport';\r\n    return axios.post(url, formData, {\r\n      responseType: 'blob',\r\n      timeout: undefined,\r\n      headers: {\r\n        'Content-Type': 'multipart/form-data',\r\n      },\r\n    });\r\n  };\r\n  importImages = (files: File[], ScreenId: number) => {\r\n    const url = 'api/GenericImport/ImportImages';\r\n    const formData = new FormData();\r\n    for (const file of files) {\r\n      formData.append(file.name, file);\r\n    }\r\n    return axios.post(url, formData, {\r\n      responseType: 'blob',\r\n      timeout: undefined,\r\n      maxContentLength: 50000000,\r\n      headers: {\r\n        'Content-Type': 'multipart/form-data',\r\n      },\r\n      params: { screenId: ScreenId },\r\n    });\r\n  };\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.samplesList || initialState;\r\n\r\nexport const selectSamplesList = createSelector([selectSlice], state => state);\r\n\r\nexport const selectSamplesTableState = createSelector(\r\n  [selectSlice],\r\n  state => state.SamplesListTableState,\r\n);\r\nexport const selectSamplesData = createSelector(\r\n  [selectSamplesList],\r\n  state => state.SamplesList,\r\n);\r\nexport const selectSelectedRunType = createSelector(\r\n  [selectSlice],\r\n  state => state.SelectedRunType,\r\n);\r\nexport const selectRunDetails = createSelector(\r\n  [selectSamplesList],\r\n  state => state.RunDetails,\r\n);\r\nexport const selectShowRunDialog = createSelector(\r\n  [selectSamplesList],\r\n  state => state.ShowRunDialog,\r\n);\r\nexport const selectSelectedSamples = createSelector(\r\n  [selectSamplesList],\r\n  state => state.SamplesSelected,\r\n);\r\nexport const selectSamplesListEditMode = createSelector(\r\n  [selectSamplesList],\r\n  state => state.EditMode,\r\n);\r\nexport const selectImportingRunDetails = createSelector(\r\n  [selectSamplesList],\r\n  state => state.ImportStarted,\r\n);\r\nexport const selectImportingRunDetailsFinished = createSelector(\r\n  [selectSamplesList],\r\n  state => state.ImportFinished,\r\n);\r\nexport const selectRunDetailsInstrument = createSelector(\r\n  [selectSamplesList],\r\n  state => state.RunDetails?.Instrument?.Name,\r\n);\r\nexport const selectRunDetailsSecondaryInstrument = createSelector(\r\n  [selectSamplesList],\r\n  state => state.RunDetails?.SecondaryInstrument?.Name,\r\n);\r\nexport const selectRunDetailsGradient = createSelector(\r\n  [selectSamplesList],\r\n  state => state.RunDetails?.Gradient?.Name,\r\n);\r\nexport const selectRunDetailsCreatedDate = createSelector(\r\n  [selectSamplesList],\r\n  state => state.RunDetails?.CreateDate,\r\n);\r\nexport const selectRunDetailsAcquision_type = createSelector(\r\n  [selectSamplesList],\r\n  state => state.RunDetails?.ACQUISITION_TYPE,\r\n);\r\n","export * from './CampusPickerFilter';\r\nexport * from './DatePickerFilter';\r\nexport * from './TextFieldFilter';\r\nexport * from './IFilterComponentProps';\r\n","/**\r\n *\r\n * TextField\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  TextField as MatTextField,\r\n  TextFieldProps as MatTextFieldProps,\r\n  Theme,\r\n  withStyles,\r\n} from '@material-ui/core';\r\nimport { omit } from 'lodash';\r\n//import styled from 'styled-components/macro';\r\nexport interface TextFieldProps\r\n  extends Omit<MatTextFieldProps, 'variant' | 'color' | 'autocomplete'> {\r\n  variant?: 'outlined' | 'filled' | 'standard';\r\n  color?: 'primary' | 'secondary';\r\n  autoComplete?: string;\r\n  mini?: string;\r\n}\r\nexport function TextField(props: TextFieldProps) {\r\n  return (\r\n    <>\r\n      <StyledTextField\r\n        variant={props.variant === undefined ? 'filled' : props.variant}\r\n        color={props.color === undefined ? 'primary' : props.color}\r\n        autoComplete={\r\n          props.autoComplete === undefined ? 'false' : props.autoComplete\r\n        }\r\n        {...omit(props, 'DialogProps')}\r\n      />\r\n    </>\r\n  );\r\n}\r\n/* only bottom border should have accent when focused according to figma design */\r\n/* TODO: override default theme instead of this mess */\r\nconst StyledTextField = withStyles((theme: Theme) => ({\r\n  root: {\r\n    margin: theme.spacing(0),\r\n  },\r\n}))(MatTextField);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { BasicCheckBox, BasicCheckBoxProps } from '../BasicCheckBox';\r\n\r\nexport interface FormCheckboxProps extends BasicCheckBoxProps {\r\n  label?: string;\r\n  helperText?: string;\r\n}\r\nexport const FormCheckbox = ({\r\n  label,\r\n  onChange,\r\n  onBlur,\r\n  value,\r\n  name,\r\n  color,\r\n  helperText,\r\n  required,\r\n  ...props\r\n}: FormCheckboxProps & FieldHookConfig<boolean> & IFieldProps) => {\r\n  const [field, meta] = useField<boolean>({ name, ...props });\r\n  const handleChange = (value, event) => {\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n    field.onChange(event);\r\n  };\r\n  return (\r\n    <>\r\n      <BasicCheckBox\r\n        error={meta?.error}\r\n        label={label}\r\n        info={props.info}\r\n        color={color || 'primary'}\r\n        onChange={handleChange}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        checked={field.value}\r\n        name={name}\r\n        required={required && field.value !== true}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { MenuList, MenuItem, makeStyles, Theme, Box } from '@material-ui/core';\r\nimport { IFilterSettings } from './IFilterSettings';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Popper } from 'app/components/Popper';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport clsx from 'clsx';\r\n\r\nexport interface AddFilterButtonProps<TRow> {\r\n  availableFilters: IFilterSettings<TRow>[];\r\n  onChange: (value: IFilterSettings<TRow>) => void;\r\n  filtersSelectionOpen: boolean;\r\n  title: string;\r\n  disabled?: boolean;\r\n  disabledTitle?: string;\r\n}\r\nconst useStyles = makeStyles<Theme>((theme: Theme) => ({\r\n  // root: {\r\n  //   width: `${props.winWidth}px`,\r\n  //   height: 'calc(100% - 90px)',\r\n  // },\r\n  selectPaper: {\r\n    height: '100%',\r\n  },\r\n  selectRoot: {\r\n    padding: theme.spacing(2),\r\n  },\r\n  selectTitle: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: '8px 8px',\r\n    justifyContent: 'space-between',\r\n    width: '100%',\r\n    '&>label': {\r\n      width: '100%',\r\n      textAlign: 'center',\r\n    },\r\n  },\r\n  selectContent: {\r\n    marginTop: theme.spacing(2),\r\n    boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n    overflow: 'auto',\r\n    height: 'calc(100% - 96px)',\r\n    // aim to show 10 top items in the list, with rest hidden behind scrollbar\r\n    // maxHeight: '385px',\r\n    // '&.mobHorizontal': {\r\n    //   maxHeight: '200px',\r\n    // },\r\n    '&.mobHorizontal': {\r\n      height: 'calc(100% - 96px)',\r\n    },\r\n  },\r\n  addButtonRoot: {\r\n    width: '100%',\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: 8,\r\n    marginTop: 'unset',\r\n    '&.isMobile': {\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      //marginTop: '16px',\r\n    },\r\n  },\r\n  addCollapsContainer: {\r\n    width: '100%',\r\n  },\r\n}));\r\nexport function AddFilterButton<TRow>({\r\n  filtersSelectionOpen,\r\n  ...props\r\n}: AddFilterButtonProps<TRow>) {\r\n  const [open, setOpen] = React.useState(filtersSelectionOpen);\r\n  const { checkIsMobile, isLandscape } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  React.useEffect(() => setOpen(filtersSelectionOpen), [filtersSelectionOpen]);\r\n\r\n  const anchorRef = React.useRef(null);\r\n  const [anchorEl, setAnchorEl] = React.useState<\r\n    EventTarget & HTMLDivElement\r\n  >();\r\n  React.useEffect(() => {\r\n    setAnchorEl(anchorRef.current ?? undefined);\r\n  }, [anchorRef]);\r\n  const handleAddFilterClick = e => {\r\n    setOpen(c => !c);\r\n    setAnchorEl(e.currentTarget);\r\n  };\r\n  // const winWidth = window.innerWidth;\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  // close popover on click anywhere outside the menu\r\n\r\n  // control field search text value\r\n  const [input, setInnput] = React.useState<string>();\r\n\r\n  // manually filter the items and take first 10\r\n  const options = props.availableFilters.filter((item, index) =>\r\n    item.displayName.toLowerCase().includes((input || '').toLowerCase()),\r\n  );\r\n\r\n  // handle selected filter event\r\n  const handleFilterSelect = item => {\r\n    props.onChange(item);\r\n    setOpen(false);\r\n    setInnput(undefined);\r\n  };\r\n\r\n  return (\r\n    <Box className={clsx(classes.addButtonRoot, { isMobile: isMobile })}>\r\n      {/* TODO: user localization on button */}\r\n      <Button\r\n        variant=\"white\"\r\n        size=\"small\"\r\n        onClick={handleAddFilterClick}\r\n        ref={anchorRef}\r\n        startIcon={<Icon icon=\"plus\" />}\r\n        disabled={props.disabled}\r\n        title={props.disabled ? props.disabledTitle : undefined}\r\n      >\r\n        {props.title}\r\n      </Button>\r\n      {anchorEl !== undefined && (\r\n        <>\r\n          {/* {isMobile ? (\r\n            <Collapse\r\n              in={open}\r\n              classes={{ container: classes.addCollapsContainer }}\r\n            >\r\n              <TextControlField\r\n                placeholder={t(translations.SearchFilter)}\r\n                startIcon={\r\n                  <Icon icon=\"search\" color=\"filters\" colorExtend=\"light\" />\r\n                }\r\n                value={input || ''}\r\n                onChange={e => setInnput(e.target.value)}\r\n                aria-label={t(translations.SearchFilter)}\r\n                autoFocus\r\n                inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n                fullWidth\r\n              />\r\n\r\n              <MenuList className={classes.selectContent}>\r\n                {options.map((item, index) => (\r\n                  <MenuItem\r\n                    key={index}\r\n                    button\r\n                    onClick={e => handleFilterSelect(item)}\r\n                  >\r\n                    {item.displayName}\r\n                  </MenuItem>\r\n                ))}\r\n              </MenuList>\r\n            </Collapse>\r\n          ) : ( */}\r\n          <Popper\r\n            open={open}\r\n            anchorEl={anchorEl}\r\n            onClose={() => setOpen(false)}\r\n            title={t(translations.SelectFieldToFilterBy)}\r\n            minWidth=\"auto\"\r\n          >\r\n            <TextControlField\r\n              placeholder={t(translations.SearchFilter)}\r\n              size=\"small\"\r\n              startIcon={\r\n                <Icon icon=\"search\" color=\"filters\" colorExtend=\"light\" />\r\n              }\r\n              value={input || ''}\r\n              aria-label={t(translations.SearchFilter)}\r\n              inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n              onChange={e => setInnput(e.target.value)}\r\n              autoFocus\r\n              fullWidth\r\n            />\r\n\r\n            <MenuList\r\n              className={clsx(classes.selectContent, {\r\n                mobHorizontal: isMobile && isLandscape,\r\n              })}\r\n            >\r\n              {options.map((item, index) => (\r\n                <MenuItem\r\n                  key={index}\r\n                  tabIndex={index}\r\n                  button\r\n                  onClick={e => handleFilterSelect(item)}\r\n                >\r\n                  {item.displayName}\r\n                </MenuItem>\r\n              ))}\r\n            </MenuList>\r\n          </Popper>\r\n          {/* )} */}\r\n        </>\r\n      )}\r\n    </Box>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AppliedFiltersContainer\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Directions } from '../FilterBox';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport clsx from 'clsx';\r\n\r\nexport interface AppliedFiltersContainerProps {\r\n  direction: Directions;\r\n}\r\n\r\nexport function AppliedFiltersContainer({\r\n  children,\r\n  ...props\r\n}: React.PropsWithChildren<AppliedFiltersContainerProps>) {\r\n  const classes = useStyles();\r\n  const { checkIsMobile, isLandscape } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  return (\r\n    <div\r\n      className={clsx(classes.root, {\r\n        [classes.horizontal]: props.direction === 'horizontal',\r\n        [classes.mobileRoot]: isMobile && !isLandscape,\r\n        [classes.mobileHorizontalRoot]: isMobile && isLandscape,\r\n      })}\r\n    >\r\n      {children}\r\n    </div>\r\n  );\r\n}\r\n\r\nconst useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      // maxHeight was taken to contain 3 AppliedFilterComponents vertically\r\n      maxHeight: theme.spacing(54),\r\n      height: 'auto',\r\n      overflowY: 'auto',\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n      gap: 12,\r\n      width: '100%',\r\n    },\r\n    horizontal: {\r\n      maxHeight: theme.spacing(21),\r\n    },\r\n    mobileRoot: {\r\n      height: 'calc(100% - 48px)',\r\n      maxHeight: '100%',\r\n      gap: 'unset',\r\n      margin: '-12px 0px 0px 0px',\r\n    },\r\n    mobileHorizontalRoot: {\r\n      height: 'calc(100% - 48px)',\r\n      maxHeight: '100%',\r\n      gap: 'unset',\r\n      margin: '-12px 0px 0px 0px',\r\n    },\r\n  }),\r\n);\r\n","import * as React from 'react';\r\nimport { AddFilterButton } from './AddFilterButton';\r\nimport { FilterDependencyData, IFilterSettings } from './IFilterSettings';\r\nimport { AppliedFilterComponent } from './AppliedFilterComponent';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nimport { Box, styled } from '@material-ui/core';\r\nimport { areSameFilter } from './utils';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Directions } from 'app/components/BasicTable/BasicFilter/FilterBox';\r\nimport { AppliedFiltersContainer } from 'app/components/BasicTable/BasicFilter/AppliedFiltersContainer';\r\nimport { SavedListsDropDown } from './SavedListsDropDown';\r\nimport { TableSavedListSettings } from '../BasicTableProps';\r\nimport { FilterValueType } from './FilterValueType';\r\n\r\nexport interface SingleFilterProps {}\r\n\r\nexport interface IBasicFilterGroupProps<TRow> {\r\n  availableFilters: IFilterSettings<TRow>[];\r\n  appliedFilters: IFilterSettings<TRow>[];\r\n  appliedFiltersDirection?: Directions;\r\n  onClose: () => void;\r\n  onChange: (items: IFilterSettings<TRow>[]) => void;\r\n  getDefaultFilters?: () => IFilterSettings<TRow>[];\r\n  autoOpenAddFilter: boolean;\r\n  showFooter: boolean;\r\n  savedListSettings?: TableSavedListSettings<TRow>;\r\n  filterDefaultOpen?: boolean;\r\n}\r\nexport function updateDepValues<TRow>(\r\n  filterValues: FilterDependencyData<TRow>[],\r\n  depKey: keyof TRow,\r\n  depValue?: FilterValueType,\r\n) {\r\n  if (depValue === null || depValue === undefined) {\r\n    if (\r\n      filterValues.length > 0 &&\r\n      filterValues.some(f => f.depKey === depKey)\r\n    ) {\r\n      return filterValues.filter(f => f.depKey !== depKey);\r\n    } else return filterValues;\r\n  } else {\r\n    if (\r\n      filterValues.length > 0 &&\r\n      filterValues.some(f => f.depKey === depKey)\r\n    ) {\r\n      return filterValues.map(f => {\r\n        if (f.depKey === depKey) {\r\n          let item = {\r\n            depKey: f.depKey,\r\n            depValue: depValue,\r\n          };\r\n          return Object.assign({}, f, item);\r\n        } else {\r\n          return f;\r\n        }\r\n      });\r\n    } else {\r\n      let item = {\r\n        depKey: depKey,\r\n        depValue: depValue,\r\n      };\r\n      return [...filterValues, item];\r\n    }\r\n  }\r\n}\r\nexport function getDependencyFilters<TRow>(\r\n  filters: IFilterSettings<TRow>[],\r\n): IFilterSettings<TRow>[] {\r\n  if (filters.length > 0) {\r\n    if (\r\n      filters.some(\r\n        f =>\r\n          !!f.dependencyProp &&\r\n          f.dependencyProp.length > 0 &&\r\n          !!f.filterPredicates,\r\n      )\r\n    ) {\r\n      let depFilters = filters.filter(\r\n        f =>\r\n          !!f.dependencyProp &&\r\n          f.dependencyProp.length > 0 &&\r\n          !!f.filterPredicates,\r\n      );\r\n      depFilters.forEach(item => {\r\n        let depFiltered = filters.filter(f =>\r\n          item.dependencyProp?.includes(f.fieldName),\r\n        );\r\n        if (depFiltered.length > 0) {\r\n          depFiltered.forEach(filt => {\r\n            let depValue = filt?.value ?? filt?.defaultValue;\r\n            item.filterData = updateDepValues(\r\n              item.filterData ?? [],\r\n              filt.fieldName,\r\n              depValue,\r\n            );\r\n          });\r\n        }\r\n      });\r\n      return filters.map(item => {\r\n        if (depFilters.some(d => d.fieldName === item.fieldName)) {\r\n          return depFilters.filter(d => d.fieldName === item.fieldName)[0];\r\n        } else {\r\n          return item;\r\n        }\r\n      });\r\n    }\r\n  }\r\n  return filters;\r\n}\r\nexport function BasicFilterGroup<TRow>({\r\n  onChange,\r\n  onClose,\r\n  appliedFiltersDirection = 'vertical',\r\n  savedListSettings,\r\n  getDefaultFilters,\r\n  filterDefaultOpen,\r\n  ...props\r\n}: IBasicFilterGroupProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  // save provided applied filters to be used in change callbacks\r\n  const [visibleFilters, setVisibleFilters] = React.useState<\r\n    IFilterSettings<TRow>[]\r\n  >(props.appliedFilters);\r\n\r\n  // refresh applied filters if they were changed from outside\r\n  React.useEffect(() => {\r\n    setVisibleFilters(props.appliedFilters);\r\n  }, [props.appliedFilters]);\r\n\r\n  // handle addition of a new filter\r\n  const handleAddFilter = (item: IFilterSettings<TRow>) => {\r\n    item.value = null;\r\n    setVisibleFilters(currentState => {\r\n      const newState = [\r\n        ...currentState,\r\n        { ...item, ...{ open: filterDefaultOpen ?? true } },\r\n      ];\r\n      onChange(newState);\r\n      return newState;\r\n    });\r\n  };\r\n  const handleAddFilterWithValue = (item: IFilterSettings<TRow>) => {\r\n    setVisibleFilters(currentState => {\r\n      const newState = [\r\n        ...currentState,\r\n        { ...item, ...{ open: filterDefaultOpen ?? true } },\r\n      ];\r\n      onChange(newState);\r\n      return newState;\r\n    });\r\n  };\r\n  const handleClearClick = () => {\r\n    setVisibleFilters(currentState => {\r\n      const newState =\r\n        getDefaultFilters?.() ??\r\n        currentState.map(f => ({\r\n          ...f,\r\n          ...{ value: null, open: false },\r\n        }));\r\n      onChange([...newState]);\r\n      return newState;\r\n    });\r\n  };\r\n\r\n  // handle apply (change) of the applied filter\r\n  const handleApply = item => {\r\n    if (item.value === undefined) {\r\n      item.value = null;\r\n    }\r\n    item.visible = true;\r\n    item.open = false;\r\n    setVisibleFilters(currentState => {\r\n      const newState = currentState.map(f =>\r\n        areSameFilter({ f, item }) ? item : f,\r\n      );\r\n      onChange(newState);\r\n      return newState;\r\n    });\r\n  };\r\n\r\n  // handle removal of applied filter\r\n  const handleRemoveFitler = (item: IFilterSettings<TRow>) => {\r\n    setVisibleFilters(currentState => {\r\n      const newState = currentState.filter(f => !areSameFilter({ f, item }));\r\n      onChange(newState);\r\n      return newState;\r\n    });\r\n  };\r\n\r\n  /**\r\n   * Filters available in \"Add filter\" - to be added to the displayed fitlers list\r\n   */\r\n  const availableFilters = props.availableFilters.filter(available => {\r\n    const unavailable = visibleFilters;\r\n    const isApplied = unavailable.some(applied =>\r\n      areSameFilter({ f: available, item: applied }),\r\n    );\r\n    return !isApplied;\r\n  });\r\n\r\n  const appliedFitltersCount = visibleFilters.length;\r\n  const [open, setOpen] = React.useState(props.autoOpenAddFilter ?? false);\r\n  useEffectOnMount(() =>\r\n    props.autoOpenAddFilter ? setOpen(appliedFitltersCount === 0) : void 0,\r\n  );\r\n\r\n  return (\r\n    <>\r\n      {visibleFilters.length > 0 && (\r\n        <AppliedFiltersContainer direction={appliedFiltersDirection}>\r\n          {visibleFilters.map((item, index) => {\r\n            return (\r\n              <AppliedFilterComponent\r\n                key={`${item.fieldName.toString()}-${index}`}\r\n                item={item}\r\n                direction={appliedFiltersDirection}\r\n                onApply={handleApply}\r\n                onRemove={handleRemoveFitler}\r\n              />\r\n            );\r\n          })}\r\n          {savedListSettings && savedListSettings.enableSavedLists && (\r\n            <SavedListsDropDown\r\n              serviceItem={\r\n                visibleFilters.filter(\r\n                  f =>\r\n                    f.fieldName ===\r\n                    savedListSettings.savedListRelatedPickerName,\r\n                ).length === 1\r\n                  ? visibleFilters.filter(\r\n                      f =>\r\n                        f.fieldName ===\r\n                        savedListSettings.savedListRelatedPickerName,\r\n                    )[0]\r\n                  : props.availableFilters.filter(\r\n                      f =>\r\n                        f.fieldName ===\r\n                        savedListSettings.savedListRelatedPickerName,\r\n                    )[0]\r\n              }\r\n              hasInVisibleFilters={\r\n                visibleFilters.filter(\r\n                  f =>\r\n                    f.fieldName ===\r\n                    savedListSettings.savedListRelatedPickerName,\r\n                ).length === 1\r\n              }\r\n              onApply={handleApply}\r\n              onRemove={handleRemoveFitler}\r\n              addFilter={handleAddFilterWithValue}\r\n              serializedKey={savedListSettings.savedListSerializedKey || 'eid'}\r\n              listViewbyAsset={savedListSettings.listViewbyAsset}\r\n            />\r\n          )}\r\n        </AppliedFiltersContainer>\r\n      )}\r\n\r\n      {savedListSettings &&\r\n        savedListSettings.enableSavedLists &&\r\n        visibleFilters.length < 1 && (\r\n          <AppliedFiltersContainer direction={appliedFiltersDirection}>\r\n            <SavedListsDropDown\r\n              serviceItem={\r\n                visibleFilters.filter(\r\n                  f =>\r\n                    f.fieldName ===\r\n                    savedListSettings.savedListRelatedPickerName,\r\n                ).length === 1\r\n                  ? visibleFilters.filter(\r\n                      f =>\r\n                        f.fieldName ===\r\n                        savedListSettings.savedListRelatedPickerName,\r\n                    )[0]\r\n                  : props.availableFilters.filter(\r\n                      f =>\r\n                        f.fieldName ===\r\n                        savedListSettings.savedListRelatedPickerName,\r\n                    )[0]\r\n              }\r\n              hasInVisibleFilters={\r\n                visibleFilters.filter(\r\n                  f =>\r\n                    f.fieldName ===\r\n                    savedListSettings.savedListRelatedPickerName,\r\n                ).length === 1\r\n              }\r\n              onApply={handleApply}\r\n              onRemove={handleRemoveFitler}\r\n              addFilter={handleAddFilterWithValue}\r\n              serializedKey={savedListSettings.savedListSerializedKey || 'eid'}\r\n              listViewbyAsset={savedListSettings.listViewbyAsset}\r\n            />\r\n          </AppliedFiltersContainer>\r\n        )}\r\n      {/* {!isMobile && (\r\n        <AddFilterButton\r\n          availableFilters={availableFilters}\r\n          filtersSelectionOpen={open}\r\n          onChange={handleAddFilter}\r\n          title={t(translations.MoreFilters)}\r\n          disabled={availableFilters.length === 0}\r\n          disabledTitle={t(translations.MoreFiltersDisabled)}\r\n        />\r\n      )} */}\r\n\r\n      <ButtonsContainer>\r\n        <AddFilterButton\r\n          availableFilters={availableFilters}\r\n          filtersSelectionOpen={open}\r\n          onChange={handleAddFilter}\r\n          title={t(translations.MoreFilters)}\r\n          disabled={availableFilters.length === 0}\r\n          disabledTitle={t(translations.MoreFiltersDisabled)}\r\n        />\r\n        <Button\r\n          size=\"small\"\r\n          variant=\"main\"\r\n          color=\"primary\"\r\n          onClick={() => onClose()}\r\n        >\r\n          {t(translations.apply)}\r\n        </Button>\r\n        <Button\r\n          size=\"small\"\r\n          color=\"primary\"\r\n          variant=\"ghost\"\r\n          onClick={handleClearClick}\r\n          title={t(translations.ResetFilters_info)}\r\n        >\r\n          {t(translations.ResetFilters)}\r\n        </Button>\r\n      </ButtonsContainer>\r\n    </>\r\n  );\r\n}\r\nexport const ButtonsContainer = styled(Box)(theme => ({\r\n  width: '100%',\r\n  display: 'flex',\r\n  justifyContent: 'space-between',\r\n  flexDirection: 'row',\r\n  alignItems: 'flex-start',\r\n  padding: '8px 0px 0px',\r\n  gap: 8,\r\n}));\r\n","import {\r\n  FormControlProps as MuiFormControlProps,\r\n  FormControl as MuiFormControl,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport * as React from 'react';\r\nexport interface FormControlProps extends MuiFormControlProps {\r\n  boxed?: boolean;\r\n}\r\nconst FormControl = (props: FormControlProps) => {\r\n  const { boxed, className, ...other } = props;\r\n  return (\r\n    <MuiFormControl className={clsx(className, { boxed: boxed })} {...other} />\r\n  );\r\n};\r\n\r\nexport default FormControl;\r\n","import { BaseTextFieldProps, InputAdornment } from '@material-ui/core';\r\nimport { PureDateInputProps } from '@material-ui/pickers/_shared/PureDateInput';\r\nimport React from 'react';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport BaseTextField from '../BasicInputs/BaseTextField';\r\nimport { DatePopupVariants } from './utils/types';\r\n\r\nexport interface DateInputProps\r\n  extends PureDateInputProps,\r\n    Pick<\r\n      BaseTextFieldProps,\r\n      | 'autoFocus'\r\n      | 'fullWidth'\r\n      | 'helperText'\r\n      | 'placeholder'\r\n      | 'required'\r\n      | 'disabled'\r\n      | 'name'\r\n      | 'id'\r\n      | 'label'\r\n      | 'margin'\r\n    > {\r\n  info?: string;\r\n  ariaLabel?: string;\r\n  startIcon?: React.ReactNode;\r\n  endIcon?: React.ReactNode;\r\n  togglePicker: () => void;\r\n  variant?: DatePopupVariants;\r\n}\r\n\r\nexport function DateInput(props: DateInputProps) {\r\n  const {\r\n    inputValue,\r\n    openPicker,\r\n    InputProps,\r\n    TextFieldComponent,\r\n    inputProps,\r\n    onBlur,\r\n    onFocus,\r\n    validationError,\r\n    inputVariant,\r\n    togglePicker,\r\n    info,\r\n    ariaLabel,\r\n    startIcon,\r\n    endIcon,\r\n    variant,\r\n    ...other\r\n  } = props;\r\n  const TextComponent = !!TextFieldComponent\r\n    ? TextFieldComponent\r\n    : BaseTextField;\r\n  const innerInputProps = React.useMemo(() => {\r\n    return Object.assign({}, InputProps, { readOnly: true });\r\n  }, [InputProps]);\r\n  return (\r\n    <TextComponent\r\n      //   InputProps={innerInputProps}\r\n      inputProps={{\r\n        ...inputProps,\r\n        'aria-label': props.label\r\n          ? undefined\r\n          : `${ariaLabel ? ariaLabel : 'date input'}`,\r\n        style: { minWidth: 80 },\r\n      }}\r\n      error={Boolean(validationError)}\r\n      InputProps={{\r\n        ...innerInputProps,\r\n        disableUnderline: props.inputVariant === 'standard',\r\n        // startAdornment: (\r\n        //   <InputAdornment position=\"start\">\r\n        //     <Icon icon=\"calendar-alt\" color=\"default\" colorExtend=\"textHover\" />\r\n        //   </InputAdornment>\r\n        // ),\r\n        endAdornment: (\r\n          <>\r\n            {(info && <InfoIcon title={info} error={props.error} />) ||\r\n              (endIcon && (\r\n                <InputAdornment position=\"end\">{endIcon}</InputAdornment>\r\n              ))}\r\n            <InputAdornment position=\"end\">\r\n              <IconButton\r\n                onClick={e => togglePicker()}\r\n                disabled={props.disabled}\r\n                size=\"xs\"\r\n                variant=\"ghost\"\r\n              >\r\n                <Icon\r\n                  icon={variant === 'time' ? 'clock' : 'calendar-alt'}\r\n                  color=\"default\"\r\n                  colorExtend=\"textHover\"\r\n                />\r\n              </IconButton>\r\n            </InputAdornment>\r\n          </>\r\n        ),\r\n        style: { minWidth: 80 },\r\n      }}\r\n      InputLabelProps={{\r\n        shrink:\r\n          props.inputVariant === 'filled'\r\n            ? !isNullOrUndefined(inputValue)\r\n              ? true\r\n              : false\r\n            : undefined,\r\n      }}\r\n      helperText={validationError || props.helperText}\r\n      onClick={ev => {\r\n        const target = ev.target as HTMLInputElement;\r\n        if (!!target && target.nodeName === 'INPUT') openPicker();\r\n      }}\r\n      value={inputValue}\r\n      variant={inputVariant}\r\n      onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n        if (event.key === 'Enter') {\r\n          event.stopPropagation();\r\n          openPicker();\r\n        }\r\n      }}\r\n      onBlur={onBlur}\r\n      onFocus={onFocus}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { truncateTime } from './truncateTime';\r\nimport { DatePickerValueProps } from '../index';\r\n\r\n/**\r\n * Handles date-only period end date conversions\r\n * @param props\r\n * @returns\r\n */\r\n\r\nexport const toEndDateDisplayValue = (\r\n  props: DatePickerValueProps & { direction: 'toDisplay' | 'fromDisplay' },\r\n) => {\r\n  if (props.value === null) {\r\n    return null;\r\n  }\r\n  if (props.value === undefined) {\r\n    return null;\r\n  }\r\n  // first truncate the time part if required\r\n  const truncatedDate = truncateTime({\r\n    value: dateUtils.dateOrStringToDate(props.value),\r\n    truncateTime: props.variant === 'date',\r\n  });\r\n\r\n  // then either move to one day forward for the underlying value or backward for the display value\r\n  // for example, the actual stored value is '2010-11-12T00:00:00' is displayed as 'November 10th 2010' (note that 10th is inclusive till the midnight)\r\n  const dir = props.direction === 'toDisplay' ? -1 : 1;\r\n  const result = props.endTime\r\n    ? dateUtils.addDays(truncatedDate, dir)\r\n    : truncatedDate;\r\n  return result;\r\n};\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { DatePickerValueProps } from '../index';\r\n\r\n/**\r\n * Optionally truncates time part to be used in date-only picker\r\n * @param props\r\n * @returns\r\n */\r\nexport function truncateTime(\r\n  props: Pick<DatePickerValueProps, 'truncateTime'> & { value: Date },\r\n) {\r\n  return props.truncateTime ? dateUtils.truncateTime(props.value) : props.value;\r\n}\r\n","function dateLongFormatter(pattern, formatLong) {\r\n  switch (pattern) {\r\n    case 'P':\r\n      return formatLong.date({\r\n        width: 'short',\r\n      });\r\n\r\n    case 'PP':\r\n      return formatLong.date({\r\n        width: 'medium',\r\n      });\r\n\r\n    case 'PPP':\r\n      return formatLong.date({\r\n        width: 'long',\r\n      });\r\n\r\n    case 'PPPP':\r\n    default:\r\n      return formatLong.date({\r\n        width: 'full',\r\n      });\r\n  }\r\n}\r\n\r\nfunction timeLongFormatter(pattern, formatLong) {\r\n  switch (pattern) {\r\n    case 'p':\r\n      return formatLong.time({\r\n        width: 'short',\r\n      });\r\n\r\n    case 'pp':\r\n      return formatLong.time({\r\n        width: 'medium',\r\n      });\r\n\r\n    case 'ppp':\r\n      return formatLong.time({\r\n        width: 'long',\r\n      });\r\n\r\n    case 'pppp':\r\n    default:\r\n      return formatLong.time({\r\n        width: 'full',\r\n      });\r\n  }\r\n}\r\n\r\nfunction dateTimeLongFormatter(pattern, formatLong) {\r\n  var matchResult = pattern.match(/(P+)(p+)?/) || [];\r\n  var datePattern = matchResult[1];\r\n  var timePattern = matchResult[2];\r\n\r\n  if (!timePattern) {\r\n    return dateLongFormatter(pattern, formatLong);\r\n  }\r\n\r\n  var dateTimeFormat;\r\n\r\n  switch (datePattern) {\r\n    case 'P':\r\n      dateTimeFormat = formatLong.dateTime({\r\n        width: 'short',\r\n      });\r\n      break;\r\n\r\n    case 'PP':\r\n      dateTimeFormat = formatLong.dateTime({\r\n        width: 'medium',\r\n      });\r\n      break;\r\n\r\n    case 'PPP':\r\n      dateTimeFormat = formatLong.dateTime({\r\n        width: 'long',\r\n      });\r\n      break;\r\n\r\n    case 'PPPP':\r\n    default:\r\n      dateTimeFormat = formatLong.dateTime({\r\n        width: 'full',\r\n      });\r\n      break;\r\n  }\r\n\r\n  return dateTimeFormat\r\n    .replace('{{date}}', dateLongFormatter(datePattern, formatLong))\r\n    .replace('{{time}}', timeLongFormatter(timePattern, formatLong));\r\n}\r\n\r\nvar longFormatters = {\r\n  p: timeLongFormatter,\r\n  P: dateTimeLongFormatter,\r\n};\r\nexport default longFormatters;\r\n","// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\r\n//   (one of the certain letters followed by `o`)\r\n// - (\\w)\\1* matches any sequences of the same letter\r\n// - '' matches two quote characters in a row\r\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\r\n//   except a single quote symbol, which ends the sequence.\r\n//   Two quote characters do not end the sequence.\r\n//   If there is no matching single quote\r\n//   then the sequence will continue until the end of the string.\r\n// - . matches any single character unmatched by previous parts of the RegExps\r\n// This RegExp catches symbols escaped by quotes, and also\r\n\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport longFormatters from './longFormatters';\r\n\r\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\r\nconst formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\r\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\r\n// const escapedStringRegExp = /^'([^]*?)'?$/;\r\n// const doubleQuoteRegExp = /''/g;\r\n// const notWhitespaceRegExp = /\\S/;\r\n// const unescapedLatinCharacterRegExp = /[a-zA-Z]/;\r\n//returns RegExpMatchArray\r\nexport default function getFormatTokens(formatString: string): string[] | null {\r\n  //  if(formatString === null ) return null;\r\n  let tokens = formatString\r\n    .match(longFormattingTokensRegExp)\r\n    ?.map(function (substring) {\r\n      var firstCharacter = substring[0];\r\n\r\n      if (firstCharacter === 'p' || firstCharacter === 'P') {\r\n        var longFormatter = longFormatters[firstCharacter];\r\n        return longFormatter(\r\n          substring,\r\n          dateUtils.dateFnsUtils.locale.formatLong,\r\n          // dateUtils.subFnOptions(),\r\n        );\r\n      }\r\n\r\n      return substring;\r\n    })\r\n    .join('')\r\n    .match(formattingTokensRegExp);\r\n  if (tokens === undefined || tokens === null) {\r\n    return null;\r\n  }\r\n  return tokens;\r\n}\r\n","import { IUtils } from '@date-io/core/IUtils';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { BaseKeyboardPickerProps } from '@material-ui/pickers/_shared/hooks/useKeyboardPickerState';\r\nimport { toEndDateDisplayValue } from 'app/components/DatePicker/utils/toEndDateDisplayValue';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport getFormatTokens from 'utils/DateFormattingUtils/getFormatTokens';\r\n\r\nexport type DateStartWith = 'day' | 'month' | 'year';\r\nexport type DatePopupVariants = 'date' | 'datetime' | 'time' | 'separated';\r\nexport interface DateTimeMask {\r\n  day: string;\r\n  month: string;\r\n  year: string;\r\n  hour: string;\r\n  minute: string;\r\n  meridiem: string;\r\n  dateSeparator: string;\r\n  dateStartFrom: DateStartWith;\r\n}\r\nexport interface FormatedResult {\r\n  value: string;\r\n  stayOnSelection: boolean;\r\n  zeroPress: boolean;\r\n}\r\nexport const getInputViewDate = (\r\n  variant: DatePopupVariants,\r\n  value?: Date | string | null,\r\n  endTime?: boolean,\r\n  truncateTime?: boolean,\r\n): string | undefined => {\r\n  if (variant === 'date') {\r\n    return (\r\n      dateUtils.shortDateFormat(\r\n        toEndDateDisplayValue({\r\n          value,\r\n          endTime,\r\n          truncateTime,\r\n          direction: 'toDisplay',\r\n        }),\r\n      ) ?? undefined\r\n    );\r\n  } else if (variant === 'time') {\r\n    return dateUtils.timeFormat(value) ?? undefined;\r\n  } else if (variant === 'datetime') {\r\n    return dateUtils.shortDateTimeFormat(value) ?? undefined;\r\n  } else {\r\n    return dateUtils.shortDateTimeFormat(value) ?? undefined;\r\n  }\r\n};\r\nexport const setInputViewDate = (\r\n  variant: DatePopupVariants,\r\n  value?: Date | string | null,\r\n  endTime?: boolean,\r\n  truncateTime?: boolean,\r\n): MaterialUiPickersDate | null => {\r\n  if (value === null) {\r\n    return null;\r\n  }\r\n  if (value === undefined) {\r\n    return null;\r\n  } else if (variant === 'date') {\r\n    let ddd =\r\n      toEndDateDisplayValue({\r\n        value,\r\n        endTime,\r\n        truncateTime,\r\n        direction: 'fromDisplay',\r\n      }) ?? value;\r\n    return new CustomDate(ddd, 'date');\r\n  } else if (variant === 'time') {\r\n    return new CustomDate(value, 'time');\r\n  } else if (variant === 'datetime') {\r\n    return new CustomDate(value, 'complete');\r\n  } else {\r\n    return new CustomDate(value, 'complete');\r\n  }\r\n};\r\nexport const getValueDateOrTruncat = (\r\n  variant: DatePopupVariants,\r\n  value?: Date | string | null,\r\n  endTime?: boolean,\r\n  truncateTime?: boolean,\r\n): Date | string | null | undefined => {\r\n  if (value === null || value === undefined) {\r\n    return value;\r\n  }\r\n\r\n  if (variant === 'date') {\r\n    return toEndDateDisplayValue({\r\n      value,\r\n      endTime,\r\n      truncateTime,\r\n      direction: 'toDisplay',\r\n    });\r\n  } else {\r\n    return value;\r\n  }\r\n};\r\nexport const maskFormats = {\r\n  date: '__/__/____',\r\n  time: '__:__',\r\n  timeMeridiem: '__:__ _M',\r\n  dateTime: '__/__/____ __:__',\r\n  dateTimeMeridiem: '__/__/____ __:__ _M',\r\n};\r\nexport const defaultDateTimeMask = (\r\n  format: string,\r\n  variant?: 'date' | 'time',\r\n): DateTimeMask => {\r\n  const tokens = getFormatTokens(format);\r\n  if (tokens === null) {\r\n    let defTokens = getFormatTokens(dateUtils.DateIOFormats.keyboardDateTime); //full fate time\r\n    if (defTokens === null) {\r\n      return {\r\n        day: 'dd',\r\n        month: 'MM',\r\n        year: 'yyyy',\r\n        hour: 'HH',\r\n        minute: 'mm',\r\n        meridiem: 'a',\r\n        dateSeparator: '/',\r\n        dateStartFrom: 'day',\r\n      };\r\n    } else {\r\n      let first = defTokens[0].toLowerCase();\r\n      let dateStartWith = first.startsWith('d')\r\n        ? 'day'\r\n        : first.startsWith('m')\r\n        ? 'month'\r\n        : 'year';\r\n      return {\r\n        day:\r\n          dateStartWith === 'day'\r\n            ? defTokens[0]\r\n            : dateStartWith === 'month'\r\n            ? defTokens[2]\r\n            : defTokens[4],\r\n        month:\r\n          dateStartWith === 'day'\r\n            ? defTokens[2]\r\n            : dateStartWith === 'month'\r\n            ? defTokens[0]\r\n            : defTokens[4],\r\n        year:\r\n          dateStartWith === 'day'\r\n            ? defTokens[4]\r\n            : dateStartWith === 'month'\r\n            ? defTokens[4]\r\n            : defTokens[0],\r\n        hour: defTokens[6],\r\n        minute: defTokens[8],\r\n        meridiem: defTokens.length > 8 ? defTokens[10] : 'aa',\r\n        dateSeparator: defTokens[1],\r\n        dateStartFrom:\r\n          dateStartWith === 'day'\r\n            ? 'day'\r\n            : dateStartWith === 'month'\r\n            ? 'month'\r\n            : 'year',\r\n      };\r\n    }\r\n  } else {\r\n    if (variant === undefined) {\r\n      if (tokens[0].toLowerCase().startsWith('h')) {\r\n        //time\r\n        let dateTokens = getFormatTokens(\r\n          dateUtils.DateIOFormats.keyboardDate,\r\n        ) ?? ['dd', '/', 'MM', '/', 'yyyy']; //full date\r\n        let first = dateTokens[0].toLowerCase();\r\n        let dateStartWith = first.startsWith('d')\r\n          ? 'day'\r\n          : first.startsWith('m')\r\n          ? 'month'\r\n          : 'year';\r\n        return {\r\n          day:\r\n            dateStartWith === 'day'\r\n              ? dateTokens[0]\r\n              : dateStartWith === 'month'\r\n              ? dateTokens[2]\r\n              : dateTokens[4],\r\n          month:\r\n            dateStartWith === 'day'\r\n              ? dateTokens[2]\r\n              : dateStartWith === 'month'\r\n              ? dateTokens[0]\r\n              : dateTokens[4],\r\n          year:\r\n            dateStartWith === 'day'\r\n              ? dateTokens[4]\r\n              : dateStartWith === 'month'\r\n              ? dateTokens[4]\r\n              : dateTokens[0],\r\n          hour: tokens[0],\r\n          minute: tokens[2],\r\n          meridiem: tokens.length > 2 ? tokens[4] : 'aa',\r\n          dateSeparator: dateTokens[1],\r\n          dateStartFrom:\r\n            dateStartWith === 'day'\r\n              ? 'day'\r\n              : dateStartWith === 'month'\r\n              ? 'month'\r\n              : 'year',\r\n        };\r\n      } else {\r\n        //date\r\n        let first = tokens[0].toLowerCase();\r\n        let dateStartWith = first.startsWith('d')\r\n          ? 'day'\r\n          : first.startsWith('m')\r\n          ? 'month'\r\n          : 'year';\r\n        let timeTokens = getFormatTokens(dateUtils.DateIOFormats.fullTime) ?? [\r\n          'HH',\r\n          ':',\r\n          'mm',\r\n        ];\r\n        return {\r\n          day:\r\n            dateStartWith === 'day'\r\n              ? tokens[0]\r\n              : dateStartWith === 'month'\r\n              ? tokens[2]\r\n              : tokens[4],\r\n          month:\r\n            dateStartWith === 'day'\r\n              ? tokens[2]\r\n              : dateStartWith === 'month'\r\n              ? tokens[0]\r\n              : tokens[4],\r\n          year:\r\n            dateStartWith === 'day'\r\n              ? tokens[4]\r\n              : dateStartWith === 'month'\r\n              ? tokens[4]\r\n              : tokens[0],\r\n          hour: timeTokens[0],\r\n          minute: timeTokens[2],\r\n          meridiem: timeTokens.length > 2 ? timeTokens[4] : 'a',\r\n          dateSeparator: tokens[1],\r\n          dateStartFrom:\r\n            dateStartWith === 'day'\r\n              ? 'day'\r\n              : dateStartWith === 'month'\r\n              ? 'month'\r\n              : 'year',\r\n        };\r\n      }\r\n    } else {\r\n      if (variant === 'time') {\r\n        let dateTokens = getFormatTokens(\r\n          dateUtils.DateIOFormats.keyboardDate,\r\n        ) ?? ['dd', '/', 'MM', '/', 'yyyy']; //full date\r\n        let first = dateTokens[0].toLowerCase();\r\n        let dateStartWith = first.startsWith('d')\r\n          ? 'day'\r\n          : first.startsWith('m')\r\n          ? 'month'\r\n          : 'year';\r\n        return {\r\n          day:\r\n            dateStartWith === 'day'\r\n              ? dateTokens[0]\r\n              : dateStartWith === 'month'\r\n              ? dateTokens[2]\r\n              : dateTokens[4],\r\n          month:\r\n            dateStartWith === 'day'\r\n              ? dateTokens[2]\r\n              : dateStartWith === 'month'\r\n              ? dateTokens[0]\r\n              : dateTokens[4],\r\n          year:\r\n            dateStartWith === 'day'\r\n              ? dateTokens[4]\r\n              : dateStartWith === 'month'\r\n              ? dateTokens[4]\r\n              : dateTokens[0],\r\n          hour: tokens[0],\r\n          minute: tokens[2],\r\n          meridiem: tokens.length > 2 ? tokens[4] : 'a',\r\n          dateSeparator: dateTokens[1],\r\n          dateStartFrom:\r\n            dateStartWith === 'day'\r\n              ? 'day'\r\n              : dateStartWith === 'month'\r\n              ? 'month'\r\n              : 'year',\r\n        };\r\n      } else {\r\n        let first = tokens[0].toLowerCase();\r\n        let dateStartWith = first.startsWith('d')\r\n          ? 'day'\r\n          : first.startsWith('m')\r\n          ? 'month'\r\n          : 'year';\r\n        let timeTokens = getFormatTokens(dateUtils.DateIOFormats.fullTime) ?? [\r\n          'HH',\r\n          ':',\r\n          'mm',\r\n        ];\r\n        return {\r\n          day:\r\n            dateStartWith === 'day'\r\n              ? tokens[0]\r\n              : dateStartWith === 'month'\r\n              ? tokens[2]\r\n              : tokens[4],\r\n          month:\r\n            dateStartWith === 'day'\r\n              ? tokens[2]\r\n              : dateStartWith === 'month'\r\n              ? tokens[0]\r\n              : tokens[4],\r\n          year:\r\n            dateStartWith === 'day'\r\n              ? tokens[4]\r\n              : dateStartWith === 'month'\r\n              ? tokens[4]\r\n              : tokens[0],\r\n          hour: timeTokens[0],\r\n          minute: timeTokens[2],\r\n          meridiem: timeTokens.length > 2 ? timeTokens[4] : 'a',\r\n          dateSeparator: tokens[1],\r\n          dateStartFrom:\r\n            dateStartWith === 'day'\r\n              ? 'day'\r\n              : dateStartWith === 'month'\r\n              ? 'month'\r\n              : 'year',\r\n        };\r\n      }\r\n    }\r\n  }\r\n};\r\n\r\nexport const maskFormat = (\r\n  dateVariant: Omit<DatePopupVariants, 'separate'>,\r\n  ampm: boolean,\r\n): string => {\r\n  switch (dateVariant) {\r\n    case 'date':\r\n      return maskFormats.date;\r\n    case 'time':\r\n      return ampm ? maskFormats.timeMeridiem : maskFormats.time;\r\n    case 'datetime':\r\n      return ampm ? maskFormats.dateTimeMeridiem : maskFormats.dateTime;\r\n    default:\r\n      return maskFormats.date;\r\n  }\r\n};\r\nexport function makeMaskFromFormat(format, numberMaskChar) {\r\n  return format.replace(/[a-z]/gi, numberMaskChar);\r\n}\r\n//MUI-4 dateFormatter\r\nexport const maskedDateFormatter = function (mask, numberMaskChar, refuse) {\r\n  return function (value) {\r\n    var result = '';\r\n    var parsed = value.replace(refuse, '');\r\n    if (parsed === '') {\r\n      return parsed;\r\n    }\r\n    var i = 0;\r\n    var n = 0;\r\n    while (i < mask.length) {\r\n      var maskChar = mask[i];\r\n      if (maskChar === numberMaskChar && n < parsed.length) {\r\n        var parsedChar = parsed[n];\r\n        result += parsedChar;\r\n        n += 1;\r\n      } else {\r\n        result += maskChar;\r\n      }\r\n      i += 1;\r\n    }\r\n    return result;\r\n  };\r\n};\r\n\r\nexport const parseDigits = (input: string) =>\r\n  (input.match(/\\d+/g) || []).join('');\r\n\r\nexport const formatDate = (input: string) => {\r\n  const digits = parseDigits(input);\r\n  const chars = digits.split('');\r\n  let res = chars\r\n    .reduce((r, v, index) => {\r\n      return index === 2 || index === 4 ? `${r}/${v}` : `${r}${v}`;\r\n    }, '')\r\n    .substr(0, 10);\r\n  return res;\r\n};\r\n\r\nexport const formatDateWithAppend = (input: string) => {\r\n  const res = formatDate(input);\r\n\r\n  if (input.endsWith('/')) {\r\n    if (res.length === 2) {\r\n      return `${res}/`;\r\n    }\r\n\r\n    if (res.length === 5) {\r\n      return `${res}/`;\r\n    }\r\n  }\r\n  return res;\r\n};\r\n\r\nexport const appendHyphen = v =>\r\n  v.length === 2 || v.length === 5 ? `${v}/` : v;\r\nexport const addMask = string => {\r\n  const digits = parseDigits(string);\r\n  const days = digits.slice(0, 2).padEnd(2, '_');\r\n  const months = digits.slice(2, 4).padEnd(2, '_');\r\n  const years = digits.slice(4, 8).padEnd(4, '_');\r\n  return `${days}-${months}-${years}`;\r\n};\r\n\r\nexport const dateStart: DateStartWith = dateUtils.dateFnsUtils.dateFormat\r\n  .toLowerCase()\r\n  .startsWith('m')\r\n  ? 'month'\r\n  : dateUtils.dateFnsUtils.dateFormat.toLowerCase().startsWith('d')\r\n  ? 'day'\r\n  : dateUtils.dateFnsUtils.dateFormat.toLowerCase().startsWith('y')\r\n  ? 'year'\r\n  : 'day';\r\n\r\nexport const dateSelection = (\r\n  event: React.MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>,\r\n  maskFormats: DateTimeMask,\r\n) => {\r\n  const target = event.target as HTMLInputElement;\r\n  let dateStartFrom = maskFormats.dateStartFrom;\r\n  // let selectionDirection = target.selectionDirection;\r\n  let selectionStart = target.selectionStart;\r\n  let selectionEnd = target.selectionEnd;\r\n  if (!!target.value && target.value !== '') {\r\n    if (dateStartFrom === 'year') {\r\n      if (selectionEnd !== null) {\r\n        if (selectionEnd <= 4) {\r\n          if (selectionStart === 0 && selectionEnd === 4) {\r\n            event.preventDefault();\r\n          }\r\n          target.setSelectionRange(0, 4);\r\n        } else if (selectionEnd <= 7) {\r\n          if (selectionStart === 5 && selectionEnd === 7) {\r\n            event.preventDefault();\r\n          }\r\n          target.setSelectionRange(5, 7);\r\n        } else {\r\n          if (selectionStart === 8 && selectionEnd === 10) {\r\n            event.preventDefault();\r\n          }\r\n          target.setSelectionRange(8, 10);\r\n        }\r\n        // target.setRangeText(target.value.substring(0, 2));\r\n      }\r\n    } else {\r\n      if (selectionEnd !== null) {\r\n        if (selectionEnd <= 2) {\r\n          if (selectionStart === 0 && selectionEnd === 2) {\r\n            event.preventDefault();\r\n          }\r\n          target.setSelectionRange(0, 2);\r\n        } else if (selectionEnd <= 5) {\r\n          if (selectionStart === 3 && selectionEnd === 5) {\r\n            event.preventDefault();\r\n          }\r\n          target.setSelectionRange(3, 5);\r\n        } else {\r\n          if (selectionStart === 6 && selectionEnd === 10) {\r\n            event.preventDefault();\r\n          }\r\n          target.setSelectionRange(6, 10);\r\n        }\r\n        // target.setRangeText(target.value.substring(0, 2));\r\n      }\r\n    }\r\n  }\r\n};\r\nexport const timeSelection = (\r\n  event: React.MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>,\r\n  maskFormats: DateTimeMask,\r\n) => {\r\n  const target = event.target as HTMLInputElement;\r\n  // let selectionDirection = target.selectionDirection;\r\n  let selectionStart = target.selectionStart ?? 0;\r\n  let selectionEnd = target.selectionEnd ?? 0;\r\n  let oneLetterHour =\r\n    maskFormats.hour.length === 1 && target.value.split(':')[0].length === 1;\r\n\r\n  if (!!target.value && target.value !== '') {\r\n    if (selectionEnd <= (oneLetterHour ? 1 : 2)) {\r\n      if (selectionStart === 0 && selectionEnd === (oneLetterHour ? 1 : 2)) {\r\n        event.preventDefault();\r\n      }\r\n      target.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n    } else if (selectionEnd <= (oneLetterHour ? 4 : 5)) {\r\n      if (\r\n        selectionStart > (oneLetterHour ? 1 : 2) &&\r\n        selectionEnd === (oneLetterHour ? 4 : 5)\r\n      ) {\r\n        event.preventDefault();\r\n      }\r\n      target.setSelectionRange(oneLetterHour ? 2 : 3, oneLetterHour ? 4 : 5);\r\n    } else {\r\n      if (target.value.length > (oneLetterHour ? 4 : 5)) {\r\n        if (\r\n          selectionStart === (oneLetterHour ? 5 : 6) &&\r\n          selectionEnd === (oneLetterHour ? 7 : 8)\r\n        ) {\r\n          event.preventDefault();\r\n        }\r\n        target.setSelectionRange(oneLetterHour ? 5 : 6, oneLetterHour ? 7 : 8);\r\n      } else {\r\n        target.setSelectionRange(3, 5);\r\n      }\r\n    }\r\n  }\r\n};\r\nexport const dateArrowSelection = (\r\n  event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>,\r\n  arrows: 'left' | 'right',\r\n  variant: 'date' | 'time',\r\n  maskFormats: DateTimeMask,\r\n) => {\r\n  const target = event.target as HTMLInputElement;\r\n  let selectionStart = target.selectionStart ?? 0;\r\n  let selectionEnd = target.selectionEnd ?? 0;\r\n  let oneLetterHour =\r\n    variant === 'time' &&\r\n    maskFormats.hour.length === 1 &&\r\n    target.value.split(':')[0].length === 1;\r\n  let dateStartFrom = maskFormats.dateStartFrom;\r\n  if (arrows === 'left') {\r\n    if (!!target.value && target.value !== '') {\r\n      if (variant === 'time') {\r\n        if (selectionStart <= (oneLetterHour ? 2 : 3)) {\r\n          target.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n        } else if (\r\n          selectionStart <= (oneLetterHour ? 5 : 6) &&\r\n          selectionStart > (oneLetterHour ? 2 : 3)\r\n        ) {\r\n          target.setSelectionRange(\r\n            oneLetterHour ? 2 : 3,\r\n            oneLetterHour ? 4 : 5,\r\n          );\r\n        } else {\r\n          if (target.value.length > (oneLetterHour ? 4 : 5)) {\r\n            target.setSelectionRange(\r\n              oneLetterHour ? 5 : 6,\r\n              oneLetterHour ? 7 : 8,\r\n            );\r\n          } else {\r\n            target.setSelectionRange(3, 5);\r\n          }\r\n        }\r\n      } else {\r\n        if (dateStartFrom === 'year') {\r\n          if (selectionStart <= 6 && selectionStart > 4) {\r\n            target.setSelectionRange(0, 4);\r\n          } else if (selectionStart <= 8 && selectionStart > 5) {\r\n            target.setSelectionRange(5, 7);\r\n          } else {\r\n            target.setSelectionRange(8, 10);\r\n          }\r\n        } else {\r\n          if (selectionStart <= 3) {\r\n            target.setSelectionRange(0, 2);\r\n          } else if (selectionStart <= 6 && selectionStart > 3) {\r\n            target.setSelectionRange(3, 5);\r\n          } else {\r\n            target.setSelectionRange(6, 10);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  if (arrows === 'right') {\r\n    if (!!target.value && target.value !== '') {\r\n      if (variant === 'time') {\r\n        if (\r\n          selectionEnd >= (oneLetterHour ? 1 : 2) &&\r\n          selectionEnd < (oneLetterHour ? 4 : 5)\r\n        ) {\r\n          target.setSelectionRange(\r\n            oneLetterHour ? 2 : 3,\r\n            oneLetterHour ? 4 : 5,\r\n          );\r\n        } else if (selectionEnd >= (oneLetterHour ? 4 : 5)) {\r\n          if (target.value.length > (oneLetterHour ? 4 : 5)) {\r\n            target.setSelectionRange(\r\n              oneLetterHour ? 5 : 6,\r\n              oneLetterHour ? 7 : 8,\r\n            );\r\n          } else {\r\n            target.setSelectionRange(3, 5);\r\n          }\r\n        } else {\r\n          target.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n        }\r\n      } else {\r\n        if (dateStartFrom === 'year') {\r\n          if (selectionEnd >= 4 && selectionEnd < 7) {\r\n            target.setSelectionRange(5, 7);\r\n          } else if (selectionEnd >= 7) {\r\n            target.setSelectionRange(8, 10);\r\n          } else {\r\n            target.setSelectionRange(0, 2);\r\n          }\r\n        } else {\r\n          if (selectionEnd >= 2 && selectionEnd < 5) {\r\n            target.setSelectionRange(3, 5);\r\n          } else if (selectionEnd >= 5) {\r\n            target.setSelectionRange(6, 10);\r\n          } else {\r\n            target.setSelectionRange(0, 2);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n};\r\nexport const getMaskedDateValue = (mask: DateTimeMask, value?: string) => {\r\n  let singleValue = !!value && value.length === 1 ? value : undefined;\r\n  return mask.dateStartFrom === 'day'\r\n    ? `${!!singleValue ? singleValue : mask.day}${mask.dateSeparator}${\r\n        mask.month\r\n      }${mask.dateSeparator}${mask.year}`\r\n    : mask.dateStartFrom === 'month'\r\n    ? `${!!singleValue ? singleValue : mask.month}${mask.dateSeparator}${\r\n        mask.day\r\n      }${mask.dateSeparator}${mask.year}`\r\n    : `${!!singleValue ? singleValue : mask.year}${mask.dateSeparator}${\r\n        mask.month\r\n      }${mask.dateSeparator}${mask.day}`;\r\n};\r\nexport const getMaskedTimeValue = (\r\n  mask: DateTimeMask,\r\n  ampm?: boolean,\r\n  value?: string,\r\n) => {\r\n  let separator = ':';\r\n  // value only used when is a single character\r\n  let hour = !!value && value.length === 1 ? value : undefined;\r\n  return ampm\r\n    ? `${!!hour ? hour : mask.hour}${separator}${mask.minute} ${mask.meridiem}`\r\n    : `${!!hour ? hour : mask.hour}${separator}${mask.minute}`;\r\n};\r\nexport const formatingDate = (\r\n  text: string,\r\n  partChanged: 'day' | 'month' | 'year',\r\n  maskFormat: DateTimeMask,\r\n  prevValue: string,\r\n  increment?: 'increase' | 'decrease',\r\n  isPrevZero?: boolean,\r\n  isSelectionChanged?: boolean,\r\n): FormatedResult => {\r\n  let result = {\r\n    value: prevValue,\r\n    stayOnSelection: false,\r\n    zeroPress: false,\r\n  };\r\n  let stayOnSelection = false;\r\n  let newDate = prevValue;\r\n  let separator = maskFormat.dateSeparator;\r\n  let startedFrom = maskFormat.dateStartFrom;\r\n  let zeroPress = false;\r\n  if (text === '') {\r\n    newDate =\r\n      startedFrom === 'day'\r\n        ? `${maskFormat.day}${separator}${maskFormat.month}${separator}${maskFormat.year}`\r\n        : maskFormat.dateStartFrom === 'month'\r\n        ? `${maskFormat.month}${separator}${maskFormat.day}${separator}${maskFormat.year}`\r\n        : `${maskFormat.year}${separator}${maskFormat.month}${separator}${maskFormat.day}`;\r\n  } else {\r\n    let parts = text.split(separator);\r\n    let prevParts = prevValue.split(separator);\r\n    if (partChanged === 'day') {\r\n      let dayVal =\r\n        startedFrom === 'day'\r\n          ? parts[0]\r\n          : startedFrom === 'month'\r\n          ? parts[1]\r\n          : parts[2];\r\n      let prevDayVal =\r\n        startedFrom === 'day'\r\n          ? prevParts[0]\r\n          : startedFrom === 'month'\r\n          ? prevParts[1]\r\n          : prevParts[2];\r\n      if (dayVal === '') {\r\n        stayOnSelection = true;\r\n        newDate =\r\n          startedFrom === 'day'\r\n            ? `${maskFormat.day}${separator}${parts[1]}${separator}${parts[2]}`\r\n            : startedFrom === 'month'\r\n            ? `${parts[0]}${separator}${maskFormat.day}${separator}${parts[2]}`\r\n            : `${parts[0]}${separator}${parts[1]}${separator}${maskFormat.day}`;\r\n      } else {\r\n        if (\r\n          dayVal.match(/[^\\d]+/gi) ||\r\n          (dayVal === '0' &&\r\n            !isNaN(parseInt(prevDayVal)) &&\r\n            (parseInt(prevDayVal) > 3 || isSelectionChanged)) ||\r\n          isNaN(parseInt(dayVal))\r\n        ) {\r\n          stayOnSelection = true;\r\n          zeroPress = dayVal === '0';\r\n          newDate =\r\n            startedFrom === 'day'\r\n              ? `${prevDayVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n              : startedFrom === 'month'\r\n              ? `${parts[0]}${separator}${prevDayVal}${separator}${parts[2]}`\r\n              : `${parts[0]}${separator}${parts[1]}${separator}${prevDayVal}`;\r\n        } else {\r\n          let newVal = '';\r\n          let dayInt = parseInt(dayVal);\r\n          if (!!increment) {\r\n            stayOnSelection = true;\r\n            dayInt = increment === 'increase' ? dayInt + 1 : dayInt - 1;\r\n            dayVal = dayInt.toString();\r\n            if (dayInt <= 0) {\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${'31'}${separator}${parts[1]}${separator}${parts[2]}`\r\n                  : startedFrom === 'month'\r\n                  ? `${parts[0]}${separator}${'31'}${separator}${parts[2]}`\r\n                  : `${parts[0]}${separator}${parts[1]}${separator}${'31'}`;\r\n            } else if (dayInt > 31) {\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${'01'}${separator}${parts[1]}${separator}${parts[2]}`\r\n                  : startedFrom === 'month'\r\n                  ? `${parts[0]}${separator}${'01'}${separator}${parts[2]}`\r\n                  : `${parts[0]}${separator}${parts[1]}${separator}${'01'}`;\r\n            } else {\r\n              newVal = dayInt < 10 ? `0${dayVal}` : dayVal;\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n                  : startedFrom === 'month'\r\n                  ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n                  : `${parts[0]}${separator}${parts[1]}${separator}${newVal}`;\r\n            }\r\n          } else {\r\n            if (prevDayVal === '' || prevDayVal === maskFormat.day) {\r\n              newVal = `0${dayVal}`;\r\n              stayOnSelection = dayInt <= 3;\r\n            } else {\r\n              let prevInt = parseInt(isPrevZero ? '0' : prevDayVal);\r\n              if (prevInt.toString().length > 1) {\r\n                newVal = `0${dayVal}`;\r\n                stayOnSelection = dayInt <= 3;\r\n              } else {\r\n                if (prevInt > 3) {\r\n                  newVal = `0${dayVal}`;\r\n                  stayOnSelection = dayInt <= 3;\r\n                } else {\r\n                  let comb = `${prevInt}${dayInt}`;\r\n                  if (parseInt(comb) > 31) {\r\n                    newVal = `0${dayVal}`;\r\n                    stayOnSelection = dayInt <= 3;\r\n                  } else {\r\n                    newVal = comb;\r\n                  }\r\n                }\r\n              }\r\n            }\r\n            newDate =\r\n              startedFrom === 'day'\r\n                ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n                : startedFrom === 'month'\r\n                ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n                : `${parts[0]}${separator}${parts[1]}${separator}${newVal}`;\r\n          }\r\n        }\r\n      }\r\n      return {\r\n        value: newDate,\r\n        stayOnSelection: stayOnSelection,\r\n        zeroPress: zeroPress,\r\n      };\r\n    } else if (partChanged === 'month') {\r\n      let monthVal =\r\n        startedFrom === 'day'\r\n          ? parts[1]\r\n          : startedFrom === 'month'\r\n          ? parts[0]\r\n          : parts[1];\r\n      let prevMonthVal =\r\n        startedFrom === 'day'\r\n          ? prevParts[1]\r\n          : startedFrom === 'month'\r\n          ? prevParts[0]\r\n          : prevParts[1];\r\n\r\n      // let monthArray = monthEntityArray;\r\n      if (monthVal === '') {\r\n        stayOnSelection = true;\r\n        newDate =\r\n          startedFrom === 'day'\r\n            ? `${parts[0]}${separator}${maskFormat.month}${separator}${parts[2]}`\r\n            : startedFrom === 'month'\r\n            ? `${maskFormat.month}${separator}${parts[1]}${separator}${parts[2]}`\r\n            : `${parts[0]}${separator}${maskFormat.month}${separator}${parts[2]}`;\r\n      } else {\r\n        if (\r\n          monthVal.match(/[^\\d]+/gi) ||\r\n          (monthVal === '0' &&\r\n            !isNaN(parseInt(prevMonthVal)) &&\r\n            (parseInt(prevMonthVal) > 1 || isSelectionChanged)) ||\r\n          isNaN(parseInt(monthVal))\r\n        ) {\r\n          stayOnSelection = true;\r\n          zeroPress = monthVal === '0';\r\n          newDate =\r\n            startedFrom === 'day'\r\n              ? `${parts[0]}${separator}${prevMonthVal}${separator}${parts[2]}`\r\n              : startedFrom === 'month'\r\n              ? `${prevMonthVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n              : `${parts[0]}${separator}${prevMonthVal}${separator}${parts[2]}`;\r\n        } else {\r\n          let newVal = '';\r\n          let monthInt = parseInt(monthVal);\r\n          if (!!increment) {\r\n            stayOnSelection = true;\r\n            monthInt = increment === 'increase' ? monthInt + 1 : monthInt - 1;\r\n            monthVal = monthInt.toString();\r\n\r\n            if (monthInt <= 0) {\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${parts[0]}${separator}${'12'}${separator}${parts[2]}`\r\n                  : startedFrom === 'month'\r\n                  ? `${'12'}${separator}${parts[1]}${separator}${parts[2]}`\r\n                  : `${parts[0]}${separator}${'12'}${separator}${parts[2]}`;\r\n            } else if (monthInt > 12) {\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${parts[0]}${separator}${'01'}${separator}${parts[2]}`\r\n                  : startedFrom === 'month'\r\n                  ? `${'01'}${separator}${parts[1]}${separator}${parts[2]}`\r\n                  : `${parts[0]}${separator}${'01'}${separator}${parts[2]}`;\r\n            } else {\r\n              newVal = monthInt < 10 ? `0${monthVal}` : monthVal;\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n                  : startedFrom === 'month'\r\n                  ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n                  : `${parts[0]}${separator}${newVal}${separator}${parts[2]}`;\r\n            }\r\n          } else {\r\n            if (prevMonthVal === '' || prevMonthVal === maskFormat.month) {\r\n              newVal = `0${monthVal}`;\r\n              stayOnSelection = monthInt <= 1;\r\n            } else {\r\n              let prevMonthInt = parseInt(isPrevZero ? '0' : prevMonthVal);\r\n              if (prevMonthInt.toString().length > 1) {\r\n                newVal = `0${monthVal}`;\r\n                stayOnSelection = monthInt <= 1;\r\n              } else {\r\n                let comb = `${prevMonthInt}${monthInt}`;\r\n                if (parseInt(comb) > 12) {\r\n                  newVal = `0${monthVal}`;\r\n                  stayOnSelection = monthInt <= 1;\r\n                } else {\r\n                  newVal = comb;\r\n                }\r\n                // if (prevMonthInt === 1) {\r\n                //   let comb = `${prevMonthInt}${monthInt}`;\r\n                //   if (parseInt(comb) > 12) {\r\n                //     newVal = `0${monthVal}`;\r\n                //     stayOnSelection = monthInt <= 1;\r\n                //   } else {\r\n                //     newVal = comb;\r\n                //   }\r\n                // } else {\r\n                //   newVal = `0${monthVal}`;\r\n                //   stayOnSelection = monthInt <= 1;\r\n                // }\r\n              }\r\n            }\r\n            newDate =\r\n              startedFrom === 'day'\r\n                ? `${parts[0]}${separator}${newVal}${separator}${parts[2]}`\r\n                : startedFrom === 'month'\r\n                ? `${newVal}${separator}${parts[1]}${separator}${parts[2]}`\r\n                : `${parts[0]}${separator}${newVal}${separator}${parts[2]}`;\r\n          }\r\n        }\r\n      }\r\n      return {\r\n        value: newDate,\r\n        stayOnSelection: stayOnSelection,\r\n        zeroPress: zeroPress,\r\n      };\r\n    } else if (partChanged === 'year') {\r\n      let yearVal =\r\n        startedFrom === 'day'\r\n          ? parts[2]\r\n          : startedFrom === 'month'\r\n          ? parts[2]\r\n          : parts[0];\r\n      let prevYearVal =\r\n        startedFrom === 'day'\r\n          ? prevParts[2]\r\n          : startedFrom === 'month'\r\n          ? prevParts[2]\r\n          : prevParts[0];\r\n      if (yearVal === '') {\r\n        stayOnSelection = true;\r\n        newDate =\r\n          startedFrom === 'day'\r\n            ? `${parts[0]}${separator}${parts[1]}${separator}${maskFormat.year}`\r\n            : startedFrom === 'month'\r\n            ? `${parts[0]}${separator}${parts[1]}${separator}${maskFormat.year}`\r\n            : `${maskFormat.year}${separator}${parts[1]}${separator}${parts[2]}`;\r\n      } else {\r\n        if (\r\n          yearVal.match(/[^\\d]+/gi) ||\r\n          // yearVal === '0' ||\r\n          isNaN(parseInt(yearVal))\r\n        ) {\r\n          stayOnSelection = true;\r\n          newDate =\r\n            startedFrom === 'day'\r\n              ? `${parts[0]}${separator}${parts[1]}${separator}${prevYearVal}`\r\n              : startedFrom === 'month'\r\n              ? `${parts[0]}${separator}${parts[1]}${separator}${prevYearVal}`\r\n              : `${prevYearVal}${separator}${parts[1]}${separator}${parts[2]}`;\r\n        } else {\r\n          let newVal = '';\r\n          let yearInt = parseInt(yearVal);\r\n          if (!!increment) {\r\n            stayOnSelection = true;\r\n            yearInt = increment === 'increase' ? yearInt + 1 : yearInt - 1;\r\n            yearVal = yearInt.toString();\r\n            if (yearInt < 0) {\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${parts[0]}${separator}${parts[1]}${separator}${'9999'}`\r\n                  : startedFrom === 'month'\r\n                  ? `${parts[0]}${separator}${parts[1]}${separator}${'9999'}`\r\n                  : `${'9999'}${separator}${parts[1]}${separator}${parts[2]}`;\r\n            } else if (yearInt > 9999) {\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${parts[0]}${separator}${parts[1]}${separator}${'0000'}`\r\n                  : startedFrom === 'month'\r\n                  ? `${parts[0]}${separator}${parts[1]}${separator}${'0000'}`\r\n                  : `${'0000'}${separator}${parts[1]}${separator}${parts[2]}`;\r\n            } else {\r\n              newVal =\r\n                yearInt > 1000\r\n                  ? yearVal\r\n                  : yearInt > 100\r\n                  ? `0${yearVal}`\r\n                  : yearInt > 10\r\n                  ? `00${yearVal}`\r\n                  : `000${yearVal}`;\r\n              newDate =\r\n                startedFrom === 'day'\r\n                  ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n                  : startedFrom === 'month'\r\n                  ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n                  : `${newVal}${separator}${parts[1]}${separator}${parts[2]}`;\r\n            }\r\n          } else {\r\n            if (prevYearVal === undefined) {\r\n              newVal =\r\n                yearVal.length === 4\r\n                  ? yearVal\r\n                  : yearVal.length === 3\r\n                  ? `0${yearVal}`\r\n                  : yearVal.length === 2\r\n                  ? `00${yearVal}`\r\n                  : `000${yearVal}`;\r\n            } else if (prevYearVal === '' || prevYearVal === maskFormat.year) {\r\n              newVal = `000${yearVal}`;\r\n            } else if (prevYearVal.startsWith('0')) {\r\n              newVal = prevYearVal.padEnd(5, yearVal).slice(1, 5);\r\n            } else {\r\n              newVal = `000${yearVal}`;\r\n            }\r\n            newDate =\r\n              startedFrom === 'day'\r\n                ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n                : startedFrom === 'month'\r\n                ? `${parts[0]}${separator}${parts[1]}${separator}${newVal}`\r\n                : `${newVal}${separator}${parts[1]}${separator}${parts[2]}`;\r\n          }\r\n        }\r\n      }\r\n      return {\r\n        value: newDate,\r\n        stayOnSelection: true,\r\n        zeroPress: false,\r\n      };\r\n    } else {\r\n      return result;\r\n    }\r\n  }\r\n\r\n  return result;\r\n};\r\nexport const formatingTime = (\r\n  text: string,\r\n  partChanged: 'hour' | 'minute' | 'meridiem',\r\n  maskFormat: DateTimeMask,\r\n  prevValue: string,\r\n  increment?: 'increase' | 'decrease',\r\n  ampm?: boolean,\r\n) => {\r\n  let result = {\r\n    value: prevValue,\r\n    stayOnSelection: false,\r\n  };\r\n  let stayOnSelection = false;\r\n  let newTime = prevValue;\r\n  let separator = ':';\r\n  if (text === '') {\r\n    newTime = ampm\r\n      ? `${maskFormat.hour}${separator}${maskFormat.minute} ${maskFormat.meridiem}`\r\n      : `${maskFormat.hour}${separator}${maskFormat.minute}`;\r\n  } else {\r\n    let parts = text.split(separator);\r\n    let hour = parts[0];\r\n    let minute = ampm ? parts[1].split(' ')[0] : parts[1];\r\n    let meridiem = ampm ? parts[1].split(' ')[1] : '';\r\n    let prevParts = prevValue.split(separator);\r\n    let prevHour = prevParts[0];\r\n    let prevMinute = ampm ? prevParts[1].split(' ')[0] : prevParts[1];\r\n    let prevMeridiem = ampm ? prevParts[1].split(' ')[1] : '';\r\n    if (partChanged === 'hour') {\r\n      if (hour === '') {\r\n        stayOnSelection = true;\r\n        newTime = ampm\r\n          ? `${maskFormat.hour}${separator}${minute} ${meridiem}`\r\n          : `${maskFormat.hour}${separator}${minute}`;\r\n      } else {\r\n        if (\r\n          hour.match(/[^\\d]+/gi) ||\r\n          (ampm &&\r\n            ((hour === '0' &&\r\n              !isNaN(parseInt(prevHour)) &&\r\n              parseInt(prevHour) > 1) ||\r\n              isNaN(parseInt(hour))))\r\n        ) {\r\n          stayOnSelection = true;\r\n          newTime = ampm\r\n            ? `${prevHour}${separator}${minute} ${meridiem}`\r\n            : `${prevHour}${separator}${minute}`;\r\n        } else {\r\n          let newVal = '';\r\n          let hourInt = parseInt(hour);\r\n          if (!!increment) {\r\n            stayOnSelection = true;\r\n            hourInt = increment === 'increase' ? hourInt + 1 : hourInt - 1;\r\n            hour = hourInt.toString();\r\n\r\n            if (hourInt < 0 || (ampm && hourInt === 0)) {\r\n              newTime = ampm\r\n                ? `${'12'}${separator}${minute} ${meridiem}`\r\n                : `${'23'}${separator}${minute}`;\r\n            } else if (hourInt > (ampm ? 12 : 23)) {\r\n              newTime = ampm\r\n                ? `${\r\n                    maskFormat.hour.length === 1 ? '1' : '01'\r\n                  }${separator}${minute} ${meridiem}`\r\n                : `${'00'}${separator}${minute}`;\r\n            } else {\r\n              newVal =\r\n                hourInt < 10\r\n                  ? ampm\r\n                    ? maskFormat.hour.length === 1\r\n                      ? hour\r\n                      : `0${hour}`\r\n                    : `0${hour}`\r\n                  : hour;\r\n              newTime = ampm\r\n                ? `${newVal}${separator}${minute} ${meridiem}`\r\n                : `${newVal}${separator}${minute}`;\r\n            }\r\n          } else {\r\n            if (prevHour === '' || prevHour === maskFormat.hour) {\r\n              newVal = ampm\r\n                ? maskFormat.hour.length === 1\r\n                  ? `${hour}`\r\n                  : `0${hour}`\r\n                : `0${hour}`;\r\n              stayOnSelection = ampm ? hourInt <= 1 : hourInt <= 2;\r\n            } else {\r\n              let prevHourInt = parseInt(prevHour);\r\n              if (prevHourInt.toString().length > 1) {\r\n                newVal = ampm\r\n                  ? maskFormat.hour.length === 1\r\n                    ? `${hour}`\r\n                    : `0${hour}`\r\n                  : `0${hour}`;\r\n                stayOnSelection = ampm ? hourInt <= 1 : hourInt <= 2;\r\n              } else {\r\n                if (\r\n                  (ampm && prevHourInt === 1) ||\r\n                  (!ampm && prevHourInt <= 2)\r\n                ) {\r\n                  let comb = `${prevHourInt}${hourInt}`;\r\n                  if (ampm && parseInt(comb) > 12) {\r\n                    newVal =\r\n                      maskFormat.hour.length === 1 ? `${hour}` : `0${hour}`;\r\n                    stayOnSelection = hourInt <= 1;\r\n                  } else if (!ampm && parseInt(comb) > 23) {\r\n                    newVal = `0${hour}`;\r\n                    stayOnSelection = hourInt <= 2;\r\n                  } else {\r\n                    newVal = comb;\r\n                  }\r\n                } else {\r\n                  newVal = ampm\r\n                    ? maskFormat.hour.length === 1\r\n                      ? `${hour}`\r\n                      : `0${hour}`\r\n                    : `0${hour}`;\r\n                  stayOnSelection = ampm ? hourInt <= 1 : hourInt <= 2;\r\n                }\r\n              }\r\n            }\r\n            newTime = ampm\r\n              ? `${newVal}${separator}${minute} ${meridiem}`\r\n              : `${newVal}${separator}${minute}`;\r\n          }\r\n        }\r\n      }\r\n      return {\r\n        value: newTime,\r\n        stayOnSelection: stayOnSelection,\r\n      };\r\n    }\r\n    if (partChanged === 'minute') {\r\n      if (minute === '') {\r\n        stayOnSelection = true;\r\n        newTime = ampm\r\n          ? `${hour}${separator}${maskFormat.minute} ${meridiem}`\r\n          : `${hour}${separator}${maskFormat.minute}`;\r\n      } else {\r\n        if (minute.match(/[^\\d]+/gi)) {\r\n          stayOnSelection = true;\r\n          newTime = ampm\r\n            ? `${hour}${separator}${prevMinute} ${meridiem}`\r\n            : `${hour}${separator}${prevMinute}`;\r\n        } else {\r\n          let newVal = '';\r\n          let minuteInt = parseInt(minute);\r\n          if (!!increment) {\r\n            stayOnSelection = true;\r\n            minuteInt =\r\n              increment === 'increase' ? minuteInt + 1 : minuteInt - 1;\r\n            minute = minuteInt.toString();\r\n\r\n            if (minuteInt < 0) {\r\n              newTime = ampm\r\n                ? `${hour}${separator}${'59'} ${meridiem}`\r\n                : `${hour}${separator}${'59'}`;\r\n            } else if (minuteInt > 59) {\r\n              newTime = ampm\r\n                ? `${hour}${separator}${'00'} ${meridiem}`\r\n                : `${hour}${separator}${'00'}`;\r\n            } else {\r\n              newVal = minuteInt < 10 ? `0${minute}` : minute;\r\n              newTime = ampm\r\n                ? `${hour}${separator}${newVal} ${meridiem}`\r\n                : `${hour}${separator}${newVal}`;\r\n            }\r\n          } else {\r\n            if (prevMinute === '' || prevMinute === maskFormat.minute) {\r\n              newVal = `0${minute}`;\r\n              stayOnSelection = minuteInt <= 5;\r\n            } else {\r\n              let prevMinuteInt = parseInt(prevMinute);\r\n              if (prevMinuteInt.toString().length > 1) {\r\n                newVal = `0${minute}`;\r\n                stayOnSelection = minuteInt <= 5;\r\n              } else {\r\n                if (prevMinuteInt <= 5) {\r\n                  let comb = `${prevMinuteInt}${minuteInt}`;\r\n                  if (parseInt(comb) > 59) {\r\n                    newVal = `0${minute}`;\r\n                    stayOnSelection = minuteInt <= 5;\r\n                  } else {\r\n                    newVal = comb;\r\n                  }\r\n                } else {\r\n                  newVal = `0${minute}`;\r\n                  stayOnSelection = minuteInt <= 5;\r\n                }\r\n              }\r\n            }\r\n            newTime = ampm\r\n              ? `${hour}${separator}${newVal} ${meridiem}`\r\n              : `${hour}${separator}${newVal}`;\r\n          }\r\n        }\r\n      }\r\n      return {\r\n        value: newTime,\r\n        stayOnSelection: stayOnSelection,\r\n      };\r\n    }\r\n    if (ampm && partChanged === 'meridiem') {\r\n      if (meridiem === '') {\r\n        stayOnSelection = true;\r\n        newTime = `${hour}${separator}${minute} ${maskFormat.meridiem}`;\r\n      } else {\r\n        if (meridiem.match(/[\\dap]+/gi) === null) {\r\n          stayOnSelection = true;\r\n          newTime = `${hour}${separator}${minute} ${prevMeridiem}`;\r\n        } else {\r\n          let newVal = '';\r\n          if (!!increment) {\r\n            stayOnSelection = true;\r\n            newVal = prevMeridiem.toLowerCase().startsWith('p') ? 'AM' : 'PM';\r\n            newTime = `${hour}${separator}${minute} ${newVal}`;\r\n          } else {\r\n            stayOnSelection = true;\r\n            newVal = meridiem.toLowerCase().startsWith('p') ? 'PM' : 'AM';\r\n            newTime = `${hour}${separator}${minute} ${newVal}`;\r\n          }\r\n        }\r\n      }\r\n      return {\r\n        value: newTime,\r\n        stayOnSelection: stayOnSelection,\r\n      };\r\n    }\r\n  }\r\n  return result;\r\n};\r\n\r\nexport const getDisplayDate = (\r\n  value: ParsableDate,\r\n  format: string,\r\n  utils: IUtils<any>,\r\n  isEmpty: boolean,\r\n  props: Pick<\r\n    BaseKeyboardPickerProps,\r\n    'invalidLabel' | 'emptyLabel' | 'labelFunc'\r\n  >,\r\n) => {\r\n  const { invalidLabel, emptyLabel, labelFunc } = props;\r\n  var date =\r\n    value === null || value === undefined\r\n      ? ''\r\n      : typeof value === 'object'\r\n      ? new Date(value as Date)\r\n      : typeof value === 'number'\r\n      ? new Date(value)\r\n      : dateUtils.dateOrStringToDate(value);\r\n  let t = dateUtils.dateOrStringToDate(date);\r\n  if (labelFunc) {\r\n    return labelFunc(isEmpty ? null : t, invalidLabel || '');\r\n  }\r\n  if (isEmpty) {\r\n    return emptyLabel || '';\r\n  }\r\n  return utils.isValid(date) ? utils.format(t, format) : invalidLabel;\r\n};\r\nexport const getParsableDate = (date: ParsableDate): Date | null => {\r\n  var resDate =\r\n    date === null || date === undefined\r\n      ? null\r\n      : typeof date === 'object'\r\n      ? new Date(date as Date)\r\n      : typeof date === 'number'\r\n      ? new Date(date)\r\n      : dateUtils.dateOrStringToDate(date);\r\n  return resDate;\r\n};\r\n","import { PopperProps, Theme, Popper } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n// import { bookitColors } from 'styles/colors/bookitColors';\r\nimport { bookitShadows } from 'styles/shadows/bookitShadow';\r\n\r\nexport const StyledPicker = styled('div')(({ theme }) => ({\r\n  '&.picker-root': {\r\n    width: '100%',\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    '& .picker-date-input': {},\r\n    // '& .picker-popper': {\r\n    //   zIndex: 1300,\r\n    //   '& .picker-paper': {\r\n    //     padding: '16px',\r\n    //     maxWidth: '360px',\r\n    //     borderRadius: '12px',\r\n    //     boxShadow: bookitShadows.shadowXL,\r\n    //     // background: bookitColors.grayscale.grayBackground,\r\n    //     '& .picker-header': {\r\n    //       // minHeight: '20px',\r\n    //       '& .picker-header-title': {},\r\n    //     },\r\n    //     '& .picker-content': {\r\n    //       display: 'flex',\r\n    //       flexDirection: 'column',\r\n    //       alignItems: 'center',\r\n    //       gap: '8px',\r\n    //       '& .picker-content-date': {\r\n    //         height: '56px',\r\n    //         width: '100%',\r\n    //         // padding: '12px',\r\n    //       },\r\n    //       '& .picker-buttons': {\r\n    //         display: 'flex',\r\n    //         flexDirection: 'row',\r\n    //         alignItems: 'center',\r\n    //         alignSelf: 'flex-start',\r\n    //         gap: '16px',\r\n    //         // paddingTop: '16px',\r\n    //       },\r\n    //     },\r\n    //   },\r\n    // },\r\n  },\r\n}));\r\n\r\nexport const PickerPopper = styled(\r\n  ({\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & PopperProps) => <Popper {...other}>{children}</Popper>,\r\n)({\r\n  '&.picker-popper': {\r\n    zIndex: 1300,\r\n    '& .picker-paper': {\r\n      padding: '16px',\r\n      maxWidth: '360px',\r\n      borderRadius: '12px',\r\n      boxShadow: bookitShadows.shadowXL,\r\n      // background: bookitColors.grayscale.grayBackground,\r\n      '& .picker-header': {\r\n        // minHeight: '20px',\r\n        '& .picker-header-title': {},\r\n      },\r\n      '& .picker-content': {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'center',\r\n        gap: '8px',\r\n        '& .picker-content-date': {\r\n          height: '56px',\r\n          width: '100%',\r\n          // padding: '12px',\r\n        },\r\n        '& .picker-buttons': {\r\n          display: 'flex',\r\n          flexDirection: 'row',\r\n          alignItems: 'center',\r\n          alignSelf: 'flex-start',\r\n          gap: '16px',\r\n          // paddingTop: '16px',\r\n        },\r\n      },\r\n    },\r\n  },\r\n});\r\n\r\n// `\r\n//   z-index: ${props => props.theme.zIndex.modal};\r\n//   height: 100vh;\r\n//   border-left: 1px solid ${bookitColors.grayscale.grayBorders};\r\n//   &.rootopen {\r\n//     width: 100%;\r\n//     transform: unset;\r\n//     &.mobileroot {\r\n//       padding-top: 0px;\r\n//     }\r\n//   }\r\n//   &.rootclose {\r\n//     width: 100vw;\r\n//     &.mobileroot {\r\n//       inset-block: 50px auto;\r\n//       height: calc(100% - 50px);\r\n//       padding-top: 0px;\r\n//     }\r\n//   }\r\n//   @media (max-width: ${props => props.theme.breakpoints.values.md}px) {\r\n//     &.rootclose {\r\n//       width: 100%;\r\n//       min-width: 600px;\r\n//     }\r\n//   }\r\n//   @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n//     &.rootclose {\r\n//       width: 100%;\r\n//       min-width: 370px;\r\n//     }\r\n//   }\r\n//   @media (min-width: ${props => props.theme.breakpoints.values.md}px) {\r\n//     &.rootclose {\r\n//       width: ${props => props.sidePanelWidth}px;\r\n//     }\r\n//   }\r\n//   & .paper {\r\n//     background: ${props => props.theme.palette.common.background};\r\n//     border-radius: 0;\r\n//     max-height: 100vh;\r\n//     height: auto;\r\n//     margin: 0;\r\n//     box-shadow: unset;\r\n//   }\r\n//   @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n//     & .paper {\r\n//       max-width: 100%;\r\n//     }\r\n//   }\r\n// `;\r\n","/**\r\n *\r\n * DaysByMonthPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface DaysByMonthPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {\r\n  month?: number | null;\r\n  date?: Date | string | null;\r\n}\r\nexport const daysEntityArray = Array.from({ length: 31 }, (_, i) => {\r\n  const x = i + 1;\r\n  return {\r\n    Id: x,\r\n    Name: x.toString(),\r\n  } as Entity<number>;\r\n});\r\n\r\nexport const defaultDayValue =\r\n  daysEntityArray.find(f => f.Id === dateUtils.getDate(new Date())) ??\r\n  ({\r\n    Id: dateUtils.getDate(new Date()),\r\n    Name: dateUtils.getDate(new Date()).toString(),\r\n  } as Entity<number>);\r\nexport const getDayEntityFromDate = (date?: Date | string | null) => {\r\n  if (date === null || date === undefined) {\r\n    return daysEntityArray[0];\r\n  } else {\r\n    let toDate = dateUtils.dateOrStringToDate(date);\r\n    return (\r\n      daysEntityArray.find(f => f.Id === toDate.getDate()) ?? daysEntityArray[0]\r\n    );\r\n  }\r\n};\r\n\r\nexport const initDaysData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        daysEntityArray.filter(item => {\r\n          return item.Id.toString() === initval.toString();\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nexport function DaysByMonthPicker(props: DaysByMonthPickerProps) {\r\n  const getOptions = React.useMemo(() => {\r\n    let maxDay = 31;\r\n    if (props.month !== null && props.month !== undefined) {\r\n      let monthDate = dateUtils.setMonth(new Date(), props.month);\r\n      maxDay = dateUtils.lastDayOfMonth(monthDate).getDate();\r\n    } else if (props.date !== null && props.date !== undefined) {\r\n      let monthDate = dateUtils.dateOrStringToDate(props.date);\r\n      maxDay = dateUtils.lastDayOfMonth(monthDate).getDate();\r\n    }\r\n    let items = daysEntityArray.filter(f => f.Id <= maxDay);\r\n    return GetOptionsFilterFunction(items);\r\n  }, [props.date, props.month]);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'daysByMonthId'}\r\n      value={props.value}\r\n      autoHighlight={true}\r\n      autoSelect={true}\r\n      selectOnFocus={true}\r\n      clearOnEscape\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * MonthOfYearPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface MonthEntity extends Entity<number> {\r\n  FullName: string;\r\n  MonthId: number;\r\n}\r\nexport interface MonthOfYearPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {\r\n  date?: Date | string | null;\r\n}\r\nexport const monthEntityArray = Array.from({ length: 12 }, (_, i) => {\r\n  const x = i;\r\n  return {\r\n    Id: x,\r\n    Name: dateUtils.format(\r\n      dateUtils.setMonth(new Date(), x),\r\n      dateUtils.DateIOFormats.monthShort,\r\n    ),\r\n    FullName: dateUtils.format(\r\n      dateUtils.setMonth(new Date(), x),\r\n      dateUtils.DateIOFormats.month,\r\n    ),\r\n    MonthId: x + 1,\r\n  } as Entity<number>;\r\n});\r\n\r\nexport const defaultMonthValue =\r\n  monthEntityArray.find(f => f.Id === dateUtils.getMonth(new Date())) ??\r\n  ({\r\n    Id: dateUtils.getMonth(new Date()),\r\n    Name: dateUtils.format(new Date(), dateUtils.DateIOFormats.monthShort),\r\n    FullName: dateUtils.format(new Date(), dateUtils.DateIOFormats.month),\r\n    MonthId: dateUtils.getMonth(new Date()) + 1,\r\n  } as Entity<number>);\r\nexport const getMonthEntityFromDate = (date?: Date | string | null) => {\r\n  if (date === null || date === undefined) {\r\n    return defaultMonthValue;\r\n  } else {\r\n    let toDate = dateUtils.dateOrStringToDate(date);\r\n    return (\r\n      monthEntityArray.find(f => f.Id === toDate.getMonth()) ??\r\n      defaultMonthValue\r\n    );\r\n  }\r\n};\r\nexport const initMonthData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        monthEntityArray.filter(item => {\r\n          return item.Id.toString() === initval.toString();\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nexport function MonthOfYearPicker(props: MonthOfYearPickerProps) {\r\n  const getOptions = React.useMemo(() => {\r\n    let items = monthEntityArray;\r\n\r\n    return GetOptionsFilterFunction(items, (f, search) =>\r\n      (f as MonthEntity).MonthId.toString()\r\n        .toLowerCase()\r\n        .startsWith(search.toLowerCase()),\r\n    );\r\n  }, []);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'monthId'}\r\n      value={props.value}\r\n      filterSelectedOptions={false}\r\n      autoHighlight={true}\r\n      autoSelect={true}\r\n      selectOnFocus={true}\r\n      clearOnEscape\r\n      includeInputInList\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * YearsPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface YearsPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {\r\n  date?: Date | string | null;\r\n}\r\nexport const MIN_YEAR: number = 2001;\r\nexport const MAX_YEAR: number = dateUtils.getYear(\r\n  dateUtils.addYears(new Date(), 10),\r\n);\r\nexport const yearsEntityArray = Array.from(\r\n  { length: MAX_YEAR - MIN_YEAR },\r\n  (_, i) => {\r\n    const x = MIN_YEAR + i;\r\n    return {\r\n      Id: x,\r\n      Name: x.toString(),\r\n    } as Entity<number>;\r\n  },\r\n);\r\n\r\nexport const initYearsData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        yearsEntityArray.filter(item => {\r\n          return item.Id.toString() === initval.toString();\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\nexport const defaultYearValue =\r\n  yearsEntityArray.find(f => f.Id === dateUtils.getYear(new Date())) ??\r\n  ({\r\n    Id: dateUtils.getYear(new Date()),\r\n    Name: dateUtils.getYear(new Date()).toString(),\r\n  } as Entity<number>);\r\nexport const getYearEntityFromDate = (date?: Date | string | null) => {\r\n  if (date === null || date === undefined) {\r\n    return defaultYearValue;\r\n  } else {\r\n    let toDate = dateUtils.dateOrStringToDate(date);\r\n    return (\r\n      yearsEntityArray.find(f => f.Id === dateUtils.getYear(toDate)) ??\r\n      defaultYearValue\r\n    );\r\n  }\r\n};\r\nexport function YearsPicker(props: YearsPickerProps) {\r\n  const getOptions = React.useMemo(() => {\r\n    let items = yearsEntityArray;\r\n    return GetOptionsFilterFunction(items);\r\n  }, []);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'yearsId'}\r\n      value={props.value}\r\n      autoHighlight={true}\r\n      autoSelect={true}\r\n      selectOnFocus={true}\r\n      clearOnEscape\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { BaseTextFieldProps, capitalize } from '@material-ui/core';\r\nimport { BaseDatePickerProps, useUtils } from '@material-ui/pickers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport FormHelperText from 'app/components/Forms/FormControls/FormHelperText';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport {\r\n  DaysByMonthPicker,\r\n  defaultDayValue,\r\n  getDayEntityFromDate,\r\n} from 'app/components/pickers/StaticOptionsPickers/DaysByMonthPicker';\r\nimport {\r\n  defaultMonthValue,\r\n  getMonthEntityFromDate,\r\n  MonthOfYearPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/MonthOfYearPicker';\r\nimport {\r\n  defaultYearValue,\r\n  getYearEntityFromDate,\r\n  YearsPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/YearsPicker';\r\nimport * as React from 'react';\r\n\r\nimport clsx from 'clsx';\r\nimport { Entity } from 'types/common';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { DateValidationProps } from '@material-ui/pickers/_helpers/text-field-helper';\r\nimport { validateDate } from 'app/components/DatePicker/utils/pickerDateValidate';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\n\r\nexport interface DateDropDownValidationProps\r\n  extends DateValidationProps,\r\n    Pick<\r\n      BaseDatePickerProps,\r\n      | 'minDate'\r\n      | 'maxDate'\r\n      | 'disablePast'\r\n      | 'disableFuture'\r\n      | 'strictCompareDates'\r\n    > {}\r\nexport interface DateDropDownProps\r\n  extends DateDropDownValidationProps,\r\n    Pick<\r\n      BaseTextFieldProps,\r\n      | 'fullWidth'\r\n      | 'helperText'\r\n      | 'required'\r\n      | 'disabled'\r\n      | 'name'\r\n      | 'id'\r\n      | 'label'\r\n      | 'error'\r\n      | 'size'\r\n    > {\r\n  value?: Date | string | null;\r\n  onChange: (\r\n    date: MaterialUiPickersDate | null,\r\n    withCompletion?: boolean,\r\n  ) => void;\r\n  inputVariant?: 'filled' | 'standard' | 'outlined';\r\n  info?: string;\r\n  className?: string;\r\n  dayDisabled?: boolean;\r\n  monthDisabled?: boolean;\r\n  yearDisabled?: boolean;\r\n  onError?: (\r\n    error: React.ReactNode,\r\n    value: MaterialUiPickersDate | ParsableDate,\r\n  ) => void;\r\n}\r\n\r\nexport function DateDropDown(props: DateDropDownProps) {\r\n  const {\r\n    value,\r\n    onChange,\r\n    inputVariant,\r\n    id,\r\n    name,\r\n    fullWidth,\r\n    helperText,\r\n    disabled,\r\n    label,\r\n    error,\r\n    size,\r\n    dayDisabled,\r\n    monthDisabled,\r\n    yearDisabled,\r\n    onError,\r\n  } = props;\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  const utils = useUtils();\r\n  const inputLabelId = label && id ? `${id}-label` : undefined;\r\n  const helperTextId = id ? `${id}-helper-text` : undefined;\r\n  const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n  const dateTimeValue = React.useMemo(() => {\r\n    return value;\r\n  }, [value]);\r\n  const [dateSelected, setDateSelected] = React.useState<\r\n    Date | string | null | undefined\r\n  >(value);\r\n  const [daySelected, setDaySelected] = React.useState(\r\n    getDayEntityFromDate(dateTimeValue),\r\n  );\r\n  const [monthSelected, setMonthSelected] = React.useState(\r\n    getMonthEntityFromDate(dateTimeValue),\r\n  );\r\n  const [yearSelected, setYearSelected] = React.useState(\r\n    getYearEntityFromDate(dateTimeValue),\r\n  );\r\n  const [innerError, setInnerError] = React.useState<\r\n    React.ReactNode | undefined\r\n  >(undefined);\r\n  const [isYearOpen, setIsYearOpen] = React.useState<boolean>(false);\r\n  const [isMonthOpen, setIsMonthOpen] = React.useState<boolean>(false);\r\n  const [isDayOpen, setIsDayOpen] = React.useState<boolean>(false);\r\n  const someOpen = React.useMemo(() => {\r\n    return isYearOpen || isMonthOpen || isDayOpen;\r\n  }, [isDayOpen, isMonthOpen, isYearOpen]);\r\n  // const dateStart = React.useMemo(() => {\r\n  //   return utils.dateFormat.toLowerCase().startsWith('m')\r\n  //     ? 'fromMonth'\r\n  //     : utils.dateFormat.toLowerCase().startsWith('d')\r\n  //     ? 'fromDay'\r\n  //     : utils.dateFormat.toLowerCase().startsWith('y')\r\n  //     ? 'fromYear'\r\n  //     : 'fromDay';\r\n  // }, [utils.dateFormat]);\r\n  React.useEffect(() => {\r\n    setDaySelected(() => getDayEntityFromDate(dateTimeValue));\r\n    setMonthSelected(() => getMonthEntityFromDate(dateTimeValue));\r\n    setYearSelected(() => getYearEntityFromDate(dateTimeValue));\r\n  }, [dateTimeValue]);\r\n\r\n  React.useEffect(() => {\r\n    if (dateSelected !== null && dateSelected !== undefined) {\r\n      let error = validateDate(\r\n        daySelected.Id,\r\n        monthSelected.Id,\r\n        yearSelected.Id,\r\n        {\r\n          maxDate: props.maxDate,\r\n          minDate: props.minDate,\r\n          disablePast: props.disablePast,\r\n          disableFuture: props.disableFuture,\r\n          maxDateMessage: props.maxDateMessage,\r\n          minDateMessage: props.minDateMessage,\r\n          invalidDateMessage: props.invalidDateMessage,\r\n          strictCompareDates: props.strictCompareDates,\r\n        },\r\n        utils,\r\n        dateSelected,\r\n      );\r\n      if (!!error) {\r\n        setInnerError(error);\r\n        if (onError) {\r\n          onError(error, dateSelected);\r\n        }\r\n      } else {\r\n        setInnerError('');\r\n        if (onError) {\r\n          onError('', dateSelected);\r\n        }\r\n      }\r\n    } else {\r\n      setInnerError('');\r\n      if (onError) {\r\n        onError('', null);\r\n      }\r\n    }\r\n  }, [\r\n    dateSelected,\r\n    daySelected.Id,\r\n    monthSelected.Id,\r\n    onError,\r\n    props.disableFuture,\r\n    props.disablePast,\r\n    props.invalidDateMessage,\r\n    props.maxDate,\r\n    props.maxDateMessage,\r\n    props.minDate,\r\n    props.minDateMessage,\r\n    props.strictCompareDates,\r\n    utils,\r\n    yearSelected.Id,\r\n  ]);\r\n  const handleChange = React.useCallback(\r\n    (day: number, month: number, year: number, withCompletion?: boolean) => {\r\n      if (dateSelected !== null && dateSelected !== undefined) {\r\n        let date = dateUtils.dateOrStringToDate(dateSelected);\r\n        let finalDate = dateUtils.set(getOffsetDate(date), {\r\n          year: year,\r\n          month: month,\r\n          date: day,\r\n        });\r\n        let hasError = validateDate(\r\n          day,\r\n          month,\r\n          year,\r\n          {\r\n            maxDate: props.maxDate,\r\n            minDate: props.minDate,\r\n            disablePast: props.disablePast,\r\n            disableFuture: props.disableFuture,\r\n            maxDateMessage: props.maxDateMessage,\r\n            minDateMessage: props.minDateMessage,\r\n            invalidDateMessage: props.invalidDateMessage,\r\n            strictCompareDates: props.strictCompareDates,\r\n          },\r\n          utils,\r\n          finalDate,\r\n        );\r\n        if (!hasError) {\r\n          onChange(finalDate, withCompletion);\r\n        }\r\n      } else {\r\n        let finalDate = dateUtils.set(newDate(), {\r\n          year: year,\r\n          month: month,\r\n          date: day,\r\n        });\r\n        setDateSelected(finalDate);\r\n        let hasError = validateDate(\r\n          day,\r\n          month,\r\n          year,\r\n          {\r\n            maxDate: props.maxDate,\r\n            minDate: props.minDate,\r\n            disablePast: props.disablePast,\r\n            disableFuture: props.disableFuture,\r\n            maxDateMessage: props.maxDateMessage,\r\n            minDateMessage: props.minDateMessage,\r\n            invalidDateMessage: props.invalidDateMessage,\r\n            strictCompareDates: props.strictCompareDates,\r\n          },\r\n          utils,\r\n          finalDate,\r\n        );\r\n        if (!hasError) {\r\n          onChange(finalDate, withCompletion);\r\n        }\r\n      }\r\n    },\r\n    [\r\n      dateSelected,\r\n      getOffsetDate,\r\n      newDate,\r\n      onChange,\r\n      props.disableFuture,\r\n      props.disablePast,\r\n      props.invalidDateMessage,\r\n      props.maxDate,\r\n      props.maxDateMessage,\r\n      props.minDate,\r\n      props.minDateMessage,\r\n      props.strictCompareDates,\r\n      utils,\r\n    ],\r\n  );\r\n  const handleDayChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setDaySelected(val);\r\n      handleChange(val.Id, monthSelected.Id, yearSelected.Id);\r\n    },\r\n    [handleChange, monthSelected.Id, yearSelected.Id],\r\n  );\r\n  const handleMonthChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setMonthSelected(val);\r\n      handleChange(daySelected.Id, val.Id, yearSelected.Id);\r\n    },\r\n    [daySelected.Id, handleChange, yearSelected.Id],\r\n  );\r\n  const handleYearChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setYearSelected(val);\r\n      handleChange(daySelected.Id, monthSelected.Id, val.Id);\r\n    },\r\n    [daySelected.Id, handleChange, monthSelected.Id],\r\n  );\r\n  return (\r\n    <React.Fragment>\r\n      <FormControl\r\n        className={clsx('date-dropdown-picker', sizeClass, {\r\n          withLabel: !!label,\r\n        })}\r\n        disabled={disabled}\r\n        error={error || Boolean(innerError)}\r\n        fullWidth={fullWidth}\r\n        required={props.required}\r\n        variant={inputVariant || 'standard'}\r\n        size={'medium'}\r\n        onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n          const target = event.target as any; // as HTMLInputElement;\r\n\r\n          if (event.key === 'Enter') {\r\n            if (!!target && target.nodeName === 'INPUT') {\r\n              if (!someOpen && !innerError) {\r\n                handleChange(\r\n                  daySelected.Id,\r\n                  monthSelected.Id,\r\n                  yearSelected.Id,\r\n                  true,\r\n                );\r\n              }\r\n            }\r\n          }\r\n        }}\r\n      >\r\n        {label && (\r\n          <InputLabel\r\n            htmlFor={id}\r\n            id={inputLabelId}\r\n            className={clsx('date-dropdown-picker', sizeClass)}\r\n            required={props.required}\r\n            error={error || Boolean(innerError)}\r\n            disabled={props.disabled}\r\n          >\r\n            {label}\r\n          </InputLabel>\r\n        )}\r\n        <div className={'date-dropdown-picker-inputs'}>\r\n          <DaysByMonthPicker\r\n            month={monthSelected.Id}\r\n            placeholder={'DD'}\r\n            defaultValue={defaultDayValue}\r\n            value={daySelected}\r\n            onChange={day => handleDayChange(day ?? defaultDayValue)}\r\n            id={`${id ?? 'dayId'}_day`}\r\n            name={`${name ?? 'dayName'}_day`}\r\n            variant={inputVariant ?? 'standard'}\r\n            disabled={disabled || dayDisabled}\r\n            ariaLabel={`${label ?? 'day'} select`}\r\n            error={error}\r\n            size={size || 'small'}\r\n            disableClearable\r\n            autoFocus={true}\r\n            setSomeOpen={setIsDayOpen}\r\n          />\r\n          <MonthOfYearPicker\r\n            defaultValue={defaultMonthValue}\r\n            value={monthSelected}\r\n            placeholder={'MMM'}\r\n            onChange={month => handleMonthChange(month ?? defaultMonthValue)}\r\n            id={`${id ?? 'monthId'}_month`}\r\n            name={`${name ?? 'monthName'}_month`}\r\n            variant={inputVariant ?? 'standard'}\r\n            disabled={disabled || monthDisabled}\r\n            ariaLabel={`${label ?? 'month'} select`}\r\n            error={error}\r\n            size={size || 'small'}\r\n            disableClearable\r\n            setSomeOpen={setIsMonthOpen}\r\n            //autoFocus={dateStart === 'fromMonth'}\r\n          />\r\n          <YearsPicker\r\n            defaultValue={defaultYearValue}\r\n            value={yearSelected}\r\n            placeholder={'YYYY'}\r\n            onChange={year => handleYearChange(year ?? defaultYearValue)}\r\n            id={`${id ?? 'yearId'}_year`}\r\n            name={`${name ?? 'yearName'}_year`}\r\n            variant={inputVariant ?? 'standard'}\r\n            disabled={disabled || yearDisabled}\r\n            ariaLabel={`${label ?? 'year'} select`}\r\n            error={error}\r\n            size={size || 'small'}\r\n            disableClearable\r\n            setSomeOpen={setIsYearOpen}\r\n            //autoFocus={dateStart === 'fromYear'}\r\n          />\r\n        </div>\r\n        {/* <div className={'date-dropdown-picker-inputs'}>\r\n          {dateStart === 'fromYear' ? (\r\n            <React.Fragment>\r\n              <YearsPicker\r\n                defaultValue={defaultYearValue}\r\n                value={yearSelected}\r\n                placeholder={'YYYY'}\r\n                onChange={year => handleYearChange(year ?? defaultYearValue)}\r\n                id={`${id ?? 'yearId'}_year`}\r\n                name={`${name ?? 'yearName'}_year`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || yearDisabled}\r\n                ariaLabel={`${label ?? 'year'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n                autoFocus={true}\r\n              />\r\n              <MonthOfYearPicker\r\n                defaultValue={defaultMonthValue}\r\n                value={monthSelected}\r\n                placeholder={'MMM'}\r\n                onChange={month =>\r\n                  handleMonthChange(month ?? defaultMonthValue)\r\n                }\r\n                id={`${id ?? 'monthId'}_month`}\r\n                name={`${name ?? 'monthName'}_month`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || monthDisabled}\r\n                ariaLabel={`${label ?? 'month'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n              />\r\n              <DaysByMonthPicker\r\n                month={monthSelected.Id}\r\n                placeholder={'DD'}\r\n                defaultValue={defaultDayValue}\r\n                value={daySelected}\r\n                onChange={day => handleDayChange(day ?? defaultDayValue)}\r\n                id={`${id ?? 'dayId'}_day`}\r\n                name={`${name ?? 'dayName'}_day`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || dayDisabled}\r\n                ariaLabel={`${label ?? 'day'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n              />\r\n            </React.Fragment>\r\n          ) : dateStart === 'fromMonth' ? (\r\n            <React.Fragment>\r\n              <MonthOfYearPicker\r\n                defaultValue={defaultMonthValue}\r\n                value={monthSelected}\r\n                placeholder={'MMM'}\r\n                onChange={month =>\r\n                  handleMonthChange(month ?? defaultMonthValue)\r\n                }\r\n                id={`${id ?? 'monthId'}_month`}\r\n                name={`${name ?? 'monthName'}_month`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || monthDisabled}\r\n                ariaLabel={`${label ?? 'month'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n                autoFocus={true}\r\n              />\r\n              <DaysByMonthPicker\r\n                month={monthSelected.Id}\r\n                placeholder={'DD'}\r\n                defaultValue={defaultDayValue}\r\n                value={daySelected}\r\n                onChange={day => handleDayChange(day ?? defaultDayValue)}\r\n                id={`${id ?? 'dayId'}_day`}\r\n                name={`${name ?? 'dayName'}_day`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || dayDisabled}\r\n                ariaLabel={`${label ?? 'day'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n              />\r\n              <YearsPicker\r\n                defaultValue={defaultYearValue}\r\n                value={yearSelected}\r\n                placeholder={'YYYY'}\r\n                onChange={year => handleYearChange(year ?? defaultYearValue)}\r\n                id={`${id ?? 'yearId'}_year`}\r\n                name={`${name ?? 'yearName'}_year`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || yearDisabled}\r\n                ariaLabel={`${label ?? 'year'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n              />\r\n            </React.Fragment>\r\n          ) : (\r\n            <React.Fragment>\r\n              <DaysByMonthPicker\r\n                month={monthSelected.Id}\r\n                placeholder={'DD'}\r\n                defaultValue={defaultDayValue}\r\n                value={daySelected}\r\n                onChange={day => handleDayChange(day ?? defaultDayValue)}\r\n                id={`${id ?? 'dayId'}_day`}\r\n                name={`${name ?? 'dayName'}_day`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || dayDisabled}\r\n                ariaLabel={`${label ?? 'day'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n                autoFocus={true}\r\n              />\r\n              <MonthOfYearPicker\r\n                defaultValue={defaultMonthValue}\r\n                value={monthSelected}\r\n                placeholder={'MMM'}\r\n                onChange={month =>\r\n                  handleMonthChange(month ?? defaultMonthValue)\r\n                }\r\n                id={`${id ?? 'monthId'}_month`}\r\n                name={`${name ?? 'monthName'}_month`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || monthDisabled}\r\n                ariaLabel={`${label ?? 'month'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n              />\r\n              <YearsPicker\r\n                defaultValue={defaultYearValue}\r\n                value={yearSelected}\r\n                placeholder={'YYYY'}\r\n                onChange={year => handleYearChange(year ?? defaultYearValue)}\r\n                id={`${id ?? 'yearId'}_year`}\r\n                name={`${name ?? 'yearName'}_year`}\r\n                variant={inputVariant ?? 'standard'}\r\n                disabled={disabled || yearDisabled}\r\n                ariaLabel={`${label ?? 'year'} select`}\r\n                error={error}\r\n                size={size || 'small'}\r\n                disableClearable\r\n              />\r\n            </React.Fragment>\r\n          )}\r\n        </div> */}\r\n        {(!!helperText || Boolean(innerError)) && (\r\n          <FormHelperText\r\n            id={helperTextId}\r\n            className={clsx('date-dropdown-picker', sizeClass)}\r\n            disabled={disabled}\r\n            error={error || Boolean(innerError)}\r\n            required={props.required}\r\n          >\r\n            {helperText || innerError}\r\n          </FormHelperText>\r\n        )}\r\n      </FormControl>\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * HoursPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface HoursPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {\r\n  useAmPm?: boolean;\r\n}\r\nexport const hoursEntityArray12 = Array.from({ length: 12 }, (_, i) => {\r\n  const x = i + 1;\r\n  return {\r\n    Id: x,\r\n    Name: x.toString(),\r\n  } as Entity<number>;\r\n});\r\nexport const hoursEntityArray24 = Array.from({ length: 24 }, (_, i) => {\r\n  const x = i;\r\n  return {\r\n    Id: x,\r\n    Name: x.toString(),\r\n  } as Entity<number>;\r\n});\r\n\r\nexport const defaultHourValue12 =\r\n  hoursEntityArray12.find(\r\n    f => f.Id === dateUtils.getMeridiemHours(new Date()),\r\n  ) ??\r\n  ({\r\n    Id: dateUtils.getMeridiemHours(new Date()),\r\n    Name: dateUtils.getMeridiemHours(new Date()).toString(),\r\n  } as Entity<number>);\r\nexport const defaultHourValue24 =\r\n  hoursEntityArray24.find(f => f.Id === dateUtils.getHours(new Date())) ??\r\n  ({\r\n    Id: dateUtils.getHours(new Date()),\r\n    Name: dateUtils.getHours(new Date()).toString(),\r\n  } as Entity<number>);\r\nexport const getHoursEntityFromDate = (\r\n  ampm: boolean,\r\n  date?: Date | string | null,\r\n) => {\r\n  if (date === null || date === undefined) {\r\n    return ampm ? defaultHourValue12 : defaultHourValue24;\r\n  } else {\r\n    let toDate = dateUtils.dateOrStringToDate(date);\r\n    return ampm\r\n      ? hoursEntityArray12.find(\r\n          f => f.Id === dateUtils.getMeridiemHours(toDate),\r\n        ) ?? defaultHourValue12\r\n      : hoursEntityArray24.find(f => f.Id === toDate.getHours()) ??\r\n          defaultHourValue24;\r\n  }\r\n};\r\nexport const initHoursData = (\r\n  initval: number | string | undefined,\r\n  ampm?: boolean,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        ampm\r\n          ? hoursEntityArray12.filter(item => {\r\n              return item.Id.toString() === initval.toString();\r\n            })\r\n          : hoursEntityArray24.filter(item => {\r\n              return item.Id.toString() === initval.toString();\r\n            }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nexport function HoursPicker(props: HoursPickerProps) {\r\n  const getOptions = React.useMemo(() => {\r\n    let items = props.useAmPm ? hoursEntityArray12 : hoursEntityArray24;\r\n    return GetOptionsFilterFunction(items);\r\n  }, [props.useAmPm]);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'hoursId'}\r\n      value={props.value}\r\n      autoHighlight={true}\r\n      autoSelect={true}\r\n      selectOnFocus={true}\r\n      clearOnEscape\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * MinutesPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface MinutesPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {\r\n  minutesStep?: number;\r\n}\r\nexport const minutesEntityArray = Array.from({ length: 60 }, (_, i) => {\r\n  const x = i;\r\n  return {\r\n    Id: x,\r\n    Name: x.toString(),\r\n  } as Entity<number>;\r\n});\r\n\r\nexport const defaultMinutes =\r\n  minutesEntityArray.find(f => f.Id === dateUtils.getMinutes(new Date())) ??\r\n  ({\r\n    Id: dateUtils.getMinutes(new Date()),\r\n    Name: dateUtils.getMinutes(new Date()).toString(),\r\n  } as Entity<number>);\r\n\r\nexport const getMinutesEntityFromDate = (\r\n  date?: Date | string | null,\r\n  minutesStep?: number,\r\n) => {\r\n  if (date === null || date === undefined) {\r\n    return defaultMinutes;\r\n  } else {\r\n    let toDate = dateUtils.dateOrStringToDate(date);\r\n    return (\r\n      minutesEntityArray.find(f => f.Id === toDate.getMinutes()) ??\r\n      defaultMinutes\r\n    );\r\n  }\r\n};\r\nexport const initMinutesData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        minutesEntityArray.filter(item => {\r\n          return item.Id.toString() === initval.toString();\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nexport function MinutesPicker(props: MinutesPickerProps) {\r\n  const { minutesStep, mini, size, id, value, ...other } = props;\r\n  const getOptions = React.useMemo(() => {\r\n    let items =\r\n      !!minutesStep && minutesStep > 0 && minutesStep <= 30\r\n        ? minutesEntityArray.filter(f => f.Id % minutesStep === 0)\r\n        : minutesEntityArray;\r\n    return GetOptionsFilterFunction(items);\r\n  }, [minutesStep]);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={mini ? true : undefined}\r\n      size={size}\r\n      getOptions={getOptions}\r\n      id={id || 'hoursId'}\r\n      value={value}\r\n      autoHighlight={true}\r\n      autoSelect={true}\r\n      selectOnFocus={true}\r\n      clearOnEscape\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AmPmPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface AmPmPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<string>>, 'getOptions'> {}\r\nexport const AmPmEntityArray = [\r\n  {\r\n    Id: 'am',\r\n    Name: 'AM',\r\n  },\r\n  {\r\n    Id: 'pm',\r\n    Name: 'PM',\r\n  },\r\n] as Entity<string>[];\r\n\r\nexport const defaultAmPm = AmPmEntityArray[0];\r\n// AmPmEntityArray.find(f => f.Id === dateUtils.getMinutes(new Date())) ??\r\n//   ({\r\n//     Id: dateUtils.getMinutes(new Date()),\r\n//     Name: dateUtils.getMinutes(new Date()).toString(),\r\n//   } as Entity<number>);\r\n\r\nexport const getAmPmEntityFromDate = (date?: Date | string | null) => {\r\n  if (date === null || date === undefined) {\r\n    return AmPmEntityArray[0];\r\n  } else {\r\n    let meridiem = dateUtils.getMeridiem(date);\r\n    return AmPmEntityArray.find(f => f.Id === meridiem) ?? AmPmEntityArray[0];\r\n  }\r\n};\r\nexport const initAmPmData = (\r\n  initval: string | undefined,\r\n): Promise<Entity<string>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve([] as Entity<string>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve(\r\n        AmPmEntityArray.filter(item => {\r\n          return item.Id.toString() === initval.toString();\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nexport function AmPmPicker(props: AmPmPickerProps) {\r\n  const getOptions = React.useMemo(() => {\r\n    let items = AmPmEntityArray;\r\n    return GetOptionsFilterFunction(items);\r\n  }, []);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'ampmId'}\r\n      value={props.value}\r\n      autoHighlight={true}\r\n      autoSelect={true}\r\n      selectOnFocus={true}\r\n      clearOnEscape\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { BaseTextFieldProps, capitalize } from '@material-ui/core';\r\nimport { BaseTimePickerProps, useUtils } from '@material-ui/pickers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport FormHelperText from 'app/components/Forms/FormControls/FormHelperText';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport * as React from 'react';\r\n\r\nimport clsx from 'clsx';\r\nimport { Entity } from 'types/common';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { validateError } from 'app/components/DatePicker/utils/pickerDateValidate';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { DateDropDownValidationProps } from '../DateDropDown';\r\nimport {\r\n  defaultHourValue12,\r\n  defaultHourValue24,\r\n  getHoursEntityFromDate,\r\n  HoursPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/HoursPicker';\r\nimport {\r\n  defaultMinutes,\r\n  getMinutesEntityFromDate,\r\n  MinutesPicker,\r\n} from 'app/components/pickers/StaticOptionsPickers/MinutesPicker';\r\nimport {\r\n  AmPmPicker,\r\n  defaultAmPm,\r\n  getAmPmEntityFromDate,\r\n} from 'app/components/pickers/StaticOptionsPickers/AmPmPicker';\r\n\r\nexport interface TimeDropDownProps\r\n  extends DateDropDownValidationProps,\r\n    BaseTimePickerProps,\r\n    Pick<\r\n      BaseTextFieldProps,\r\n      | 'fullWidth'\r\n      | 'helperText'\r\n      | 'required'\r\n      | 'disabled'\r\n      | 'name'\r\n      | 'id'\r\n      | 'label'\r\n      | 'error'\r\n      | 'size'\r\n    > {\r\n  value?: Date | string | null;\r\n  onChange: (\r\n    date: MaterialUiPickersDate | null,\r\n    withCompletion?: boolean,\r\n  ) => void;\r\n  inputVariant?: 'filled' | 'standard' | 'outlined';\r\n  info?: string;\r\n  className?: string;\r\n  hoursDisabled?: boolean;\r\n  minutesDisabled?: boolean;\r\n  onError?: (\r\n    error: React.ReactNode,\r\n    value: MaterialUiPickersDate | ParsableDate,\r\n  ) => void;\r\n}\r\n\r\nexport function TimeDropDown(props: TimeDropDownProps) {\r\n  const {\r\n    value,\r\n    onChange,\r\n    inputVariant,\r\n    id,\r\n    name,\r\n    fullWidth,\r\n    helperText,\r\n    disabled,\r\n    label,\r\n    error,\r\n    size,\r\n    hoursDisabled,\r\n    minutesDisabled,\r\n    ampm,\r\n    minutesStep,\r\n    onError,\r\n  } = props;\r\n  const { newDate } = useSystemDate();\r\n  const utils = useUtils();\r\n  const inputLabelId = label && id ? `${id}-label` : undefined;\r\n  const helperTextId = id ? `${id}-helper-text` : undefined;\r\n  const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n  const dateTimeValue = React.useMemo(() => {\r\n    return value;\r\n  }, [value]);\r\n  const [dateSelected, setDateSelected] = React.useState<\r\n    Date | string | null | undefined\r\n  >(value);\r\n  const [hoursSelected, setHoursSelected] = React.useState(\r\n    getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n  );\r\n  const [minutesSelected, setMinutesSelected] = React.useState(\r\n    getMinutesEntityFromDate(dateTimeValue),\r\n  );\r\n  const [ampmSelected, setAmpmSelected] = React.useState(\r\n    getAmPmEntityFromDate(dateTimeValue),\r\n  );\r\n  const [isHourOpen, setIsHourOpen] = React.useState<boolean>(false);\r\n  const [isMinuteOpen, setIsMinuteOpen] = React.useState<boolean>(false);\r\n  const [isAmPmOpen, setIsAmPmOpen] = React.useState<boolean>(false);\r\n  const someOpen = React.useMemo(() => {\r\n    return isHourOpen || isMinuteOpen || isAmPmOpen;\r\n  }, [isHourOpen, isMinuteOpen, isAmPmOpen]);\r\n  const [innerError, setInnerError] = React.useState<\r\n    React.ReactNode | undefined\r\n  >(undefined);\r\n\r\n  React.useEffect(() => {\r\n    setHoursSelected(() =>\r\n      getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n    );\r\n    setMinutesSelected(() => getMinutesEntityFromDate(dateTimeValue));\r\n    setAmpmSelected(() => getAmPmEntityFromDate(dateTimeValue));\r\n  }, [ampm, dateTimeValue]);\r\n\r\n  React.useEffect(() => {\r\n    if (dateSelected !== null && dateSelected !== undefined) {\r\n      let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n        hours: hoursSelected.Id,\r\n        minutes: minutesSelected.Id,\r\n      });\r\n      let validateDate = dateUtils.convertToMeridiem(\r\n        time,\r\n        ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n        ampm ?? false,\r\n      );\r\n      let error = validateError(\r\n        validateDate,\r\n        {\r\n          maxDate: props.maxDate,\r\n          minDate: props.minDate,\r\n          disablePast: props.disablePast,\r\n          disableFuture: props.disableFuture,\r\n          maxDateMessage: props.maxDateMessage,\r\n          minDateMessage: props.minDateMessage,\r\n          invalidDateMessage: props.invalidDateMessage,\r\n          strictCompareDates: props.strictCompareDates,\r\n        },\r\n        utils,\r\n      );\r\n      if (!!error) {\r\n        setInnerError(error);\r\n        if (onError) {\r\n          onError(error, validateDate);\r\n        }\r\n      } else {\r\n        setInnerError('');\r\n        if (onError) {\r\n          onError('', validateDate);\r\n        }\r\n      }\r\n    } else {\r\n      setInnerError('');\r\n      if (onError) {\r\n        onError('', null);\r\n      }\r\n    }\r\n  }, [\r\n    ampm,\r\n    ampmSelected.Id,\r\n    dateSelected,\r\n    hoursSelected.Id,\r\n    minutesSelected.Id,\r\n    onError,\r\n    props.disableFuture,\r\n    props.disablePast,\r\n    props.invalidDateMessage,\r\n    props.maxDate,\r\n    props.maxDateMessage,\r\n    props.minDate,\r\n    props.minDateMessage,\r\n    props.strictCompareDates,\r\n    utils,\r\n  ]);\r\n  const handleChange = React.useCallback(\r\n    (\r\n      hour: number,\r\n      minute: number,\r\n      ampmValue: 'am' | 'pm',\r\n      withCompletion?: boolean,\r\n    ) => {\r\n      if (dateSelected !== null && dateSelected !== undefined) {\r\n        let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n          hours: hour,\r\n          minutes: minute,\r\n        });\r\n        let finalDate = dateUtils.convertToMeridiem(\r\n          time,\r\n          ampmValue,\r\n          ampm ?? false,\r\n        );\r\n        let hasError = validateError(\r\n          finalDate,\r\n          {\r\n            maxDate: props.maxDate,\r\n            minDate: props.minDate,\r\n            disablePast: props.disablePast,\r\n            disableFuture: props.disableFuture,\r\n            maxDateMessage: props.maxDateMessage,\r\n            minDateMessage: props.minDateMessage,\r\n            invalidDateMessage: props.invalidDateMessage,\r\n            strictCompareDates: props.strictCompareDates,\r\n          },\r\n          utils,\r\n        );\r\n        if (!hasError || hasError === '') {\r\n          onChange(finalDate, withCompletion);\r\n        }\r\n      } else {\r\n        let time = dateUtils.set(newDate(), { hours: hour, minutes: minute });\r\n        let finalDate = dateUtils.convertToMeridiem(\r\n          time,\r\n          ampmValue,\r\n          ampm ?? false,\r\n        );\r\n        setDateSelected(finalDate);\r\n        let hasError = validateError(\r\n          finalDate,\r\n          {\r\n            maxDate: props.maxDate,\r\n            minDate: props.minDate,\r\n            disablePast: props.disablePast,\r\n            disableFuture: props.disableFuture,\r\n            maxDateMessage: props.maxDateMessage,\r\n            minDateMessage: props.minDateMessage,\r\n            invalidDateMessage: props.invalidDateMessage,\r\n            strictCompareDates: props.strictCompareDates,\r\n          },\r\n          utils,\r\n        );\r\n        if (!hasError || hasError === '') {\r\n          onChange(finalDate, withCompletion);\r\n        }\r\n      }\r\n    },\r\n    [\r\n      ampm,\r\n      dateSelected,\r\n      newDate,\r\n      onChange,\r\n      props.disableFuture,\r\n      props.disablePast,\r\n      props.invalidDateMessage,\r\n      props.maxDate,\r\n      props.maxDateMessage,\r\n      props.minDate,\r\n      props.minDateMessage,\r\n      props.strictCompareDates,\r\n      utils,\r\n    ],\r\n  );\r\n  const handleHoursChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setHoursSelected(val);\r\n      handleChange(\r\n        val.Id,\r\n        minutesSelected.Id,\r\n        ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n      );\r\n    },\r\n    [ampmSelected.Id, handleChange, minutesSelected.Id],\r\n  );\r\n  const handleMinutesChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setMinutesSelected(val);\r\n      handleChange(\r\n        hoursSelected.Id,\r\n        val.Id,\r\n        ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n      );\r\n    },\r\n    [ampmSelected.Id, handleChange, hoursSelected.Id],\r\n  );\r\n  const handleAmPmChange = React.useCallback(\r\n    (val: Entity<string>) => {\r\n      setAmpmSelected(val);\r\n      handleChange(\r\n        hoursSelected.Id,\r\n        minutesSelected.Id,\r\n        val.Id === 'am' ? 'am' : 'pm',\r\n      );\r\n    },\r\n    [handleChange, hoursSelected.Id, minutesSelected.Id],\r\n  );\r\n  return (\r\n    <React.Fragment>\r\n      <FormControl\r\n        className={clsx('date-dropdown-picker', sizeClass, {\r\n          withLabel: !!label,\r\n        })}\r\n        disabled={disabled}\r\n        error={error || Boolean(innerError)}\r\n        fullWidth={fullWidth}\r\n        required={props.required}\r\n        variant={inputVariant || 'standard'}\r\n        size={'medium'}\r\n        onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n          const target = event.target as any; // as HTMLInputElement;\r\n\r\n          if (event.key === 'Enter') {\r\n            if (!!target && target.nodeName === 'INPUT') {\r\n              if (!someOpen && !innerError) {\r\n                handleChange(\r\n                  hoursSelected.Id,\r\n                  minutesSelected.Id,\r\n                  ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n                  true,\r\n                );\r\n              }\r\n            }\r\n          }\r\n        }}\r\n      >\r\n        {label && (\r\n          <InputLabel\r\n            htmlFor={id}\r\n            id={inputLabelId}\r\n            className={clsx('date-dropdown-picker', sizeClass)}\r\n            required={props.required}\r\n            error={error || Boolean(innerError)}\r\n            disabled={props.disabled}\r\n          >\r\n            {label}\r\n          </InputLabel>\r\n        )}\r\n        <div className={'date-dropdown-picker-inputs'}>\r\n          <HoursPicker\r\n            useAmPm={ampm}\r\n            defaultValue={ampm ? defaultHourValue12 : defaultHourValue24}\r\n            value={hoursSelected}\r\n            onChange={hour =>\r\n              handleHoursChange(\r\n                hour ?? (ampm ? defaultHourValue12 : defaultHourValue24),\r\n              )\r\n            }\r\n            id={`${id ?? 'hourId'}_hour`}\r\n            name={`${name ?? 'hourName'}_hour`}\r\n            variant={inputVariant ?? 'standard'}\r\n            disabled={disabled || hoursDisabled}\r\n            ariaLabel={`${label ?? 'hour'} select`}\r\n            error={error}\r\n            size={size || 'small'}\r\n            disableClearable\r\n            autoFocus={true}\r\n            placeholder={'HH'}\r\n            setSomeOpen={setIsHourOpen}\r\n            // disableListWrap\r\n            // disableCloseOnSelect\r\n            // ListboxProps={{\r\n            //   style: { maxHeight: '20vh' },\r\n            // }}\r\n            // isOpen={true}\r\n          />\r\n          <MinutesPicker\r\n            defaultValue={defaultMinutes}\r\n            value={minutesSelected}\r\n            onChange={minute => handleMinutesChange(minute ?? defaultMinutes)}\r\n            id={`${id ?? 'minuteId'}_minute`}\r\n            name={`${name ?? 'minuteName'}_minute`}\r\n            variant={inputVariant ?? 'standard'}\r\n            disabled={disabled || minutesDisabled}\r\n            ariaLabel={`${label ?? 'minute'} select`}\r\n            error={error}\r\n            size={size || 'small'}\r\n            minutesStep={minutesStep}\r\n            disableClearable\r\n            placeholder={'mm'}\r\n            setSomeOpen={setIsMinuteOpen}\r\n            // disableCloseOnSelect\r\n            // ListboxProps={{\r\n            //   style: { maxHeight: '20vh' },\r\n            // }}\r\n            // isOpen={true}\r\n          />\r\n          {ampm && (\r\n            <AmPmPicker\r\n              defaultValue={ampmSelected}\r\n              value={ampmSelected}\r\n              onChange={ampmVal => handleAmPmChange(ampmVal ?? defaultAmPm)}\r\n              id={`${id ?? 'ampmId'}_ampm`}\r\n              name={`${name ?? 'ampmName'}_ampm`}\r\n              variant={inputVariant ?? 'standard'}\r\n              disabled={disabled}\r\n              ariaLabel={`${label ?? 'ampm'} select`}\r\n              error={error}\r\n              size={size || 'small'}\r\n              placeholder={'AM/PM'}\r\n              disableClearable\r\n              setSomeOpen={setIsAmPmOpen}\r\n              // disableCloseOnSelect\r\n              // ListboxProps={{\r\n              //   style: { maxHeight: '20vh' },\r\n              // }}\r\n              // isOpen={true}\r\n            />\r\n          )}\r\n        </div>\r\n        {(!!helperText || Boolean(innerError)) && (\r\n          <FormHelperText\r\n            id={helperTextId}\r\n            className={clsx('date-dropdown-picker', sizeClass)}\r\n            disabled={disabled}\r\n            error={error || Boolean(innerError)}\r\n            required={props.required}\r\n          >\r\n            {helperText || innerError}\r\n          </FormHelperText>\r\n        )}\r\n      </FormControl>\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { useEffect, useLayoutEffect } from 'react';\r\n\r\nconst useIsomorphicLayoutEffect =\r\n  typeof window !== 'undefined' ? useLayoutEffect : useEffect;\r\n\r\nexport default useIsomorphicLayoutEffect;\r\n","import { RefObject, useEffect, useRef } from 'react';\r\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\r\n\r\n// Window Event based useEventListener interface\r\nfunction useEventListener<K extends keyof WindowEventMap>(\r\n  eventName: K,\r\n  handler: (event: WindowEventMap[K]) => void,\r\n  element?: undefined,\r\n  options?: boolean | AddEventListenerOptions,\r\n): void;\r\n\r\n// Element Event based useEventListener interface\r\nfunction useEventListener<\r\n  K extends keyof HTMLElementEventMap,\r\n  T extends HTMLElement = HTMLDivElement\r\n>(\r\n  eventName: K,\r\n  handler: (event: HTMLElementEventMap[K]) => void,\r\n  element: RefObject<T>,\r\n  options?: boolean | AddEventListenerOptions,\r\n): void;\r\n\r\n// Document Event based useEventListener interface\r\nfunction useEventListener<K extends keyof DocumentEventMap>(\r\n  eventName: K,\r\n  handler: (event: DocumentEventMap[K]) => void,\r\n  element: RefObject<Document>,\r\n  options?: boolean | AddEventListenerOptions,\r\n): void;\r\n\r\nfunction useEventListener<\r\n  KW extends keyof WindowEventMap,\r\n  KH extends keyof HTMLElementEventMap,\r\n  T extends HTMLElement | void = void\r\n>(\r\n  eventName: KW | KH,\r\n  handler: (\r\n    event: WindowEventMap[KW] | HTMLElementEventMap[KH] | Event,\r\n  ) => void,\r\n  element?: RefObject<T>,\r\n  options?: boolean | AddEventListenerOptions,\r\n) {\r\n  // Create a ref that stores handler\r\n  const savedHandler = useRef(handler);\r\n\r\n  useIsomorphicLayoutEffect(() => {\r\n    savedHandler.current = handler;\r\n  }, [handler]);\r\n\r\n  useEffect(() => {\r\n    // Define the listening target\r\n    const targetElement: T | Window = element?.current || window;\r\n    if (!(targetElement && targetElement.addEventListener)) {\r\n      return;\r\n    }\r\n\r\n    // Create event listener that calls handler function stored in ref\r\n    const eventListener: typeof handler = event => savedHandler.current(event);\r\n\r\n    targetElement.addEventListener(eventName, eventListener, options);\r\n\r\n    // Remove event listener on cleanup\r\n    return () => {\r\n      targetElement.removeEventListener(eventName, eventListener);\r\n    };\r\n  }, [eventName, element, options]);\r\n}\r\n\r\nexport default useEventListener;\r\n","/* @flow */\r\n\r\nimport useIsomorphicLayoutEffect from 'app/hooks/useIsomorphicLayoutEffect';\r\nimport * as React from 'react';\r\nimport {\r\n  DateStartWith,\r\n  DateTimeMask,\r\n  formatingDate,\r\n  formatingTime,\r\n  getMaskedDateValue,\r\n  getMaskedTimeValue,\r\n} from './types';\r\n\r\nexport interface DateChangeProps {\r\n  value: string;\r\n  onChange: (text: string) => void;\r\n  onSelectionChange: () => boolean;\r\n  variant: 'date' | 'time';\r\n  maskFormats: DateTimeMask;\r\n  inputMask: string;\r\n  ampm?: boolean;\r\n  // format: (str: string) => string;\r\n  mask?: boolean;\r\n  maskIfEmpty?: boolean;\r\n  // replace?: string => string,\r\n  // append?: string => string,\r\n  // accept?: RegExp,\r\n  selectionChanged?: boolean;\r\n}\r\n\r\ntype RenderProps = {\r\n  value: string;\r\n  onChange: (\r\n    evt: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\r\n    increment?: 'increase' | 'decrease',\r\n  ) => void;\r\n};\r\n\r\nexport type ResolverProps = {\r\n  props: DateChangeProps;\r\n  children: (props: RenderProps) => React.ReactNode;\r\n};\r\n\r\nexport const useDateTimeChange = (props: DateChangeProps): RenderProps => {\r\n  const [, refresh] = React.useReducer(c => c + 1, 0);\r\n  const valueRef = React.useRef<any | null>(null);\r\n\r\n  const dateTimeMask = props.maskFormats;\r\n  const dateStartOf: DateStartWith = React.useMemo(() => {\r\n    return dateTimeMask.dateStartFrom;\r\n  }, [dateTimeMask.dateStartFrom]);\r\n  // const { replace, append } = props;\r\n  // const { variant } = props;\r\n  // const userValue = replace\r\n  //   ? replace(props.format(props.value))\r\n  //   : props.format(props.value);\r\n  const userValue = props.value;\r\n  // state of delete button see comments below about inputType support\r\n  const isDeleleteButtonDownRef = React.useRef(false);\r\n  const wasZeroBefore = React.useRef(false);\r\n  const selectionStateChanged = React.useRef(false);\r\n  const onChange = (\r\n    evt: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\r\n    increment?: 'increase' | 'decrease',\r\n  ) => {\r\n    if (process.env.NODE_ENV !== 'production') {\r\n      if (evt.target.type === 'number') {\r\n        console.error(\r\n          'Rifm does not support input type=number, use type=tel instead.',\r\n        );\r\n        return;\r\n      }\r\n      if (evt.target.type === 'date') {\r\n        console.error('Rifm does not support input type=date.');\r\n        return;\r\n      }\r\n    }\r\n\r\n    const eventValue = evt.target.value;\r\n    const target = evt.target as HTMLInputElement;\r\n    const oneLetterHour =\r\n      props.variant === 'time' &&\r\n      props.ampm &&\r\n      dateTimeMask.hour.length === 1 &&\r\n      (eventValue === '' || eventValue.split(':')[0].length === 1);\r\n    const hasSingleChar =\r\n      eventValue.length === 1 && (target.selectionStart ?? 0) <= 1;\r\n    const maskedValue = hasSingleChar\r\n      ? props.variant === 'time'\r\n        ? getMaskedTimeValue(props.maskFormats, props.ampm, eventValue)\r\n        : getMaskedDateValue(props.maskFormats, eventValue)\r\n      : undefined;\r\n    selectionStateChanged.current = props.onSelectionChange();\r\n    valueRef.current = [\r\n      hasSingleChar ? maskedValue : eventValue, // eventValue\r\n      target, // input\r\n      // eventValue.length > userValue.length, // isSizeIncreaseOperation\r\n      // eventValue.length < userValue.length, // isSizeDecraseOperation\r\n      increment, //'increase' | 'decrease' by keyboard\r\n      props.variant === 'time' &&\r\n        (target.selectionStart ?? 0) <= (oneLetterHour ? 1 : 2), //isHourChanged\r\n      props.variant === 'time' &&\r\n        (target.selectionStart ?? 0) > (oneLetterHour ? 1 : 2) &&\r\n        (target.selectionEnd ?? 0) <= (oneLetterHour ? 4 : 5), //isMinutesChanged\r\n      props.variant === 'time' &&\r\n        props.ampm &&\r\n        (target.selectionStart ?? 0) >= 5, //isAmPmChanged\r\n      dateStartOf === 'day'\r\n        ? (target.selectionStart ?? 0) <= 2\r\n        : dateStartOf === 'month'\r\n        ? (target.selectionStart ?? 0) > 2 && (target.selectionEnd ?? 0) <= 5\r\n        : (target.selectionStart ?? 0) >= 8, //isDayChanged\r\n      dateStartOf === 'day'\r\n        ? (target.selectionStart ?? 0) > 2 && (target.selectionEnd ?? 0) <= 5\r\n        : dateStartOf === 'month'\r\n        ? (target.selectionStart ?? 0) <= 2\r\n        : (target.selectionStart ?? 0) > 4 && (target.selectionEnd ?? 0) < 7, //isMonthChanged\r\n\r\n      dateStartOf === 'day' || dateStartOf === 'month'\r\n        ? (target.selectionStart ?? 0) > 5\r\n        : (target.selectionStart ?? 0) <= 4, //isYearChanged\r\n      isDeleleteButtonDownRef.current, // isDeleleteButtonDown\r\n      props.variant === 'time' ? false : userValue === eventValue, // isNoOperation\r\n      selectionStateChanged.current,\r\n    ];\r\n    // if (process.env.NODE_ENV !== 'production') {\r\n    //   const formattedEventValue = props.format(eventValue);\r\n    //   if (\r\n    //     eventValue !== formattedEventValue &&\r\n    //     eventValue.toLowerCase() === formattedEventValue.toLowerCase()\r\n    //   ) {\r\n    //     console.warn(\r\n    //       'Case enforcement does not work with format. Please use replace={value => value.toLowerCase()} instead',\r\n    //     );\r\n    //   }\r\n    // }\r\n\r\n    // The main trick is to update underlying input with non formatted value (= eventValue)\r\n    // that allows us to calculate right cursor position after formatting (see getCursorPosition)\r\n    // then we format new value and call props.onChange with masked/formatted value\r\n    // and finally we are able to set cursor position into right place\r\n    refresh();\r\n  };\r\n  // React prints warn on server in non production mode about useLayoutEffect usage\r\n  // in both cases it's noop\r\n  useIsomorphicLayoutEffect(() => {\r\n    if (valueRef.current == null) return;\r\n\r\n    let [\r\n      eventValue,\r\n      input,\r\n      increment,\r\n      isHourChanged,\r\n      isMinutesChanged,\r\n      isAmPmChanged,\r\n      isDayChanged,\r\n      isMonthChanged,\r\n      isYearChanged,\r\n      isDeleleteButtonDown,\r\n      // No operation means that value itself hasn't been changed, BTW cursor, selection etc can be changed\r\n      isNoOperation,\r\n      selectionChanged,\r\n    ] = valueRef.current;\r\n    valueRef.current = null;\r\n    let formattedValue = eventValue;\r\n    let moveSelectionForward = true;\r\n    if (eventValue === '' || eventValue === undefined) {\r\n      formattedValue = props.maskIfEmpty\r\n        ? props.variant === 'time'\r\n          ? getMaskedTimeValue(dateTimeMask, props.ampm)\r\n          : getMaskedDateValue(dateTimeMask)\r\n        : '';\r\n    } else {\r\n      if (!isNoOperation) {\r\n        if (props.variant === 'time') {\r\n          if (isHourChanged || isMinutesChanged || isAmPmChanged) {\r\n            let finalTime = formatingTime(\r\n              eventValue,\r\n              isHourChanged ? 'hour' : isMinutesChanged ? 'minute' : 'meridiem',\r\n              dateTimeMask,\r\n              userValue,\r\n              increment,\r\n              props.ampm,\r\n            );\r\n            formattedValue = finalTime.value;\r\n            moveSelectionForward = !finalTime.stayOnSelection;\r\n          }\r\n        } else {\r\n          if (isDayChanged || isMonthChanged || isYearChanged) {\r\n            let finalValue = formatingDate(\r\n              eventValue,\r\n              isDayChanged ? 'day' : isMonthChanged ? 'month' : 'year',\r\n              dateTimeMask,\r\n              userValue,\r\n              increment,\r\n              wasZeroBefore.current,\r\n              selectionChanged,\r\n            );\r\n            formattedValue = finalValue.value;\r\n            moveSelectionForward = !finalValue.stayOnSelection;\r\n            wasZeroBefore.current = finalValue.zeroPress;\r\n          }\r\n        }\r\n      }\r\n    }\r\n    if (isDeleleteButtonDown) {\r\n    }\r\n    if (userValue === formattedValue || isNoOperation) {\r\n      // if nothing changed for formatted value, just refresh so userValue will be used at render\r\n      refresh();\r\n    } else {\r\n      props.onChange(formattedValue);\r\n    }\r\n    // const replacedValue = replace ? replace(formattedValue) : formattedValue;\r\n    // const replacedValue = formattedValue;\r\n    // if (userValue === formattedValue || isNoOperation) {\r\n    //   // if nothing changed for formatted value, just refresh so userValue will be used at render\r\n    //   refresh();\r\n    // } else {\r\n    //   props.onChange(formattedValue);\r\n    // }\r\n\r\n    return () => {\r\n      if (\r\n        (eventValue === '' || eventValue === undefined) &&\r\n        props.maskIfEmpty\r\n      ) {\r\n        if (props.variant === 'time') {\r\n          if (props.ampm) {\r\n            let oneLetterHour = dateTimeMask.hour.length === 1;\r\n            input.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n          } else {\r\n            input.setSelectionRange(0, 2);\r\n          }\r\n        } else {\r\n          if (dateStartOf === 'year') {\r\n            input.setSelectionRange(0, 4);\r\n          } else {\r\n            input.setSelectionRange(0, 2);\r\n          }\r\n        }\r\n      } else {\r\n        if (props.variant === 'time') {\r\n          let oneLetterHour =\r\n            props.ampm &&\r\n            dateTimeMask.hour.length === 1 &&\r\n            formattedValue.split(':')[0].length === 1;\r\n          if (isHourChanged) {\r\n            if (moveSelectionForward) {\r\n              input.setSelectionRange(\r\n                oneLetterHour ? 2 : 3,\r\n                oneLetterHour ? 4 : 5,\r\n              );\r\n            } else {\r\n              input.setSelectionRange(0, oneLetterHour ? 1 : 2);\r\n            }\r\n          }\r\n          if (isMinutesChanged) {\r\n            if (props.ampm) {\r\n              if (moveSelectionForward) {\r\n                input.setSelectionRange(\r\n                  oneLetterHour ? 5 : 6,\r\n                  oneLetterHour ? 7 : 8,\r\n                );\r\n              } else {\r\n                input.setSelectionRange(\r\n                  oneLetterHour ? 2 : 3,\r\n                  oneLetterHour ? 4 : 5,\r\n                );\r\n              }\r\n            } else {\r\n              input.setSelectionRange(3, 5);\r\n            }\r\n          }\r\n          if (isAmPmChanged) {\r\n            input.setSelectionRange(\r\n              oneLetterHour ? 5 : 6,\r\n              oneLetterHour ? 7 : 8,\r\n            );\r\n          }\r\n        } else {\r\n          if (isDayChanged) {\r\n            if (moveSelectionForward) {\r\n              if (dateStartOf === 'year') {\r\n                input.setSelectionRange(8, 10);\r\n              } else if (dateStartOf === 'month') {\r\n                input.setSelectionRange(6, 10);\r\n              } else {\r\n                input.setSelectionRange(3, 5);\r\n              }\r\n            } else {\r\n              if (dateStartOf === 'year') {\r\n                input.setSelectionRange(8, 10);\r\n              } else if (dateStartOf === 'month') {\r\n                input.setSelectionRange(3, 5);\r\n              } else {\r\n                input.setSelectionRange(0, 2);\r\n              }\r\n            }\r\n          }\r\n          if (isMonthChanged) {\r\n            if (moveSelectionForward) {\r\n              if (dateStartOf === 'year') {\r\n                input.setSelectionRange(8, 10);\r\n              } else if (dateStartOf === 'month') {\r\n                input.setSelectionRange(3, 5);\r\n              } else {\r\n                input.setSelectionRange(6, 10);\r\n              }\r\n            } else {\r\n              if (dateStartOf === 'year') {\r\n                input.setSelectionRange(3, 5);\r\n              } else if (dateStartOf === 'month') {\r\n                input.setSelectionRange(0, 2);\r\n              } else {\r\n                input.setSelectionRange(3, 5);\r\n              }\r\n            }\r\n          }\r\n          if (isYearChanged) {\r\n            if (moveSelectionForward) {\r\n              if (dateStartOf === 'year') {\r\n                input.setSelectionRange(5, 7);\r\n              } else if (dateStartOf === 'month') {\r\n                input.setSelectionRange(6, 10);\r\n              } else {\r\n                input.setSelectionRange(6, 10);\r\n              }\r\n            } else {\r\n              if (dateStartOf === 'year') {\r\n                input.setSelectionRange(0, 4);\r\n              } else if (dateStartOf === 'month') {\r\n                input.setSelectionRange(6, 10);\r\n              } else {\r\n                input.setSelectionRange(6, 10);\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n      selectionStateChanged.current = false;\r\n      //   let start = getCursorPosition(formattedValue);\r\n      //   // Visually improves working with masked values,\r\n      //   // like cursor jumping over refused symbols\r\n      //   // as an example date mask: was \"5|1-24-3\" then user pressed \"6\"\r\n      //   // it becomes \"56-|12-43\" with this code, and \"56|-12-43\" without\r\n      //   if (\r\n      //     props.mask != null &&\r\n      //     (isSizeIncreaseOperation ||\r\n      //       isSizeDecraseOperation ||\r\n      //       (isDeleleteButtonDown && !deleteWasNoOp))\r\n      //   ) {\r\n      //     while (formattedValue[start] && clean(formattedValue[start]) === '') {\r\n      //       start += 1;\r\n      //     }\r\n      //   }\r\n      //   input.selectionStart = input.selectionEnd =\r\n      //     start + (deleteWasNoOp ? 1 + charsToSkipAfterDelete : 0);\r\n    };\r\n  });\r\n\r\n  React.useEffect(() => {\r\n    // until https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType will be supported\r\n    // by all major browsers (now supported by: +chrome, +safari, ?edge, !firefox)\r\n    // there is no way I found to distinguish in onChange\r\n    // backspace or delete was called in some situations\r\n    // firefox track https://bugzilla.mozilla.org/show_bug.cgi?id=1447239\r\n    const handleKeyDown = (evt: KeyboardEvent) => {\r\n      if (evt.code === 'Delete') {\r\n        isDeleleteButtonDownRef.current = true;\r\n      }\r\n    };\r\n\r\n    const handleKeyUp = (evt: KeyboardEvent) => {\r\n      if (evt.code === 'Delete') {\r\n        isDeleleteButtonDownRef.current = false;\r\n      }\r\n    };\r\n\r\n    document.addEventListener('keydown', handleKeyDown);\r\n    document.addEventListener('keyup', handleKeyUp);\r\n\r\n    return () => {\r\n      document.removeEventListener('keydown', handleKeyDown);\r\n      document.removeEventListener('keyup', handleKeyUp);\r\n    };\r\n  }, []);\r\n\r\n  return {\r\n    value: valueRef.current != null ? valueRef.current[0] : userValue,\r\n    onChange,\r\n  };\r\n};\r\n\r\nexport const DateTimeResolver = (props: ResolverProps) => {\r\n  const renderProps = useDateTimeChange(props.props);\r\n\r\n  return props.children(renderProps);\r\n};\r\n","import {\r\n  BaseTextFieldProps,\r\n  InputAdornment,\r\n  InputAdornmentProps,\r\n  TextFieldProps,\r\n} from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport React from 'react';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport {\r\n  dateArrowSelection,\r\n  DatePopupVariants,\r\n  dateSelection,\r\n  DateTimeMask,\r\n  defaultDateTimeMask,\r\n  getMaskedDateValue,\r\n  getMaskedTimeValue,\r\n  timeSelection,\r\n} from '../utils/types';\r\nimport { useDateTimeChange } from '../utils/useDateTimeChange';\r\n\r\nexport interface KeyboardRifmInputProps\r\n  extends Pick<\r\n    BaseTextFieldProps,\r\n    | 'autoFocus'\r\n    | 'fullWidth'\r\n    | 'helperText'\r\n    | 'placeholder'\r\n    | 'required'\r\n    | 'disabled'\r\n    | 'name'\r\n    | 'id'\r\n    | 'label'\r\n    | 'margin'\r\n    | 'error'\r\n    | 'size'\r\n  > {\r\n  format: string;\r\n  onChange: (value: string | null, withCompletion?: boolean) => void;\r\n  openPicker: () => void;\r\n  validationError?: React.ReactNode;\r\n  inputValue: string;\r\n  inputProps?: TextFieldProps['inputProps'];\r\n  InputProps?: TextFieldProps['InputProps'];\r\n  onBlur?: TextFieldProps['onBlur'];\r\n  onFocus?: TextFieldProps['onFocus'];\r\n  InputAdornmentProps?: Partial<InputAdornmentProps>;\r\n  /** Override input component */\r\n  TextFieldComponent?: React.ComponentType<TextFieldProps>;\r\n  /** Icon displaying for open picker button */\r\n  keyboardIcon?: React.ReactNode;\r\n  /** Pass material-ui text field variant down, bypass internal variant prop */\r\n  inputVariant?: TextFieldProps['variant'];\r\n  info?: string;\r\n  ariaLabel?: string;\r\n  startIcon?: React.ReactNode;\r\n  endIcon?: React.ReactNode;\r\n  togglePicker: () => void;\r\n  variant: Omit<DatePopupVariants, 'separate'>;\r\n  ampm?: boolean;\r\n  isPickerOpen?: boolean;\r\n  maskIfEmpty?: boolean;\r\n  clearable?: boolean;\r\n}\r\n\r\nexport function KeyboardRifmInput({\r\n  inputValue,\r\n  openPicker,\r\n  InputProps,\r\n  TextFieldComponent,\r\n  inputProps,\r\n  inputVariant,\r\n  togglePicker,\r\n  info,\r\n  ariaLabel,\r\n  startIcon,\r\n  endIcon,\r\n  variant,\r\n  format,\r\n  ampm,\r\n  onChange,\r\n  isPickerOpen,\r\n  maskIfEmpty,\r\n  // refuse = /[^\\d]+/gi, //props.ampm ? /[^\\dap]+/gi : /[^\\d]+/gi\r\n  // maskChar = '_',\r\n  ...props\r\n}: KeyboardRifmInputProps) {\r\n  const TextComponent = !!TextFieldComponent\r\n    ? TextFieldComponent\r\n    : BaseTextField;\r\n\r\n  // const keyDownRef = React.useRef({\r\n  //   selectionStart: 0,\r\n  //   selectionEnd: 0,\r\n  // });\r\n  // used to show mask for each part of the Date - e.g. MM, DD, YYYY\r\n  const dateTimeMask: DateTimeMask = React.useMemo(() => {\r\n    return defaultDateTimeMask(format, variant === 'time' ? 'time' : 'date');\r\n  }, [format, variant]);\r\n\r\n  // //indicator of start date based on dateUtils dateFrmat definition per local time zone - is date is start form day/month/year;\r\n  // const dateStartWith = React.useMemo(() => {\r\n  //   return dateStartFrom ?? dateStart;\r\n  // }, [dateStartFrom]);\r\n\r\n  //generated mask for date, so will be replaced when value is null\r\n  const inputMask = React.useMemo(() => {\r\n    return variant === 'time'\r\n      ? getMaskedTimeValue(dateTimeMask, ampm)\r\n      : getMaskedDateValue(dateTimeMask);\r\n  }, [ampm, dateTimeMask, variant]);\r\n  const [hasError, setHasError] = React.useState(\r\n    props.error || Boolean(props.validationError),\r\n  );\r\n\r\n  const [errorMessage, setErrorMessage] = React.useState(\r\n    hasError ? props.validationError || props.helperText : undefined,\r\n  );\r\n  React.useEffect(() => {\r\n    setHasError(props.error || Boolean(props.validationError));\r\n    setErrorMessage(props.validationError || props.helperText);\r\n  }, [props.error, props.helperText, props.validationError]);\r\n  const [selectionChanged, setSelectionChanged] = React.useState(false);\r\n  const handleChange = (text: string, withCompletion?: boolean) => {\r\n    let finalString =\r\n      text === '' || text === inputMask\r\n        ? maskIfEmpty\r\n          ? inputMask\r\n          : null\r\n        : text;\r\n    onChange(finalString, withCompletion);\r\n  };\r\n  const dateChange = useDateTimeChange({\r\n    mask: true,\r\n    // format: val => val,\r\n    value: inputValue || (maskIfEmpty ? inputMask : ''),\r\n    onChange: handleChange,\r\n    variant: variant === 'time' ? 'time' : 'date',\r\n    maskFormats: dateTimeMask,\r\n    ampm: ampm,\r\n    inputMask: inputMask,\r\n    maskIfEmpty: maskIfEmpty,\r\n    onSelectionChange: () => selectionChanged,\r\n  });\r\n  return (\r\n    <TextComponent\r\n      inputProps={{\r\n        ...inputProps,\r\n        'aria-label': props.label\r\n          ? undefined\r\n          : `${ariaLabel ? ariaLabel : 'date input'}`,\r\n        // style: { minWidth: 80 },\r\n        onMouseUp: event => {\r\n          if (variant === 'time') {\r\n            timeSelection(event, dateTimeMask);\r\n          } else {\r\n            dateSelection(event, dateTimeMask);\r\n          }\r\n          setSelectionChanged(true);\r\n        },\r\n        onMouseDown: event => {\r\n          const target = event.target as HTMLInputElement;\r\n          if (!!target.value && target.value !== '') {\r\n            target.selectionStart = target.selectionEnd = target.value.length;\r\n          }\r\n        },\r\n        onKeyUp: event => {\r\n          if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\r\n            dateArrowSelection(\r\n              event,\r\n              event.key === 'ArrowLeft' ? 'left' : 'right',\r\n              variant === 'time' ? 'time' : 'date',\r\n              dateTimeMask,\r\n            );\r\n            setSelectionChanged(true);\r\n            console.log(event.key, {\r\n              selStart: (event.target as any).selectionStart,\r\n              selEnd: (event.target as any).selectionEnd,\r\n            });\r\n          }\r\n          if (event.key === 'ArrowUp') {\r\n            // keyDownRef.current = {\r\n            //   selectionStart: (event.target as any).selectionStart,\r\n            //   selectionEnd: (event.target as any).selectionEnd,\r\n            // };\r\n            dateChange.onChange(event as any, 'increase');\r\n            console.log('ArrowUp', {\r\n              selectionStart: (event.target as any).selectionStart,\r\n              selectionEnd: (event.target as any).selectionEnd,\r\n            });\r\n          }\r\n          if (event.key === 'ArrowDown') {\r\n            dateChange.onChange(event as any, 'decrease');\r\n            // keyDownRef.current = {\r\n            //   selectionStart: (event.target as any).selectionStart,\r\n            //   selectionEnd: (event.target as any).selectionEnd,\r\n            // };\r\n            console.log('ArrowUp', {\r\n              selStart: (event.target as any).selectionStart,\r\n              selEnd: (event.target as any).selectionEnd,\r\n            });\r\n          }\r\n          if (event.key === 'Enter' || event.key === 'Tab') {\r\n            handleChange(dateChange.value, true);\r\n          }\r\n        },\r\n        onKeyDown: event => {\r\n          switch (event.key) {\r\n            case 'ArrowLeft':\r\n            case 'ArrowRight':\r\n            case 'ArrowUp':\r\n            case 'ArrowDown':\r\n              event.preventDefault();\r\n              event.nativeEvent.stopImmediatePropagation();\r\n          }\r\n        },\r\n      }}\r\n      error={hasError}\r\n      onChange={event => {\r\n        dateChange.onChange(event);\r\n      }}\r\n      InputProps={{\r\n        ...InputProps,\r\n        disableUnderline: inputVariant === 'standard',\r\n        autoComplete: 'off',\r\n        // startAdornment: (\r\n        //   <InputAdornment position=\"start\">\r\n        //     <Icon icon=\"calendar-alt\" color=\"default\" colorExtend=\"textHover\" />\r\n        //   </InputAdornment>\r\n        // ),\r\n        endAdornment: (\r\n          <>\r\n            {(info && <InfoIcon title={info} error={hasError} />) ||\r\n              (endIcon && (\r\n                <InputAdornment position=\"end\" className={'date-picker'}>\r\n                  {endIcon}\r\n                </InputAdornment>\r\n              ))}\r\n            <InputAdornment position=\"end\" className={'date-picker'}>\r\n              <IconButton\r\n                onClick={e => togglePicker()}\r\n                disabled={props.disabled}\r\n                size=\"xs\"\r\n                variant=\"ghost\"\r\n              >\r\n                <Icon\r\n                  icon={variant === 'time' ? 'clock' : 'calendar-alt'}\r\n                  color=\"default\"\r\n                  colorExtend=\"textHover\"\r\n                />\r\n              </IconButton>\r\n            </InputAdornment>\r\n            {props.clearable &&\r\n              Boolean(inputValue || (maskIfEmpty ? inputMask : '')) && (\r\n                <InputAdornment position=\"end\" className={'date-picker'}>\r\n                  <IconButton\r\n                    variant=\"ghost\"\r\n                    size=\"xs\"\r\n                    shape=\"circle\"\r\n                    onClick={e => handleChange('', true)}\r\n                  >\r\n                    <Icon\r\n                      icon=\"circle-xmark\"\r\n                      color=\"default\"\r\n                      colorExtend=\"textHover\"\r\n                      style={{ width: 13, height: 13 }}\r\n                    />\r\n                  </IconButton>\r\n                </InputAdornment>\r\n              )}\r\n          </>\r\n        ),\r\n        // style: { minWidth: 80 },\r\n      }}\r\n      InputLabelProps={{\r\n        shrink:\r\n          inputVariant === 'filled'\r\n            ? !isNullOrUndefined(inputValue)\r\n              ? true\r\n              : false\r\n            : undefined,\r\n      }}\r\n      helperText={errorMessage || props.helperText}\r\n      onClick={ev => {\r\n        if (!isPickerOpen) {\r\n          const target = ev.target as HTMLInputElement;\r\n          if (!!target && target.nodeName === 'INPUT') openPicker();\r\n        }\r\n      }}\r\n      onMouseDown={ev => {\r\n        if (!isPickerOpen) {\r\n          const target = ev.target as HTMLInputElement;\r\n          if (!!target && target.nodeName === 'INPUT') openPicker();\r\n        }\r\n      }}\r\n      value={dateChange.value}\r\n      variant={inputVariant}\r\n      // onKeyUp={(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n      //   if (event.key === 'Enter') {\r\n      //     event.stopPropagation();\r\n      //     openPicker();\r\n      //   }\r\n      // }}\r\n      autoFocus={props.autoFocus}\r\n      size={props.size}\r\n      fullWidth={props.fullWidth}\r\n      placeholder={props.placeholder}\r\n      required={props.required}\r\n      disabled={props.disabled}\r\n      name={props.name}\r\n      id={props.id}\r\n      label={props.label}\r\n      margin={props.margin}\r\n      onBlur={props.onBlur}\r\n      onFocus={props.onFocus}\r\n    />\r\n  );\r\n}\r\n","import { BaseTextFieldProps } from '@material-ui/core';\r\nimport { BaseDatePickerProps, BaseTimePickerProps } from '@material-ui/pickers';\r\nimport { DateValidationProps } from '@material-ui/pickers/_helpers/text-field-helper';\r\nimport { BaseKeyboardPickerProps } from '@material-ui/pickers/_shared/hooks/useKeyboardPickerState';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { KeyboardRifmInput } from './KeyboardRifmInput';\r\nimport * as React from 'react';\r\nimport { IUtils } from '@date-io/core/IUtils';\r\nimport { validateError } from '../DatePicker/utils/pickerDateValidate';\r\nimport { KeyboardDateInputProps } from '@material-ui/pickers/_shared/KeyboardDateInput';\r\nimport { DatePopupVariants, getDisplayDate } from './utils/types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\n\r\nexport interface KeyboardInputProps\r\n  extends DateValidationProps,\r\n    Pick<BaseTimePickerProps, 'minutesStep' | 'ampm'>,\r\n    Pick<\r\n      BaseDatePickerProps,\r\n      | 'disableFuture'\r\n      | 'disablePast'\r\n      | 'minDate'\r\n      | 'maxDate'\r\n      | 'strictCompareDates'\r\n    >,\r\n    Omit<\r\n      KeyboardDateInputProps,\r\n      | 'maskChar'\r\n      | 'mask'\r\n      | 'refuse'\r\n      | 'KeyboardButtonProps'\r\n      | 'rifmFormatter'\r\n      | 'onChange'\r\n      | 'format'\r\n    >,\r\n    Pick<\r\n      BaseKeyboardPickerProps,\r\n      | 'onChange'\r\n      | 'format'\r\n      | 'value'\r\n      | 'invalidLabel'\r\n      | 'emptyLabel'\r\n      | 'labelFunc'\r\n      | 'onError'\r\n      | 'onChange'\r\n    >,\r\n    Pick<\r\n      BaseTextFieldProps,\r\n      | 'autoFocus'\r\n      | 'fullWidth'\r\n      | 'helperText'\r\n      | 'placeholder'\r\n      | 'required'\r\n      | 'disabled'\r\n      | 'name'\r\n      | 'id'\r\n      | 'label'\r\n      | 'margin'\r\n    > {\r\n  info?: string;\r\n  ariaLabel?: string;\r\n  startIcon?: React.ReactNode;\r\n  endIcon?: React.ReactNode;\r\n  togglePicker: () => void;\r\n  variant: Omit<DatePopupVariants, 'separate'>;\r\n  isPickerOpen?: boolean;\r\n  onChange: (\r\n    date: MaterialUiPickersDate | null,\r\n    value?: string | null,\r\n    withCompletion?: boolean,\r\n  ) => void;\r\n  maskIfEmpty?: boolean;\r\n  clearable?: boolean;\r\n}\r\nexport function parseInputString(\r\n  value: string,\r\n  utils: IUtils<any>,\r\n  format: string,\r\n) {\r\n  try {\r\n    return utils.parse(value, format);\r\n  } catch {\r\n    return null;\r\n  }\r\n}\r\nexport function KeyboardInput({\r\n  format = dateUtils.DateIOFormats.keyboardDate,\r\n  inputValue,\r\n  onChange,\r\n  value,\r\n  onError,\r\n  maxDate,\r\n  minDate,\r\n  disablePast,\r\n  disableFuture,\r\n  maxDateMessage,\r\n  minDateMessage,\r\n  invalidDateMessage,\r\n  strictCompareDates,\r\n  variant,\r\n  size,\r\n  maskIfEmpty,\r\n  clearable,\r\n  ...props\r\n}: KeyboardInputProps) {\r\n  const utils = dateUtils.dateFnsUtils;\r\n  const displayDate = getDisplayDate(\r\n    value,\r\n    format,\r\n    utils,\r\n    value === null || value === '',\r\n    {\r\n      invalidLabel: props.invalidLabel,\r\n      emptyLabel: props.emptyLabel,\r\n      labelFunc: props.labelFunc,\r\n    },\r\n  );\r\n  const [innerInputValue, setInnerInputValue] = React.useState(displayDate);\r\n  // const dateValue = inputValue\r\n  //   ? parseInputString(inputValue, utils, format)\r\n  //   : value;\r\n  const changedValueRef = React.useRef(innerInputValue);\r\n  React.useEffect(() => {\r\n    if (value === null || utils.isValid(value)) {\r\n      setInnerInputValue(displayDate);\r\n    }\r\n  }, [displayDate, setInnerInputValue, utils, value]);\r\n  React.useEffect(() => {\r\n    let val = innerInputValue;\r\n    if (!!val && val !== '') {\r\n      let date = val === null ? null : utils.parse(val, format);\r\n\r\n      if (!(date?.toString() === 'Invalid Date')) {\r\n        if (value !== null || utils.isValid(value)) {\r\n          let dateVal = dateUtils.getParsableDate(value);\r\n          if (dateVal !== null && date !== null) {\r\n            if (variant === 'time') {\r\n              date = dateUtils.dateFnsUtils.mergeDateAndTime(dateVal, date);\r\n            } else {\r\n              date = dateUtils.dateFnsUtils.mergeDateAndTime(date, dateVal);\r\n            }\r\n          }\r\n        }\r\n      }\r\n\r\n      let error = validateError(\r\n        date,\r\n        {\r\n          maxDate: maxDate,\r\n          minDate: minDate,\r\n          disablePast: disablePast,\r\n          disableFuture: disableFuture,\r\n          maxDateMessage: maxDateMessage,\r\n          minDateMessage: minDateMessage,\r\n          invalidDateMessage: invalidDateMessage,\r\n          strictCompareDates: strictCompareDates,\r\n        },\r\n        utils,\r\n      );\r\n      if (!!error) {\r\n        setValidationError(error);\r\n        if (!!onError) {\r\n          onError(error, null);\r\n        }\r\n      } else {\r\n        setValidationError('');\r\n        if (!!onError) {\r\n          onError('', null);\r\n        }\r\n      }\r\n    } else {\r\n      setValidationError('');\r\n      if (!!onError) {\r\n        onError('', null);\r\n      }\r\n    }\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [format, innerInputValue, maxDate, minDate]);\r\n  const [innerValidationError, setValidationError] = React.useState<\r\n    React.ReactNode | undefined\r\n  >(undefined);\r\n  const errorMessage = React.useMemo(() => {\r\n    return innerValidationError;\r\n  }, [innerValidationError]);\r\n  // const handleKeyboardChange = React.useCallback(\r\n  //   (date: MaterialUiPickersDate) => {\r\n  //     onChange(date, date === null ? null : utils.format(date, format));\r\n  //   },\r\n  //   [format, onChange, utils],\r\n  // );\r\n\r\n  // const inputProps = React.useMemo(\r\n  //   () => ({\r\n  //     ...innerInputProps, // reuse validation and open/close logic\r\n  //     format: format,\r\n  //     inputValue: inputValue || innerInputValue,\r\n  //     onChange: (value: string | null) => {\r\n  //       setInnerInputValue(value || '');\r\n  //       const date =\r\n  //         value === null ? null : utils.parse(value, wrapperProps.format);\r\n\r\n  //       onChange(date, value);\r\n  //     },\r\n  //   }),\r\n  //   [\r\n  //     innerInputProps,\r\n  //     innerInputValue,\r\n  //     inputValue,\r\n  //     onChange,\r\n  //     utils,\r\n  //     wrapperProps.format,\r\n  //   ],\r\n  // );\r\n  return (\r\n    <KeyboardRifmInput\r\n      inputValue={innerInputValue || inputValue}\r\n      onChange={(textValue: string | null, withCompletion?: boolean) => {\r\n        setInnerInputValue(textValue ?? '');\r\n        changedValueRef.current = textValue ?? '';\r\n\r\n        let date = textValue === null ? null : utils.parse(textValue, format);\r\n\r\n        if (!(date?.toString() === 'Invalid Date')) {\r\n          if (value !== null || utils.isValid(value)) {\r\n            let dateVal = dateUtils.getParsableDate(value);\r\n            if (dateVal !== null && date !== null) {\r\n              if (variant === 'time') {\r\n                date = dateUtils.dateFnsUtils.mergeDateAndTime(dateVal, date);\r\n              } else {\r\n                date = dateUtils.dateFnsUtils.mergeDateAndTime(date, dateVal);\r\n              }\r\n            }\r\n          }\r\n        }\r\n        let error = validateError(\r\n          date,\r\n          {\r\n            maxDate: maxDate,\r\n            minDate: minDate,\r\n            disablePast: disablePast,\r\n            disableFuture: disableFuture,\r\n            maxDateMessage: maxDateMessage,\r\n            minDateMessage: minDateMessage,\r\n            invalidDateMessage: invalidDateMessage,\r\n            strictCompareDates: strictCompareDates,\r\n          },\r\n          utils,\r\n        );\r\n        if (!!error) {\r\n          setValidationError(error);\r\n          if (!!onError) {\r\n            onError(error, date);\r\n          }\r\n        } else {\r\n          setValidationError('');\r\n          if (!!onError) {\r\n            onError('', date);\r\n          }\r\n          // if (!(date?.toString() === 'Invalid Date')) {\r\n          //   setTimeout(() => {\r\n          //     if (textValue === changedValueRef.current) {\r\n          //       onChange(date, textValue);\r\n          //     }\r\n          //   }, 1500);\r\n          // }\r\n          if (!(date?.toString() === 'Invalid Date')) {\r\n            onChange(date, textValue, withCompletion);\r\n          }\r\n        }\r\n      }}\r\n      isPickerOpen={props.isPickerOpen}\r\n      info={props.info}\r\n      ariaLabel={props.ariaLabel}\r\n      format={format}\r\n      validationError={errorMessage || props.validationError}\r\n      helperText={errorMessage || props.helperText}\r\n      error={Boolean(errorMessage)}\r\n      InputProps={props.InputProps}\r\n      startIcon={props.startIcon}\r\n      endIcon={props.endIcon}\r\n      inputVariant={props.inputVariant}\r\n      onFocus={props.onFocus}\r\n      onBlur={props.onBlur}\r\n      ampm={props.ampm}\r\n      variant={variant}\r\n      size={size}\r\n      maskIfEmpty={maskIfEmpty}\r\n      clearable={clearable}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import {\r\n  BaseTextFieldProps,\r\n  capitalize,\r\n  Divider,\r\n  List,\r\n  ListItem,\r\n  useTheme,\r\n} from '@material-ui/core';\r\nimport { BaseTimePickerProps, useUtils } from '@material-ui/pickers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport FormControl from 'app/components/Forms/FormControls/FormControl';\r\nimport FormHelperText from 'app/components/Forms/FormControls/FormHelperText';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport * as React from 'react';\r\n\r\nimport clsx from 'clsx';\r\nimport { Entity } from 'types/common';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { validateError } from 'app/components/DatePicker/utils/pickerDateValidate';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { DateDropDownValidationProps } from '../DateDropDown';\r\nimport {\r\n  getHoursEntityFromDate,\r\n  hoursEntityArray12,\r\n  hoursEntityArray24,\r\n} from 'app/components/pickers/StaticOptionsPickers/HoursPicker';\r\nimport {\r\n  getMinutesEntityFromDate,\r\n  minutesEntityArray,\r\n} from 'app/components/pickers/StaticOptionsPickers/MinutesPicker';\r\nimport {\r\n  AmPmEntityArray,\r\n  getAmPmEntityFromDate,\r\n} from 'app/components/pickers/StaticOptionsPickers/AmPmPicker';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface TimeOptionPickerProps\r\n  extends DateDropDownValidationProps,\r\n    BaseTimePickerProps,\r\n    Pick<\r\n      BaseTextFieldProps,\r\n      | 'fullWidth'\r\n      | 'helperText'\r\n      | 'required'\r\n      | 'disabled'\r\n      | 'name'\r\n      | 'id'\r\n      | 'label'\r\n      | 'error'\r\n      | 'size'\r\n    > {\r\n  value?: Date | string | null;\r\n  onChange: (\r\n    date: MaterialUiPickersDate | null,\r\n    withCompletion?: boolean,\r\n  ) => void;\r\n  inputVariant?: 'filled' | 'standard' | 'outlined';\r\n  info?: string;\r\n  className?: string;\r\n  hoursDisabled?: boolean;\r\n  minutesDisabled?: boolean;\r\n  onError?: (\r\n    error: React.ReactNode,\r\n    value: MaterialUiPickersDate | ParsableDate,\r\n  ) => void;\r\n}\r\n\r\nexport function TimeOptionPicker(props: TimeOptionPickerProps) {\r\n  const {\r\n    value,\r\n    onChange,\r\n    inputVariant,\r\n    id,\r\n    fullWidth,\r\n    helperText,\r\n    disabled,\r\n    label,\r\n    error,\r\n    size,\r\n    ampm,\r\n    minutesStep,\r\n    strictCompareDates = true,\r\n    onError,\r\n  } = props;\r\n  const { newDate } = useSystemDate();\r\n  const utils = useUtils();\r\n  const theme = useTheme();\r\n  const inputLabelId = label && id ? `${id}-label` : undefined;\r\n  const helperTextId = id ? `${id}-helper-text` : undefined;\r\n  const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n  const dateTimeValue = React.useMemo(() => {\r\n    return value;\r\n  }, [value]);\r\n  const [dateSelected, setDateSelected] = React.useState<\r\n    Date | string | null | undefined\r\n  >(value);\r\n  const [hoursSelected, setHoursSelected] = React.useState(\r\n    getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n  );\r\n  const [minutesSelected, setMinutesSelected] = React.useState(\r\n    getMinutesEntityFromDate(dateTimeValue),\r\n  );\r\n  const [ampmSelected, setAmpmSelected] = React.useState(\r\n    getAmPmEntityFromDate(dateTimeValue),\r\n  );\r\n  //   const [isHourOpen, setIsHourOpen] = React.useState<boolean>(false);\r\n  //   const [isMinuteOpen, setIsMinuteOpen] = React.useState<boolean>(false);\r\n  //   const [isAmPmOpen, setIsAmPmOpen] = React.useState<boolean>(false);\r\n  //   const someOpen = React.useMemo(() => {\r\n  //     return isHourOpen || isMinuteOpen || isAmPmOpen;\r\n  //   }, [isHourOpen, isMinuteOpen, isAmPmOpen]);\r\n  const [innerError, setInnerError] = React.useState<\r\n    React.ReactNode | undefined\r\n  >(undefined);\r\n\r\n  const hoursItems = React.useMemo(() => {\r\n    return ampm ? hoursEntityArray12 : hoursEntityArray24;\r\n  }, [ampm]);\r\n  const minutesItems = React.useMemo(() => {\r\n    return !!minutesStep && minutesStep > 0 && minutesStep <= 30\r\n      ? minutesEntityArray.filter(f => f.Id % minutesStep === 0)\r\n      : minutesEntityArray;\r\n  }, [minutesStep]);\r\n  const ampmItems = React.useMemo(() => {\r\n    return AmPmEntityArray;\r\n  }, []);\r\n  const hourRef = React.useRef<HTMLDivElement>(null);\r\n  const minuteRef = React.useRef<HTMLDivElement>(null);\r\n  const hourScroll = (selectedId: number, useAmPm?: boolean) => {\r\n    if (!!hourRef.current) {\r\n      let top = (useAmPm ? selectedId - 1 : selectedId) * 50;\r\n      hourRef.current.scrollTo(0, top);\r\n    }\r\n  };\r\n  const minuteScroll = (selectedId: number, step?: number) => {\r\n    if (!!minuteRef.current) {\r\n      let top = selectedId * 50;\r\n      if (step !== undefined) {\r\n        top = top / step;\r\n      }\r\n      minuteRef.current.scrollTo(0, top);\r\n    }\r\n  };\r\n  React.useEffect(() => {\r\n    setHoursSelected(() =>\r\n      getHoursEntityFromDate(ampm ?? false, dateTimeValue),\r\n    );\r\n    setMinutesSelected(() => getMinutesEntityFromDate(dateTimeValue));\r\n    setAmpmSelected(() => getAmPmEntityFromDate(dateTimeValue));\r\n  }, [ampm, dateTimeValue]);\r\n\r\n  React.useEffect(() => {\r\n    if (!!hourRef.current) {\r\n      hourScroll(hoursSelected.Id, ampm);\r\n    }\r\n    if (!!minuteRef.current) {\r\n      minuteScroll(minutesSelected.Id, minutesStep);\r\n    }\r\n  }, [ampm, hoursSelected.Id, minutesSelected.Id, minutesStep]);\r\n  React.useEffect(() => {\r\n    if (dateSelected !== null && dateSelected !== undefined) {\r\n      let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n        hours: hoursSelected.Id,\r\n        minutes: minutesSelected.Id,\r\n      });\r\n      let validateDate = dateUtils.convertToMeridiem(\r\n        time,\r\n        ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n        ampm ?? false,\r\n      );\r\n      let error = validateError(\r\n        validateDate,\r\n        {\r\n          maxDate: props.maxDate,\r\n          minDate: props.minDate,\r\n          disablePast: props.disablePast,\r\n          disableFuture: props.disableFuture,\r\n          maxDateMessage: props.maxDateMessage,\r\n          minDateMessage: props.minDateMessage,\r\n          invalidDateMessage: props.invalidDateMessage,\r\n          strictCompareDates: strictCompareDates,\r\n        },\r\n        utils,\r\n      );\r\n      if (!!error) {\r\n        setInnerError(error);\r\n        if (onError) {\r\n          onError(error, validateDate);\r\n        }\r\n      } else {\r\n        setInnerError('');\r\n        if (onError) {\r\n          onError('', validateDate);\r\n        }\r\n      }\r\n    } else {\r\n      setInnerError('');\r\n      if (onError) {\r\n        onError('', null);\r\n      }\r\n    }\r\n  }, [\r\n    ampm,\r\n    ampmSelected.Id,\r\n    dateSelected,\r\n    hoursSelected.Id,\r\n    minutesSelected.Id,\r\n    onError,\r\n    props.disableFuture,\r\n    props.disablePast,\r\n    props.invalidDateMessage,\r\n    props.maxDate,\r\n    props.maxDateMessage,\r\n    props.minDate,\r\n    props.minDateMessage,\r\n    strictCompareDates,\r\n    utils,\r\n  ]);\r\n  const handleChange = React.useCallback(\r\n    (\r\n      hour: number,\r\n      minute: number,\r\n      ampmValue: 'am' | 'pm',\r\n      withCompletion?: boolean,\r\n    ) => {\r\n      if (dateSelected !== null && dateSelected !== undefined) {\r\n        let time = dateUtils.set(dateUtils.dateOrStringToDate(dateSelected), {\r\n          hours: hour,\r\n          minutes: minute,\r\n        });\r\n        let finalDate = dateUtils.convertToMeridiem(\r\n          time,\r\n          ampmValue,\r\n          ampm ?? false,\r\n        );\r\n        let hasError = validateError(\r\n          finalDate,\r\n          {\r\n            maxDate: props.maxDate,\r\n            minDate: props.minDate,\r\n            disablePast: props.disablePast,\r\n            disableFuture: props.disableFuture,\r\n            maxDateMessage: props.maxDateMessage,\r\n            minDateMessage: props.minDateMessage,\r\n            invalidDateMessage: props.invalidDateMessage,\r\n            strictCompareDates: strictCompareDates,\r\n          },\r\n          utils,\r\n        );\r\n        if (!hasError || hasError === '') {\r\n          onChange(finalDate, withCompletion);\r\n        }\r\n      } else {\r\n        let time = dateUtils.set(newDate(), { hours: hour, minutes: minute });\r\n        let finalDate = dateUtils.convertToMeridiem(\r\n          time,\r\n          ampmValue,\r\n          ampm ?? false,\r\n        );\r\n        setDateSelected(finalDate);\r\n        let hasError = validateError(\r\n          finalDate,\r\n          {\r\n            maxDate: props.maxDate,\r\n            minDate: props.minDate,\r\n            disablePast: props.disablePast,\r\n            disableFuture: props.disableFuture,\r\n            maxDateMessage: props.maxDateMessage,\r\n            minDateMessage: props.minDateMessage,\r\n            invalidDateMessage: props.invalidDateMessage,\r\n            strictCompareDates: strictCompareDates,\r\n          },\r\n          utils,\r\n        );\r\n        if (!hasError || hasError === '') {\r\n          onChange(finalDate, withCompletion);\r\n        }\r\n      }\r\n    },\r\n    [\r\n      ampm,\r\n      dateSelected,\r\n      newDate,\r\n      onChange,\r\n      props.disableFuture,\r\n      props.disablePast,\r\n      props.invalidDateMessage,\r\n      props.maxDate,\r\n      props.maxDateMessage,\r\n      props.minDate,\r\n      props.minDateMessage,\r\n      strictCompareDates,\r\n      utils,\r\n    ],\r\n  );\r\n  const handleHoursChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setHoursSelected(val);\r\n      handleChange(\r\n        val.Id,\r\n        minutesSelected.Id,\r\n        ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n      );\r\n    },\r\n    [ampmSelected.Id, handleChange, minutesSelected.Id],\r\n  );\r\n  const handleMinutesChange = React.useCallback(\r\n    (val: Entity<number>) => {\r\n      setMinutesSelected(val);\r\n      handleChange(\r\n        hoursSelected.Id,\r\n        val.Id,\r\n        ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n      );\r\n    },\r\n    [ampmSelected.Id, handleChange, hoursSelected.Id],\r\n  );\r\n  const handleAmPmChange = React.useCallback(\r\n    (val: Entity<string>) => {\r\n      setAmpmSelected(val);\r\n      handleChange(\r\n        hoursSelected.Id,\r\n        minutesSelected.Id,\r\n        val.Id === 'am' ? 'am' : 'pm',\r\n      );\r\n    },\r\n    [handleChange, hoursSelected.Id, minutesSelected.Id],\r\n  );\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <FormControl\r\n        className={clsx('time-options-picker', sizeClass, {\r\n          withLabel: !!label,\r\n        })}\r\n        disabled={disabled}\r\n        error={error || Boolean(innerError)}\r\n        fullWidth={fullWidth}\r\n        required={props.required}\r\n        variant={inputVariant || 'standard'}\r\n        size={'medium'}\r\n        // onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n        //   const target = event.target as any; // as HTMLInputElement;\r\n\r\n        //   if (event.key === 'Enter') {\r\n        //     if (!!target && target.nodeName === 'INPUT') {\r\n        //       if (!someOpen && !innerError) {\r\n        //         handleChange(\r\n        //           hoursSelected.Id,\r\n        //           minutesSelected.Id,\r\n        //           ampmSelected.Id === 'am' ? 'am' : 'pm',\r\n        //           true,\r\n        //         );\r\n        //       }\r\n        //     }\r\n        //   }\r\n        // }}\r\n      >\r\n        {label && (\r\n          <InputLabel\r\n            htmlFor={id}\r\n            id={inputLabelId}\r\n            className={clsx('time-options-picker', sizeClass)}\r\n            required={props.required}\r\n            error={error || Boolean(innerError)}\r\n            disabled={props.disabled}\r\n          >\r\n            {label}\r\n          </InputLabel>\r\n        )}\r\n        <PickerOptions theme={theme} className={'time-options-picker-root'}>\r\n          <div className={'time-options-picker-wrap'}>\r\n            <div className={'time-options-picker-section'}>\r\n              <List\r\n                disablePadding\r\n                ref={hourRef}\r\n                // dense={true}\r\n                component={'div'}\r\n                className={clsx(\r\n                  'time-options-picker-list',\r\n                  'time-options-hours',\r\n                )}\r\n                // name={name}\r\n              >\r\n                {hoursItems.map(hour => (\r\n                  <ListItem\r\n                    button\r\n                    alignItems=\"center\"\r\n                    key={hour.Id}\r\n                    className={clsx('time-options-picker-list-item', {\r\n                      selected: hoursSelected.Id === hour.Id,\r\n                    })}\r\n                    //    children={children}\r\n                    onClick={event => {\r\n                      handleHoursChange(hour);\r\n                    }}\r\n                    onKeyDown={event => {\r\n                      if (event.key === 'Enter') {\r\n                        handleHoursChange(hour);\r\n                      }\r\n                    }}\r\n                    selected={hoursSelected.Id === hour.Id}\r\n                  >\r\n                    {hour.Name}\r\n                  </ListItem>\r\n                ))}\r\n              </List>\r\n              <Divider orientation=\"vertical\" />\r\n              <List\r\n                disablePadding\r\n                ref={minuteRef}\r\n                component={'div'}\r\n                // dense={true}\r\n                className={clsx(\r\n                  'time-options-picker-list',\r\n                  'time-options-minutes',\r\n                )}\r\n                // name={name}\r\n              >\r\n                {minutesItems.map(minute => (\r\n                  <ListItem\r\n                    button\r\n                    alignItems=\"center\"\r\n                    key={minute.Id}\r\n                    className={clsx('time-options-picker-list-item', {\r\n                      selected: minutesSelected.Id === minute.Id,\r\n                    })}\r\n                    onClick={event => {\r\n                      handleMinutesChange(minute);\r\n                    }}\r\n                    onKeyDown={event => {\r\n                      if (event.key === 'Enter') {\r\n                        handleMinutesChange(minute);\r\n                      }\r\n                    }}\r\n                    selected={minutesSelected.Id === minute.Id}\r\n                  >\r\n                    {minute.Name}\r\n                  </ListItem>\r\n                ))}\r\n              </List>\r\n              {ampm && (\r\n                <React.Fragment>\r\n                  <Divider orientation=\"vertical\" />\r\n                  <List\r\n                    disablePadding\r\n                    component={'div'}\r\n                    //   dense={true}\r\n                    className={clsx(\r\n                      'time-options-picker-list',\r\n                      'time-options-ampm',\r\n                    )}\r\n                    // name={name}\r\n                  >\r\n                    {ampmItems.map(ap => (\r\n                      <ListItem\r\n                        button\r\n                        alignItems=\"center\"\r\n                        key={ap.Id}\r\n                        className={clsx('time-options-picker-list-item', {\r\n                          selected: ampmSelected.Id === ap.Id,\r\n                        })}\r\n                        onClick={event => {\r\n                          handleAmPmChange(ap);\r\n                        }}\r\n                        onKeyDown={event => {\r\n                          if (event.key === 'Enter') {\r\n                            handleAmPmChange(ap);\r\n                          }\r\n                        }}\r\n                        selected={ampmSelected.Id === ap.Id}\r\n                      >\r\n                        {ap.Name}\r\n                      </ListItem>\r\n                    ))}\r\n                  </List>\r\n                </React.Fragment>\r\n              )}\r\n            </div>\r\n          </div>\r\n        </PickerOptions>\r\n        {(!!helperText || Boolean(innerError)) && (\r\n          <FormHelperText\r\n            id={helperTextId}\r\n            className={clsx('time-options-picker', sizeClass)}\r\n            disabled={disabled}\r\n            error={error || Boolean(innerError)}\r\n            required={props.required}\r\n          >\r\n            {helperText || innerError}\r\n          </FormHelperText>\r\n        )}\r\n      </FormControl>\r\n    </React.Fragment>\r\n  );\r\n}\r\nconst PickerOptions = styled('div')(({ theme }) => ({\r\n  '&.time-options-picker-root': {\r\n    display: 'grid',\r\n    gridAutoColumns: 'max-content auto max-content',\r\n    gridAutoRows: 'max-content auto max-content',\r\n    '& .time-options-picker-wrap': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      gridColumn: 1,\r\n      gridRow: 1,\r\n      '& .time-options-picker-section': {\r\n        overflow: 'hidden',\r\n        maxHeight: '334px',\r\n        margin: '0px auto',\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        width: '100%',\r\n        borderBottom: '1px solid rgba(0, 0, 0, 0.12)',\r\n        borderTop: '1px solid rgba(0, 0, 0, 0.12)',\r\n        gap: '8px',\r\n        padding: '8px 0px',\r\n        '& .time-options-picker-list': {\r\n          listStyle: 'none',\r\n          margin: '0px',\r\n          position: 'relative',\r\n          maxHeight: '232px',\r\n          width: '56px',\r\n          padding: '0px',\r\n          overflow: 'hidden',\r\n          '&.time-options-hours, &.time-options-minutes': {\r\n            '&::after': {\r\n              display: 'block',\r\n              content: '\"\"',\r\n              height: 'calc((100% - 40px) - 6px)',\r\n            },\r\n            '@media (prefers-reduced-motion: no-preference)': {\r\n              scrollBehavior: 'auto',\r\n            },\r\n            '&:hover': {\r\n              overflowY: 'auto',\r\n            },\r\n            '&::-webkit-scrollbar': {\r\n              width: '4px',\r\n              boxShadow: `inset 0px 0px 1px 1px ${bookitColors.grayscale.grayBorders}`,\r\n              borderRadius: '2px',\r\n            },\r\n            '&::-webkit-scrollbar-thumb': {\r\n              boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n              borderRadius: '6px',\r\n              backgroundColor: theme.palette.common.grayBorders,\r\n            },\r\n          },\r\n          '& .time-options-picker-list-item': {\r\n            display: 'flex',\r\n            minHeight: '48px',\r\n            whiteSpace: 'nowrap',\r\n            padding: '8px',\r\n            margin: '2px 4px',\r\n            width: '48px',\r\n            borderRadius: '8px',\r\n            justifyContent: 'center',\r\n            fontFamily: `'Lato', sans-serif`,\r\n            fontSize: '16px',\r\n            fontStyle: 'normal',\r\n            lineHeight: '20px' /* 125% */,\r\n            fontWeight: 600,\r\n            letterSpacing: '0.2px',\r\n            '&.selected': {\r\n              backgroundColor: bookitColors.primary.components,\r\n              color: bookitColors.base.white,\r\n              '&:hover': {\r\n                backgroundColor: bookitColors.primary.regular,\r\n                color: bookitColors.base.white,\r\n              },\r\n            },\r\n            '&:hover': {\r\n              backgroundColor: bookitColors.primary.bgHover,\r\n            },\r\n          },\r\n        },\r\n        '& .time-options-minutes': {\r\n          // borderLeft: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n          // marginLeft: '12px',\r\n        },\r\n        '& .time-options-ampm': {\r\n          // borderLeft: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n          // marginLeft: '12px',\r\n        },\r\n        '& .time-options-hours': {\r\n          // marginRight: '12px',\r\n        },\r\n      },\r\n    },\r\n  },\r\n}));\r\n","import { ClickAwayListener, Fade, Paper, useTheme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { DateInput, DateInputProps } from './DateInput';\r\nimport {\r\n  DatePopupVariants,\r\n  getInputViewDate,\r\n  getValueDateOrTruncat,\r\n  setInputViewDate,\r\n} from './utils/types';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport {\r\n  BaseDatePickerProps,\r\n  BaseTimePickerProps,\r\n  DatePicker,\r\n  KeyboardDatePickerProps,\r\n  TimePicker,\r\n  useUtils,\r\n} from '@material-ui/pickers';\r\nimport { DatePickerValueProps } from '../DatePicker';\r\nimport { PickerPopper, StyledPicker } from './StyledPicker';\r\nimport { SeparatedPickerProps } from '../KeyBoardDatePicker';\r\nimport { KeyboardDateInputProps } from '@material-ui/pickers/_shared/KeyboardDateInput';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { BaseKeyboardPickerProps } from '@material-ui/pickers/_shared/hooks/useKeyboardPickerState';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { DateDropDown } from './DateDropDown';\r\nimport { TimeDropDown } from './TimeDropDown';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectUseAmPm } from 'app/slice/selectors';\r\nimport {\r\n  validateDate,\r\n  validateTime,\r\n} from '../DatePicker/utils/pickerDateValidate';\r\nimport { useKeyUpOutside } from 'app/hooks/useKeyUpOutside';\r\nimport { KeyboardInput } from './KeyboardInput';\r\nimport { TimeOptionPicker } from './TimeOptionPicker';\r\n\r\nexport interface BookitDatePickerProps\r\n  extends BaseDatePickerProps,\r\n    Pick<BaseTimePickerProps, 'minutesStep'>,\r\n    SeparatedPickerProps,\r\n    Pick<BaseKeyboardPickerProps, 'onChange' | 'inputValue'>,\r\n    Pick<\r\n      KeyboardDateInputProps,\r\n      | 'validationError'\r\n      | 'keyboardIcon'\r\n      | 'mask'\r\n      | 'maskChar'\r\n      | 'KeyboardButtonProps'\r\n      | 'rifmFormatter'\r\n      | 'refuse'\r\n    >,\r\n    Pick<\r\n      KeyboardDatePickerProps,\r\n      | 'labelFunc'\r\n      | 'clearable'\r\n      | 'maxDateMessage'\r\n      | 'minDateMessage'\r\n      | 'invalidDateMessage'\r\n      | 'onError'\r\n    >,\r\n    Pick<DatePickerValueProps, 'value' | 'endTime' | 'truncateTime'>,\r\n    Pick<\r\n      DateInputProps,\r\n      | 'autoFocus'\r\n      | 'fullWidth'\r\n      | 'helperText'\r\n      | 'placeholder'\r\n      | 'error'\r\n      | 'required'\r\n      | 'disabled'\r\n      | 'name'\r\n      | 'id'\r\n      | 'label'\r\n      | 'margin'\r\n      | 'inputProps'\r\n      | 'InputProps'\r\n      | 'TextFieldComponent'\r\n      | 'onBlur'\r\n      | 'onFocus'\r\n    > {\r\n  inputVariant?: 'filled' | 'standard' | 'outlined';\r\n  closablePicker?: boolean;\r\n  closeTitle?: React.ReactNode;\r\n  onClose?: () => void;\r\n  onOpen?: () => void;\r\n  variant?: DatePopupVariants;\r\n  info?: string;\r\n  ariaLabel?: string;\r\n  startIcon?: React.ReactNode;\r\n  endIcon?: React.ReactNode;\r\n  size?: 'medium' | 'small' | undefined;\r\n  className?: string;\r\n  fullScreen?: boolean;\r\n  readonlyInput?: boolean;\r\n  useTimeClockPicker?: boolean;\r\n  useTimeDropDowns?: boolean;\r\n  useDateDropDowns?: boolean;\r\n  useDateCalendarPicker?: boolean;\r\n  saveOnSelect?: boolean;\r\n  maskIfEmpty?: boolean;\r\n  clearable?: boolean;\r\n}\r\n\r\nexport function BookitDatePicker(props: BookitDatePickerProps) {\r\n  const isMobile = DetectIsMobile();\r\n  const theme = useTheme();\r\n  const { t } = useTranslation();\r\n  const useAmPm = useSelector(selectUseAmPm);\r\n  const utils = useUtils();\r\n  const elementRef = React.useRef<HTMLDivElement>(null);\r\n  const {\r\n    inputVariant,\r\n    closablePicker = true,\r\n    closeTitle = 'Close',\r\n    onClose,\r\n    onOpen,\r\n    value,\r\n    endTime,\r\n    truncateTime,\r\n    variant = 'date',\r\n    info,\r\n    startIcon,\r\n    endIcon,\r\n    ariaLabel,\r\n    minDateMessage = 'Date should not be before minimal date',\r\n    maxDateMessage = 'Date should not be after maximal date',\r\n    invalidDateMessage = 'Invalid Date Format',\r\n    onChange,\r\n    labelFunc,\r\n    readonlyInput,\r\n    useTimeClockPicker,\r\n    useTimeDropDowns,\r\n    useDateDropDowns,\r\n    saveOnSelect,\r\n    maskIfEmpty = true,\r\n    clearable,\r\n    ...other\r\n  } = props;\r\n\r\n  const dateInputProps = React.useMemo(() => {\r\n    return {\r\n      autoFocus: props.autoFocus,\r\n      fullWidth: props.fullWidth,\r\n      helperText: props.helperText,\r\n      placeholder: props.placeholder,\r\n      error: props.error,\r\n      required: props.required,\r\n      disabled: props.disabled,\r\n      name: props.name || 'dateInputName',\r\n      id: props.id || 'dateInputId',\r\n      label: props.label,\r\n      margin: props.margin,\r\n      inputProps: props.inputProps,\r\n      InputProps: props.InputProps,\r\n      TextFieldComponent: props.TextFieldComponent,\r\n      onBlur: props.onBlur,\r\n      onFocus: props.onFocus,\r\n    };\r\n  }, [\r\n    props.InputProps,\r\n    props.TextFieldComponent,\r\n    props.autoFocus,\r\n    props.disabled,\r\n    props.error,\r\n    props.fullWidth,\r\n    props.helperText,\r\n    props.id,\r\n    props.inputProps,\r\n    props.label,\r\n    props.margin,\r\n    props.name,\r\n    props.onBlur,\r\n    props.onFocus,\r\n    props.placeholder,\r\n    props.required,\r\n  ]);\r\n  const keyboardInputProps = React.useMemo(() => {\r\n    return {\r\n      ...dateInputProps,\r\n      minDateMessage: minDateMessage,\r\n      maxDateMessage: maxDateMessage,\r\n      invalidDateMessage: invalidDateMessage,\r\n      ariaLabel: ariaLabel,\r\n      startIcon: startIcon,\r\n      endIcon: endIcon,\r\n      info: info,\r\n      labelFunc: labelFunc,\r\n      minDate: other.minDate,\r\n      maxDate: other.maxDate,\r\n      disableFuture: other.disableFuture,\r\n      disablePast: other.disablePast,\r\n      strictCompareDates: other.strictCompareDates,\r\n    };\r\n  }, [\r\n    ariaLabel,\r\n    dateInputProps,\r\n    endIcon,\r\n    info,\r\n    invalidDateMessage,\r\n    labelFunc,\r\n    maxDateMessage,\r\n    minDateMessage,\r\n    other.disableFuture,\r\n    other.disablePast,\r\n    other.maxDate,\r\n    other.minDate,\r\n    other.strictCompareDates,\r\n    startIcon,\r\n  ]);\r\n  const [dateValue, setDateValue] = React.useState<\r\n    Date | string | null | undefined\r\n  >(getValueDateOrTruncat(variant, value, endTime, truncateTime));\r\n  const [open, setOpen] = React.useState<boolean | undefined>(undefined);\r\n  const [validationError, setValidationError] = React.useState<\r\n    React.ReactNode | undefined\r\n  >(undefined);\r\n  const dateTimeValue = React.useMemo(() => {\r\n    return getValueDateOrTruncat(variant, value, endTime, truncateTime);\r\n  }, [endTime, truncateTime, value, variant]);\r\n  React.useEffect(() => {\r\n    setDateValue(() => {\r\n      if (dateTimeValue === null || dateTimeValue === undefined) {\r\n        return null;\r\n      } else {\r\n        return dateUtils.dateOrStringToDate(dateTimeValue);\r\n      }\r\n    });\r\n  }, [dateTimeValue]);\r\n  useKeyUpOutside(\r\n    elementRef,\r\n    () => {\r\n      if (open) {\r\n        if (!validationError || validationError === '') {\r\n          handleSave();\r\n        }\r\n        handleClose();\r\n      }\r\n    },\r\n    'keyup',\r\n    'Tab',\r\n  );\r\n  // useGlobalDOMEvents({\r\n  //   keyup(ev) {\r\n  //     if ((ev as KeyboardEvent).key === 'Tab') {\r\n  //       console.log('tab event target', ev.target);\r\n  //       console.log('tab event currentTarget', ev.currentTarget);\r\n  //     }\r\n  //   },\r\n  // });\r\n  // manually trigger rerender using a useless usState hook\r\n  // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n  const countState = React.useState(0);\r\n  React.useEffect(() => {\r\n    countState[1](c => c + 1);\r\n    // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [elementRef.current]);\r\n\r\n  const handleClickAway = (event: React.MouseEvent<Document>) => {\r\n    if (open) {\r\n      if (!validationError || validationError === '') {\r\n        handleSave();\r\n      }\r\n      handleClose();\r\n    }\r\n  };\r\n  const handleSave = React.useCallback(() => {\r\n    onChange(setInputViewDate(variant, dateValue, endTime, truncateTime));\r\n    setOpen(false);\r\n    onClose?.();\r\n  }, [dateValue, endTime, onChange, onClose, truncateTime, variant]);\r\n  const handleClose = React.useCallback(() => {\r\n    setOpen(false);\r\n    onClose?.();\r\n  }, [onClose]);\r\n  const handleOpen = React.useCallback(() => {\r\n    setOpen(true);\r\n    onOpen?.();\r\n  }, [onOpen]);\r\n  const togglePicker = React.useCallback(() => {\r\n    if (open) {\r\n      if (!validationError || validationError === '') {\r\n        handleClose();\r\n      }\r\n    } else {\r\n      handleOpen();\r\n    }\r\n  }, [handleClose, handleOpen, open, validationError]);\r\n  const inputDisplayValue = React.useMemo(() => {\r\n    return getInputViewDate(variant, dateValue, endTime, truncateTime);\r\n  }, [endTime, truncateTime, dateValue, variant]);\r\n\r\n  const onError = React.useCallback(\r\n    (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n      setValidationError(error);\r\n      if (!!props.onError) {\r\n        props.onError(error, value);\r\n      }\r\n    },\r\n    [props],\r\n  );\r\n  return (\r\n    <ClickAwayListener\r\n      mouseEvent={'onMouseDown'}\r\n      onClickAway={event => handleClickAway(event)}\r\n    >\r\n      <StyledPicker theme={theme} className={'picker-root'} ref={elementRef}>\r\n        {readonlyInput || isMobile ? (\r\n          <DateInput\r\n            openPicker={handleOpen}\r\n            togglePicker={togglePicker}\r\n            inputVariant={inputVariant || 'filled'}\r\n            inputValue={inputDisplayValue ?? ''}\r\n            validationError={\r\n              dateInputProps.error ? dateInputProps.helperText : undefined\r\n            }\r\n            className={clsx('picker-date-input', props.className)}\r\n            size={props.size}\r\n            info={info}\r\n            startIcon={startIcon}\r\n            variant={variant}\r\n            endIcon={endIcon}\r\n            ariaLabel={ariaLabel}\r\n            {...dateInputProps}\r\n          />\r\n        ) : (\r\n          <KeyboardInput\r\n            value={dateValue}\r\n            openPicker={handleOpen}\r\n            togglePicker={togglePicker}\r\n            inputVariant={inputVariant || 'filled'}\r\n            inputValue={''}\r\n            variant={variant}\r\n            className={clsx('keyboard-date-input', props.className)}\r\n            size={props.size}\r\n            maskIfEmpty={maskIfEmpty}\r\n            isPickerOpen={open}\r\n            clearable={clearable}\r\n            onChange={(date, inpValue, withCompletion) => {\r\n              setDateValue(date);\r\n              if (withCompletion) {\r\n                if (!validationError || validationError === '') {\r\n                  onChange(\r\n                    setInputViewDate(variant, date, endTime, truncateTime),\r\n                    inpValue,\r\n                  );\r\n                  setOpen(false);\r\n                  onClose?.();\r\n                }\r\n              }\r\n              // onChange(date, inpValue);\r\n              // if (open) {\r\n              //   setOpen(false);\r\n              //   onClose?.();\r\n              // }\r\n              //onChange(setInputViewDate(variant, dateValue, endTime, truncateTime));\r\n            }}\r\n            onError={(error, date) => {\r\n              if (\r\n                !!error &&\r\n                !!date &&\r\n                date !== null &&\r\n                dateUtils.dateFnsUtils.isValid(date)\r\n              ) {\r\n                let setDate = dateUtils.getParsableDate(date);\r\n                setDateValue(setDate);\r\n              }\r\n\r\n              onError(error, date);\r\n            }}\r\n            ampm={useAmPm}\r\n            format={\r\n              variant === 'time'\r\n                ? dateUtils.DateIOFormats.fullTime\r\n                : dateUtils.DateIOFormats.keyboardDate\r\n            }\r\n            validationError={\r\n              keyboardInputProps.error\r\n                ? keyboardInputProps.helperText\r\n                : undefined\r\n            }\r\n            {...keyboardInputProps}\r\n          />\r\n        )}\r\n\r\n        <PickerPopper\r\n          theme={theme}\r\n          open={Boolean(open)}\r\n          anchorEl={elementRef.current}\r\n          className={clsx('picker-popper', {\r\n            'picker-popper-mobile': isMobile,\r\n          })}\r\n          // placement={'bottom-end'}\r\n          transition\r\n          disablePortal={false}\r\n          onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => {\r\n            const target = event.target as any; // as HTMLInputElement;\r\n\r\n            if (event.key === 'Enter') {\r\n              if (!!target && target.nodeName === 'INPUT') {\r\n                // if (!validationError || validationError === '') {\r\n                //   handleSave();\r\n                // }\r\n              } else {\r\n                if (!validationError || validationError === '') {\r\n                  handleSave();\r\n                } else {\r\n                  handleClose();\r\n                }\r\n              }\r\n            }\r\n          }}\r\n          // onBlur={event => {\r\n          //   console.log('blur event', event.target);\r\n          // }}\r\n          // modifiers={{\r\n          //   keepTogether: { enabled: true },\r\n          //   flip: { enabled: false },\r\n          //   preventOverflow: {\r\n          //     enabled: true,\r\n          //     boundariesElement: 'viewport',\r\n          //   },\r\n          //   // offset: {\r\n          //   //   offset: '-15,0',\r\n          //   // },\r\n          // }}\r\n        >\r\n          {({ TransitionProps }) => (\r\n            <Fade {...TransitionProps} timeout={33}>\r\n              <Paper\r\n                className={clsx('picker-paper', {\r\n                  'picker-paper-mobile': isMobile,\r\n                })}\r\n              >\r\n                <div\r\n                  className={clsx('picker-header', {\r\n                    'picker-header-mobile': isMobile,\r\n                  })}\r\n                >\r\n                  {closablePicker && (\r\n                    <IconButton\r\n                      shape=\"square\"\r\n                      size=\"xs\"\r\n                      variant=\"ghost\"\r\n                      aria-label=\"Close\"\r\n                      onClick={event => {\r\n                        handleClose();\r\n                      }}\r\n                      disabled={!!validationError && validationError !== ''}\r\n                      style={{ position: 'absolute', right: 8, top: 8 }}\r\n                    >\r\n                      {!!closeTitle ? (\r\n                        <Tooltip title={closeTitle}>\r\n                          <span>\r\n                            <Icon\r\n                              icon=\"times\"\r\n                              color={\r\n                                !!validationError && validationError !== ''\r\n                                  ? 'danger'\r\n                                  : 'default'\r\n                              }\r\n                              style={{ pointerEvents: 'none' }}\r\n                              colorExtend=\"textHover\"\r\n                            />\r\n                          </span>\r\n                        </Tooltip>\r\n                      ) : (\r\n                        <Icon\r\n                          icon=\"times\"\r\n                          color={\r\n                            !!validationError && validationError !== ''\r\n                              ? 'danger'\r\n                              : 'default'\r\n                          }\r\n                          style={{ pointerEvents: 'none' }}\r\n                          colorExtend=\"textHover\"\r\n                        />\r\n                      )}\r\n                    </IconButton>\r\n                  )}\r\n                  <div\r\n                    className={clsx('picker-header-title', {\r\n                      'picker-header-title-mobile': isMobile,\r\n                    })}\r\n                  ></div>\r\n                </div>\r\n                <div\r\n                  className={clsx('picker-content', {\r\n                    'picker-content-mobile': isMobile,\r\n                  })}\r\n                >\r\n                  {variant === 'time' ? (\r\n                    <React.Fragment>\r\n                      {useTimeClockPicker ? (\r\n                        <TimePicker\r\n                          value={dateValue}\r\n                          disableToolbar\r\n                          variant={'static'}\r\n                          onChange={timeValue => {\r\n                            if (timeValue !== null) {\r\n                              // let validateDate = dateUtils.convertToMeridiem(\r\n                              //   timeValue,\r\n                              //   dateUtils.getMeridiem(timeValue),\r\n                              //   useAmPm ?? false,\r\n                              // );\r\n                              let error = validateTime(\r\n                                timeValue.getHours(),\r\n                                timeValue.getMinutes(),\r\n                                {\r\n                                  maxDate: props.maxDate,\r\n                                  minDate: props.minDate,\r\n                                  disablePast: props.disablePast,\r\n                                  disableFuture: props.disableFuture,\r\n                                  maxDateMessage: maxDateMessage,\r\n                                  minDateMessage: minDateMessage,\r\n                                  invalidDateMessage: invalidDateMessage,\r\n                                  strictCompareDates: props.strictCompareDates,\r\n                                },\r\n                                utils,\r\n                                timeValue,\r\n                                useAmPm ?? false,\r\n                              );\r\n                              if (!!error) {\r\n                                onError(error, validateDate);\r\n                              } else {\r\n                                setDateValue(timeValue);\r\n                                if (saveOnSelect) {\r\n                                  onChange(\r\n                                    setInputViewDate(\r\n                                      variant,\r\n                                      timeValue,\r\n                                      endTime,\r\n                                      truncateTime,\r\n                                    ),\r\n                                  );\r\n                                  setOpen(false);\r\n                                  onClose?.();\r\n                                }\r\n                              }\r\n                            } else {\r\n                              setDateValue(timeValue);\r\n                              if (saveOnSelect) {\r\n                                onChange(\r\n                                  setInputViewDate(\r\n                                    variant,\r\n                                    timeValue,\r\n                                    endTime,\r\n                                    truncateTime,\r\n                                  ),\r\n                                );\r\n                                setOpen(false);\r\n                                onClose?.();\r\n                              }\r\n                            }\r\n                          }}\r\n                          ampm={useAmPm}\r\n                        />\r\n                      ) : (\r\n                        <TimeOptionPicker\r\n                          value={dateValue}\r\n                          id={`inner-${dateInputProps.id ?? 'dateInputId'}`}\r\n                          name={`inner-${\r\n                            dateInputProps.name ?? 'dateInputName'\r\n                          }`}\r\n                          label={dateInputProps.label}\r\n                          inputVariant={'standard'}\r\n                          onChange={(val, withCompletion) => {\r\n                            setDateValue(val);\r\n                            if (withCompletion) {\r\n                              if (!validationError || validationError === '') {\r\n                                onChange(\r\n                                  setInputViewDate(\r\n                                    variant,\r\n                                    val,\r\n                                    endTime,\r\n                                    truncateTime,\r\n                                  ),\r\n                                );\r\n                                setOpen(false);\r\n                                onClose?.();\r\n                              }\r\n                            }\r\n                          }}\r\n                          onBlur={props.onBlur}\r\n                          error={props.error}\r\n                          onError={onError}\r\n                          fullWidth={props.fullWidth || true}\r\n                          helperText={props.helperText}\r\n                          disabled={props.disabled}\r\n                          placeholder={props.placeholder}\r\n                          required={props.required}\r\n                          size={props.size}\r\n                          maxDateMessage={maxDateMessage}\r\n                          minDateMessage={minDateMessage}\r\n                          invalidDateMessage={invalidDateMessage}\r\n                          strictCompareDates={true}\r\n                          // dateId={`inner-date-${props.dateId ?? 'dateId'}`}\r\n                          // timeId={`inner-time-${props.timeId ?? 'timeId'}`}\r\n                          // dateName={`inner-date-${props.dateName ?? 'dateName'}`}\r\n                          // timeName={`inner-time-${props.timeName ?? 'timeName'}`}\r\n                          // dateInputProps={props.dateInputProps}\r\n                          // timeInputProps={props.timeInputProps}\r\n                          autoFocus={true}\r\n                          ampm={useAmPm}\r\n                          minutesStep={props.minutesStep}\r\n                          {...other}\r\n                        />\r\n                      )}\r\n                    </React.Fragment>\r\n                  ) : (\r\n                    <DatePicker\r\n                      variant=\"static\"\r\n                      disableToolbar\r\n                      value={dateValue}\r\n                      // onError={onError}\r\n                      minDate={props.minDate}\r\n                      maxDate={props.maxDate}\r\n                      disableFuture={props.disableFuture}\r\n                      disablePast={props.disablePast}\r\n                      onChange={dateVal => {\r\n                        if (dateVal !== null) {\r\n                          let error = validateDate(\r\n                            dateVal.getDate(),\r\n                            dateVal.getMonth(),\r\n                            dateVal.getFullYear(),\r\n                            {\r\n                              maxDate: props.maxDate,\r\n                              minDate: props.minDate,\r\n                              disablePast: props.disablePast,\r\n                              disableFuture: props.disableFuture,\r\n                              maxDateMessage: maxDateMessage,\r\n                              minDateMessage: minDateMessage,\r\n                              invalidDateMessage: invalidDateMessage,\r\n                              strictCompareDates: props.strictCompareDates,\r\n                            },\r\n                            utils,\r\n                            dateVal,\r\n                          );\r\n                          if (!!error) {\r\n                            onError(error, dateVal);\r\n                          } else {\r\n                            setDateValue(dateVal);\r\n                            if (saveOnSelect) {\r\n                              onChange(\r\n                                setInputViewDate(\r\n                                  variant,\r\n                                  dateVal,\r\n                                  endTime,\r\n                                  truncateTime,\r\n                                ),\r\n                              );\r\n                              setOpen(false);\r\n                              onClose?.();\r\n                            }\r\n                          }\r\n                        } else {\r\n                          setDateValue(dateVal);\r\n                          if (saveOnSelect) {\r\n                            onChange(\r\n                              setInputViewDate(\r\n                                variant,\r\n                                dateVal,\r\n                                endTime,\r\n                                truncateTime,\r\n                              ),\r\n                            );\r\n                            setOpen(false);\r\n                            onClose?.();\r\n                          }\r\n                        }\r\n                      }}\r\n                    />\r\n                  )}\r\n                  {((variant === 'time' && useTimeDropDowns) ||\r\n                    (variant === 'date' && useDateDropDowns)) && (\r\n                    <div className={'picker-content-date'}>\r\n                      {variant === 'time' && useTimeDropDowns && (\r\n                        <TimeDropDown\r\n                          value={dateValue}\r\n                          id={`inner-${dateInputProps.id ?? 'dateInputId'}`}\r\n                          name={`inner-${\r\n                            dateInputProps.name ?? 'dateInputName'\r\n                          }`}\r\n                          label={dateInputProps.label}\r\n                          inputVariant={'standard'}\r\n                          onChange={(val, withCompletion) => {\r\n                            setDateValue(val);\r\n                            if (withCompletion) {\r\n                              if (!validationError || validationError === '') {\r\n                                onChange(\r\n                                  setInputViewDate(\r\n                                    variant,\r\n                                    val,\r\n                                    endTime,\r\n                                    truncateTime,\r\n                                  ),\r\n                                );\r\n                                setOpen(false);\r\n                                onClose?.();\r\n                              }\r\n                            }\r\n                          }}\r\n                          onBlur={props.onBlur}\r\n                          error={props.error}\r\n                          onError={onError}\r\n                          fullWidth={props.fullWidth || true}\r\n                          helperText={props.helperText}\r\n                          disabled={props.disabled}\r\n                          placeholder={props.placeholder}\r\n                          required={props.required}\r\n                          size={props.size}\r\n                          maxDateMessage={maxDateMessage}\r\n                          minDateMessage={minDateMessage}\r\n                          invalidDateMessage={invalidDateMessage}\r\n                          // dateId={`inner-date-${props.dateId ?? 'dateId'}`}\r\n                          // timeId={`inner-time-${props.timeId ?? 'timeId'}`}\r\n                          // dateName={`inner-date-${props.dateName ?? 'dateName'}`}\r\n                          // timeName={`inner-time-${props.timeName ?? 'timeName'}`}\r\n                          // dateInputProps={props.dateInputProps}\r\n                          // timeInputProps={props.timeInputProps}\r\n                          autoFocus={true}\r\n                          ampm={useAmPm}\r\n                          minutesStep={props.minutesStep}\r\n                          {...other}\r\n                        />\r\n                      )}\r\n                      {variant === 'date' && useDateDropDowns && (\r\n                        <DateDropDown\r\n                          value={dateValue}\r\n                          id={`inner-${dateInputProps.id ?? 'dateInputId'}`}\r\n                          name={`inner-${\r\n                            dateInputProps.name ?? 'dateInputName'\r\n                          }`}\r\n                          label={dateInputProps.label}\r\n                          inputVariant={'standard'}\r\n                          onChange={(val, withCompletion) => {\r\n                            setDateValue(val);\r\n                            if (withCompletion) {\r\n                              if (!validationError || validationError === '') {\r\n                                onChange(\r\n                                  setInputViewDate(\r\n                                    variant,\r\n                                    val,\r\n                                    endTime,\r\n                                    truncateTime,\r\n                                  ),\r\n                                );\r\n                                setOpen(false);\r\n                                onClose?.();\r\n                              }\r\n                            }\r\n                          }}\r\n                          onBlur={props.onBlur}\r\n                          error={props.error}\r\n                          onError={onError}\r\n                          fullWidth={props.fullWidth || true}\r\n                          helperText={props.helperText}\r\n                          disabled={props.disabled}\r\n                          placeholder={props.placeholder}\r\n                          required={props.required}\r\n                          size={props.size}\r\n                          maxDateMessage={maxDateMessage}\r\n                          minDateMessage={minDateMessage}\r\n                          invalidDateMessage={invalidDateMessage}\r\n                          // dateId={`inner-date-${props.dateId ?? 'dateId'}`}\r\n                          // timeId={`inner-time-${props.timeId ?? 'timeId'}`}\r\n                          // dateName={`inner-date-${props.dateName ?? 'dateName'}`}\r\n                          // timeName={`inner-time-${props.timeName ?? 'timeName'}`}\r\n                          // dateInputProps={props.dateInputProps}\r\n                          // timeInputProps={props.timeInputProps}\r\n                          autoFocus={true}\r\n                          {...other}\r\n                        />\r\n                      )}\r\n                    </div>\r\n                  )}\r\n\r\n                  <div className={'picker-buttons'}>\r\n                    <Button\r\n                      size=\"small\"\r\n                      disabled={!!validationError && validationError !== ''}\r\n                      onClick={ev => {\r\n                        if (!validationError || validationError === '') {\r\n                          handleSave();\r\n                        }\r\n                      }}\r\n                    >\r\n                      {t(translations.Save)}\r\n                    </Button>\r\n                    <Button\r\n                      size=\"small\"\r\n                      variant=\"white\"\r\n                      onClick={() => {\r\n                        handleClose();\r\n                      }}\r\n                    >\r\n                      {t(translations.Cancel)}\r\n                    </Button>\r\n                    {(clearable || isMobile) && (\r\n                      <Button\r\n                        size=\"small\"\r\n                        variant=\"accent\"\r\n                        className={'clearValue'}\r\n                        onClick={() => {\r\n                          setDateValue(null);\r\n                          onChange(null);\r\n                          setOpen(false);\r\n                          onClose?.();\r\n                        }}\r\n                      >\r\n                        {t(translations.Clear)}\r\n                      </Button>\r\n                    )}\r\n                  </div>\r\n                </div>\r\n              </Paper>\r\n            </Fade>\r\n          )}\r\n        </PickerPopper>\r\n      </StyledPicker>\r\n    </ClickAwayListener>\r\n  );\r\n}\r\n","import { RefObject } from 'react';\r\nimport useEventListener from './useEventListener';\r\n\r\ntype Handler = (event: KeyboardEvent) => void;\r\n\r\nexport function useKeyUpOutside<T extends HTMLElement = HTMLElement>(\r\n  ref: RefObject<T>,\r\n  handler: Handler,\r\n  keyboardEvent: 'keyup',\r\n  key: string,\r\n): void {\r\n  useEventListener(keyboardEvent, event => {\r\n    if ((event as KeyboardEvent).key === key) {\r\n      const el = ref?.current;\r\n\r\n      // Do nothing if clicking ref's element or descendent elements\r\n      if (!el || el.contains(event.target as Node)) {\r\n        return;\r\n      }\r\n\r\n      handler(event);\r\n    }\r\n  });\r\n}\r\n","import * as log from 'loglevel';\r\nimport * as prefix from 'loglevel-plugin-prefix';\r\n\r\nlog.enableAll();\r\n\r\nprefix.apply(log, {\r\n  template: '[%t] %l (%n):',\r\n  levelFormatter(level) {\r\n    return level.toUpperCase();\r\n  },\r\n  nameFormatter(name) {\r\n    return name || 'global';\r\n  },\r\n  timestampFormatter(date) {\r\n    return date.toISOString();\r\n  },\r\n});\r\n\r\nlog.setLevel(process.env.NODE_ENV === 'development' ? 'DEBUG' : 'INFO');\r\nlog.info('%s prefix', 'template');\r\n\r\nexport const getLogger = log.getLogger;\r\n","import { PeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IDatesRange } from './IDatesRange';\r\n\r\nfunction createPeriod(\r\n  now: Date,\r\n  startFn: (d: Date) => Date,\r\n  endFn: (d: Date) => Date,\r\n  addFn: (d: Date, n: number) => Date,\r\n  offset: number,\r\n): DatesRange {\r\n  const d = addFn(now, offset);\r\n  return new DatesRange({ start: startFn(d), end: endFn(d) });\r\n}\r\nexport class DatesRange implements IDatesRange {\r\n  public start: Date | null = null;\r\n  public end: Date | null = null;\r\n  constructor(t?: IDatesRange) {\r\n    this.start = t?.start ?? null;\r\n    this.end = t?.end ?? null;\r\n  }\r\n  public static fromPreset(\r\n    type: PeriodTypesEntity,\r\n    st: Date | null,\r\n    et: Date | null,\r\n  ): { start: Date | null; end: Date | null } {\r\n    const now = new Date();\r\n    switch (type.Id) {\r\n      case 'CustomDate':\r\n        return { start: st, end: et };\r\n      case 'ThisMonth':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfMonth,\r\n          dateUtils.endOfMonth,\r\n          dateUtils.addMonths,\r\n          0,\r\n        );\r\n      case 'LastMonth':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfMonth,\r\n          dateUtils.endOfMonth,\r\n          dateUtils.addMonths,\r\n          -1,\r\n        );\r\n      case 'NextMonth':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfMonth,\r\n          dateUtils.endOfMonth,\r\n          dateUtils.addMonths,\r\n          1,\r\n        );\r\n      case 'ThisQuarter':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfQuarter,\r\n          dateUtils.endOfQuarter,\r\n          dateUtils.addQuarters,\r\n          0,\r\n        );\r\n      case 'LastQuarter':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfQuarter,\r\n          dateUtils.endOfQuarter,\r\n          dateUtils.addQuarters,\r\n          -1,\r\n        );\r\n      case 'NextQuarter':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfQuarter,\r\n          dateUtils.endOfQuarter,\r\n          dateUtils.addQuarters,\r\n          1,\r\n        );\r\n      case 'ThisWeek':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfWeek,\r\n          dateUtils.endOfWeek,\r\n          dateUtils.addWeeks,\r\n          0,\r\n        );\r\n      case 'LastWeek':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfWeek,\r\n          dateUtils.endOfWeek,\r\n          dateUtils.addWeeks,\r\n          -1,\r\n        );\r\n      case 'NextWeek':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfWeek,\r\n          dateUtils.endOfWeek,\r\n          dateUtils.addWeeks,\r\n          1,\r\n        );\r\n      case 'ThisYear':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfYear,\r\n          dateUtils.endOfYear,\r\n          dateUtils.addYears,\r\n          0,\r\n        );\r\n      case 'LastYear':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfYear,\r\n          dateUtils.endOfYear,\r\n          dateUtils.addYears,\r\n          -1,\r\n        );\r\n      case 'NextYear':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfYear,\r\n          dateUtils.endOfYear,\r\n          dateUtils.addYears,\r\n          1,\r\n        );\r\n      case 'Today':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfDay,\r\n          dateUtils.endOfDay,\r\n          dateUtils.addDays,\r\n          0,\r\n        );\r\n      case 'TodayTomorrow':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfDay,\r\n          dateUtils.endOfTomorrow,\r\n          dateUtils.addDays,\r\n          0,\r\n        );\r\n      case 'Tomorrow':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfDay,\r\n          dateUtils.endOfDay,\r\n          dateUtils.addDays,\r\n          1,\r\n        );\r\n      case 'Yesterday':\r\n        return createPeriod(\r\n          now,\r\n          dateUtils.startOfDay,\r\n          dateUtils.endOfDay,\r\n          dateUtils.addDays,\r\n          -1,\r\n        );\r\n      default:\r\n        assertExhaustive(type.Id);\r\n    }\r\n  }\r\n}\r\n","import { useAppSettingsSlice } from 'app/slice';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { UserProfile } from 'utils/userProfileSettings';\r\nimport { useIsMobile } from './useIsMobile';\r\ninterface ExpandedType {\r\n  expand: (value: boolean) => void;\r\n  expandLocal: (value: boolean) => void;\r\n  toggle: () => void;\r\n}\r\nexport function userProfileComparer(\r\n  prev: readonly [UserProfile],\r\n  next: readonly [UserProfile],\r\n) {\r\n  if (!!prev[0] && !!prev[0].savedSettings) {\r\n    if (prev[0].savedSettings.length === next[0].savedSettings.length) {\r\n      let prevExpanded = prev[0].GetSideBarExpanded('SideBarExpanded');\r\n      let nextExpanded = next[0].GetSideBarExpanded('SideBarExpanded');\r\n      if (prevExpanded !== nextExpanded) {\r\n        return false;\r\n      } else {\r\n        return true;\r\n      }\r\n    } else {\r\n      return false;\r\n    }\r\n  }\r\n  return false;\r\n}\r\nfunction useExpandedSideBarState(defaultValue?: boolean): ExpandedType {\r\n  const { checkIsMobile } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const isExpanded = useSelector(state =>\r\n    selectIsExpandedSideBar(state, isMobile),\r\n  );\r\n  //const userProfileSett = useSelector(selectUserProfileSettings);\r\n  // const [expanded, setExpanded] = React.useState<boolean>(\r\n  //   !!defaultValue ? defaultValue : isExpanded,\r\n  // );\r\n  // const [lastExpandedTime, setLastExpandedTime] = React.useState<\r\n  //   number | undefined\r\n  // >(undefined);\r\n  // const userProfileSettCompared = useCustomCompareMemo(\r\n  //   () => {\r\n  //     return userProfileSett;\r\n  //   },\r\n  //   [userProfileSett],\r\n  //   userProfileComparer,\r\n  // );\r\n  // const userProfExpanded = React.useMemo<boolean | undefined>(() => {\r\n  //   return userProfileSettCompared?.GetSideBarExpanded('SideBarExpanded');\r\n  // }, [userProfileSettCompared]);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  // useEffectOnMount(() => {\r\n  //   let defaultval = isMobile\r\n  //     ? !!defaultValue\r\n  //       ? defaultValue\r\n  //       : isExpanded\r\n  //     : userProfExpanded ?? true;\r\n  //   dispatch(actions.updateExpandedState_Local(defaultval));\r\n  //   // if (isMobile) {\r\n  //   //   setExpanded(isExpanded);\r\n  //   // } else {\r\n  //   //   setExpanded(userProfExpanded ?? true);\r\n  //   // }\r\n  // });\r\n  // React.useEffect(() => {\r\n  //   if (isMobile) {\r\n  //     setExpanded(isExpanded);\r\n  //   } else {\r\n  //     setExpanded(userProfExpanded ?? true);\r\n  //   }\r\n  // }, [isExpanded, isMobile, userProfExpanded]);\r\n\r\n  const expand = React.useCallback(\r\n    (value: boolean) => {\r\n      dispatch(actions.updateExpandedState_Local(value));\r\n      if (!isMobile) {\r\n        dispatch(actions.updateExpandedState(value));\r\n      }\r\n      // if (value === true) {\r\n      //   setLastExpandedTime(new Date().getTime());\r\n      // }\r\n    },\r\n    [actions, dispatch, isMobile],\r\n  );\r\n  const expandLocal = React.useCallback(\r\n    (value: boolean) => {\r\n      dispatch(actions.updateExpandedState_Local(value));\r\n      // if (value === true) {\r\n      //   setLastExpandedTime(new Date().getTime());\r\n      // }\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const toggle = React.useCallback(() => {\r\n    dispatch(actions.updateExpandedState_Local(!isExpanded));\r\n    if (!isMobile) {\r\n      dispatch(actions.updateExpandedState(!isExpanded));\r\n    }\r\n    // if (!lastExpandedTime) {\r\n    //   dispatch(actions.updateExpandedState_Local(!isExpanded));\r\n    //   if (!isMobile) {\r\n    //     dispatch(actions.updateExpandedState(!isExpanded));\r\n    //   }\r\n    //   if (isExpanded === true) {\r\n    //     setLastExpandedTime(new Date().getTime());\r\n    //   }\r\n    // } else {\r\n    //   if (!!lastExpandedTime && new Date().getTime() - lastExpandedTime > 500) {\r\n    //     dispatch(actions.updateExpandedState_Local(!isExpanded));\r\n    //     if (!isMobile) {\r\n    //       dispatch(actions.updateExpandedState(!isExpanded));\r\n    //     }\r\n    //   }\r\n    // }\r\n  }, [actions, dispatch, isExpanded, isMobile]);\r\n\r\n  return { expand, expandLocal, toggle };\r\n}\r\n\r\nexport default useExpandedSideBarState;\r\n","/* eslint-disable prettier/prettier */\r\nimport { RowActionsProps } from 'app/components/BasicTable/RowActions';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { isEmptyOrWhitespace, toLowerCaseSafely } from 'utils/typeUtils';\r\nimport {\r\n  AuthenticatedUser,\r\n  IAuthenticatedUser,\r\n  isInRole,\r\n} from './AuthenticatedUser';\r\n\r\nexport interface SiteMapSettings {\r\n  userNodes: SiteMapNode[];\r\n  rootNode: SiteMapNode;\r\n}\r\nexport enum MainTabs {\r\n  Dashboard = 1,\r\n  Cores = 2,\r\n  Assets = 3,\r\n  RoomMap = 4,\r\n  Reservations = 5,\r\n  Trainings = 6,\r\n  Consumables = 7,\r\n  Samples = 8,\r\n  WorkOrders = 9,\r\n  LoanDesk = 10,\r\n  Eln = 11,\r\n  Colonies = 12,\r\n  Budgets = 13,\r\n  Billing = 14,\r\n  Messages = 15,\r\n  Users = 16,\r\n  Suppliers = 17,\r\n  Expenses = 18,\r\n  LargeAnimals = 19,\r\n  Reports = 20,\r\n  SystemSettings = 21,\r\n}\r\nexport type MainTabsUnion = keyof typeof MainTabs;\r\nexport const MainTabsUnionArray: Array<MainTabsUnion> = [\r\n  'Dashboard',\r\n  'Cores',\r\n  'Assets',\r\n  'RoomMap',\r\n  'Reservations',\r\n  'Trainings',\r\n  'Consumables',\r\n  'Samples',\r\n  'WorkOrders',\r\n  'LoanDesk',\r\n  'Eln',\r\n  'Colonies',\r\n  'Budgets',\r\n  'Billing',\r\n  'Messages',\r\n  'Users',\r\n  'Suppliers',\r\n  'Expenses',\r\n  'LargeAnimals',\r\n  'Reports',\r\n  'SystemSettings',\r\n];\r\nexport enum AssetsSubTab {\r\n  AssetsTabSetting = 1,\r\n  InstrumentsTabSettings = 2,\r\n  LocationsTabSettings = 3,\r\n}\r\nexport type AssetsSubTabUnion = keyof typeof AssetsSubTab;\r\nexport const AssetsSubTabUnionArray: Array<AssetsSubTabUnion> = [\r\n  'AssetsTabSetting',\r\n  'InstrumentsTabSettings',\r\n  'LocationsTabSettings',\r\n];\r\nexport interface SiteMapNode {\r\n  Roles?: string[];\r\n  HasChildNodes: boolean;\r\n  Key?: string;\r\n  ResourceKey?: string;\r\n  Title: string;\r\n  Description?: string;\r\n  RootNode: SiteMapNode | null;\r\n  Url: string;\r\n  ChildNodes: SiteMapNode[];\r\n  icon?: string;\r\n  reactUrl: string;\r\n  HideReact: boolean;\r\n  isAdminNode: boolean;\r\n  ParentNode: SiteMapNode | null;\r\n  Hide: boolean;\r\n  LinkWithChildren?: string | null;\r\n  MainTab?: string;\r\n  SubTab?: string;\r\n  IsAdminSettings?: boolean;\r\n  GroupTab?: number;\r\n  IsLastTab?: boolean;\r\n}\r\nexport const NoAuthNodes = (t: TFunction): SiteMapNode[] => {\r\n  return [\r\n    {\r\n      Roles: [],\r\n      HasChildNodes: false,\r\n      Key: undefined,\r\n      ResourceKey: undefined,\r\n      Title: t(translations.reg_NewUserRegistration) as string,\r\n      Description: undefined,\r\n      RootNode: null,\r\n      Url: '/RegisterAccount',\r\n      ChildNodes: [],\r\n      icon: undefined,\r\n      reactUrl: '/RegisterAccount',\r\n      HideReact: false,\r\n      isAdminNode: false,\r\n      ParentNode: null,\r\n      Hide: false,\r\n      MainTab: undefined,\r\n      SubTab: undefined,\r\n      IsAdminSettings: false,\r\n      GroupTab: undefined,\r\n    },\r\n    {\r\n      Roles: [],\r\n      HasChildNodes: false,\r\n      Key: undefined,\r\n      ResourceKey: undefined,\r\n      Title: t(translations.reg_NewUserRegistration) as string,\r\n      Description: undefined,\r\n      RootNode: null,\r\n      Url: '/Assets/Public',\r\n      ChildNodes: [],\r\n      icon: undefined,\r\n      reactUrl: '/Assets/Public',\r\n      HideReact: false,\r\n      isAdminNode: false,\r\n      ParentNode: null,\r\n      Hide: false,\r\n      MainTab: undefined,\r\n      SubTab: undefined,\r\n      IsAdminSettings: false,\r\n      GroupTab: undefined,\r\n    },\r\n    {\r\n      Roles: [],\r\n      HasChildNodes: false,\r\n      Key: undefined,\r\n      ResourceKey: undefined,\r\n      Title: t(translations.reg_NewUserRegistration) as string,\r\n      Description: undefined,\r\n      RootNode: null,\r\n      Url: '/Assets/Details',\r\n      ChildNodes: [],\r\n      icon: undefined,\r\n      reactUrl: '/Assets/Details',\r\n      HideReact: false,\r\n      isAdminNode: false,\r\n      ParentNode: null,\r\n      Hide: false,\r\n      MainTab: undefined,\r\n      SubTab: undefined,\r\n      IsAdminSettings: false,\r\n      GroupTab: undefined,\r\n    },\r\n  ] as SiteMapNode[];\r\n};\r\n\r\nexport class SiteMapProvider {\r\n  settings: SiteMapSettings | null;\r\n  constructor(sett: SiteMapSettings | null) {\r\n    this.settings = sett;\r\n  }\r\n  // public getAdminNodes(): SiteMapNode[] {\r\n  //   if (\r\n  //     !!this.settings &&\r\n  //     this.settings !== null &&\r\n  //     !!this.settings.adminNodes\r\n  //   ) {\r\n  //     //console.log('adminNodes', this.settings.adminNodes);\r\n  //     return this.settings.adminNodes;\r\n  //   } else {\r\n  //     //console.log('empty admin nodes');\r\n  //     return [] as SiteMapNode[];\r\n  //   }\r\n  // }\r\n  public getUserNodes(): SiteMapNode[] {\r\n    if (\r\n      !!this.settings &&\r\n      this.settings !== null &&\r\n      !!this.settings.userNodes\r\n    ) {\r\n      //console.log('userNodes', this.settings.userNodes);\r\n      return this.settings.userNodes;\r\n    } else {\r\n      //console.log('empty user nodes');\r\n      return [] as SiteMapNode[];\r\n    }\r\n  }\r\n  public getCurrentMainNode(pathname: string): SiteMapNode | undefined {\r\n    let node: SiteMapNode[] | undefined = undefined;\r\n    let searchItem = pathname;\r\n    if (!!this.settings && this.settings != null) {\r\n      node = this.settings.userNodes\r\n        .filter(f => f.Hide === false)\r\n        .filter((item, index) => {\r\n          if (item.ChildNodes.length > 0) {\r\n            let irurl = toLowerCaseSafely(item.reactUrl);\r\n\r\n            return (\r\n              item.ChildNodes.filter(chitem => {\r\n                let rurl = toLowerCaseSafely(chitem.reactUrl);\r\n                if (rurl !== null) {\r\n                  let rpath = rurl.split('?')[0] ?? rurl;\r\n                  return searchItem.toLowerCase().indexOf(rpath) > -1;\r\n                } else {\r\n                  return chitem.Url.toLowerCase().indexOf(searchItem) > -1;\r\n                }\r\n              }).length > 0 ||\r\n              (irurl !== null\r\n                ? searchItem\r\n                    .toLowerCase()\r\n                    .indexOf(irurl.split('?')[0] ?? irurl) > -1\r\n                : item.Url.toLowerCase().indexOf(searchItem) > -1) === true\r\n            );\r\n          } else {\r\n            let irurl = toLowerCaseSafely(item.reactUrl);\r\n            let prurl =\r\n              item.ParentNode !== null\r\n                ? toLowerCaseSafely(item.ParentNode.reactUrl)\r\n                : null;\r\n            let purl = item.ParentNode !== null ? item.ParentNode.Url : null;\r\n            return (\r\n              (irurl !== null\r\n                ? searchItem\r\n                    .toLowerCase()\r\n                    .indexOf(irurl.split('?')[0] ?? irurl) > -1\r\n                : item.Url.toLowerCase().indexOf(searchItem) > -1) === true ||\r\n              (item.ParentNode !== null && prurl !== null\r\n                ? searchItem\r\n                    .toLowerCase()\r\n                    .indexOf(prurl.split('?')[0] ?? prurl) > -1\r\n                : purl !== null\r\n                ? purl.toLowerCase().indexOf(searchItem) > -1\r\n                : false)\r\n            );\r\n          }\r\n        });\r\n    }\r\n    // There may be multiple results.\r\n    // This happens when the react page is selected.\r\n    // It is necessary to choose the result whose reactUrl length is longer.\r\n    if (node !== undefined && node.length > 0) {\r\n      let res: SiteMapNode | undefined = node[0];\r\n      if (node.length > 1) {\r\n        var rurl = '';\r\n        node.forEach(item => {\r\n          item.ChildNodes.forEach(chitem => {\r\n            let rurl1 = toLowerCaseSafely(chitem.reactUrl);\r\n            if (rurl1 !== null) {\r\n              let rpath = rurl1.split('?')[0] ?? rurl1;\r\n              if (searchItem.toLowerCase().indexOf(rpath) > -1) {\r\n                if (rpath.length > rurl.length) {\r\n                  res = item;\r\n                  rurl = rpath;\r\n                }\r\n              }\r\n            }\r\n          });\r\n        });\r\n      }\r\n      //console.log('getCurrentNode', node);\r\n      return res;\r\n    } else {\r\n      return undefined;\r\n    }\r\n  }\r\n  public currentMainNodeIsAdmin(pathname: string): boolean | undefined {\r\n    let isAdmin = this.getCurrentMainNode(pathname)?.isAdminNode;\r\n    //console.log('isAdmin', isAdmin);\r\n    return isAdmin;\r\n  }\r\n  public getCurrentNodes(pathname: string): SiteMapNode[] {\r\n    return this.getUserNodes().filter(f => f.Hide === false);\r\n    // let isAdmin = this.currentMainNodeIsAdmin(pathname);\r\n    // if (isAdmin) {\r\n    //   return this.getAdminNodes().filter(f => f.Hide === false);\r\n    // } else {\r\n    //   return this.getUserNodes().filter(f => f.Hide === false);\r\n    // }\r\n  }\r\n  public findNode(pathname: string): SiteMapNode | undefined {\r\n    let node: SiteMapNode | undefined = undefined;\r\n    if (!!this.settings && this.settings != null) {\r\n      let parentNodes = this.settings.userNodes;\r\n      let childNodes = this.settings.userNodes.map(f => f.ChildNodes).flat();\r\n      const currentPathNameLowered = pathname.toLowerCase();\r\n      // first try exact match node\r\n      node = childNodes.find(element => {\r\n        const elementURL = element.reactUrl ?? element.Url;\r\n        const [elementPathName] = elementURL.split('?');\r\n        return currentPathNameLowered === elementPathName?.toLowerCase();\r\n      });\r\n      // then if no exact match was found - try the indexOf for whatever reason it was done originally\r\n      if (!node) {\r\n        childNodes.find(element => {\r\n          if (element !== undefined) {\r\n            const reactUrl = toLowerCaseSafely(element.reactUrl);\r\n\r\n            if (reactUrl !== null) {\r\n              let rpath = reactUrl.split('?')[0] ?? reactUrl;\r\n              //return pathname.toLowerCase() === rpath;\r\n              return pathname.toLowerCase().indexOf(rpath) > -1;\r\n            } else {\r\n              return (\r\n                element.Url.toLowerCase().indexOf(pathname.toLowerCase()) > -1\r\n              );\r\n            }\r\n          }\r\n          return undefined;\r\n        });\r\n      }\r\n      if (!node) {\r\n        node = parentNodes.find(element => {\r\n          if (element !== undefined) {\r\n            const reactUrl = toLowerCaseSafely(element.reactUrl);\r\n            if (reactUrl !== null) {\r\n              let rpath = reactUrl.split('?')[0] ?? reactUrl;\r\n              //return pathname.toLowerCase() === rpath;\r\n              return pathname.toLowerCase().indexOf(rpath) > -1;\r\n            } else {\r\n              return (\r\n                element.Url.toLowerCase().indexOf(pathname.toLowerCase()) > -1\r\n              );\r\n            }\r\n          }\r\n          return undefined;\r\n        });\r\n      }\r\n    }\r\n    return node;\r\n  }\r\n  public updatePath(pathname: string | undefined, newSearch: string) {\r\n    if (!!this.settings && this.settings != null && pathname) {\r\n      this.getCurrentNodes(pathname)\r\n        .map(f => f.ChildNodes)\r\n        .flat()\r\n        .forEach(element => {\r\n          if (element !== undefined) {\r\n            const reactUrl = element.reactUrl;\r\n            if (reactUrl !== undefined && reactUrl !== null) {\r\n              const elementPath = reactUrl.split('?')[0] ?? reactUrl;\r\n              if (elementPath === pathname) {\r\n                element.reactUrl = `${pathname}?${newSearch}`;\r\n                element.Url = `${pathname}?${newSearch}`;\r\n              }\r\n            }\r\n          }\r\n        });\r\n    }\r\n  }\r\n  public accesibleByRole(pathname: string, user?: IAuthenticatedUser): boolean {\r\n    if (user) {\r\n      let currentNode = this.findNode(pathname);\r\n      if (currentNode) {\r\n        if (currentNode.Roles && currentNode.Roles.length > 0) {\r\n          return (\r\n            currentNode.Roles.filter(item => isInRole(user, item)).length > 0\r\n          );\r\n        } else if (\r\n          currentNode.ParentNode !== null &&\r\n          currentNode.ParentNode.Roles &&\r\n          currentNode.ParentNode.Roles.length > 0\r\n        ) {\r\n          return (\r\n            currentNode.ParentNode.Roles.filter(item => isInRole(user, item))\r\n              .length > 0\r\n          );\r\n        }\r\n      }\r\n    }\r\n    return false;\r\n  }\r\n  public nodeAccesibleByRole(\r\n    node: SiteMapNode,\r\n    user?: AuthenticatedUser,\r\n  ): boolean {\r\n    if (user) {\r\n      if (node) {\r\n        if (node.Roles && node.Roles.length > 0) {\r\n          if(user?.Roles.includes(Roles.CustomRole) && node.Roles.filter(item => isInRole(user, item)).length > 0){\r\n            return user?.HasCustomRoleUrlPermission(node.Url);\r\n          }\r\n          return node.Roles.filter(item => isInRole(user, item)).length > 0;\r\n        } else if (\r\n          node.ParentNode !== null &&\r\n          node.ParentNode.Roles &&\r\n          node.ParentNode.Roles.length > 0\r\n        ) {\r\n          if(user?.Roles.includes(Roles.CustomRole) && node.ParentNode.Roles.filter(item => isInRole(user, item)).length > 0){\r\n            return user?.HasCustomRoleUrlPermission(node.ParentNode.Url);\r\n          }\r\n          return (\r\n            node.ParentNode.Roles.filter(item => isInRole(user, item)).length > 0\r\n          );\r\n        } else {\r\n          return true;\r\n        }\r\n      }\r\n    }\r\n    return false;\r\n  }\r\n  public findMainTabNode(menuTab: MainTabsUnion) {\r\n    let filtered = this.getUserNodes().filter(\r\n      f => f.Hide === false && !!f.MainTab && f.MainTab === menuTab,\r\n    );\r\n    if (!!filtered && filtered.length > 0) {\r\n      return filtered[0];\r\n    }\r\n    return undefined;\r\n  }\r\n  public adminSettingsNodes(node: SiteMapNode, user?: AuthenticatedUser) {\r\n    let result: SiteMapNode[] = [];\r\n    const isAdmin =\r\n      isInRole(user, Roles.Administrators) ||\r\n      isInRole(user, Roles.GroupAdministrators) ||\r\n      isInRole(user, Roles.EquipmentAdministrator) ||\r\n      isInRole(user, Roles.CustomRole);\r\n    if (\r\n      isAdmin &&\r\n      node.ChildNodes.length > 0 &&\r\n      !!node.MainTab &&\r\n      node.ChildNodes.some(f => f.IsAdminSettings)\r\n    ) {\r\n      let filtered = node.ChildNodes.filter(\r\n        f => f.IsAdminSettings && this.nodeAccesibleByRole(f, user),\r\n      ).map((it, index) => {\r\n        return it;\r\n      });\r\n      return filtered;\r\n    }\r\n    return result;\r\n  }\r\n  public adminSettingsActions(\r\n    menuTab: MainTabsUnion,\r\n    user?: AuthenticatedUser,\r\n    subTab?: any,\r\n    action?: (link: string) => void,\r\n  ) {\r\n    let result: RowActionsProps[] = [];\r\n    const isAdmin =\r\n      isInRole(user, Roles.Administrators) ||\r\n      isInRole(user, Roles.GroupAdministrators) ||\r\n      isInRole(user, Roles.EquipmentAdministrator) ||\r\n      isInRole(user, Roles.CustomRole);\r\n    let node = this.findMainTabNode(menuTab);\r\n    if (\r\n      isAdmin &&\r\n      !!node &&\r\n      node.ChildNodes.length > 0 &&\r\n      !!node.MainTab &&\r\n      node.ChildNodes.some(f => f.IsAdminSettings)\r\n    ) {\r\n      let filtered = node.ChildNodes.filter(\r\n        f =>\r\n          f.IsAdminSettings &&\r\n          this.nodeAccesibleByRole(f, user) &&\r\n          (!subTab || (!isEmptyOrWhitespace(subTab) && subTab === f.SubTab)),\r\n      ).map((it, index) => {\r\n        return it;\r\n      });\r\n      if (!!filtered && filtered.length > 0) {\r\n        let subTabTitle =\r\n          filtered.filter(f => !!f.SubTab).length > 0\r\n            ? filtered.filter(f => !!f.SubTab)[0].SubTab\r\n            : 'Settings';\r\n        result.push({\r\n          localizedText: subTabTitle === 'Settings' ? undefined : subTabTitle,\r\n          text: subTabTitle === 'Settings' ? subTabTitle : '',\r\n          icon: 'circle',\r\n          renderAsTitle: true,\r\n        });\r\n        filtered.forEach((item, index) => {\r\n          result.push({\r\n            href:\r\n              !action && isEmptyOrWhitespace(item.reactUrl)\r\n                ? item.Url\r\n                : undefined,\r\n            to: !isEmptyOrWhitespace(item.reactUrl) ? item.reactUrl : undefined,\r\n            text: item.Title,\r\n            icon: 'circle-small',\r\n            onClick:\r\n              !!action && isEmptyOrWhitespace(item.reactUrl)\r\n                ? () => action(item.Url)\r\n                : undefined,\r\n          } as RowActionsProps);\r\n        });\r\n      }\r\n    }\r\n    return result;\r\n  }\r\n}\r\n","import { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport {\r\n  RepeatMonthlyBy,\r\n  RepeatPeriod,\r\n  RepetitiveOptions,\r\n} from 'enums/RepetitiveOptions';\r\nimport { WorkWeekDays } from 'enums/WorkWeekDays';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { dateUtils, WeekStartsOn } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { Entity } from './common';\r\nimport { Timestamp } from './Timestamp';\r\n\r\nexport interface IRepetitiveDto {\r\n  StartDate?: Date | string;\r\n  RecurringEvents?: Entity<number> | null;\r\n  RecurringEndDate?: Date | string;\r\n  RepeatsEveryDay?: Entity<number> | null;\r\n  RepeatsEveryPeriod?: Entity<number> | null;\r\n  RepeatsMonthlyBy?: Entity<number> | null;\r\n  RepeatsOnDays: CheckEntity[];\r\n}\r\nexport interface RepetitiveIntervals {\r\n  start: Date;\r\n  end: Date;\r\n}\r\nexport const ShortWeekDays = (): CheckEntity[] => {\r\n  return dateUtils.getShortDaysArray().map((day, index) => {\r\n    return {\r\n      Id: index + 1,\r\n      Name: day,\r\n      checked: false,\r\n    } as CheckEntity;\r\n  });\r\n};\r\nexport const LongWeekDays = (): CheckEntity[] => {\r\n  return dateUtils.getLongDaysArray().map((day, index) => {\r\n    return {\r\n      Id: index + 1,\r\n      Name: day,\r\n      checked: false,\r\n    } as CheckEntity;\r\n  });\r\n};\r\nexport const RepetitiveInit = (\r\n  date?: Date | string,\r\n  option?: number,\r\n): IRepetitiveDto => {\r\n  const startDate = dateUtils.dateOrStringToDate(date || new Date());\r\n  const untilDate = dateUtils.dateFnsUtils.addDays(startDate, 7);\r\n  return {\r\n    StartDate: dateUtils.formatISO(dateUtils.dateOrStringToDate(startDate)),\r\n    RecurringEvents: enumToEntityArray(RepetitiveOptions)[option ?? 0],\r\n    RepeatsOnDays: ShortWeekDays().map(f => {\r\n      if (f.Id === 1) f.checked = true;\r\n      return f;\r\n    }),\r\n    RecurringEndDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(untilDate),\r\n    ),\r\n    RepeatsEveryDay: { Id: 1, Name: '1' } as Entity<number>,\r\n    RepeatsEveryPeriod: enumToEntityArray(RepeatPeriod)[1],\r\n    RepeatsMonthlyBy: enumToEntityArray(RepeatMonthlyBy)[0],\r\n  };\r\n};\r\nexport const GetAutoCreateTitle = (\r\n  type: IWorkOrderTypeDto,\r\n  eventStart: Date | Timestamp | null,\r\n  firstDayOfWeek: WeekStartsOn,\r\n): string | undefined => {\r\n  let title: string | undefined = undefined;\r\n  if (type.AutoCreateEvent && type.AutoCreateFor !== 0) {\r\n    if (type.RepetitiveOptions > 0) {\r\n      switch (type.RepetitiveOptions) {\r\n        case RepetitiveOptions.RepeatCustom:\r\n          let periodName = enumToEntityArray(RepeatPeriod).filter(\r\n            f => f.Id === type.RepeatsEveryType,\r\n          )[0].Name;\r\n          if (type.RepeatsEveryType === RepeatPeriod.Days) {\r\n            title = `Repeats every ${type.RepeatsEveryNum} - ${periodName}`;\r\n          } else if (type.RepeatsEveryType === RepeatPeriod.Weeks) {\r\n            title = `Repeats every ${type.RepeatsEveryNum} - ${periodName} on ${\r\n              LongWeekDays().filter(f => f.Id.toString() === type.RepeatsOn)[0]\r\n                .Name\r\n            }`;\r\n          } else {\r\n            title = `Repeats every ${type.RepeatsEveryNum} - ${periodName} by ${\r\n              enumToEntityArray(RepeatMonthlyBy).filter(\r\n                f => f.Id === type.RepeatsBy,\r\n              )[0].Name\r\n            }`;\r\n          }\r\n          break;\r\n        case RepetitiveOptions.RepeatDaily:\r\n          title = 'Repeats Daily';\r\n          break;\r\n        case RepetitiveOptions.RepeatWeeklyOn:\r\n          title = `Repeats ${i18next\r\n            .t(translations.RepeatWeeklyOn)\r\n            .replace(\r\n              '{0}',\r\n              dateUtils.getDayText(\r\n                dateUtils.parseISOOrNull(eventStart) ?? new Date(),\r\n              ),\r\n            )}`;\r\n          break;\r\n        case RepetitiveOptions.RepeatMonthlyOn:\r\n          let weekName = i18next.t(\r\n            enumToEntityArray(WorkWeekDays).filter(\r\n              f =>\r\n                dateUtils.getWeekNumberOfMonth(\r\n                  dateUtils.parseISOOrNull(eventStart) ?? new Date(),\r\n                  firstDayOfWeek,\r\n                ) === f.Id,\r\n            )[0].Name,\r\n          );\r\n          title = `Repeats ${i18next\r\n            .t(translations.RepeatMonthlyOn)\r\n            .replace('{0}', weekName)\r\n            .replace(\r\n              '{1}',\r\n              dateUtils.getDayText(\r\n                dateUtils.parseISOOrNull(eventStart) ?? new Date(),\r\n              ),\r\n            )}`;\r\n          break;\r\n        case RepetitiveOptions.RepeatEveryWeekDay:\r\n          let weekDays = `${\r\n            dateUtils.getLongDaysArray()[firstDayOfWeek as number]\r\n          } - ${\r\n            dateUtils.getLongDaysArray()[\r\n              dateUtils.getLongDaysArray().length - 2\r\n            ]\r\n          }`;\r\n          title = `Repeats ${i18next\r\n            .t(translations.RepeatEveryWeekDay)\r\n            .replace('{0}', weekDays)}`;\r\n          break;\r\n      }\r\n    }\r\n  }\r\n  return title;\r\n};\r\nexport const GetIntervals = (\r\n  start: Date,\r\n  data: IRepetitiveDto,\r\n  firstDayOfWeek?: number,\r\n): Date[] => {\r\n  let dates: Date[] = [];\r\n  if (start && data.RecurringEndDate) {\r\n    let originStart = dateUtils.dateOrStringToDate(start);\r\n    let originalEnd = dateUtils.dateOrStringToDate(data.RecurringEndDate);\r\n    if (data.RecurringEvents && data.RecurringEvents !== null) {\r\n      if (\r\n        data.RecurringEvents.Id !== (RepetitiveOptions.DoNotRepeat as number)\r\n      ) {\r\n        switch (data.RecurringEvents.Id) {\r\n          case RepetitiveOptions.RepeatDaily as number:\r\n            let days = dateUtils.differenceInCalendarDays(\r\n              originalEnd,\r\n              originStart,\r\n            );\r\n            dates = [...Array(days + 1).keys()].map(i =>\r\n              dateUtils.addDays(originStart, i),\r\n            );\r\n            break;\r\n          case RepetitiveOptions.RepeatWeeklyOn as number:\r\n            dates.push(originStart);\r\n            let nextWeek = dateUtils.addWeeks(originStart, 1);\r\n            while (nextWeek < originalEnd) {\r\n              dates.push(nextWeek);\r\n              nextWeek = dateUtils.addWeeks(nextWeek, 1);\r\n            }\r\n            break;\r\n          case RepetitiveOptions.RepeatMonthlyOn as number:\r\n            // let week = dateUtils.getWeekNumberOfMonth(\r\n            //   originStart,\r\n            //   firstDayOfWeek,\r\n            // );\r\n            dates.push(originStart);\r\n            let dayWeek = dateUtils.getDay(originStart);\r\n            let newMonthDate = dateUtils.addMonths(originStart, 1);\r\n            let newDayWeek = dateUtils.getDay(newMonthDate);\r\n            let calcDay =\r\n              dayWeek >= newDayWeek\r\n                ? dayWeek - newDayWeek\r\n                : 7 - (newDayWeek - dayWeek);\r\n            let checkDate = dateUtils.addDays(newMonthDate, calcDay);\r\n            if (checkDate.getMonth() > newMonthDate.getMonth()) {\r\n              newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n            } else if (checkDate.getMonth() === newMonthDate.getMonth()) {\r\n              if (\r\n                checkDate.getDate() > newMonthDate.getDate() &&\r\n                (dateUtils.addDays(newMonthDate, calcDay - 7).getFullYear() ===\r\n                checkDate.getFullYear()\r\n                  ? !(\r\n                      dateUtils.addDays(newMonthDate, calcDay - 7).getMonth() <\r\n                      checkDate.getMonth()\r\n                    )\r\n                  : dateUtils.addDays(newMonthDate, calcDay - 7).getMonth() <\r\n                    checkDate.getMonth())\r\n              ) {\r\n                newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n              } else {\r\n                newMonthDate = checkDate;\r\n              }\r\n            } else {\r\n              newMonthDate = checkDate;\r\n            }\r\n            //newMonth = dateUtils.setWeek(newMonth, week, firstDayOfWeek);\r\n            //newMonth = dateUtils.setDay(newMonth, dayWeek, firstDayOfWeek);\r\n            let counter = 1;\r\n            while (newMonthDate <= originalEnd) {\r\n              dates.push(newMonthDate);\r\n              counter++;\r\n              newMonthDate = dateUtils.addMonths(originStart, counter);\r\n              let newDayWeek = dateUtils.getDay(newMonthDate);\r\n              let calcDay =\r\n                dayWeek >= newDayWeek\r\n                  ? dayWeek - newDayWeek\r\n                  : 7 - (newDayWeek - dayWeek);\r\n              let checkDate = dateUtils.addDays(newMonthDate, calcDay);\r\n              if (checkDate.getMonth() > newMonthDate.getMonth()) {\r\n                newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n              } else if (checkDate.getMonth() === newMonthDate.getMonth()) {\r\n                if (\r\n                  checkDate.getDate() > newMonthDate.getDate() &&\r\n                  (dateUtils\r\n                    .addDays(newMonthDate, calcDay - 7)\r\n                    .getFullYear() === checkDate.getFullYear()\r\n                    ? !(\r\n                        dateUtils\r\n                          .addDays(newMonthDate, calcDay - 7)\r\n                          .getMonth() < checkDate.getMonth()\r\n                      )\r\n                    : dateUtils.addDays(newMonthDate, calcDay - 7).getMonth() <\r\n                      checkDate.getMonth())\r\n                ) {\r\n                  newMonthDate = dateUtils.addDays(newMonthDate, calcDay - 7);\r\n                } else {\r\n                  newMonthDate = checkDate;\r\n                }\r\n              } else {\r\n                newMonthDate = checkDate;\r\n              }\r\n            }\r\n            break;\r\n          case RepetitiveOptions.RepeatEveryWeekDay as number:\r\n            dates.push(originStart);\r\n            let theDay = dateUtils.getDay(originStart);\r\n            let firstDay = dateUtils.getDay(\r\n              dateUtils.startOfWeek(originStart, firstDayOfWeek),\r\n            );\r\n            let lastDay = firstDay + 4;\r\n\r\n            let day =\r\n              (theDay > firstDay && theDay < lastDay) || theDay === firstDay\r\n                ? 1\r\n                : 3;\r\n            let newDay = dateUtils.addDays(originStart, day);\r\n            while (newDay <= originalEnd) {\r\n              dates.push(newDay);\r\n              let theDay = dateUtils.getDay(newDay);\r\n              let day =\r\n                (theDay > firstDay && theDay < lastDay) || theDay === firstDay\r\n                  ? 1\r\n                  : 3;\r\n              newDay = dateUtils.addDays(newDay, day);\r\n            }\r\n            break;\r\n          case RepetitiveOptions.RepeatCustom as number:\r\n            if (\r\n              data.RepeatsEveryDay !== null &&\r\n              data.RepeatsEveryPeriod !== null\r\n            ) {\r\n              let period =\r\n                (data.RepeatsEveryPeriod?.Id as RepeatPeriod) ||\r\n                RepeatPeriod.Weeks;\r\n              let everyDayNum = data.RepeatsEveryDay?.Id || 1;\r\n              switch (period) {\r\n                case RepeatPeriod.Days:\r\n                  dates.push(originStart);\r\n                  let newDay = dateUtils.addDays(originStart, everyDayNum);\r\n                  while (newDay <= originalEnd) {\r\n                    dates.push(newDay);\r\n                    newDay = dateUtils.addDays(newDay, everyDayNum);\r\n                  }\r\n                  break;\r\n                case RepeatPeriod.Weeks:\r\n                  dates.push(originStart);\r\n                  let days = data.RepeatsOnDays.filter(f => f.checked === true)\r\n                    .map(m => m.Id - 1)\r\n                    .sort((a, b) => a - b);\r\n                  let theDay = dateUtils.getDay(originStart);\r\n                  let nextDay =\r\n                    days.filter(f => f > theDay).length > 0\r\n                      ? days.filter(f => f > theDay)[0]\r\n                      : days[0];\r\n                  let daysToAdd =\r\n                    nextDay >= theDay\r\n                      ? nextDay - theDay === 0\r\n                        ? 7 * everyDayNum\r\n                        : nextDay - theDay\r\n                      : 7 * everyDayNum - (theDay - nextDay);\r\n\r\n                  let newDayDate = dateUtils.addDays(originStart, daysToAdd);\r\n                  while (newDayDate <= originalEnd) {\r\n                    dates.push(newDayDate);\r\n                    let mtheDay = dateUtils.getDay(newDayDate);\r\n                    let mnextDay =\r\n                      days.filter(f => f > mtheDay).length > 0\r\n                        ? days.filter(f => f > mtheDay)[0]\r\n                        : days[0];\r\n                    let mdaysToAdd =\r\n                      mnextDay >= mtheDay\r\n                        ? mnextDay - mtheDay === 0\r\n                          ? 7 * everyDayNum\r\n                          : mnextDay - mtheDay\r\n                        : 7 * everyDayNum - (mtheDay - mnextDay);\r\n\r\n                    newDayDate = dateUtils.addDays(newDayDate, mdaysToAdd);\r\n                  }\r\n                  break;\r\n                case RepeatPeriod.Months:\r\n                  let monthlyBy =\r\n                    (data.RepeatsMonthlyBy?.Id as RepeatMonthlyBy) ||\r\n                    RepeatMonthlyBy.RepeatsBy_DayOfMonth;\r\n                  switch (monthlyBy) {\r\n                    case RepeatMonthlyBy.RepeatsBy_DayOfMonth:\r\n                      dates.push(originStart);\r\n                      let monthDay = dateUtils.getDate(originStart);\r\n                      let newMonthDate = dateUtils.addMonths(\r\n                        originStart,\r\n                        everyDayNum,\r\n                      );\r\n                      dateUtils.setDate(newMonthDate, monthDay);\r\n                      while (newMonthDate <= originalEnd) {\r\n                        dates.push(newMonthDate);\r\n                        newMonthDate = dateUtils.addMonths(\r\n                          newMonthDate,\r\n                          everyDayNum,\r\n                        );\r\n                        dateUtils.setDate(newMonthDate, monthDay);\r\n                      }\r\n                      break;\r\n                    case RepeatMonthlyBy.RepeatsBy_DayOfWeek:\r\n                      dates.push(originStart);\r\n                      let dayWeek = dateUtils.getDay(originStart);\r\n                      let newMonth = dateUtils.addMonths(\r\n                        originStart,\r\n                        everyDayNum,\r\n                      );\r\n                      let newDayWeek = dateUtils.getDay(newMonth);\r\n                      let calcDay =\r\n                        dayWeek >= newDayWeek\r\n                          ? dayWeek - newDayWeek\r\n                          : 7 - (newDayWeek - dayWeek);\r\n                      let checkDate = dateUtils.addDays(newMonth, calcDay);\r\n                      if (checkDate.getMonth() > newMonth.getMonth()) {\r\n                        newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n                      } else if (checkDate.getMonth() === newMonth.getMonth()) {\r\n                        if (\r\n                          checkDate.getDate() > newMonth.getDate() &&\r\n                          (dateUtils\r\n                            .addDays(newMonth, calcDay - 7)\r\n                            .getFullYear() === checkDate.getFullYear()\r\n                            ? !(\r\n                                dateUtils\r\n                                  .addDays(newMonth, calcDay - 7)\r\n                                  .getMonth() < checkDate.getMonth()\r\n                              )\r\n                            : dateUtils\r\n                                .addDays(newMonth, calcDay - 7)\r\n                                .getMonth() < checkDate.getMonth())\r\n                        ) {\r\n                          newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n                        } else {\r\n                          newMonth = checkDate;\r\n                        }\r\n                      } else {\r\n                        newMonth = checkDate;\r\n                      }\r\n                      let counter = everyDayNum;\r\n                      while (newMonth <= originalEnd) {\r\n                        dates.push(newMonth);\r\n                        counter += everyDayNum;\r\n                        newMonth = dateUtils.addMonths(originStart, counter);\r\n                        let newDayWeek = dateUtils.getDay(newMonth);\r\n                        let calcDay =\r\n                          dayWeek >= newDayWeek\r\n                            ? dayWeek - newDayWeek\r\n                            : 7 - (newDayWeek - dayWeek);\r\n                        let checkDate = dateUtils.addDays(newMonth, calcDay);\r\n                        if (checkDate.getMonth() > newMonth.getMonth()) {\r\n                          newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n                        } else if (\r\n                          checkDate.getMonth() === newMonth.getMonth()\r\n                        ) {\r\n                          if (\r\n                            checkDate.getDate() > newMonth.getDate() &&\r\n                            (dateUtils\r\n                              .addDays(newMonth, calcDay - 7)\r\n                              .getFullYear() === checkDate.getFullYear()\r\n                              ? !(\r\n                                  dateUtils\r\n                                    .addDays(newMonth, calcDay - 7)\r\n                                    .getMonth() < checkDate.getMonth()\r\n                                )\r\n                              : dateUtils\r\n                                  .addDays(newMonth, calcDay - 7)\r\n                                  .getMonth() < checkDate.getMonth())\r\n                          ) {\r\n                            newMonth = dateUtils.addDays(newMonth, calcDay - 7);\r\n                          } else {\r\n                            newMonth = checkDate;\r\n                          }\r\n                        } else {\r\n                          newMonth = checkDate;\r\n                        }\r\n                      }\r\n                      break;\r\n                  }\r\n              }\r\n            }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  return dates;\r\n};\r\n","export const box_shadow_xs: React.CSSProperties['boxShadow'] =\r\n  '0px 1px 2px 0px rgba(16, 24, 40, 0.10), 0px 1px 3px 0px rgba(16, 24, 40, 0.10)';\r\nexport const box_shadow_s: React.CSSProperties['boxShadow'] =\r\n  '0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10)';\r\nexport const box_shadow_m: React.CSSProperties['boxShadow'] =\r\n  '0px 4px 4px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08)';\r\nexport const box_shadow_l: React.CSSProperties['boxShadow'] =\r\n  '0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08)';\r\nexport const box_shadow_xl: React.CSSProperties['boxShadow'] =\r\n  '0px 24px 48px -12px rgba(16, 24, 40, 0.18)';\r\nexport const box_shadow_border_top: React.CSSProperties['boxShadow'] =\r\n  '0px 1px 0px 0px #E3E8EF inset';\r\n\r\nexport const bookitShadows = {\r\n  shadowXS: box_shadow_xs,\r\n  shadowS: box_shadow_s,\r\n  shadowM: box_shadow_m,\r\n  shadowL: box_shadow_l,\r\n  shadowXL: box_shadow_xl,\r\n  shadowBorderTop: box_shadow_border_top,\r\n};\r\n","import { omit } from 'lodash';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nimport { ISavedViewDto } from './odata/generated/entities/ISavedViewDto';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\n\r\nexport const savedViewsApi = {\r\n  initUpdateData: (payload: number) => {\r\n    const url = `/api/odata/v4/savedviews(${payload})`;\r\n    return httpClient.get(url);\r\n  },\r\n  deleteSavedViews: (rows: ISavedViewDto[]): Promise<IResponseType> => {\r\n    const viewIds: number[] = rows.map(item => item.Id);\r\n    const data = { viewIds };\r\n    const url = '/api/odata/v4/SavedViews/DeleteViews';\r\n    return httpClient.post(url, data);\r\n  },\r\n  createSavedView: (payload: ISavedViewDto) => {\r\n    const url = `/api/odata/v4/savedviews`;\r\n    return httpClient.post(url, payload);\r\n  },\r\n  updateSavedView: (payload: ISavedViewDto) => {\r\n    const url = `/api/odata/v4/savedviews(${payload.Id})`;\r\n    return httpClient.put(url, payload);\r\n  },\r\n  patch: (payload: Partial<ISavedViewDto>) => {\r\n    const url = `/api/odata/v4/savedviews(${payload.Id})`;\r\n    return httpClient.patch(url, omit(payload, 'Id'));\r\n  },\r\n  useSavedView: (id: number | undefined) => {\r\n    if (!id) return;\r\n    return httpClient.post(odataUrlPrefix + 'savedviews/UseSavedView', { id });\r\n  },\r\n  getMySavedViews: (payload: {\r\n    user: AuthenticatedUser | undefined;\r\n    serviceGroups: Entity<number>[] | undefined;\r\n    isAdmin: boolean;\r\n    onlyMyView: boolean | undefined;\r\n  }) => {\r\n    const url = '/api/odata/v4/SavedViews';\r\n    const filters = mySavedViewFilter(\r\n      payload.serviceGroups,\r\n      payload.user,\r\n      payload.isAdmin,\r\n    );\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $expand: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter:\r\n        payload.onlyMyView === true\r\n          ? new Condition(\r\n              'UserName',\r\n              ODataOperators.Equals,\r\n              payload.user?.Id || '',\r\n            ).toString()\r\n          : filters.toString(),\r\n      $expand: 'Assets',\r\n      $skip: 0,\r\n      $top: 100,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as ISavedViewDto[]);\r\n  },\r\n};\r\nconst mySavedViewFilter = (\r\n  topServiceGroups: Entity<number>[] | undefined,\r\n  user: AuthenticatedUser | undefined,\r\n  isAdmin: boolean,\r\n): string => {\r\n  const predicates: (string | Condition<ISavedViewDto>)[] = [];\r\n  let result = '';\r\n  const byUser: string[] = [];\r\n  if (user) {\r\n    byUser.push(\r\n      new Condition('UserName', ODataOperators.Equals, user.Id).toString() ||\r\n        '',\r\n    );\r\n    // byUser.push(\r\n    //   '(' +\r\n    //     (new Condition<ISavedViewDto>(\r\n    //       'Shared',\r\n    //       ODataOperators.Equals,\r\n    //       true,\r\n    //     ).toString() || '') +\r\n    //     ' and ' +\r\n    //     (new Condition<ISavedViewDto>(\r\n    //       'SharedUsers',\r\n    //       ODataOperators.Any,\r\n    //       user.Id,\r\n    //       'Name',\r\n    //     ).toString() || '') +\r\n    //     ')',\r\n    // );\r\n    // if (isAdmin && user.AdminServiceGroups.length > 0) {\r\n    //   let ids = user.AdminServiceGroups.map(item => {\r\n    //     return { Id: item.Id };\r\n    //   }) as Identifiable<number>[];\r\n    //   byUser.push(\r\n    //     '(' +\r\n    //       (new Condition<ISavedViewDto>(\r\n    //         'Shared',\r\n    //         ODataOperators.Equals,\r\n    //         true,\r\n    //       ).toString() || '') +\r\n    //       ' and ' +\r\n    //       '(' +\r\n    //       new Condition(\r\n    //         'Assets',\r\n    //         ODataOperators.AllIn,\r\n    //         ids,\r\n    //         'ServiceGroupId',\r\n    //       ).toString() +\r\n    //       '))',\r\n    //   );\r\n    // }\r\n    // if (isAdmin && user.AdminEquipments.length > 0) {\r\n    //   let ids = user.AdminEquipments.map(item => {\r\n    //     return { Id: item };\r\n    //   }) as Identifiable<number>[];\r\n    //   byUser.push(\r\n    //     '(' +\r\n    //       (new Condition<ISavedViewDto>(\r\n    //         'Shared',\r\n    //         ODataOperators.Equals,\r\n    //         true,\r\n    //       ).toString() || '') +\r\n    //       ' and ' +\r\n    //       '(' +\r\n    //       new Condition(\r\n    //         'Assets',\r\n    //         ODataOperators.AllIn,\r\n    //         ids,\r\n    //         'ServiceId',\r\n    //       ).toString() +\r\n    //       '))',\r\n    //   );\r\n    // }\r\n    byUser.push(\r\n      new Condition<ISavedViewDto>(\r\n        'Shared',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ).toString() || '',\r\n    );\r\n    predicates.push(byUser.filter(f => f !== '').join(' or '));\r\n    result = '(' + predicates.map(f => f.toString()).join(' or ') + ')';\r\n    if (topServiceGroups !== undefined) {\r\n      if (topServiceGroups.length > 0) {\r\n        let ids = topServiceGroups.map(item => {\r\n          return { Id: item.Id };\r\n        }) as Identifiable<number>[];\r\n        result +=\r\n          ' and (' +\r\n          new Condition(\r\n            'Assets',\r\n            ODataOperators.AllIn,\r\n            ids,\r\n            'ServiceGroupId',\r\n          ).toString() +\r\n          ')';\r\n      }\r\n    }\r\n  }\r\n\r\n  return result;\r\n};\r\n","/**\r\n *\r\n * AssetCatGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity, Identifiable } from 'types/common';\r\nexport interface IWorkOrderTypeParamsPicker {\r\n  assets?: IAssetDto[];\r\n  groupIds?: number[];\r\n  downtime?: boolean;\r\n}\r\nexport interface WorkOrderTypePickerProps\r\n  extends Omit<AutocompletePickerProps<IWorkOrderTypeDto>, 'loadData'> {\r\n  useSearchOrPredicate?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/WorkOrderType';\r\nexport const initWOTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport const initWOTypeDataParams = (\r\n  assets: IAssetDto[] | undefined,\r\n  groupIds: number[] | undefined,\r\n  downtime: boolean | undefined,\r\n) => {\r\n  if (assets === undefined) {\r\n    return new Promise<IWorkOrderTypeDto[]>((resolve, reject) => {\r\n      resolve([] as IWorkOrderTypeDto[]);\r\n    });\r\n  } else {\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n      $select?: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $skip: 0,\r\n      $top: 10,\r\n      $select: 'Id,Name,AssetAlertType',\r\n    };\r\n    const predicates: (\r\n      | string\r\n      | Condition<IWorkOrderTypeDto>\r\n    )[] = filteredWorkOrderTypes(assets, groupIds, downtime);\r\n    params.$filter = new ODataFilterBuilder<IWorkOrderTypeDto>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: undefined,\r\n      globalServiceGroupFilter: [],\r\n    }).toString();\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as IWorkOrderTypeDto[]);\r\n  }\r\n};\r\nexport const filteredWorkOrderTypes = (\r\n  assets: IAssetDto[] | undefined,\r\n  groupIds: number[] | undefined,\r\n  downtime: boolean | undefined,\r\n  calibration?: boolean,\r\n): (string | Condition<IWorkOrderTypeDto>)[] => {\r\n  const predicates: (string | Condition<IWorkOrderTypeDto>)[] = [];\r\n  if (assets !== undefined && assets.length > 0) {\r\n    const grp = assets\r\n      .map(f => f.ServiceGroupId)\r\n      .filter((elem, index, self) => {\r\n        return (\r\n          elem !== null && elem !== undefined && index === self.indexOf(elem)\r\n        );\r\n      })\r\n      .map(f => {\r\n        return { Id: f } as Identifiable<number>;\r\n      });\r\n    const cts = assets\r\n      .map(f => f.AssetCatId)\r\n      .filter((elem, index, self) => {\r\n        return (\r\n          elem !== null && elem !== undefined && index === self.indexOf(elem)\r\n        );\r\n      })\r\n      .map(f => {\r\n        return { Id: f } as Identifiable<number>;\r\n      });\r\n    const byGroups: string[] = [];\r\n    byGroups.push(\r\n      new Condition('Groups', ODataOperators.HasNoAny, 0).toString() || '',\r\n    );\r\n    byGroups.push(\r\n      `(${grp\r\n        .map(\r\n          g =>\r\n            new Condition('Groups', ODataOperators.Any, g.Id).toString() || '',\r\n        )\r\n        .filter(f => f !== '')\r\n        .join(' and ')})`,\r\n    );\r\n    predicates.push(\r\n      '(' + byGroups.filter(f => f !== '' && f !== '()').join(' or ') + ')',\r\n    );\r\n    const byCats: string[] = [];\r\n    byCats.push(\r\n      new Condition('AssetCats', ODataOperators.HasNoAny, 0).toString() || '',\r\n    );\r\n    byCats.push(\r\n      `(${cts\r\n        .map(\r\n          g =>\r\n            new Condition('AssetCats', ODataOperators.Any, g.Id).toString() ||\r\n            '',\r\n        )\r\n        .filter(f => f !== '')\r\n        .join(' and ')})`,\r\n    );\r\n    predicates.push(\r\n      '(' + byCats.filter(f => f !== '' && f !== '()').join(' or ') + ')',\r\n    );\r\n  }\r\n  if (groupIds !== undefined && groupIds.length > 0) {\r\n    predicates.push(\r\n      new Condition(\r\n        'Groups',\r\n        ODataOperators.Includes,\r\n        groupIds.map(g => {\r\n          return { Id: g } as Identifiable<number>;\r\n        }),\r\n      ).toString() || '',\r\n    );\r\n  }\r\n  if (downtime) {\r\n    predicates.push(\r\n      new Condition('AssetAlertType', ODataOperators.Equals, true),\r\n    );\r\n  }\r\n  if (calibration === true) {\r\n    predicates.push(\r\n      new Condition('ShowOnCalibrationHistory', ODataOperators.Equals, true),\r\n    );\r\n  }\r\n  predicates.push(new Condition('Statuses', ODataOperators.Any, true, 'New'));\r\n  return predicates || [];\r\n};\r\nexport function withParamsFilter(\r\n  assets: IAssetDto[] | undefined,\r\n  groupIds: number[] | undefined,\r\n  downtime: boolean | undefined,\r\n) {\r\n  return (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n    };\r\n    const predicates: (\r\n      | string\r\n      | Condition<IWorkOrderTypeDto>\r\n    )[] = filteredWorkOrderTypes(assets, groupIds, downtime);\r\n    params.$filter = new ODataFilterBuilder<IWorkOrderTypeDto>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm === null ? undefined : searchTerm,\r\n      globalServiceGroupFilter: [],\r\n    }).toString();\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  };\r\n}\r\nconst loadData = (\r\n  predicates: (string | Condition<IWorkOrderTypeDto>)[] | undefined,\r\n  queryUrl?: string,\r\n  useSearchOrPredicate?: boolean,\r\n) =>\r\n  getAutoCompleteLoadDataFn<IWorkOrderTypeDto>({\r\n    url: url ?? queryUrl,\r\n    predicates: predicates,\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'UserInquiry',\r\n      'AssetAlertType',\r\n      'QuickCreation',\r\n      'ReportSymptoms',\r\n      'UserCreated',\r\n      'NotifySGA',\r\n      'NotifyCreator',\r\n      'NotifyInstrumentAdmin',\r\n      'NotifyLabTech',\r\n      'Active',\r\n      'StaffOnly',\r\n      'AutoCreateEvent',\r\n      'RepairCodesEnabled',\r\n      'AssignedToCoreAdmin',\r\n      'AssignedToInstrumentAdmin',\r\n      'AssignedToLabTech',\r\n      'AssignedToCreator',\r\n      'ShowOnCalibrationHistory',\r\n      'NotifyAdditionalEmails',\r\n      'UserInquiryGuidance',\r\n      'RepeatsOn',\r\n      'DefaultSubject',\r\n      'DefaultCreatedBy',\r\n      'CustomFormId',\r\n      'RepeatsEveryNum',\r\n      'RepeatsEveryType',\r\n      'RepeatsBy',\r\n      'AutoCreateFor',\r\n      'DefaultRemaindBefore',\r\n      'RepetitiveOptions',\r\n      'DowntimeReasonTypeId',\r\n      'DowntimeDuration',\r\n      'CreatedDate',\r\n      'UpdateDate',\r\n      'DefaultEventTime',\r\n      'AssignedUsers',\r\n      'AssetCats',\r\n      'Groups',\r\n      'FormValues',\r\n      'Statuses',\r\n      'NotEditable',\r\n    ],\r\n    useSearchOrPredicate: useSearchOrPredicate,\r\n  });\r\nexport function WorkOrderTypePicker(props: WorkOrderTypePickerProps) {\r\n  const innerLoadData = (predicates, queryUrl) =>\r\n    loadData(props.predicates, queryUrl, props.useSearchOrPredicate);\r\n  // const loadData = withParamsFilter(\r\n  //   props.assets,\r\n  //   props.groupIds,\r\n  //   props.downtime,\r\n  // );\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      id={props.id || 'workordertypeId'}\r\n      mini={props.mini ? true : undefined}\r\n      loadData={innerLoadData(props.predicates, url)}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const loadWorkOrderTypes = loadData;\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nexport interface InventoryBatchPickerProps\r\n  extends Omit<AutocompletePickerProps<IInventoryBatchDto>, 'loadData'> {}\r\nconst url = '/api/odata/v4/InventoryBatches';\r\nexport const generateInventoryBatchName = (\r\n  dto: IInventoryBatchDto,\r\n): IInventoryBatchDto => {\r\n  let name = `Batch: #${dto?.Id} - ${dto.Name} - ${dto?.Inventory}`;\r\n  return Object.assign({}, dto, { Name: name });\r\n};\r\nexport const convertInventoryBatchName = (\r\n  Id: number,\r\n  Name: string,\r\n  Inventory: number,\r\n): string => {\r\n  let name = `Batch: #${Id} - ${Name} - ${Inventory}`;\r\n  return name;\r\n};\r\nconst loadBaseData = (\r\n  predicates: (string | Condition<IInventoryBatchDto>)[] | undefined,\r\n  select?: (keyof IInventoryBatchDto)[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<IInventoryBatchDto>({\r\n    url,\r\n    predicates: predicates,\r\n    //transformModel: generateInventoryBatchName,\r\n    // TODO: narrow down used properties list\r\n    select:\r\n      !!select && select.length > 0\r\n        ? select\r\n        : [\r\n            'Id',\r\n            'Name',\r\n            'OfflineServiceTypeId',\r\n            'OfflineServiceTypeName',\r\n            'Inventory',\r\n            'Lot',\r\n            'CreatedAt',\r\n            'CreatedBy',\r\n            'ExpirationDate',\r\n            'PurchaseDate',\r\n            'PurchasePricePerUnit',\r\n            'InventoryUsed',\r\n            'StokRenewed',\r\n          ],\r\n    globalServiceGroupFilter: undefined,\r\n  });\r\n\r\nexport function InventoryBatchPicker(props: InventoryBatchPickerProps) {\r\n  const innerLoadData = loadBaseData(props.predicates);\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      additionalItem={props.additionalItem}\r\n      id={props.id || 'inventBatchId'}\r\n      getOptionLabelName={option =>\r\n        convertInventoryBatchName(\r\n          (option as IInventoryBatchDto).Id,\r\n          (option as IInventoryBatchDto).Name,\r\n          (option as IInventoryBatchDto).Inventory,\r\n        )\r\n      }\r\n      renderOptionName={option =>\r\n        convertInventoryBatchName(\r\n          (option as IInventoryBatchDto).Id,\r\n          (option as IInventoryBatchDto).Name,\r\n          (option as IInventoryBatchDto).Inventory,\r\n        )\r\n      }\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const loadInventoryBatchesData = loadBaseData;\r\nexport function BatchesByServiceTypeFilter(\r\n  serviceTypeId: number,\r\n  withStockRenewed?: boolean,\r\n): (string | Condition<IInventoryBatchDto>)[] {\r\n  const predicates: (string | Condition<IInventoryBatchDto>)[] = [];\r\n  predicates.push(\r\n    new Condition<IInventoryBatchDto>(\r\n      'OfflineServiceTypeId',\r\n      ODataOperators.Equals,\r\n      serviceTypeId,\r\n    ),\r\n  );\r\n  if (!!withStockRenewed) {\r\n    predicates.push(\r\n      new Condition<IInventoryBatchDto>(\r\n        'StokRenewed',\r\n        ODataOperators.Equals,\r\n        withStockRenewed,\r\n      ),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n","import { ViewTypes } from '../slice/types';\r\n\r\nexport const parseType = (s?: ViewTypes) => {\r\n  if (s === undefined) {\r\n    return undefined;\r\n  }\r\n  switch (s) {\r\n    case 'calendar':\r\n    case 'timeline':\r\n      return s;\r\n    default:\r\n      return undefined;\r\n  }\r\n};\r\n","/**\r\n *\r\n * auto generated interface for Default.TimelineGroupBy\r\n *\r\n */\r\n\r\nexport enum TimelineGroupBy {\r\n  NoTimelineGrouped = 0,\r\n  GroupByAssemblyPart = 1,\r\n  GroupByAssetCat = 2,\r\n}\r\nexport type TimelineGroupByUnion = keyof typeof TimelineGroupBy;\r\nexport const TimelineGroupByUnionArray: Array<TimelineGroupByUnion> = [\r\n  'NoTimelineGrouped',\r\n  'GroupByAssemblyPart',\r\n  'GroupByAssetCat',\r\n];\r\n","import { IViewState } from './Scheduler/slice/types';\r\nimport { match } from 'react-router';\r\nimport { parseType } from './Scheduler/utils/parseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { CalendarPageParams } from './index';\r\nimport { presetPeriodToViewLength } from './Scheduler/utils/parseLength';\r\nimport {\r\n  getPeriodTypeNameOrUndefined,\r\n  GetRawValue,\r\n  URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { TimelineGroupByUnionArray } from 'api/odata/generated/enums/TimelineGroupBy';\r\n\r\n/** the name of the filter/search/querystring field storing the selected period value */\r\nexport const periodFilterFieldName = 'period';\r\n/**\r\n * the name of the filter/search/querystring field storing the selected period value\r\n */\r\nexport const groupByFilterFieldName = 'groupBy';\r\n/**\r\n * Parse and sanitize scheduler viewstate provided in the URL\r\n * @param match current route match\r\n * @param search route search\r\n * @returns scheduler view state\r\n */\r\nexport const parseCalendarPageParams = (\r\n  match: match<CalendarPageParams>,\r\n  search: string,\r\n  isMobile: boolean,\r\n  date: Date,\r\n  dashView?: boolean,\r\n): IViewState => {\r\n  const params = new URLSearchParamsCI(search);\r\n  let periodType =\r\n    getPeriodTypeNameOrUndefined(GetRawValue(params, periodFilterFieldName)) ??\r\n    match.params.period;\r\n  const defaultviewType =\r\n    isMobile && !dashView\r\n      ? 'calendar'\r\n      : parseType(match.params.type) ?? 'timeline';\r\n  const defaultviewLength = isMobile\r\n    ? 'day'\r\n    : periodType === undefined\r\n    ? 'week'\r\n    : presetPeriodToViewLength(periodType, defaultviewType);\r\n  const result: IViewState = {\r\n    viewType: defaultviewType,\r\n    search: search,\r\n    preset: null,\r\n    viewLength: defaultviewLength,\r\n    date: dateUtils.formatISO(date),\r\n    groupBy: getTimelineGroupBy(params),\r\n    //...parsePosition(match.params.length, match.params.date),\r\n  };\r\n  return result;\r\n};\r\n\r\nconst getTimelineGroupBy = function (params: URLSearchParamsCI) {\r\n  const rawValue = GetRawValue(params, groupByFilterFieldName);\r\n  if (rawValue === null || rawValue === undefined) {\r\n    return undefined;\r\n  }\r\n  var result = TimelineGroupByUnionArray.find(\r\n    item => item.toLowerCase() === rawValue.toLowerCase(),\r\n  );\r\n  return result;\r\n};\r\n","import { styled } from '@material-ui/core';\r\n\r\nexport const AlignRight = styled('div')(props => ({\r\n  textAlign: 'right',\r\n}));\r\n","export enum CustomFormTypeEnum {\r\n  Reservation = 0,\r\n  Request = 1,\r\n  Experiment = 2,\r\n  Alert = 3,\r\n  AlertType = 4,\r\n  ServiceGroup = 5,\r\n  Quiz = 6,\r\n}\r\n","/**\r\n *\r\n * UserGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface UserGroupPickerProps\r\n  extends Omit<AutocompletePickerProps<IUserGroupDto>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/UserGroupFilter';\r\nconst restrictedUrl = '/api/odata/v4/UserGroupFilter/Restricted';\r\nexport const initUserGroupData = (initval: string) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: new Condition<Entity<string>>(\r\n      'Id',\r\n      ODataOperators.Equals,\r\n      initval,\r\n    ).toString(),\r\n    $select: 'Id,Name',\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\n\r\nexport function UserGroupPicker(props: UserGroupPickerProps) {\r\n  const loadData = getAutoCompleteLoadDataFn<IUserGroupDto>({\r\n    url,\r\n    predicates: props.predicates,\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'DepartmentId',\r\n      'DepartmentName',\r\n      'InstituteId',\r\n      'InstituteName',\r\n      'InstituteTypeId',\r\n      'InstituteTypeName',\r\n      'AffiliatedGroups',\r\n      'IsUserOwneGroup',\r\n    ],\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      id={props.id || 'usergroupId'}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function RestrictedUserGroupPicker(props: UserGroupPickerProps) {\r\n  const loadData = getAutoCompleteLoadDataFn<IUserGroupDto>({\r\n    url: restrictedUrl,\r\n    predicates: props.predicates,\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'DepartmentId',\r\n      'DepartmentName',\r\n      'InstituteId',\r\n      'InstituteName',\r\n      'InstituteTypeId',\r\n      'InstituteTypeName',\r\n      'AffiliatedGroups',\r\n      'IsUserOwneGroup',\r\n    ],\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      id={props.id || 'usergroupId'}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function RestrictedFilter(\r\n  departmentId?: number,\r\n  instituteId?: number,\r\n  instituteTypeId?: number,\r\n  restricted?: boolean,\r\n): (string | Condition<IUserGroupDto>)[] {\r\n  const predicates: (string | Condition<IUserGroupDto>)[] = [];\r\n  if (!!departmentId) {\r\n    predicates.push(\r\n      new Condition<IUserGroupDto>(\r\n        'DepartmentId',\r\n        ODataOperators.Equals,\r\n        departmentId,\r\n      ),\r\n    );\r\n  }\r\n  if (!!instituteId) {\r\n    predicates.push(\r\n      new Condition<IUserGroupDto>(\r\n        'InstituteId',\r\n        ODataOperators.Equals,\r\n        instituteId,\r\n      ),\r\n    );\r\n  }\r\n  if (!!instituteTypeId) {\r\n    predicates.push(\r\n      new Condition<IUserGroupDto>(\r\n        'InstituteTypeId',\r\n        ODataOperators.Equals,\r\n        instituteTypeId,\r\n      ),\r\n    );\r\n  }\r\n  if (restricted) {\r\n    predicates.push(\r\n      new Condition<IUserGroupDto>(\r\n        'IsUserOwneGroup',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n","/**\r\n *\r\n * UserFilter\r\n *\r\n */\r\nimport { UserPicker } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const UserFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<string> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <UserPicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      urlType={props.urlType}\r\n      selectArray={\r\n        props.urlType === 'budgetExperiments'\r\n          ? ['Id', 'Name']\r\n          : [\r\n              'Id',\r\n              'Name',\r\n              'UserGroups',\r\n              'Budgets',\r\n              'IsAdminPanel',\r\n              'IsEquipmentAdmin',\r\n              'IsGroupAdmin',\r\n              'IsLabTech',\r\n              'Services',\r\n            ]\r\n      }\r\n    />\r\n  );\r\n};\r\nexport default UserFilter;\r\n","/**\r\n *\r\n * DescriptionCell\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Description, DescriptionProps } from 'app/components/Description';\r\n\r\nexport interface DescriptonCellProps\r\n  extends Pick<\r\n    DescriptionProps,\r\n    'width' | 'interactive' | 'leaveDelay' | 'leaveTouchDelay'\r\n  > {}\r\n/**\r\n * Renders a long text Cell - truncates long text with a popup\r\n * @param c react-table renderprop params - see https://react-table.tanstack.com/docs/api/useTable\r\n * @returns\r\n */\r\nexport const DescriptionCell = (p?: DescriptonCellProps) => (c: {\r\n  value: string | null;\r\n}) => {\r\n  if (p?.width === 'auto') {\r\n    return String(c.value);\r\n  }\r\n  return (\r\n    <Description\r\n      value={c.value}\r\n      width={p?.width}\r\n      interactive={p?.interactive}\r\n      leaveDelay={p?.leaveDelay}\r\n      leaveTouchDelay={p?.leaveTouchDelay}\r\n    />\r\n  );\r\n};\r\n","import { IViewState, ViewTypes } from './Scheduler/slice/types';\r\nimport { generatePath } from 'react-router';\r\nimport { calendarPageFullPath } from './index';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\n/**\r\n * Generates path of the scheduler (calendar/timeline) page\r\n * @param params\r\n * @returns\r\n */\r\nexport const GetCalendarPagePath = (params: IViewState) =>\r\n  GetSchedulerPagePath(params.viewType);\r\n\r\nexport const GetSchedulerPagePath = (viewType: ViewTypes) =>\r\n  generatePath(calendarPageFullPath, {\r\n    type: viewType,\r\n  });\r\n\r\nexport const useCalendarLink = (props?: {\r\n  equipments?: Array<number | undefined>;\r\n  start?: string | Date;\r\n  openToBook?: boolean;\r\n  viewType: ViewTypes;\r\n  defaultMulti?: boolean;\r\n}): string => {\r\n  const EnableLegacyScheduler = useSelector(\r\n    selectGlobalDbSetting_EnableLegacyScheduler,\r\n  );\r\n  if (EnableLegacyScheduler) {\r\n    switch (props?.viewType) {\r\n      case 'calendar':\r\n        const params = {\r\n          id: props?.equipments\r\n            ?.filter(f => f !== undefined)\r\n            ?.map(r => `os${r}`)\r\n            ?.join(','),\r\n          Start:\r\n            props?.start === undefined\r\n              ? undefined\r\n              : dateUtils.formatQueryStringDate(\r\n                  dateUtils.parseISO(props?.start),\r\n                ),\r\n          openToBook: props?.openToBook,\r\n        };\r\n\r\n        return `/Weekly.aspx?${toQueryString(params)}`;\r\n      case 'timeline':\r\n        return `/Timeline.aspx?${toQueryString({\r\n          services: props?.equipments?.filter(f => f !== undefined)?.join(','),\r\n          Start:\r\n            props?.start === undefined\r\n              ? undefined\r\n              : dateUtils.formatQueryStringDate(\r\n                  dateUtils.parseISO(props?.start),\r\n                ),\r\n          openToBook: props?.openToBook,\r\n        })}`;\r\n    }\r\n  }\r\n  return `/schedule/${props?.viewType.toLowerCase()}?${toQueryString({\r\n    eid: props?.equipments\r\n      ?.filter(f => f !== undefined)\r\n      ?.map(r => `${r}`)\r\n      ?.join(','),\r\n    Start:\r\n      props?.start === undefined\r\n        ? undefined\r\n        : dateUtils.formatQueryStringDate(dateUtils.parseISO(props?.start)),\r\n    openToBook: props?.openToBook,\r\n    defaultMulti: props?.defaultMulti,\r\n  })}`;\r\n};\r\n","import { EditorProps } from '../../EditableCell';\r\nimport { tryParseFloat } from 'utils/string-utils';\r\nimport { TextField as BasicTextField } from 'app/components/TextField';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { InputAdornment } from '@material-ui/core';\r\n\r\n/* Project Name */\r\n// 'Number':\r\n\r\nexport function NumberField({\r\n  value,\r\n  onChange,\r\n  parentValue,\r\n  min,\r\n  max,\r\n  step,\r\n  helperText,\r\n  info,\r\n  error,\r\n  autoFocus,\r\n  ...props\r\n}: EditorProps<number | null> & MinMaxProps) {\r\n  return (\r\n    // <StyledInput\r\n    //   type=\"number\"\r\n    //   value={value || ''}\r\n    //   onChange={e => onChange(tryParseFloat(e.target.value) ?? null)}\r\n    //   {...props}\r\n    // />\r\n    <BasicTextField\r\n      className={'textTable'}\r\n      InputProps={{\r\n        disableUnderline: true,\r\n        endAdornment: ((!!info && info !== '') || (error && !!helperText)) && (\r\n          <InputAdornment position=\"end\">\r\n            {!!info && info !== '' && <InfoIcon title={info} error={error} />}\r\n            {error && <InfoIcon title={helperText || ''} error={error} />}\r\n          </InputAdornment>\r\n        ),\r\n      }}\r\n      variant=\"standard\"\r\n      error={error}\r\n      fullWidth\r\n      autoFocus={autoFocus}\r\n      inputProps={{\r\n        type: 'number',\r\n        min: min,\r\n        max: max,\r\n        step: step,\r\n      }}\r\n      value={value || ''}\r\n      onChange={e => onChange(tryParseFloat(e.target.value) ?? null)}\r\n      onBlur={props.onBlur}\r\n      id={props.id}\r\n      label={props.label}\r\n      name={props.name}\r\n    />\r\n  );\r\n}\r\n\r\ninterface MinMaxProps {\r\n  min?: number;\r\n  max?: number;\r\n  step?: number;\r\n}\r\n\r\nexport function withMinMax(Component, withProps: MinMaxProps) {\r\n  return (props: EditorProps<number>) => (\r\n    <Component {...withProps} {...props} />\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\nimport { Dto, ISection } from './types';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.serviceRequestsKanban || initialState;\r\n\r\nexport const selectServiceRequestsKanban = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectServiceRequestsKanbanProcessingUpdate = createSelector(\r\n  [selectSlice],\r\n  state => state.processingUpdate,\r\n);\r\nexport const selectServiceRequestsKanbanProcessingInsert = createSelector(\r\n  [selectSlice],\r\n  state => state.processingInsert,\r\n);\r\n\r\nexport const selectServiceRequestsKanbanTickets = createSelector(\r\n  [selectServiceRequestsKanban],\r\n  state => state.data,\r\n);\r\nexport const selectServiceRequestsKanbanSelectedStatuses = createSelector(\r\n  [selectSlice],\r\n  state => state.selectedStatuses,\r\n);\r\nexport const selectServiceRequestsKanbanData = createSelector(\r\n  [\r\n    selectServiceRequestsKanbanSelectedStatuses,\r\n    selectServiceRequestsKanbanTickets,\r\n  ],\r\n  (selectedStatuses, tickets) => {\r\n    if (selectedStatuses !== undefined) {\r\n      if (selectedStatuses.some(f => f.Name !== undefined)) {\r\n        return selectedStatuses.map(status => {\r\n          const dataList = tickets[status.Id.toString()];\r\n          const b: ISection<IServiceRequestStatusDto, Dto> = {\r\n            id: status.Id,\r\n            section: status,\r\n            data: dataList,\r\n          };\r\n          return b;\r\n        });\r\n      }\r\n    }\r\n  },\r\n);\r\n\r\nexport const selectShowAddSubTicket = createSelector(\r\n  [selectSlice],\r\n  state => state.showAddSubTicket,\r\n);\r\nexport const selectParentTicket = createSelector(\r\n  [selectSlice],\r\n  state => state.parentTicket,\r\n);\r\nexport const selectEdit = createSelector([selectSlice], state => state.ticket);\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Identifiable } from 'types/common';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\n\r\nexport type GroupUrl =\r\n  | 'base'\r\n  | 'admin'\r\n  | 'regpublic'\r\n  | 'public'\r\n  | 'billableAdminUrl';\r\n\r\nexport interface ServiceGroupPickerProps\r\n  extends Omit<AutocompletePickerProps<IServiceGroupDto>, 'loadData'> {\r\n  urlType: GroupUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/servicegroups';\r\nconst adminUrl = '/api/odata/v4/servicegroups/GetAdminServiceGroups';\r\nconst publicUrl = '/api/odata/v4/servicegroups/GetPublicServiceGroups';\r\nconst regPublicUrl = '/api/odata/v4/servicegroups/GetRegistrationServiceGroups';\r\nconst billableAdminUrl =\r\n  '/api/odata/v4/servicegroups/GetBillableAdminServiceGroups';\r\n\r\nexport const initServiceGroupsData = (\r\n  initval: string | undefined,\r\n  urlType: GroupUrl | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IServiceGroupDto[]>((resolve, reject) => {\r\n      resolve([] as IServiceGroupDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,DivisionId,DivisionName',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      urlType === undefined\r\n        ? url\r\n        : urlType === 'public'\r\n        ? publicUrl\r\n        : urlType === 'regpublic'\r\n        ? regPublicUrl\r\n        : urlType === 'admin'\r\n        ? adminUrl\r\n        : urlType === 'billableAdminUrl'\r\n        ? billableAdminUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IServiceGroupDto[]);\r\n  }\r\n};\r\n\r\nexport function ServiceGroupPicker(props: ServiceGroupPickerProps) {\r\n  const urlt =\r\n    props.urlType === 'public'\r\n      ? publicUrl\r\n      : props.urlType === 'regpublic'\r\n      ? regPublicUrl\r\n      : props.urlType === 'admin'\r\n      ? adminUrl\r\n      : props.urlType === 'billableAdminUrl'\r\n      ? billableAdminUrl\r\n      : url;\r\n  let filters: (string | Condition<IServiceGroupDto>)[] = [];\r\n  if (urlt === url) {\r\n    if (!!props.predicates && props.predicates.length > 0) {\r\n      filters = [...props.predicates, ...['Active eq true']];\r\n    } else {\r\n      filters = ['Active eq true'];\r\n    }\r\n  }\r\n  const loadData = getAutoCompleteLoadDataFn<IServiceGroupDto>({\r\n    url:\r\n      props.urlType === 'public'\r\n        ? publicUrl\r\n        : props.urlType === 'regpublic'\r\n        ? regPublicUrl\r\n        : props.urlType === 'admin'\r\n        ? adminUrl\r\n        : props.urlType === 'billableAdminUrl'\r\n        ? billableAdminUrl\r\n        : url,\r\n    select: ['Id', 'Name', 'DivisionId', 'DivisionName'],\r\n    predicates: filters,\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      id={props.id || 'serviceGroupId'}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nexport const ServiceGroupByDivisionFilter = (value: FilterValueType) => {\r\n  if (value !== undefined && value !== null) {\r\n    return [\r\n      `${new Condition<IServiceGroupDto>(\r\n        'DivisionId',\r\n        ODataOperators.Equals,\r\n        (value as Identifiable<number>).Id,\r\n      ).toString()}`,\r\n    ];\r\n  }\r\n  return [];\r\n};\r\n\r\nexport const serviceGroupFilterUrl = url;\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { GroupUrl, ServiceGroupPicker } from '../pickers/ServiceGroupPicker';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\n\r\nexport const FormServiceGroupPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & {\r\n  label?: string;\r\n  fullWidth?: boolean;\r\n  urlType: GroupUrl;\r\n  autoFocus?: boolean;\r\n  name: string;\r\n  placeholder: string;\r\n  disabled?: boolean;\r\n  predicates?: (string | Condition<Entity<number>>)[];\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n}) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <ServiceGroupPicker\r\n      name={props.name}\r\n      urlType={props.urlType}\r\n      placeholder={props.placeholder}\r\n      disabled={props.disabled}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(props.value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value as IServiceGroupDto}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      predicates={props.predicates}\r\n      variant={props.variant === undefined ? 'filled' : props.variant}\r\n    />\r\n  );\r\n};\r\n","import {\r\n  FormControlLabelProps as MuiFormControlLabelProps,\r\n  FormControlLabel as MuiFormControlLabel,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport * as React from 'react';\r\n\r\nexport interface FormControlLabelProps extends MuiFormControlLabelProps {\r\n  boldLabel?: boolean;\r\n  withInfo?: boolean;\r\n  boxed?: boolean;\r\n  boxedChecked?: boolean;\r\n  boxedError?: boolean;\r\n}\r\nconst FormControlLabel = (props: FormControlLabelProps) => {\r\n  const {\r\n    boldLabel,\r\n    withInfo,\r\n    boxed,\r\n    boxedChecked,\r\n    boxedError,\r\n    ...other\r\n  } = props;\r\n  return (\r\n    <MuiFormControlLabel\r\n      {...other}\r\n      className={clsx(props.className, {\r\n        withInfo: withInfo,\r\n        boxed: boxed,\r\n        boxedChecked: boxedChecked,\r\n        boxedError: boxedError,\r\n        boldLabel: boldLabel === true,\r\n      })}\r\n    />\r\n  );\r\n};\r\n\r\nexport default FormControlLabel;\r\n","import {\r\n  FormHelperTextProps as MuiFormHelperTextProps,\r\n  FormHelperText as MuiFormHelperText,\r\n} from '@material-ui/core';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FormHelperTextProps extends MuiFormHelperTextProps {\r\n  boxed?: boolean;\r\n  shiftRight?: boolean;\r\n}\r\nconst FormHelperText = (props: FormHelperTextProps) => {\r\n  const { shiftRight, boxed, ...other } = props;\r\n  return (\r\n    <MuiFormHelperText\r\n      {...other}\r\n      className={clsx(props.className, {\r\n        boxed: boxed,\r\n        shiftRight: shiftRight,\r\n      })}\r\n    />\r\n  );\r\n};\r\n\r\nexport default FormHelperText;\r\n","export function roundTwoPlacesAfterDecimalPoint(value: any) {\r\n  return (Math.round((Number(value) ?? 0) * 100) / 100).toFixed(2);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { articlesActions as actions } from '.';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IExternalArticlesSearchResponse } from 'api/odata/generated/entities/IExternalArticlesSearchResponse';\r\nimport { IExternalArticleSearchPayload } from './types';\r\nimport { selectArticlesExternalSearchPageData } from 'app/pages/ArticlesPage/slice/selectors';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { omit } from 'lodash';\r\n\r\nfunction* doShowDetails(\r\n  action: PayloadAction<{\r\n    Id?: number;\r\n    externalId?: string;\r\n    externalIdSource?: string;\r\n    article?: IArticleDto;\r\n  }>,\r\n) {\r\n  // const props: ArticleDetailsProps = {\r\n  //   useSidePanel: true,\r\n  //   value: action.payload,\r\n  // };\r\n\r\n  try {\r\n    const url = '/api/odata/v4/articles';\r\n    let params = {};\r\n    let articleDetails;\r\n    if (!!action.payload.Id && action.payload.Id > 0) {\r\n      params = { key: action.payload.Id };\r\n      const data: IODataQueryResponse<IArticleDto> = yield call(\r\n        httpClient.get,\r\n        url,\r\n        params,\r\n      );\r\n      articleDetails = omit(data, '@odata.context');\r\n    } else {\r\n      if (\r\n        action.payload.externalId !== undefined &&\r\n        action.payload.externalIdSource !== undefined\r\n      ) {\r\n        const filter = new ODataFilterBuilder<IArticleDto>({\r\n          predicates: [\r\n            new Condition<IArticleDto>(\r\n              'ExternalId',\r\n              ODataOperators.Equals,\r\n              action.payload.externalId,\r\n            ),\r\n            new Condition<IArticleDto>(\r\n              'ExternalIdSource',\r\n              ODataOperators.Equals,\r\n              action.payload.externalIdSource,\r\n            ),\r\n          ],\r\n          stringColumns: [],\r\n        });\r\n        params = { $filter: filter.toString(), $top: 1 };\r\n        const data: IODataQueryResponse<IArticleDto> = yield call(\r\n          httpClient.get,\r\n          url,\r\n          params,\r\n        );\r\n        articleDetails = data.value[0];\r\n      }\r\n    }\r\n    yield put(actions.showDetails_Success(articleDetails));\r\n  } catch (error) {}\r\n\r\n  // yield put(\r\n  //   layoutActions.openSidePanel({\r\n  //     type: RenderPageType.Article,\r\n  //     props: props,\r\n  //   }),\r\n  // );\r\n}\r\n\r\nfunction* doExternalSearch(\r\n  action: PayloadAction<IExternalArticleSearchPayload>,\r\n) {\r\n  try {\r\n    // skip fetching already loaded items\r\n    const page = yield select(selectArticlesExternalSearchPageData);\r\n    if (page !== undefined) {\r\n      yield put(actions.externalSearch_Skip());\r\n      return;\r\n    }\r\n    if (action.payload.searchForm.Source === undefined) {\r\n      return;\r\n    }\r\n    const url = `/api/odata/v4/Articles/ExternalSearch(source='${action.payload.searchForm.Source}')`;\r\n    const params = new URLSearchParams(\r\n      action.payload.searchForm as Record<string, string>,\r\n    );\r\n    params.set(\r\n      '$skip',\r\n      String(action.payload.pageIndex * action.payload.pageSize),\r\n    );\r\n    params.set('$top', String(action.payload.pageSize));\r\n    const results: IExternalArticlesSearchResponse = yield call(\r\n      httpClient.get,\r\n      url,\r\n      params,\r\n    );\r\n    yield put(\r\n      actions.externalSearch_Success({\r\n        count: results.Count,\r\n        items: results.Items,\r\n        pageIndex: action.payload.pageIndex,\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    if ((error as AxiosError).isAxiosError) {\r\n      var errorCode = (error as AxiosError).response?.status;\r\n      if (errorCode === StatusCodes.TOO_MANY_REQUESTS) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            message: i18next.t(translations.TooManyRequests),\r\n          }),\r\n        );\r\n      }\r\n    }\r\n    yield put(actions.externalSearch_Error('Error searching external source'));\r\n  }\r\n}\r\nfunction* doSaveArticleAssociation(action: PayloadAction<IArticleDto>) {\r\n  try {\r\n    const isNew = (action.payload.Id ?? 0) === 0;\r\n    const url = isNew\r\n      ? '/api/odata/v4/articles'\r\n      : `/api/odata/v4/articles(${action.payload.Id})`;\r\n    const fn = isNew ? httpClient.post : httpClient.put;\r\n    const result = yield call(fn, url, action.payload);\r\n    yield put(layoutActions.setRefreshTable(true));\r\n    if (result.Queryable[0].Status === ArticleStatus.AwaitingApproval) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'success',\r\n          message: i18next.t(translations.PublicationAwaitingApproval),\r\n        }),\r\n      );\r\n    } else {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'success',\r\n          message: i18next.t(translations.Success),\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.saveArticleAssociation_Success(result.Queryable[0]));\r\n  } catch (error) {\r\n    const mes = (error as AxiosError)?.response?.data.error.message;\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message:\r\n          mes !== undefined ? mes : i18next.t(translations.AnErrorOccurred),\r\n      }),\r\n    );\r\n    yield put(actions.saveArticleAssociation_Error(action.payload));\r\n  }\r\n}\r\n\r\nexport function* articlesSaga() {\r\n  yield takeLatest(actions.showDetails.type, doShowDetails);\r\n  yield takeLatest(actions.externalSearch.type, doExternalSearch);\r\n  yield takeLatest(actions.chnagePage.type, doExternalSearch);\r\n\r\n  yield takeLatest(\r\n    actions.saveArticleAssociation.type,\r\n    doSaveArticleAssociation,\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { articlesSaga } from './saga';\r\nimport {\r\n  ArticlesState,\r\n  IExternalArticleSearchPayload,\r\n  IExternalArticleSearchSuccessPayload,\r\n} from './types';\r\n\r\nexport const initialState: ArticlesState = {\r\n  externalSearchResults: {},\r\n  externalSearchPageIndex: 0,\r\n  externalSearchPageSize: 10,\r\n  refreshEditArticleAssociation: undefined,\r\n  articleDetailsBusy: undefined,\r\n  editArticleAssociationBusy: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'articles',\r\n  initialState,\r\n  reducers: {\r\n    showDetails(\r\n      state,\r\n      action: PayloadAction<{\r\n        Id?: number;\r\n        externalId?: string;\r\n        externalIdSource?: string;\r\n        article?: IArticleDto;\r\n      }>,\r\n    ) {\r\n      state.articleDetailsBusy = true;\r\n      state.editArticleAssociationBusy = undefined;\r\n      state.articleDetails = action.payload.article;\r\n    },\r\n    showDetails_Success(state, action: PayloadAction<IArticleDto | undefined>) {\r\n      state.articleDetailsBusy = false;\r\n      if (action.payload !== undefined) {\r\n        if (state.articleDetails !== undefined) {\r\n          state.articleDetails.Id = action.payload.Id;\r\n          state.articleDetails.Assets = action.payload.Assets;\r\n        }\r\n      }\r\n    },\r\n    refreshEditArticleAssociation(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.refreshEditArticleAssociation = action.payload;\r\n    },\r\n    saveArticleAssociation(state, action: PayloadAction<IArticleDto>) {\r\n      state.editArticleAssociationBusy = true;\r\n      state.refreshEditArticleAssociation = undefined;\r\n    },\r\n    saveArticleAssociation_Success(state, action: PayloadAction<IArticleDto>) {\r\n      state.articleDetails = action.payload;\r\n      state.refreshEditArticleAssociation = true;\r\n      state.editArticleAssociationBusy = false;\r\n    },\r\n    saveArticleAssociation_Error(state, action: PayloadAction<IArticleDto>) {\r\n      state.editArticleAssociationBusy = false;\r\n    },\r\n    resetArticleAssociationState(state, action: PayloadAction) {\r\n      state.editArticleAssociationBusy = undefined;\r\n      //delete state.articleDetails;\r\n    },\r\n    externalSearch(\r\n      state,\r\n      action: PayloadAction<IExternalArticleSearchPayload>,\r\n    ) {\r\n      state.externalSearchFormDetails = action.payload.searchForm;\r\n      state.externalSearchPageIndex = action.payload.pageIndex;\r\n      state.externalSearchPageSize = action.payload.pageSize;\r\n      state.externalSearchResults = {\r\n        processing: true,\r\n      };\r\n    },\r\n    chnagePage(state, action: PayloadAction<IExternalArticleSearchPayload>) {\r\n      state.externalSearchResults.processing = true;\r\n      if (state.externalSearchPageSize !== action.payload.pageSize) {\r\n        state.externalSearchResults.data = {};\r\n      }\r\n      state.externalSearchPageIndex = action.payload.pageIndex;\r\n      state.externalSearchPageSize = action.payload.pageSize;\r\n    },\r\n    externalSearch_Skip(state, action: PayloadAction) {\r\n      state.externalSearchResults.processing = false;\r\n    },\r\n    externalSearch_Success(\r\n      state,\r\n      action: PayloadAction<IExternalArticleSearchSuccessPayload>,\r\n    ) {\r\n      state.externalSearchResults.processing = false;\r\n      state.externalSearchResults.dataLength = action.payload.count;\r\n      if (state.externalSearchResults.data === undefined) {\r\n        state.externalSearchResults.data = {};\r\n      }\r\n      state.externalSearchResults.data[action.payload.pageIndex] =\r\n        action.payload.items;\r\n    },\r\n    externalSearch_Error(state, action: PayloadAction<string>) {\r\n      state.externalSearchResults = { error: action.payload };\r\n    },\r\n    someAction(state, action: PayloadAction<any>) {},\r\n    clearArticleDetails(state) {\r\n      state.articleDetails = undefined;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: articlesActions } = slice;\r\n\r\nexport const useArticlesSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: articlesSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useArticlesSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, select, takeLatest } from 'redux-saga/effects';\r\nimport { PrintPDFItem } from './types';\r\nimport { printPDFActions as actions } from '.';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { selectPrintPDFSections } from './selectors';\r\n\r\nfunction* doUpdateSections(action: PayloadAction<PrintPDFItem[]>) {}\r\nfunction* doSaveSections(action: PayloadAction) {\r\n  const sections: PrintPDFItem[] = yield select(selectPrintPDFSections);\r\n  const value = sections.filter(s => s.checked === true).map(f => f.id);\r\n  const user = yield select(selectAuthenticatedUser);\r\n  yield put(\r\n    appSettingsActions.updateUserProfileSettings({\r\n      key: '/RequestSamples.pdf',\r\n      model: {\r\n        UserName: user.Id,\r\n        Key: '/RequestSamples.pdf',\r\n        Value: value.join(','),\r\n        Id: 0,\r\n        AdGroup: null,\r\n        DefaultGroups: null,\r\n        Enabled: true,\r\n        IsMultiple: null,\r\n        Name: null,\r\n        Selected: false,\r\n        StaffEnabled: false,\r\n      },\r\n    }),\r\n  );\r\n}\r\nexport function* printPDFSaga() {\r\n  yield takeLatest(actions.updateSections.type, doUpdateSections);\r\n  yield takeLatest(actions.saveSections.type, doSaveSections);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { printPDFSaga } from './saga';\r\nimport { PrintPDFItem, PrintPDFState } from './types';\r\n\r\nexport const initialState: PrintPDFState = {\r\n  printing: false,\r\n  isLoading: false,\r\n  useSections: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'printPDF',\r\n  initialState,\r\n  reducers: {\r\n    setPrinting(state, action: PayloadAction<boolean>) {\r\n      state.printing = action.payload;\r\n    },\r\n    setUseSections(state, action: PayloadAction<boolean>) {\r\n      state.useSections = action.payload;\r\n    },\r\n    updateSections(state, action: PayloadAction<PrintPDFItem[] | undefined>) {\r\n      state.Sections = action.payload;\r\n    },\r\n    updateSection(\r\n      state,\r\n      action: PayloadAction<{\r\n        id: string;\r\n        checked: boolean;\r\n      }>,\r\n    ) {\r\n      if (state.Sections !== undefined) {\r\n        const section = state.Sections.find(f => f.id === action.payload.id);\r\n        if (section !== undefined) {\r\n          section.checked = action.payload.checked;\r\n        }\r\n      }\r\n    },\r\n    saveSections(state, action: PayloadAction) {},\r\n    clearLoading(state, action: PayloadAction) {\r\n      state.tables = undefined;\r\n    },\r\n    setLoading(state, action: PayloadAction<{ id: string; loading: boolean }>) {\r\n      if (state.tables === undefined) {\r\n        state.tables = [action.payload];\r\n        state.isLoading = action.payload.loading;\r\n      } else {\r\n        const table = state.tables.find(t => t.id === action.payload.id);\r\n        if (table !== undefined) {\r\n          table.loading = action.payload.loading;\r\n        } else {\r\n          state.tables.push(action.payload);\r\n        }\r\n        state.isLoading = state.tables.some(t => t.loading === true);\r\n      }\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: printPDFActions } = slice;\r\n\r\nexport const usePrintPDFSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: printPDFSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  call,\r\n  put,\r\n  take,\r\n  select,\r\n  takeLatest,\r\n  takeLeading,\r\n  takeEvery,\r\n  all,\r\n} from 'redux-saga/effects';\r\nimport { serviceRequestsKanbanActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport {\r\n  selectServiceRequestsKanbanData,\r\n  selectServiceRequestsKanbanTickets,\r\n} from './selectors';\r\nimport { Dto, IDataList, ISection, ReorderPayload } from './types';\r\nimport { omit } from 'lodash';\r\nimport { takeLatestByKey } from 'utils/redux-saga';\r\nimport { PartialExceptId } from 'utils/typeUtils';\r\nimport { extractErrorMessages, getModelStateErrors } from 'api/utils';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ServiceRequestTicketDetailsProps } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails';\r\n\r\nconst ENTITY_SET_URL = '/api/odata/v4/ServiceRequestTickets';\r\n\r\nconst fetchTicketsByStatusId = async (params: {\r\n  statusId: number;\r\n  top: number;\r\n  skip: number;\r\n}) => {\r\n  const response: IODataQueryResponse<IServiceRequestStatusDto> = await httpClient.get(\r\n    ENTITY_SET_URL,\r\n    fetchTicketsParams({\r\n      statusId: params.statusId,\r\n      top: params.top + 1,\r\n      skip: params.skip,\r\n    }),\r\n  );\r\n  const count = response['@odata.count'];\r\n  const result: IDataList<IServiceRequestStatusDto> = {\r\n    id: params.statusId,\r\n    items: response.value.slice(0, params.top),\r\n    count: count ?? 0,\r\n    more: response.value.length > params.top,\r\n  };\r\n  return result;\r\n};\r\nconst fetchTicketById = async (params: { Id: number | null }) => {\r\n  if (params.Id === null) {\r\n    return Promise.resolve(undefined);\r\n  } else {\r\n    const response = await httpClient.get(\r\n      `${ENTITY_SET_URL}(${params.Id})`,\r\n      FETCH_SELECT_EXPAND,\r\n    );\r\n    return response;\r\n  }\r\n};\r\n\r\nconst FETCH_SELECT_EXPAND = {\r\n  $select: [\r\n    'Id',\r\n    'Index',\r\n    'SubSamplesCount',\r\n    'TotalSamplesCount',\r\n    'SamplesCount',\r\n    'Priority',\r\n    'ParentTicketId',\r\n    'ServiceRequestId',\r\n  ].join(','),\r\n  $expand: [\r\n    'Status($select=Id,Name)',\r\n    //'Service($select=Id,Name)',\r\n    //'ServiceRequestStatus($select=Id,Name)',\r\n    'AssignedTo($select=Id,Name)',\r\n    'ServiceRequest($select=CreatedFor,Service;$expand=CreatedFor($select=Id,Name),Service($select=Id,Name;$expand=ServiceGroup($select=Id,Name)),Budget($select=Id,Name))',\r\n  ].join(','),\r\n};\r\nfunction fetchTicketsParams(params: {\r\n  statusId: number;\r\n  top: number;\r\n  skip: number;\r\n}): any {\r\n  return {\r\n    ...FETCH_SELECT_EXPAND,\r\n    $filter: `Status/Id eq ${params.statusId}`,\r\n    $top: params.top,\r\n    $skip: params.skip,\r\n    $count: true,\r\n    $orderBy: 'Index',\r\n  };\r\n}\r\n/**\r\n * Number of initially fetched tickets per each status\r\n */\r\nconst INITIAL_TOP = 10;\r\nconst notificationMessageKey_getItems = 'getItems';\r\nfunction* doGetItems(action: PayloadAction<number[]>) {\r\n  try {\r\n    const bar: Array<IDataList<IServiceRequestTicketDto>> = yield all(\r\n      action.payload.map(statusId =>\r\n        call(fetchTicketsByStatusId, { statusId, top: INITIAL_TOP, skip: 0 }),\r\n      ),\r\n    );\r\n\r\n    yield put(actions.getItems_Success(bar));\r\n  } catch (error: unknown) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: notificationMessageKey_getItems,\r\n        message: i18next.t(translations.errormessage),\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.getItems_Error(Error));\r\n  }\r\n}\r\nfunction* doGetMoreItems(action: PayloadAction<number>) {\r\n  const tickets: Record<\r\n    string,\r\n    IDataList<IServiceRequestTicketDto>\r\n  > = yield select(selectServiceRequestsKanbanTickets);\r\n\r\n  try {\r\n    const section = tickets[action.payload.toString()];\r\n    const bar: IDataList<IServiceRequestTicketDto> = yield call(\r\n      fetchTicketsByStatusId,\r\n      {\r\n        statusId: action.payload,\r\n        top: INITIAL_TOP,\r\n        skip: section.items.length,\r\n      },\r\n    );\r\n\r\n    yield put(actions.getMoreItems_Success(bar));\r\n  } catch (error: unknown) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: notificationMessageKey_getItems,\r\n        message: i18next.t(translations.errormessage),\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.getItems_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doSetSelectedStatuses(\r\n  action: PayloadAction<IServiceRequestStatusDto[] | undefined>,\r\n) {\r\n  if (action.payload !== undefined) {\r\n    const original: Record<string, Dto> = yield select(\r\n      selectServiceRequestsKanbanTickets,\r\n    );\r\n    const loadedIds = Object.keys(original);\r\n    const currentStatusIdentifiers = action.payload\r\n      .map(f => f.Id)\r\n      .filter(statusId => !loadedIds.includes(statusId.toString()));\r\n\r\n    if (currentStatusIdentifiers.length > 0) {\r\n      yield put(actions.getItems(currentStatusIdentifiers));\r\n    }\r\n  }\r\n}\r\nfunction* doReorder(action: PayloadAction<ReorderPayload>) {\r\n  try {\r\n    const data: ISection<\r\n      IServiceRequestStatusDto,\r\n      IServiceRequestTicketDto\r\n    >[] = yield select(selectServiceRequestsKanbanData);\r\n\r\n    const indexChanges = data\r\n      .flatMap(section => {\r\n        return (\r\n          section.data?.items?.map((item, index) => {\r\n            return {\r\n              Id: item.Id,\r\n              Index: item.Index === index ? undefined : index,\r\n              Status:\r\n                item.Status.Id === section.id ? undefined : section.section,\r\n            };\r\n          }) ?? []\r\n        );\r\n      })\r\n      .filter(item => item.Status !== undefined);\r\n\r\n    const payload = {\r\n      Id: action.payload.Id,\r\n      ServiceRequestStatusId: action.payload.destinationSectionId,\r\n      Index: action.payload.destinationIndex,\r\n    };\r\n\r\n    yield call(\r\n      httpClient.patch,\r\n      `${ENTITY_SET_URL}(${payload.Id})`,\r\n      omit(payload, 'Id'),\r\n    );\r\n    yield put(actions.reorder_Success(indexChanges));\r\n  } catch (error) {\r\n    yield put(\r\n      actions.reorder_Error({\r\n        destinationIndex: action.payload.sourceIndex,\r\n        destinationSectionId: action.payload.sourceSectionId,\r\n        Id: action.payload.Id,\r\n        sourceIndex: action.payload.destinationIndex,\r\n        sourceSectionId: action.payload.destinationSectionId,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doInsert(action: PayloadAction<Partial<IServiceRequestTicketDto>>) {\r\n  const url = ENTITY_SET_URL;\r\n  const notificationMessageKey = 'serviceRequestTicektsInsert';\r\n  try {\r\n    const payload: Partial<Dto> = {\r\n      AssignedTo_Id: action.payload.AssignedTo?.Id,\r\n      Index: action.payload.Index,\r\n      Priority: action.payload.Priority,\r\n      SamplesCount: action.payload.SamplesCount,\r\n      ServiceRequestId: action.payload.ParentTicket?.ServiceRequestId,\r\n      ServiceRequestStatusId: action.payload.Status?.Id,\r\n      ParentTicketId: action.payload.ParentTicketId,\r\n    };\r\n    const response = yield call(httpClient.post, url, payload);\r\n    const p: Dto = {\r\n      ...action.payload.ParentTicket,\r\n      ...response,\r\n      ...action.payload,\r\n    };\r\n    yield put(actions.insert_Success(p));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: notificationMessageKey,\r\n        variant: 'success',\r\n        message: i18next.t(translations.GenericInsertSuccessMessage),\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    yield put(actions.insert_Error());\r\n    const modelState = getModelStateErrors(error);\r\n    console.error(error);\r\n    if (modelState !== undefined) {\r\n      const messages = Object.values(modelState).flat();\r\n      for (const message of messages) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: notificationMessageKey,\r\n            variant: 'error',\r\n            message: message,\r\n          }),\r\n        );\r\n      }\r\n    }\r\n  }\r\n}\r\nfunction* doUpdate(\r\n  action: PayloadAction<PartialExceptId<IServiceRequestTicketDto>>,\r\n) {\r\n  const url = `${ENTITY_SET_URL}(${action.payload.Id})`;\r\n  const notificationMessageKey = 'serviceRequestTicketUpdate';\r\n  try {\r\n    const payload: Partial<IServiceRequestTicketDto> = {\r\n      AssignedTo_Id: action.payload.AssignedTo?.Id,\r\n      Priority: action.payload.Priority,\r\n      Index: action.payload.Index,\r\n      ServiceRequestStatusId: action.payload.Status?.Id,\r\n      SamplesCount: action.payload.SamplesCount,\r\n    };\r\n    yield call(httpClient.patch, url, payload);\r\n    yield put(actions.update_Success(action.payload));\r\n    yield put(layoutActions.resetSidePanel());\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: notificationMessageKey,\r\n        variant: 'success',\r\n        message: i18next.t(translations.GenericUpdateSuccessMessage),\r\n      }),\r\n    );\r\n    //yield put(layoutActions.resetSidePanel());\r\n  } catch (error) {\r\n    yield put(actions.update_Error());\r\n    const messages = extractErrorMessages(error);\r\n    if (messages !== undefined) {\r\n      for (const message of messages) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: notificationMessageKey,\r\n            variant: 'error',\r\n            message: message,\r\n          }),\r\n        );\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n/**\r\n * Runs a monitor on a given selector\r\n * @param selector selector to monitor\r\n */\r\nfunction* selectorChangeSaga(selector, pattern) {\r\n  let previousValue;\r\n  while (true) {\r\n    const currentValue = yield* monitorSelector(\r\n      selector,\r\n      previousValue,\r\n      pattern,\r\n    );\r\n    if (previousValue !== currentValue) {\r\n      //yield spawn(loadRowSaga, focusType, focusId);\r\n    }\r\n    previousValue = currentValue;\r\n  }\r\n}\r\n\r\nfunction* monitorSelector(selector, previousValue, takePattern = '*') {\r\n  while (true) {\r\n    const nextValue = yield select(selector);\r\n    if (nextValue !== previousValue) {\r\n      return nextValue;\r\n    }\r\n    yield take(takePattern);\r\n  }\r\n}\r\nfunction* doShowEdit(action: PayloadAction<Dto>) {\r\n  // const data = yield select(s)\r\n\r\n  const openSidePanelProps: ServiceRequestTicketDetailsProps = {\r\n    item: action.payload,\r\n    useSidePanel: true,\r\n  };\r\n  const parent = yield call(fetchTicketById, {\r\n    Id: action.payload.ParentTicketId,\r\n  });\r\n  yield put(\r\n    actions.showEdit_Success({\r\n      ...action.payload,\r\n      ParentTicket: parent,\r\n    }),\r\n  );\r\n  yield put(\r\n    layoutActions.openSidePanel({\r\n      type: RenderPageType.ServiceRequestTicketDetails,\r\n      props: openSidePanelProps,\r\n    }),\r\n  );\r\n}\r\nfunction* doShowEditParent(action: PayloadAction<Dto>) {\r\n  try {\r\n    const ticket = yield call(fetchTicketById, {\r\n      Id: action.payload.ParentTicketId,\r\n    });\r\n    yield put(actions.showEdit(ticket));\r\n  } catch (error) {\r\n    yield put(actions.showEdit_Error());\r\n  }\r\n}\r\nexport function* serviceRequestsKanbanSaga() {\r\n  yield takeLatest(actions.getItems.type, doGetItems);\r\n  yield takeLatestByKey<number>(\r\n    actions.getMoreItems.type,\r\n    f => f,\r\n    doGetMoreItems,\r\n  );\r\n  yield takeLatest(actions.setSelectedStatuses.type, doSetSelectedStatuses);\r\n  yield takeEvery(actions.reorder.type, doReorder);\r\n  yield takeLeading(actions.insert.type, doInsert);\r\n  yield takeLeading(actions.update.type, doUpdate);\r\n  yield takeLeading(actions.showEdit.type, doShowEdit);\r\n  yield takeLeading(actions.showEditParent.type, doShowEditParent);\r\n  yield selectorChangeSaga(\r\n    selectServiceRequestsKanbanTickets,\r\n    actions.setSelectedStatuses.type,\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { serviceRequestsKanbanSaga } from './saga';\r\nimport {\r\n  Dto,\r\n  IDataList,\r\n  ServiceRequestsKanbanState,\r\n  ReorderPayload,\r\n} from './types';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { isEqual, orderBy } from 'lodash';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { PartialExceptId } from 'utils/typeUtils';\r\n\r\nexport const initialState: ServiceRequestsKanbanState = {\r\n  data: {},\r\n  selectedStatuses: [],\r\n  selectedStatusIds: [],\r\n  fetchCount: 2,\r\n  processingUpdate: false,\r\n  processingInsert: false,\r\n  ticket: {},\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'serviceRequestsKanban',\r\n  initialState,\r\n  reducers: {\r\n    setSelectedStatuses(\r\n      state,\r\n      action: PayloadAction<IServiceRequestStatusDto[] | undefined>,\r\n    ) {\r\n      const ids = orderBy(action.payload?.map(f => f.Id));\r\n      const p = orderBy(state.selectedStatuses.map(f => f.Id));\r\n      if (!isEqual(ids, p)) {\r\n        state.selectedStatusIds = ids;\r\n      }\r\n      state.selectedStatuses = action.payload ?? [];\r\n    },\r\n    getItems(state, action: PayloadAction<any>) {},\r\n\r\n    getItems_Success(state, action: PayloadAction<Array<IDataList<Dto>>>) {\r\n      action.payload.forEach(item => {\r\n        state.data[item.id.toString()] = item;\r\n      });\r\n    },\r\n    getItems_Error(state, action: PayloadAction<any>) {\r\n      // state.processing = false;\r\n      // state.error = 'ERROR';\r\n    },\r\n    getMoreItems(state, action: PayloadAction<number>) {},\r\n    getMoreItems_Success(state, action: PayloadAction<IDataList<Dto>>) {\r\n      const section = state.data[action.payload.id.toString()];\r\n      section.items.push(...action.payload.items);\r\n      section.more = action.payload.more;\r\n    },\r\n    reorder(state, action: PayloadAction<ReorderPayload>) {\r\n      const sourceSection =\r\n        state.data[action.payload.sourceSectionId.toString()];\r\n      if (sourceSection === undefined) {\r\n        return;\r\n      }\r\n      const destinationSection =\r\n        state.data[action.payload.destinationSectionId.toString()];\r\n      if (destinationSection === undefined) {\r\n        return;\r\n      }\r\n      const [removed] = sourceSection?.items?.splice(\r\n        action.payload.sourceIndex,\r\n        1,\r\n      );\r\n\r\n      destinationSection?.items?.splice(\r\n        action.payload.destinationIndex,\r\n        0,\r\n        removed,\r\n      );\r\n    },\r\n    reorder_Success(\r\n      state,\r\n      action: PayloadAction<\r\n        Array<Pick<Dto, 'Id'> & Partial<Pick<Dto, 'Status' | 'Index'>>>\r\n      >,\r\n    ) {\r\n      action.payload.forEach(item => {\r\n        Object.values(state.data).forEach(section => {\r\n          const { Id, ...props } = item;\r\n          const ticket = section.items.find(f => f.Id === Id);\r\n          if (ticket !== undefined) {\r\n            if (props.Index !== undefined) ticket.Index = props.Index;\r\n            if (props.Status !== undefined) ticket.Status = props.Status;\r\n          }\r\n        });\r\n      });\r\n    },\r\n    //todo reuse update & updateError function bodies\r\n    reorder_Error(state, action: PayloadAction<ReorderPayload>) {\r\n      const sourceSection =\r\n        state.data[action.payload.sourceSectionId.toString()];\r\n      if (sourceSection === undefined) {\r\n        return;\r\n      }\r\n      const destinationSection =\r\n        state.data[action.payload.destinationSectionId.toString()];\r\n      if (destinationSection === undefined) {\r\n        return;\r\n      }\r\n      const [removed] = sourceSection?.items?.splice(\r\n        action.payload.sourceIndex,\r\n        1,\r\n      );\r\n\r\n      destinationSection?.items?.splice(\r\n        action.payload.destinationIndex,\r\n        0,\r\n        removed,\r\n      );\r\n    },\r\n\r\n    showAddSubTicket(state, action: PayloadAction<Partial<Dto> | undefined>) {\r\n      state.showAddSubTicket = action.payload !== undefined;\r\n      state.parentTicket = action.payload;\r\n    },\r\n    showEdit(state, action: PayloadAction<Dto>) {\r\n      state.ticket.status = 'pending';\r\n    },\r\n    showEditParent(state, action: PayloadAction<Dto>) {\r\n      state.ticket.status = 'pending';\r\n    },\r\n    showEdit_Success(state, action: PayloadAction<Dto>) {\r\n      state.ticket.status = 'resolved';\r\n      state.ticket.value = action.payload;\r\n    },\r\n    showEdit_Error(state, action: PayloadAction) {\r\n      state.ticket.status = 'rejected';\r\n    },\r\n    insert(state, action: PayloadAction<Partial<IServiceRequestTicketDto>>) {\r\n      state.processingInsert = true;\r\n    },\r\n    insert_Success(state, action: PayloadAction<IServiceRequestTicketDto>) {\r\n      // subtract number of samples from the samples count on the main ticket - for sub tickets only\r\n      updateSamplesCount(action.payload, state);\r\n\r\n      // insert newly created ticket into corresponding section based on the status\r\n      // and push the index on the tickets that come after the newly inserted ticket\r\n      const statusId = action.payload.Status?.Id;\r\n      if (statusId !== undefined) {\r\n        const index = action.payload.Index;\r\n        if (index !== undefined) {\r\n          const section = state.data[statusId.toString()];\r\n          const items = section.items;\r\n          if (items !== undefined) {\r\n            items.slice(index).forEach(ticket => (ticket.Index += 1));\r\n            items.splice(index, 0, action.payload);\r\n          }\r\n        }\r\n      }\r\n      state.parentTicket = undefined;\r\n      state.showAddSubTicket = false;\r\n      state.processingInsert = false;\r\n    },\r\n    insert_Error(state, action: PayloadAction) {\r\n      state.processingInsert = false;\r\n    },\r\n\r\n    update(\r\n      state,\r\n      action: PayloadAction<PartialExceptId<IServiceRequestTicketDto>>,\r\n    ) {\r\n      state.processingUpdate = true;\r\n    },\r\n    update_Success(\r\n      state,\r\n      action: PayloadAction<PartialExceptId<IServiceRequestTicketDto>>,\r\n    ) {\r\n      Object.keys(state.data).forEach(key => {\r\n        const item = Object.values(state.data)\r\n          .flatMap(section => section.items)\r\n          .find(f => f.Id === action.payload.Id);\r\n        if (item !== undefined) {\r\n          //item = {...item, ...action.payload};\r\n          Object.assign(item, action.payload);\r\n        }\r\n      });\r\n      updateSamplesCount(\r\n        action.payload,\r\n        state,\r\n        state.ticket.value?.SamplesCount ?? undefined,\r\n      );\r\n      state.processingUpdate = false;\r\n    },\r\n    update_Error(state, action: PayloadAction) {\r\n      state.processingUpdate = false;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: serviceRequestsKanbanActions } = slice;\r\n\r\nexport const useServiceRequestsKanbanSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: serviceRequestsKanbanSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\nfunction updateSamplesCount(\r\n  payload: Partial<IServiceRequestTicketDto>,\r\n\r\n  state,\r\n  originalSamplesCount?: number,\r\n) {\r\n  if (payload.SamplesCount !== undefined) {\r\n    if (payload.ParentTicket !== undefined) {\r\n      const parent = state.data[\r\n        payload.ParentTicket.Status.Id.toString()\r\n      ].items.find(f => f.Id === payload.ParentTicket?.Id);\r\n      if (parent !== undefined) {\r\n        parent.SamplesCount -=\r\n          (payload.SamplesCount ?? 0) - (originalSamplesCount ?? 0);\r\n      }\r\n    }\r\n  }\r\n}\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useServiceRequestsKanbanSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { IOfflineServiceTypeDto } from 'api/odata/generated/entities/IOfflineServiceTypeDto';\r\nimport { IAsset } from 'app/pages/AssetPopUp/IAsset';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { intersection } from 'lodash';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\n\r\nexport function useAdminPermissions() {\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const roles: number[] | undefined = user?.Roles;\r\n\r\n  const allowedToEdit = React.useCallback(\r\n    (\r\n      row: Pick<IAsset, 'ServiceGroupId' | 'ServiceType' | 'ServiceId'>,\r\n    ): boolean => {\r\n      if (!user) return false;\r\n      return (\r\n        user.HasAdminGroupPermissions(row.ServiceGroupId ?? undefined) ||\r\n        (row.ServiceType !== null &&\r\n          row.ServiceId !== null &&\r\n          user.HasAdminServicePermissions(\r\n            ServiceType[row.ServiceType],\r\n            row.ServiceId,\r\n          ))\r\n      );\r\n    },\r\n    [user],\r\n  );\r\n  const allowedToAdd = React.useCallback(\r\n    (row: Pick<IAsset, 'ServiceGroupId'>): boolean => {\r\n      if (!user) return false;\r\n      return (\r\n        user.HasCreateAdminGroupPermissions(row.ServiceGroupId ?? undefined) ||\r\n        user.HasAdminGroupPermissions(row.ServiceGroupId ?? undefined)\r\n      );\r\n    },\r\n    [user],\r\n  );\r\n  const allowedToEditOffline = React.useCallback(\r\n    (row: Pick<IOfflineServiceTypeDto, 'ServiceGroupId' | 'Id'>): boolean => {\r\n      if (!user) return false;\r\n      return (\r\n        user.HasAdminGroupPermissions(row.ServiceGroupId) ||\r\n        user.HasAdminServicePermissions(ServiceType.Offline, row.Id)\r\n      );\r\n    },\r\n    [user],\r\n  );\r\n  const allowedToAddOffline = React.useCallback(\r\n    (row: Pick<IOfflineServiceTypeDto, 'ServiceGroupId'>): boolean => {\r\n      if (!user) return false;\r\n      return (\r\n        user.HasCreateAdminGroupPermissions(row.ServiceGroupId) ||\r\n        user.HasAdminGroupPermissions(row.ServiceGroupId)\r\n      );\r\n    },\r\n    [user],\r\n  );\r\n  const allowedToEditBatch = React.useCallback(\r\n    (row: Pick<IOfflineServiceTypeDto, 'ServiceGroupId' | 'Id'>): boolean => {\r\n      if (!user) return false;\r\n      return (\r\n        user.HasAdminGroupPermissions(row.ServiceGroupId) ||\r\n        user.HasAdminServicePermissions(ServiceType.Offline, row.Id) ||\r\n        user.HasLabTechGroupPermissions(row.ServiceGroupId) ||\r\n        user.HasLabTechServicePermissions(ServiceType.Offline, row.Id)\r\n      );\r\n    },\r\n    [user],\r\n  );\r\n  const allowedToEditGroup = React.useCallback(\r\n    (row: Pick<ICoresDirectoryRow, 'Id'>): boolean => {\r\n      if (!user) return false;\r\n      return user.HasAdminGroupOnlyPermissions(row.Id);\r\n    },\r\n    [user],\r\n  );\r\n  const allowedRoles = [\r\n    Roles.Administrators,\r\n    Roles.EquipmentAdministrator,\r\n    Roles.GroupAdministrators,\r\n    Roles.CreateNewAssetsAdmin,\r\n  ];\r\n  const hasRolePermissions: boolean =\r\n    intersection(roles, allowedRoles).length > 0;\r\n  return {\r\n    hasRolePermissions,\r\n    allowedToEdit,\r\n    allowedToAdd,\r\n    allowedToEditOffline,\r\n    allowedToAddOffline,\r\n    allowedToEditBatch,\r\n    allowedToEditGroup,\r\n  };\r\n}\r\n","export function sum(values, aggregatedValues) {\r\n  // It's faster to just add the aggregations together instead of\r\n  // process leaf nodes individually\r\n  return aggregatedValues.reduce(\r\n    (sum, next) => sum + (typeof next === 'number' ? next : 0),\r\n    0,\r\n  );\r\n}\r\n\r\nexport function min(values) {\r\n  let min = values[0] || 0;\r\n\r\n  values.forEach(value => {\r\n    if (typeof value === 'number') {\r\n      min = Math.min(min, value);\r\n    }\r\n  });\r\n\r\n  return min;\r\n}\r\n\r\nexport function max(values) {\r\n  let max = values[0] || 0;\r\n\r\n  values.forEach(value => {\r\n    if (typeof value === 'number') {\r\n      max = Math.max(max, value);\r\n    }\r\n  });\r\n\r\n  return max;\r\n}\r\n\r\nexport function minMax(values) {\r\n  let min = values[0] || 0;\r\n  let max = values[0] || 0;\r\n\r\n  values.forEach(value => {\r\n    if (typeof value === 'number') {\r\n      min = Math.min(min, value);\r\n      max = Math.max(max, value);\r\n    }\r\n  });\r\n\r\n  return `${min}..${max}`;\r\n}\r\n\r\nexport function average(values) {\r\n  return sum(null, values) / values.length;\r\n}\r\n\r\nexport function median(values) {\r\n  if (!values.length) {\r\n    return null;\r\n  }\r\n\r\n  const mid = Math.floor(values.length / 2);\r\n  const nums = [...values].sort((a, b) => a - b);\r\n  return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;\r\n}\r\n\r\nexport function unique(values) {\r\n  return Array.from(new Set(values).values());\r\n}\r\n\r\nexport function uniqueCount(values) {\r\n  return new Set(values).size;\r\n}\r\n\r\nexport function count(values) {\r\n  return values.length;\r\n}\r\n","import { defaultColumn, emptyRenderer } from 'react-table';\r\n\r\n// Find the depth of the columns\r\nexport function findMaxDepth(columns, depth = 0) {\r\n  return columns.reduce((prev, curr) => {\r\n    if (curr.columns) {\r\n      return Math.max(prev, findMaxDepth(curr.columns, depth + 1));\r\n    }\r\n    return depth;\r\n  }, 0);\r\n}\r\n\r\n// Build the visible columns, headers and flat column list\r\nexport function linkColumnStructure(columns, parent, depth = 0) {\r\n  return columns.map(column => {\r\n    column = {\r\n      ...column,\r\n      parent,\r\n      depth,\r\n    };\r\n\r\n    assignColumnAccessor(column);\r\n\r\n    if (column.columns) {\r\n      column.columns = linkColumnStructure(column.columns, column, depth + 1);\r\n    }\r\n    return column;\r\n  });\r\n}\r\n\r\nexport function flattenColumns(columns) {\r\n  return flattenBy(columns, 'columns');\r\n}\r\n\r\nexport function assignColumnAccessor(column) {\r\n  // First check for string accessor\r\n  let { id, accessor, Header } = column;\r\n\r\n  if (typeof accessor === 'string') {\r\n    id = id || accessor;\r\n    const accessorPath = accessor.split('.');\r\n    accessor = row => getBy(row, accessorPath);\r\n  }\r\n\r\n  if (!id && typeof Header === 'string' && Header) {\r\n    id = Header;\r\n  }\r\n\r\n  if (!id && column.columns) {\r\n    console.error(column);\r\n    throw new Error('A column ID (or unique \"Header\" value) is required!');\r\n  }\r\n\r\n  if (!id) {\r\n    console.error(column);\r\n    throw new Error('A column ID (or string accessor) is required!');\r\n  }\r\n\r\n  Object.assign(column, {\r\n    id,\r\n    accessor,\r\n  });\r\n\r\n  return column;\r\n}\r\n\r\nexport function decorateColumn(column, userDefaultColumn) {\r\n  if (!userDefaultColumn) {\r\n    throw new Error();\r\n  }\r\n  Object.assign(column, {\r\n    // Make sure there is a fallback header, just in case\r\n    Header: emptyRenderer,\r\n    Footer: emptyRenderer,\r\n    ...defaultColumn,\r\n    ...userDefaultColumn,\r\n    ...column,\r\n  });\r\n\r\n  Object.assign(column, {\r\n    originalWidth: column.width,\r\n  });\r\n\r\n  return column;\r\n}\r\n\r\n// Build the header groups from the bottom up\r\nexport function makeHeaderGroups(\r\n  allColumns,\r\n  defaultColumn,\r\n  additionalHeaderProperties = () => ({}),\r\n) {\r\n  const headerGroups = [];\r\n\r\n  let scanColumns = allColumns;\r\n\r\n  let uid = 0;\r\n  const getUID = () => uid++;\r\n\r\n  while (scanColumns.length) {\r\n    // The header group we are creating\r\n    const headerGroup = {\r\n      headers: [],\r\n    };\r\n\r\n    // The parent columns we're going to scan next\r\n    const parentColumns = [];\r\n\r\n    const hasParents = scanColumns.some(d => d.parent);\r\n\r\n    // Scan each column for parents\r\n    scanColumns.forEach(column => {\r\n      // What is the latest (last) parent column?\r\n      let latestParentColumn = [...parentColumns].reverse()[0];\r\n\r\n      let newParent;\r\n\r\n      if (hasParents) {\r\n        // If the column has a parent, add it if necessary\r\n        if (column.parent) {\r\n          newParent = {\r\n            ...column.parent,\r\n            originalId: column.parent.id,\r\n            id: `${column.parent.id}_${getUID()}`,\r\n            headers: [column],\r\n            ...additionalHeaderProperties(column),\r\n          };\r\n        } else {\r\n          // If other columns have parents, we'll need to add a place holder if necessary\r\n          const originalId = `${column.id}_placeholder`;\r\n          newParent = decorateColumn(\r\n            {\r\n              originalId,\r\n              id: `${column.id}_placeholder_${getUID()}`,\r\n              placeholderOf: column,\r\n              headers: [column],\r\n              ...additionalHeaderProperties(column),\r\n            },\r\n            defaultColumn,\r\n          );\r\n        }\r\n\r\n        // If the resulting parent columns are the same, just add\r\n        // the column and increment the header span\r\n        if (\r\n          latestParentColumn &&\r\n          latestParentColumn.originalId === newParent.originalId\r\n        ) {\r\n          latestParentColumn.headers.push(column);\r\n        } else {\r\n          parentColumns.push(newParent);\r\n        }\r\n      }\r\n\r\n      headerGroup.headers.push(column);\r\n    });\r\n\r\n    headerGroups.push(headerGroup);\r\n\r\n    // Start scanning the parent columns\r\n    scanColumns = parentColumns;\r\n  }\r\n\r\n  return headerGroups.reverse();\r\n}\r\n\r\nconst pathObjCache = new Map();\r\n\r\nexport function getBy(obj, path, def) {\r\n  if (!path) {\r\n    return obj;\r\n  }\r\n  const cacheKey = typeof path === 'function' ? path : JSON.stringify(path);\r\n\r\n  const pathObj =\r\n    pathObjCache.get(cacheKey) ||\r\n    (() => {\r\n      const pathObj = makePathArray(path);\r\n      pathObjCache.set(cacheKey, pathObj);\r\n      return pathObj;\r\n    })();\r\n\r\n  let val;\r\n\r\n  try {\r\n    val = pathObj.reduce((cursor, pathPart) => cursor[pathPart], obj);\r\n  } catch (e) {\r\n    // continue regardless of error\r\n  }\r\n  return typeof val !== 'undefined' ? val : def;\r\n}\r\n\r\nexport function getFirstDefined(...args) {\r\n  for (let i = 0; i < args.length; i += 1) {\r\n    if (typeof args[i] !== 'undefined') {\r\n      return args[i];\r\n    }\r\n  }\r\n}\r\n\r\nexport function getElementDimensions(element) {\r\n  const rect = element.getBoundingClientRect();\r\n  const style = window.getComputedStyle(element);\r\n  const margins = {\r\n    left: parseInt(style.marginLeft),\r\n    right: parseInt(style.marginRight),\r\n  };\r\n  const padding = {\r\n    left: parseInt(style.paddingLeft),\r\n    right: parseInt(style.paddingRight),\r\n  };\r\n  return {\r\n    left: Math.ceil(rect.left),\r\n    width: Math.ceil(rect.width),\r\n    outerWidth: Math.ceil(\r\n      rect.width + margins.left + margins.right + padding.left + padding.right,\r\n    ),\r\n    marginLeft: margins.left,\r\n    marginRight: margins.right,\r\n    paddingLeft: padding.left,\r\n    paddingRight: padding.right,\r\n    scrollWidth: element.scrollWidth,\r\n  };\r\n}\r\n\r\nexport function isFunction(a) {\r\n  if (typeof a === 'function') {\r\n    return a;\r\n  }\r\n}\r\n\r\nexport function flattenBy(arr, key) {\r\n  const flat = [];\r\n\r\n  const recurse = arr => {\r\n    arr.forEach(d => {\r\n      if (!d[key]) {\r\n        flat.push(d);\r\n      } else {\r\n        recurse(d[key]);\r\n      }\r\n    });\r\n  };\r\n\r\n  recurse(arr);\r\n\r\n  return flat;\r\n}\r\n\r\nexport function expandRows(\r\n  rows,\r\n  { manualExpandedKey, expanded, expandSubRows = true },\r\n) {\r\n  const expandedRows = [];\r\n\r\n  const handleRow = (row, addToExpandedRows = true) => {\r\n    row.isExpanded =\r\n      (row.original && row.original[manualExpandedKey]) || expanded[row.id];\r\n\r\n    row.canExpand = row.subRows && !!row.subRows.length;\r\n\r\n    if (addToExpandedRows) {\r\n      expandedRows.push(row);\r\n    }\r\n\r\n    if (row.subRows && row.subRows.length && row.isExpanded) {\r\n      row.subRows.forEach(row => handleRow(row, expandSubRows));\r\n    }\r\n  };\r\n\r\n  rows.forEach(row => handleRow(row));\r\n\r\n  return expandedRows;\r\n}\r\n\r\nexport function getFilterMethod(filter, userFilterTypes, filterTypes) {\r\n  return (\r\n    isFunction(filter) ||\r\n    userFilterTypes[filter] ||\r\n    filterTypes[filter] ||\r\n    filterTypes.text\r\n  );\r\n}\r\n\r\nexport function shouldAutoRemoveFilter(autoRemove, value, column) {\r\n  return autoRemove ? autoRemove(value, column) : typeof value === 'undefined';\r\n}\r\n\r\nexport function unpreparedAccessWarning() {\r\n  throw new Error(\r\n    'React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.',\r\n  );\r\n}\r\n\r\nlet passiveSupported = null;\r\nexport function passiveEventSupported() {\r\n  // memoize support to avoid adding multiple test events\r\n  if (typeof passiveSupported === 'boolean') return passiveSupported;\r\n\r\n  let supported = false;\r\n  try {\r\n    const options = {\r\n      get passive() {\r\n        supported = true;\r\n        return false;\r\n      },\r\n    };\r\n\r\n    window.addEventListener('test', null, options);\r\n    window.removeEventListener('test', null, options);\r\n  } catch (err) {\r\n    supported = false;\r\n  }\r\n  passiveSupported = supported;\r\n  return passiveSupported;\r\n}\r\n\r\n//\r\n\r\nconst reOpenBracket = /\\[/g;\r\nconst reCloseBracket = /\\]/g;\r\n\r\nfunction makePathArray(obj) {\r\n  return (\r\n    flattenDeep(obj)\r\n      // remove all periods in parts\r\n      .map(d => String(d).replace('.', '_'))\r\n      // join parts using period\r\n      .join('.')\r\n      // replace brackets with periods\r\n      .replace(reOpenBracket, '.')\r\n      .replace(reCloseBracket, '')\r\n      // split it back out on periods\r\n      .split('.')\r\n  );\r\n}\r\n\r\nfunction flattenDeep(arr, newArr = []) {\r\n  if (!Array.isArray(arr)) {\r\n    newArr.push(arr);\r\n  } else {\r\n    for (let i = 0; i < arr.length; i += 1) {\r\n      flattenDeep(arr[i], newArr);\r\n    }\r\n  }\r\n  return newArr;\r\n}\r\n","import React from 'react';\r\n\r\nimport * as aggregations from './aggregations';\r\n\r\nimport { getFirstDefined, flattenBy } from './utils';\r\n\r\nimport {\r\n  actions,\r\n  ensurePluginOrder,\r\n  useMountedLayoutEffect,\r\n  useGetLatest,\r\n} from 'react-table';\r\n\r\nconst emptyArray = [];\r\nconst emptyObject = {};\r\n\r\n// Actions\r\nactions.resetGroupBy = 'resetGroupBy';\r\nactions.setGroupBy = 'setGroupBy';\r\n\r\nexport const useSummary = hooks => {\r\n  hooks.stateReducers.push(reducer);\r\n  hooks.visibleColumnsDeps.push((deps, { instance }) => [\r\n    ...deps,\r\n    instance.state.groupBy,\r\n  ]);\r\n  hooks.visibleColumns.push(visibleColumns);\r\n  hooks.useInstance.push(useInstance);\r\n  hooks.prepareRow.push(prepareRow);\r\n};\r\n\r\nuseSummary.pluginName = 'useSummary';\r\n\r\n// Reducer\r\nfunction reducer(state, action, previousState, instance) {\r\n  if (action.type === actions.init) {\r\n    return {\r\n      groupBy: [],\r\n      ...state,\r\n    };\r\n  }\r\n\r\n  if (action.type === actions.resetGroupBy) {\r\n    return {\r\n      ...state,\r\n      groupBy: instance.initialState.groupBy || [],\r\n    };\r\n  }\r\n\r\n  if (action.type === actions.setGroupBy) {\r\n    const { value } = action;\r\n    return {\r\n      ...state,\r\n      groupBy: value,\r\n    };\r\n  }\r\n}\r\n\r\nfunction visibleColumns(\r\n  columns,\r\n  {\r\n    instance: {\r\n      state: { groupBy },\r\n    },\r\n  },\r\n) {\r\n  // Sort grouped columns to the start of the column list\r\n  // before the headers are built\r\n\r\n  const groupByColumns = groupBy\r\n    .map(g => columns.find(col => col.id === g))\r\n    .filter(Boolean);\r\n\r\n  const nonGroupByColumns = columns.filter(col => !groupBy.includes(col.id));\r\n\r\n  columns = [...groupByColumns, ...nonGroupByColumns];\r\n\r\n  columns.forEach(column => {\r\n    column.isGrouped = groupBy.includes(column.id);\r\n    column.groupedIndex = groupBy.indexOf(column.id);\r\n  });\r\n\r\n  return columns;\r\n}\r\n\r\nconst defaultUserAggregations = {};\r\n\r\nfunction useInstance(instance) {\r\n  const {\r\n    data,\r\n    rows,\r\n    flatRows,\r\n    rowsById,\r\n    allColumns,\r\n    groupByFn = defaultGroupByFn,\r\n    manualGroupBy,\r\n    aggregations: userAggregations = defaultUserAggregations,\r\n    plugins,\r\n    state: { groupBy },\r\n    dispatch,\r\n    autoResetGroupBy = true,\r\n    disableGroupBy,\r\n    defaultCanGroupBy,\r\n  } = instance;\r\n\r\n  ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useSummary');\r\n\r\n  allColumns.forEach(column => {\r\n    const {\r\n      accessor,\r\n      defaultGroupBy: defaultColumnGroupBy,\r\n      disableGroupBy: columnDisableGroupBy,\r\n    } = column;\r\n\r\n    column.canGroupBy = accessor\r\n      ? getFirstDefined(\r\n          column.canGroupBy,\r\n          columnDisableGroupBy === true ? false : undefined,\r\n          disableGroupBy === true ? false : undefined,\r\n          true,\r\n        )\r\n      : getFirstDefined(\r\n          column.canGroupBy,\r\n          defaultColumnGroupBy,\r\n          defaultCanGroupBy,\r\n          false,\r\n        );\r\n\r\n    column.Aggregated = column.Aggregated || column.Cell;\r\n  });\r\n  const setGroupBy = React.useCallback(\r\n    value => {\r\n      dispatch({ type: actions.setGroupBy, value });\r\n    },\r\n    [dispatch],\r\n  );\r\n\r\n  const [\r\n    groupedRows,\r\n    groupedFlatRows,\r\n    groupedRowsById,\r\n    onlyGroupedFlatRows,\r\n    onlyGroupedRowsById,\r\n    nonGroupedFlatRows,\r\n    nonGroupedRowsById,\r\n    summaryRows,\r\n  ] = React.useMemo(() => {\r\n    if (manualGroupBy || !groupBy.length) {\r\n      return [\r\n        rows,\r\n        flatRows,\r\n        rowsById,\r\n        emptyArray,\r\n        emptyObject,\r\n        flatRows,\r\n        rowsById,\r\n      ];\r\n    }\r\n\r\n    // Ensure that the list of filtered columns exist\r\n    const existingGroupBy = groupBy.filter(g =>\r\n      allColumns.find(col => col.id === g),\r\n    );\r\n\r\n    // Find the columns that can or are aggregating\r\n    // Uses each column to aggregate rows into a single value\r\n    const aggregateRowsToValues = (leafRows, groupedRows, depth) => {\r\n      const values = {};\r\n\r\n      allColumns.forEach(column => {\r\n        // Don't aggregate columns that are in the groupBy\r\n        if (existingGroupBy.includes(column.id)) {\r\n          values[column.id] = groupedRows[0]\r\n            ? groupedRows[0].values[column.id]\r\n            : null;\r\n          return;\r\n        }\r\n\r\n        // Aggregate the values\r\n        let aggregateFn =\r\n          typeof column.aggregate === 'function'\r\n            ? column.aggregate\r\n            : userAggregations[column.aggregate] ||\r\n              aggregations[column.aggregate];\r\n\r\n        if (aggregateFn) {\r\n          // Get the columnValues to aggregate\r\n          const groupedValues = groupedRows.map(row => row.values[column.id]);\r\n\r\n          // Get the columnValues to aggregate\r\n          const leafValues = leafRows.map(row => {\r\n            let columnValue = row.values[column.id];\r\n\r\n            if (!depth && column.aggregateValue) {\r\n              const aggregateValueFn =\r\n                typeof column.aggregateValue === 'function'\r\n                  ? column.aggregateValue\r\n                  : userAggregations[column.aggregateValue] ||\r\n                    aggregations[column.aggregateValue];\r\n\r\n              if (!aggregateValueFn) {\r\n                console.info({ column });\r\n                throw new Error(\r\n                  `React Table: Invalid column.aggregateValue option for column listed above`,\r\n                );\r\n              }\r\n\r\n              columnValue = aggregateValueFn(columnValue, row, column);\r\n            }\r\n            return columnValue;\r\n          });\r\n\r\n          values[column.id] = aggregateFn(leafValues, groupedValues);\r\n        } else if (column.aggregate) {\r\n          console.info({ column });\r\n          throw new Error(\r\n            `React Table: Invalid column.aggregate option for column listed above`,\r\n          );\r\n        } else {\r\n          values[column.id] = null;\r\n        }\r\n      });\r\n\r\n      return values;\r\n    };\r\n\r\n    let groupedFlatRows = [];\r\n    const groupedRowsById = {};\r\n    const onlyGroupedFlatRows = [];\r\n    const onlyGroupedRowsById = {};\r\n    const nonGroupedFlatRows = [];\r\n    const nonGroupedRowsById = {};\r\n\r\n    // Recursively group the data\r\n    const groupUpRecursively = (rows, depth = 0, parentId) => {\r\n      // This is the last level, just return the rows\r\n      if (depth === existingGroupBy.length) {\r\n        return rows;\r\n      }\r\n\r\n      const columnId = existingGroupBy[depth];\r\n\r\n      // Group the rows together for this level\r\n      let rowGroupsMap = groupByFn(rows, columnId);\r\n\r\n      // Peform aggregations for each group\r\n      const aggregatedGroupedRows = Object.entries(rowGroupsMap).map(\r\n        ([groupByVal, groupedRows], index) => {\r\n          let id = `${columnId}:${groupByVal}`;\r\n          id = parentId ? `${parentId}>${id}` : id;\r\n\r\n          // First, Recurse to group sub rows before aggregation\r\n          const subRows = groupUpRecursively(groupedRows, depth + 1, id);\r\n\r\n          // Flatten the leaf rows of the rows in this group\r\n          const leafRows = depth\r\n            ? flattenBy(groupedRows, 'leafRows')\r\n            : groupedRows;\r\n\r\n          const values = aggregateRowsToValues(leafRows, groupedRows, depth);\r\n\r\n          const row = {\r\n            id,\r\n            isGrouped: true,\r\n            groupByID: columnId,\r\n            groupByVal,\r\n            values,\r\n            subRows,\r\n            leafRows,\r\n            depth,\r\n            index,\r\n          };\r\n\r\n          subRows.forEach(subRow => {\r\n            groupedFlatRows.push(subRow);\r\n            groupedRowsById[subRow.id] = subRow;\r\n            if (subRow.isGrouped) {\r\n              onlyGroupedFlatRows.push(subRow);\r\n              onlyGroupedRowsById[subRow.id] = subRow;\r\n            } else {\r\n              nonGroupedFlatRows.push(subRow);\r\n              nonGroupedRowsById[subRow.id] = subRow;\r\n            }\r\n          });\r\n\r\n          return row;\r\n        },\r\n      );\r\n\r\n      return aggregatedGroupedRows;\r\n    };\r\n\r\n    const groupedRows = groupUpRecursively(rows);\r\n    const summaryRows = [\r\n      {\r\n        id: 'summary',\r\n        isGrouped: true,\r\n        values: aggregateRowsToValues(rows, rows, 0),\r\n      },\r\n    ];\r\n    groupedRows.forEach(subRow => {\r\n      groupedFlatRows.push(subRow);\r\n      groupedRowsById[subRow.id] = subRow;\r\n      if (subRow.isGrouped) {\r\n        onlyGroupedFlatRows.push(subRow);\r\n        onlyGroupedRowsById[subRow.id] = subRow;\r\n      } else {\r\n        nonGroupedFlatRows.push(subRow);\r\n        nonGroupedRowsById[subRow.id] = subRow;\r\n      }\r\n    });\r\n\r\n    // Assign the new data\r\n    return [\r\n      groupedRows,\r\n      groupedFlatRows,\r\n      groupedRowsById,\r\n      onlyGroupedFlatRows,\r\n      onlyGroupedRowsById,\r\n      nonGroupedFlatRows,\r\n      nonGroupedRowsById,\r\n      summaryRows,\r\n    ];\r\n  }, [\r\n    manualGroupBy,\r\n    groupBy,\r\n    rows,\r\n    flatRows,\r\n    rowsById,\r\n    allColumns,\r\n    userAggregations,\r\n    groupByFn,\r\n  ]);\r\n\r\n  const getAutoResetGroupBy = useGetLatest(autoResetGroupBy);\r\n\r\n  useMountedLayoutEffect(() => {\r\n    if (getAutoResetGroupBy()) {\r\n      dispatch({ type: actions.resetGroupBy });\r\n    }\r\n  }, [dispatch, manualGroupBy ? null : data]);\r\n\r\n  Object.assign(instance, {\r\n    preGroupedRows: rows,\r\n    preGroupedFlatRow: flatRows,\r\n    preGroupedRowsById: rowsById,\r\n    groupedRows,\r\n    groupedFlatRows,\r\n    groupedRowsById,\r\n    onlyGroupedFlatRows,\r\n    onlyGroupedRowsById,\r\n    nonGroupedFlatRows,\r\n    nonGroupedRowsById,\r\n    rows: groupedRows,\r\n    flatRows: groupedFlatRows,\r\n    rowsById: groupedRowsById,\r\n    setGroupBy,\r\n    summaryRows,\r\n  });\r\n}\r\n\r\nfunction prepareRow(row) {\r\n  row.allCells.forEach(cell => {\r\n    // Grouped cells are in the groupBy and the pivot cell for the row\r\n    cell.isGrouped = cell.column.isGrouped && cell.column.id === row.groupByID;\r\n    // Placeholder cells are any columns in the groupBy that are not grouped\r\n    cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped;\r\n    // Aggregated cells are not grouped, not repeated, but still have subRows\r\n    cell.isAggregated =\r\n      !cell.isGrouped && !cell.isPlaceholder && row.subRows?.length;\r\n  });\r\n}\r\n\r\nexport function defaultGroupByFn(rows, columnId) {\r\n  return rows.reduce((prev, row, i) => {\r\n    // TODO: Might want to implement a key serializer here so\r\n    // irregular column values can still be grouped if needed?\r\n    const resKey = `${row.values[columnId]}`;\r\n    prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : [];\r\n    prev[resKey].push(row);\r\n    return prev;\r\n  }, {});\r\n}\r\n","import React from 'react';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from '../../IRow';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n  getAssetImageThumbSrc,\r\n  ImageSize,\r\n} from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport {\r\n  BasicCardWithInfo,\r\n  CardPosition,\r\n  CardSize,\r\n} from 'app/components/BasicCards';\r\nimport { PrimaryAction } from './PrimaryAction';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser, selectImageExist } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface TableCardProps<TRow extends IRow> {\r\n  row: Row<TRow>;\r\n  imageSrcKey?: keyof TRow;\r\n  titleKey: keyof TRow;\r\n  primaryAction?: PrimaryAction<TRow>;\r\n  someSelected: boolean;\r\n  viewCheckBox?: boolean;\r\n  useSelect: boolean;\r\n  hasAdditionalActions: boolean;\r\n  hasInlineRowActions: boolean;\r\n  toggleAllRowsSelected?: (value?: boolean) => void;\r\n  isRowSelectable: (row: Row<TRow>) => boolean;\r\n  active: boolean;\r\n  cardSize?: CardSize;\r\n  showTitleCell?: boolean;\r\n  preventInnerClicks?: boolean;\r\n  compact?: boolean;\r\n  contentEditable?: boolean;\r\n  cardPosition?: CardPosition;\r\n  loading?: boolean;\r\n}\r\n\r\nexport function TableCard<Trow extends IRow>({\r\n  row,\r\n  imageSrcKey,\r\n  titleKey,\r\n  primaryAction,\r\n  viewCheckBox = true,\r\n  useSelect,\r\n  hasAdditionalActions,\r\n  hasInlineRowActions,\r\n  toggleAllRowsSelected,\r\n  isRowSelectable,\r\n  someSelected,\r\n  active,\r\n  cardSize = 'small',\r\n  showTitleCell,\r\n  compact,\r\n  contentEditable,\r\n  cardPosition,\r\n  loading,\r\n  ...props\r\n}: TableCardProps<Trow>) {\r\n  const isMobile = DetectIsMobile() || compact === true;\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const { t } = useTranslation();\r\n  const useButtons = React.useMemo(() => {\r\n    return (\r\n      hasInlineRowActions &&\r\n      row.cells.filter(c => c.column.id.startsWith('InlineActionColumn'))\r\n        .length > 0\r\n    );\r\n  }, [hasInlineRowActions, row.cells]);\r\n\r\n  const sizeOfMobileCard = React.useMemo(() => {\r\n    return isMobile ? (cardSize === undefined ? 'small' : cardSize) : undefined;\r\n  }, [cardSize, isMobile]);\r\n  const position = React.useMemo(() => {\r\n    return isMobile\r\n      ? 'horizontal'\r\n      : cardPosition === undefined\r\n      ? 'vertical'\r\n      : cardPosition;\r\n  }, [cardPosition, isMobile]);\r\n  const img = React.useMemo(() => {\r\n    return row.original[imageSrcKey ?? ''];\r\n  }, [imageSrcKey, row.original]);\r\n  const hasImg = React.useMemo(() => {\r\n    return (img ?? null) !== null && typeof img === 'string';\r\n  }, [img]);\r\n  const imageExist = useSelector(state =>\r\n    selectImageExist(state, hasImg ? img : null),\r\n  );\r\n  const imageSize = React.useMemo<ImageSize>(() => {\r\n    if (position === 'horizontal') {\r\n      if (!!sizeOfMobileCard) {\r\n        return sizeOfMobileCard === 'medium' ? 'thumbLarge' : 'thumb';\r\n      } else {\r\n        return cardSize === 'medium' ? 'horizontalLarge' : 'horizontal';\r\n      }\r\n    } else {\r\n      return cardSize === 'medium' ? 'verticalLarge' : 'vertical';\r\n    }\r\n  }, [cardSize, position, sizeOfMobileCard]);\r\n  const imgSrc = React.useMemo(() => {\r\n    return getAssetImageThumbSrc(img, imageSize, imageExist);\r\n  }, [imageExist, imageSize, img]);\r\n  const [showSelect, setShowSelect] = React.useState(\r\n    isMobile ? viewCheckBox === true : someSelected || viewCheckBox === true,\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    setShowSelect(\r\n      isMobile ? viewCheckBox === true : someSelected || viewCheckBox === true,\r\n    );\r\n  }, [isMobile, someSelected, viewCheckBox]);\r\n  const title = React.useMemo(() => {\r\n    return row.cells.find(c => c.column.id === titleKey);\r\n  }, [row.cells, titleKey]);\r\n  const select = React.useMemo(() => {\r\n    return row.cells.find(c => c.column.id === 'selection');\r\n  }, [row.cells]);\r\n  const isDisabled = React.useMemo(() => {\r\n    return !isRowSelectable(row);\r\n  }, [isRowSelectable, row]);\r\n  const cells = React.useMemo(() => {\r\n    return row.cells\r\n      .filter(\r\n        c =>\r\n          c.column.id !== titleKey &&\r\n          c.column.id !== imageSrcKey &&\r\n          c.column.id !== 'selection',\r\n      )\r\n      .filter(f => f.value !== null && f.value !== undefined && f.value !== '')\r\n      .slice(0, 3);\r\n  }, [imageSrcKey, row.cells, titleKey]);\r\n\r\n  return (\r\n    <BasicCardWithInfo\r\n      title={showTitleCell ? title?.render('Cell') : title?.value}\r\n      info={\r\n        isDisabled\r\n          ? undefined\r\n          : useSelect\r\n          ? t(translations.CardMouseOver_info)\r\n          : undefined\r\n      }\r\n      backStyle=\"white\"\r\n      imageSrc={imgSrc}\r\n      disabled={isDisabled}\r\n      //status={active ? 'active' : undefined}\r\n      selected={active}\r\n      selectVisible={\r\n        showSelect\r\n        //isMobile ? useSelect && !isDisabled && viewCheckBox : showSelect\r\n      }\r\n      checkBox={\r\n        <React.Fragment>{!!select && select.render('Cell')}</React.Fragment>\r\n      }\r\n      showBullet={true}\r\n      cardSize={cardSize}\r\n      mobileSize={sizeOfMobileCard}\r\n      position={position}\r\n      primaryAction={() => {\r\n        if (!!primaryAction) {\r\n          primaryAction(row, toggleAllRowsSelected, user, undefined, isMobile);\r\n        } else if (useSelect && !isDisabled) {\r\n          row.toggleRowSelected();\r\n        }\r\n      }}\r\n      useSelect={useSelect} //&& viewCheckBox\r\n      useButtons={useButtons}\r\n      useImage={imageSrcKey !== undefined}\r\n      topActions={\r\n        hasAdditionalActions\r\n          ? row.cells\r\n              .filter(c => c.column.id.startsWith('ActionColumn'))\r\n              .map(c => {\r\n                return {\r\n                  key: c.column.id,\r\n                  action: c.render('Cell'),\r\n                };\r\n              })\r\n          : undefined\r\n      }\r\n      hasTopActions={hasAdditionalActions}\r\n      cardContentRows={\r\n        cells.length > 0\r\n          ? cells\r\n              .filter(\r\n                f =>\r\n                  !(\r\n                    f.column.id.startsWith('ActionColumn') ||\r\n                    f.column.id.startsWith('InlineActionColumn')\r\n                  ),\r\n              )\r\n              .map(c => {\r\n                return {\r\n                  key: c.column.id,\r\n                  label: c.render('Header'),\r\n                  text: c.render('Cell'),\r\n                };\r\n              })\r\n          : undefined\r\n      }\r\n      buttons={\r\n        hasInlineRowActions\r\n          ? row.cells\r\n              .filter(c => c.column.id.startsWith('InlineActionColumn'))\r\n              .map(c => {\r\n                return {\r\n                  key: c.column.id,\r\n                  button: c.render('Cell'),\r\n                };\r\n              })\r\n          : undefined\r\n      }\r\n      preventInnerClicks={props.preventInnerClicks}\r\n      contentEditable={contentEditable}\r\n      loading={loading}\r\n    />\r\n  );\r\n}\r\n","import { Grow, Tabs, useTheme } from '@material-ui/core';\r\nimport { TabsActionRenderer } from './TabsActionRender';\r\nimport * as React from 'react';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from '../..';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport clsx from 'clsx';\r\n\r\nexport interface TabsToolbarProps<TRow extends IRow>\r\n  extends ICanRaiseBasicTableRefreshEvent {\r\n  rowsCount: number;\r\n  rows: Row<TRow>[];\r\n  leftTabs?: TabsActionRenderer<TRow>[];\r\n  rightTabActions?: TabsActionRenderer<TRow>[];\r\n  selectedValue?: number;\r\n  selectedArray: TRow[];\r\n  toggleAllRowsSelected: (value?: boolean) => void;\r\n  appliedFilters?: IFilterSettings<TRow>[];\r\n  allRowsSelected?: boolean;\r\n  isRowSelectable: (row: Row<TRow>) => boolean;\r\n  getMultiMode?: (mode: boolean) => void;\r\n  onAllRowsSelected?: (rows: Row<TRow>[], selected: boolean) => void;\r\n  disableMultiMode?: boolean;\r\n  defaultMultiMode?: boolean;\r\n  showClear?: boolean;\r\n  compact?: boolean;\r\n  selectMultiLabel?: string;\r\n}\r\n\r\nexport const TabsToolbar = React.memo(function TabsToolbarFunc<TRow>(\r\n  props: TabsToolbarProps<TRow>,\r\n) {\r\n  const {\r\n    leftTabs,\r\n    selectedValue,\r\n    onRefresh,\r\n    selectedArray,\r\n    toggleAllRowsSelected,\r\n    appliedFilters,\r\n    rowsCount,\r\n    rows,\r\n    allRowsSelected,\r\n    isRowSelectable,\r\n    getMultiMode,\r\n    onAllRowsSelected,\r\n    disableMultiMode,\r\n    defaultMultiMode = true,\r\n    rightTabActions,\r\n    //showClear,\r\n    compact,\r\n  } = props;\r\n  const [value, setValue] = React.useState(selectedValue || 0);\r\n  const isMobile = DetectIsMobile();\r\n  const { t } = useTranslation();\r\n  const theme = useTheme();\r\n  const [multiMode, setMultiMode] = React.useState<boolean>(\r\n    (selectedArray.length > 0 && !disableMultiMode) ||\r\n      defaultMultiMode === true,\r\n  );\r\n  // const handleChecked = React.useCallback(\r\n  //   ev => {\r\n  //     if (!multiMode) {\r\n  //       setMultiMode(true);\r\n  //       !!getMultiMode && getMultiMode(true);\r\n  //     } else {\r\n  //       let selectable = rows.filter(f => isRowSelectable(f));\r\n  //       selectable.forEach(f => {\r\n  //         f.isSelected && f.toggleRowSelected(false);\r\n  //       });\r\n  //       if (!!onAllRowsSelected) {\r\n  //         onAllRowsSelected(selectable, false);\r\n  //       }\r\n  //       setMultiMode(false);\r\n  //       !!getMultiMode && getMultiMode(false);\r\n  //     }\r\n  //   },\r\n  //   [getMultiMode, isRowSelectable, multiMode, onAllRowsSelected, rows],\r\n  // );\r\n  const handleChange = (event: any, newValue: number) => {\r\n    setValue(newValue);\r\n  };\r\n  React.useEffect(() => {\r\n    if (selectedArray.length > 1 || defaultMultiMode === true) {\r\n      //!multiMode &&\r\n      setMultiMode(true);\r\n    } else {\r\n      setMultiMode(false);\r\n    }\r\n  }, [defaultMultiMode, multiMode, selectedArray.length]);\r\n  return (\r\n    <TabsContainer\r\n      theme={theme}\r\n      className={clsx({ shortView: compact || isMobile })}\r\n    >\r\n      {!isMobile && !compact && (\r\n        <div className={'tabsContent'}>\r\n          {!!leftTabs && leftTabs.length > 0 && (\r\n            <Grow in={true}>\r\n              <Tabs\r\n                action={ref => ref?.updateIndicator()}\r\n                selectionFollowsFocus={false}\r\n                indicatorColor=\"primary\"\r\n                value={value}\r\n                onChange={(ev, value) => handleChange(ev, value)}\r\n                aria-label=\"nav tabs example\"\r\n              >\r\n                {leftTabs.map((tab, index) =>\r\n                  tab(\r\n                    rowsCount,\r\n                    rows,\r\n                    toggleAllRowsSelected,\r\n                    selectedArray,\r\n                    allRowsSelected,\r\n                    onRefresh,\r\n                    appliedFilters,\r\n                  ),\r\n                )}\r\n              </Tabs>\r\n            </Grow>\r\n          )}\r\n        </div>\r\n      )}\r\n      <div\r\n        className={clsx('buttonsContent', { shortView: compact || isMobile })}\r\n      >\r\n        {/* selectedArray.length > 0 && (multiMode || showClear) && */}\r\n        {!disableMultiMode && (\r\n          <Button\r\n            key={0}\r\n            variant=\"ghost\"\r\n            size={compact || isMobile ? 'small' : 'medium'}\r\n            startIcon={<Icon icon=\"times\" />}\r\n            disabled={!(selectedArray.length > 0)}\r\n            onClick={event => {\r\n              event.stopPropagation();\r\n              let selectable = rows.filter(f => isRowSelectable(f));\r\n              selectable.forEach(f => {\r\n                f.toggleRowSelected(false);\r\n              });\r\n              if (!!onAllRowsSelected) {\r\n                onAllRowsSelected(selectable, false);\r\n              }\r\n              let allPagesUnselected = selectedArray.length > selectable.length;\r\n              setMultiMode(allPagesUnselected);\r\n              !!getMultiMode && getMultiMode(allPagesUnselected);\r\n            }}\r\n          >\r\n            {compact || isMobile\r\n              ? t(translations.Unselect)\r\n              : t(translations.ClearSelection)}\r\n          </Button>\r\n        )}\r\n        {/* (multiMode === true || selectedArray.length > 0) && */}\r\n        {!disableMultiMode && (\r\n          <Button\r\n            key={1}\r\n            variant=\"ghost\"\r\n            title={t(translations.CoreMultiSelect_info) as string}\r\n            size={compact || isMobile ? 'small' : 'medium'}\r\n            startIcon={<Icon icon=\"check\" />}\r\n            onClick={() => {\r\n              setMultiMode(true);\r\n              !!getMultiMode && getMultiMode(true);\r\n              let selectable = rows.filter(f => isRowSelectable(f));\r\n              selectable.forEach(f => {\r\n                f.toggleRowSelected(true);\r\n              });\r\n              if (!!onAllRowsSelected) {\r\n                onAllRowsSelected(selectable, true);\r\n              }\r\n            }}\r\n          >\r\n            {t(translations.CoreSelectAll)}\r\n          </Button>\r\n        )}\r\n        {/* <BasicToggle\r\n          name=\"checkedB\"\r\n          disabled={disableMultiMode}\r\n          checked={multiMode && !disableMultiMode}\r\n          onClick={handleChecked}\r\n          label={\r\n            compact || isMobile\r\n              ? (t(translations.SelectMultiple) as string)\r\n              : selectMultiLabel ?? (t(translations.SelectMultiple) as string)\r\n          }\r\n        /> */}\r\n\r\n        {/* {tabRightActions\r\n          .filter(f => f !== undefined)\r\n          .map((tab, index) => (\r\n            <span key={index}>{tab(rowsCount, rows)}</span>\r\n          ))} */}\r\n      </div>\r\n      {!!rightTabActions && rightTabActions.length > 0 && (\r\n        <>\r\n          {rightTabActions\r\n            .filter(f => f !== undefined)\r\n            .map((tab, index) => (\r\n              <span key={index}>{tab(rowsCount, rows)}</span>\r\n            ))}\r\n        </>\r\n      )}\r\n    </TabsContainer>\r\n  );\r\n});\r\nconst TabsContainer = styled('div')(({ theme }) => ({\r\n  width: '100%',\r\n  display: 'flex',\r\n  flexDirection: 'row',\r\n  padding: '8px 32px',\r\n  alignItems: 'center',\r\n  justifyContent: 'space-between',\r\n  '&.shortView': {\r\n    flexDirection: 'column',\r\n    padding: '8px 8px 16px',\r\n    alignItems: 'start',\r\n  },\r\n  '& .tabsContent': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    gap: 16,\r\n  },\r\n  '& .buttonsContent': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    //flexWrap: isMobile ? 'wrap' : 'nowrap',\r\n    gap: 16,\r\n    '&.shortView': {\r\n      gap: 0,\r\n    },\r\n  },\r\n}));\r\n","import { useTheme } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { SelectedRowsActionExtRenderer } from '../SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport * as React from 'react';\r\nimport { IdType, Row } from 'react-table';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectHideNavigation } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\nimport { IRow } from '..';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../ControlledTable/ControlledTableProps';\r\nimport styled from 'styled-components';\r\n\r\nconst genericMemo: <T>(component: T) => T = React.memo;\r\n\r\nexport interface FloatingActionsProps<TRow extends IRow>\r\n  extends ICanRaiseBasicTableRefreshEvent {\r\n  selectedActions: SelectedRowsActionExtRenderer<TRow>[];\r\n  rows: Row<TRow>[];\r\n  useSidePanel?: boolean;\r\n  buttonActions?: SelectedRowsActionExtRenderer<TRow>[];\r\n\r\n  selectedArray: TRow[];\r\n  toggleAllRowsSelected: (value?: boolean) => void;\r\n  toggleRowSelected: (rowId: IdType<TRow>, set?: boolean | undefined) => void;\r\n  totalRows: number;\r\n  compact?: boolean;\r\n}\r\n\r\nexport const FloatingContainer = styled('div')(({ theme }) => ({\r\n  display: 'flex',\r\n  alignItems: 'center',\r\n  justifyContent: 'space-between',\r\n  gap: 8,\r\n  height: 72,\r\n  background: '#ffffff',\r\n  borderRadius: 8,\r\n  boxShadow: '0px 2px 18px rgba(8, 24, 41, 0.16)',\r\n  '&.fixedContainer': {\r\n    position: 'fixed',\r\n    insetBlock: 'auto 80px',\r\n    insetInline: 'auto 160px',\r\n    zIndex: 1070,\r\n    width: '70%',\r\n    padding: 16,\r\n    '&.fullWidth': {\r\n      width: '80%',\r\n    },\r\n  },\r\n  '&.fixedContainerMobile': {\r\n    //position: 'absolute',\r\n    zIndex: 1070, //zIndex: 1500,\r\n    width: '100%',\r\n    padding: '16px 8px',\r\n    //bottom: 'unset',\r\n    position: 'fixed',\r\n    bottom: '50px',\r\n    '&.isPopup': {\r\n      position: 'absolute',\r\n      bottom: '50px',\r\n    },\r\n  },\r\n  '& .buttonsContent': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: 8,\r\n    width: 'calc(100% - 200px)',\r\n    '&.mobile': {\r\n      width: 'calc(100% - 115px)',\r\n    },\r\n    '&.compact': {\r\n      width: 'auto',\r\n    },\r\n    '& .actions': {\r\n      display: 'inline-flex',\r\n      flex: '1 1 auto',\r\n      position: 'relative',\r\n      whiteSpace: 'nowrap',\r\n      overflow: 'auto hidden',\r\n      alignItems: 'center',\r\n      gap: 8,\r\n      '&.compactActions': {\r\n        flex: '0 1 auto',\r\n      },\r\n      '& .rowsCount': {\r\n        display: 'inline-flex',\r\n      },\r\n    },\r\n  },\r\n  '& .buttonActions': {\r\n    display: 'inline-flex',\r\n    flex: '1 1 auto',\r\n    position: 'relative',\r\n    whiteSpace: 'nowrap',\r\n    overflow: 'auto hidden',\r\n    gap: 8,\r\n  },\r\n}));\r\n\r\nfunction FloatingActionsFunc<TRow>(props: FloatingActionsProps<TRow>) {\r\n  const {\r\n    selectedActions: actions,\r\n    onRefresh,\r\n    selectedArray,\r\n    toggleAllRowsSelected,\r\n    totalRows,\r\n    buttonActions,\r\n    useSidePanel,\r\n    toggleRowSelected,\r\n    compact,\r\n    rows,\r\n  } = props;\r\n  const isMobile = DetectIsMobile() === true;\r\n  const hideNavigation = useSelector(selectHideNavigation);\r\n\r\n  const maxButtons = React.useMemo(() => {\r\n    return isMobile || compact === true ? 1 : 6;\r\n  }, [compact, isMobile]);\r\n  const baseActions = React.useMemo(() => {\r\n    return actions.length > maxButtons\r\n      ? actions.slice(0, maxButtons - 1)\r\n      : actions;\r\n  }, [actions, maxButtons]);\r\n  const sperActions = React.useMemo(() => {\r\n    return actions.length > maxButtons ? actions.slice(maxButtons - 1) : [];\r\n  }, [actions, maxButtons]);\r\n  const theme = useTheme();\r\n  // const toggleSingleSelected = (\r\n  //   rowId: IdType<TRow>,\r\n  //   set?: boolean | undefined,\r\n  // ) => {\r\n  //   let selectable = rows.filter(f => f.id === rowId).length > 0;\r\n  //   if (selectable) {\r\n  //     return toggleRowSelected(rowId, set);\r\n  //   }\r\n  // };\r\n  return (\r\n    <FloatingContainer\r\n      theme={theme}\r\n      className={clsx({\r\n        fixedContainer: !isMobile && !compact,\r\n        fixedContainerMobile: isMobile || compact === true,\r\n        fullWidth: useSidePanel || hideNavigation,\r\n        isPopup: useSidePanel ?? false,\r\n      })}\r\n    >\r\n      <div\r\n        className={clsx('buttonsContent', {\r\n          mobile: isMobile,\r\n          compact: compact === true || buttonActions === undefined,\r\n        })}\r\n      >\r\n        <div\r\n          className={clsx('actions', {\r\n            compactActions: isMobile || compact === true,\r\n          })}\r\n          key={'selected_actions'}\r\n        >\r\n          <div className=\"rowsCount\" key={'rows_count'}>\r\n            <Body\r\n              bold={true}\r\n              size=\"small\"\r\n            >{`${selectedArray.length} of ${totalRows} Items`}</Body>\r\n          </div>\r\n          {sperActions.length > 0 ? (\r\n            <React.Fragment>\r\n              {baseActions.map((item, index) =>\r\n                item(\r\n                  selectedArray,\r\n                  rows,\r\n                  onRefresh,\r\n                  toggleAllRowsSelected,\r\n                  toggleRowSelected,\r\n                ),\r\n              )}\r\n              <SperActions\r\n                actions={sperActions}\r\n                onRefresh={onRefresh}\r\n                selectedArray={selectedArray}\r\n                rows={rows}\r\n                toggleAllRowsSelected={toggleAllRowsSelected}\r\n                toggleRowSelected={toggleRowSelected}\r\n                isMobile={isMobile || compact === true}\r\n              />\r\n            </React.Fragment>\r\n          ) : (\r\n            <React.Fragment>\r\n              {actions.map((item, index) => (\r\n                <span key={index}>\r\n                  {item(\r\n                    selectedArray,\r\n                    rows,\r\n                    onRefresh,\r\n                    toggleAllRowsSelected,\r\n                    toggleRowSelected,\r\n                  )}\r\n                </span>\r\n              ))}\r\n            </React.Fragment>\r\n          )}\r\n        </div>\r\n      </div>\r\n      {!!buttonActions && buttonActions.length > 0 && (\r\n        <div key={'buttons_actions'} className={'buttonActions'}>\r\n          {buttonActions.map((item, index) => (\r\n            <span key={index}>\r\n              {item(\r\n                selectedArray,\r\n                rows,\r\n                onRefresh,\r\n                toggleAllRowsSelected,\r\n                toggleRowSelected,\r\n              )}\r\n            </span>\r\n          ))}\r\n        </div>\r\n      )}\r\n    </FloatingContainer>\r\n  );\r\n}\r\nexport interface SperActionsProps<TRow extends IRow>\r\n  extends ICanRaiseBasicTableRefreshEvent {\r\n  actions: SelectedRowsActionExtRenderer<TRow>[];\r\n  selectedArray: TRow[];\r\n  rows: Row<TRow>[];\r\n  toggleAllRowsSelected: (value?: boolean) => void;\r\n  toggleRowSelected: (rowId: IdType<TRow>, set?: boolean | undefined) => void;\r\n  isMobile: boolean;\r\n}\r\nfunction SperActionsFunc<TRow>(props: SperActionsProps<TRow>) {\r\n  const {\r\n    actions,\r\n    onRefresh,\r\n    selectedArray,\r\n    rows,\r\n    toggleAllRowsSelected,\r\n    toggleRowSelected,\r\n    isMobile,\r\n  } = props;\r\n  return (\r\n    <BookitChip\r\n      onDelete={() => {}}\r\n      deleteIcon={\r\n        <ReactActions\r\n          size=\"xs\"\r\n          iconVariant=\"ghost\"\r\n          id={`floating_actions`}\r\n          items={\r\n            [\r\n              ...actions?.map((item, index) => (\r\n                <span key={index}>\r\n                  {item(\r\n                    selectedArray,\r\n                    rows,\r\n                    onRefresh,\r\n                    toggleAllRowsSelected,\r\n                    toggleRowSelected,\r\n                  )}\r\n                </span>\r\n              )),\r\n            ].filter(v => !!v) as JSX.Element[]\r\n          }\r\n        ></ReactActions>\r\n      }\r\n      variant=\"default\"\r\n      customsize=\"medium\"\r\n      label={`and ${actions.length} more`}\r\n      customwidth={isMobile ? 150 : 180}\r\n      custombgcolor={bookitColors.primary.disabled}\r\n      customcolor={bookitColors.grayscale.blackComponents}\r\n      customiconcolor={bookitColors.primary.regular}\r\n      shape=\"circle\"\r\n      key={'sper_actions'}\r\n    />\r\n  );\r\n}\r\nexport const SperActions = genericMemo(SperActionsFunc);\r\nexport const FloatingActions = genericMemo(FloatingActionsFunc);\r\n","import { Box, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from '../..';\r\n\r\nexport interface ICustomToolbar<TRow extends IRow> extends Record<string, any> {\r\n  rowsCount: number;\r\n  rows: Row<TRow>[];\r\n}\r\nexport interface CustomToolbarProps {\r\n  Component: React.ReactNode;\r\n  compact?: boolean;\r\n}\r\n\r\nfunction CustomToolbarFunc(props: CustomToolbarProps) {\r\n  const { Component, compact } = props;\r\n  const isMobile = DetectIsMobile() || compact === true;\r\n  const classes = useStyles({ isMobile })();\r\n  return <Box className={classes.customRoot}>{Component}</Box>;\r\n}\r\nconst useStyles = ({ isMobile }: { isMobile: boolean }) =>\r\n  makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      customRoot: {\r\n        width: '100%',\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        padding: isMobile ? '8px 8px 16px' : '8px 32px',\r\n      },\r\n      tabsContant: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        gap: 16,\r\n      },\r\n      buttonsContant: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        //flexWrap: isMobile ? 'wrap' : 'nowrap',\r\n        gap: isMobile ? 0 : 16,\r\n      },\r\n    }),\r\n  );\r\nexport const CustomToolbar = React.memo(CustomToolbarFunc);\r\n","import * as React from 'react';\r\nimport { TableCell, TableRow } from '@material-ui/core';\r\nimport { Row } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { ICanRaiseBasicTableRefreshEvent } from './ControlledTableProps';\r\n\r\nexport interface RenderRowProps<TRow extends IRow>\r\n  extends ICanRaiseBasicTableRefreshEvent {\r\n  row: Row<TRow>;\r\n\r\n  onRowClicked?: (row: TRow) => void;\r\n  children?: (cell) => React.ReactNode;\r\n}\r\nexport function RenderRow<TRow extends IRow>({\r\n  row,\r\n  onRefresh,\r\n  onRowClicked,\r\n  children = cell =>\r\n    cell.render('Cell', {\r\n      onRefresh: onRefresh,\r\n    }),\r\n}: RenderRowProps<TRow>) {\r\n  const canClickRow = onRowClicked !== undefined;\r\n  return (\r\n    <Tooltip\r\n      style={canClickRow ? { cursor: 'pointer' } : undefined}\r\n      title={canClickRow ? 'click to view underlying data' : undefined}\r\n    >\r\n      <TableRow\r\n        onClick={() => onRowClicked?.(row.original)}\r\n        {...row.getRowProps()}\r\n      >\r\n        {\r\n          // Loop over the rows cells\r\n          row.cells.map(cell => {\r\n            // Apply the cell props\r\n            return (\r\n              <TableCell\r\n                style={{\r\n                  fontWeight: row.isGrouped ? 'bold' : undefined,\r\n                }}\r\n                {...cell.getCellProps()}\r\n              >\r\n                <span\r\n                  onClick={e => {\r\n                    if (canClickRow) {\r\n                      e.stopPropagation();\r\n                    }\r\n                  }}\r\n                >\r\n                  {\r\n                    // Render the cell contents\r\n                    children(cell)\r\n                  }\r\n                </span>\r\n              </TableCell>\r\n            );\r\n          })\r\n        }\r\n      </TableRow>\r\n    </Tooltip>\r\n  );\r\n}\r\n","import { H3 } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport React from 'react';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\n\r\nexport interface CustomEmptyTableProps {\r\n  id?: string;\r\n  headTitle?: string;\r\n  title?: string;\r\n  shortView?: boolean;\r\n}\r\n\r\nexport function CustomEmptyTable(props: CustomEmptyTableProps) {\r\n  const { headTitle, title } = props;\r\n  return (\r\n    <FlexRowDiv>\r\n      <Box textAlign=\"center\" style={{ marginTop: '5%' }}>\r\n        {props.shortView ? (\r\n          <React.Fragment>\r\n            {headTitle && (\r\n              <BasicTypography variant={'boldM'}>{headTitle}</BasicTypography>\r\n            )}\r\n            {title && (\r\n              <BasicTypography variant={'boldS'}>{title}</BasicTypography>\r\n            )}\r\n          </React.Fragment>\r\n        ) : (\r\n          <React.Fragment>\r\n            {headTitle && <H3>{headTitle}</H3>}\r\n            {title && <H4>{title}</H4>}\r\n          </React.Fragment>\r\n        )}\r\n      </Box>\r\n    </FlexRowDiv>\r\n  );\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const TableHeaderCellLabel = styled('span')`\r\n  white-space: break-spaces;\r\n  word-break: normal;\r\n`;\r\n\r\n// export const TableCell = withStyles({\r\n//   root: {\r\n//     height: '32px',\r\n//   },\r\n//   head: {},\r\n//   body: {\r\n//     padding: '10px 12px',\r\n//   },\r\n// })(MuiTableCell);\r\n","import * as React from 'react';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { RenderRow, RenderRowProps } from './RenderRow';\r\n\r\nexport interface RenderGroupedRowProps<TRow extends IRow>\r\n  extends RenderRowProps<TRow> {}\r\n\r\nexport function RenderGroupedRow<TRow extends IRow>({\r\n  row,\r\n  onRefresh,\r\n  onRowClicked,\r\n  children = cell =>\r\n    cell.isAggregated\r\n      ? // If the cell is aggregated, use the Aggregated\r\n        // renderer for cell\r\n        cell.render('Aggregated')\r\n      : cell.isPlaceholder\r\n      ? null // For cells with repeated values, render null\r\n      : // Otherwise, just render the regular cell\r\n        cell.render('Cell', {\r\n          onRefresh: onRefresh,\r\n        }),\r\n}: RenderGroupedRowProps<TRow>) {\r\n  return (\r\n    <RenderRow row={row} onRefresh={onRefresh} onRowClicked={onRowClicked}>\r\n      {children}\r\n    </RenderRow>\r\n  );\r\n}\r\n","/**\r\n *\r\n * ImportButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Menu } from '@material-ui/core';\r\n\r\nexport interface ImportButtonProps {\r\n  onClick: () => void;\r\n  importLink?: string;\r\n  importHandler?: () => void;\r\n  menuItems?: (onClose: () => void) => React.ReactNode[] | undefined;\r\n}\r\n\r\nexport function ImportButton(props: ImportButtonProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const [anchorEl, setAnchorEl] = React.useState(null);\r\n  const handleClick = event => {\r\n    setAnchorEl(event.currentTarget);\r\n  };\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n  };\r\n  const handleImport = async () => {\r\n    handleClose();\r\n    props.onClick();\r\n  };\r\n  const menuItems = React.useMemo(() => {\r\n    const result = props.menuItems ? props.menuItems(handleClose) : undefined;\r\n    return result;\r\n  }, [props]);\r\n  const showSingleImportButton =\r\n    menuItems === undefined || menuItems.length === 0;\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <Button\r\n        id=\"import-button\"\r\n        aria-controls=\"import-menu-button\"\r\n        aria-haspopup=\"true\"\r\n        variant=\"white\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"file-import\" />}\r\n        onClick={showSingleImportButton ? handleImport : handleClick}\r\n      >\r\n        {t(translations.Import)}\r\n      </Button>\r\n      {!showSingleImportButton && (\r\n        <>\r\n          <Menu\r\n            id=\"import-menu-button\"\r\n            anchorEl={anchorEl}\r\n            keepMounted\r\n            open={Boolean(anchorEl)}\r\n            onClose={handleClose}\r\n            MenuListProps={{ dense: true }}\r\n            getContentAnchorEl={null}\r\n            anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}\r\n          >\r\n            {menuItems}\r\n          </Menu>\r\n        </>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * ControlledTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  LinearProgress,\r\n  TableBody,\r\n  TableCell,\r\n  TableHead,\r\n  TablePagination,\r\n  TableRow,\r\n  TableSortLabel,\r\n} from '@material-ui/core';\r\nimport Table from '@material-ui/core/Table';\r\nimport {\r\n  useTable,\r\n  usePagination,\r\n  useSortBy,\r\n  UseSortByState,\r\n  UseSortByInstanceProps,\r\n  UsePaginationState,\r\n  PluginHook,\r\n  useGlobalFilter,\r\n  useExpanded,\r\n  Row,\r\n  HeaderGroup,\r\n  SortingRule,\r\n} from 'react-table';\r\nimport TablePaginationActions from 'app/components/BasicTable/TablePaginationActions';\r\nimport { TableContainer } from '@material-ui/core';\r\nimport { GlobalFilter } from 'app/components/BasicTable/GlobalFilter';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { BasicFilterGroup } from 'app/components/BasicTable/BasicFilter';\r\nimport { useState } from 'react';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { useStyles } from 'app/components/BasicTable/styles';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Button } from 'app/components//BasicButtons/Button';\r\nimport { TableHeaderIcon } from 'app/components//BasicIcons/SvgIcons';\r\nimport { Icon } from 'app/components//BasicIcons/FontAwesome';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { useEffect } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\n//import { Progress } from '../LoadingIndicator';\r\nimport { BasicTableProps } from '..';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { ExportButton } from 'app/components/BasicTable/ExportButton';\r\nimport { orderBy, sortedUniq } from 'lodash';\r\nimport { FilterContainer } from '../FilterContainer';\r\nimport { PageActionRenderer2 } from '../PageActions/PageActionsRenderer';\r\nimport { FilterIconButton } from 'app/components/BasicButtons/FilterIconButton';\r\nimport { TableRowsSkeleton } from '../components/TableSkeleton';\r\nimport { AlertContentType, BasicAlert } from 'app/components/BasicAlert';\r\nimport { ControlledTableProps } from './ControlledTableProps';\r\nimport { SelectedActions } from '../SelectedActions';\r\nimport { FiltersGroupDisplay } from '../BasicFilter/FiltersGroupDisplay';\r\nimport { NoTableData } from '../components/NoTableData';\r\nimport { useMemoFilters } from '../useMemoFilters';\r\nimport { useInlineRowActionsColumn, useRowActionsColumn } from '../RowActions';\r\nimport { useSummary } from '../Hooks/useSummary';\r\nimport { TableError } from '../components/TableError';\r\nimport { FiltersButton } from '../BasicFilter/FiltersButton';\r\nimport { TableCardGrid } from '../components/TableCardGrid';\r\nimport { TableCard } from '../components/TableCard';\r\nimport { ConfigureColumnsButton } from '../components/ConfigureColumnsButton';\r\nimport { TabsToolbar } from '../components/TabsToolbar';\r\nimport { selectActionTableProcessing } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { FloatingActions } from '../components/FloatingActions';\r\nimport clsx from 'clsx';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { CustomToolbar } from '../components/CustomTableToolbar';\r\nimport { RenderRow } from './RenderRow';\r\nimport { CustomEmptyTable } from '../components/CustomEmptyTable';\r\nimport DefaultRenderer from '../CellRenderers/DefaultRenderer';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { TableHeaderCellLabel } from './TableCell';\r\nimport { RenderGroupedRow } from './RenderGroupedRow';\r\nimport { selectGlobalSearchOpen } from 'app/pages/PublicAssets/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { ImportButton } from '../ImportButton';\r\nimport { Notification } from 'types/Notification';\r\nimport { addRowSelect } from './addRowSelect';\r\n\r\nexport type { IRow };\r\nexport type { BasicTableProps };\r\n\r\ntype IPartialTableState<TRow extends IRow> = Partial<\r\n  UseSortByState<TRow> & UsePaginationState<TRow> & UseSortByInstanceProps<TRow>\r\n>;\r\nexport type TableMode = 'card' | 'table';\r\n/**\r\n * Interface to the (initial) table state\r\n */\r\nexport interface IControlledTableState<TRow extends IRow>\r\n  extends IPartialTableState<TRow> {}\r\n\r\n// todo: enable row accessor for rowActions\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nconst defaultRowIdAccessor = <TRow extends IRow>(row: TRow): string =>\r\n  row.Id?.toString();\r\n\r\nconst defaultGetSubRows = original =>\r\n  original.Rows && original.Rows.length > 1 ? original.Rows : [];\r\nexport const defaultCheckIfRowIsSelectable = <TRow extends IRow>(\r\n  row: TRow,\r\n): boolean => true;\r\n/**\r\n * Server side driven Table component that will be reused in most of the pages\r\n * @param param0\r\n * @returns\r\n */\r\nexport function ControlledTable<TRow extends IRow>({\r\n  columns,\r\n  initialState,\r\n  getRowId = defaultRowIdAccessor,\r\n  searchColumns,\r\n  useExport = true,\r\n  onDownloadTemplate,\r\n  rowActions,\r\n  inlineRowActions,\r\n  pageActions,\r\n  screenName,\r\n  screenNameVariant = 'H1',\r\n  selectedRowsActions,\r\n  filterOpen = false,\r\n  screenId,\r\n  serviceGroups,\r\n  customParams,\r\n  useImportLink,\r\n  importLink,\r\n  importHandler,\r\n  ServiceGroupsOptional,\r\n  topAlertMessage,\r\n  onChangeState,\r\n  onSelectedRowsChange,\r\n  onExport,\r\n  compact = true,\r\n  updateMyData,\r\n  loading,\r\n  tableRowsSize = 'small',\r\n  getSubRows = defaultGetSubRows,\r\n  savedListSettings,\r\n  withToolBar = true,\r\n  allowCards,\r\n  useCardsByDefault,\r\n  onModeChange,\r\n  viewCardsCheck,\r\n  floatingTabSettings,\r\n  tabSectionSettings,\r\n  isRowSelectable,\r\n  onSelectedChange,\r\n  hideMenuOnMobile,\r\n  useConfigurable = true,\r\n  customToolbarSettings,\r\n  showTitleCell,\r\n  getAllFilteredRowsCallback,\r\n  useExportForImport,\r\n  exportForImportFilterKey,\r\n  customEmptyTableSettings,\r\n  manualPagination = true,\r\n  manualSorting = true,\r\n  enablePagination = true,\r\n  onRowClicked,\r\n  printing,\r\n  alwaysShowTableHeader,\r\n  hideFilters,\r\n  baseTableActionsOnToolbar,\r\n  baseSortBy,\r\n  showGlobalSearchIconOnToolbar,\r\n  toggleGlobalSearchIcon,\r\n  customExpandMenu,\r\n  customScreenName,\r\n  getDefaultFilters,\r\n  importMenuItems,\r\n  isContentEditable,\r\n  cardPosition = 'vertical',\r\n  tablePaddingVariant = 'regular',\r\n  minCardHeight = 80,\r\n  ...props\r\n}: ControlledTableProps<TRow>) {\r\n  const classes = useStyles();\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const dispatch = useDispatch();\r\n  const { actions: globalActions } = useAppSettingsSlice();\r\n  // collapsed state of the filters\r\n  // reference to the show/hide filters button\r\n  const [filtersButtonAnchorEl, setFiltersButtonAnchorEl] = React.useState(\r\n    null,\r\n  );\r\n  // collapsed state of the filters\r\n  const [open, setOpen] = React.useState<boolean>(false);\r\n  // data length - total number of the records\r\n  const dataLength = React.useMemo(() => {\r\n    return props.dataLength ?? 0;\r\n  }, [props.dataLength]);\r\n  // table Plugins array assembly\r\n  const tablePlugins: PluginHook<TRow>[] = [\r\n    useSummary,\r\n    useGlobalFilter,\r\n    useSortBy,\r\n    useExpanded,\r\n  ];\r\n  if (enablePagination) {\r\n    tablePlugins.push(usePagination);\r\n  }\r\n  if (searchColumns !== undefined && searchColumns?.length > 0) {\r\n    tablePlugins.unshift(useGlobalFilter);\r\n  }\r\n\r\n  if (props.useRowSelect) {\r\n    addRowSelect<TRow>(tablePlugins, isRowSelectable, onSelectedChange);\r\n  }\r\n  useInlineRowActionsColumn<TRow>(inlineRowActions, tablePlugins);\r\n  useRowActionsColumn<TRow>(rowActions, tablePlugins);\r\n  const columnsDefinition = React.useMemo(() => {\r\n    const columnDefaults = {\r\n      Cell: DefaultRenderer,\r\n    };\r\n    return columns.map(column => ({\r\n      ...columnDefaults,\r\n      ...column,\r\n    }));\r\n  }, [columns]);\r\n\r\n  const {\r\n    getTableProps,\r\n    getTableBodyProps,\r\n    headerGroups,\r\n    prepareRow,\r\n    rows: reactTableRows,\r\n    page: reactTablePage,\r\n    gotoPage,\r\n    setPageSize,\r\n    setGlobalFilter,\r\n    // todo: make use of the selectedRowIds\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    state: { pageIndex, pageSize, sortBy, selectedRowIds, globalFilter },\r\n    selectedFlatRows,\r\n    toggleAllRowsSelected,\r\n    toggleRowSelected,\r\n    isAllRowsSelected,\r\n    summaryRows,\r\n    setSortBy,\r\n  } = useTable(\r\n    {\r\n      columns: columnsDefinition,\r\n      data: props.data,\r\n      updateMyData,\r\n      initialState,\r\n      // server side controlled pagination\r\n      manualPagination: manualPagination,\r\n      // server side controlled sorting\r\n      manualSortBy: manualSorting,\r\n      // server side controlled global filter\r\n      manualGlobalFilter: true,\r\n      //When true, the selectedRowIds state will automatically reset if any of the following conditions are met:\r\n      autoResetSelectedRows: false,\r\n      //When true, the paging is always reset to initial pageIndex state.\r\n      autoResetPage: false,\r\n      // controlled page count (server sided pagination)\r\n      pageCount: props.pageCount,\r\n      getRowId: getRowId,\r\n      getSubRows,\r\n    },\r\n    ...tablePlugins,\r\n  );\r\n  const rows = React.useMemo(() => {\r\n    return enablePagination ? reactTablePage : reactTableRows;\r\n  }, [enablePagination, reactTablePage, reactTableRows]);\r\n\r\n  useEffect(() => {\r\n    if (baseSortBy !== undefined) {\r\n      setSortBy(baseSortBy);\r\n    }\r\n  }, [baseSortBy, setSortBy]);\r\n\r\n  useEffect(() => {\r\n    if (initialState?.pageSize !== undefined) {\r\n      setPageSize(initialState.pageSize);\r\n    }\r\n  }, [initialState?.pageSize, setPageSize]);\r\n\r\n  useEffect(() => {\r\n    if (initialState?.globalFilter !== undefined) {\r\n      setGlobalFilter(initialState.globalFilter);\r\n    }\r\n  }, [initialState?.globalFilter, setGlobalFilter]);\r\n  // useEffect(() => {\r\n  //   if (initialState?.pageIndex !== undefined) {\r\n  //     gotoPage(initialState.pageIndex);\r\n  //   }\r\n  // }, [gotoPage, initialState?.pageIndex]);\r\n\r\n  /**\r\n   * Track selected original row values. selectedRowIds only stores the row Ids.\r\n   * selectedFlatRows only holds selected rows from the current page.\r\n   */\r\n  const isSomeSelected = React.useMemo(() => {\r\n    return Object.keys(selectedRowIds || {}).length > 0;\r\n  }, [selectedRowIds]);\r\n  const [selected, setSelected] = useState<Record<any, TRow>>({});\r\n  useEffect(() => {\r\n    setSelected(state =>\r\n      Object.keys(selectedRowIds || {}).reduce((accumulator, key) => {\r\n        accumulator[key] =\r\n          state[key] ??\r\n          selectedFlatRows\r\n            .filter(isRowSelectable || defaultCheckIfRowIsSelectable)\r\n            .find(row => row.id === key)?.original;\r\n        return accumulator;\r\n      }, {}),\r\n    );\r\n  }, [selectedRowIds, selectedFlatRows, isRowSelectable]);\r\n  const selectedArray = React.useMemo(() => {\r\n    return Object.entries(selected).map(value => value[1]);\r\n  }, [selected]);\r\n\r\n  const appliedFiltersLength = React.useMemo(() => {\r\n    return props.appliedFilters && props.appliedFilters.length > 0\r\n      ? props.appliedFilters.filter(\r\n          f => f.value !== null && f.value !== undefined && f.value !== '',\r\n        ).length\r\n      : 0;\r\n  }, [props.appliedFilters]);\r\n\r\n  const handleFilterChange = React.useCallback(\r\n    (items: IFilterSettings<TRow>[]) => {\r\n      props.onFilterChange?.(items);\r\n      if (items.length !== appliedFiltersLength) {\r\n        gotoPage(0);\r\n      }\r\n    },\r\n    [appliedFiltersLength, gotoPage, props],\r\n  );\r\n  const [alreadySelected, setAlreadySelected] = React.useState<Row<TRow>[]>(\r\n    selectedFlatRows || [],\r\n  );\r\n  useEffect(() => {\r\n    let active =\r\n      onSelectedRowsChange !== undefined &&\r\n      selectedFlatRows !== undefined &&\r\n      selectedFlatRows.length !== alreadySelected.length;\r\n    if (active) {\r\n      !!onSelectedRowsChange &&\r\n        onSelectedRowsChange(\r\n          selectedFlatRows\r\n            .filter(isRowSelectable || defaultCheckIfRowIsSelectable)\r\n            .map(row => row.original),\r\n        );\r\n      setAlreadySelected(selectedFlatRows);\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    alreadySelected.length,\r\n    isRowSelectable,\r\n    onSelectedRowsChange,\r\n    selectedFlatRows,\r\n  ]);\r\n  // page change handler\r\n  const handlePageChange: (\r\n    event: React.MouseEvent<HTMLButtonElement> | null,\r\n    page: number,\r\n  ) => void = (e, page) => {\r\n    gotoPage(page < 0 ? 0 : page);\r\n  };\r\n  const handlePageSizeChange = newPageSize => {\r\n    // setControlledPageCount(Math.ceil(dataLength / newPageSize));\r\n    setPageSize(newPageSize);\r\n  };\r\n  const filterRef = React.useRef(null);\r\n  const handleFilterOpen = React.useCallback(() => {\r\n    setFiltersButtonAnchorEl(filterRef.current);\r\n    setOpen(!open);\r\n  }, [open]);\r\n\r\n  const AuthenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const customProcesing = useSelector(selectActionTableProcessing);\r\n  const globalSearchOpen = useSelector(selectGlobalSearchOpen);\r\n  const showGlobalFilter = React.useMemo(() => {\r\n    return (\r\n      searchColumns !== undefined && searchColumns?.length > 0 && !hideFilters\r\n    );\r\n  }, [hideFilters, searchColumns]);\r\n\r\n  const defaultPageActions: PageActionRenderer2<TRow>[] = React.useMemo(() => {\r\n    const actions: PageActionRenderer2<TRow>[] = [];\r\n    if (compact && props.availableFilters !== undefined && !hideFilters) {\r\n      actions.push((dataCount, refresh) => (\r\n        <FilterIconButton\r\n          filterLength={appliedFiltersLength}\r\n          handleClick={handleFilterOpen}\r\n          innerRef={filterRef}\r\n        />\r\n      ));\r\n    }\r\n    if (pageActions !== undefined) {\r\n      if (pageActions.length > 0) {\r\n        pageActions.forEach(element => {\r\n          actions.push(element);\r\n        });\r\n      }\r\n    }\r\n    return actions;\r\n  }, [\r\n    appliedFiltersLength,\r\n    compact,\r\n    handleFilterOpen,\r\n    hideFilters,\r\n    pageActions,\r\n    props.availableFilters,\r\n  ]);\r\n\r\n  const handleExportClick = React.useCallback(async () => {\r\n    await onExport();\r\n  }, [onExport]);\r\n\r\n  const rowsPerPageOptions = sortedUniq(\r\n    orderBy([5, 10, 25, 100].concat(initialState?.pageSize ?? [])),\r\n  );\r\n  const handleSortBy = React.useCallback(\r\n    (event: any, column: HeaderGroup<TRow>) => {\r\n      const columnId = column.id;\r\n      let sortAction = '';\r\n      let newSortBy: SortingRule<TRow>[] = [];\r\n      let sortDescFirst = column.sortDescFirst;\r\n      let desc = column.isSortedDesc;\r\n      const existingSortBy = sortBy.find(d => d.id === columnId);\r\n      const existingIndex = sortBy.findIndex(d => d.id === columnId);\r\n      const hasDescDefined = typeof desc !== 'undefined' && desc !== null;\r\n      if (existingIndex !== sortBy.length - 1 || sortBy.length !== 1) {\r\n        sortAction = 'replace';\r\n      } else if (existingSortBy) {\r\n        sortAction = 'toggle';\r\n      } else {\r\n        sortAction = 'replace';\r\n      }\r\n      if (sortAction === 'replace') {\r\n        newSortBy = [\r\n          {\r\n            id: columnId,\r\n            desc: hasDescDefined ? desc : sortDescFirst,\r\n          },\r\n        ];\r\n      } else if (sortAction === 'add') {\r\n        newSortBy = [\r\n          ...sortBy,\r\n          {\r\n            id: columnId,\r\n            desc: hasDescDefined ? desc : sortDescFirst,\r\n          },\r\n        ];\r\n      } else if (sortAction === 'toggle') {\r\n        // This flips (or sets) the\r\n        newSortBy = sortBy.map(d => {\r\n          if (d.id === columnId) {\r\n            return {\r\n              ...d,\r\n              desc: hasDescDefined ? !desc : !existingSortBy?.desc,\r\n            };\r\n          }\r\n          return d;\r\n        });\r\n      } else if (sortAction === 'remove') {\r\n        newSortBy = sortBy.filter(d => d.id !== columnId);\r\n      }\r\n      // Object.assign({}, sortBy, newSortBy)\r\n      setSortBy(newSortBy);\r\n    },\r\n    [setSortBy, sortBy],\r\n  );\r\n  React.useEffect(() => {\r\n    if (props.allRowsSelected !== undefined) {\r\n      toggleAllRowsSelected?.(props.allRowsSelected);\r\n    }\r\n  }, [props.allRowsSelected, toggleAllRowsSelected]);\r\n\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  const s = React.useMemo(() => searchColumns, []);\r\n  const customFilters = useMemoFilters({\r\n    appliedFilters: props.appliedFilters,\r\n  });\r\n\r\n  const sortByActual = React.useMemo(() => JSON.stringify(sortBy), [sortBy]);\r\n  React.useEffect(() => {\r\n    const state = {\r\n      pageIndex,\r\n      pageSize,\r\n      sortBy,\r\n      globalFilter,\r\n      customFilters: customFilters,\r\n      searchColumns: s,\r\n    };\r\n\r\n    onChangeState(state);\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [\r\n    onChangeState,\r\n    globalFilter,\r\n    pageIndex,\r\n    pageSize,\r\n\r\n    sortByActual,\r\n    customFilters,\r\n    s,\r\n  ]);\r\n\r\n  //used to add top message as Alert on the page if needs\r\n  const [topMessage, setTopMessage] = React.useState<\r\n    AlertContentType | undefined\r\n  >(undefined);\r\n  const setGlobalMessage = React.useCallback(\r\n    (message: Notification) => {\r\n      dispatch(globalActions.addNotification(message));\r\n    },\r\n    [dispatch, globalActions],\r\n  );\r\n  React.useEffect(() => {\r\n    if (ServiceGroupsOptional && !!serviceGroups && serviceGroups.length > 1) {\r\n      setGlobalMessage({\r\n        key: 'NotRelatedServiceGroups',\r\n        message: t(translations.ShowNotRelatedServiceGroups_warning) as string,\r\n        variant: 'warning',\r\n        autoHideDuration: 30000,\r\n        closable: true,\r\n      });\r\n    } else if (!!topAlertMessage) {\r\n      setTopMessage(() => {\r\n        return topAlertMessage;\r\n      });\r\n    }\r\n  }, [\r\n    ServiceGroupsOptional,\r\n    serviceGroups,\r\n    setGlobalMessage,\r\n    t,\r\n    topAlertMessage,\r\n  ]);\r\n  const [isCards, setIsCards] = useState(useCardsByDefault || isMobile);\r\n  useEffect(() => {\r\n    setIsCards(useCardsByDefault || isMobile);\r\n  }, [isMobile, useCardsByDefault]);\r\n  useEffect(() => {\r\n    if (allowCards) {\r\n      onModeChange?.(isCards === true);\r\n    }\r\n  }, [allowCards, isCards, onModeChange]);\r\n  const print = React.useMemo(() => {\r\n    return printing !== undefined && printing.printing === true;\r\n  }, [printing]);\r\n  useEffect(() => {\r\n    if (printing !== undefined && print && printing.onLoading !== undefined) {\r\n      printing.onLoading(printing.id, loading);\r\n    }\r\n  }, [loading, print, printing]);\r\n  const error = React.useMemo(() => {\r\n    return (props.error ?? false) === true;\r\n  }, [props.error]);\r\n  const baseTableActions: PageActionRenderer2<TRow>[] = React.useMemo(() => {\r\n    const actions: PageActionRenderer2<TRow>[] = [];\r\n    if (screenId && AuthenticatedUser && useConfigurable && !isMobile) {\r\n      actions.push(dataCount => (\r\n        <ConfigureColumnsButton onClick={props.onConfigurableColumns} />\r\n      ));\r\n    }\r\n    if (useExport && !isMobile) {\r\n      actions.push(dataCount => (\r\n        <ExportButton\r\n          onClick={handleExportClick}\r\n          //selectedRows={selectedFlatRows}\r\n          useExportForImport={useExportForImport}\r\n          selectedFilterRowProp={exportForImportFilterKey}\r\n          onDownloadTemplateClick={onDownloadTemplate}\r\n          screenId={screenId}\r\n          getAllFilteredRowsCallback={getAllFilteredRowsCallback}\r\n        />\r\n      ));\r\n    }\r\n    if (\r\n      useImportLink &&\r\n      !isMobile &&\r\n      !compact &&\r\n      (importLink || importHandler || importMenuItems)\r\n    ) {\r\n      actions.push(dataCount => (\r\n        <ImportButton\r\n          menuItems={importMenuItems}\r\n          onClick={() => {\r\n            if (importHandler) {\r\n              importHandler();\r\n            } else {\r\n              if (importLink) {\r\n                window.open(toRootedURL(importLink), '_blank');\r\n              }\r\n            }\r\n          }}\r\n        />\r\n      ));\r\n    }\r\n    if (allowCards && !isMobile) {\r\n      //&& !compact\r\n      actions.push(dataCount => (\r\n        <Button\r\n          variant={isCards ? 'white' : 'gray'}\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"list-ul\" />}\r\n          onClick={() => setIsCards(false)}\r\n        >\r\n          {t(translations.Table)}\r\n        </Button>\r\n      ));\r\n      actions.push(dataCount => (\r\n        <Button\r\n          variant={isCards ? 'gray' : 'white'}\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"grip-horizontal\" />}\r\n          onClick={() => setIsCards(true)}\r\n        >\r\n          {t(translations.Cards)}\r\n        </Button>\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    AuthenticatedUser,\r\n    allowCards,\r\n    compact,\r\n    exportForImportFilterKey,\r\n    getAllFilteredRowsCallback,\r\n    handleExportClick,\r\n    importHandler,\r\n    importLink,\r\n    importMenuItems,\r\n    isCards,\r\n    isMobile,\r\n    onDownloadTemplate,\r\n    props.onConfigurableColumns,\r\n    screenId,\r\n    t,\r\n    useConfigurable,\r\n    useExport,\r\n    useExportForImport,\r\n    useImportLink,\r\n  ]);\r\n  const table_id = React.useMemo(\r\n    () =>\r\n      props.id ??\r\n      (screenId === undefined ? undefined : ScreensId[screenId]) ??\r\n      'table',\r\n    [props.id, screenId],\r\n  );\r\n  const tableHead: React.ReactNode = React.useMemo(() => {\r\n    let result: React.ReactNode = (\r\n      <TableHead id={`${table_id}_head`}>\r\n        {\r\n          // loop over header groups\r\n          headerGroups.map(headerGroup => (\r\n            // apply header group props\r\n            <TableRow {...headerGroup.getHeaderGroupProps()}>\r\n              {\r\n                // loop over headers\r\n                headerGroup.headers.map((column, i) => (\r\n                  // apply header props\r\n                  // disableSortBy controls the sortability\r\n                  <TableCell\r\n                    variant=\"head\"\r\n                    component={props.useRowSelect && i === 0 ? 'td' : 'th'}\r\n                    {...(column.disableSortBy\r\n                      ? column.getHeaderProps()\r\n                      : column.getHeaderProps(column.getSortByToggleProps()))}\r\n                    onClick={ev =>\r\n                      !column.disableSortBy &&\r\n                      column.id !== 'selection' &&\r\n                      handleSortBy(ev, column)\r\n                    }\r\n                  >\r\n                    <TableSortLabel\r\n                      IconComponent={TableHeaderIcon}\r\n                      active={column.isSorted}\r\n                      hideSortIcon={\r\n                        (props.useRowSelect && i === 0) ||\r\n                        column.id === 'selection' ||\r\n                        column.disableSortBy\r\n                      }\r\n                      aria-label=\"Sorting\"\r\n                      title={\r\n                        typeof column.Header === 'string' ? column.Header : ''\r\n                      }\r\n                      onClick={ev =>\r\n                        // column.toggleSortBy(\r\n                        //   !column.isSortedDesc,\r\n                        //   undefined,\r\n                        // )\r\n                        !column.disableSortBy &&\r\n                        column.id !== 'selection' &&\r\n                        handleSortBy(ev, column)\r\n                      }\r\n                      // react-table has a unsorted state which is not treated here\r\n                      direction={column.isSortedDesc ? 'desc' : 'asc'}\r\n                    >\r\n                      <TableHeaderCellLabel>\r\n                        {column.render('Header')}\r\n                      </TableHeaderCellLabel>\r\n                    </TableSortLabel>\r\n                  </TableCell>\r\n                ))\r\n              }\r\n            </TableRow>\r\n          ))\r\n        }\r\n      </TableHead>\r\n    );\r\n    return result;\r\n  }, [handleSortBy, headerGroups, props.useRowSelect, table_id]);\r\n  return (\r\n    <React.Fragment>\r\n      <React.Fragment>\r\n        {customProcesing !== undefined && customProcesing.processing === true && (\r\n          <Box style={{ width: '100%' }}>\r\n            <LinearProgress variant=\"query\" color=\"primary\" />\r\n          </Box>\r\n        )}\r\n\r\n        <TableContainer\r\n          key=\"table-container\"\r\n          style={props.tableContainerSyles}\r\n          id={`${table_id}_table_container`}\r\n        >\r\n          {withToolBar && (\r\n            <TableToolbar\r\n              screenName={screenName}\r\n              screenNameVariant={screenNameVariant}\r\n              onRefresh={props.onRefresh}\r\n              loading={loading}\r\n              showMenu={!hideMenuOnMobile}\r\n              compact={compact}\r\n              customExpandMenu={customExpandMenu}\r\n              customScreenName={customScreenName}\r\n              showGlobalSearchIcon={showGlobalSearchIconOnToolbar}\r\n              toggleGlobalFilter={toggleGlobalSearchIcon}\r\n              variant={tablePaddingVariant}\r\n            >\r\n              {print === false &&\r\n                defaultPageActions.length > 0 &&\r\n                defaultPageActions.map((item, index) => (\r\n                  <span key={index}>\r\n                    {item(\r\n                      dataLength,\r\n                      props.onRefresh,\r\n                      props.appliedFilters,\r\n                      selectedArray,\r\n                    )}\r\n                  </span>\r\n                ))}\r\n              {baseTableActionsOnToolbar &&\r\n                baseTableActions.length > 0 &&\r\n                baseTableActions.map((item, index) => (\r\n                  <span key={'base_actions_' + index}>\r\n                    {item(\r\n                      dataLength,\r\n                      props.onRefresh,\r\n                      props.appliedFilters,\r\n                      selectedArray,\r\n                    )}\r\n                  </span>\r\n                ))}\r\n            </TableToolbar>\r\n          )}\r\n          {print === false ? (\r\n            <>\r\n              {props.subHeader !== undefined && (\r\n                <Box className={classes.subHeader}>{props.subHeader}</Box>\r\n              )}\r\n              {!isMobile && !compact && topMessage !== undefined && (\r\n                <div className={classes.subHeader}>\r\n                  <BasicAlert\r\n                    content={topMessage}\r\n                    showMore\r\n                    collapsedMinHeight={60}\r\n                  />\r\n                </div>\r\n              )}\r\n              {props.availableFilters !== undefined && !hideFilters && (\r\n                <FilterContainer\r\n                  open={open}\r\n                  onClose={() => setOpen(false)}\r\n                  onChange={handleFilterChange}\r\n                  anchorEl={filtersButtonAnchorEl}\r\n                  appliedFilters={props.appliedFilters ?? []}\r\n                  compact={compact}\r\n                >\r\n                  <BasicFilterGroup\r\n                    getDefaultFilters={getDefaultFilters}\r\n                    availableFilters={props.availableFilters || []}\r\n                    onChange={handleFilterChange}\r\n                    appliedFilters={props.appliedFilters || []}\r\n                    onClose={() => setOpen(false)}\r\n                    autoOpenAddFilter={true}\r\n                    showFooter={!isMobile && !compact}\r\n                    savedListSettings={savedListSettings}\r\n                  />\r\n                </FilterContainer>\r\n              )}\r\n              {!error &&\r\n                (showGlobalFilter || useExport || screenId) &&\r\n                !baseTableActionsOnToolbar && (\r\n                  <>\r\n                    <Box\r\n                      component=\"div\"\r\n                      className={clsx({\r\n                        [classes.tableButtonsRoot]: !isMobile && !compact,\r\n                        [classes.tableButtonsRootShort]: isMobile || compact,\r\n                        tablePaddingDense: tablePaddingVariant === 'dense',\r\n                      })}\r\n                    >\r\n                      <Box\r\n                        className={clsx(classes.tableButtonsLeft, {\r\n                          // [classes.tableButtonsLeft]: !isMobile && !compact,\r\n                          // [classes.tableButtonsLeftShort]: isMobile || compact,\r\n                          [classes.tableButtonWrap]:\r\n                            isSomeSelected &&\r\n                            selectedRowsActions !== undefined &&\r\n                            selectedRowsActions.length > 0,\r\n                          [classes.tableButtonNoWrap]:\r\n                            (isSomeSelected &&\r\n                              selectedRowsActions !== undefined &&\r\n                              selectedRowsActions.length > 0) === false,\r\n                        })}\r\n                      >\r\n                        {isSomeSelected &&\r\n                        selectedRowsActions !== undefined &&\r\n                        selectedRowsActions.length > 0 ? (\r\n                          <SelectedActions\r\n                            onRefresh={props.onRefresh}\r\n                            actions={selectedRowsActions || []}\r\n                            selectedArray={selectedArray}\r\n                            toggleAllRowsSelected={toggleAllRowsSelected}\r\n                            totalRows={dataLength}\r\n                            shortView={isMobile || compact}\r\n                          />\r\n                        ) : (\r\n                          <>\r\n                            {(showGlobalSearchIconOnToolbar === true\r\n                              ? globalSearchOpen\r\n                              : showGlobalFilter) && (\r\n                              <GlobalFilter\r\n                                globalFilter={globalFilter}\r\n                                setGlobalFilter={setGlobalFilter}\r\n                              />\r\n                            )}\r\n                            {!compact &&\r\n                              !hideFilters &&\r\n                              (props.availableFilters ?? []).length > 0 && (\r\n                                <FiltersButton\r\n                                  onClick={handleFilterOpen}\r\n                                  appliedFiltersLength={appliedFiltersLength}\r\n                                  innerRef={filterRef}\r\n                                />\r\n                              )}\r\n                          </>\r\n                        )}\r\n                        {(isMobile || compact) && (\r\n                          <ReactActions\r\n                            id=\"baseTableActions\"\r\n                            size=\"small\"\r\n                            items={baseTableActions.map((item, index) => (\r\n                              <span key={'base_actions_' + index}>\r\n                                {item(\r\n                                  dataLength,\r\n                                  props.onRefresh,\r\n                                  props.appliedFilters,\r\n                                  selectedArray,\r\n                                )}\r\n                              </span>\r\n                            ))}\r\n                          ></ReactActions>\r\n                        )}\r\n                      </Box>\r\n                      {!isMobile && !compact && (\r\n                        <Box\r\n                          className={clsx({\r\n                            [classes.tableButtonsRight]: !isMobile && !compact,\r\n                            [classes.tableButtonsRightShort]:\r\n                              isMobile || compact,\r\n                          })}\r\n                        >\r\n                          {!baseTableActionsOnToolbar &&\r\n                            baseTableActions.length > 0 &&\r\n                            baseTableActions.map((item, index) => (\r\n                              <span key={'base_actions_' + index}>\r\n                                {item(\r\n                                  dataLength,\r\n                                  props.onRefresh,\r\n                                  props.appliedFilters,\r\n                                  selectedArray,\r\n                                )}\r\n                              </span>\r\n                            ))}\r\n                        </Box>\r\n                      )}\r\n                    </Box>\r\n                    {!isMobile &&\r\n                      !compact &&\r\n                      (props.appliedFilters ?? []).filter(\r\n                        f => f.value !== undefined,\r\n                      ).length > 0 && (\r\n                        <Box\r\n                          component=\"div\"\r\n                          className={clsx({\r\n                            [classes.filterDisplayRoot]: !isMobile && !compact,\r\n                            [classes.filterDisplayRootShort]:\r\n                              isMobile || compact,\r\n                          })}\r\n                        >\r\n                          <FiltersGroupDisplay\r\n                            appliedFilters={props.appliedFilters ?? []}\r\n                            onChange={handleFilterChange}\r\n                            openFilter={handleFilterOpen}\r\n                          />\r\n                        </Box>\r\n                      )}\r\n                  </>\r\n                )}\r\n              {!!customToolbarSettings &&\r\n                customToolbarSettings.useCustomToolbar &&\r\n                !!customToolbarSettings.CustomToolbar && (\r\n                  <CustomToolbar\r\n                    Component={customToolbarSettings.CustomToolbar}\r\n                    compact={compact}\r\n                  />\r\n                )}\r\n\r\n              {((!!tabSectionSettings && tabSectionSettings.useTabsSection) ||\r\n                (props.useRowSelect && isCards)) && (\r\n                <TabsToolbar\r\n                  rowsCount={dataLength}\r\n                  rows={rows}\r\n                  leftTabs={tabSectionSettings?.leftTabs}\r\n                  rightTabActions={tabSectionSettings?.rightTabActions}\r\n                  selectedValue={tabSectionSettings?.selectedTabValue}\r\n                  selectedArray={selectedArray}\r\n                  toggleAllRowsSelected={toggleAllRowsSelected}\r\n                  onRefresh={props.onRefresh}\r\n                  appliedFilters={props.appliedFilters}\r\n                  allRowsSelected={isAllRowsSelected}\r\n                  isRowSelectable={\r\n                    isRowSelectable || defaultCheckIfRowIsSelectable\r\n                  }\r\n                  getMultiMode={tabSectionSettings?.getMultiMode}\r\n                  onAllRowsSelected={tabSectionSettings?.onAllRowsSelected}\r\n                  disableMultiMode={tabSectionSettings?.disableMultiMode}\r\n                  defaultMultiMode={\r\n                    tabSectionSettings?.defaultMultiMode ?? true\r\n                  }\r\n                  showClear={tabSectionSettings?.showClear}\r\n                  compact={compact}\r\n                />\r\n              )}\r\n            </>\r\n          ) : (\r\n            <></>\r\n          )}\r\n          <Box\r\n            id={`${table_id}_content`}\r\n            component=\"div\"\r\n            className={clsx({\r\n              [classes.tableContent]: !isMobile && !compact,\r\n              [classes.tableContentShort]: isMobile || compact,\r\n              tablePaddingDense: tablePaddingVariant === 'dense',\r\n            })}\r\n          >\r\n            {error ? (\r\n              <TableError id={`${table_id}_error`} />\r\n            ) : loading ? (\r\n              <TableRowsSkeleton\r\n                id={`${table_id}_skeleton`}\r\n                isMobile={isMobile || compact}\r\n                isCards={isCards === true || isMobile}\r\n              />\r\n            ) : dataLength === 0 && !loading ? (\r\n              <React.Fragment>\r\n                {alwaysShowTableHeader && !isCards && (\r\n                  <div className={classes.tableScrolling}>\r\n                    <Table\r\n                      {...getTableProps()}\r\n                      className={classes.table}\r\n                      size={tableRowsSize}\r\n                    >\r\n                      {tableHead}\r\n                      <TableBody {...getTableBodyProps()}></TableBody>\r\n                    </Table>\r\n                  </div>\r\n                )}\r\n                {!!customEmptyTableSettings ? (\r\n                  <CustomEmptyTable\r\n                    id={`${table_id}_nodata`}\r\n                    headTitle={customEmptyTableSettings.headTitle}\r\n                    title={customEmptyTableSettings.title}\r\n                    shortView={isMobile || compact}\r\n                  />\r\n                ) : (\r\n                  <NoTableData\r\n                    id={`${table_id}_nodata`}\r\n                    shortView={isMobile || compact}\r\n                  />\r\n                )}\r\n              </React.Fragment>\r\n            ) : (\r\n              <>\r\n                {/* {loading && (\r\n                  // <Box style={{ width: '100%' }}>\r\n                  //   <LinearProgress variant=\"query\" color=\"primary\" />\r\n                  // </Box>\r\n                 \r\n                )} */}\r\n                {/* <TableRowsSkeleton\r\n                  //style={loading ? undefined : { display: 'none' }}\r\n                  id={`${table_id}_skeleton`}\r\n                  isMobile={isMobile || compact}\r\n                  isCards={isCards === true}\r\n                /> */}\r\n                {!isCards ? (\r\n                  <div\r\n                    className={classes.tableScrolling}\r\n                    style={loading ? { display: 'none' } : undefined}\r\n                  >\r\n                    <Table\r\n                      id={table_id}\r\n                      {...getTableProps()}\r\n                      className={clsx(classes.table, {\r\n                        withFooter: enablePagination && !isCards,\r\n                      })}\r\n                      size={tableRowsSize}\r\n                      role=\"table\"\r\n                      aria-label={screenName}\r\n                    >\r\n                      {tableHead}\r\n                      <TableBody\r\n                        id={`${table_id}_body`}\r\n                        {...getTableBodyProps()}\r\n                      >\r\n                        {\r\n                          // Loop over the table rows\r\n                          rows.map((row, rowIndex) => {\r\n                            // Prepare the row for display\r\n\r\n                            prepareRow(row);\r\n                            return (\r\n                              <React.Fragment\r\n                                key={`data-rows-group_page-${rowIndex}`}\r\n                              >\r\n                                {row.isGrouped &&\r\n                                  row.subRows?.map(subRow => {\r\n                                    prepareRow(subRow);\r\n                                    return (\r\n                                      <RenderRow\r\n                                        row={subRow}\r\n                                        onRefresh={props.onRefresh}\r\n                                        onRowClicked={onRowClicked}\r\n                                      />\r\n                                    );\r\n                                  })}\r\n                                <RenderGroupedRow\r\n                                  row={row}\r\n                                  onRefresh={props.onRefresh}\r\n                                  onRowClicked={onRowClicked}\r\n                                />\r\n                              </React.Fragment>\r\n                            );\r\n                          })\r\n                        }\r\n                        {summaryRows !== undefined &&\r\n                          summaryRows.map(summaryRow => {\r\n                            prepareRow(summaryRow);\r\n                            return (\r\n                              <RenderGroupedRow\r\n                                row={summaryRow}\r\n                                onRefresh={props.onRefresh}\r\n                              />\r\n                            );\r\n                          })}\r\n                      </TableBody>\r\n                    </Table>\r\n                  </div>\r\n                ) : (\r\n                  <TableCardGrid\r\n                    id={table_id}\r\n                    isMobile={isMobile}\r\n                    cardPosition={cardPosition}\r\n                    style={loading ? { display: 'none' } : undefined}\r\n                    minCardHeight={minCardHeight}\r\n                    compact={compact}\r\n                  >\r\n                    {rows.map((r, ind) => {\r\n                      prepareRow(r);\r\n                      return (\r\n                        <TableCard\r\n                          key={`card-${ind}`}\r\n                          someSelected={\r\n                            //isSomeSelected\r\n                            selectedArray.length > 0\r\n                            // (!!selectedRowsActions ||\r\n                            //   (!!floatingTabSettings &&\r\n                            //     floatingTabSettings.useFloatingActions ===\r\n                            //       true &&\r\n                            //     !!floatingTabSettings.selectedFloatingActions &&\r\n                            //     floatingTabSettings.selectedFloatingActions\r\n                            //       .length > 0)) &&\r\n                            // selectedFlatRows.filter(\r\n                            //   isRowSelectable || defaultCheckIfRowIsSelectable,\r\n                            // ).length > 0\r\n                          }\r\n                          viewCheckBox={viewCardsCheck}\r\n                          useSelect={\r\n                            !!props.useRowSelect &&\r\n                            (!!isRowSelectable\r\n                              ? isRowSelectable(r)\r\n                              : defaultCheckIfRowIsSelectable(r))\r\n                          }\r\n                          primaryAction={props.primaryAction}\r\n                          row={r}\r\n                          titleKey={props.titleKey ?? sortBy![0].id}\r\n                          imageSrcKey={props.imageSrcKey}\r\n                          hasAdditionalActions={\r\n                            !!rowActions && rowActions.length > 0\r\n                          }\r\n                          hasInlineRowActions={\r\n                            !!inlineRowActions && inlineRowActions.length > 0\r\n                          }\r\n                          active={selectedFlatRows?.some(f => f.id === r.id)}\r\n                          toggleAllRowsSelected={toggleAllRowsSelected}\r\n                          isRowSelectable={\r\n                            isRowSelectable || defaultCheckIfRowIsSelectable\r\n                          }\r\n                          cardSize={props.cardSize}\r\n                          cardPosition={cardPosition}\r\n                          showTitleCell={showTitleCell}\r\n                          preventInnerClicks={props.preventInnerClicks}\r\n                          compact={compact}\r\n                          contentEditable={\r\n                            !!isContentEditable\r\n                              ? isContentEditable(r)\r\n                              : undefined\r\n                          }\r\n                          loading={loading}\r\n                        />\r\n                      );\r\n                    })}\r\n                  </TableCardGrid>\r\n                )}\r\n                {print === false && enablePagination && (\r\n                  <Box\r\n                    id={`${table_id}_footer`}\r\n                    className={clsx(classes.tableFooter, {\r\n                      [classes.tableFooterWithBorder]:\r\n                        !isCards && !(isMobile || compact),\r\n                      tableFooterShortView: compact && !isMobile,\r\n                    })}\r\n                  >\r\n                    {/* {loading && (\r\n                      <Box style={{ width: '100%' }}>\r\n                        <LinearProgress variant=\"query\" color=\"primary\" />\r\n                      </Box>\r\n                    )} */}\r\n                    <TablePagination\r\n                      component=\"div\"\r\n                      rowsPerPageOptions={rowsPerPageOptions}\r\n                      colSpan={headerGroups[0]?.headers?.length || 0}\r\n                      count={dataLength}\r\n                      rowsPerPage={pageSize}\r\n                      page={pageIndex}\r\n                      labelRowsPerPage={\r\n                        isMobile || compact ? <></> : <>{'Rows per Page'}</>\r\n                      }\r\n                      SelectProps={{\r\n                        label: 'Rows per Page',\r\n                        inputProps: {\r\n                          'aria-label': `${pageSize || 'pagesize'}`,\r\n                        },\r\n                        native: true,\r\n                        MenuProps: {\r\n                          variant: 'menu',\r\n                          anchorOrigin: {\r\n                            vertical: 'bottom',\r\n                            horizontal: 'right',\r\n                          },\r\n                          getContentAnchorEl: null,\r\n                          classes: { paper: classes.menuPaper },\r\n                        },\r\n                        'aria-label': `${pageSize || 'pagesize'}`,\r\n                      }}\r\n                      onChangePage={handlePageChange}\r\n                      onChangeRowsPerPage={e =>\r\n                        handlePageSizeChange(Number(e.target.value))\r\n                      }\r\n                      ActionsComponent={TablePaginationActions}\r\n                    />\r\n                  </Box>\r\n                )}\r\n              </>\r\n            )}\r\n          </Box>\r\n        </TableContainer>\r\n      </React.Fragment>\r\n      {print === false &&\r\n        !!floatingTabSettings &&\r\n        floatingTabSettings.useFloatingActions && (\r\n          <FloatingActions\r\n            onRefresh={props.onRefresh}\r\n            rows={rows}\r\n            selectedActions={floatingTabSettings.selectedFloatingActions || []}\r\n            selectedArray={selectedArray}\r\n            useSidePanel={floatingTabSettings.useSidePanel}\r\n            toggleAllRowsSelected={toggleAllRowsSelected}\r\n            totalRows={dataLength}\r\n            buttonActions={floatingTabSettings.buttonFloatingActions}\r\n            toggleRowSelected={toggleRowSelected}\r\n            compact={compact}\r\n          />\r\n        )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { Grid, Divider, Card, TableContainer } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport makeStyles from '@material-ui/styles/makeStyles';\r\nimport { TableCardGrid } from '../TableCardGrid';\r\nimport clsx from 'clsx';\r\n\r\n/* \r\nxs (for phones - screens less than 768px wide)\r\nsm (for tablets - screens equal to or greater than 768px wide)\r\nmd (for small laptops - screens equal to or greater than 992px wide)\r\nlg (for laptops and desktops - screens equal to or greater than 1200px wide) \r\n*/\r\n\r\nconst headerHeight = 48;\r\nconst toolbarHeight = 30;\r\nconst searchBarHeight = 30;\r\n//const tableHeaderHeight = 30;\r\n//const tableRowHeight = 30;\r\n//const tableColumnHeight = 438;\r\n//const tableFooterHeight = 30;\r\n\r\nconst numOfHeaderItems = 7;\r\nconst numOfColumns = 7;\r\nconst numOfRows = 11;\r\nconst numberOfCards = 12;\r\n\r\nconst useStyles = makeStyles({\r\n  tableContainer: {\r\n    boxShadow: '0 3px 5px 2px #D7D7D7',\r\n  },\r\n  tableHeaderCell: {\r\n    position: 'relative',\r\n    height: 48,\r\n    backgroundColor: '#F5F5F5',\r\n    borderRight: '1px solid #D7D7D7',\r\n    borderBottom: '1px solid #D7D7D7',\r\n    boxShadow: '0 3px 5px 2px #D7D7D7',\r\n    color: 'white',\r\n  },\r\n  tableHeader: {\r\n    position: 'absolute',\r\n    top: '35%',\r\n    left: '20%',\r\n    height: 15,\r\n    width: '60%',\r\n    background: '#D7D7D7',\r\n    color: 'white',\r\n  },\r\n  tableRowContainer: {\r\n    height: 48,\r\n    color: 'white',\r\n  },\r\n  tableRowCell: {\r\n    position: 'relative',\r\n    borderBottom: '1px solid #D7D7D7',\r\n  },\r\n  tableRow: {\r\n    position: 'absolute',\r\n    top: '37%',\r\n    left: '20%',\r\n    height: 15,\r\n    width: '60%',\r\n    color: 'white',\r\n  },\r\n  tableFooterContainer: {\r\n    //display: 'block',\r\n    //position: 'relative',\r\n    height: 48,\r\n    backgroundColor: 'green',\r\n    justifyContent: 'center',\r\n    //borderBottom: '1px solid black',\r\n    //boxShadow: '0 3px 5px 2px #D7D7D7',\r\n    color: 'white',\r\n  },\r\n  tableFooter: {\r\n    //position: 'absolute',\r\n    //top: '37%',\r\n    //left: '20%',\r\n    height: 15,\r\n    //width: 'auto',\r\n    backgroundColor: 'black', //'#F5F5F5',\r\n    boxShadow: '0 3px 5px 2px #D7D7D7',\r\n    color: 'white',\r\n  },\r\n  shadow: {\r\n    boxShadow: '0 3px 5px 2px #D7D7D7',\r\n  },\r\n});\r\nconst useTableCardsStyle = makeStyles({\r\n  card: {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    justifyContent: 'flex-start',\r\n    alignItems: 'flex-start',\r\n    padding: 0,\r\n  },\r\n  cardVertical: {\r\n    maxHeight: 308,\r\n    height: 220,\r\n  },\r\n  cardHorizontal: {\r\n    maxHeight: 183,\r\n    height: 110,\r\n  },\r\n  cardSkelet: {\r\n    backgroundColor: '#e0e5ec',\r\n  },\r\n});\r\nconst RenderTableRowsItems = classes => {\r\n  return [...Array(numOfRows).keys()].map(key => (\r\n    //Row item\r\n    <Grid\r\n      key={key}\r\n      container\r\n      spacing={1}\r\n      className={classes.tableRowContainer}\r\n      role=\"alert\"\r\n      aria-live=\"polite\"\r\n      aria-busy=\"true\"\r\n    >\r\n      <Grid item xs md className={classes.tableRowCell}>\r\n        <Skeleton variant=\"rect\" className={classes.tableRow} />\r\n      </Grid>\r\n    </Grid>\r\n  ));\r\n};\r\n\r\nconst RenderTableHeaderCells = classes => {\r\n  return [...Array(numOfHeaderItems).keys()].map(key => (\r\n    <Grid key={key} item xs md className={classes.tableHeaderCell}>\r\n      <Grid container spacing={0}>\r\n        <Grid item xs md>\r\n          <Skeleton variant=\"rect\" className={classes.tableHeader} />\r\n        </Grid>\r\n      </Grid>\r\n    </Grid>\r\n  ));\r\n};\r\n\r\nconst RenderTableRows = classes => {\r\n  return [...Array(numOfColumns).keys()].map(key => (\r\n    //TableRow\r\n    <Grid key={key} item xs md>\r\n      <Grid container spacing={0}>\r\n        <Grid item xs md>\r\n          {RenderTableRowsItems(classes)}\r\n        </Grid>\r\n      </Grid>\r\n    </Grid>\r\n  ));\r\n};\r\n\r\n/* const RenderFooter = classes => {\r\n  return (\r\n    <Grid container spacing={1}>\r\n      <Grid item xs={12} md={4} className={classes.tableFooterContainer}>\r\n        <Grid container spacing={2}>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"rect\" className={classes.tableFooter} />\r\n          </Grid>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"rect\" className={classes.tableFooter} />\r\n          </Grid>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"rect\" className={classes.tableFooter} />\r\n          </Grid>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"circle\" className={classes.tableFooter} />\r\n          </Grid>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"circle\" className={classes.tableFooter} />\r\n          </Grid>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"circle\" className={classes.tableFooter} />\r\n          </Grid>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"circle\" className={classes.tableFooter} />\r\n          </Grid>\r\n        </Grid>\r\n      </Grid>\r\n    </Grid>\r\n  );\r\n}; */\r\nexport function TableCardsSkeleton({ isMobile }: { isMobile: boolean }) {\r\n  const classes = useTableCardsStyle();\r\n  return (\r\n    <TableCardGrid>\r\n      {[...Array(numberOfCards).keys()].map(key => (\r\n        <Card\r\n          key={key}\r\n          className={clsx(classes.card, {\r\n            [classes.cardVertical]: !isMobile,\r\n            [classes.cardHorizontal]: isMobile,\r\n          })}\r\n        >\r\n          <Skeleton\r\n            variant=\"rect\"\r\n            width=\"100%\"\r\n            height=\"100%\"\r\n            className={classes.cardSkelet}\r\n          />\r\n        </Card>\r\n      ))}\r\n    </TableCardGrid>\r\n  );\r\n}\r\nexport interface TableRowsSkeletonProps {\r\n  id?: string;\r\n  isMobile: boolean;\r\n  isCards: boolean;\r\n  style?: React.CSSProperties;\r\n}\r\nexport function TableRowsSkeleton(props: TableRowsSkeletonProps) {\r\n  const { isMobile, isCards, style } = props;\r\n  const classes = useStyles();\r\n  //RENDER\r\n  return (\r\n    <Box\r\n      component=\"div\"\r\n      //flexGrow={1}\r\n      id={props.id}\r\n      style={{ width: '100%', ...style }}\r\n    >\r\n      {/* Table */}\r\n      {/* TableHeaders */}\r\n\r\n      {isCards ? (\r\n        <TableCardsSkeleton isMobile={isMobile} />\r\n      ) : (\r\n        <TableContainer style={{ width: '100%' }}>\r\n          <Grid container spacing={1}>\r\n            {RenderTableHeaderCells(classes)}\r\n          </Grid>\r\n          {/* TableBody */}\r\n          <Grid container spacing={1}>\r\n            {RenderTableRows(classes)}\r\n          </Grid>\r\n        </TableContainer>\r\n      )}\r\n\r\n      {/* TableFooter */}\r\n      {/* {RenderFooter(classes)} */}\r\n    </Box>\r\n  );\r\n}\r\n\r\nexport function TableSkeleton(): JSX.Element {\r\n  const classes = useStyles();\r\n  //RENDER\r\n  return (\r\n    <Box\r\n      component=\"div\"\r\n      flexGrow={1}\r\n      role=\"alert\"\r\n      aria-live=\"polite\"\r\n      aria-busy=\"true\"\r\n    >\r\n      {/* Header */}\r\n      <Box component=\"div\">\r\n        <Grid container spacing={2}>\r\n          <Grid item xs={4} md={2}>\r\n            <Skeleton\r\n              variant=\"text\"\r\n              height={headerHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n        </Grid>\r\n      </Box>\r\n      {/* Toolbar */}\r\n      <Box component=\"div\" marginTop={1}>\r\n        <Grid container spacing={2}>\r\n          <Grid item xs={6} md={3}>\r\n            <Skeleton\r\n              variant=\"rect\"\r\n              height={toolbarHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n          <Grid item xs={4} md={2}>\r\n            <Skeleton\r\n              variant=\"rect\"\r\n              height={toolbarHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n        </Grid>\r\n      </Box>\r\n      <Box component=\"div\" marginTop={3} marginBottom={3}>\r\n        <Divider />\r\n      </Box>\r\n      {/* Search bar */}\r\n      <Box component=\"div\">\r\n        <Grid container spacing={2}>\r\n          <Grid item xs={2} sm={2} md={2}>\r\n            <Skeleton\r\n              variant=\"rect\"\r\n              height={searchBarHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n          <Grid item xs={2} sm={2} md={2}>\r\n            <Skeleton\r\n              variant=\"rect\"\r\n              height={searchBarHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n          <Grid item xs={2} sm={2} md={2}>\r\n            <Skeleton\r\n              variant=\"rect\"\r\n              height={searchBarHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n          <Grid item xs={4} md={3}>\r\n            <Skeleton\r\n              variant=\"rect\"\r\n              height={searchBarHeight}\r\n              className={classes.shadow}\r\n            />\r\n          </Grid>\r\n        </Grid>\r\n      </Box>\r\n      {/* Table */}\r\n      {/* TableHeaders */}\r\n      <Box component=\"div\" marginTop={3} className={classes.tableContainer}>\r\n        <Grid container spacing={1}>\r\n          {RenderTableHeaderCells(classes)}\r\n        </Grid>\r\n        {/* TableBody */}\r\n        <Grid container spacing={1}>\r\n          {RenderTableRows(classes)}\r\n        </Grid>\r\n        {/* TableFooter */}\r\n        {/* <Grid container spacing={1}>\r\n          <Grid item xs md>\r\n            <Skeleton variant=\"rect\" height={tableFooterHeight} />\r\n          </Grid>\r\n        </Grid> */}\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\n","import { Switch, SwitchProps } from '@material-ui/core';\r\n\r\nexport interface ToggleProps extends SwitchProps {\r\n  danger?: boolean;\r\n  label?: string;\r\n}\r\n\r\nexport function Toggle(props: ToggleProps) {\r\n  const {\r\n    color = 'primary',\r\n    label,\r\n    danger,\r\n    size = 'medium',\r\n    className,\r\n    ...other\r\n  } = props;\r\n  return (\r\n    <Switch\r\n      disableRipple\r\n      color={danger ? 'secondary' : color === 'default' ? 'primary' : color}\r\n      inputProps={{ 'aria-label': !!label ? label : 'decorative toggle' }}\r\n      className={className}\r\n      size={size}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport FormControl from '../Forms/FormControls/FormControl';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\nimport FormHelperText from '../Forms/FormControls/FormHelperText';\r\nimport FormGroup from '../Forms/FormControls/FormGroup';\r\nimport { Toggle, ToggleProps } from '../BasicInputs/Toggle';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface BasicToggleProps\r\n  extends Omit<ToggleProps, 'onChange' | 'danger'> {\r\n  label?: string;\r\n  error?: string;\r\n  helperText?: string;\r\n  info?: React.ReactNode;\r\n  fullWidth?: boolean;\r\n  name?: string;\r\n  boxed?: boolean;\r\n  boldLabel?: boolean;\r\n  maxLabelWidth?: string | number;\r\n  onChange?: (\r\n    value: boolean,\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => void;\r\n}\r\n\r\nexport function BasicToggle(props: BasicToggleProps) {\r\n  const {\r\n    label,\r\n    error,\r\n    helperText,\r\n    info,\r\n    name,\r\n    onChange,\r\n    boxed,\r\n    fullWidth,\r\n    boldLabel,\r\n    maxLabelWidth = 25,\r\n    size,\r\n    ...other\r\n  } = props;\r\n  const [isChecked, setIsChecked] = React.useState<boolean>(\r\n    props.checked ?? false,\r\n  );\r\n  const sizeClass = `toggleSize${capitalize(size ?? 'medium')}`;\r\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.checked as boolean;\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n    setIsChecked(value);\r\n  };\r\n  const withInfoLabel = React.useMemo(() => {\r\n    return !!label && label.length > maxLabelWidth;\r\n  }, [label, maxLabelWidth]);\r\n  const Label = withInfoLabel ? (\r\n    <Tooltip title={<>{label}</>}>\r\n      <span>{label}</span>\r\n    </Tooltip>\r\n  ) : (\r\n    <React.Fragment>{label}</React.Fragment>\r\n  );\r\n  const baseLabelStyle: React.CSSProperties = React.useMemo(() => {\r\n    return withInfoLabel\r\n      ? { maxWidth: `${maxLabelWidth}ch`, gap: 12 }\r\n      : { gap: 12 };\r\n  }, [maxLabelWidth, withInfoLabel]);\r\n  return (\r\n    <FormControl\r\n      error={error !== undefined}\r\n      fullWidth={fullWidth}\r\n      boxed={boxed}\r\n      className={sizeClass}\r\n    >\r\n      <FormGroup\r\n        row={true}\r\n        withInfo={info !== undefined}\r\n        boxed={boxed}\r\n        boxedChecked={isChecked}\r\n        boxedError={error !== undefined}\r\n        className={sizeClass}\r\n      >\r\n        <FormControlLabel\r\n          style={baseLabelStyle}\r\n          label={Label}\r\n          withInfo={info !== undefined}\r\n          boxed={boxed}\r\n          boxedChecked={isChecked}\r\n          boxedError={error !== undefined}\r\n          boldLabel={boldLabel}\r\n          className={sizeClass}\r\n          control={\r\n            <Toggle\r\n              name={name}\r\n              color={props.color || 'primary'}\r\n              danger={error !== undefined}\r\n              onChange={handleChange}\r\n              checked={isChecked}\r\n              className={sizeClass}\r\n              {...other}\r\n            />\r\n          }\r\n        />\r\n        {info && <InfoIcon title={info} />}\r\n      </FormGroup>\r\n      {((!!error && error !== '') || (!!helperText && helperText !== '')) && (\r\n        <FormHelperText\r\n          error={error !== undefined}\r\n          boxed={boxed}\r\n          className={sizeClass}\r\n        >\r\n          {error || helperText}\r\n        </FormHelperText>\r\n      )}\r\n    </FormControl>\r\n  );\r\n}\r\n","import styled from 'styled-components/macro';\r\n\r\nexport const FlexRowDiv = styled.div`\r\n  display: flex;\r\n  flex-direction: row;\r\n  align-items: center;\r\n  justify-content: center;\r\n`;\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.printPDF || initialState;\r\n\r\nexport const selectPrintPDF = createSelector([selectSlice], state => state);\r\nexport const selectPrintPDFPrinting = createSelector(\r\n  [selectPrintPDF],\r\n  state => state.printing,\r\n);\r\nexport const selectPrintPDFSections = createSelector([selectPrintPDF], state =>\r\n  state.useSections ? state.Sections : [],\r\n);\r\nexport const selectPrintPDFisLoading = createSelector(\r\n  [selectPrintPDF],\r\n  state => state.isLoading,\r\n);\r\n","/**\r\n *\r\n * Comments\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\nimport {\r\n  CommentsContainer,\r\n  EmailRelated,\r\n} from 'app/components/CommentsContainer';\r\nimport {\r\n  IComment,\r\n  NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useAbsolute } from 'utils/url-utils';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLargeFilesUploadSlice } from '../LargeFilesUpload/slice';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface CommentsProps\r\n  extends Omit<EmailRelated, 'referenceName' | 'linkUrl'> {\r\n  /**\r\n   * Type of the comments, e.g. Invoice, UserTraining, etc.\r\n   */\r\n  commentType: CommentReferenceTypes;\r\n  /**\r\n   * Controls permissions related functionality like internal comments available to admins only\r\n   */\r\n  isAdmin: boolean;\r\n  /**\r\n   * Entity identifier to attach comments to\r\n   */\r\n  referenceId: number;\r\n  /**\r\n   * Optional link that will be shown inside of comments\r\n   */\r\n  link?: string;\r\n  /**\r\n   * default initial value for added comment\r\n   */\r\n  defaultComment?: Partial<IComment>;\r\n  /**\r\n   * set to true if user can not add comments\r\n   */\r\n  cannotComment?: boolean;\r\n\r\n  /**\r\n   * Event fired after a comment has been added successfully\r\n   */\r\n  onCommentAdded?: (comment: IComment) => void;\r\n\r\n  onEditComment?: (comment: IComment, newComment: NewComment) => void;\r\n  onDeleteComment?: (comment: IComment) => void;\r\n  noTitle?: boolean;\r\n  disableFileUpload?: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\n\r\n/**\r\n * Reusable comments component.\r\n * For example:\r\n * <Comments\r\n *    commentType={CommentReferenceTypes.Invoice}\r\n *    referenceId={referenceId}\r\n *    isAdmin={isAdmin}\r\n *    link={link}\r\n *    />\r\n * @param param\r\n * @returns\r\n */\r\nexport const Comments = ({\r\n  commentType,\r\n  referenceId,\r\n  isAdmin,\r\n  link,\r\n  defaultComment,\r\n  cannotComment,\r\n  pageName,\r\n  emailType,\r\n  disableFileUpload,\r\n  ...props\r\n}: CommentsProps) => {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const [changed, setChanged] = React.useState(false);\r\n\r\n  const comments = useAsyncGetWthEffect<IComment[]>(\r\n    () => CommentsApi.GetComments(commentType, referenceId),\r\n    [],\r\n    [changed],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    dispatch(\r\n      largeFileActions.setCommentProperties({\r\n        commentType: commentType,\r\n        referenceId: referenceId,\r\n      }),\r\n    );\r\n  }, [commentType, dispatch, largeFileActions, referenceId]);\r\n\r\n  // const classes = useStyles();\r\n\r\n  return (\r\n    <CommentsContainer\r\n      Comments={comments}\r\n      onSubmit={c => {\r\n        CommentsApi.SendComment(commentType, referenceId, c)\r\n          .then(res => props.onCommentAdded?.(res))\r\n          .finally(() => setChanged(prev => !prev));\r\n      }}\r\n      isAdmin={isAdmin}\r\n      withMentions\r\n      pageName={pageName ?? t(translations.Invoice)}\r\n      referenceName={referenceId.toString()}\r\n      linkUrl={useAbsolute(link)}\r\n      emailType={emailType ?? 'Invoice'}\r\n      defaultComment={defaultComment}\r\n      cannotComment={cannotComment}\r\n      disableFileUpload={disableFileUpload}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n//   <Box component=\"div\" className={classes.base}>\r\n// </Box>\r\n// const useStyles = makeStyles((theme: Theme) => ({\r\n//   base: {\r\n//     paddingInline: theme.spacing(2),\r\n//   },\r\n// }));\r\n","import { useCalendarLink } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { ViewTypes } from 'app/pages/CalendarPage/Scheduler/slice/types';\r\nimport { Button, ButtonProps } from '../BasicButtons/Button';\r\n\r\nexport interface CalendarButtonProps extends Omit<ButtonProps, 'href'> {\r\n  equipments?: Array<number | undefined>;\r\n  start?: string | Date;\r\n  openToBook?: boolean;\r\n  viewType?: ViewTypes;\r\n  defaultMulti?: boolean;\r\n  target?: string;\r\n}\r\n\r\nexport function CalendarButton({\r\n  equipments,\r\n  start,\r\n  openToBook,\r\n  viewType = 'calendar',\r\n  defaultMulti,\r\n  target,\r\n  ...props\r\n}: CalendarButtonProps) {\r\n  const link = useCalendarLink({\r\n    equipments,\r\n    openToBook,\r\n    start,\r\n    viewType,\r\n    defaultMulti,\r\n  });\r\n  return <Button href={link} target={target} {...props} />;\r\n}\r\n","/**\r\n *\r\n * FormFundingTypePicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { FundingTypeIdPicker } from '../pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\n\r\nexport const FormFundingTypePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <FundingTypeIdPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\n/**\r\n * Determines user's membership in provided user group.\r\n * Can be used to clear user/usergroup selection in connected selectors (user group)\r\n * @param selectedUser selected user\r\n * @param selectedUserGroup selected user group\r\n * @returns true if the user is a member of the user group\r\n */\r\nexport function isMember(\r\n  selectedUser: Entity<string> | null | undefined,\r\n  selectedUserGroup: Entity<string> | null | undefined,\r\n) {\r\n  const userGroupId = (selectedUser as IUserFilterDto)?.UserGroupId;\r\n  const samePrimaryUserGroup = userGroupId === selectedUserGroup?.Id;\r\n  const userGroups = (selectedUser as IUserFilterDto)?.UserGroups;\r\n  const member = userGroups?.some(ug => ug.Id === selectedUserGroup?.Id);\r\n  const result = samePrimaryUserGroup || member;\r\n  return result;\r\n}\r\n","import {\r\n  InputAdornment,\r\n  InputBaseComponentProps,\r\n  SelectProps as MuiSelectProps,\r\n} from '@material-ui/core';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport React from 'react';\r\n\r\nimport BaseTextField from '../BaseTextField';\r\n\r\nexport interface SelectProps {\r\n  fullWidth?: boolean;\r\n  info?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLTextAreaElement | HTMLInputElement>;\r\n  onChange?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\r\n  onFocus?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\r\n  startIcon?: React.ReactNode;\r\n  endIcon?: React.ReactNode;\r\n  autoFocus?: boolean;\r\n  variant?: 'standard' | 'outlined' | 'filled';\r\n  label?: React.ReactNode;\r\n  SelectProps?: MuiSelectProps;\r\n  className?: string;\r\n  children?: React.ReactNode;\r\n  inputProps?: InputBaseComponentProps;\r\n  id?: string;\r\n  value?: unknown;\r\n  multiple?: boolean;\r\n  placeholder?: string;\r\n  ariaLabel?: string;\r\n  renderValue?: (value: MuiSelectProps['value']) => React.ReactNode;\r\n}\r\n\r\nexport function Select({\r\n  info,\r\n  startIcon,\r\n  endIcon,\r\n  onBlur,\r\n  onChange,\r\n  onFocus,\r\n  autoFocus,\r\n  variant,\r\n  inputProps,\r\n  className,\r\n  SelectProps,\r\n  children,\r\n  id,\r\n  placeholder,\r\n  ariaLabel,\r\n  multiple,\r\n  label,\r\n  value,\r\n  renderValue,\r\n  ...props\r\n}: SelectProps) {\r\n  const startIconComponent = startIcon && (\r\n    <InputAdornment position=\"start\">{startIcon}</InputAdornment>\r\n  );\r\n  const classNames: string[] = [];\r\n  if (className) classNames.push(className);\r\n  if (startIcon) classNames.push('startIcon');\r\n  if (endIcon) classNames.push('endIcon');\r\n\r\n  const endIconComponent = (\r\n    <InputAdornment position=\"end\">{endIcon}</InputAdornment>\r\n  );\r\n  const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n  };\r\n  const handleOpen = e => {\r\n    setAnchorEl(e.currentTarget);\r\n  };\r\n  const ITEM_HEIGHT = 56;\r\n  const ITEM_PADDING_TOP = 16;\r\n  return (\r\n    <BaseTextField\r\n      select={true}\r\n      onClick={e => {\r\n        if (!Boolean(anchorEl)) {\r\n          handleOpen(e);\r\n        }\r\n      }}\r\n      SelectProps={{\r\n        multiple: multiple,\r\n        MenuProps: {\r\n          anchorOrigin: {\r\n            vertical: 'bottom',\r\n            horizontal: 'left',\r\n          },\r\n          transformOrigin: {\r\n            vertical: 'top',\r\n            horizontal: 'left',\r\n          },\r\n          autoFocus: false,\r\n          getContentAnchorEl: null,\r\n          anchorEl: anchorEl,\r\n          open: Boolean(anchorEl),\r\n          // disablePortal: true,\r\n          onClose: (ev, r) => handleClose(),\r\n          PaperProps: {\r\n            style: {\r\n              maxHeight: ITEM_HEIGHT * 5 + ITEM_PADDING_TOP,\r\n            },\r\n          },\r\n        },\r\n        displayEmpty: true,\r\n        ...SelectProps,\r\n      }}\r\n      value={value}\r\n      onBlur={onBlur}\r\n      onChange={onChange}\r\n      onFocus={onFocus}\r\n      autoFocus={autoFocus}\r\n      variant={variant || 'standard'}\r\n      placeholder={placeholder}\r\n      id={id || 'simple-select'}\r\n      inputProps={{\r\n        ...inputProps,\r\n        'aria-label': `${\r\n          label ? undefined : ariaLabel ? ariaLabel : 'search input'\r\n        }`,\r\n      }}\r\n      InputProps={{\r\n        startAdornment: startIcon && startIconComponent,\r\n        endAdornment:\r\n          (info && <InfoIcon title={info} />) || (endIcon && endIconComponent),\r\n      }}\r\n      className={classNames.length > 0 ? classNames.join(' ') : undefined}\r\n      {...props}\r\n    >\r\n      {/* {placeholder && (\r\n        <MenuItem disabled value=\"\">\r\n          <SmallBody1>{placeholder}</SmallBody1>\r\n        </MenuItem>\r\n      )} */}\r\n      {children}\r\n    </BaseTextField>\r\n  );\r\n\r\n  //   return (\r\n  //     <FormControl\r\n  //       variant={props.variant || 'standard'}\r\n  //       fullWidth={props.fullWidth}\r\n  //     >\r\n  //       {/* {props.label && (\r\n  //         <InputLabel id={props.labelId ? props.labelId : 'simple-select'}>\r\n  //           {props.label}\r\n  //         </InputLabel>\r\n  //       )} */}\r\n\r\n  //       <MuiSelect\r\n  //         input={\r\n  //           props.variant === 'filled' ? (\r\n  //             <FilledInput fullWidth={props.fullWidth} />\r\n  //           ) : (\r\n  //             <StandardInput fullWidth={props.fullWidth} />\r\n  //           )\r\n  //         }\r\n  //         labelId={props.labelId}\r\n  //         label={props.label}\r\n  //         MenuProps={{\r\n  //           anchorOrigin: {\r\n  //             vertical: 'bottom',\r\n  //             horizontal: 'left',\r\n  //           },\r\n  //           transformOrigin: {\r\n  //             vertical: 'top',\r\n  //             horizontal: 'left',\r\n  //           },\r\n  //           getContentAnchorEl: null,\r\n  //           ...props.MenuProps,\r\n  //         }}\r\n  //         {...props}\r\n  //       >\r\n  //         {props.children}\r\n  //       </MuiSelect>\r\n  //     </FormControl>\r\n  //   );\r\n}\r\n","import { Box, ListItem, ListItemText, MenuItem } from '@material-ui/core';\r\nimport { ButtonLabel } from 'app/components/Typography';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { FilterBox } from '../FilterBox';\r\nimport { savedViewsApi as api } from 'api/savedViewsApi';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Uppercase } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { SavedViewDetailsProps } from 'app/pages/SavedViewsPage/SavedViewPage/Details';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n  savedViewActions,\r\n  useSavedViewSlice,\r\n} from 'app/pages/SavedViewsPage/SavedViewPage/slice';\r\nimport { Select } from 'app/components/BasicInputs/Select';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { IFilterSettings } from '../IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { URLSearchParamsCI } from '../../types/FilterParam';\r\nimport { tryParseInt } from 'utils/string-utils';\r\n\r\nexport interface SavedListsDropDownProps<T> {\r\n  serviceItem: IFilterSettings<T>;\r\n  onRemove: (item: IFilterSettings<T>) => void;\r\n  onApply: (item: IFilterSettings<T>) => void;\r\n  addFilter: (value: IFilterSettings<T>) => void;\r\n  hasInVisibleFilters: boolean;\r\n  serializedKey: string;\r\n  listViewbyAsset?: boolean;\r\n}\r\nexport const SAVEDVIEW_SEARCH_KEY = 'savedview';\r\nfunction SavedLists<TRow>({\r\n  serviceItem,\r\n  onRemove,\r\n  onApply,\r\n  addFilter,\r\n  hasInVisibleFilters,\r\n  serializedKey,\r\n  listViewbyAsset,\r\n}: SavedListsDropDownProps<TRow>) {\r\n  const { checkIsMobile } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const { t } = useTranslation();\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const savedActions = useSavedViewSlice();\r\n  const isAdmin = React.useMemo(() => {\r\n    return (\r\n      user !== undefined &&\r\n      (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n        user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n        user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n        user.Roles.indexOf(Roles.EquipmentAdministrator) >= 0)\r\n    );\r\n  }, [user]);\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const location = useLocation();\r\n  const fetchView = async (\r\n    user: AuthenticatedUser | undefined,\r\n    serviceGroups: Entity<number>[] | undefined,\r\n    isAdmin: boolean,\r\n  ): Promise<ISavedViewDto[]> => {\r\n    return api\r\n      .getMySavedViews({\r\n        user: user,\r\n        serviceGroups: selectedServiceGroups,\r\n        isAdmin: isAdmin,\r\n        onlyMyView: false,\r\n      })\r\n      .then(data => {\r\n        return data;\r\n      });\r\n  };\r\n  const containsText = (text, searchText) =>\r\n    text.toLowerCase().includes(searchText.toLowerCase());\r\n\r\n  const [myViews, setMyViews] = useAsyncExtendedState<ISavedViewDto[]>([]);\r\n  const [fetchViewState, fetchViewPromise] = usePromise(fetchView);\r\n  const [input, setInnput] = React.useState<string>('');\r\n  const selectedView = React.useMemo(() => {\r\n    const search = new URLSearchParamsCI(location.search);\r\n    const savedViewId = tryParseInt(search.get(SAVEDVIEW_SEARCH_KEY));\r\n    const selectedView = myViews.find(savedView => {\r\n      return savedView.Id === savedViewId;\r\n    });\r\n    return selectedView;\r\n  }, [location.search, myViews]);\r\n  const displayedOptions = React.useMemo(\r\n    () =>\r\n      myViews\r\n        .filter(option => containsText(option.Name, input))\r\n        .sort((a, b) => (a.Name < b.Name ? -1 : a.Name > b.Name ? 1 : 0)),\r\n    [input, myViews],\r\n  );\r\n  const getViewDislpayName = (renderedView: ISavedViewDto): string => {\r\n    let groupId = renderedView.Assets[0].ServiceGroupId;\r\n    if (renderedView.Assets.some(item => item.ServiceGroupId !== groupId)) {\r\n      return renderedView.Name;\r\n    } else {\r\n      return `${renderedView.Name} (${renderedView.Assets[0].ServiceGroupName})`;\r\n    }\r\n  };\r\n  const selectedChangeLocation = React.useCallback(\r\n    (view: ISavedViewDto | undefined) => {\r\n      // store selected values for other uses\r\n      dispatch(savedViewActions.selectSavedView_Success(view));\r\n\r\n      //const originalSearch = new URLSearchParamsCI(location.search);\r\n      const currentSearch = new URLSearchParams(location.search);\r\n      if (view === undefined) {\r\n        currentSearch.delete(SAVEDVIEW_SEARCH_KEY);\r\n      } else {\r\n        currentSearch.set(SAVEDVIEW_SEARCH_KEY, String(view?.Id));\r\n      }\r\n      if (!!view && view.Assets.length > 0) {\r\n        currentSearch.set(\r\n          serializedKey,\r\n          view.Assets.map(f => {\r\n            if (listViewbyAsset) {\r\n              return f.Id;\r\n            } else {\r\n              return f.ServiceId !== null && f.ServiceId !== undefined\r\n                ? f.ServiceId\r\n                : undefined;\r\n            }\r\n          })\r\n            .filter(f => f !== undefined)\r\n            .join('|'),\r\n        );\r\n        //addFilter(serviceItem);\r\n        if (hasInVisibleFilters) {\r\n          onApply({\r\n            ...serviceItem,\r\n            ...{\r\n              value: view.Assets.map(asset => {\r\n                return {\r\n                  Id: listViewbyAsset ? asset.Id : asset.ServiceId || 0,\r\n                  Name: asset.Name,\r\n                  Color: asset.Color,\r\n                } as Entity<number>;\r\n              }),\r\n            },\r\n            ...{ open: false },\r\n          });\r\n        } else {\r\n          addFilter({\r\n            ...serviceItem,\r\n            ...{\r\n              value: view.Assets.map(asset => {\r\n                return {\r\n                  Id: listViewbyAsset ? asset.Id : asset.ServiceId || 0,\r\n                  Name: asset.Name,\r\n                  Color: asset.Color,\r\n                } as Entity<number>;\r\n              }),\r\n            },\r\n            ...{ open: false },\r\n          });\r\n        }\r\n        dispatch(\r\n          routerActions.replace({\r\n            pathname: location.pathname,\r\n            search: currentSearch.toString(),\r\n          }),\r\n        );\r\n      } else {\r\n        currentSearch.set(serializedKey, '');\r\n        if (hasInVisibleFilters) {\r\n          onApply({\r\n            ...serviceItem,\r\n            ...{\r\n              value: undefined,\r\n            },\r\n            ...{ open: false },\r\n          });\r\n        }\r\n        //onRemove(serviceItem);\r\n        dispatch(\r\n          routerActions.replace({\r\n            pathname: location.pathname,\r\n            search: currentSearch.toString(),\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [\r\n      addFilter,\r\n      dispatch,\r\n      hasInVisibleFilters,\r\n      listViewbyAsset,\r\n      location.pathname,\r\n      location.search,\r\n      onApply,\r\n      serializedKey,\r\n      serviceItem,\r\n    ],\r\n  );\r\n  React.useEffect(() => {\r\n    if (\r\n      !fetchViewState.status ||\r\n      (fetchViewState.status !== 'pending' &&\r\n        fetchViewState.status !== 'resolved')\r\n    ) {\r\n      setMyViews(fetchViewPromise(user, selectedServiceGroups, isAdmin));\r\n    }\r\n\r\n    return () => {};\r\n  }, [\r\n    fetchViewPromise,\r\n    fetchViewState,\r\n    isAdmin,\r\n    selectedServiceGroups,\r\n    setMyViews,\r\n    user,\r\n  ]);\r\n  const selectedViewChange = React.useCallback(\r\n    e => {\r\n      let selected = e.target.value;\r\n      if (selected === 'search') {\r\n        //e.preventDefault();\r\n        //e.stopPropagation();\r\n      } else {\r\n        if (selected !== 'action') {\r\n          let view = myViews.filter(f => f.Id === selected)[0];\r\n          dispatch(savedActions.actions.selectMyList(view));\r\n          //setSelectedView(() => view);\r\n          selectedChangeLocation(view);\r\n        }\r\n      }\r\n    },\r\n    [myViews, dispatch, savedActions.actions, selectedChangeLocation],\r\n  );\r\n  const removeSelected = React.useCallback(() => {\r\n    dispatch(savedActions.actions.selectMyList(undefined));\r\n    //setSelectedView(undefined);\r\n    selectedChangeLocation(undefined);\r\n  }, [dispatch, savedActions.actions, selectedChangeLocation]);\r\n  const openDetailsList = React.useCallback(() => {\r\n    let params = {\r\n      id: undefined,\r\n      useSidePanel: true,\r\n    } as SavedViewDetailsProps;\r\n    dispatch(\r\n      actions.openSidePanel({\r\n        type: RenderPageType.SavedViewDetails,\r\n        props: params,\r\n      }),\r\n    );\r\n  }, [actions, dispatch]);\r\n  return (\r\n    <FilterBox id={`filter-box-saved-lists`} direction={'vertical'}>\r\n      <ButtonLabel\r\n        // ariaId={`saved-list-label`}\r\n        style={\r\n          isMobile\r\n            ? {\r\n                overflow: 'hidden',\r\n                textOverflow: 'ellipsis',\r\n                maxWidth: '10ch',\r\n              }\r\n            : undefined\r\n        }\r\n        //color={open ? 'primary' : 'initial'}\r\n      >\r\n        {t(translations.InstrumentList)}\r\n      </ButtonLabel>\r\n\r\n      <Box style={{ maxWidth: 400, minWidth: 300 }}>\r\n        {fetchViewState.status === 'resolved' ? (\r\n          <Select\r\n            placeholder={t(translations.MyInstrumentList) as string}\r\n            value={selectedView?.Id || ''}\r\n            onChange={selectedViewChange}\r\n            id=\"saved-list\"\r\n            fullWidth={true}\r\n            //SelectProps={{ MenuProps: { autoFocus: false } }}\r\n            renderValue={selected => {\r\n              return (\r\n                <Body size=\"small\">\r\n                  {displayedOptions.filter(\r\n                    f => f.Id === (selected as number),\r\n                  )[0].Name || ''}\r\n                </Body>\r\n              );\r\n            }}\r\n          >\r\n            <MenuItem key={'myListsTitle'} disabled value=\"\">\r\n              <Uppercase>{t(translations.PleaseSelectView)}</Uppercase>\r\n            </MenuItem>\r\n            <ListItem key=\"lists-search\" value=\"search\">\r\n              <TextControlField\r\n                placeholder={t(translations.SearchFilter)}\r\n                startIcon={\r\n                  <Icon icon=\"search\" color=\"filters\" colorExtend=\"light\" />\r\n                }\r\n                value={input || ''}\r\n                size=\"small\"\r\n                aria-label={t(translations.SearchFilter)}\r\n                inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n                onChange={e => setInnput(e.target.value)}\r\n                autoFocus\r\n                fullWidth\r\n              />\r\n            </ListItem>\r\n            <MenuItem key={'myViewsTitle'} disabled>\r\n              <Uppercase>{t(translations.MySavedLists)}</Uppercase>\r\n            </MenuItem>\r\n            {displayedOptions\r\n              .filter(f => f.UserName === user?.Id)\r\n              .map(a => (\r\n                <MenuItem key={a.Id} value={a.Id}>\r\n                  <ListItemText>\r\n                    <Body size=\"small\">{getViewDislpayName(a)}</Body>\r\n                  </ListItemText>\r\n                </MenuItem>\r\n              ))}\r\n            {displayedOptions.filter(\r\n              f => f.Shared === true && f.UserName !== user?.Id,\r\n            ).length > 0 && (\r\n              <MenuItem key={'sharedViewsTitle'} disabled>\r\n                <Uppercase>{t(translations.SharedLists)}</Uppercase>\r\n              </MenuItem>\r\n            )}\r\n\r\n            {displayedOptions.filter(\r\n              f => f.Shared === true && f.UserName !== user?.Id,\r\n            ).length > 0 &&\r\n              displayedOptions\r\n                .filter(f => f.Shared === true && f.UserName !== user?.Id)\r\n                .map(a => (\r\n                  <MenuItem key={a.Id} value={a.Id}>\r\n                    <ListItemText>\r\n                      <Body size=\"small\">{getViewDislpayName(a)}</Body>\r\n                    </ListItemText>\r\n                  </MenuItem>\r\n                ))}\r\n            {displayedOptions.filter(f => f.UserName === user?.Id).length >\r\n            0 ? (\r\n              <ListItem key=\"manage-lists\" value=\"action\">\r\n                <Button\r\n                  variant=\"white\"\r\n                  size=\"small\"\r\n                  fullWidth={true}\r\n                  aria-label=\"manage views\"\r\n                  startIcon={<Icon icon=\"cog\" />}\r\n                  to={'/myLists'}\r\n                >\r\n                  {t(translations.ManageLists)}\r\n                </Button>\r\n              </ListItem>\r\n            ) : (\r\n              <ListItem key=\"manage-lists\" value=\"action\">\r\n                <Button\r\n                  variant=\"white\"\r\n                  size=\"small\"\r\n                  fullWidth={true}\r\n                  aria-label=\"create view\"\r\n                  startIcon={<Icon icon=\"plus\" />}\r\n                  onClick={() => openDetailsList()}\r\n                >\r\n                  {t(translations.AddSavedView)}\r\n                </Button>\r\n              </ListItem>\r\n            )}\r\n          </Select>\r\n        ) : (\r\n          <Skeleton width=\"300\" />\r\n        )}\r\n      </Box>\r\n\r\n      <Button\r\n        color=\"default\"\r\n        variant=\"ghost\"\r\n        title=\"Clear selection\"\r\n        size=\"small\"\r\n        onClick={() => {\r\n          removeSelected();\r\n        }}\r\n        aria-label=\"Remove\"\r\n      >\r\n        <Icon icon={['fas', 'xmark']} />\r\n      </Button>\r\n    </FilterBox>\r\n  );\r\n}\r\n\r\nexport const SavedListsDropDown = React.memo(\r\n  SavedLists,\r\n  (prevProps, nextProps) => {\r\n    const x = props =>\r\n      JSON.stringify({\r\n        value: props.serviceItem?.value,\r\n      });\r\n    var result = x(prevProps) === x(nextProps);\r\n\r\n    return result;\r\n  },\r\n) as typeof SavedLists;\r\n","/**\r\n *\r\n * EnumPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { Entity } from 'types/common';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { GetOptionsFilterFunction } from 'utils/enumKeys';\r\n\r\nexport interface EnumPickerProps<TKey extends string>\r\n  extends Omit<\r\n    BaseOptionsPickerProps<Entity<TKey>>,\r\n    'getOptions' | 'value' | 'onChange'\r\n  > {\r\n  EnumNamesArray: Array<TKey>;\r\n  value: TKey | null;\r\n  onChange: (value: TKey | null) => void;\r\n  nameRender?: (value: TKey) => string;\r\n}\r\n\r\nexport function EnumPicker<TKey extends string>({\r\n  value,\r\n  onChange,\r\n  nameRender,\r\n  ...props\r\n}: EnumPickerProps<TKey>) {\r\n  const { t } = useTranslation();\r\n  const options = React.useMemo(\r\n    () =>\r\n      props.EnumNamesArray.map(key => ({\r\n        Id: key,\r\n        Name: !!nameRender ? nameRender(key) : t(key) ?? key,\r\n      })),\r\n    [nameRender, props.EnumNamesArray, t],\r\n  );\r\n\r\n  const getOptions = React.useMemo(() => GetOptionsFilterFunction(options), [\r\n    options,\r\n  ]);\r\n  const selectedOption = React.useMemo(\r\n    () => options.find(f => f.Id === value) ?? null,\r\n    [options, value],\r\n  );\r\n  const handleChange = (value: Entity<TKey> | null) => {\r\n    onChange?.(value?.Id ?? null);\r\n  };\r\n\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={selectedOption}\r\n      onChange={handleChange}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\n/**\r\n * Provides a picker with the predefined options based on the array of the enum names\r\n * @param array Array of the Union type enum names\r\n * @returns\r\n */\r\nexport function withEnumOptions<TUnion extends string>(array: Array<TUnion>) {\r\n  return (Component: React.ComponentType<EnumPickerProps<TUnion>>) => {\r\n    return (props: Omit<EnumPickerProps<TUnion>, 'EnumNamesArray'>) => (\r\n      <Component {...props} EnumNamesArray={array} />\r\n    );\r\n  };\r\n}\r\n","import { Entity } from './common';\r\nimport { CustomDate } from './CustomDate';\r\n\r\nexport interface IConnectedFiltersDto {\r\n  StartTime: Date | string;\r\n  EndTime?: Date | string;\r\n  User?: Entity<string> | null;\r\n  UserGroup?: Entity<string> | null;\r\n  Budget?: Entity<number> | null;\r\n  BudgetExperiment?: Entity<number> | null;\r\n  InstituteProject?: Entity<number> | null;\r\n  FundingType?: Entity<number> | null;\r\n  ExternalCustomer?: Entity<number> | null;\r\n  PurchaseOrder?: string | null;\r\n  Reference?: string | null;\r\n}\r\nexport const ConnectedFiltersInit = (\r\n  StartTime?: Date | string,\r\n  EndTime?: Date | string,\r\n  User?: Entity<string> | null,\r\n  UserGroup?: Entity<string> | null,\r\n  Budget?: Entity<number> | null,\r\n  BudgetExperiment?: Entity<number> | null,\r\n  InstituteProject?: Entity<number> | null,\r\n  FundingType?: Entity<number> | null,\r\n  ExternalCustomer?: Entity<number> | null,\r\n  PurchaseOrder?: string | null,\r\n  Reference?: string | null,\r\n): IConnectedFiltersDto => {\r\n  return {\r\n    StartTime: StartTime || new CustomDate(new Date()).toISOString(),\r\n    EndTime: EndTime,\r\n    User: User,\r\n    UserGroup: UserGroup,\r\n    Budget: Budget,\r\n    BudgetExperiment: BudgetExperiment,\r\n    InstituteProject: InstituteProject,\r\n    ExternalCustomer: ExternalCustomer,\r\n    FundingType: FundingType,\r\n    PurchaseOrder: PurchaseOrder,\r\n    Reference: Reference,\r\n  };\r\n};\r\n","import React from 'react';\r\nimport { useRef } from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport styled from 'styled-components';\r\nimport { selectPrintPDFSections } from './slice/selectors';\r\nimport clsx from 'clsx';\r\n\r\nexport interface PrintPDFSectionProps {\r\n  print: boolean;\r\n  id: string;\r\n  forceChecked?: boolean;\r\n  fullWidth?: boolean;\r\n  sectionClass?: string;\r\n}\r\nexport function PrintPDFSection(\r\n  props: React.PropsWithChildren<PrintPDFSectionProps>,\r\n) {\r\n  const printPDFSections = useSelector(selectPrintPDFSections);\r\n  const componentRef = useRef<HTMLDivElement>(null);\r\n  const printClasses = React.useMemo(() => {\r\n    const classes = ['print-section'];\r\n    if (props.fullWidth) {\r\n      classes.push('print-section-full-width');\r\n    }\r\n    let checked = printPDFSections?.some(\r\n      f => f.id === props.id && (f.checked === true || props.forceChecked),\r\n    );\r\n    if (props.print && !checked) {\r\n      classes.push('print-section-hidden');\r\n    } else {\r\n      classes.push('print-section-block');\r\n    }\r\n    return classes.join(' ');\r\n  }, [\r\n    printPDFSections,\r\n    props.forceChecked,\r\n    props.fullWidth,\r\n    props.id,\r\n    props.print,\r\n  ]);\r\n  // useEffect(() => {\r\n  //   if (componentRef.current !== null) {\r\n  //     if (props.print) {\r\n  //       const checked = printPDFSections?.some(\r\n  //         f => f.id === props.id && (f.checked === true || props.forceChecked),\r\n  //       );\r\n  //       if (checked) {\r\n  //         componentRef.current.style.display = 'block';\r\n  //       } else {\r\n  //         componentRef.current.style.display = 'none';\r\n  //       }\r\n  //     } else {\r\n  //       componentRef.current.style.display = 'initial';\r\n  //     }\r\n  //   }\r\n  // }, [printPDFSections, props.forceChecked, props.id, props.print]);\r\n  return (\r\n    <>\r\n      {props.print ? (\r\n        <PrintSection\r\n          className={clsx(printClasses, props.sectionClass)}\r\n          ref={componentRef}\r\n        >\r\n          {props.children}\r\n        </PrintSection>\r\n      ) : (\r\n        <>{props.children}</>\r\n      )}\r\n    </>\r\n  );\r\n}\r\nconst PrintSection = styled.div`\r\n  &.print-section {\r\n    display: initial;\r\n    &.print-section-hidden {\r\n      display: none;\r\n    }\r\n    &.print-section-block {\r\n      display: block;\r\n    }\r\n    &.print-section-full-width {\r\n      width: 100%;\r\n    }\r\n    &.print-reservation {\r\n      & .formsection {\r\n        flex-direction: column;\r\n        gap: 32px;\r\n        & .rightsection {\r\n          width: 100%;\r\n        }\r\n      }\r\n    }\r\n  }\r\n`;\r\n","/**\r\n *\r\n * NumberFieldFilter\r\n *\r\n */\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const NumberFieldFilter = (props: IFilterComponentProps) => {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const [value, setValue] = React.useState<number | null>(null);\r\n  const handleChange: React.ChangeEventHandler<\r\n    HTMLInputElement | HTMLTextAreaElement\r\n  > = event => {\r\n    setValue(+event.target.value);\r\n    props.onChange(+event.target.value);\r\n  };\r\n\r\n  const { t } = useTranslation();\r\n  return (\r\n    <TextControlField\r\n      value={props.value || null}\r\n      type=\"number\"\r\n      size=\"small\"\r\n      onChange={handleChange}\r\n      autoFocus={true /*props.open*/}\r\n      placeholder={t(translations.AllValues)}\r\n      id={props.id}\r\n      inputProps={{ 'aria-label': props.label }}\r\n    />\r\n  );\r\n};\r\nexport default NumberFieldFilter;\r\n","/**\r\n *\r\n * BuildingPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IBuildingDto } from 'api/odata/generated/entities/IBuildingDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type BuildingsUrl = 'base' | 'assetBase' | 'public' | 'locations';\r\nexport interface BuildingPickerProps\r\n  extends Omit<AutocompletePickerProps<IBuildingDto>, 'loadData'> {\r\n  urlType?: BuildingsUrl;\r\n  withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/Buildings';\r\nconst assetBuildingUrl = '/api/odata/v4/Buildings/BuildingsFilter';\r\nconst publicBuildingUrl = '/api/odata/v4/Buildings/PublicBuildingsFilter';\r\nconst LocationsUrl = '/api/odata/v4/Locations';\r\nexport const initBuildingData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: BuildingsUrl,\r\n  withoutServiceGroups?: boolean,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IBuildingDto[]>((resolve, reject) => {\r\n      resolve([] as IBuildingDto[]);\r\n    });\r\n  } else {\r\n    if (sourceUrl === 'locations') {\r\n      withoutServiceGroups = true;\r\n    }\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        withoutServiceGroups === undefined || withoutServiceGroups === false\r\n          ? 'Id,Name,ServiceGroups'\r\n          : 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'public'\r\n        ? publicBuildingUrl\r\n        : sourceUrl === 'assetBase'\r\n        ? assetBuildingUrl\r\n        : sourceUrl === 'locations'\r\n        ? LocationsUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IBuildingDto[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IBuildingDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: BuildingsUrl,\r\n  withoutServiceGroups?: boolean,\r\n) => {\r\n  if (urlType === 'locations') {\r\n    withoutServiceGroups = true;\r\n  }\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicBuildingUrl\r\n      : urlType === 'assetBase'\r\n      ? assetBuildingUrl\r\n      : urlType === 'locations'\r\n      ? LocationsUrl\r\n      : url;\r\n  return getAutoCompleteLoadDataFn<IBuildingDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select:\r\n      withoutServiceGroups === undefined || withoutServiceGroups === false\r\n        ? ['Id', 'Name', 'ServiceGroups']\r\n        : ['Id', 'Name'],\r\n    globalServiceGroupFilter:\r\n      (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n      !!globalServiceGroupFilter &&\r\n      globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IBuildingDto>(\r\n              'ServiceGroups',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n              'Id',\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function BuildingPicker(props: BuildingPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    isAuth ? globalServiceGroupFilter || [] : [],\r\n    isAuth,\r\n    props.urlType,\r\n    props.withoutServiceGroups,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || 'BuildingId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const BuildingByServiceGroupFilter = (\r\n  value: FilterValueType,\r\n  fieldName: any,\r\n) => {\r\n  if (value !== undefined && value !== null) {\r\n    if (fieldName === 'ServiceGroupId') {\r\n      return [\r\n        `${new Condition<IBuildingDto>(\r\n          'ServiceGroups',\r\n          ODataOperators.AnyIn,\r\n          [(value as Identifiable<number>).Id],\r\n          'Id',\r\n        ).toString()}`,\r\n      ];\r\n    }\r\n  }\r\n  return [];\r\n};\r\n","/**\r\n *\r\n * CampusPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ICampusDto } from 'api/odata/generated/entities/ICampusDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type CampusUrl = 'base' | 'assetBase' | 'public';\r\nexport interface CampusPickerProps\r\n  extends Omit<AutocompletePickerProps<ICampusDto>, 'loadData'> {\r\n  urlType?: CampusUrl;\r\n  withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/Campuses';\r\nconst assetCampusUrl = '/api/odata/v4/Campuses/CampusAssetFilter';\r\nconst publicCampusUrl = '/api/odata/v4/Campuses/PublicCampusAssetFilter';\r\nexport const initCampusData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: CampusUrl,\r\n  withoutServiceGroups?: boolean,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<ICampusDto[]>((resolve, reject) => {\r\n      resolve([] as ICampusDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        withoutServiceGroups === undefined || withoutServiceGroups === false\r\n          ? 'Id,Name,ServiceGroups'\r\n          : 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'public'\r\n        ? publicCampusUrl\r\n        : sourceUrl === 'assetBase'\r\n        ? assetCampusUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as ICampusDto[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<ICampusDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: CampusUrl,\r\n  withoutServiceGroups?: boolean,\r\n) => {\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicCampusUrl\r\n      : urlType === 'assetBase'\r\n      ? assetCampusUrl\r\n      : url;\r\n  return getAutoCompleteLoadDataFn<ICampusDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select:\r\n      withoutServiceGroups === undefined || withoutServiceGroups === false\r\n        ? ['Id', 'Name', 'ServiceGroups']\r\n        : ['Id', 'Name'],\r\n    globalServiceGroupFilter:\r\n      (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n      !!globalServiceGroupFilter &&\r\n      globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<ICampusDto>(\r\n              'ServiceGroups',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function CampusPicker(props: CampusPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    isAuth ? globalServiceGroupFilter || [] : [],\r\n    isAuth,\r\n    props.urlType,\r\n    props.withoutServiceGroups,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || 'CampusId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const CampusByServiceGroupFilter = (\r\n  value: FilterValueType,\r\n  fieldName: any,\r\n) => {\r\n  if (value !== undefined && value !== null) {\r\n    if (fieldName === 'ServiceGroupId') {\r\n      return [\r\n        `${new Condition<ICampusDto>(\r\n          'ServiceGroups',\r\n          ODataOperators.In,\r\n          (value as Identifiable<number>).Id,\r\n        ).toString()}`,\r\n      ];\r\n    }\r\n  }\r\n  return [];\r\n};\r\n","/**\r\n *\r\n * RoomPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type RoomsUrl = 'base' | 'assetBase' | 'public' | 'locations';\r\nexport interface RoomPickerProps\r\n  extends Omit<AutocompletePickerProps<IRoomDto>, 'loadData'> {\r\n  urlType?: RoomsUrl;\r\n  selectArray?: Array<keyof IRoomDto>;\r\n  withoutServiceGroups?: boolean;\r\n}\r\nexport const convertRoomWithBuildingName = (\r\n  Name: string,\r\n  BuildingName: string,\r\n): string => {\r\n  let name = BuildingName !== '' ? `${Name} - ${BuildingName}` : Name;\r\n  return name;\r\n};\r\nexport const modifyRoomName = (room: IRoomDto | null): IRoomDto | null => {\r\n  if (room !== null && room !== undefined) {\r\n    return Object.assign(\r\n      {},\r\n      {\r\n        Name: convertRoomWithBuildingName(room.Name, room.BuildingName ?? ''),\r\n      },\r\n      room,\r\n    );\r\n  }\r\n  return null;\r\n};\r\nconst url = '/api/odata/v4/Rooms/GetRoomsFilter';\r\nconst publicUrl = '/api/odata/v4/Rooms/GetPublicAssetsRoomsFilter';\r\nconst assetRoomUrl = '/api/odata/v4/Rooms/GetAssetsRoomsFilter';\r\nconst LocationsUrl = '/api/odata/v4/LocationsBuilding';\r\nexport const initRoomData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: RoomsUrl,\r\n  withoutServiceGroups?: boolean,\r\n  selectArray?: Array<keyof IRoomDto>,\r\n): Promise<IRoomDto[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<IRoomDto[]>((resolve, reject) => {\r\n      resolve([] as IRoomDto[]);\r\n    });\r\n  } else {\r\n    if (sourceUrl === 'locations') {\r\n      withoutServiceGroups = true;\r\n    }\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: !!selectArray\r\n        ? selectArray.join(',')\r\n        : (withoutServiceGroups === undefined ||\r\n            withoutServiceGroups === false) &&\r\n          !!sourceUrl &&\r\n          sourceUrl !== 'base'\r\n        ? 'Id,Name,BuildingId,BuildingName,ServiceGroupsIds'\r\n        : 'Id,Name,BuildingId,BuildingName',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'public'\r\n        ? publicUrl\r\n        : sourceUrl === 'assetBase'\r\n        ? assetRoomUrl\r\n        : sourceUrl === 'locations'\r\n        ? LocationsUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IRoomDto[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IRoomDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: RoomsUrl,\r\n  withoutServiceGroups?: boolean,\r\n  selectArray?: Array<keyof IRoomDto>,\r\n) => {\r\n  if (urlType === 'locations') {\r\n    withoutServiceGroups = true;\r\n  }\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicUrl\r\n      : urlType === 'assetBase'\r\n      ? assetRoomUrl\r\n      : urlType === 'locations'\r\n      ? LocationsUrl\r\n      : url;\r\n  return getAutoCompleteLoadDataFn<IRoomDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select:\r\n      selectArray ??\r\n      ((withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n      !!urlType &&\r\n      urlType !== 'base'\r\n        ? ['Id', 'Name', 'BuildingId', 'BuildingName', 'ServiceGroupsIds']\r\n        : ['Id', 'Name', 'BuildingId', 'BuildingName']),\r\n    maxTop: 100,\r\n    globalServiceGroupFilter:\r\n      (withoutServiceGroups === undefined || withoutServiceGroups === false) &&\r\n      !!globalServiceGroupFilter &&\r\n      globalServiceGroupFilter.length > 0 &&\r\n      !!urlType &&\r\n      urlType !== 'base'\r\n        ? [\r\n            new Condition<IRoomDto>(\r\n              'ServiceGroupsIds',\r\n              ODataOperators.HasNoAny,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n            new Condition<IRoomDto>(\r\n              'ServiceGroupsIds',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n};\r\n\r\nexport function RoomPicker(props: RoomPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    isAuth ? globalServiceGroupFilter || [] : [],\r\n    isAuth,\r\n    props.urlType,\r\n    props.withoutServiceGroups,\r\n    props.selectArray,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'roomId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nexport const RoomByBuildingFilter = (\r\n  value: FilterValueType,\r\n  fieldName: any,\r\n) => {\r\n  if (value !== undefined && value !== null) {\r\n    if (fieldName === 'BuildingId') {\r\n      return [\r\n        `${new Condition<IRoomDto>(\r\n          'BuildingId',\r\n          ODataOperators.Equals,\r\n          (value as Identifiable<number>).Id,\r\n        ).toString()}`,\r\n      ];\r\n    }\r\n    if (fieldName === 'ServiceGroupId') {\r\n      return [\r\n        `${new Condition<IRoomDto>(\r\n          'ServiceGroupsIds',\r\n          ODataOperators.AnyIn,\r\n          (value as Identifiable<number>).Id,\r\n        ).toString()}`,\r\n      ];\r\n    }\r\n  }\r\n  return [];\r\n};\r\n","import { ToolbarProps as MuiToolbarProps } from '@material-ui/core';\r\nimport React from 'react';\r\nimport { Body, H1 } from 'app/components/Typography';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\n\r\nexport interface TableToolbarHeaderProps\r\n  extends Pick<MuiToolbarProps, 'variant'> {\r\n  isMobile: boolean;\r\n  compact?: boolean;\r\n  screenName: React.ReactNode;\r\n  customScreenName?: React.ReactNode;\r\n  /**\r\n   * Controls the size of the table title. Defaults to H1 for list pages.\r\n   */\r\n  screenNameVariant?: 'H1' | 'section';\r\n}\r\n/**\r\n * Renders responsive page/table header.\r\n * Nothing fancy, just wraps the header content in different components for desktop/mobile. Using responsive styling might have been more appropriate here\r\n * @param props\r\n * @returns\r\n */\r\nexport function TableToolbarHeader({\r\n  compact,\r\n  isMobile,\r\n  screenName,\r\n  customScreenName,\r\n  screenNameVariant,\r\n  variant,\r\n}: React.PropsWithChildren<TableToolbarHeaderProps>) {\r\n  if (compact || isMobile) {\r\n    return <Body bold={true}>{screenName}</Body>;\r\n  } else if (!!customScreenName) {\r\n    return <React.Fragment>{customScreenName}</React.Fragment>;\r\n  } else if (screenNameVariant === 'section') {\r\n    return <FormSectionTitle title={screenName} />;\r\n  } else {\r\n    return <H1 gutterBottom={variant === 'regular'}>{screenName}</H1>;\r\n  }\r\n}\r\n","import { ToolbarProps as MuiToolbarProps, useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport MenuIcon from '@material-ui/icons/Menu';\r\nimport { AlertContentType, BasicAlert } from 'app/components/BasicAlert';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport clsx from 'clsx';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\nimport { RefreshIcon } from './RefreshIcon';\r\nimport {\r\n  TableToolbarHeader,\r\n  TableToolbarHeaderProps,\r\n} from './TableToolbarHeader';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { StyledToolbar } from './styled';\r\n\r\nexport interface TableToolbarProps\r\n  extends React.PropsWithChildren<MuiToolbarProps>,\r\n    Omit<TableToolbarHeaderProps, 'isMobile'>,\r\n    ICanRaiseBasicTableRefreshEvent {\r\n  alertContent?: AlertContentType;\r\n  showAlert?: boolean;\r\n  titleIcon?: React.ReactNode;\r\n  showMenu?: boolean;\r\n  loading?: boolean;\r\n  compact?: boolean;\r\n  /**\r\n   * Make a title section render content as flex column (in case when need to show additional description under Title)\r\n   */\r\n  titleAsColumn?: boolean;\r\n  customExpandMenu?: () => void;\r\n  showGlobalSearchIcon?: boolean;\r\n  toggleGlobalFilter?: () => void;\r\n}\r\n\r\nexport const TableToolbar = React.memo(function TableToolbar({\r\n  screenName,\r\n  screenNameVariant = 'H1',\r\n  alertContent,\r\n  showAlert,\r\n  titleIcon,\r\n  showMenu = true,\r\n  variant = 'regular',\r\n  onRefresh,\r\n  compact,\r\n  customExpandMenu,\r\n  customScreenName,\r\n  showGlobalSearchIcon,\r\n  toggleGlobalFilter,\r\n  titleAsColumn,\r\n  ...props\r\n}: TableToolbarProps) {\r\n  const { t } = useTranslation();\r\n  const { checkIsMobile } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const { toggle } = useExpandedSideBarState();\r\n\r\n  const handleSidebarOpen = () => {\r\n    if (!!customExpandMenu) {\r\n      customExpandMenu();\r\n    } else {\r\n      toggle();\r\n    }\r\n  };\r\n  const handleRefresh = () => {\r\n    const event = { reloadConfigurableColumns: true };\r\n    onRefresh?.(event);\r\n  };\r\n  const theme = useTheme();\r\n  return (\r\n    <StyledToolbar\r\n      theme={theme}\r\n      disableGutters\r\n      variant={variant}\r\n      className={clsx('toolbar', { shortview: isMobile || compact === true })}\r\n    >\r\n      {isMobile && showMenu && (\r\n        <IconButton\r\n          edge=\"start\"\r\n          variant=\"textGray\"\r\n          aria-label=\"toggle menu\"\r\n          onClick={handleSidebarOpen}\r\n        >\r\n          <MenuIcon />\r\n        </IconButton>\r\n      )}\r\n      <div\r\n        className={clsx('titleSection', {\r\n          titleAndIconMobile: isMobile || compact,\r\n          titleAsColumn: titleAsColumn,\r\n        })}\r\n      >\r\n        <div className={'title'}>\r\n          <TableToolbarHeader\r\n            variant={variant}\r\n            isMobile={isMobile}\r\n            screenName={screenName}\r\n            customScreenName={customScreenName}\r\n            compact={compact}\r\n            screenNameVariant={screenNameVariant}\r\n          />\r\n\r\n          {onRefresh !== undefined && (\r\n            <RefreshIcon\r\n              onRefresh={handleRefresh}\r\n              loading={props.loading}\r\n              title={t(translations.RefreshContent)}\r\n            />\r\n          )}\r\n        </div>\r\n        <div>{titleIcon}</div>\r\n      </div>\r\n      {!isMobile && !compact && showAlert === true && alertContent && (\r\n        <div className={'messageContainer'}>\r\n          <BasicAlert content={alertContent} />\r\n        </div>\r\n      )}\r\n\r\n      <div className={'actionsContainer'}>\r\n        {\r\n          <React.Fragment>\r\n            {showGlobalSearchIcon && (\r\n              <IconButton\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                aria-label=\"toggle menu\"\r\n                onClick={() => !!toggleGlobalFilter && toggleGlobalFilter()}\r\n              >\r\n                <Icon icon=\"magnifying-glass\" />\r\n              </IconButton>\r\n            )}\r\n            {props.children}\r\n          </React.Fragment>\r\n        }\r\n      </div>\r\n    </StyledToolbar>\r\n  );\r\n});\r\n","/**\r\n *\r\n * AssetPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { avTypes, getAvFilter } from '../../MultiSelectPickers/AssetsPicker';\r\n\r\nexport interface AssetPickerProps\r\n  extends Omit<AutocompletePickerProps<IAssetDto>, 'loadData'> {\r\n  restrictByAvType?: avTypes;\r\n  /**\r\n   * Option to filter admin permissions. If set to true will return only the assets authenticated user is an admin of\r\n   */\r\n  admin?: boolean;\r\n  /**\r\n   * Fetches only Active assets/instruments if this property is set to true\r\n   */\r\n  showOnlyActiveAssets?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/AssetNames';\r\nexport const initAssetData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IAssetDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  admin?: boolean,\r\n) => {\r\n  const url =\r\n    admin === true\r\n      ? '/api/odata/v4/AssetNames/AdminAssets'\r\n      : '/api/odata/v4/AssetNames';\r\n  return getAutoCompleteLoadDataFn<IAssetDto>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'AssetCatId',\r\n      'Availability',\r\n      // BookableAsset is not mapped (AssetNamesController)\r\n      //      'BookableAsset',\r\n      'Image',\r\n      'ServiceGroupId',\r\n      'ServiceId',\r\n      'ServiceTypeId',\r\n      'ServiceGroupName',\r\n      'ServiceGroupAssetId',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IAssetDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function AssetPicker({\r\n  predicates,\r\n  restrictByAvType,\r\n  showOnlyActiveAssets,\r\n  admin,\r\n  ...props\r\n}: AssetPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  let avFilter =\r\n    restrictByAvType === undefined ? undefined : getAvFilter(restrictByAvType);\r\n\r\n  let filters =\r\n    avFilter !== undefined\r\n      ? predicates !== undefined\r\n        ? [...predicates, avFilter]\r\n        : [avFilter]\r\n      : predicates;\r\n  if (showOnlyActiveAssets === true) {\r\n    filters?.push(\r\n      new Condition<IAssetDto>('Active', ODataOperators.Equals, true),\r\n    );\r\n  }\r\n  const innerLoadData = loadData(\r\n    filters,\r\n    globalServiceGroupFilter || [],\r\n    admin,\r\n  );\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      ariaLabel=\"Asset Filter\"\r\n      id={props.id || 'AssetsId'}\r\n      loadData={innerLoadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport {\r\n  UseSortByState,\r\n  UsePaginationState,\r\n  SortingRule,\r\n  TableState,\r\n} from 'react-table';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { CancelToken } from 'axios';\r\nimport { BasicTableProps } from 'app/components/BasicTable/BasicTableProps';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport {\r\n  getExportParameters,\r\n  buildURL,\r\n  openExportLink,\r\n  IPathAndQuery,\r\n} from 'utils/url-utils';\r\nimport { Entity } from 'types/common';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n//import { Progress } from '../LoadingIndicator';\r\nimport { buildParams } from 'api/odata/ODataParamsBuilder';\r\nimport { ControlledTable } from 'app/components/BasicTable/ControlledTable';\r\nimport { useMemoFilters } from 'app/components/BasicTable/useMemoFilters';\r\nimport { selectDoRefreshTable } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { BasicTableRefreshEventHandler } from '../ControlledTable/ControlledTableProps';\r\nexport type { IRow };\r\nexport type { BasicTableProps };\r\n\r\ntype IPartialTableState<TRow extends IRow> = Partial<\r\n  UseSortByState<TRow> & UsePaginationState<TRow>\r\n>;\r\n\r\nconst REQUEST_CANCELLED_MESSAGE = 'Request cancelled (race condition)';\r\n/**\r\n * Interface to the (initial) table state\r\n */\r\nexport interface IBasicTableState<TRow extends IRow>\r\n  extends IPartialTableState<TRow> {}\r\n\r\nconst defaultRowIdAccessor = <TRow extends IRow>(row: TRow): string =>\r\n  row.Id?.toString();\r\n/**\r\n * Server side driven Table component that will be reused in most of the pages\r\n * @param param0\r\n * @returns\r\n */\r\nexport function UnconfigurableTable<TRow extends IRow>({\r\n  columns,\r\n  initialState,\r\n  api,\r\n  additionalColumns,\r\n  getRowId = defaultRowIdAccessor,\r\n  searchColumns,\r\n  useExport = true,\r\n  onExportForImport,\r\n  rowActions,\r\n  pageActions,\r\n  screenName,\r\n  selectedRowsActions,\r\n  filterOpen = false,\r\n  serviceGroups,\r\n  customParams,\r\n  useImportLink,\r\n  importLink,\r\n  needRefresh,\r\n  ServiceGroupsOptional,\r\n  topAlertMessage,\r\n  printing,\r\n  exportNotConfigurable,\r\n  ...props\r\n}: Omit<BasicTableProps<TRow>, 'screenId'> & {\r\n  // If the component has export, then this parameter should\r\n  // be passed as true, otherwise the export .xlsx will be empty\r\n  // has dependency to:\r\n  // \"C:\\bookitlab\\bkt_webApp\\Api\\Infrastructure\\XlsxResultFormatter.cs\"\r\n  // \"var unConfigured = !string.IsNullOrEmpty(Request.RequestUri.ParseQueryString()[\"unConfigured\"]);\"\r\n  exportNotConfigurable?: boolean;\r\n}) {\r\n  const isMobile = DetectIsMobile();\r\n  // loading/processing indication\r\n  const [loading, setLoading] = React.useState(false);\r\n  // data received from the server and displayd on the table\r\n  const [data, setData] = React.useState<TRow[]>([]);\r\n  // reference to the show/hide filters button\r\n  // data length - total number of the records\r\n  const [dataLength, setDataLength] = React.useState(0);\r\n  // page count derrived from total number of the records\r\n  // this is passed to the react-table hook\r\n  const [controlledPageCount, setControlledPageCount] = React.useState(0);\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const dispatch = useDispatch();\r\n  const doRefresh = useSelector(selectDoRefreshTable);\r\n\r\n  const [tableState, setTableState] = React.useState<Partial<TableState<TRow>>>(\r\n    {\r\n      pageIndex: initialState?.pageIndex ?? 0,\r\n      pageSize:\r\n        printing !== undefined && printing.printing === true\r\n          ? 10000\r\n          : initialState?.pageSize ?? 10,\r\n\r\n      sortBy: initialState?.sortBy,\r\n    },\r\n  );\r\n  const handleChangeState = React.useCallback(state => {\r\n    setTableState(state);\r\n  }, []);\r\n\r\n  const configurableColumns = React.useMemo(() => columns, [columns]);\r\n\r\n  const columnAccessors = React.useMemo(\r\n    () =>\r\n      configurableColumns\r\n        ?.filter(c => typeof c.accessor === 'string')\r\n        ?.filter(c => c.accessor !== undefined)\r\n        ?.map(c => c.accessor as keyof TRow),\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [configurableColumns],\r\n  );\r\n\r\n  // memo cleaned up filters without the Name which is loaded independently of the filter value and only affects appearance of the filter\r\n  const customFilter = useMemoFilters({ appliedFilters: props.appliedFilters });\r\n  // serialize the applied filters to be compatible with shallow comparison of the useEffect readonly array\r\n  const serializedCustomFilter = JSON.stringify(customFilter);\r\n  const handleFilterChange = React.useCallback(\r\n    items => {\r\n      if (props.onFilterChange !== undefined) {\r\n        props.onFilterChange(items);\r\n      }\r\n    },\r\n    [props],\r\n  );\r\n\r\n  /**\r\n   * Fetch data method that retrieves the data according to the current table state\r\n   */\r\n  const fetchData = React.useCallback(\r\n    async (\r\n      state: {\r\n        api: string | IPathAndQuery;\r\n        pageSize: number;\r\n        pageIndex: number;\r\n        sortBy?: SortingRule<TRow>[] | null;\r\n        globalFilterValue?: string;\r\n        customFilter: IFilterSettings<TRow>[];\r\n        serviceGroups?: Entity<number>[];\r\n        isOptionalServiceGroup: boolean;\r\n        columns: Array<keyof TRow>;\r\n      },\r\n      cancelToken: CancelToken,\r\n    ) => {\r\n      setLoading(true);\r\n      try {\r\n        // todo: add support for object notation accessors like 'foo.bar'\r\n        // todo: add support for accessor of type Function(originalRow, rowIndex) => any\r\n        const oDataParams = buildParams<TRow>(\r\n          {\r\n            ...state,\r\n            select: state.columns,\r\n            additionalColumns: additionalColumns,\r\n            serviceGroups: state.serviceGroups ?? [],\r\n          },\r\n          searchColumns,\r\n          customParams,\r\n        );\r\n        var { url, params } = getUrlAndParams(state.api, oDataParams);\r\n        const response = await httpClient.get(url, params, cancelToken);\r\n\r\n        setData(response.value);\r\n        setDataLength(response['@odata.count']);\r\n        setControlledPageCount(\r\n          Math.ceil(response['@odata.count'] / state.pageSize),\r\n        );\r\n        setLoading(false);\r\n      } catch (error) {\r\n        // todo: show error message\r\n\r\n        if (\r\n          error instanceof Error &&\r\n          error.message === REQUEST_CANCELLED_MESSAGE\r\n        ) {\r\n          // noop - request was explicitly cancelled after a new one was issues to prevent race conditions between multiple requests\r\n        } else {\r\n          console.warn(error);\r\n        }\r\n      }\r\n      // finally {\r\n      //   setLoading(false);\r\n      // }\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [],\r\n  );\r\n\r\n  const pageIndex = tableState.pageIndex!;\r\n  const pageSize = tableState.pageSize!;\r\n  const sortBy = tableState.sortBy!;\r\n  const globalFilter = tableState.globalFilter;\r\n\r\n  // connect table state changes to server data fetch side effect\r\n  React.useEffect(() => {\r\n    const cancelTokenSource = httpClient.cancelToken.source();\r\n    if (columnAccessors === undefined) {\r\n      return;\r\n    }\r\n    fetchData(\r\n      {\r\n        api,\r\n        pageIndex,\r\n        pageSize,\r\n        sortBy,\r\n        globalFilterValue: globalFilter as string,\r\n        customFilter: customFilter ?? [],\r\n        serviceGroups: serviceGroups,\r\n        isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n        columns: columnAccessors,\r\n      },\r\n      cancelTokenSource.token,\r\n    );\r\n    return () => {\r\n      cancelTokenSource.cancel(REQUEST_CANCELLED_MESSAGE);\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [\r\n    fetchData,\r\n    pageIndex,\r\n    pageSize,\r\n    sortBy,\r\n    globalFilter,\r\n    serializedCustomFilter,\r\n    serviceGroups,\r\n    ServiceGroupsOptional,\r\n    columnAccessors,\r\n    api,\r\n  ]);\r\n\r\n  const handleExportClick = (): Promise<void> => {\r\n    const { $top, $skip, ...tableParams } = buildParams({\r\n      pageIndex,\r\n      pageSize,\r\n      sortBy,\r\n      globalFilterValue: globalFilter as string,\r\n      customFilter: customFilter ?? [],\r\n      select: columnAccessors,\r\n      additionalColumns: additionalColumns,\r\n      serviceGroups: serviceGroups ?? [],\r\n      isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n    });\r\n    var oDataParams = getExportParameters(tableParams);\r\n    var { url, params } = getUrlAndParams(api, oDataParams);\r\n    if (exportNotConfigurable === true) {\r\n      params['unConfigured'] = true;\r\n    }\r\n    const exporturl = buildURL(url, params);\r\n    return openExportLink(exporturl);\r\n  };\r\n\r\n  const [allRowsSelected, setAllRowsSelected] = React.useState<boolean>();\r\n  const toggleAllRowsSelected = React.useCallback((value: boolean) => {\r\n    setAllRowsSelected(value);\r\n  }, []);\r\n\r\n  /**\r\n   * Reloads the table and unselects all rows\r\n   */\r\n  const handleRefresh: BasicTableRefreshEventHandler = React.useCallback(\r\n    event => {\r\n      if (columnAccessors === undefined) {\r\n        return;\r\n      }\r\n      if (toggleAllRowsSelected !== undefined) {\r\n        toggleAllRowsSelected(false);\r\n      }\r\n      fetchData(\r\n        {\r\n          api,\r\n          pageIndex,\r\n          pageSize,\r\n          sortBy,\r\n          globalFilterValue: globalFilter as string,\r\n          customFilter: customFilter ?? [],\r\n          serviceGroups: serviceGroups,\r\n          isOptionalServiceGroup: ServiceGroupsOptional || false,\r\n          columns: columnAccessors,\r\n        },\r\n        httpClient.cancelToken.source().token,\r\n      );\r\n    },\r\n    [\r\n      columnAccessors,\r\n      toggleAllRowsSelected,\r\n      fetchData,\r\n      api,\r\n      pageIndex,\r\n      pageSize,\r\n      sortBy,\r\n      globalFilter,\r\n      customFilter,\r\n      serviceGroups,\r\n      ServiceGroupsOptional,\r\n    ],\r\n  );\r\n\r\n  const refreshFromState = React.useCallback(() => {\r\n    dispatch(layoutActions.setRefreshTable(false));\r\n    handleRefresh();\r\n  }, [dispatch, layoutActions, handleRefresh]);\r\n\r\n  React.useEffect(() => {\r\n    if (needRefresh !== undefined && needRefresh) {\r\n      handleRefresh();\r\n    }\r\n    if (doRefresh === true) {\r\n      refreshFromState();\r\n    }\r\n  }, [doRefresh, needRefresh, handleRefresh, refreshFromState]);\r\n  const handleSelectedRowsChange = React.useCallback(\r\n    (rows: TRow[]) => {\r\n      if (props.onSelectedRowsChange !== undefined) {\r\n        props.onSelectedRowsChange(rows);\r\n      }\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [props.onSelectedRowsChange],\r\n  );\r\n  return (\r\n    <ControlledTable\r\n      api=\"foo\"\r\n      columns={configurableColumns ?? []}\r\n      compact={isMobile}\r\n      data={data}\r\n      loading={loading}\r\n      dataLength={dataLength}\r\n      onChangeState={handleChangeState}\r\n      onExport={handleExportClick}\r\n      pageCount={controlledPageCount}\r\n      screenName={screenName}\r\n      serviceGroups={serviceGroups}\r\n      ServiceGroupsOptional={ServiceGroupsOptional}\r\n      additionalColumns={additionalColumns}\r\n      appliedFilters={props.appliedFilters}\r\n      availableFilters={props.availableFilters}\r\n      customParams={customParams}\r\n      filterOpen={filterOpen}\r\n      getRowId={getRowId}\r\n      importLink={importLink}\r\n      initialPageSize={pageSize}\r\n      initialState={initialState}\r\n      onDownloadTemplate={props.onDownloadTemplate}\r\n      onExportForImport={onExportForImport}\r\n      onFilterChange={handleFilterChange}\r\n      pageActions={pageActions}\r\n      rowActions={rowActions}\r\n      searchColumns={searchColumns}\r\n      selectedRowsActions={selectedRowsActions}\r\n      onSelectedRowsChange={handleSelectedRowsChange}\r\n      subHeader={props.subHeader}\r\n      topAlertMessage={topAlertMessage}\r\n      useExport={useExport}\r\n      onRefresh={handleRefresh}\r\n      useGlobalFilter={true}\r\n      useImportLink={useImportLink}\r\n      useRowSelect={props.useRowSelect}\r\n      allRowsSelected={allRowsSelected}\r\n      imageSrcKey={props.imageSrcKey}\r\n      titleKey={props.titleKey ?? columnAccessors[0]}\r\n      printing={printing}\r\n    />\r\n  );\r\n}\r\nfunction getUrlAndParams(\r\n  api: string | IPathAndQuery,\r\n  oDataParams: {\r\n    $skip?: number;\r\n    $top?: number;\r\n    $count?: boolean;\r\n    $select?: string;\r\n    $orderby?: string | undefined;\r\n    $filter?: string | undefined;\r\n    $format?: string;\r\n  },\r\n) {\r\n  var url = typeof api === 'string' ? api : (api as IPathAndQuery).path;\r\n  var search = (api as IPathAndQuery).search;\r\n  const params = { ...oDataParams, ...search };\r\n  return { url, params };\r\n}\r\n","import styled from 'styled-components';\r\nimport {\r\n  Theme,\r\n  AppBar,\r\n  AppBarProps,\r\n  MenuProps,\r\n  Menu,\r\n  Collapse,\r\n  CollapseProps,\r\n} from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport transitions from '@material-ui/core/styles/transitions';\r\n\r\nexport const StyledTopBar = styled(\r\n  ({\r\n    theme,\r\n    drawerWidth,\r\n    sidePanelWidth,\r\n    children,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n    drawerWidth: number;\r\n    sidePanelWidth: number;\r\n    children: React.ReactNode;\r\n  } & AppBarProps) => <AppBar {...other}>{children}</AppBar>,\r\n)`\r\n  &.appBar {\r\n    display: flex;\r\n    flex-direction: column;\r\n    justify-content: center;\r\n    align-items: flex-start;\r\n    align-self: stretch;\r\n    background-color: ${bookitColors.base.white};\r\n    z-index: ${props => props.theme.zIndex.drawer + 1};\r\n    transition: ${props =>\r\n      props.theme.transitions.create(['width', 'margin'], {\r\n        easing: props.theme.transitions.easing.sharp,\r\n        duration: props.theme.transitions.duration.leavingScreen,\r\n      })};\r\n    border-bottom: 1px solid ${bookitColors.grayscale.grayBorders};\r\n    width: calc(100% - ${60 + 1}px);\r\n    &.appBarShift {\r\n      margin-left: ${props => props.drawerWidth}px;\r\n      width: calc(100% - ${props => props.drawerWidth}px);\r\n      transition: ${props =>\r\n        props.theme.transitions.create(['width', 'margin'], {\r\n          easing: props.theme.transitions.easing.sharp,\r\n          duration: props.theme.transitions.duration.enteringScreen,\r\n        })};\r\n    }\r\n    &.sidePanelShift {\r\n      margin-right: ${props => props.sidePanelWidth}px;\r\n      width: calc(100% - ${props => 60 + 1 + props.sidePanelWidth}px);\r\n      &.appBarShift {\r\n        width: calc(\r\n          100% - ${props => props.drawerWidth + props.sidePanelWidth}px\r\n        );\r\n      }\r\n    }\r\n  }\r\n`;\r\n\r\nexport const CollapseBar = styled(\r\n  ({\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & CollapseProps) => <Collapse {...other}>{children}</Collapse>,\r\n)`\r\n  &.subBar {\r\n    display: flex;\r\n    height: 56px;\r\n    padding: 4px 16px 4px 32px;\r\n    align-items: center;\r\n    gap: 24px;\r\n    align-self: stretch;\r\n    width: 100%;\r\n    gap: ${props => props.theme.spacing(2)}px;\r\n    border-top: 1px solid ${bookitColors.grayscale.grayBorders};\r\n    background: ${bookitColors.primary.background};\r\n    & .frame {\r\n      display: flex;\r\n      align-items: center;\r\n      gap: 16px;\r\n      flex: 1 0 0;\r\n      & .controls {\r\n        display: flex;\r\n        align-items: center;\r\n        gap: 8px;\r\n        flex: 1 0 0;\r\n      }\r\n    }\r\n  }\r\n`;\r\n\r\nexport const SubTopBar = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  &.subBar {\r\n    display: flex;\r\n    height: 56px;\r\n    padding: 4px 16px 4px 32px;\r\n    align-items: center;\r\n    gap: 24px;\r\n    align-self: stretch;\r\n    width: 100%;\r\n    gap: ${props => props.theme.spacing(2)}px;\r\n    border-top: 1px solid ${bookitColors.grayscale.grayBorders};\r\n    background: ${bookitColors.primary.background};\r\n    transition: ${transitions.create('height', {\r\n      easing: transitions.easing.easeInOut,\r\n      duration: 150,\r\n    })};\r\n    &.subBarCollapsed {\r\n      height: 0;\r\n      display: none;\r\n    }\r\n    & .frame {\r\n      display: flex;\r\n      align-items: center;\r\n      gap: 16px;\r\n      flex: 1 0 0;\r\n      & .controls {\r\n        display: flex;\r\n        align-items: center;\r\n        gap: 8px;\r\n        flex: 1 0 0;\r\n      }\r\n    }\r\n  }\r\n`;\r\n// box-shadow: 0px 1px 1px -1px rgb(0 0 0 / 20%),\r\n// 0px 0px 2px 0px rgb(0 0 0 / 14%), 0px 1px 1px 0px rgb(0 0 0 / 12%);\r\nexport const ProfileSection = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  &.userProfile {\r\n    display: flex;\r\n    justify-content: flex-end;\r\n    align-items: center;\r\n    gap: 8px;\r\n  }\r\n`;\r\n// display: flex;\r\n//     flex-direction: row;\r\n//     align-items: center;\r\n//     padding: 0px;\r\n//     gap: ${props => props.theme.spacing(2)}px;\r\n//     & span > a {\r\n//       color: ${props => props.theme.palette.common.graySubtitle};\r\n//       & > svg {\r\n//         font-size: 20px;\r\n//       }\r\n//     }\r\n//     @media (max-width: ${props => props.theme.breakpoints.values.md}px) {\r\n//       gap: 12px;\r\n//     }\r\n//     & .mainMenu {\r\n//       display: flex;\r\n//       align-items: flex-start;\r\n//       padding: 0px;\r\n//       &.userMenu {\r\n//         flex-direction: column;\r\n//         flex: none;\r\n//         order: 4;\r\n//         flex-grow: 0;\r\n//       }\r\n//       &.menuIcon {\r\n//         flex-direction: row;\r\n//         flex: none;\r\n//         flex-grow: 0;\r\n//       }\r\n//       &.menuCores {\r\n//         flex-direction: row;\r\n//         flex: none;\r\n//         flex-grow: 0;\r\n//         order: 1;\r\n//         align-self: center;\r\n//       }\r\n//       &.menuSearch {\r\n//         flex-direction: column;\r\n//         flex: none;\r\n//         flex-grow: 0;\r\n//         order: 0;\r\n//         align-self: stretch;\r\n//       }\r\n//     }\r\nexport const StyledUserMenu = styled(\r\n  ({\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & MenuProps) => <Menu {...other}>{children}</Menu>,\r\n)`\r\n  & li {\r\n    & a {\r\n      margin-left: ${props => props.theme.spacing(2)}px;\r\n      color: ${props => props.theme.palette.text.primary};\r\n    }\r\n  }\r\n`;\r\n","import styled from 'styled-components';\r\nimport { Theme } from '@material-ui/core/styles';\r\n\r\nexport const Section = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n  sidePanelWidth: number;\r\n}>`\r\n  &.formsection {\r\n    display: flex;\r\n    flex-direction: row;\r\n    align-items: flex-start;\r\n    padding: 0px 32px;\r\n    max-width: 100%;\r\n    width: 100%;\r\n    gap: ${props => props.theme.spacing(17)}px;\r\n    &.noPadding {\r\n      padding: 0;\r\n    }\r\n    &.shortView {\r\n      .sidePanelRoot & {\r\n        .baseRootHeight & {\r\n          flex-direction: row;\r\n          padding: 0px 32px;\r\n          width: 100%;\r\n          gap: ${props => props.theme.spacing(17)}px;\r\n        }\r\n        &.noPadding {\r\n          padding: 0;\r\n        }\r\n        flex-direction: column;\r\n        padding: 0px 16px 0px 24px;\r\n        width: ${props => props.sidePanelWidth}px;\r\n        gap: ${props => props.theme.spacing(2)}px;\r\n      }\r\n    }\r\n    @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n      &.shortView {\r\n        width: 100%;\r\n      }\r\n    }\r\n  }\r\n`;\r\nexport const LeftSection = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  &.leftsection {\r\n    display: flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    flex-grow: 1;\r\n    padding: 0px;\r\n\r\n    width: 100%;\r\n    gap: ${props => props.theme.spacing(6)}px;\r\n    &.shortView {\r\n      .sidePanelRoot & {\r\n        gap: ${props => props.theme.spacing(3)}px;\r\n        .baseRootHeight & {\r\n          gap: ${props => props.theme.spacing(6)}px;\r\n        }\r\n      }\r\n    }\r\n  }\r\n`;\r\nexport const RightSection = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  display: flex;\r\n  flex-direction: column;\r\n  align-items: flex-start;\r\n  flex-grow: 1;\r\n  padding: 0px;\r\n  width: 40%;\r\n  gap: ${props => props.theme.spacing(6)}px;\r\n  &.shortView {\r\n    .sidePanelRoot & {\r\n      width: 100%;\r\n      gap: ${props => props.theme.spacing(2)}px;\r\n      padding-bottom: ${props => props.theme.spacing(3)}px;\r\n      .baseRootHeight & {\r\n        width: 40%;\r\n        gap: ${props => props.theme.spacing(6)}px;\r\n        padding-bottom: 0px;\r\n      }\r\n    }\r\n  }\r\n`;\r\n\r\nexport const RowSection = styled('div')(({ theme }) => ({\r\n  display: 'flex',\r\n  alignItems: 'center',\r\n  width: '100%',\r\n  gap: `${theme.spacing(2)}px`,\r\n  flex: '1 1 49%',\r\n  '&.hideRow': {\r\n    display: 'none',\r\n  },\r\n  '&.shortView': {\r\n    flex: '1 1 100%',\r\n  },\r\n  '&.fullRow': {\r\n    flex: '1 1 100%',\r\n  },\r\n  '&.minRow': {\r\n    flex: '1 1 25%',\r\n    [theme.breakpoints.down('md')]: {\r\n      flex: '1 1 40%',\r\n    },\r\n    [theme.breakpoints.down('sm')]: {\r\n      flex: '1 1 40%',\r\n    },\r\n    [theme.breakpoints.down('xs')]: {\r\n      flex: '1 1 100%',\r\n    },\r\n    // [theme.breakpoints.down('sm')]: {\r\n    //   flex: '1 1 100%',\r\n    // },\r\n  },\r\n  '.shortView &': {\r\n    flex: '1 1 100%',\r\n  },\r\n  '&.wrap': {\r\n    flexWrap: 'wrap',\r\n  },\r\n  '&.shrink-1': {\r\n    '& > *:first-child': {\r\n      flexShrink: 1,\r\n    },\r\n  },\r\n  '&.shrink-2': {\r\n    '& > *:first-child': {\r\n      flexShrink: 2,\r\n    },\r\n  },\r\n  '&.shrink-3': {\r\n    '& > *:first-child': {\r\n      flexShrink: 3,\r\n    },\r\n  },\r\n}));\r\n\r\nexport const FormFieldsBox = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  &.fields-section {\r\n    display: flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    width: 100%;\r\n    padding: 0px;\r\n    gap: ${props => props.theme.spacing(1.5)}px;\r\n    & .sectiontitle {\r\n      display: flex;\r\n      flex-direction: row;\r\n      align-items: center;\r\n      // padding: ${props => props.theme.spacing(0, 0, 0.5)};\r\n      gap: ${props => props.theme.spacing(2)}px;\r\n    }\r\n    & .fields {\r\n      display: flex;\r\n      flex-direction: row;\r\n      align-items: flex-start;\r\n      padding: 0px;\r\n      flex-wrap: wrap;\r\n      box-sizing: border-box;\r\n      width: 100%;\r\n      gap: ${props => props.theme.spacing(1.5)}px;\r\n    }\r\n  }\r\n`;\r\n","import * as React from 'react';\r\nimport { Body } from 'app/components/Typography';\r\nimport styled from 'styled-components';\r\n\r\nexport interface FormSectionTitleProps {\r\n  title: React.ReactNode;\r\n  link?: React.ReactNode;\r\n}\r\nconst SectionTitle = styled('div')`\r\n  display: flex;\r\n  flex-direction: row;\r\n  align-items: center;\r\n  padding: 0px 0px 4px;\r\n  gap: 16px;\r\n`;\r\nexport function FormSectionTitle(props: FormSectionTitleProps) {\r\n  return (\r\n    <SectionTitle>\r\n      <Body bold={true}>{props.title}</Body>\r\n      {props.link !== undefined && props.link}\r\n    </SectionTitle>\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { selectglobalSettings } from './selectors';\r\n\r\nexport const selectGlobalDbSetting_EnableLegacyScheduler = createSelector(\r\n  [selectglobalSettings],\r\n  state =>\r\n    state.GetBooleanByKey(AllowedSettings.EnableLegacyScheduler) ?? false,\r\n);\r\n","/**\r\n *\r\n * AssetsPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  AssetsPicker,\r\n  avTypes,\r\n} from '../pickers/MultiSelectPickers/AssetsPicker/index';\r\n\r\nexport const FormAssetsPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number>[] | null> &\r\n  IFieldProps & {\r\n    restrictByAvType?: avTypes;\r\n    admin?: boolean;\r\n    showOnlyActiveAssets?: boolean;\r\n    withoutServiceGroups?: boolean;\r\n  }) => {\r\n  const [field, meta, helpers] = useField<Entity<number>[] | null>(props);\r\n  return (\r\n    <AssetsPicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      onChipClick={props.onChipClick}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      restrictByAvType={props.restrictByAvType}\r\n      admin={props.admin}\r\n      showOnlyActiveAssets={props.showOnlyActiveAssets}\r\n      disabled={props.disabled}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      required={props.required}\r\n      withoutServiceGroups={props.withoutServiceGroups}\r\n    />\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport {\r\n  BaseOptionsMultiPicker,\r\n  BaseOptionsMultiPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsMultiPicker';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { selectReservationStatuses } from 'app/slice/selectors';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nexport interface ReservationStatusMultiProps\r\n  extends Omit<BaseOptionsMultiPickerProps<number>, 'getOptions'> {}\r\n\r\nexport const initReservationStatusMultiData = (t: TFunction) => (\r\n  initialValue: string | undefined,\r\n) => {\r\n  const id =\r\n    initialValue\r\n      ?.split('|')\r\n      ?.map(id => parseInt(id))\r\n      ?.filter(id => !isNaN(id) && ReservationStatus[id] !== undefined)\r\n      ?.map(id => ({ Id: id, Name: t(translations[ReservationStatus[id]]) })) ??\r\n    [];\r\n  return Promise.resolve(id);\r\n};\r\n\r\nexport function ReservationStatusMultiPicker(\r\n  props: ReservationStatusMultiProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const options = useSelector(state => selectReservationStatuses(state, t));\r\n  const getOptions = React.useCallback(() => options, [options]);\r\n  return (\r\n    <BaseOptionsMultiPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'reservation-status-id'}\r\n      ariaLabel=\"Reservation Status\"\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { ReservationStatusMultiPicker } from 'app/components/pickers/AutocompletePickers/ResrevationStatusMultiPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ResrvationStatusMultiFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <ReservationStatusMultiPicker\r\n      onPickerOpen={props.onOpen}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number>[]}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default ResrvationStatusMultiFilter;\r\n","import { BaseOptionsMultiPicker } from 'app/components/BasicPickers/BaseOptionsMultiPicker';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '..';\r\n\r\nconst getOptions: (t: TFunction) => Entity<number>[] = (t: TFunction) => {\r\n  return [\r\n    {\r\n      Id: 1,\r\n      Name: t(translations.Future),\r\n    },\r\n    {\r\n      Id: 2,\r\n      Name: t(translations.Ongoing),\r\n    },\r\n  ];\r\n};\r\n\r\nexport const getInitUpcomingReservationfilterMultiData = (t: TFunction) => (\r\n  initval: string | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return Promise.resolve([]);\r\n  }\r\n  return Promise.resolve(\r\n    getOptions(t).filter(f =>\r\n      initval\r\n        .split('|')\r\n        .map(s => parseInt(s))\r\n        .includes(f.Id),\r\n    ),\r\n  );\r\n};\r\n\r\nexport const UpcomingReservationfilter = (props: IFilterComponentProps) => {\r\n  const { t } = useTranslation();\r\n  const handleChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  return (\r\n    <BaseOptionsMultiPicker\r\n      getOptions={() => getOptions(t)}\r\n      onChange={handleChange}\r\n      value={props.value}\r\n      placeholder={t(translations.AllReservations)}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * WorkflowBookingFilter\r\n *\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { WorkflowBookingPicker } from 'app/components/pickers/AutocompletePickers/WorkflowBookingPicker';\r\n\r\nexport const WorkflowBookingFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <WorkflowBookingPicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default WorkflowBookingFilter;\r\n","/**\r\n *\r\n * ReservationByIdWithPartsPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IReservationByIdFilterDto } from 'api/odata/generated/entities/IReservationByIdFilterDto';\r\n\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ReservationByIdWithPartsPickerProps\r\n  extends Omit<\r\n    AutocompletePickerProps<IReservationByIdFilterDto>,\r\n    'loadData'\r\n  > {}\r\n\r\nconst url = '/api/odata/v4/ReservationByIdFilter/WithParts';\r\nexport const initReservationByIdWithPartsData = (\r\n  initval: string | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Id desc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        'Id,Name,FatherId,ParentAssemblyReservationId,TopAssemblyReservationId,Repeat_Period,Repeat,ReservationParts',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport function ReservationByIdWithPartsPicker(\r\n  props: ReservationByIdWithPartsPickerProps,\r\n) {\r\n  const loadData = getAutoCompleteLoadDataFn<IReservationByIdFilterDto>({\r\n    url,\r\n    predicates: props.predicates,\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'FatherId',\r\n      'ParentAssemblyReservationId',\r\n      'TopAssemblyReservationId',\r\n      'Repeat_Period',\r\n      'Repeat',\r\n      'ReservationParts',\r\n    ],\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'reservationbyId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * ReservationByIdWithPartsFilter\r\n *\r\n */\r\n\r\nimport { ReservationByIdWithPartsPicker } from 'app/components/pickers/AutocompletePickers/ReservationByIdWithPartsPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ReservationByIdWithPartsFilter = (\r\n  props: IFilterComponentProps,\r\n) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  return (\r\n    <ReservationByIdWithPartsPicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\nexport default ReservationByIdWithPartsFilter;\r\n","import { Chip, ChipProps, Theme, useTheme } from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { BasicTypography } from 'app/components/Typography/BasicTypography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { Entity } from 'types/common';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { FilterChip, FilterDisplayProps } from '..';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { FilterValueType } from '../../FilterValueType';\r\n\r\nconst InstrumentFilterChip = styled(\r\n  ({\r\n    color,\r\n    theme,\r\n    ...other\r\n  }: {\r\n    color?: string;\r\n    theme: Theme;\r\n  } & ChipProps) => <Chip {...other} />,\r\n)`\r\n  &.instrument-display-root {\r\n    gap: ${props => props.theme.spacing(1)}px;\r\n    max-width: 28ch;\r\n    border-radius: 8px;\r\n    color: white;\r\n    background-color: ${props => (!!props.color ? props.color : '#ccc')};\r\n    height: 28px;\r\n    &::first-child {\r\n      margin: 0;\r\n    }\r\n  }\r\n`;\r\nfunction IsNotEmptyArray(\r\n  entity: FilterValueType | undefined,\r\n): entity is Extract<FilterValueType, any[]> {\r\n  return Array.isArray(entity) && !!entity.length;\r\n}\r\nexport function InstrumentsFilterDisplay<TRow>(\r\n  props: FilterDisplayProps<TRow>,\r\n) {\r\n  const { t } = useTranslation();\r\n  const theme = useTheme();\r\n  const isMobile = DetectIsMobile();\r\n  const value = props.filter.value;\r\n  const items = IsNotEmptyArray(value) ? (value as Array<Entity<number>>) : [];\r\n\r\n  const handleDelete = event => {\r\n    props.onDelete(props.filter);\r\n  };\r\n  return items.length > 0 ? (\r\n    <div\r\n      style={{\r\n        gap: '6px',\r\n        display: 'flex',\r\n        flexWrap: 'wrap',\r\n        alignItems: 'center',\r\n        flexDirection: 'row',\r\n        border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n        padding: `${items.length > 7 ? '6px 12px' : '0px 12px'}`,\r\n        borderRadius: '8px',\r\n      }}\r\n    >\r\n      <BasicTypography\r\n        component=\"span\"\r\n        noWrap\r\n        variant=\"boldM\"\r\n        style={\r\n          isMobile\r\n            ? {\r\n                overflow: 'hidden',\r\n                textOverflow: 'ellipsis',\r\n                maxWidth: '10ch',\r\n              }\r\n            : undefined\r\n        }\r\n      >\r\n        {props.filter.displayName}\r\n        {':'}\r\n        {props.filter.isInversed ? ' Not' : ''}\r\n      </BasicTypography>\r\n\r\n      {items\r\n        .filter(chip => chip.Name !== undefined)\r\n        .map(chip => (\r\n          <InstrumentFilterChip\r\n            theme={theme}\r\n            key={chip.Id}\r\n            className={'instrument-display-root'}\r\n            onClick={props.openFilter}\r\n            color={(chip as any)?.Color}\r\n            label={\r\n              <>\r\n                {chip.Name !== undefined && chip.Name.length > 20 ? (\r\n                  <Tooltip title={chip.Name} placement=\"bottom-start\" arrow>\r\n                    <span>\r\n                      <BasicTypography\r\n                        component=\"span\"\r\n                        noWrap\r\n                        variant=\"bodyS\"\r\n                        style={{\r\n                          overflow: 'hidden',\r\n                          textOverflow: 'ellipsis',\r\n                          maxWidth: '20ch',\r\n                          color: 'inherit',\r\n                        }}\r\n                      >\r\n                        {chip.Name}\r\n                      </BasicTypography>\r\n                    </span>\r\n                  </Tooltip>\r\n                ) : (\r\n                  <BasicTypography\r\n                    component=\"span\"\r\n                    variant=\"bodyS\"\r\n                    noWrap\r\n                    style={{\r\n                      overflow: 'hidden',\r\n                      textOverflow: 'ellipsis',\r\n                      maxWidth: '20ch',\r\n                      color: 'inherit',\r\n                    }}\r\n                  >\r\n                    {chip.Name}\r\n                  </BasicTypography>\r\n                )}\r\n              </>\r\n            }\r\n            //   onDelete={handleDelete}\r\n          />\r\n        ))}\r\n      <IconButton variant=\"ghost\" size=\"small\" onClick={handleDelete}>\r\n        <Icon icon=\"times\" />\r\n      </IconButton>\r\n    </div>\r\n  ) : (\r\n    <FilterChip\r\n      theme={theme}\r\n      className={'filter-display-root'}\r\n      onClick={props.openFilter}\r\n      label={\r\n        <>\r\n          <BasicTypography\r\n            component=\"span\"\r\n            noWrap\r\n            style={\r\n              isMobile\r\n                ? {\r\n                    overflow: 'hidden',\r\n                    textOverflow: 'ellipsis',\r\n                    maxWidth: '10ch',\r\n                  }\r\n                : undefined\r\n            }\r\n          >\r\n            {props.filter.displayName}\r\n          </BasicTypography>\r\n          :&ensp;\r\n          <BasicTypography\r\n            component=\"span\"\r\n            noWrap\r\n            style={\r\n              isMobile\r\n                ? {\r\n                    overflow: 'hidden',\r\n                    textOverflow: 'ellipsis',\r\n                    maxWidth: '30ch',\r\n                  }\r\n                : undefined\r\n            }\r\n          >\r\n            {t(translations.NA)}\r\n          </BasicTypography>\r\n        </>\r\n      }\r\n      onDelete={handleDelete}\r\n    />\r\n  );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { getBudgetsFilterSettings } from 'app/components/BasicTable/Filters/ProjectFilter/getBudgetsFilterSettings';\r\nimport { AssetCatGroupFilter } from 'app/components/BasicTable/Filters/AssetCatGroupFilter';\r\nimport { DatesRangeFilter } from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { InstituteFilter } from 'app/components/BasicTable/Filters/InstituteFilter';\r\nimport { AssetCatFilter } from 'app/components/BasicTable/Filters/AssetCatFilter';\r\nimport { CampusFilter } from 'app/components/BasicTable/Filters/CampusFilter';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { BooleanPickerFilter } from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport {\r\n  formatQueryStringDateValue,\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  GetDateOrUndefined,\r\n  getDefaultFilterDatePeriod,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  presetDatesRangeToQueryString,\r\n  initPickerValue,\r\n  URLSearchParamsCI,\r\n  GetStringOrUndefined,\r\n  arrayToQueryString,\r\n  getNumberEntityArray,\r\n  getDefaultFilterNumberPeriod,\r\n  NumebersRangeToQueryString,\r\n  initMultiPickerValue,\r\n  initMultiExPickerValue,\r\n  initExPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { UserGroupFilter } from 'app/components/BasicTable/Filters/UserGroupFIlter';\r\nimport { initAssetCatGroupData } from 'app/components/pickers/AutocompletePickers/AssetCatGroupPicker';\r\nimport { initAssetCatData } from 'app/components/pickers/AutocompletePickers/AssetCatPicker';\r\nimport { initInstituteData } from 'app/components/pickers/AutocompletePickers/InstitutePicker';\r\nimport { initUserGroupData } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { initCampusData } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport { UserFilter } from 'app/components/BasicTable/Filters/UserFilter';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport {\r\n  AppSettings,\r\n  getOffsetDate,\r\n  IsAssetFieldEnabled,\r\n  IsModuleEnabled,\r\n} from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { initReservationStatusMultiData } from 'app/components/pickers/AutocompletePickers/ResrevationStatusMultiPicker';\r\nimport ResrvationStatusMultiFilter from 'app/components/BasicTable/Filters/ResrvationStatusMultiFilter';\r\nimport ServiceGroupFilter from 'app/components/BasicTable/Filters/ServiceGroupFilter';\r\nimport NumbersRangeFilter from 'app/components/BasicTable/Filters/NumbersRangeFilter';\r\nimport DepartmentFilter from 'app/components/BasicTable/Filters/DepartmentFilter';\r\nimport { initDepartmentData } from 'app/components/pickers/AutocompletePickers/DepartmentPicker';\r\nimport { initInstituteTypeData } from 'app/components/pickers/AutocompletePickers/InstituteTypePicker';\r\nimport {\r\n  DatePickerFilter,\r\n  TextFieldFilter,\r\n} from 'app/components/BasicTable/Filters';\r\nimport { initRoomData } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport { RoomPickerFilter } from 'app/components/BasicTable/Filters/RoomPickerFilter';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport UserDisciplineFilter from 'app/components/BasicTable/Filters/UserDisciplineFilter';\r\nimport { initUserDisciplineData } from 'app/components/pickers/AutocompletePickers/UserDisciplinePicker';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { initAvailabilityTypeData } from 'app/components/pickers/AutocompletePickers/AvailabilityTypePicker';\r\nimport { AvailabilityTypeBookableFilter } from 'app/components/BasicTable/Filters/AvailabilityTypeBookableFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport {\r\n  initOnlineServicesData,\r\n  ServiceUrl,\r\n} from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport {\r\n  ServiceAdminFilter,\r\n  ServiceMultiFilter,\r\n  ServiceReservationFilter,\r\n} from 'app/components/BasicTable/Filters/ServiceMultiFilter';\r\nimport { TFunction } from 'i18next';\r\nimport {\r\n  getInitUpcomingReservationfilterMultiData,\r\n  UpcomingReservationfilter,\r\n} from 'app/components/BasicTable/Filters/UpcomingReservationfilter';\r\nimport { isArray } from 'lodash';\r\nimport { IsEntity } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { initWorkflowBookingData } from 'app/components/pickers/AutocompletePickers/WorkflowBookingPicker';\r\nimport WorkflowBookingFilter from 'app/components/BasicTable/Filters/WorkflowBookingFilter';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport InstituteTypeFilter from 'app/components/BasicTable/Filters/InstituteTypeFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport { initServiceGroupsData } from 'app/components/pickers/ServiceGroupPicker';\r\nimport ReservationByIdWithPartsFilter from 'app/components/BasicTable/Filters/ReservationByIdWithPartsFilter';\r\nimport { InstrumentsFilterDisplay } from 'app/components/BasicTable/BasicFilter/FilterDisplay/InstrumentsFilterDisplay';\r\nimport { initReservationByIdWithPartsData } from 'app/components/pickers/AutocompletePickers/ReservationByIdWithPartsPicker';\r\nimport { IReservationByIdFilterDto } from 'api/odata/generated/entities/IReservationByIdFilterDto';\r\n\r\nexport const GetFilters: GetPageFilters<IReservationHistoryDto> =\r\n  (t, appSettings, user, settings) => search => {\r\n    const params = new URLSearchParamsCI(search);\r\n    var result: IFilterSettings<IReservationHistoryDto>[] = [];\r\n    result.push({\r\n      id: 'period',\r\n      fieldName: 'StartTime',\r\n      fieldName1: 'EndTime',\r\n      displayName: t(translations.RG_DatePeriod),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      notNullable: true,\r\n      urlKey: 'period',\r\n    });\r\n    pushServicesFilter(result, t, params, true);\r\n    result.push({\r\n      fieldName: 'StatusId',\r\n      displayName: t(translations.Status),\r\n      operator: ODataOperators.Includes,\r\n      queryStringSerializer: arrayToQueryString('stid'),\r\n      value: getNumberEntityArray(params, 'stid'),\r\n      initData: initMultiPickerValue(initReservationStatusMultiData(t)),\r\n      component: ResrvationStatusMultiFilter,\r\n      urlKey: 'stid',\r\n    });\r\n    pushBookedByFilter(result, t, params);\r\n    const budgetsFilter = getBudgetsFilterSettings<IReservationHistoryDto>(\r\n      params,\r\n      'BudgetId',\r\n      t,\r\n      appSettings,\r\n    );\r\n    if (budgetsFilter !== undefined) {\r\n      result.push(budgetsFilter);\r\n    }\r\n    pushAssetCatGroupFilter(result, t, params, true);\r\n    pushAssetCatFilter(result, t, params, true);\r\n    pushAssetAvailabilityFilter(result, t, params, true);\r\n    result.push({\r\n      fieldName: 'InstituteId',\r\n      displayName: t(translations.Institute),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'iid',\r\n      value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'iid'))),\r\n      initData: initPickerValue(initInstituteData),\r\n      component: InstituteFilter,\r\n      notDefault: true,\r\n      urlKey: 'iid',\r\n    });\r\n\r\n    result.push({\r\n      fieldName: 'StatusId',\r\n      displayName: t(translations.ExcludeStatus),\r\n      operator: ODataOperators.Excludes,\r\n      queryStringSerializer: arrayToQueryString('stidx'),\r\n      value: getNumberEntityArray(params, 'stidx'),\r\n      initData: initMultiPickerValue(initReservationStatusMultiData(t)),\r\n      component: ResrvationStatusMultiFilter,\r\n      notDefault: true,\r\n      urlKey: 'stidx',\r\n    });\r\n\r\n    result.push({\r\n      customFilter: (value, setting) => {\r\n        //To be able to display records when \"All My Managed Services\" option is selected\r\n        if (!!value && setting.fieldName === 'EquipmentId') {\r\n          if (\r\n            isArray(value) &&\r\n            (value as []).find(x => (x as Entity<number>).Id === -999)\r\n          ) {\r\n            return new Condition(\r\n              setting.fieldName,\r\n              ODataOperators.NotEquals,\r\n              -999,\r\n            ).toString();\r\n          } else {\r\n            return new Condition(\r\n              setting.fieldName,\r\n              setting.operator,\r\n              value,\r\n            ).toString();\r\n          }\r\n        }\r\n      },\r\n      fieldName: 'ServiceGroupId',\r\n      displayName: t(translations.ServiceGroup),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'ServiceGroupId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'ServiceGroupId')),\r\n      ),\r\n      initData: initExPickerValue(initServiceGroupsData),\r\n      component: ServiceGroupFilter,\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      fieldName: 'ADGroup',\r\n      displayName: t(translations.UserGroup),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(GetStringOrUndefined(GetRawValue(params, 'adg'))),\r\n      component: UserGroupFilter,\r\n      queryStringSerializer: 'adg',\r\n      initData: initPickerValue(initUserGroupData),\r\n      notDefault: true,\r\n      urlKey: 'adg',\r\n    });\r\n    result.push({\r\n      fieldName: 'Id',\r\n      displayName: t(translations.ReservationsRelatedToReservationId),\r\n      operator: ODataOperators.Includes,\r\n      queryStringSerializer: 'relId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'relId')),\r\n      ),\r\n      component: ReservationByIdWithPartsFilter,\r\n      initData: initExPickerValue(initReservationByIdWithPartsData),\r\n      notDefault: true,\r\n      urlKey: 'relId',\r\n      refreshAfterInit: true,\r\n      customFilter: (value, setting) => {\r\n        if (!!value && setting.fieldName === 'Id') {\r\n          let part = value as IReservationByIdFilterDto;\r\n          if (!!part.ReservationParts && part.ReservationParts.length > 0) {\r\n            let ids = part.ReservationParts.map(item => {\r\n              return { Id: item };\r\n            }) as Identifiable<number>[];\r\n\r\n            return `${new Condition(\r\n              setting.fieldName,\r\n              ODataOperators.Includes,\r\n              ids,\r\n            ).toString()} or ${new Condition(\r\n              'TopAssemblyReservationId',\r\n              ODataOperators.Includes,\r\n              ids,\r\n            ).toString()}`;\r\n          } else {\r\n            return `${new Condition(\r\n              setting.fieldName,\r\n              ODataOperators.Equals,\r\n              part.Id,\r\n            ).toString()} or ${new Condition(\r\n              'TopAssemblyReservationId',\r\n              ODataOperators.Equals,\r\n              part.Id,\r\n            ).toString()}`;\r\n          }\r\n        }\r\n      },\r\n    });\r\n    result.push({\r\n      fieldName: 'LastUpdateAdminId',\r\n      displayName: t(translations.LastUpdateAdmin),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'LastUpdateAdminId',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'LastUpdateAdminId')),\r\n      ),\r\n      component: UserFilter,\r\n      initData: initPickerValue(initUserData),\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      fieldName: 'InsertedById',\r\n      displayName: t(translations.OrderedBy),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'InsertedById',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'InsertedById')),\r\n      ),\r\n      component: UserFilter,\r\n      initData: initPickerValue(initUserData),\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      id: 'StartTimeDate',\r\n      fieldName: 'StartTime',\r\n      queryStringSerializer: formatQueryStringDateValue('startsOn'),\r\n      displayName: t(translations.ReservationStartsOn),\r\n      operator: ODataOperators.Equals,\r\n      defaultValue: new CustomDate(),\r\n      value: GetDateOrUndefined(GetRawValue(params, 'startsOn'), 'date'),\r\n      component: DatePickerFilter,\r\n      notDefault: true,\r\n      urlKey: 'startsOn',\r\n    });\r\n    result.push({\r\n      id: 'EndTimeDate',\r\n      fieldName: 'EndTime',\r\n      queryStringSerializer: formatQueryStringDateValue('endsOn'),\r\n      displayName: t(translations.ReservationEndsOn),\r\n      operator: ODataOperators.Equals,\r\n      defaultValue: new Date(),\r\n      value: GetDateOrUndefined(GetRawValue(params, 'endsOn'), 'date'),\r\n      component: DatePickerFilter,\r\n      notDefault: true,\r\n      urlKey: 'endsOn',\r\n    });\r\n    result.push({\r\n      id: 'StartTime',\r\n      fieldName: 'StartTime',\r\n      displayName: t(translations.StartTime),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod(\r\n        'StartTime-period',\r\n        'StartTime-st',\r\n        'StartTime-et',\r\n        params,\r\n      ),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'StartTime-period',\r\n        'StartTime-st',\r\n        'StartTime-et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      notDefault: true,\r\n      urlKey: 'StartTime-period',\r\n    });\r\n    result.push({\r\n      id: 'EndTime',\r\n      fieldName: 'EndTime',\r\n      displayName: t(translations.EndTime),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod(\r\n        'EndTime-period',\r\n        'EndTime-st',\r\n        'EndTime-et',\r\n        params,\r\n      ),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'EndTime-period',\r\n        'EndTime-st',\r\n        'EndTime-et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      notDefault: true,\r\n      urlKey: 'EndTime-period',\r\n    });\r\n\r\n    result.push({\r\n      fieldName: 'Tutoring',\r\n      displayName: t(translations.Tutoring),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'tr',\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'tr')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n      notDefault: true,\r\n      urlKey: 'tr',\r\n    });\r\n    result.push({\r\n      fieldName: 'Loanable',\r\n      displayName: t(translations.Loanable),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'loan',\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'loan')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n      notDefault: true,\r\n      urlKey: 'loan',\r\n    });\r\n    result.push({\r\n      fieldName: 'TrainingSignUp',\r\n      queryStringSerializer: 'TrainingSignUp',\r\n      displayName: t(translations.TrainingSignUp),\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'TrainingSignUp')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      id: 'RecordDate',\r\n      fieldName: 'RecordDate',\r\n      displayName: t(translations.RecordDate),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod(\r\n        'RecordDate-period',\r\n        'RecordDate-st',\r\n        'RecordDate-et',\r\n        params,\r\n      ),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'RecordDate-period',\r\n        'RecordDate-st',\r\n        'RecordDate-et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      notDefault: true,\r\n      urlKey: 'RecordDate-period',\r\n    });\r\n    result.push({\r\n      id: 'DurationH',\r\n      fieldName: 'DurationH',\r\n      displayName: t(translations.Duration),\r\n      operator: ODataOperators.Between,\r\n      value: getDefaultFilterNumberPeriod('DurationH', params),\r\n      queryStringSerializer: NumebersRangeToQueryString('DurationH'),\r\n      component: NumbersRangeFilter,\r\n      notDefault: true,\r\n      urlKey: 'DurationH',\r\n    });\r\n    result.push({\r\n      id: 'DepartmentId',\r\n      fieldName: 'DepartmentId',\r\n      queryStringSerializer: 'DepartmentId',\r\n      displayName: t(translations.Department),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'DepartmentId')),\r\n      ),\r\n      initData: initPickerValue(initDepartmentData),\r\n      component: DepartmentFilter,\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      notDefault: true,\r\n      id: 'InstituteTypeId',\r\n      fieldName: 'InstituteTypeId',\r\n      queryStringSerializer: 'InstituteTypeId',\r\n      displayName: t(translations.InstituteType),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'InstituteTypeId')),\r\n      ),\r\n      initData: initPickerValue(initInstituteTypeData),\r\n      component: InstituteTypeFilter,\r\n    });\r\n    result.push({\r\n      id: 'AssetModel',\r\n      fieldName: 'AssetModel',\r\n      queryStringSerializer: 'AssetModel',\r\n      displayName: t(translations.Model),\r\n      operator: ODataOperators.Contains,\r\n      value: GetRawValue(params, 'AssetModel'),\r\n      component: TextFieldFilter,\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      id: 'AssetModelNumber',\r\n      fieldName: 'AssetModelNumber',\r\n      queryStringSerializer: 'AssetModelNumber',\r\n      displayName: t(translations.ModelNumber),\r\n      operator: ODataOperators.Contains,\r\n      value: GetRawValue(params, 'AssetModelNumber'),\r\n      component: TextFieldFilter,\r\n      notDefault: true,\r\n    });\r\n    pushRoomFilter(result, t, params, true);\r\n    pushBuildingFilter(result, t, params, true);\r\n    result.push({\r\n      id: 'UserDisciplineId',\r\n      fieldName: 'UserDisciplineId',\r\n      displayName: t(translations.Discipline),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'UserDisciplineId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'UserDisciplineId')),\r\n      ),\r\n      component: UserDisciplineFilter,\r\n      initData: initPickerValue(initUserDisciplineData),\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      fieldName: 'StaffUser',\r\n      displayName: t(translations.StaffUser),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'StaffUser',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'StaffUser')),\r\n      ),\r\n      initData: initPickerValue(initUserData),\r\n      component: UserFilter,\r\n      notDefault: true,\r\n    });\r\n\r\n    pushBudgetManagerFilter(appSettings, result, t, params, true);\r\n    pushCampusFilter(appSettings, result, t, params, true);\r\n\r\n    result.push({\r\n      id: 'upcomingReservations',\r\n      fieldName: 'StartTime',\r\n      queryStringSerializer: arrayToQueryString('upcomingReservations'),\r\n      operator: ODataOperators.Equals,\r\n      displayName: t(translations.UpcomingReservations),\r\n      value: getNumberEntityArray(params, 'upcomingReservations'),\r\n      component: UpcomingReservationfilter,\r\n      initData: initMultiPickerValue(\r\n        getInitUpcomingReservationfilterMultiData(t),\r\n      ),\r\n      notDefault: true,\r\n      urlKey: 'upcomingReservations',\r\n      customFilter(value, settings) {\r\n        if (!isArray(value) || (value ?? []).length === 0) {\r\n          return undefined;\r\n        }\r\n        const now = getOffsetDate(appSettings, new Date());\r\n        return (\r\n          '(' +\r\n          value\r\n            .map(v => {\r\n              if (!IsEntity(v)) return '';\r\n              if (v.Id === 1) {\r\n                return new Condition(\r\n                  'StartTime',\r\n                  ODataOperators.GreaterThan,\r\n                  now,\r\n                ).toString();\r\n              }\r\n              if (v.Id === 2) {\r\n                return (\r\n                  '(' +\r\n                  new Condition(\r\n                    'StartTime',\r\n                    ODataOperators.LessThanEqual,\r\n                    now,\r\n                  ).toString() +\r\n                  ' and ' +\r\n                  new Condition(\r\n                    'EndTime',\r\n                    ODataOperators.GreaterThan,\r\n                    now,\r\n                  ).toString() +\r\n                  ')'\r\n                );\r\n              }\r\n              return '';\r\n            })\r\n            .join(' or ') +\r\n          ')'\r\n        );\r\n      },\r\n    });\r\n    pushWorkflowBookingFilter(settings, result, t, params, true);\r\n    const HideTrainingSessionsSettings = settings?.GetBoolean(\r\n      AllowedSettings[AllowedSettings.HideTrainingSessionsSettings],\r\n    );\r\n    if (!HideTrainingSessionsSettings) {\r\n      result.push({\r\n        id: 'TrainingSessionId',\r\n        fieldName: 'TrainingSessionId',\r\n        queryStringSerializer: 'TrainingSessionId',\r\n        displayName: t(translations.TrainingSessionId),\r\n        operator: ODataOperators.Equals,\r\n        value: GetNumberOrUndefined(GetRawValue(params, 'TrainingSessionId')),\r\n        component: NumberFieldFilter,\r\n        notDefault: true,\r\n      });\r\n    }\r\n    return result;\r\n  };\r\nexport function pushAssetCatGroupFilter<\r\n  T extends { AssetGroupId: number | null },\r\n>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  result.push({\r\n    id: 'AssetGroupId',\r\n    fieldName: 'AssetGroupId',\r\n    queryStringSerializer: 'assetCatGroupId',\r\n    displayName: t(translations.AssetCatGroupName),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'assetCatGroupId')),\r\n    ),\r\n    initData: initPickerValue(initAssetCatGroupData),\r\n    component: AssetCatGroupFilter,\r\n    urlType: 'assetBase',\r\n    notDefault,\r\n    urlKey: 'assetCatGroupId',\r\n  });\r\n}\r\n\r\nexport function pushBookedByFilter<T extends { BookedById: string | null }>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  result.push({\r\n    id: 'BookedById',\r\n    fieldName: 'BookedById',\r\n    displayName: t(translations.User),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'un',\r\n    value: GetPartialEntity(GetStringOrUndefined(GetRawValue(params, 'un'))),\r\n    component: UserFilter,\r\n    initData: initPickerValue(initUserData),\r\n    notDefault,\r\n    urlKey: 'un',\r\n  });\r\n}\r\n\r\nexport function pushAssetAvailabilityFilter<\r\n  T extends { AvailabilityTypeId: number | null },\r\n>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  result.push({\r\n    id: 'AvailabilityTypeId',\r\n    fieldName: 'AvailabilityTypeId',\r\n    queryStringSerializer: 'atid',\r\n    displayName: t(translations.AvailabilityType),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'atid'))),\r\n    // TODO: set value directly instead of the initValue\r\n    //initValue: getDefaultFilterValue('atid', params) as FilterValueType,\r\n    initData: initPickerValue(initAvailabilityTypeData),\r\n    component: AvailabilityTypeBookableFilter,\r\n    notDefault,\r\n    urlKey: 'atid',\r\n  });\r\n}\r\n\r\nexport function pushBudgetManagerFilter<\r\n  T extends { BudgetManager: string | null },\r\n>(\r\n  appSettings: AppSettings | null,\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  if (IsModuleEnabled(appSettings, KnownModules.Budgets)) {\r\n    result.push({\r\n      id: 'BudgetManager',\r\n      fieldName: 'BudgetManager',\r\n      displayName: t(translations.BudgetManager),\r\n      operator: ODataOperators.Equals,\r\n      // value: getDefaultFilterValue('bid', params),\r\n      queryStringSerializer: 'BudgetManager',\r\n      initData: initPickerValue(initUserData),\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'BudgetManager')),\r\n      ),\r\n      component: UserFilter,\r\n      notDefault,\r\n    });\r\n  }\r\n}\r\n\r\nexport function pushAssetCatFilter<T extends { AssetCatId: number | null }>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  result.push({\r\n    id: 'AssetCatId',\r\n    fieldName: 'AssetCatId',\r\n    displayName: t(translations.AssetCategory),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'assetCatID',\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'assetCatID')),\r\n    ),\r\n    initData: initPickerValue(initAssetCatData),\r\n    component: AssetCatFilter,\r\n    urlType: 'assetBase',\r\n    urlKey: 'assetCatID',\r\n    notDefault,\r\n  });\r\n}\r\n\r\nexport function pushRoomFilter<T extends { AssetRoomId: number | null }>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n  options?: Partial<IFilterSettings<T>>,\r\n) {\r\n  result.push({\r\n    id: 'AssetRoomId',\r\n    fieldName: 'AssetRoomId',\r\n    queryStringSerializer: 'AssetRoomId',\r\n    displayName: t(translations.Room),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'AssetRoomId')),\r\n    ),\r\n    initData: initPickerValue(initRoomData),\r\n    component: RoomPickerFilter,\r\n    notDefault,\r\n    ...(options ?? {}),\r\n  });\r\n}\r\n\r\n//not working\r\n/* export function pushRoomFilter<\r\n  T extends {\r\n    AssetRoomId: number | null;\r\n    AssetBuildingId: number | null;\r\n    ServiceGroupId: number | null;\r\n  }\r\n>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  result.push({\r\n    id: 'AssetRoomId',\r\n    fieldName: 'AssetRoomId',\r\n    queryStringSerializer: 'AssetRoomId',\r\n    displayName: t(translations.Room),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'AssetRoomId')),\r\n    ),\r\n    initData: initExPickerValue(initRoomData, undefined, 'base'),\r\n    component: RoomPickerFilter,\r\n    dependencyProp: ['AssetBuildingId', 'ServiceGroupId'],\r\n    filterPredicates: RoomByBuildingFilter,\r\n    urlType: 'base',\r\n    notDefault,\r\n  });\r\n} */\r\n\r\nexport function pushBuildingFilter<\r\n  T extends { AssetBuildingId: number | null },\r\n>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  result.push({\r\n    id: 'AssetBuildingId',\r\n    fieldName: 'AssetBuildingId',\r\n    queryStringSerializer: 'AssetBuildingId',\r\n    displayName: t(translations.Building),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'AssetBuildingId')),\r\n    ),\r\n    initData: initPickerValue(initBuildingData),\r\n    component: BuildingPickerFilter,\r\n    urlType: 'assetBase',\r\n    notDefault,\r\n  });\r\n}\r\n\r\nexport function pushServicesFilter<T extends { EquipmentId: number }>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  includeAllMyManagedServicesOption: boolean,\r\n  fieldName?: keyof T,\r\n  sourceUrl?: ServiceUrl,\r\n  separator?: string,\r\n) {\r\n  const allMyManagedServicesOption = {\r\n    Id: -999,\r\n    Name: t(translations.AllMyManagedServices),\r\n  };\r\n  result.push({\r\n    id: 'service',\r\n    fieldName: fieldName || 'EquipmentId',\r\n    displayName: t(translations.InstrumentServiceName),\r\n    operator: ODataOperators.Includes,\r\n    queryStringSerializer: arrayToQueryString('eid'),\r\n    urlKey: 'eid',\r\n    value: getNumberEntityArray(params, 'eid'),\r\n    component:\r\n      sourceUrl === 'admin'\r\n        ? ServiceAdminFilter\r\n        : sourceUrl === 'reserved'\r\n        ? ServiceReservationFilter\r\n        : ServiceMultiFilter,\r\n    additionalItem: includeAllMyManagedServicesOption\r\n      ? allMyManagedServicesOption\r\n      : undefined,\r\n    initData: initMultiExPickerValue(\r\n      initOnlineServicesData,\r\n      [allMyManagedServicesOption],\r\n      sourceUrl,\r\n      separator,\r\n    ),\r\n    customFilter: (value, setting) => {\r\n      if (!includeAllMyManagedServicesOption) {\r\n        return new Condition(\r\n          setting.fieldName,\r\n          setting.operator,\r\n          value,\r\n          setting.fieldName1,\r\n        ).toString();\r\n      }\r\n      //To be able to display records when \"All My Managed Services\" option is selected\r\n      if (!!value && setting.fieldName === 'EquipmentId') {\r\n        if (\r\n          isArray(value) &&\r\n          (value as []).find(x => (x as Entity<number>).Id === -999)\r\n        ) {\r\n          return new Condition(\r\n            setting.fieldName,\r\n            ODataOperators.NotEquals,\r\n            -999,\r\n          ).toString();\r\n        } else {\r\n          return new Condition(\r\n            setting.fieldName,\r\n            setting.operator,\r\n            value,\r\n          ).toString();\r\n        }\r\n      }\r\n    },\r\n  });\r\n}\r\n\r\nexport function pushServicesCalendarFilter<T extends { EquipmentId: number }>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  includeAllMyManagedServicesOption: boolean,\r\n  fieldName?: keyof T,\r\n  sourceUrl?: ServiceUrl,\r\n  separator?: string,\r\n) {\r\n  const allMyManagedServicesOption = {\r\n    Id: -999,\r\n    Name: t(translations.AllMyManagedServices),\r\n  };\r\n  result.push({\r\n    id: 'service',\r\n    fieldName: fieldName || 'EquipmentId',\r\n    displayName: t(translations.InstrumentServiceName),\r\n    operator: ODataOperators.Includes,\r\n    queryStringSerializer: arrayToQueryString('eid'),\r\n    urlKey: 'eid',\r\n    value: getNumberEntityArray(params, 'eid'),\r\n    component:\r\n      sourceUrl === 'admin'\r\n        ? ServiceAdminFilter\r\n        : sourceUrl === 'reserved'\r\n        ? ServiceReservationFilter\r\n        : ServiceMultiFilter,\r\n    additionalItem: includeAllMyManagedServicesOption\r\n      ? allMyManagedServicesOption\r\n      : undefined,\r\n    initData: initMultiExPickerValue(\r\n      initOnlineServicesData,\r\n      [allMyManagedServicesOption],\r\n      sourceUrl,\r\n      separator,\r\n    ),\r\n    renderFilterDisplay: InstrumentsFilterDisplay,\r\n  });\r\n}\r\n\r\nexport function pushCampusFilter<T extends { AssetCampusId: number | null }>(\r\n  appSettings: AppSettings | null,\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Campus)) {\r\n    result.push({\r\n      id: 'campus',\r\n      fieldName: 'AssetCampusId',\r\n      displayName: t(translations.Campus),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'campus',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'campus')),\r\n      ),\r\n      initData: initPickerValue(initCampusData),\r\n\r\n      component: CampusFilter,\r\n      notDefault,\r\n      urlKey: 'campus',\r\n    });\r\n  }\r\n}\r\nexport function pushWorkflowBookingFilter(\r\n  settings: GlobalSettings | null,\r\n  result: IFilterSettings<IReservationHistoryDto>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  if (\r\n    settings?.GetBoolean(AllowedSettings[AllowedSettings.AllowWorkflowBooking])\r\n  ) {\r\n    result.push({\r\n      id: 'WorkflowBooking',\r\n      fieldName: 'WorkflowBookingId',\r\n      displayName: t(translations.WorkflowBooking),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'wbId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'wbId')),\r\n      ),\r\n      initData: initPickerValue(initWorkflowBookingData),\r\n      component: WorkflowBookingFilter,\r\n      notDefault,\r\n      urlKey: 'wbId',\r\n    });\r\n  }\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, takeLatest } from 'redux-saga/effects';\r\nimport { repetitiveActions as actions } from '.';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\n\r\nfunction* doSaveState(action: PayloadAction<IRepetitiveDto>) {\r\n  yield put(actions.saveState_success(action.payload));\r\n}\r\nfunction* doSetRepetitiveValue(\r\n  action: PayloadAction<{\r\n    fieldKey: keyof IRepetitiveDto;\r\n    fieldValue: any;\r\n  }>,\r\n) {\r\n  yield put(actions.setRepetitiveValueSuccess(action.payload));\r\n}\r\nexport function* repetitiveSaga() {\r\n  yield takeLatest(actions.saveState.type, doSaveState);\r\n  yield takeLatest(actions.setRepetitiveValue.type, doSetRepetitiveValue);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  IRepetitiveDto,\r\n  RepetitiveInit,\r\n  ShortWeekDays,\r\n} from 'types/IRepetitiveDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { repetitiveSaga } from './saga';\r\nimport { RepetitiveState } from './types';\r\n\r\nexport const initialState: RepetitiveState = {\r\n  processing: false,\r\n  data: {\r\n    StartDate: undefined,\r\n    RecurringEvents: null,\r\n    RepeatsOnDays: ShortWeekDays().map(f => {\r\n      if (f.Id === 0) f.checked = true;\r\n      return f;\r\n    }),\r\n    RecurringEndDate: undefined,\r\n    RepeatsEveryDay: null,\r\n    RepeatsEveryPeriod: null,\r\n    RepeatsMonthlyBy: null,\r\n  },\r\n  repetitiveValueHandler: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'repetitive',\r\n  initialState,\r\n  reducers: {\r\n    resetState(state, action: PayloadAction<Date | string | undefined>) {\r\n      state.data = RepetitiveInit(action.payload ?? new Date());\r\n    },\r\n    saveState(state, action: PayloadAction<IRepetitiveDto>) {},\r\n    saveState_success(state, action: PayloadAction<IRepetitiveDto>) {\r\n      state.data = {\r\n        StartDate: action.payload.StartDate,\r\n        RecurringEvents: action.payload.RecurringEvents,\r\n        RepeatsOnDays: action.payload.RepeatsOnDays,\r\n        RecurringEndDate: action.payload.RecurringEndDate,\r\n        RepeatsEveryDay: action.payload.RepeatsEveryDay,\r\n        RepeatsEveryPeriod: action.payload.RepeatsEveryPeriod,\r\n        RepeatsMonthlyBy: action.payload.RepeatsMonthlyBy,\r\n      };\r\n    },\r\n    setSubmit(state, action: PayloadAction<boolean>) {\r\n      state.processing = action.payload;\r\n    },\r\n    setRepetitiveValue(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof IRepetitiveDto;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {},\r\n    setRepetitiveValueSuccess(\r\n      state,\r\n      action: PayloadAction<{\r\n        fieldKey: keyof IRepetitiveDto;\r\n        fieldValue: any;\r\n      }>,\r\n    ) {\r\n      state.repetitiveValueHandler = {\r\n        run: true,\r\n        fieldKey: action.payload.fieldKey,\r\n        fieldValue: action.payload.fieldValue,\r\n        shouldValidate: true,\r\n      };\r\n    },\r\n    resetRepetitiveHandler(state, action: PayloadAction) {\r\n      state.repetitiveValueHandler = undefined;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: repetitiveActions } = slice;\r\n\r\nexport const useRepetitiveSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: repetitiveSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useRepetitiveSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","/**\r\n * Bookit.Data.ServiceGroupRegistrationStatus\r\n */\r\nexport enum ServiceGroupRegistrationStatus {\r\n  Approved = 0,\r\n  Rejected = 1,\r\n  Pending = 2,\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { ConfigurableTypes } from 'enums/ConfigurableTypes';\r\nimport { Column } from 'react-table';\r\nimport { IRow } from './IRow';\r\n\r\n/**\r\n * Simplest in memory cache of the configurable columns\r\n * TODO: replace this one with something a little bit capable (e.g. expiration, cache-control, etc.)\r\n */\r\nconst configurableColumnsCache: Record<\r\n  string,\r\n  Promise<Array<ConfigurableColumns>>\r\n> = {};\r\n\r\nexport interface ConfigurableColumns {\r\n  Id: string;\r\n  DisplayName: string;\r\n  CustomName: string;\r\n  hasCustomName: boolean;\r\n}\r\n\r\n/**\r\n * Returns cached configurable columns data. Can be also used for pre fetching screens that are likely will be visited.\r\n * Server request can be already resolved one which will return the data immediately.\r\n * If the request is pending, it will resolve for all callers on completion.\r\n * In case no calls were made yet with exact params, a new request will be issued and a pending promis will be returned.\r\n * @param listId listId aka screenId\r\n * @param configurableType screen/export\r\n * @param force forces reload of configurable column and ignores cache\r\n * @returns A promise of the configurable columns data.\r\n */\r\nexport async function GetCachedConfigurableColumnsData(\r\n  listId: number,\r\n  configurableType: number,\r\n  isAuthenticated?: boolean,\r\n  force?: boolean,\r\n) {\r\n  const privateUrl = '/api/odata/v4/ConfigurableColumns';\r\n  const publicUrl = '/api/odata/v4/ConfigurableColumns/PublicColumns';\r\n  const url = isAuthenticated ? privateUrl : publicUrl;\r\n  const param = { ListID: listId, ConfigurableType: configurableType };\r\n  const key = JSON.stringify(param);\r\n\r\n  // drops stored value so it will be reloaded later\r\n  if (force === true) {\r\n    delete configurableColumnsCache[key];\r\n  }\r\n\r\n  // load configurable columns data if it's not present yet\r\n  if (configurableColumnsCache[key] === undefined) {\r\n    configurableColumnsCache[key] = loadData(url, param);\r\n  }\r\n  return await configurableColumnsCache[key];\r\n}\r\n/**\r\n * Loads configurable columns from the server. Throws an error if there's no columns configured\r\n * @param url\r\n * @param param\r\n * @returns\r\n */\r\nasync function loadData(url, param) {\r\n  try {\r\n    const response = await httpClient.get<\r\n      IODataQueryResponse<ConfigurableColumns>\r\n    >(url, param);\r\n    if (!response || !response.value || response.value.length === 0) {\r\n      throw new Error('Unexpected configurable columns response');\r\n    }\r\n    return response.value;\r\n  } catch (error) {\r\n    throw error;\r\n  }\r\n}\r\n\r\nexport function getTableColumns<TRow extends IRow>({\r\n  response,\r\n  ConfigurableColumnsSetUp,\r\n}: {\r\n  response: ConfigurableColumns[];\r\n  ConfigurableColumnsSetUp: Column<TRow>[];\r\n}) {\r\n  var res: Column<TRow>[] = [];\r\n\r\n  if (!response || response.length === 0) {\r\n    return ConfigurableColumnsSetUp;\r\n  } else {\r\n    for (var i = 0; i < response.length; i++) {\r\n      for (var j = 0; j < ConfigurableColumnsSetUp.length; j++) {\r\n        if (\r\n          ConfigurableColumnsSetUp[j].accessor === response[i].Id ||\r\n          ConfigurableColumnsSetUp[j].accessor === response[i].DisplayName ||\r\n          // This is for dummy columns when no accessor is defined.\r\n          ConfigurableColumnsSetUp[j].Header === response[i].DisplayName\r\n        ) {\r\n          if (response[i].hasCustomName) {\r\n            ConfigurableColumnsSetUp[j].Header = response[i].CustomName;\r\n          }\r\n          res.push(ConfigurableColumnsSetUp[j]);\r\n          break;\r\n        }\r\n      }\r\n    }\r\n    return res;\r\n  }\r\n}\r\n\r\nexport async function TryGetExportColumns<TRow extends IRow>(\r\n  listId: number | undefined,\r\n  columns: Array<Column<TRow>>,\r\n): Promise<Array<keyof TRow> | undefined> {\r\n  try {\r\n    if (listId === undefined) {\r\n      return getColumnAccessors(columns);\r\n    } else {\r\n      const columnsData = await GetCachedConfigurableColumnsData(\r\n        listId,\r\n        ConfigurableTypes.ColumnExportConfig,\r\n      );\r\n      return columnsData.map(item => item.Id);\r\n    }\r\n  } catch (error) {\r\n    return getColumnAccessors(columns);\r\n  }\r\n}\r\n\r\nexport function getColumnAccessors<TRow extends IRow>(\r\n  columns: Column<TRow>[],\r\n): Array<keyof TRow> {\r\n  const result: Array<keyof TRow> = columns\r\n    .filter(c => typeof c.accessor === 'string')\r\n    .filter(c => c.accessor !== undefined)\r\n    .map(c => c.accessor as keyof TRow);\r\n  return result;\r\n}\r\n","export enum RemindBefore {\r\n  doNotNotify = 0,\r\n  oneday = 1,\r\n  twodays = 2,\r\n  threedays = 3,\r\n  oneweek = 4,\r\n  onemonth = 5,\r\n  custom = 6,\r\n}\r\n","/**\r\n *\r\n * UserMultiPicker\r\n *\r\n */\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nimport * as React from 'react';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { UserUrl } from '../UserPicker';\r\n\r\nexport interface UserPickerProps\r\n  extends Omit<AutocompleteMultiPickerExProps<IUserFilterDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  selectArray?: Array<keyof IUserFilterDto>;\r\n  urlType?: UserUrl;\r\n  separator?: string;\r\n}\r\n\r\nconst defaultUrl = '/api/odata/v4/UserFilter';\r\nconst fullActiveUrl = '/api/odata/v4/UserFilter/GetUserSelections';\r\nconst adminsUrl = '/api/odata/v4/UserFilter/GetAdminUsers';\r\nexport const initUserMultiData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: UserUrl,\r\n  separator?: string,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve([] as Entity<string>[]);\r\n    });\r\n  } else {\r\n    let ids = (initval.indexOf(separator || '|') !== -1\r\n      ? initval.split(separator || '|')\r\n      : [initval]\r\n    ).map(item => {\r\n      return { Id: item };\r\n    }) as Identifiable<string>[];\r\n    let filters: string | undefined = undefined;\r\n    if (ids.length > 0) {\r\n      const predicates: (string | Condition<IUserFilterDto>)[] = [];\r\n      predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n      filters = predicates.map(f => f.toString()).join(' and ');\r\n    }\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: filters,\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'full'\r\n        ? fullActiveUrl\r\n        : sourceUrl === 'admin'\r\n        ? adminsUrl\r\n        : defaultUrl;\r\n\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as Entity<string>[]);\r\n  }\r\n};\r\n\r\nexport function UserMultiPicker(props: UserPickerProps) {\r\n  const { selectArray, predicates, urlType, ...other } = props;\r\n  const loadData = getAutoCompleteLoadDataFn<IUserFilterDto>({\r\n    url:\r\n      urlType === 'full'\r\n        ? fullActiveUrl\r\n        : urlType === 'admin'\r\n        ? adminsUrl\r\n        : defaultUrl,\r\n    predicates: predicates,\r\n    select: selectArray ?? [\r\n      'Id',\r\n      'Name',\r\n      'UserGroups',\r\n      'Budgets',\r\n      'IsAdminPanel',\r\n      'IsEquipmentAdmin',\r\n      'IsGroupAdmin',\r\n      'IsLabTech',\r\n      'ServiceGroupIds',\r\n      'Services',\r\n      'CustomRoles',\r\n      'UserGroupId',\r\n      'UserGroupName',\r\n      'UserRoles',\r\n    ],\r\n    expand: 'Services,UserGroups',\r\n  });\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      ariaLabel=\"Users search\"\r\n      id={props.id || 'usermultiUId'}\r\n      loadData={loadData}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n\r\n//PREDICATES FUNCTION\r\nexport function ContactsByAssetIdsFilter(\r\n  AssetIds: number[],\r\n): (string | Condition<IUserFilterDto>)[] {\r\n  const predicates: (string | Condition<IUserFilterDto>)[] = [];\r\n  if (AssetIds.length > 0) {\r\n    let ids = AssetIds.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IUserFilterDto>('AssetIds', ODataOperators.Includes, ids),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n","import { isEqual } from 'lodash';\r\nimport { IFilterSettings } from './IFilterSettings';\r\n\r\nexport function areSameFilter<TRow>({\r\n  f,\r\n  item,\r\n}: {\r\n  f: IFilterSettings<TRow> | undefined;\r\n  item: IFilterSettings<TRow> | undefined;\r\n}): boolean {\r\n  return (\r\n    f !== undefined &&\r\n    item !== undefined &&\r\n    isEqual(filterKey(f), filterKey(item))\r\n  );\r\n}\r\n\r\nexport const filterKey = <TRow>(f: IFilterSettings<TRow>) =>\r\n  f.id !== undefined\r\n    ? f.id\r\n    : {\r\n        fieldName: f.fieldName,\r\n        fieldName1: f.fieldName1,\r\n        displayName: f.displayName,\r\n      };\r\n\r\nexport const filtersInQuery = <TRow>(\r\n  filters: IFilterSettings<TRow>[],\r\n  query: string,\r\n) => {\r\n  return filters.filter(f => f.value !== undefined);\r\n};\r\n","/**\r\n *\r\n * FormOnlineServicesComboPicker - FormOnlineServicesSinglePicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  OnlineServiceMultiPicker,\r\n  OnlineServicePickerProps,\r\n  OnlineServiceSinglePicker,\r\n} from '../pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\n\r\nexport const FormOnlineServicesComboPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IServiceFilterDto[] | null> &\r\n  IFieldProps & { multiple: boolean } & OnlineServicePickerProps) => {\r\n  const [field, meta, helpers] = useField<IServiceFilterDto[] | null>(props);\r\n  if (props.multiple) {\r\n    return (\r\n      <OnlineServiceMultiPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        predicates={props.predicates}\r\n        disabled={props.disabled}\r\n        onChipClick={props.onChipClick}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        urlType={props.urlType}\r\n      />\r\n    );\r\n  } else {\r\n    return (\r\n      <OnlineServiceSinglePicker\r\n        predicates={props.predicates}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        error={meta?.error !== undefined}\r\n        variant=\"filled\"\r\n        disabled={props.disabled}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        urlType={props.urlType}\r\n        info={props.info}\r\n      />\r\n    );\r\n  }\r\n};\r\nexport const FormOnlineServicesSinglePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IServiceFilterDto | null> &\r\n  IFieldProps &\r\n  OnlineServicePickerProps) => {\r\n  const [field, meta, helpers] = useField<IServiceFilterDto | null>(props);\r\n\r\n  return (\r\n    <OnlineServiceSinglePicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value[0], true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value === null ? undefined : [field.value]}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      disabled={props.disabled}\r\n      helperText={meta.error}\r\n      urlType={props.urlType}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n    />\r\n  );\r\n};\r\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { Entity, Identifiable } from 'types/common';\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { INamedEntity } from 'types/common';\r\nimport { IAssetAvailabilityDto } from './IAssetAvailabilityDto';\r\nimport { IServiceFilterDto } from './IServiceFilterDto';\r\nimport { IServiceTypeFilterDto } from './IServiceTypeFilterDto';\r\n\r\n/**\r\n *\r\n * auto generated interface for bkt_webApp.Api.OData.V4.Dto.AssetDto\r\n *\r\n */\r\nexport interface IAssetDto extends Entity<number> {\r\n  Id: number;\r\n  Name: string;\r\n  Active?: boolean;\r\n  Availability?: IAssetAvailabilityDto;\r\n  ServiceId?: number | null;\r\n  ServiceTypeId?: number | null;\r\n  ServiceGroupId?: number | null;\r\n  ServiceGroupName?: string | null;\r\n  Image?: string;\r\n  AssetCatId?: number | null;\r\n  PrerequisiteFor?: number | null;\r\n  BookableAsset?: boolean;\r\n  ServiceGroupAssetId?: number | null;\r\n  Color?: string;\r\n}\r\nexport const mapAssetsToServiceFilterDto = (\r\n  assets: IAssetDto[],\r\n): IServiceFilterDto[] => {\r\n  return assets.map(a => {\r\n    return {\r\n      Id: a.ServiceId,\r\n      Name: a.Name,\r\n      ServiceGroupId: a.ServiceGroupId,\r\n      ServiceTypeId: a.ServiceTypeId,\r\n    } as IServiceFilterDto;\r\n  });\r\n};\r\nexport const mapAssetsToServiceTypeFilterDto = (\r\n  assets: IAssetDto[],\r\n): IServiceTypeFilterDto[] => {\r\n  return assets.map(a => {\r\n    return {\r\n      Id: a.ServiceId ?? 0,\r\n      Name: a.Name,\r\n      ServiceGroupId: a.ServiceGroupId ?? 0,\r\n      ServiceTypeId: a.ServiceTypeId ?? 1,\r\n    } as IServiceTypeFilterDto;\r\n  });\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { BudgetPicker } from '../pickers/AutocompletePickers/BudgetPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormBudgetPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IBudgetFilterDto | null> &\r\n  IFieldProps & { useSearchOrPredicate?: boolean }) => {\r\n  const [field, meta, helpers] = useField<IBudgetFilterDto | null>(props);\r\n  return (\r\n    <BudgetPicker\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      disabled={props.disabled}\r\n      label={label}\r\n      onChange={value => {\r\n        props.onChange?.(value);\r\n        helpers.setValue(value, true);\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      variant=\"filled\"\r\n      predicates={props.predicates}\r\n      useSearchOrPredicate={props.useSearchOrPredicate}\r\n      info={props.info}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.ServiceRequestMilestoneStatuses\r\n *\r\n */\r\n\r\nexport enum ServiceRequestMilestoneStatuses {\r\n  NotStarted = 0,\r\n  Started = 1,\r\n  Completed = 2,\r\n}\r\nexport type ServiceRequestMilestoneStatusesUnion = keyof typeof ServiceRequestMilestoneStatuses;\r\nexport const ServiceRequestMilestoneStatusesUnionArray: Array<ServiceRequestMilestoneStatusesUnion> = [\r\n  'NotStarted',\r\n  'Started',\r\n  'Completed',\r\n];\r\n","import { IRepairCodeDto } from 'api/odata/generated/entities/IRepairCodeDto';\r\nimport { ISymptomCodeDto } from 'api/odata/generated/entities/ISymptomCodeDto';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { GetIntervals, IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { getSingleReminder } from 'app/components/pickers/StaticOptionsPickers/RemindBeforePicker';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { RemindBefore } from 'enums/RemindBefore';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { Guid } from 'guid-typescript';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport {\r\n  PageTypeProps,\r\n  RenderPageType,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\n//import { FieldHandlerProps } from 'app/components/Forms/FormRender/FormRenderer';\r\n\r\n/* --- STATE --- */\r\nexport interface WorkOrderState {\r\n  createState: AsyncDataState<WorkOrderDetailsState>;\r\n  updateState: AsyncDataState<WorkOrderDetailsState>;\r\n  reservationOffline: AsyncDataState<ReservationsOfflineData[]>;\r\n  processing: boolean;\r\n  sendEmailOnOffline: boolean;\r\n  readonlyState?: WorkOrderReadonlyState;\r\n  updateAllRecurrent: boolean;\r\n  valueHandler?: FieldHandlerProps<WorkOrderDetailsState>;\r\n  linksProcessing?: boolean;\r\n  /**\r\n   * Value used to change the offline event start from outside of the workorder details\r\n   */\r\n  OfflineEventStart?: Date | Timestamp | null;\r\n  /**\r\n   * Value used to change the offline event end from outside of the workorder details\r\n   */\r\n  OfflineEventEnd?: Date | Timestamp | null;\r\n  doSaveNewComments?: boolean;\r\n  createdOrders: number[];\r\n  savedLinkedOrders: IWorkOrderDetailsDto[];\r\n  calibrationsChanged?: boolean;\r\n  downtimeOverlaps?: DowntimeOverlaps[];\r\n}\r\nexport interface WorkOrderResponse extends IResponseType {\r\n  Id?: number;\r\n  sendEmailOnOffline: boolean;\r\n  RecurringAssetId: number | null;\r\n  RecurringGroupId: number | null;\r\n  WorkOrderTypeId: number | null;\r\n  ReservationOffline: ReservationsOfflineData[];\r\n  AutoCreatedOrders: AutoCreateResult[];\r\n}\r\nexport interface WorkOrderGlobalState {\r\n  workOrderDetails: WorkOrderDetailsState;\r\n  RepetitiveOptions: IRepetitiveDto | null;\r\n}\r\nexport interface WorkOrderDetailsState {\r\n  Id: number;\r\n  Assets: Entity<number>[];\r\n  WorkOrderType: Entity<number> | null;\r\n  WorkOrderTypeStatus: Entity<number> | null;\r\n  SymptomCodes: Entity<number>[];\r\n  RepairCodes: Entity<number>[];\r\n  RemindBefore: Entity<number> | null;\r\n  EventStart: Date | Timestamp;\r\n  EventEnd?: Date | Timestamp | null;\r\n  AlertStart?: Date | Timestamp | null;\r\n  AssignUsers: Entity<string>[];\r\n  Description?: string | null;\r\n  Downtime?: boolean;\r\n  ToDown: boolean;\r\n  OfflineEventStart?: Date | Timestamp | null;\r\n  OfflineEventEnd?: Date | Timestamp | null;\r\n  ReasonType?: Entity<number> | null;\r\n  OfflineRemarks?: string | null;\r\n  AlertTitle?: string | null;\r\n  AutoCreateTitle?: string | null;\r\n  RecurringAssetId: number | null;\r\n  RecurringGroupId: number | null;\r\n  SubmissionFormValues: IFormValueDto[];\r\n  StaffFormValues: IFormValueDto[];\r\n  SubmissionFormFiles: IFormFileValue[];\r\n  StaffFormFiles: IFormFileValue[];\r\n  StuffCustomForm: Entity<number> | null;\r\n  HasAletForm: boolean;\r\n  IsClosed: boolean;\r\n  ClosedStatuses: Entity<number>[];\r\n  ReportedBy?: string | null;\r\n  ShowOnCalibrationHistory: boolean;\r\n  NotEditable: boolean;\r\n  ReservationId: number | null;\r\n}\r\nexport interface SendEmailOnOffline {\r\n  cancel: boolean;\r\n  deleted: boolean;\r\n  insert: boolean;\r\n  sendData: ReservationsOfflineData[];\r\n}\r\nexport interface ReservationsOfflineData {\r\n  AlertId: number;\r\n  offStart: Date | string;\r\n  offEnd: Date | string;\r\n  ReasonName: string;\r\n  Remarks: string;\r\n  reservationIds: string;\r\n}\r\nexport interface AutoCreateResult {\r\n  AlertId: number;\r\n  Date: Date;\r\n}\r\nexport interface WorkOrderReadonlyState {\r\n  AlertType: string | null;\r\n  UpdateUser: IUserFilterDto;\r\n  StatusName: string | null;\r\n  ReportedBy: string | null;\r\n  ReportedByDisplayName: string | null;\r\n  LastUpdated: Date | Timestamp | null;\r\n  Reservation: number | null;\r\n  LastComment: string | null;\r\n  LastCommentBy: string | null;\r\n  AssetCatName: string | null;\r\n  AssetCatGroupName: string | null;\r\n  IsClosed: boolean | null;\r\n  ReservationBookedBy: string;\r\n  ReservationUserGroup: string;\r\n  ReservationInstituteId: number | null;\r\n  DoneDate: Date | Timestamp | null;\r\n  DoneBy: string | null;\r\n  InternalServiceAvaliable: boolean;\r\n  CreateDate: Date | Timestamp | null;\r\n  LinkedAlerts: Entity<number>[];\r\n}\r\nexport interface WorkOrderQueryStringParameters {\r\n  id?: string;\r\n  aType?: string;\r\n  down?: string;\r\n  source?: string;\r\n  Up?: string;\r\n  title?: string;\r\n  eStart?: string;\r\n  sympt?: string;\r\n  aStatus?: string;\r\n  aStart?: string;\r\n  desc?: string;\r\n  assetId?: string;\r\n  offH?: string;\r\n  offStart?: string;\r\n  offEnd?: string;\r\n  reason?: string;\r\n  eqid?: string;\r\n  sid?: string;\r\n  defaultMulti?: string;\r\n  continueTo?: string;\r\n  reservationId?: string;\r\n}\r\nexport interface WorkOrderDates {\r\n  start: Date[];\r\n  end: Date[];\r\n  alert: Date[];\r\n  offlineStart: Date[];\r\n  offlineEnd: Date[];\r\n}\r\n\r\nexport interface ContinueToState {\r\n  pageType?: RenderPageType;\r\n  pageProps?: PageTypeProps;\r\n  continueToLink?: string;\r\n}\r\nexport interface DowntimeOverlaps {\r\n  Id: number;\r\n  AssetId: number;\r\n  ServiceId: number;\r\n}\r\nexport function ConvertEntityToModel(\r\n  entity: IWorkOrderDetailsDto,\r\n  toDown: boolean | undefined,\r\n): WorkOrderDetailsState | undefined {\r\n  if (!entity) {\r\n    return undefined;\r\n  } else {\r\n    const result: WorkOrderDetailsState = {\r\n      Id: entity.Id,\r\n      AlertStart: entity.AlertStart,\r\n      Assets: entity.Assets,\r\n      AssignUsers: entity.AssignedUsers,\r\n      Description: entity.AlertDescription,\r\n      Downtime: entity.InstrumentWasDown,\r\n      EventEnd: entity.EventEnd,\r\n      EventStart: entity.EventStart,\r\n      // convert dates (timestamps) received from the API to Date objects\r\n      OfflineEventEnd: entity.OfflineEventEnd,\r\n      OfflineEventStart: entity.OfflineEventStart,\r\n      OfflineRemarks: entity.OfflineRemarks,\r\n\r\n      ReasonType: toEntity(entity.ReasonTypeId, entity.ReasonTypeName),\r\n      RemindBefore: getSingleReminder(entity.RemindMeBefore),\r\n      WorkOrderType: entity.WorkOrderType, //toEntity(entity.AlertTypeId, entity.AlertType),\r\n      WorkOrderTypeStatus: toEntity(entity.StatusId, entity.StatusName),\r\n      RepairCodes: entity.RepairCodes as IRepairCodeDto[],\r\n      SymptomCodes: entity.SymptomCodes as ISymptomCodeDto[],\r\n      AlertTitle: entity.AlertTitle,\r\n      ToDown: toDown || false,\r\n      RecurringAssetId: entity.RecurringAssetId,\r\n      RecurringGroupId: entity.RecurringGroupId,\r\n      AutoCreateTitle: entity.AutoCreateTitle,\r\n      StaffFormValues: entity.FormValues.filter(\r\n        fv => fv.AlertId !== null && fv.AlertTypeId === null,\r\n      ),\r\n      SubmissionFormValues: entity.FormValues.filter(\r\n        fv => fv.AlertId !== null && fv.AlertTypeId !== null,\r\n      ),\r\n      StaffFormFiles: [] as IFormFileValue[],\r\n      SubmissionFormFiles: [] as IFormFileValue[],\r\n      StuffCustomForm: entity.CustomForm as Entity<number> | null,\r\n      HasAletForm: entity.HasAletForm,\r\n      IsClosed: entity.IsClosed ?? false,\r\n      ClosedStatuses: entity.ClosedStatuses,\r\n      ReportedBy: entity.ReportedBy,\r\n      ShowOnCalibrationHistory: (entity.WorkOrderType as IWorkOrderTypeDto)\r\n        .ShowOnCalibrationHistory,\r\n      NotEditable: (entity.WorkOrderType as IWorkOrderTypeDto).NotEditable,\r\n      ReservationId: entity.Reservation,\r\n    } as WorkOrderDetailsState;\r\n    return result;\r\n  }\r\n}\r\nexport function parseRepetitive(\r\n  model: WorkOrderDetailsState,\r\n  repetitive: IRepetitiveDto,\r\n): WorkOrderDates {\r\n  const dates: WorkOrderDates = {\r\n    start: [],\r\n    end: [],\r\n    alert: [],\r\n    offlineStart: [],\r\n    offlineEnd: [],\r\n  };\r\n  let start = dateUtils.dateOrStringToDate(model.EventStart);\r\n  dates.start = GetIntervals(start, repetitive);\r\n  if (!isNullOrUndefined<Date | Timestamp>(model.EventEnd)) {\r\n    let end = dateUtils.dateOrStringToDate(model.EventEnd);\r\n    dates.end = dates.start.map(s => {\r\n      if (s === start) {\r\n        return end;\r\n      } else {\r\n        let dur = dateUtils.intervalToDuration({\r\n          start: start,\r\n          end: s,\r\n        });\r\n        return dateUtils.add(end, dur);\r\n      }\r\n    });\r\n  }\r\n  if (!isNullOrUndefined<Date | Timestamp>(model.AlertStart)) {\r\n    // start = dateUtils.dateOrStringToDate(model.AlertStart);\r\n    // dates.alert = GetIntervals(start, repetitive);\r\n    let alertStart = dateUtils.dateOrStringToDate(model.AlertStart);\r\n    // let alertDuration = dateUtils.intervalToDuration({\r\n    //   start: start,\r\n    //   end: alertStart,\r\n    // });\r\n    dates.alert = dates.start.map(s => {\r\n      if (s === start) {\r\n        return alertStart;\r\n      } else {\r\n        let dur = dateUtils.intervalToDuration({\r\n          start: start,\r\n          end: s,\r\n        });\r\n        return dateUtils.add(alertStart, dur);\r\n      }\r\n    });\r\n  }\r\n  if (!isNullOrUndefined<Date | Timestamp>(model.OfflineEventStart)) {\r\n    // start = dateUtils.dateOrStringToDate(model.OfflineEventStart);\r\n    // dates.offlineStart = GetIntervals(start, repetitive);\r\n    let offStart = dateUtils.dateOrStringToDate(model.OfflineEventStart);\r\n    dates.offlineStart = dates.start.map(s => {\r\n      if (s === start) {\r\n        return offStart;\r\n      } else {\r\n        let dur = dateUtils.intervalToDuration({\r\n          start: start,\r\n          end: s,\r\n        });\r\n        return dateUtils.add(offStart, dur);\r\n      }\r\n    });\r\n  }\r\n  if (!isNullOrUndefined<Date | Timestamp>(model.OfflineEventEnd)) {\r\n    let offend = dateUtils.dateOrStringToDate(model.OfflineEventEnd);\r\n    dates.offlineEnd = dates.start.map(s => {\r\n      if (s === start) {\r\n        return offend;\r\n      } else {\r\n        let dur = dateUtils.intervalToDuration({\r\n          start: start,\r\n          end: s,\r\n        });\r\n        return dateUtils.add(offend, dur);\r\n      }\r\n    });\r\n  }\r\n  return dates;\r\n}\r\nexport function ConvertNewWorkOrdersToModel(\r\n  model: WorkOrderGlobalState,\r\n  user: AuthenticatedUser | undefined,\r\n): IWorkOrderDetailsDto[] {\r\n  let entities = [] as IWorkOrderDetailsDto[];\r\n  let workModel = model.workOrderDetails;\r\n  let repeat =\r\n    model.RepetitiveOptions !== null &&\r\n    model.RepetitiveOptions.RecurringEndDate !== null &&\r\n    model.RepetitiveOptions.RecurringEvents != null &&\r\n    model.RepetitiveOptions.RecurringEvents.Id !== RepetitiveOptions.DoNotRepeat\r\n      ? model.RepetitiveOptions\r\n      : null;\r\n  let repeatAsset = workModel.Assets.length > 1;\r\n  let times = repeat ? parseRepetitive(model.workOrderDetails, repeat) : null;\r\n  let assetGuid: Guid | null =\r\n    workModel.Assets.length > 1 ? Guid.create() : null;\r\n  workModel.Assets.forEach(ass => {\r\n    let asset = ass as IAssetDto;\r\n    if (repeat !== null && times !== null) {\r\n      let timesGuid = Guid.create();\r\n      times.start.forEach((date, idx) => {\r\n        entities.push(({\r\n          Id: -1,\r\n          EventStart: dateUtils.formatISO(date),\r\n          EventEnd: isNullOrUndefined<Date>(times?.end[idx])\r\n            ? null\r\n            : dateUtils.tryFormatIso(times?.end[idx]),\r\n          AlertDescription: workModel.Description || null,\r\n          AlertStart: isNullOrUndefined<Date>(times?.alert[idx])\r\n            ? null\r\n            : dateUtils.tryFormatIso(times?.alert[idx]),\r\n\r\n          AlertTitle: workModel.AlertTitle,\r\n          AlertTypeId: workModel.WorkOrderType?.Id ?? -1,\r\n          StatusId: workModel.WorkOrderTypeStatus?.Id,\r\n          AssetId: asset.Id,\r\n          ServiceId: asset.ServiceId,\r\n          ServiceTypeId: asset.ServiceTypeId,\r\n          ServiceGroupId: asset.ServiceGroupId,\r\n          AssignedUsers: workModel.AssignUsers as IUserFilterDto[],\r\n          OfflineEventStart: isNullOrUndefined<Date>(times?.offlineStart[idx])\r\n            ? null\r\n            : dateUtils.tryFormatIso(times?.offlineStart[idx]),\r\n          OfflineEventEnd:\r\n            workModel.OfflineEventStart !== null &&\r\n            workModel.Downtime &&\r\n            isNullOrUndefined<Date | Timestamp>(workModel.OfflineEventEnd)\r\n              ? dateUtils.formatISO(MaxDate)\r\n              : dateUtils.tryFormatIso(times?.offlineEnd[idx]),\r\n          OfflineRemarks: workModel.OfflineRemarks,\r\n          ReasonTypeId: workModel.ReasonType?.Id,\r\n          ReasonTypeName: workModel.ReasonType?.Name,\r\n          InstrumentWasDown: workModel.Downtime ?? false,\r\n          Repeat: true,\r\n          RepeatAssets: repeatAsset,\r\n          RepeatEndTime: repeat?.RecurringEndDate,\r\n          RepairCodes: workModel.RepairCodes as IRepairCodeDto[],\r\n          SymptomCodes: workModel.SymptomCodes as ISymptomCodeDto[],\r\n          RecurringAssetUniq: assetGuid?.toString() ?? null,\r\n          RecurringGroupUniq: timesGuid?.toString() ?? null,\r\n          FormValues: workModel.SubmissionFormValues.concat(\r\n            workModel.StaffFormValues,\r\n          ),\r\n          Reservation: workModel.ReservationId,\r\n          ReportedBy: user?.Id,\r\n          StaffOnly: (workModel.WorkOrderType as IWorkOrderTypeDto).StaffOnly,\r\n          ShowOnCalibrationHistory: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n            .ShowOnCalibrationHistory,\r\n          NotEditable: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n            .NotEditable,\r\n        } as unknown) as IWorkOrderDetailsDto);\r\n      });\r\n    } else {\r\n      entities.push({\r\n        Id: -1,\r\n        EventStart: dateUtils.tryFormatIso(workModel.EventStart),\r\n        AlertDescription: workModel.Description || null,\r\n        AlertStart: isNullOrUndefined<Date | Timestamp>(workModel.AlertStart)\r\n          ? null\r\n          : dateUtils.tryFormatIso(workModel.AlertStart),\r\n        AlertTitle: workModel.AlertTitle,\r\n        AlertTypeId: workModel.WorkOrderType?.Id ?? -1,\r\n        StatusId: workModel.WorkOrderTypeStatus?.Id,\r\n        AssetId: ass.Id,\r\n        ServiceId: asset.ServiceId,\r\n        ServiceTypeId: asset.ServiceTypeId,\r\n        ServiceGroupId: asset.ServiceGroupId,\r\n        AssignedUsers: workModel.AssignUsers as IUserFilterDto[],\r\n        OfflineEventStart: isNullOrUndefined<Date | Timestamp>(\r\n          workModel.OfflineEventStart,\r\n        )\r\n          ? null\r\n          : dateUtils.tryFormatIso(workModel.OfflineEventStart),\r\n        OfflineEventEnd:\r\n          workModel.OfflineEventStart !== null &&\r\n          workModel.Downtime &&\r\n          isNullOrUndefined<Date | Timestamp>(workModel.OfflineEventEnd)\r\n            ? dateUtils.formatISO(MaxDate)\r\n            : isNullOrUndefined<Date | Timestamp>(workModel.OfflineEventEnd)\r\n            ? null\r\n            : dateUtils.tryFormatIso(workModel.OfflineEventEnd),\r\n        OfflineRemarks: workModel.OfflineRemarks,\r\n        ReasonTypeId: workModel.ReasonType?.Id,\r\n        ReasonTypeName: workModel.ReasonType?.Name,\r\n        InstrumentWasDown: workModel.Downtime ?? false,\r\n        Repeat: false,\r\n        RepeatAssets: repeatAsset,\r\n        RepairCodes: workModel.RepairCodes as IRepairCodeDto[],\r\n        SymptomCodes: workModel.SymptomCodes as ISymptomCodeDto[],\r\n        RecurringAssetUniq: assetGuid?.toString() ?? null,\r\n        RecurringGroupUniq: null,\r\n        FormValues: workModel.SubmissionFormValues.concat(\r\n          workModel.StaffFormValues,\r\n        ),\r\n        Reservation: workModel.ReservationId,\r\n        ReportedBy: user?.Id,\r\n        StaffOnly: (workModel.WorkOrderType as IWorkOrderTypeDto).StaffOnly,\r\n        ShowOnCalibrationHistory: (workModel.WorkOrderType as IWorkOrderTypeDto)\r\n          .ShowOnCalibrationHistory,\r\n        NotEditable: (workModel.WorkOrderType as IWorkOrderTypeDto).NotEditable,\r\n      } as IWorkOrderDetailsDto);\r\n    }\r\n  });\r\n  return entities;\r\n}\r\nexport function ConvertModelToEntity(\r\n  model: WorkOrderDetailsState,\r\n  original: WorkOrderDetailsState | undefined,\r\n): IWorkOrderDetailsDto {\r\n  let entity = {\r\n    Id: original?.Id === undefined ? model.Id : original.Id,\r\n    AlertDescription: model.Description,\r\n    AlertStart: isNullOrUndefined<Date | Timestamp>(model.AlertStart)\r\n      ? null\r\n      : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.AlertStart)),\r\n    AlertTitle: model.AlertTitle,\r\n    AlertTypeId: model.WorkOrderType?.Id ?? -1,\r\n    AlertType: model.WorkOrderType?.Name,\r\n    StatusId: model.WorkOrderTypeStatus?.Id,\r\n    StatusName: model.WorkOrderTypeStatus?.Name,\r\n    AssetId: model.Assets[0].Id,\r\n    AssetName: model.Assets[0].Name,\r\n    AssignedUsers: model.AssignUsers as IUserFilterDto[],\r\n    EventStart: isNullOrUndefined<Date | Timestamp>(model.EventStart)\r\n      ? null\r\n      : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EventStart)),\r\n    OfflineEventStart: isNullOrUndefined<Date | Timestamp>(\r\n      model.OfflineEventStart,\r\n    )\r\n      ? null\r\n      : dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(model.OfflineEventStart),\r\n        ),\r\n    OfflineEventEnd:\r\n      !isNullOrUndefined<Date | Timestamp>(model.OfflineEventStart) &&\r\n      model.Downtime\r\n        ? isNullOrUndefined<Date | Timestamp>(model.OfflineEventEnd)\r\n          ? dateUtils.formatISO(MaxDate)\r\n          : dateUtils.formatISO(\r\n              dateUtils.dateOrStringToDate(model.OfflineEventEnd),\r\n            )\r\n        : null,\r\n    OfflineRemarks: model.OfflineRemarks,\r\n    RemindMeBefore: model.RemindBefore?.Id,\r\n    InstrumentWasDown: model.Downtime || false,\r\n    ReasonTypeId: model.ReasonType?.Id,\r\n    ReasonTypeName: model.ReasonType?.Name,\r\n    RepairCodes: model.RepairCodes as IRepairCodeDto[],\r\n    SymptomCodes: model.SymptomCodes as ISymptomCodeDto[],\r\n    ServiceGroupId: (model.Assets[0] as IAssetDto).ServiceGroupId,\r\n    ServiceId: (model.Assets[0] as IAssetDto).ServiceId,\r\n    ServiceTypeId: (model.Assets[0] as IAssetDto).ServiceTypeId,\r\n    RecurringAssetId: model.RecurringAssetId,\r\n    RecurringGroupId: model.RecurringGroupId,\r\n    Repeat: model.RecurringGroupId !== null,\r\n    RepeatAssets: model.RecurringAssetId !== null,\r\n    FormValues: model.SubmissionFormValues.concat(model.StaffFormValues),\r\n    ReportedBy: model.ReportedBy,\r\n    Reservation: model.ReservationId,\r\n    ShowOnCalibrationHistory: (model.WorkOrderType as IWorkOrderTypeDto)\r\n      .ShowOnCalibrationHistory,\r\n    NotEditable: (model.WorkOrderType as IWorkOrderTypeDto).NotEditable,\r\n  } as IWorkOrderDetailsDto;\r\n\r\n  return entity;\r\n}\r\nexport const getAlertStart = (\r\n  remindBefore: number,\r\n  Start: Date | Timestamp,\r\n): Date | Timestamp | null => {\r\n  let alertStart: Date | null = new Date();\r\n  switch (remindBefore as RemindBefore) {\r\n    case RemindBefore.doNotNotify:\r\n      alertStart = null;\r\n      break;\r\n    case RemindBefore.oneday:\r\n      alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -1);\r\n      break;\r\n    case RemindBefore.twodays:\r\n      alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -2);\r\n      break;\r\n    case RemindBefore.threedays:\r\n      alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -3);\r\n      break;\r\n    case RemindBefore.oneweek:\r\n      alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -7);\r\n      break;\r\n    case RemindBefore.onemonth:\r\n      alertStart = dateUtils.addMonths(dateUtils.dateOrStringToDate(Start), -1);\r\n      break;\r\n    default:\r\n      alertStart = dateUtils.addDays(dateUtils.dateOrStringToDate(Start), -1);\r\n      break;\r\n  }\r\n  return alertStart;\r\n};\r\n\r\nexport const MaxDate: Date = dateUtils.set(new Date(), {\r\n  year: 9999,\r\n  month: 11,\r\n  date: 31,\r\n  hours: 0,\r\n  minutes: 0,\r\n  seconds: 0,\r\n});\r\n","import { IRow } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { SearchColumnType } from 'app/components/BasicTable/BasicTableProps';\r\nimport { isEmpty } from 'lodash';\r\nimport { SortingRule } from 'react-table';\r\nimport { Entity } from 'types/common';\r\nimport { getPredicates } from './getPredicates';\r\nimport { Condition, ODataFilterBuilder, ODataOperators } from './ODataFilter';\r\n\r\nexport const buildParams = <TRow extends IRow>(\r\n  state: {\r\n    pageSize: number;\r\n    pageIndex: number;\r\n    sortBy?: SortingRule<TRow>[] | null;\r\n    globalFilterValue?: string;\r\n    customFilter: IFilterSettings<TRow>[];\r\n    select: Array<keyof TRow>;\r\n    additionalColumns?: Array<keyof TRow>;\r\n    serviceGroups: Entity<number>[];\r\n    isOptionalServiceGroup: boolean;\r\n    expandedColumns?: Array<keyof TRow>;\r\n    predicates?: Array<Condition<TRow> | string>;\r\n  },\r\n  searchColumns?: Array<SearchColumnType<TRow>>,\r\n  customParams?: (fieldName: string, Id: number, fn: (p: {}) => void) => void,\r\n  isExport?: boolean,\r\n) => {\r\n  const params: {\r\n    $skip: number;\r\n    $top: number;\r\n    $count: boolean;\r\n    $select: string;\r\n    $orderby?: string;\r\n    $filter?: string;\r\n    $expand?: string;\r\n  } = {\r\n    $skip: state.pageIndex * state.pageSize,\r\n    $top: state.pageSize,\r\n    // adds inline count of all records\r\n    $count: true,\r\n    // definition of columns required\r\n    $select: isExport\r\n      ? state.select.join(',')\r\n      : [\r\n          ...new Set([...state.select, ...(state.additionalColumns ?? [])]),\r\n        ].join(','),\r\n  };\r\n  const expaneded = state.expandedColumns?.filter(\r\n    c => state.select.includes(c) || state.additionalColumns?.includes(c),\r\n  );\r\n\r\n  if (expaneded && expaneded.length > 0) {\r\n    params.$expand = expaneded.join(',');\r\n  }\r\n  const customparams = {};\r\n  function cp(p: {}) {\r\n    Object.assign(customparams, p);\r\n  }\r\n\r\n  params.$filter = new ODataFilterBuilder<TRow>({\r\n    predicates: [\r\n      ...(state.predicates ?? []),\r\n      ...getPredicates<TRow>(state.customFilter, customParams, cp),\r\n    ],\r\n    globalServiceGroupFilter:\r\n      state.serviceGroups === undefined || state.serviceGroups.length === 0\r\n        ? undefined\r\n        : state.additionalColumns?.find(f => f === 'ServiceGroupId') !==\r\n            undefined ||\r\n          state.select.find(f => f === 'ServiceGroupId') !== undefined\r\n        ? [\r\n            new Condition<TRow>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              state.serviceGroups,\r\n            ),\r\n          ]\r\n        : state.additionalColumns?.find(f => f === 'ServiceGroups') !==\r\n            undefined ||\r\n          state.select.find(f => f === 'ServiceGroups') !== undefined\r\n        ? state.isOptionalServiceGroup\r\n          ? [\r\n              new Condition<TRow>(\r\n                'ServiceGroups',\r\n                ODataOperators.HasNoAny,\r\n                state.serviceGroups,\r\n              ),\r\n              new Condition<TRow>(\r\n                'ServiceGroups',\r\n                ODataOperators.AnyIn,\r\n                state.serviceGroups,\r\n                'Id',\r\n              ),\r\n            ]\r\n          : [\r\n              new Condition<TRow>(\r\n                'ServiceGroups',\r\n                ODataOperators.AnyIn,\r\n                state.serviceGroups,\r\n                'Id',\r\n              ),\r\n            ]\r\n        : undefined,\r\n    stringColumns: searchColumns || [],\r\n    stringSearch: state.globalFilterValue,\r\n    isOptionalServiceGroup: state.isOptionalServiceGroup,\r\n  }).toString();\r\n\r\n  // sort parameter should be present only if sorting is defined\r\n  // empty $orderby is considered a bad request\r\n  if (!isEmpty(state?.sortBy)) {\r\n    params.$orderby = state.sortBy\r\n      ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n      .join(',');\r\n  }\r\n  Object.assign(params, customparams);\r\n  return params;\r\n};\r\n","import { Box, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\n\r\nexport interface BulletedListItem {\r\n  key: React.Key | null | undefined;\r\n  node: React.ReactNode;\r\n}\r\nexport interface BulletedListProps {\r\n  items: BulletedListItem[];\r\n  showBullet?: boolean;\r\n}\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      '&': {\r\n        listStyle: 'none',\r\n      },\r\n      '& li:before': {\r\n        content: \"'•'\",\r\n        color: theme.palette.primary.main,\r\n        fontWeight: 'bold',\r\n        display: 'inline-block',\r\n        width: '1em',\r\n        marginLeft: '-1em',\r\n      },\r\n    },\r\n  }),\r\n);\r\n\r\nconst bulletedStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    rows: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n      margin: 0,\r\n      gap: '8px',\r\n      flexGrow: 1,\r\n      overflowY: 'auto',\r\n      overflowX: 'clip',\r\n      '&::-webkit-scrollbar': {\r\n        width: '6px',\r\n      },\r\n      '&::-webkit-scrollbar-thumb': {\r\n        boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n        borderRadius: '6px',\r\n        backgroundColor: theme.palette.common.grayBorders,\r\n      },\r\n      height: 'auto', // isMobile ? '90px' : `${cardcurrentHeight - (84 + 64)}px`,\r\n      maxHeight: 200,\r\n    },\r\n    row: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: 0,\r\n      gap: 8,\r\n      height: 25,\r\n      // width: '100%',\r\n    },\r\n    rowOverRule: {\r\n      display: 'flex',\r\n      width: '100%',\r\n      whiteSpace: 'pre',\r\n      overflow: 'hidden',\r\n      textOverflow: 'ellipsis',\r\n      maxWidth: '23ch',\r\n    },\r\n  }),\r\n);\r\nexport const StyledList = ({\r\n  children,\r\n  className,\r\n  style,\r\n}: React.PropsWithChildren<{\r\n  className?: string;\r\n  style?: React.CSSProperties;\r\n}>) => {\r\n  const classes = useStyles();\r\n  return (\r\n    <ul\r\n      className={className ? clsx(classes.root, className) : classes.root}\r\n      style={style}\r\n    >\r\n      {children}\r\n    </ul>\r\n  );\r\n};\r\nexport const SimpleList = ({\r\n  children,\r\n  className,\r\n  style,\r\n}: React.PropsWithChildren<{\r\n  className?: string;\r\n  style?: React.CSSProperties;\r\n}>) => {\r\n  return (\r\n    <ul className={className} style={{ ...style, listStyle: 'none' }}>\r\n      {children}\r\n    </ul>\r\n  );\r\n};\r\nexport const BulletedList = (props: BulletedListProps) => {\r\n  const classes = bulletedStyles();\r\n  const { items, showBullet = true } = props;\r\n  return (\r\n    <SimpleList className={classes.rows}>\r\n      {items.map(c => {\r\n        return (\r\n          <li key={`list-key-${c.key}`} className={classes.row}>\r\n            {showBullet && (\r\n              <Icon icon=\"circle\" fontSize=\"6px\" color=\"primary\" />\r\n            )}\r\n            <Box component=\"span\" className={classes.rowOverRule}>\r\n              {c.node}\r\n            </Box>\r\n          </li>\r\n        );\r\n      })}\r\n    </SimpleList>\r\n  );\r\n};\r\n","import { cyan } from '@material-ui/core/colors';\r\n\r\ninterface InfoColors {\r\n  colorInfoFull: string;\r\n  colorInfoDark: string;\r\n  colorInfoHover: string;\r\n  colorInfoRegular: string;\r\n  colorInfoComponents: string;\r\n  colorInfoComponentsLight: string;\r\n  colorInfoBorders: string;\r\n  colorInfoDisabled: string;\r\n  colorInfoBgHover: string;\r\n  colorInfoBg: string;\r\n  colorInfoBgLight: string;\r\n}\r\nconst infoColors: InfoColors = {\r\n  colorInfoFull: cyan[900],\r\n  colorInfoDark: cyan[900],\r\n  colorInfoHover: cyan[800],\r\n  colorInfoRegular: cyan[700],\r\n  colorInfoComponents: cyan[600],\r\n  colorInfoComponentsLight: cyan[500],\r\n  colorInfoBorders: cyan[400],\r\n  colorInfoDisabled: cyan[300],\r\n  colorInfoBgHover: cyan[200],\r\n  colorInfoBg: cyan[100],\r\n  colorInfoBgLight: cyan[50],\r\n};\r\n\r\nexport default infoColors;\r\n","import { StyleRules } from '@material-ui/styles';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { buttonS } from 'styles/typography/bookitTypography';\r\n\r\nexport const MuiButtonOverride = {\r\n  root: {\r\n    ...buttonS,\r\n    textTransform: 'none',\r\n    display: 'inline-flex',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n    gap: '10px',\r\n    flexShrink: 1,\r\n    boxShadow: 'unset',\r\n    lineHeight: 'normal',\r\n    border: '1px solid transparent',\r\n    padding: '4px 16px',\r\n    minWidth: '40px',\r\n    height: '40px',\r\n    '&.variantMain': {\r\n      backgroundColor: bookitColors.primary.regular,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.hover,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.primary.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantText': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.primary.regular,\r\n      padding: '0px',\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.primary.hover,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantTextgray': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.grayscale.graySubtitles,\r\n      padding: '0px',\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.blackComponents,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantGray': {\r\n      backgroundColor: bookitColors.grayscale.graybgComponents,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.regular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantAccent': {\r\n      backgroundColor: bookitColors.grayscale.graySubtitles,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.grayscale.blackRegular,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantDanger': {\r\n      backgroundColor: bookitColors.danger.regular,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.danger.hover,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.danger.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantWhite': {\r\n      backgroundColor: bookitColors.base.white,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n        border: '1px solid transparent',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n        border: '1px solid transparent',\r\n      },\r\n    },\r\n    '&.variantGhostcolor': {\r\n      backgroundColor: 'unset',\r\n      color: bookitColors.primary.regular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'unset',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantGhost': {\r\n      backgroundColor: 'unset',\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'unset',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '& .buttonLabel': {\r\n      height: '18px',\r\n      whiteSpace: 'nowrap',\r\n    },\r\n  },\r\n  contained: {\r\n    borderRadius: '8px',\r\n    boxShadow: 'none',\r\n    color: bookitColors.grayscale.blackRegular,\r\n    padding: '4px 16px',\r\n    minWidth: '40px',\r\n    height: '40px',\r\n    '&.hasStartIcon.hasEndIcon': {\r\n      padding: '4px 12px',\r\n    },\r\n    '&.hasStartIcon': {\r\n      padding: '4px 16px 4px 12px',\r\n    },\r\n    '&.hasEndIcon': {\r\n      padding: '4px 12px 4px 16px',\r\n    },\r\n    '&:hover': {\r\n      backgroundColor: 'initial',\r\n      boxShadow: 'unset',\r\n      '@media (hover: none)': {\r\n        boxShadow: 'unset',\r\n        backgroundColor: 'initial',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'initial',\r\n      },\r\n    },\r\n    '&$focusVisible': {\r\n      boxShadow: 'unset',\r\n    },\r\n    '&:active': {\r\n      boxShadow: 'unset',\r\n    },\r\n    '&$disabled': {\r\n      boxShadow: 'unset',\r\n      // color: theme.palette.action.disabled,\r\n      // boxShadow: theme.shadows[0],\r\n      // backgroundColor: theme.palette.action.disabledBackground\r\n    },\r\n    '&.variantMain': {\r\n      backgroundColor: bookitColors.primary.regular,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.hover,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.primary.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantText': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.primary.regular,\r\n      padding: '0px',\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.primary.hover,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantTextgray': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.grayscale.graySubtitles,\r\n      padding: '0px',\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.blackComponents,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantGray': {\r\n      backgroundColor: bookitColors.grayscale.graybgComponents,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.regular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantAccent': {\r\n      backgroundColor: bookitColors.grayscale.graySubtitles,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.grayscale.blackRegular,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantDanger': {\r\n      backgroundColor: bookitColors.danger.regular,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.danger.hover,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.danger.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantWhite': {\r\n      backgroundColor: bookitColors.base.white,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n        border: '1px solid transparent',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n        border: '1px solid transparent',\r\n      },\r\n    },\r\n    '&.variantGhostcolor': {\r\n      backgroundColor: 'unset',\r\n      color: bookitColors.primary.regular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'unset',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantGhost': {\r\n      backgroundColor: 'unset',\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'unset',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n  },\r\n  containedSizeSmall: {\r\n    borderRadius: '6px',\r\n    padding: '4px 12px',\r\n    minWidth: '32px',\r\n    height: '32px',\r\n    '&.hasStartIcon.hasEndIcon': {\r\n      padding: '4px 8px',\r\n    },\r\n    '&.hasStartIcon': {\r\n      padding: '4px 12px 4px 8px',\r\n    },\r\n    '&.hasEndIcon': {\r\n      padding: '4px 8px 4px 12px',\r\n    },\r\n  },\r\n  containedSizeLarge: {\r\n    minWidth: '48px',\r\n    height: '48px',\r\n    borderRadius: '8px',\r\n    padding: '4px 20px',\r\n    '&.hasStartIcon.hasEndIcon': {\r\n      padding: '4px 16px',\r\n    },\r\n    '&.hasStartIcon': {\r\n      padding: '4px 20px 4px 16px',\r\n    },\r\n    '&.hasEndIcon': {\r\n      padding: '4px 16px 4px 20px',\r\n    },\r\n  },\r\n  label: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: '0px',\r\n    margin: 0,\r\n    gap: '8px',\r\n  },\r\n  startIcon: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'flex-start',\r\n    padding: '0px',\r\n    flex: 'none',\r\n    order: 0,\r\n    flexGrow: 0,\r\n    margin: 0,\r\n    marginLeft: 0,\r\n    marginRight: 0,\r\n    '&$iconSizeSmall': {\r\n      marginLeft: 0,\r\n    },\r\n  },\r\n  endIcon: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'flex-start',\r\n    padding: '0px',\r\n    flex: 'none',\r\n    order: 2,\r\n    flexGrow: 0,\r\n    margin: 0,\r\n    marginLeft: 0,\r\n    marginRight: 0,\r\n    '&$iconSizeSmall': {\r\n      marginRight: 0,\r\n    },\r\n  },\r\n  text: {\r\n    padding: '0px',\r\n    height: '20px',\r\n  },\r\n  textSizeSmall: {\r\n    fontSize: '14px',\r\n    height: '17px',\r\n  },\r\n  textSizeLarge: {\r\n    fontSize: '14px',\r\n    height: '23px',\r\n  },\r\n  sizeSmall: {},\r\n  sizeLarge: {\r\n    '&>[class*=\"MuiButton-label\"]': {\r\n      gap: '12px',\r\n    },\r\n  },\r\n  iconSizeMedium: {\r\n    fontSize: '16px',\r\n    '&>:first-child': {\r\n      fontSize: '16px',\r\n      width: '16px',\r\n      height: '16px',\r\n    },\r\n  },\r\n  iconSizeLarge: {\r\n    fontSize: '14px',\r\n    '&>:first-child': {\r\n      fontSize: '14px',\r\n      width: '14px',\r\n      height: '14px',\r\n    },\r\n  },\r\n  iconSizeSmall: {\r\n    fontSize: '14px',\r\n    '&>:first-child': {\r\n      fontSize: '14px',\r\n      width: '14px',\r\n      height: '14px',\r\n    },\r\n  },\r\n} as Partial<StyleRules>;\r\nexport const MuiIconButtonOverride = {\r\n  root: {\r\n    display: 'inline-flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n    gap: '10px',\r\n    padding: '0px',\r\n    border: '1px solid transparent',\r\n    '&.variantMain': {\r\n      backgroundColor: bookitColors.primary.regular,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.hover,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.primary.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantText': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.primary.regular,\r\n      padding: '0px',\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.primary.hover,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantTextgray': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.grayscale.graySubtitles,\r\n      padding: '0px',\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.blackComponents,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantGray': {\r\n      backgroundColor: bookitColors.grayscale.graybgComponents,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.regular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantAccent': {\r\n      backgroundColor: bookitColors.grayscale.graySubtitles,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.grayscale.blackRegular,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantDanger': {\r\n      backgroundColor: bookitColors.danger.regular,\r\n      color: bookitColors.base.white,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.danger.hover,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.danger.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantWhite': {\r\n      backgroundColor: bookitColors.base.white,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n        border: '1px solid transparent',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n        border: '1px solid transparent',\r\n      },\r\n    },\r\n    '&.variantGhostcolor': {\r\n      backgroundColor: 'unset',\r\n      color: bookitColors.primary.regular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'unset',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantGhost': {\r\n      backgroundColor: 'unset',\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&:hover, &:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'unset',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.iconSizeLarge': {\r\n      width: '48px',\r\n      height: '48px',\r\n      fontSize: '16px',\r\n      '&.shapeSquare': {\r\n        borderRadius: '8px',\r\n      },\r\n    },\r\n    '&.iconSizeMedium': {\r\n      width: '40px',\r\n      height: '40px',\r\n      fontSize: '16px',\r\n      '&.shapeSquare': {\r\n        borderRadius: '8px',\r\n      },\r\n    },\r\n    '&.iconSizeSmall': {\r\n      width: '32px',\r\n      height: '32px',\r\n      fontSize: '14px',\r\n      '&.shapeSquare': {\r\n        borderRadius: '6px',\r\n      },\r\n    },\r\n    '&.iconSizeXs': {\r\n      width: '24px',\r\n      height: '24px',\r\n      fontSize: '14px',\r\n      padding: '4px 11px 4px 11px',\r\n      '&.shapeSquare': {\r\n        borderRadius: '4px',\r\n      },\r\n    },\r\n    '&.shapeCircle': {\r\n      borderRadius: '50%',\r\n    },\r\n  },\r\n  label: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: '12px',\r\n    cursor: 'pointer',\r\n  },\r\n} as Partial<StyleRules>;\r\nexport const MuiToggleButtonGroupOverride = {\r\n  root: {\r\n    display: 'inline-flex',\r\n    alignItems: 'flex-start',\r\n    padding: '0px',\r\n    gap: '0px',\r\n    backgroundColor: 'transparent',\r\n    '&.variantMain': {\r\n      backgroundColor: bookitColors.primary.bgHover,\r\n    },\r\n    '&.variantText': {\r\n      padding: '0px',\r\n    },\r\n    '&.variantTextgray': {\r\n      padding: '0px',\r\n    },\r\n    '&.variantGray': {\r\n      backgroundColor: bookitColors.primary.bgLight,\r\n    },\r\n    '&.variantAccent': {\r\n      backgroundColor: bookitColors.grayscale.graybgComponents,\r\n    },\r\n    '&.variantDanger': {\r\n      backgroundColor: bookitColors.danger.background,\r\n    },\r\n    '&.variantWhite': {\r\n      backgroundColor: bookitColors.base.white,\r\n      border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n    },\r\n    '&.separated': {\r\n      gap: '8px',\r\n    },\r\n    '&.variantGhostcolor': {\r\n      '&.separated': {\r\n        padding: '0px',\r\n      },\r\n    },\r\n    '&.variantGhost': {\r\n      '&.separated': {\r\n        padding: '0px',\r\n      },\r\n    },\r\n    '&.sizeLarge': {\r\n      borderRadius: '12px',\r\n      '&.separated': {\r\n        padding: '4px',\r\n        gap: '4px',\r\n      },\r\n    },\r\n    '&.sizeMedium': {\r\n      borderRadius: '10px',\r\n      '&.separated': {\r\n        padding: '3px',\r\n        gap: '3px',\r\n      },\r\n    },\r\n    '&.sizeSmall': {\r\n      borderRadius: '8px',\r\n      '&.separated': {\r\n        padding: '1px',\r\n        gap: '1px',\r\n      },\r\n    },\r\n    '&.errorBorder': {\r\n      borderColor: bookitColors.danger.regular,\r\n    },\r\n    '&.fullWidth': {\r\n      width: '100%',\r\n    },\r\n  },\r\n  grouped: {\r\n    '&.fullWidthButton': {\r\n      flex: '1',\r\n    },\r\n  },\r\n  /* Styles applied to the children if `orientation=\"horizontal\"`. */\r\n  groupedHorizontal: {\r\n    '&:not(:first-child)': {\r\n      marginLeft: '0px', //props => (props.variant === 'white' ? 0 : -1),\r\n      borderLeft: '1px solid transparent',\r\n      borderTopLeftRadius: 0,\r\n      borderBottomLeftRadius: 0,\r\n      '&.separated': {\r\n        '&.sizeLarge': {\r\n          borderTopLeftRadius: 8,\r\n          borderBottomLeftRadius: 8,\r\n        },\r\n        '&.sizeMedium': {\r\n          borderTopLeftRadius: 8,\r\n          borderBottomLeftRadius: 8,\r\n        },\r\n        '&.sizeSmall': {\r\n          borderTopLeftRadius: 6,\r\n          borderBottomLeftRadius: 6,\r\n        },\r\n      },\r\n    },\r\n    '&:not(:last-child)': {\r\n      borderTopRightRadius: 0,\r\n      borderBottomRightRadius: 0,\r\n      '&.separated': {\r\n        '&.sizeLarge': {\r\n          borderTopRightRadius: 8,\r\n          borderBottomRightRadius: 8,\r\n        },\r\n        '&.sizeMedium': {\r\n          borderTopRightRadius: 8,\r\n          borderBottomRightRadius: 8,\r\n        },\r\n        '&.sizeSmall': {\r\n          borderTopRightRadius: 6,\r\n          borderBottomRightRadius: 6,\r\n        },\r\n      },\r\n    },\r\n    '&>[class*=\"withTitle\"]:not(:first-child)': {\r\n      '&>button': {\r\n        marginLeft: '0px', // props => (props.variant === 'white' ? 0 : -1),\r\n        borderLeft: '1px solid transparent',\r\n        borderTopLeftRadius: 0,\r\n        borderBottomLeftRadius: 0,\r\n        '&.separated': {\r\n          '&.sizeLarge': {\r\n            borderTopLeftRadius: 8,\r\n            borderBottomLeftRadius: 8,\r\n          },\r\n          '&.sizeMedium': {\r\n            borderTopLeftRadius: 8,\r\n            borderBottomLeftRadius: 8,\r\n          },\r\n          '&.sizeSmall': {\r\n            borderTopLeftRadius: 6,\r\n            borderBottomLeftRadius: 6,\r\n          },\r\n        },\r\n      },\r\n    },\r\n    '&>[class*=\"withTitle\"]:not(:last-child)': {\r\n      '&>button': {\r\n        borderTopRightRadius: 0,\r\n        borderBottomRightRadius: 0,\r\n        '&.separated': {\r\n          '&.sizeLarge': {\r\n            borderTopRightRadius: 8,\r\n            borderBottomRightRadius: 8,\r\n          },\r\n          '&.sizeMedium': {\r\n            borderTopRightRadius: 8,\r\n            borderBottomRightRadius: 8,\r\n          },\r\n          '&.sizeSmall': {\r\n            borderTopRightRadius: 6,\r\n            borderBottomRightRadius: 6,\r\n          },\r\n        },\r\n      },\r\n    },\r\n  },\r\n  /* Styles applied to the children if `orientation=\"vertical\"`. */\r\n  groupedVertical: {\r\n    '&:not(:first-child)': {\r\n      marginTop: -1,\r\n      borderTop: '1px solid transparent',\r\n      borderTopLeftRadius: 0,\r\n      borderTopRightRadius: 0,\r\n      '&.separated': {\r\n        '&.sizeLarge': {\r\n          borderTopLeftRadius: 8,\r\n          borderTopRightRadius: 8,\r\n        },\r\n        '&.sizeMedium': {\r\n          borderTopLeftRadius: 8,\r\n          borderTopRightRadius: 8,\r\n        },\r\n        '&.sizeSmall': {\r\n          borderTopLeftRadius: 6,\r\n          borderTopRightRadius: 6,\r\n        },\r\n      },\r\n    },\r\n    '&:not(:last-child)': {\r\n      borderBottomLeftRadius: 0,\r\n      borderBottomRightRadius: 0,\r\n      '&.separated': {\r\n        '&.sizeLarge': {\r\n          borderBottomLeftRadius: 8,\r\n          borderBottomRightRadius: 8,\r\n        },\r\n        '&.sizeMedium': {\r\n          borderBottomLeftRadius: 8,\r\n          borderBottomRightRadius: 8,\r\n        },\r\n        '&.sizeSmall': {\r\n          borderBottomLeftRadius: 6,\r\n          borderBottomRightRadius: 6,\r\n        },\r\n      },\r\n    },\r\n    '&>[class*=\"withTitle\"]:not(:first-child)': {\r\n      '&>button': {\r\n        marginTop: -1,\r\n        borderTop: '1px solid transparent',\r\n        borderTopLeftRadius: 0,\r\n        borderTopRightRadius: 0,\r\n        '&.separated': {\r\n          '&.sizeLarge': {\r\n            borderTopLeftRadius: 8,\r\n            borderTopRightRadius: 8,\r\n          },\r\n          '&.sizeMedium': {\r\n            borderTopLeftRadius: 8,\r\n            borderTopRightRadius: 8,\r\n          },\r\n          '&.sizeSmall': {\r\n            borderTopLeftRadius: 6,\r\n            borderTopRightRadius: 6,\r\n          },\r\n        },\r\n      },\r\n    },\r\n    '&>[class*=\"withTitle\"]:not(:last-child)': {\r\n      '&>button': {\r\n        borderBottomLeftRadius: 0,\r\n        borderBottomRightRadius: 0,\r\n        '&.separated': {\r\n          '&.sizeLarge': {\r\n            borderBottomLeftRadius: 8,\r\n            borderBottomRightRadius: 8,\r\n          },\r\n          '&.sizeMedium': {\r\n            borderBottomLeftRadius: 8,\r\n            borderBottomRightRadius: 8,\r\n          },\r\n          '&.sizeSmall': {\r\n            borderBottomLeftRadius: 6,\r\n            borderBottomRightRadius: 6,\r\n          },\r\n        },\r\n      },\r\n    },\r\n  },\r\n} as Partial<StyleRules>;\r\nexport const MuiToggleButtonOverride = {\r\n  root: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n    gap: '10px',\r\n    textTransform: 'none',\r\n    boxShadow: 'unset',\r\n    boxSizing: 'border-box',\r\n    border: '1px solid transparent',\r\n    borderRadius: '8px',\r\n    minWidth: '40px',\r\n    height: '40px',\r\n    ...buttonS,\r\n    padding: '4px 16px',\r\n    '&.hasMainIcon': {\r\n      padding: '4px 10px',\r\n    },\r\n    '&.hasStartIcon.hasEndIcon': {\r\n      padding: '4px 12px',\r\n    },\r\n    '&.hasStartIcon': {\r\n      padding: '4px 16px 4px 12px',\r\n    },\r\n    '&.hasEndIcon': {\r\n      padding: '4px 12px 4px 16px',\r\n    },\r\n    '&.fullWidth': {\r\n      width: '100%',\r\n    },\r\n    '&.variantMain': {\r\n      backgroundColor: bookitColors.primary.bgHover,\r\n      color: bookitColors.primary.hover,\r\n      '&$selected': {\r\n        color: bookitColors.base.white,\r\n        backgroundColor: bookitColors.primary.regular,\r\n        border: `1px solid ${bookitColors.primary.borders}`,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.primary.hover,\r\n          border: '1px solid transparent',\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.primary.regular,\r\n        color: bookitColors.base.white,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.regular,\r\n        color: bookitColors.base.white,\r\n        border: `1px solid ${bookitColors.primary.borders}`,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.primary.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantText': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.primary.regular,\r\n      padding: '0px',\r\n      '&$selected': {\r\n        color: bookitColors.primary.hover,\r\n        backgroundColor: 'transparent',\r\n        textDecoration: 'underline',\r\n        '&:hover': {\r\n          backgroundColor: 'transparent',\r\n          color: bookitColors.primary.hover,\r\n          textDecoration: 'underline',\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.primary.hover,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.primary.hover,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantTextgray': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.grayscale.graySubtitles,\r\n      padding: '0px',\r\n      '&$selected': {\r\n        color: bookitColors.grayscale.blackComponents,\r\n        backgroundColor: 'transparent',\r\n        textDecoration: 'underline',\r\n        '&:hover': {\r\n          backgroundColor: 'transparent',\r\n          color: bookitColors.grayscale.blackComponents,\r\n          textDecoration: 'underline',\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.blackComponents,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.blackComponents,\r\n        textDecoration: 'underline',\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayComponentsLight,\r\n      },\r\n    },\r\n    '&.variantGray': {\r\n      backgroundColor: bookitColors.primary.bgLight,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&$selected': {\r\n        color: bookitColors.primary.regular,\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.grayscale.graySelection,\r\n          color: bookitColors.primary.regular,\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        color: bookitColors.primary.regular,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        color: bookitColors.primary.regular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantAccent': {\r\n      backgroundColor: bookitColors.grayscale.graybgComponents,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&$selected': {\r\n        color: bookitColors.base.white,\r\n        backgroundColor: bookitColors.grayscale.graySubtitles,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.grayscale.blackRegular,\r\n          color: bookitColors.base.white,\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantDanger': {\r\n      backgroundColor: bookitColors.danger.background,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&$selected': {\r\n        color: bookitColors.base.white,\r\n        backgroundColor: bookitColors.danger.regular,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.danger.hover,\r\n          color: bookitColors.base.white,\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.danger.background,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.danger.background,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.danger.disabled,\r\n        color: bookitColors.base.white,\r\n      },\r\n    },\r\n    '&.variantWhite': {\r\n      backgroundColor: bookitColors.base.white,\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&$selected': {\r\n        color: bookitColors.grayscale.blackRegular,\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.grayscale.graySelection,\r\n          color: bookitColors.grayscale.blackRegular,\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.grayscale.graybgComponents,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: bookitColors.grayscale.grayBackground,\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantGhostcolor': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.primary.regular,\r\n      '&$selected': {\r\n        color: bookitColors.primary.hover,\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.primary.bgHover,\r\n          color: bookitColors.primary.hover,\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n    '&.variantGhost': {\r\n      backgroundColor: 'transparent',\r\n      color: bookitColors.grayscale.blackRegular,\r\n      '&$selected': {\r\n        color: bookitColors.primary.hover,\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.primary.bgHover,\r\n          color: bookitColors.primary.hover,\r\n        },\r\n        '& + &': {\r\n          borderLeft: 0,\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      '&:hover': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&:active, &:focus': {\r\n        backgroundColor: bookitColors.primary.bgHover,\r\n        color: bookitColors.primary.hover,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: 'transparent',\r\n        color: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n  },\r\n  sizeLarge: {\r\n    padding: '4px 20px',\r\n    borderRadius: '8px',\r\n    minWidth: '48px',\r\n    height: '48px',\r\n    '&.hasMainIcon': {\r\n      padding: '4px 14px',\r\n    },\r\n    '&.hasStartIcon.hasEndIcon': {\r\n      padding: '4px 16px',\r\n    },\r\n    '&.hasStartIcon': {\r\n      padding: '4px 20px 4px 16px',\r\n    },\r\n    '&.hasEndIcon': {\r\n      padding: '4px 16px 4px 20px',\r\n    },\r\n    '&>$label': {\r\n      gap: '12px',\r\n    },\r\n  },\r\n  sizeSmall: {\r\n    padding: '4px 12px',\r\n    borderRadius: '8px',\r\n    minWidth: '32px',\r\n    height: '32px',\r\n    '&.separated': {\r\n      borderRadius: '6px',\r\n    },\r\n    '&.hasMainIcon': {\r\n      padding: '4px 8px',\r\n    },\r\n    '&.hasStartIcon.hasEndIcon': {\r\n      padding: '4px 8px',\r\n    },\r\n    '&.hasStartIcon': {\r\n      padding: '4px 12px 4px 8px',\r\n    },\r\n    '&.hasEndIcon': {\r\n      padding: '4px 8px 4px 12px',\r\n    },\r\n  },\r\n  label: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: '0px',\r\n    margin: 0,\r\n    gap: '8px',\r\n    '& .startIcon': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n      flex: 'none',\r\n      order: 0,\r\n      flexGrow: 0,\r\n      margin: 0,\r\n    },\r\n    '& .endIcon': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n      flex: 'none',\r\n      order: 2,\r\n      flexGrow: 0,\r\n      margin: 0,\r\n    },\r\n    '& .mainIcon': {\r\n      display: 'flex',\r\n      alignItems: 'flex-start',\r\n      gap: '10px',\r\n    },\r\n    '& .buttonLabel': {\r\n      height: '18px',\r\n      whiteSpace: 'nowrap',\r\n    },\r\n    '& .iconSizeSmall': {\r\n      fontSize: '14px',\r\n      '&>:first-child': {\r\n        fontSize: '14px',\r\n        width: '14px',\r\n        height: '14px',\r\n      },\r\n    },\r\n    '& .iconSizeMedium': {\r\n      fontSize: '16px',\r\n      '&>:first-child': {\r\n        fontSize: '16px',\r\n        width: '16px',\r\n        height: '16px',\r\n      },\r\n    },\r\n    '& .iconSizeLarge': {\r\n      fontSize: '16px',\r\n      '&>:first-child': {\r\n        fontSize: '16px',\r\n        width: '16px',\r\n        height: '16px',\r\n      },\r\n    },\r\n  },\r\n} as Partial<StyleRules>;\r\n","import { fade, ThemeOptions } from '@material-ui/core';\r\nimport createBreakpoints from '@material-ui/core/styles/createBreakpoints';\r\nimport { unstable_createMuiStrictModeTheme as createMuiTheme } from '@material-ui/core';\r\n// import convertLength from 'convert-css-length';\r\nimport { grey, green } from '@material-ui/core/colors';\r\nimport { bookitColors } from './colors/bookitColors';\r\nimport infoColors from './colors/info';\r\nimport {\r\n  bodyS,\r\n  boldS,\r\n  bookitTypography,\r\n  buttonM,\r\n  inputLabelXS,\r\n  inputValueS,\r\n  tipsRegular,\r\n} from './typography/bookitTypography';\r\nimport {\r\n  MuiButtonOverride,\r\n  MuiIconButtonOverride,\r\n  MuiToggleButtonGroupOverride,\r\n  MuiToggleButtonOverride,\r\n} from './MUIExtend/themeOverrides';\r\nimport transitions from '@material-ui/core/styles/transitions';\r\nimport {\r\n  COVER_WIDTH,\r\n  //DRAWER_MOBILE_WIDTH,\r\n  DRAWER_WIDTH,\r\n} from './constantVariables';\r\nimport { box_shadow_m, box_shadow_s } from './shadows/bookitShadow';\r\n\r\nconst breakpoints = createBreakpoints({});\r\n// xs: 0,\r\n// sm: 600,\r\n// md: 960,\r\n// lg: 1280,\r\n// xl: 1920\r\nconst lato_Light = {\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontStyle: 'normal',\r\n  fontWeight: 300,\r\n  src: `\r\n    local(''),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff') format('woff'),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff2') format('woff2'),\r\n  `,\r\n};\r\nconst lato_Regular = {\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontStyle: 'normal',\r\n  fontWeight: 400,\r\n  src: `\r\n    local(''),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff') format('woff'),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff2') format('woff2'),\r\n  `,\r\n};\r\nconst lato_Bold = {\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontStyle: 'normal',\r\n  fontWeight: 700,\r\n  src: `\r\n    local(''),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff') format('woff'),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff2') format('woff2'),\r\n  `,\r\n};\r\nconst lato_Black = {\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontStyle: 'normal',\r\n  fontWeight: 900,\r\n  src: `\r\n    local(''),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff') format('woff'),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff2') format('woff2'),\r\n  `,\r\n};\r\nconst lato = {\r\n  fontFamily: `'Lato', sans-serif`,\r\n  fontStyle: 'normal',\r\n  fontWeight: 400,\r\n  src: `\r\n    local(''),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff') format('woff'),\r\n    url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff2') format('woff2'),\r\n  `,\r\n  unicodeRange:\r\n    'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF',\r\n};\r\n//const convert = convertLength('16px');\r\nexport type BaseTheme = 'default' | 'animals' | 'bookit' | 'dark' | undefined;\r\n// customizes the mui theme defaults/overrides\r\n// colors: https://material-ui.com/customization/color/#color\r\nexport const DefaultThemeSettings: ThemeOptions = {\r\n  typography: {\r\n    fontFamily: `'Lato', sans-serif`,\r\n  },\r\n  overrides: {\r\n    MuiCssBaseline: {\r\n      '@global': {\r\n        '@font-face': [lato],\r\n      },\r\n    },\r\n  },\r\n};\r\n\r\nexport const BookitThemeSettings: ThemeOptions = {\r\n  zIndex: {\r\n    mobileStepper: 1000,\r\n    speedDial: 1050,\r\n    appBar: 1100,\r\n    drawer: 1200,\r\n    modal: 1300,\r\n    snackbar: 1400,\r\n    tooltip: 1500,\r\n  },\r\n  palette: {\r\n    primary: {\r\n      dark: bookitColors.primary.dark,\r\n      main: bookitColors.primary.regular,\r\n      light: bookitColors.primary.background,\r\n      textHover: bookitColors.primary.hover,\r\n      bgHover: bookitColors.primary.bgHover,\r\n      contrastText: bookitColors.base.white,\r\n    },\r\n\r\n    secondary: {\r\n      dark: '#BFA44A',\r\n      main: '#FFDB63',\r\n      light: '#F4ECCE',\r\n      textHover: '#E0BC40',\r\n      bgHover: '#FFEBA9',\r\n      contrastText: '#000',\r\n    },\r\n    info: {\r\n      dark: infoColors.colorInfoDark,\r\n      main: infoColors.colorInfoRegular,\r\n      light: infoColors.colorInfoBg,\r\n      textHover: infoColors.colorInfoBgHover,\r\n      bgHover: infoColors.colorInfoHover,\r\n      contrastText: bookitColors.base.white,\r\n    },\r\n    accent: {\r\n      dark: bookitColors.secondary.violet.dark,\r\n      main: bookitColors.secondary.violet.regular,\r\n      light: bookitColors.secondary.violet.background,\r\n      bgHover: bookitColors.secondary.violet.bgHover,\r\n      textHover: bookitColors.secondary.violet.hover,\r\n      contrastText: bookitColors.base.white,\r\n    },\r\n    danger: {\r\n      dark: bookitColors.danger.dark,\r\n      main: bookitColors.danger.regular,\r\n      light: bookitColors.danger.background,\r\n      textHover: bookitColors.danger.hover,\r\n      bgHover: bookitColors.danger.bgHover,\r\n      contrastText: bookitColors.base.white,\r\n    },\r\n    success: {\r\n      dark: bookitColors.success.dark,\r\n      main: bookitColors.success.regular,\r\n      light: bookitColors.success.background,\r\n      textHover: bookitColors.success.hover,\r\n      bgHover: bookitColors.success.bgHover,\r\n      contrastText: bookitColors.base.white,\r\n    },\r\n    error: {\r\n      dark: bookitColors.danger.dark,\r\n      main: bookitColors.danger.regular,\r\n      light: bookitColors.danger.background,\r\n      bgHover: bookitColors.danger.bgHover,\r\n      textHover: bookitColors.danger.hover,\r\n      contrastText: bookitColors.base.white,\r\n    },\r\n    default: {\r\n      dark: bookitColors.grayscale.blackComponents,\r\n      main: bookitColors.grayscale.graybgComponents,\r\n      light: bookitColors.grayscale.grayBackground,\r\n      bgHover: bookitColors.base.white,\r\n      textHover: bookitColors.grayscale.graySubtitles,\r\n      contrastText: bookitColors.base.black,\r\n    },\r\n    filters: {\r\n      dark: bookitColors.primary.dark,\r\n      main: bookitColors.grayscale.graySelection,\r\n      textHover: bookitColors.primary.dark,\r\n      bgHover: bookitColors.primary.bgHover,\r\n      light: bookitColors.grayscale.grayComponents,\r\n      contrastText: bookitColors.grayscale.blackRegular,\r\n    },\r\n    common: {\r\n      black: bookitColors.base.black,\r\n      blackRegular: bookitColors.grayscale.blackRegular,\r\n      blackComponent: bookitColors.grayscale.blackComponents,\r\n      graySubtitle: bookitColors.grayscale.graySubtitles,\r\n      grayComponents: bookitColors.grayscale.grayComponents,\r\n      grayComponentsLight: bookitColors.grayscale.grayComponentsLight,\r\n      background: bookitColors.grayscale.grayBackground,\r\n      backgroundHover: bookitColors.grayscale.graybgComponents,\r\n      grayBorders: bookitColors.grayscale.grayBorders,\r\n      grayDividers: bookitColors.grayscale.graySelection,\r\n      white: bookitColors.base.white,\r\n    },\r\n    background: {\r\n      default: bookitColors.grayscale.grayBackground,\r\n      paper: bookitColors.base.white,\r\n    },\r\n  },\r\n  shape: {\r\n    borderRadius: 8,\r\n  },\r\n  typography: {\r\n    fontFamily: ['Lato', 'sans-serif'].join(','),\r\n    h1: bookitTypography.h1,\r\n    h2: bookitTypography.h2,\r\n    h3: bookitTypography.h3,\r\n    h4: bookitTypography.h4,\r\n    bodyL: bookitTypography.bodyL,\r\n    bodyM: bookitTypography.bodyM,\r\n    bodyS: bookitTypography.bodyS,\r\n    boldL: bookitTypography.boldL,\r\n    boldM: bookitTypography.boldM,\r\n    boldS: bookitTypography.boldS,\r\n    buttonM: bookitTypography.buttonM,\r\n    buttonS: bookitTypography.buttonS,\r\n    captionRegular: bookitTypography.captionRegular,\r\n    captionBold: bookitTypography.captionBold,\r\n\r\n    subtitle1: bookitTypography.subtitle1,\r\n    subtitle2: bookitTypography.subtitle2,\r\n    tipsRegular: bookitTypography.tipsRegular,\r\n    tipsBold: bookitTypography.tipsBold,\r\n    inputLabelM: bookitTypography.inputLabelM,\r\n    inputLabelXS: bookitTypography.inputLabelXS,\r\n    inputValueM: bookitTypography.inputValueM,\r\n    inputValueS: bookitTypography.inputValueS,\r\n    uppercase: bookitTypography.uppercase,\r\n  },\r\n  overrides: {\r\n    MuiTypography: {\r\n      root: {\r\n        '&.variantH1': {\r\n          ...bookitTypography.h1,\r\n        },\r\n        '&.variantH2': {\r\n          ...bookitTypography.h2,\r\n        },\r\n        '&.variantH3': {\r\n          ...bookitTypography.h3,\r\n        },\r\n        '&.variantH4': {\r\n          ...bookitTypography.h4,\r\n        },\r\n        '&.variantSubtitle1': {\r\n          ...bookitTypography.subtitle1,\r\n        },\r\n        '&.variantSubtitle2': {\r\n          ...bookitTypography.subtitle2,\r\n        },\r\n        '&.variantBodyl': {\r\n          ...bookitTypography.bodyL,\r\n        },\r\n        '&.variantBodym': {\r\n          ...bookitTypography.bodyM,\r\n        },\r\n        '&.variantBodys': {\r\n          ...bookitTypography.bodyS,\r\n        },\r\n        '&.variantBoldl': {\r\n          ...bookitTypography.boldL,\r\n        },\r\n        '&.variantBoldm': {\r\n          ...bookitTypography.boldM,\r\n        },\r\n        '&.variantBolds': {\r\n          ...bookitTypography.boldS,\r\n        },\r\n        '&.variantCaptionbold': {\r\n          ...bookitTypography.captionBold,\r\n        },\r\n        '&.variantCaptionregular': {\r\n          ...bookitTypography.captionRegular,\r\n        },\r\n        '&.variantUppercase': {\r\n          ...bookitTypography.uppercase,\r\n        },\r\n        '&.variantTipsbold': {\r\n          ...bookitTypography.tipsBold,\r\n        },\r\n        '&.variantTipsregular': {\r\n          ...bookitTypography.tipsRegular,\r\n        },\r\n        '&.variantInputlabelm': {\r\n          ...bookitTypography.inputLabelM,\r\n        },\r\n        '&.variantInputlabelxs': {\r\n          ...bookitTypography.inputLabelXS,\r\n        },\r\n        '&.variantInputvaluem': {\r\n          ...bookitTypography.inputValueM,\r\n        },\r\n        '&.variantInputvalues': {\r\n          ...bookitTypography.inputValueS,\r\n        },\r\n        '&.variantButtonm': {\r\n          ...bookitTypography.buttonM,\r\n        },\r\n        '&.variantButtons': {\r\n          ...bookitTypography.buttonS,\r\n        },\r\n        '&.italic': {\r\n          fontStyle: 'italic',\r\n        },\r\n      },\r\n      colorError: {\r\n        color: bookitColors.danger.components,\r\n      },\r\n      colorPrimary: {\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      colorSecondary: { color: bookitColors.grayscale.grayComponents },\r\n      colorTextPrimary: { color: bookitColors.primary.regular },\r\n      colorTextSecondary: { color: bookitColors.success.regular },\r\n    },\r\n    MuiAppBar: {\r\n      colorDefault: { backgroundColor: bookitColors.grayscale.grayBackground },\r\n    },\r\n    MuiLink: {\r\n      root: {\r\n        color: bookitColors.primary.regular,\r\n        '&:hover': {\r\n          textDecoration: 'underline',\r\n        },\r\n        '&:focus': {\r\n          textDecoration: 'underline',\r\n        },\r\n      },\r\n    },\r\n    MuiCssBaseline: {\r\n      '@global': {\r\n        '@font-face': [lato_Light, lato_Regular, lato_Bold, lato_Black],\r\n        ':root': {\r\n          '--drawer-width': 240,\r\n        },\r\n      },\r\n    },\r\n    MuiSelect: {\r\n      select: {\r\n        '&:focus': {\r\n          backgroundColor: 'transparent',\r\n        },\r\n      },\r\n    },\r\n    MuiInputBase: {\r\n      root: {\r\n        ...inputValueS,\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      adornedStart: {\r\n        paddingLeft: 12,\r\n      },\r\n      adornedEnd: {\r\n        paddingRight: 12,\r\n      },\r\n      input: {\r\n        '.textTable &': {\r\n          minWidth: '80px',\r\n        },\r\n      },\r\n      // marginDense: {\r\n      //   width: '100px',\r\n      // }\r\n    },\r\n    MuiFilledInput: {\r\n      root: {\r\n        border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n        backgroundColor: bookitColors.base.white,\r\n        borderRadius: 8,\r\n        borderTopLeftRadius: 8,\r\n        borderTopRightRadius: 8,\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.base.white,\r\n          '@media (hover: none)': {\r\n            backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n          },\r\n        },\r\n        '&$focused': {\r\n          backgroundColor: bookitColors.base.white,\r\n        },\r\n        '&$disabled': {\r\n          backgroundColor: bookitColors.grayscale.grayBackground,\r\n        },\r\n      },\r\n      /* Styles applied to the root element if color secondary. */\r\n      colorSecondary: {\r\n        '&$underline:after': {\r\n          borderBottomColor: bookitColors.danger.regular,\r\n        },\r\n      },\r\n      underline: {\r\n        '&:after': {\r\n          borderBottom: `1px solid ${bookitColors.primary.regular}`,\r\n          left: 0,\r\n          bottom: -1,\r\n          // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n          content: '\"\"',\r\n          position: 'absolute',\r\n          right: 0,\r\n          transform: 'scaleX(0)',\r\n          pointerEvents: 'none', // Transparent to the hover style.\r\n          transition: transitions.create('transform', {\r\n            duration: transitions.duration.shorter,\r\n            easing: transitions.easing.easeOut,\r\n          }),\r\n          marginInline: 8,\r\n        },\r\n        '&$focused:after': {\r\n          transform: 'scaleX(1)',\r\n        },\r\n        '&$error:after': {\r\n          borderBottomColor: bookitColors.danger.regular,\r\n          transform: 'scaleX(1)', // error is always underlined in red\r\n        },\r\n        '&:before': {\r\n          borderBottom: 'none',\r\n          left: 0,\r\n          bottom: -1,\r\n          // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n          content: '\"\\\\00a0\"',\r\n          // content: '\"\"',\r\n          position: 'absolute',\r\n          right: 0,\r\n          transition: transitions.create('border-bottom-color', {\r\n            duration: transitions.duration.shorter,\r\n          }),\r\n          pointerEvents: 'none', // Transparent to the hover style.\r\n          marginInline: 8,\r\n        },\r\n        '&:hover:before': {\r\n          borderBottom: 'none',\r\n        },\r\n        '&$disabled:before': {\r\n          borderBottomStyle: 'none',\r\n        },\r\n        '&$focused:before': {\r\n          borderBottom: `1px solid ${bookitColors.primary.regular}`,\r\n          transform: 'scaleX(1)',\r\n        },\r\n        '&$error:before': {\r\n          borderBottom: `1px solid ${bookitColors.danger.regular}`,\r\n          transform: 'scaleX(1)',\r\n        },\r\n      },\r\n      /* Pseudo-class applied to the root element if the component is focused. */\r\n      focused: {},\r\n\r\n      /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n      disabled: {},\r\n\r\n      /* Styles applied to the root element if `startAdornment` is provided. */\r\n      adornedStart: {\r\n        paddingLeft: 12,\r\n      },\r\n\r\n      /* Styles applied to the root element if `endAdornment` is provided. */\r\n      adornedEnd: {\r\n        paddingRight: 12,\r\n      },\r\n\r\n      /* Pseudo-class applied to the root element if `error={true}`. */\r\n      error: {},\r\n\r\n      /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n      marginDense: {},\r\n\r\n      /* Styles applied to the root element if `multiline={true}`. */\r\n      multiline: {\r\n        padding: '27px 12px 10px',\r\n        '&$marginDense': {\r\n          paddingTop: 23,\r\n          paddingBottom: 6,\r\n        },\r\n      },\r\n      // input: {\r\n      //   height: '20px',\r\n      //   padding: '22px 12px 4px',\r\n      // },\r\n      // inputMarginDense: {\r\n      //   paddingTop: '16px',\r\n      //   paddingBottom: '6px',\r\n      // },\r\n      /* Styles applied to the `input` element. */\r\n      input: {\r\n        height: '20px',\r\n        padding: '26px 12px 8px',\r\n        '&:-webkit-autofill': {\r\n          // WebkitBoxShadow:\r\n          //   theme.palette.type === 'light' ? null : '0 0 0 100px #266798 inset',\r\n          // WebkitTextFillColor: theme.palette.type === 'light' ? null : '#fff',\r\n          // caretColor: theme.palette.type === 'light' ? null : '#fff',\r\n          borderTopLeftRadius: 'inherit',\r\n          borderTopRightRadius: 'inherit',\r\n        },\r\n        '.inputSizeLarge &': {\r\n          paddingTop: 22,\r\n          paddingBottom: 4,\r\n        },\r\n        '.inputSizeLarge.noLabel &': {\r\n          paddingTop: 14,\r\n          paddingBottom: 12,\r\n        },\r\n        '.inputSizeMedium &': {\r\n          paddingTop: 9,\r\n          paddingBottom: 9,\r\n        },\r\n        '.inputSizeSmall &': {\r\n          paddingTop: 5,\r\n          paddingBottom: 5,\r\n        },\r\n      },\r\n\r\n      /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n      inputMarginDense: {\r\n        paddingTop: 22,\r\n        paddingBottom: 4,\r\n      },\r\n\r\n      /* Styles applied to the `input` if in `<FormControl hiddenLabel />`. */\r\n      inputHiddenLabel: {\r\n        paddingTop: 17,\r\n        paddingBottom: 17,\r\n        '&$inputMarginDense': {\r\n          paddingTop: 9,\r\n          paddingBottom: 9,\r\n        },\r\n      },\r\n\r\n      /* Styles applied to the `input` element if `multiline={true}`. */\r\n      inputMultiline: {\r\n        padding: 0,\r\n      },\r\n\r\n      /* Styles applied to the `input` element if `startAdornment` is provided. */\r\n      inputAdornedStart: {\r\n        paddingLeft: 0,\r\n      },\r\n\r\n      /* Styles applied to the `input` element if `endAdornment` is provided. */\r\n      inputAdornedEnd: {\r\n        paddingRight: 0,\r\n      },\r\n    },\r\n    MuiFormHelperText: {\r\n      /* Styles applied to the root element. */\r\n      root: {\r\n        display: 'flex',\r\n        paddingLeft: '4px',\r\n        alignItems: 'center',\r\n        gap: 0,\r\n        alignSelf: 'stretch',\r\n        color: bookitColors.grayscale.blackRegular,\r\n        ...tipsRegular,\r\n        textAlign: 'left',\r\n        marginTop: 0,\r\n        margin: 0,\r\n        '&$disabled': {\r\n          color: bookitColors.grayscale.graySelection,\r\n        },\r\n        '&$error': {\r\n          color: bookitColors.danger.regular,\r\n        },\r\n        '&.boxed': {\r\n          gap: 0,\r\n        },\r\n        '&.shiftRight': {\r\n          gap: 28,\r\n        },\r\n        // '&.separate-picker': {\r\n        //   position: 'absolute',\r\n        //   top: 0,\r\n        //   left: 0,\r\n        //   '&.inputSizeLarge': {\r\n        //     transform: 'translate(0px, 54px) scale(1)',\r\n        //   },\r\n        //   '&.inputSizeMedium': {\r\n        //     transform: 'translate(0px, 46px) scale(1)',\r\n        //   },\r\n        //   '&.inputSizeSmall': {\r\n        //     transform: 'translate(0px, 38px) scale(1)',\r\n        //   },\r\n        // },\r\n        // empty helperText results in zero element height. So when field is validated the appearance of the\r\n        // error message in the helperText causes the form element to increase in height and forces a redraw\r\n        // empty char \\00a0 causes the FormHelperText to always occupy one line height and prevents reflows\r\n        '&::before': {\r\n          content: '\"\\\\00a0\"',\r\n        },\r\n        // marginLeft: '6px',\r\n        // ...tipsRegular,\r\n      },\r\n\r\n      /* Pseudo-class applied to the root element if `error={true}`. */\r\n      error: {},\r\n\r\n      /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n      disabled: {},\r\n\r\n      /* Styles applied to the root element if `margin=\"dense\"`. */\r\n      marginDense: {\r\n        marginTop: 4,\r\n      },\r\n\r\n      /* Styles applied to the root element if `variant=\"filled\"` or `variant=\"outlined\"`. */\r\n      contained: {\r\n        marginLeft: 0,\r\n        marginRight: 0,\r\n      },\r\n\r\n      /* Pseudo-class applied to the root element if `focused={true}`. */\r\n      focused: {},\r\n\r\n      /* Pseudo-class applied to the root element if `filled={true}`. */\r\n      filled: {},\r\n\r\n      /* Pseudo-class applied to the root element if `required={true}`. */\r\n      required: {},\r\n    },\r\n    MuiFormGroup: {\r\n      /* Styles applied to the root element. */\r\n      root: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        flexWrap: 'wrap',\r\n        gap: 8,\r\n        '&.boxed': {\r\n          display: 'flex',\r\n          height: 'auto',\r\n          minHeight: '56px',\r\n          //justifyContent: 'center',\r\n          alignItems: 'center',\r\n          gap: '10px',\r\n          alignSelf: 'stretch',\r\n          padding: '16px',\r\n          borderRadius: '8px',\r\n          border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n          background: bookitColors.base.white,\r\n          '&.toggleSizeSmall': {\r\n            minHeight: '48px',\r\n            padding: '12px',\r\n          },\r\n          '&.boxedError': {\r\n            border: `1px solid ${bookitColors.danger.borders}`,\r\n          },\r\n          '&.boxedChecked': {\r\n            border: `1px solid ${bookitColors.primary.borders}`,\r\n            background: bookitColors.primary.background,\r\n            //   '&.boxedSecondary': {\r\n            //     border: `1px solid ${bookitColors.success.borders}`,\r\n            //     background: bookitColors.success.background,\r\n            //   },\r\n            '&.boxedError': {\r\n              border: `1px solid ${bookitColors.danger.borders}`,\r\n              background: bookitColors.danger.background,\r\n            },\r\n          },\r\n        },\r\n        '&.horizontal': {\r\n          gap: '16px',\r\n        },\r\n        '&.vertical': {\r\n          gap: '16px',\r\n          alignItems: 'flex-start',\r\n          width: '100%',\r\n        },\r\n      },\r\n      /* Styles applied to the root element if `row={true}`. */\r\n      row: {\r\n        flexDirection: 'row',\r\n        justifyContent: 'space-between',\r\n      },\r\n    },\r\n    MuiFormLabel: {\r\n      root: {\r\n        color: bookitColors.grayscale.graySubtitles,\r\n        ...bodyS,\r\n        '&$focused': {\r\n          color: bookitColors.grayscale.graySubtitles,\r\n        },\r\n        '&.ghosInputLabel': {\r\n          display: 'flex',\r\n          height: '17px',\r\n          flexDirection: 'column',\r\n          justifyContent: 'center',\r\n          alignSelf: 'stretch',\r\n          color: bookitColors.grayscale.graySubtitles,\r\n          ...bookitTypography.captionRegular,\r\n          '&.ghosInputLabelBold': {\r\n            fontWeight: '900',\r\n          },\r\n        },\r\n        '&.radio-group-base-label': {\r\n          marginBottom: '24px',\r\n          color: bookitColors.grayscale.blackRegular,\r\n          ...buttonM,\r\n          '&[class*=\"Mui-focused\"]': {\r\n            color: bookitColors.grayscale.blackRegular,\r\n          },\r\n          '&.withLabel': {\r\n            marginBottom: '8px',\r\n          },\r\n          '&.boldLabel': {\r\n            fontWeight: 700,\r\n          },\r\n        },\r\n      },\r\n      // focused: {\r\n      //   color: bookitColors.grayscale.graySubtitles,\r\n      // },\r\n      asterisk: {\r\n        color: bookitColors.danger.regular,\r\n      },\r\n    },\r\n    MuiInputLabel: {\r\n      root: {\r\n        color: bookitColors.grayscale.grayComponents,\r\n        ...inputValueS,\r\n        display: 'block',\r\n        transformOrigin: 'top left',\r\n        '&.datetime-picker': {\r\n          position: 'relative',\r\n          transform: 'unset',\r\n          textOverflow: 'ellipsis',\r\n          whiteSpace: 'nowrap',\r\n          overflow: 'hidden',\r\n          width: '13ch',\r\n          display: 'inline-block',\r\n        },\r\n        '&.shrinkFile': {\r\n          transform: 'translate(12px, -4px) scale(1)',\r\n        },\r\n      },\r\n      /* Pseudo-class applied to the root element if `focused={true}`. */\r\n      focused: {},\r\n\r\n      /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n      disabled: {},\r\n\r\n      /* Pseudo-class applied to the root element if `error={true}`. */\r\n      error: {},\r\n\r\n      /* Pseudo-class applied to the root element if `required={true}`. */\r\n      required: {},\r\n\r\n      /* Pseudo-class applied to the asterisk element. */\r\n      asterisk: {},\r\n      /* Styles applied to the root element if the component is a descendant of `FormControl`. */\r\n      formControl: {\r\n        position: 'absolute',\r\n        left: 0,\r\n        top: 0,\r\n        // slight alteration to spec spacing to match visual spec result\r\n        transform: 'translate(0, 24px) scale(1)',\r\n        '&.date-dropdown-picker': {\r\n          transform: 'translate(0px, -20px) scale(1)',\r\n        },\r\n        '&.time-options-picker': {\r\n          transform: 'translate(0px, -26px) scale(1)',\r\n        },\r\n        '&.noLabelInline': {\r\n          transform: 'translate(0px, 0px) scale(1)',\r\n        },\r\n      },\r\n      /* Styles applied to the root element if `margin=\"dense\"`. */\r\n      marginDense: {\r\n        // Compensation for the `Input.inputDense` style.\r\n        transform: 'translate(0, 21px) scale(1)',\r\n      },\r\n      /* Styles applied to the `input` element if `disableAnimation={false}`. */\r\n      animated: {\r\n        transition: transitions.create(['color', 'transform'], {\r\n          duration: transitions.duration.shorter,\r\n          easing: transitions.easing.easeOut,\r\n        }),\r\n      },\r\n      /* Styles applied to the `input` element if `shrink={true}`. */\r\n      shrink: {\r\n        transform: 'translate(0, -2.5px) scale(1.1)',\r\n        //transform: 'translate(0, 1.5px) scale(0.75)',\r\n        transformOrigin: 'top left',\r\n        ...inputLabelXS,\r\n      },\r\n      /* Styles applied to the root element if `variant=\"filled\"`. */\r\n      filled: {\r\n        // Chrome's autofill feature gives the input field a yellow background.\r\n        // Since the input field is behind the label in the HTML tree,\r\n        // the input field is drawn last and hides the label with an opaque background color.\r\n        // zIndex: 1 will raise the label above opaque background-colors of input.\r\n        zIndex: 1,\r\n        pointerEvents: 'none',\r\n        height: '16px',\r\n        transform: 'translate(12px, 18px) scale(1)',\r\n        '&.inputSizeLarge': {\r\n          transform: 'translate(12px, 14px) scale(1)',\r\n          '&.separate-picker': {\r\n            transform: 'translate(0px, -20px) scale(1)',\r\n          },\r\n          '&.date-dropdown-picker': {\r\n            transform: 'translate(0px, -20px) scale(1)',\r\n          },\r\n          '&.time-options-picker': {\r\n            transform: 'translate(0px, -26px) scale(1)',\r\n          },\r\n        },\r\n        '&.inputSizeMedium': {\r\n          transform: 'translate(12px, 10px) scale(1)',\r\n          '&.separate-picker': {\r\n            transform: 'translate(0px, -20px) scale(1)',\r\n          },\r\n          '&.date-dropdown-picker': {\r\n            transform: 'translate(0px, -20px) scale(1)',\r\n          },\r\n          '&.time-options-picker': {\r\n            transform: 'translate(0px, -26px) scale(1)',\r\n          },\r\n        },\r\n        '&.inputSizeSmall': {\r\n          transform: 'translate(12px, 6px) scale(1)',\r\n          '&.separate-picker,': {\r\n            transform: 'translate(0px, -20px) scale(1)',\r\n          },\r\n          '&.date-dropdown-picker': {\r\n            transform: 'translate(0px, -20px) scale(1)',\r\n          },\r\n          '&.time-options-picker': {\r\n            transform: 'translate(0px, -26px) scale(1)',\r\n          },\r\n        },\r\n        '&$marginDense': {\r\n          transform: 'translate(12px, 8px) scale(1)',\r\n        },\r\n        '&$shrink': {\r\n          // letterSpacing: '0.2px',\r\n          ...inputLabelXS,\r\n          '&.inputSizeLarge': {\r\n            transform: 'translate(12px, 6px) scale(1)',\r\n          },\r\n          '&.inputSizeMedium': {\r\n            transform: 'translate(12px, -18px) scale(1)',\r\n          },\r\n          '&.inputSizeSmall': {\r\n            transform: 'translate(12px, -18px) scale(1)',\r\n          },\r\n          transform: 'translate(12px, 8px) scale(1)',\r\n          '&$marginDense': {\r\n            transform: 'translate(12px, 4px) scale(0.75)',\r\n          },\r\n        },\r\n        '&.datetime-picker': {\r\n          transform: 'unset',\r\n          textOverflow: 'ellipsis',\r\n          whiteSpace: 'nowrap',\r\n          overflow: 'hidden',\r\n          width: '13ch',\r\n          display: 'inline-block',\r\n        },\r\n        '&.rich-text-input-label': {\r\n          transform: 'translate(9px, 15px) scale(1)',\r\n          '&.rich-text-input-label-focused': {\r\n            transform: 'translate(9px, 38px) scale(0.8)',\r\n          },\r\n        },\r\n        // transform: 'translate(12px, 20px) scale(1)',\r\n        // '&$marginDense': {\r\n        //   transform: 'translate(12px, 17px) scale(1)',\r\n        // },\r\n        // '&$shrink': {\r\n        //   transform: 'translate(12px, 10px) scale(0.75)',\r\n        //   '&$marginDense': {\r\n        //     transform: 'translate(12px, 7px) scale(0.75)',\r\n        //   },\r\n        // },\r\n      },\r\n      /* Styles applied to the root element if `variant=\"outlined\"`. */\r\n      outlined: {\r\n        // see comment above on filled.zIndex\r\n        zIndex: 1,\r\n        pointerEvents: 'none',\r\n        transform: 'translate(14px, 20px) scale(1)',\r\n        '&$marginDense': {\r\n          transform: 'translate(14px, 12px) scale(1)',\r\n        },\r\n        '&$shrink': {\r\n          transform: 'translate(14px, -6px) scale(0.75)',\r\n        },\r\n      },\r\n    },\r\n    MuiInputAdornment: {\r\n      positionStart: {\r\n        cursor: 'pointer',\r\n        '& svg': {\r\n          width: '16px',\r\n          height: '16px',\r\n        },\r\n      },\r\n      positionEnd: {\r\n        '&.date-picker': {\r\n          marginLeft: 0,\r\n        },\r\n      },\r\n      filled: {\r\n        '&$positionStart:not($hiddenLabel)': {\r\n          marginTop: 0,\r\n        },\r\n        width: '18px',\r\n        height: '20px',\r\n        cursor: 'pointer',\r\n        '& svg': {\r\n          height: '16px',\r\n          width: '16px',\r\n        },\r\n      },\r\n      marginDense: {\r\n        '& svg': {\r\n          fontSize: '0.8rem',\r\n          cursor: 'pointer',\r\n        },\r\n      },\r\n    },\r\n    MuiSvgIcon: {\r\n      root: {\r\n        cursor: 'auto',\r\n      },\r\n      fontSizeSmall: {\r\n        fontSize: '0.8rem',\r\n      },\r\n    },\r\n    MuiList: {\r\n      root: {\r\n        '&.sideBarList': {\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          '& .sideBarListGroup': {\r\n            display: 'flex',\r\n            padding: '12px 0px',\r\n            flexDirection: 'column',\r\n            alignItems: 'flex-start',\r\n            alignSelf: 'stretch',\r\n            borderBottom: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n          },\r\n          '&.sideBarCollapsed': {\r\n            alignSelf: 'stretch',\r\n          },\r\n          '&.sideBarExpanded': {\r\n            width: '240px',\r\n            '&.sideBarListMobile': {\r\n              width: '100%',\r\n            },\r\n          },\r\n        },\r\n        '&.secondMenuItem': {\r\n          display: 'flex',\r\n          paddingBottom: '12px',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          background: bookitColors.grayscale.graybgComponents,\r\n          '.sideBarListMobile &': {\r\n            width: '100%',\r\n          },\r\n          '& .menuItem': {\r\n            display: 'flex',\r\n            width: '240px',\r\n            height: '32px',\r\n            padding: '0px 8px 0px 16px',\r\n            alignItems: 'center',\r\n            gap: '8px',\r\n            '.sideBarListMobile &': {\r\n              width: '100%',\r\n            },\r\n            '&:hover, &:focus': {\r\n              background: bookitColors.primary.bgHover,\r\n              '& .menuItemContent': {\r\n                '& .menuItemText': {\r\n                  ...bookitTypography.bodyS,\r\n                },\r\n              },\r\n            },\r\n            '&:active': {\r\n              background: bookitColors.primary.bgHover,\r\n              '& .menuItemContent': {\r\n                '& .menuItemText': {\r\n                  ...bookitTypography.bodyS,\r\n                },\r\n              },\r\n            },\r\n            '&.Mui-selected': {\r\n              background: bookitColors.primary.bgHover,\r\n              '& .menuItemContent': {\r\n                '& .menuItemText': {\r\n                  ...bookitTypography.bodyS,\r\n                  fontWeight: 600,\r\n                },\r\n              },\r\n            },\r\n            '& .menuItemContent': {\r\n              display: 'flex',\r\n              alignItems: 'center',\r\n              paddingLeft: '8px',\r\n              gap: '8px',\r\n              flex: '1 0 0',\r\n              '& .menuItemIcon': {\r\n                display: 'flex',\r\n                alignItems: 'flex-start',\r\n                gap: '7.5px',\r\n                width: 'auto',\r\n                height: 12,\r\n                color: bookitColors.grayscale.grayComponents,\r\n                '& > svg': {\r\n                  width: '12px',\r\n                },\r\n              },\r\n              '& .menuItemText': {\r\n                flex: '1 0 0',\r\n                color: bookitColors.grayscale.blackRegular,\r\n                ...bookitTypography.bodyS,\r\n                cursor: 'pointer',\r\n                whiteSpace: 'inherit',\r\n              },\r\n            },\r\n          },\r\n        },\r\n      },\r\n    },\r\n    MuiListItem: {\r\n      root: {\r\n        '&.assetListItemLink': {\r\n          display: 'flex',\r\n          width: '100%',\r\n          padding: '4px 8px',\r\n          alignItems: 'center',\r\n          gap: '12px',\r\n\r\n          borderRadius: '4px',\r\n          background: bookitColors.base.white,\r\n          '&:hover, &:focus': {\r\n            backgroundColor: bookitColors.grayscale.grayBackground,\r\n          },\r\n          '&:active': {\r\n            backgroundColor: bookitColors.grayscale.graybgComponents,\r\n          },\r\n        },\r\n        '&.menuItem': {\r\n          padding: 0,\r\n          '&.mainTabMenu': {\r\n            display: 'flex',\r\n            height: '40px',\r\n            padding: '0px 16px',\r\n            alignItems: 'center',\r\n            gap: '8px',\r\n            alignSelf: 'stretch',\r\n            backgroundColor: 'transparent',\r\n            '& .menuItemContent': {\r\n              display: 'flex',\r\n              alignItems: 'center',\r\n              gap: '8px',\r\n              flex: '1 0 0',\r\n              '& .menuItemIcon': {\r\n                display: 'flex',\r\n                paddingBottom: '1px',\r\n                alignItems: 'flex-start',\r\n                gap: '10px',\r\n                width: 'auto',\r\n                height: 20,\r\n                color: bookitColors.grayscale.grayComponents,\r\n                '& > svg': {\r\n                  width: '19px',\r\n                },\r\n              },\r\n              '& .menuItemText': {\r\n                flex: '1 0 0',\r\n                color: bookitColors.grayscale.blackRegular,\r\n                ...bookitTypography.buttonS,\r\n                cursor: 'pointer',\r\n                whiteSpace: 'initial',\r\n              },\r\n            },\r\n            '&:hover, &:focus': {\r\n              backgroundColor: bookitColors.grayscale.graybgComponents,\r\n            },\r\n            '&:active': {\r\n              backgroundColor: bookitColors.grayscale.graybgComponents,\r\n            },\r\n            '&.mainTabExpanded': {\r\n              '& .menuItemContent': {\r\n                '& .menuItemIcon': {\r\n                  minWidth: 'initial',\r\n                },\r\n              },\r\n            },\r\n            '&.mainTabShort': {\r\n              '& .menuItemContent': {\r\n                '& .menuItemIcon': {\r\n                  minWidth: '60px',\r\n                },\r\n              },\r\n            },\r\n          },\r\n        },\r\n        '.hoverItem &': {\r\n          display: 'flex',\r\n          width: '60px',\r\n          height: '40px',\r\n          padding: '0px 16px',\r\n          alignItems: 'center',\r\n          gap: '8px',\r\n          backgroundColor: 'transparent',\r\n          '& .menuItemHoverContent': {\r\n            display: 'flex',\r\n            justifyContent: 'center',\r\n            alignItems: 'center',\r\n            gap: '8px',\r\n            flex: '1 0 0',\r\n            '& .menuItemIcon': {\r\n              display: 'flex',\r\n              paddingBottom: '1px',\r\n              alignItems: 'flex-start',\r\n              gap: '10px',\r\n              width: 'auto',\r\n              height: 20,\r\n              color: bookitColors.grayscale.grayComponents,\r\n              '& > svg': {\r\n                width: '19px',\r\n              },\r\n            },\r\n          },\r\n          '&:hover, &:focus': {\r\n            backgroundColor: bookitColors.grayscale.graySelection,\r\n            '& .menuItemHoverContent': {\r\n              '& .menuItemIcon': {\r\n                color: bookitColors.grayscale.grayComponents,\r\n              },\r\n            },\r\n          },\r\n          '&:focus': {\r\n            backgroundColor: bookitColors.primary.bgHover,\r\n            '& .menuItemHoverContent': {\r\n              '& .menuItemIcon': {\r\n                color: bookitColors.primary.components,\r\n              },\r\n            },\r\n          },\r\n          '&:active': {\r\n            backgroundColor: bookitColors.primary.bgHover,\r\n            '& .menuItemHoverContent': {\r\n              '& .menuItemIcon': {\r\n                color: bookitColors.primary.components,\r\n              },\r\n            },\r\n          },\r\n          '&.Mui-selected': {\r\n            backgroundColor: bookitColors.primary.bgHover,\r\n            '& .menuItemHoverContent': {\r\n              '& .menuItemIcon': {\r\n                color: bookitColors.primary.components,\r\n              },\r\n            },\r\n          },\r\n        },\r\n      },\r\n    },\r\n    MuiListItemText: {\r\n      root: {\r\n        '.assetListItemLink &': {\r\n          display: 'flex',\r\n          alignItems: 'flex-start',\r\n          gap: '8px',\r\n          flex: '1 0 0',\r\n          margin: 0,\r\n        },\r\n      },\r\n      primary: {\r\n        '.assetListItemLink &': {\r\n          display: 'inline-block',\r\n          maxWidth: '50%',\r\n          textOverflow: 'ellipsis',\r\n          whiteSpace: 'nowrap',\r\n          overflow: 'hidden',\r\n          ...boldS,\r\n        },\r\n      },\r\n      secondary: {\r\n        '.assetListItemLink &': {\r\n          display: 'flex',\r\n          height: '20px',\r\n          flexDirection: 'column',\r\n          justifyContent: 'center',\r\n          flex: '1 0 0',\r\n          color: bookitColors.grayscale.blackRegular,\r\n          ...bodyS,\r\n        },\r\n      },\r\n    },\r\n    MuiListItemIcon: {\r\n      root: {\r\n        minWidth: 20,\r\n        '.assetListItemLink &': {\r\n          display: 'flex',\r\n          width: '32px',\r\n          height: '32px',\r\n          flexDirection: 'column',\r\n          justifyContent: 'center',\r\n          alignItems: 'center',\r\n          gap: '10px',\r\n          flexShrink: 0,\r\n          borderRadius: '4px',\r\n        },\r\n      },\r\n    },\r\n    MuiAvatar: {\r\n      root: {\r\n        '.assetListItemLink &': {\r\n          color: bookitColors.grayscale.grayComponentsLight,\r\n          backgroundColor: bookitColors.grayscale.graySelection,\r\n          width: '32px',\r\n          height: '32px',\r\n          borderRadius: '4px',\r\n        },\r\n      },\r\n    },\r\n    MuiTableContainer: {\r\n      root: {\r\n        overflowX: 'unset',\r\n        height: 'inherit',\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        overflowY: 'hidden',\r\n      },\r\n    },\r\n    MuiTable: {\r\n      root: {\r\n        //flex test -----\r\n        // display: 'flex',\r\n        // flexFlow: 'column nowrap',\r\n        // flex: '1 1 auto',\r\n        //---------------\r\n        padding: 0,\r\n        borderRadius: '8px',\r\n        boxShadow: `inset 0px 0px 1px 1px ${bookitColors.grayscale.grayBorders}`,\r\n        [breakpoints.down('md')]: {\r\n          display: 'block',\r\n          overflowX: 'auto',\r\n          height: '100%',\r\n        },\r\n      },\r\n    },\r\n    MuiTableHead: {\r\n      root: {\r\n        //flex test -----\r\n        // display: 'flex',\r\n        // flexFlow: 'row nowrap',\r\n        // alignItems: 'flex-start',\r\n        //width: 'inherit',\r\n        //---------------\r\n        padding: 0,\r\n      },\r\n    },\r\n    MuiTableBody: {\r\n      root: {\r\n        //flex test -----\r\n        // display: 'flex',\r\n        // flexFlow: 'row wrap',\r\n        // width: 'inherit',\r\n        //---------------\r\n        padding: 0,\r\n      },\r\n    },\r\n    MuiTableRow: {\r\n      root: {\r\n        //flex test -----\r\n        // display: 'flex',\r\n        // flex: '1 1 auto',\r\n        // width: 'inherit',\r\n        //---------------\r\n        '& td:first-child ': {\r\n          boxShadow: `0px 1px 0px 0px ${bookitColors.grayscale.grayBorders}`,\r\n        },\r\n        '& th:first-child ': {\r\n          boxShadow: `0px 1px 0px 0px ${bookitColors.grayscale.grayBorders}`,\r\n        },\r\n      },\r\n    },\r\n    MuiTableCell: {\r\n      root: {\r\n        //flex test -----\r\n        // display: 'flex',\r\n        // flexFlow: 'row nowrap',\r\n        // flexGrow: 1,\r\n        // flexBasis: 0,\r\n        //---------------\r\n        //height: '32px',\r\n        ...bodyS,\r\n        boxShadow: `-1px 1px 0px ${bookitColors.grayscale.grayBorders}`,\r\n        borderBottom: 'unset',\r\n        height: '56px',\r\n        color: bookitColors.grayscale.blackRegular,\r\n        [breakpoints.down('md')]: {\r\n          whiteSpace: 'nowrap',\r\n        },\r\n      },\r\n      head: {\r\n        lineHeight: '164%',\r\n        fontWeight: 'bold',\r\n        padding: '4px 12px',\r\n        gap: '10px',\r\n        whiteSpace: 'nowrap',\r\n      },\r\n      body: {\r\n        fontWeight: 'normal',\r\n        lineHeight: '141%',\r\n        padding: '8px 12px',\r\n        gap: '10px',\r\n        '& > span a': {\r\n          color: bookitColors.primary.regular, // accentColors.colorAccentRegular,\r\n        },\r\n        '& > span > button': {\r\n          color: bookitColors.primary.regular, //accentColors.colorAccentRegular,\r\n        },\r\n        '& > a': {\r\n          color: bookitColors.primary.regular, // accentColors.colorAccentRegular,\r\n        },\r\n        '& > button': {\r\n          color: bookitColors.primary.regular, // accentColors.colorAccentRegular,\r\n        },\r\n        // '& > span': {\r\n        //   display: 'inline-block',\r\n        //   whiteSpace: 'break-spaces',\r\n        //   maxWidth: '25ch',\r\n        //   minWidth: '6ch',\r\n        //   //overflow: 'hidden',\r\n        //   //textOverflow: 'ellipsis',\r\n        // },\r\n      },\r\n      sizeSmall: {\r\n        height: '40px',\r\n        padding: '0px 12px',\r\n        gap: '10px',\r\n      },\r\n      footer: {\r\n        lineHeight: '164%',\r\n        fontWeight: 'bold',\r\n        padding: '12px',\r\n      },\r\n    },\r\n    MuiTableSortLabel: {\r\n      root: {\r\n        cursor: 'pointer',\r\n        '&$active': {\r\n          // && instead of & is a workaround for https://github.com/cssinjs/jss/issues/1045\r\n          '&& $icon': {\r\n            color: bookitColors.grayscale.blackRegular,\r\n          },\r\n        },\r\n        '&:focus': {\r\n          '&& $icon': {\r\n            fontSize: 16,\r\n            opacity: 0.5,\r\n          },\r\n        },\r\n      },\r\n      icon: {\r\n        fontSize: '12px',\r\n        cursor: 'pointer',\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n    },\r\n    MuiTablePagination: {\r\n      root: {\r\n        fontSize: '14px',\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n      caption: {\r\n        fontSize: '14px', // convert('14px', 'em'),\r\n        fontWeight: 'bold',\r\n        letterSpacing: '0.1px',\r\n        lineHeight: '151%',\r\n      },\r\n      spacer: {\r\n        flex: 'none',\r\n      },\r\n      input: {\r\n        marginRight: 'auto',\r\n        marginLeft: 0,\r\n      },\r\n      selectRoot: {\r\n        fontWeight: 'bold',\r\n      },\r\n      select: {\r\n        '&:focus': {\r\n          border: `1px solid ${bookitColors.primary.hover}`,\r\n          background: bookitColors.primary.background,\r\n          borderRadius: '6px',\r\n          fontWeight: 'bold',\r\n          color: bookitColors.primary.dark,\r\n        },\r\n      },\r\n      toolbar: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        padding: 0,\r\n        gap: '16px',\r\n        fontWeight: 'bold',\r\n        fontSize: '14px',\r\n        minHeight: '40px',\r\n      },\r\n      menuItem: {\r\n        padding: '10px 16px',\r\n        gap: '12px',\r\n        fontSize: '14px',\r\n        color: bookitColors.grayscale.blackRegular,\r\n      },\r\n    },\r\n    MuiTextField: {\r\n      root: {\r\n        '&.startIcon': {\r\n          '& > label': {\r\n            marginLeft: '24px',\r\n          },\r\n        },\r\n        // '&.textTable': {\r\n        //   minWidth: '80px',\r\n        // },\r\n      },\r\n    },\r\n    MuiChip: {\r\n      root: {\r\n        '&.recentItem': {\r\n          display: 'flex',\r\n          height: '32px',\r\n          padding: '0px 8px',\r\n          alignItems: 'center',\r\n          gap: '12px',\r\n          flexShrink: 0,\r\n          justifyContent: 'flex-start',\r\n          ...bodyS,\r\n          borderRadius: '4px',\r\n          background: bookitColors.base.white,\r\n          '& [class*=\"MuiChip-avatar\"]': {\r\n            margin: 0,\r\n            width: 16,\r\n            height: 16,\r\n            color: bookitColors.grayscale.grayComponents,\r\n          },\r\n          '&$disabled': {\r\n            color: bookitColors.grayscale.grayComponentsLight,\r\n            opacity: 1,\r\n          },\r\n          '&:hover, &:focus': {\r\n            backgroundColor: bookitColors.grayscale.grayBackground,\r\n          },\r\n          '&:active': {\r\n            backgroundColor: bookitColors.grayscale.graybgComponents,\r\n            boxShadow: 'none',\r\n          },\r\n          '& [class*=\"MuiChip-label\"]': {\r\n            flex: '1 0 0',\r\n            padding: 0,\r\n          },\r\n        },\r\n      },\r\n      clickable: {\r\n        '&:focus': {\r\n          backgroundColor: bookitColors.grayscale.grayComponentsLight,\r\n          color: bookitColors.base.black,\r\n        },\r\n        '&:hover': {\r\n          backgroundColor: bookitColors.grayscale.grayComponentsLight,\r\n          color: bookitColors.base.black,\r\n        },\r\n      },\r\n    },\r\n    MuiButton: MuiButtonOverride,\r\n    MuiIconButton: MuiIconButtonOverride,\r\n    MuiToggleButtonGroup: MuiToggleButtonGroupOverride,\r\n    MuiToggleButton: MuiToggleButtonOverride,\r\n    MuiSwitch: {\r\n      //TO DO: set a padding: '0px' after Toggle component will replace a Switch component\r\n      /* Styles applied to the root element. */\r\n      root: {\r\n        display: 'inline-flex',\r\n        width: 36,\r\n        height: 20,\r\n        overflow: 'hidden',\r\n        padding: '0px',\r\n        boxSizing: 'border-box',\r\n        position: 'relative',\r\n        flexShrink: 0,\r\n        zIndex: 0,\r\n        // Reset the stacking context.\r\n        verticalAlign: 'middle',\r\n        // For correct alignment with the text.\r\n        '@media print': {\r\n          colorAdjust: 'exact',\r\n        },\r\n        // '&>[class*=\"PrivateSwitchBase-root\"]': {\r\n        //   padding: 2,\r\n        // },\r\n      },\r\n      /* Styles applied to the internal `SwitchBase` component's `root` class. */\r\n      switchBase: {\r\n        position: 'absolute',\r\n        top: 0,\r\n        left: 0,\r\n        zIndex: 1,\r\n        // Render above the focus ripple.\r\n        color: bookitColors.grayscale.grayComponents,\r\n        transition: transitions.create(['left', 'transform'], {\r\n          duration: transitions.duration.shortest,\r\n        }),\r\n        padding: '2px',\r\n        border: 0,\r\n        '&$checked': {\r\n          transform: 'translateX(16px)',\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.grayscale.grayComponentsLight,\r\n        },\r\n        '&$checked + $track': {\r\n          opacity: 'unset',\r\n        },\r\n        '&$disabled + $track': {\r\n          opacity: 'unset',\r\n        },\r\n      },\r\n      /* Pseudo-class applied to the internal `SwitchBase` component's `checked` class. */\r\n      checked: {},\r\n\r\n      /* Pseudo-class applied to the internal SwitchBase component's disabled class. */\r\n      disabled: {},\r\n\r\n      /* Styles applied to the internal SwitchBase component's input element. */\r\n      input: {\r\n        left: '-100%',\r\n        width: '300%',\r\n      },\r\n      /* Styles applied to the internal SwitchBase component's root element if `color=\"primary\"`. */\r\n      colorPrimary: {\r\n        '&$checked': {\r\n          color: bookitColors.primary.components,\r\n          '&:hover': {\r\n            //backgroundColor: bookitColors.primary.componentsLight,\r\n            '@media (hover: none)': {\r\n              backgroundColor: 'transparent',\r\n            },\r\n          },\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.grayscale.graySelection,\r\n          //backgroundColor: bookitColors.grayscale.graySelection,\r\n        },\r\n        '&$checked + $track': {\r\n          backgroundColor: bookitColors.primary.components,\r\n        },\r\n        '&.Mui-checked.Mui-disabled + $track': {\r\n          backgroundColor: bookitColors.primary.disabled,\r\n        },\r\n        '&$disabled + $track': {\r\n          backgroundColor: bookitColors.grayscale.graySelection,\r\n        },\r\n      },\r\n      /* Styles applied to the internal SwitchBase component's root element if `color=\"secondary\"`. */\r\n      colorSecondary: {\r\n        '&$checked': {\r\n          color: bookitColors.danger.regular,\r\n          '&:hover': {\r\n            '@media (hover: none)': {\r\n              backgroundColor: 'transparent',\r\n            },\r\n          },\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.danger.disabled,\r\n        },\r\n        '&$checked + $track': {\r\n          backgroundColor: bookitColors.danger.regular,\r\n        },\r\n        '&.Mui-checked.Mui-disabled + $track': {\r\n          backgroundColor: bookitColors.danger.disabled,\r\n        },\r\n        '&$disabled + $track': {\r\n          backgroundColor: bookitColors.grayscale.graySelection,\r\n          border: `1px solid ${bookitColors.danger.borders}`,\r\n        },\r\n      },\r\n      /* Styles applied to the root element if `size=\"small\"`. */\r\n      sizeSmall: {\r\n        width: 36,\r\n        height: 20,\r\n        padding: 0,\r\n        '& $thumb': {\r\n          width: 16,\r\n          height: 16,\r\n        },\r\n        '& $switchBase': {\r\n          padding: 2,\r\n          '&$checked': {\r\n            transform: 'translateX(16px)',\r\n          },\r\n        },\r\n      },\r\n      /* Styles used to create the thumb passed to the internal `SwitchBase` component `icon` prop. */\r\n      thumb: {\r\n        backgroundColor: bookitColors.base.white,\r\n        borderRadius: '8px',\r\n        height: '16px',\r\n        position: 'relative',\r\n        width: '16px',\r\n        boxShadow: box_shadow_s,\r\n      },\r\n      /* Styles applied to the track element. */\r\n      track: {\r\n        borderRadius: '100px',\r\n        padding: '0px',\r\n        height: '100%',\r\n        width: '100%',\r\n        zIndex: -1,\r\n        transition: 'unset',\r\n        backgroundColor: bookitColors.grayscale.grayComponentsLight,\r\n        opacity: 'unset',\r\n      },\r\n    },\r\n    MuiFormControl: {\r\n      /* Styles applied to the root element. */\r\n      root: {\r\n        display: 'inline-flex',\r\n        flexDirection: 'column',\r\n        position: 'relative',\r\n        // Reset fieldset default style.\r\n        minWidth: 0,\r\n        padding: 0,\r\n        margin: 0,\r\n        border: 0,\r\n        verticalAlign: 'top', // Fix alignment issue on Safari.\r\n\r\n        minHeight: '20px',\r\n        // alignItems: 'center',\r\n        gap: '8px',\r\n        flexShrink: 0,\r\n        '&.boxed': {\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          justifyContent: 'center',\r\n          alignItems: 'flex-start',\r\n          gap: '8px',\r\n        },\r\n        '&.inputSizeMedium.withLabel': {\r\n          marginTop: '16px',\r\n        },\r\n        '&.inputSizeSmall.withLabel': {\r\n          marginTop: '16px',\r\n        },\r\n        '&.separate-picker': {\r\n          // flexDirection: 'row',\r\n          // flexShrink: 1,\r\n          // marginBottom: '18px',\r\n          '& .separate-picker-inputs': {\r\n            display: 'flex',\r\n            flexDirection: 'row',\r\n            flex: '1 1 auto',\r\n            alignSelf: 'stretch',\r\n            alignItems: 'center',\r\n            gap: 8,\r\n          },\r\n          '&.withLabel': {\r\n            marginTop: '16px',\r\n          },\r\n        },\r\n        '&.separate-time-picker': {\r\n          flexShrink: 1,\r\n        },\r\n        '&.separate-date-picker': {\r\n          flexShrink: 1,\r\n        },\r\n        '&.datetime-picker': {\r\n          // flexDirection: 'row',\r\n          // flexShrink: 1,\r\n          // marginBottom: '18px',\r\n          '& .datetime-picker-inputs': {\r\n            display: 'flex',\r\n            flexDirection: 'row',\r\n            flex: '1 1 auto',\r\n            alignSelf: 'stretch',\r\n            alignItems: 'center',\r\n            gap: 8,\r\n          },\r\n          // '&.withLabel': {\r\n          //   marginTop: '16px',\r\n          // },\r\n        },\r\n        '&.datetime-time-picker': {\r\n          flexShrink: 1,\r\n        },\r\n        '&.datetime-date-picker': {\r\n          flexShrink: 1,\r\n        },\r\n        '&.date-dropdown-picker': {\r\n          // flexDirection: 'row',\r\n          // flexShrink: 1,\r\n          // marginBottom: '18px',\r\n          '& .date-dropdown-picker-inputs': {\r\n            display: 'flex',\r\n            flexDirection: 'row',\r\n            flex: '1 1 auto',\r\n            alignSelf: 'stretch',\r\n            alignItems: 'center',\r\n            gap: 8,\r\n          },\r\n          '&.withLabel': {\r\n            marginTop: '16px',\r\n          },\r\n        },\r\n        '&.time-options-picker': {\r\n          marginTop: '20px',\r\n          '&.withLabel': {\r\n            marginTop: '20px',\r\n          },\r\n        },\r\n        '&.formLabelText': {\r\n          gap: 0,\r\n        },\r\n        '&.ghostInput': {\r\n          display: 'flex',\r\n          minHeight: '48px',\r\n          padding: '5px 0px',\r\n          alignItems: 'center',\r\n          gap: '10px',\r\n          flexShrink: 0,\r\n          borderRadius: '8px',\r\n          '& .ghosInputText': {\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            flex: '1 1 0',\r\n            alignItems: 'flex-start',\r\n            alignSelf: 'stretch',\r\n            width: '100%',\r\n          },\r\n        },\r\n        '&.radio-group-base': {\r\n          marginBottom: 0,\r\n        },\r\n      },\r\n\r\n      /* Styles applied to the root element if `margin=\"normal\"`. */\r\n      marginNormal: {\r\n        marginTop: 16,\r\n        marginBottom: 8,\r\n      },\r\n\r\n      /* Styles applied to the root element if `margin=\"dense\"`. */\r\n      marginDense: {\r\n        marginTop: 8,\r\n        marginBottom: 4,\r\n      },\r\n\r\n      /* Styles applied to the root element if `fullWidth={true}`. */\r\n      fullWidth: {\r\n        width: '100%',\r\n      },\r\n    },\r\n    MuiFormControlLabel: {\r\n      /* Styles applied to the root element. */\r\n      root: {\r\n        display: 'inline-flex',\r\n        alignItems: 'center',\r\n        cursor: 'pointer',\r\n        // For correct alignment with the text.\r\n        verticalAlign: 'middle',\r\n        WebkitTapHighlightColor: 'transparent',\r\n        marginLeft: 0,\r\n        marginRight: 0,\r\n        gap: 8,\r\n        // used for row presentation of radio/checkbox\r\n        '&$disabled': {\r\n          cursor: 'default',\r\n        },\r\n        '&.boldLabel': {\r\n          '& $label': {\r\n            ...boldS,\r\n            '&$disabled': {\r\n              color: bookitColors.grayscale.graySubtitles,\r\n            },\r\n          },\r\n        },\r\n        '&.autoWrap': {\r\n          '& $label': {\r\n            whiteSpace: 'normal',\r\n            overflow: 'visible',\r\n            textOverflow: 'unset',\r\n          },\r\n        },\r\n      },\r\n      /* Styles applied to the root element if `labelPlacement=\"start\"`. */\r\n      labelPlacementStart: {\r\n        flexDirection: 'row-reverse',\r\n        marginLeft: 16,\r\n        // used for row presentation of radio/checkbox\r\n        marginRight: -11,\r\n      },\r\n\r\n      /* Styles applied to the root element if `labelPlacement=\"top\"`. */\r\n      labelPlacementTop: {\r\n        flexDirection: 'column-reverse',\r\n        marginLeft: 0,\r\n        marginRight: 2,\r\n      },\r\n\r\n      /* Styles applied to the root element if `labelPlacement=\"bottom\"`. */\r\n      labelPlacementBottom: {\r\n        flexDirection: 'column',\r\n        marginLeft: 16,\r\n      },\r\n\r\n      /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n      disabled: {},\r\n\r\n      /* Styles applied to the label's Typography component. */\r\n      label: {\r\n        ...bodyS,\r\n        whiteSpace: 'nowrap',\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis',\r\n        // maxWidth: '25ch',\r\n        '&$disabled': {\r\n          color: bookitColors.grayscale.graySubtitles,\r\n        },\r\n        '&.boldLabel': {\r\n          ...boldS,\r\n          '&$disabled': {\r\n            color: bookitColors.grayscale.graySubtitles,\r\n          },\r\n        },\r\n      },\r\n    },\r\n    MuiCheckbox: {\r\n      root: {\r\n        color: bookitColors.grayscale.graySelection,\r\n        // '&[class*=\"PrivateSwitchBase-root\"]': {\r\n        //   padding: 0,\r\n        // },\r\n      },\r\n      colorPrimary: {\r\n        color: bookitColors.primary.borders,\r\n        '&$checked': {\r\n          color: bookitColors.primary.regular,\r\n          '&:hover': {\r\n            backgroundColor: bookitColors.base.white,\r\n            // Reset on touch devices, it doesn't add specificity\r\n            '@media (hover: none)': {\r\n              backgroundColor: 'transparent',\r\n            },\r\n          },\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.primary.disabled,\r\n        },\r\n      },\r\n      /* Styles applied to the root element if `color=\"secondary\"`. */\r\n      colorSecondary: {\r\n        color: bookitColors.danger.borders,\r\n        '&$checked': {\r\n          color: bookitColors.danger.regular,\r\n          '&:hover': {\r\n            backgroundColor: bookitColors.base.white,\r\n            // Reset on touch devices, it doesn't add specificity\r\n            '@media (hover: none)': {\r\n              backgroundColor: 'transparent',\r\n            },\r\n          },\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.danger.disabled,\r\n        },\r\n      },\r\n    },\r\n    MuiRadio: {\r\n      /* Styles applied to the root element. */\r\n      root: {\r\n        color: bookitColors.base.white,\r\n      },\r\n\r\n      /* Pseudo-class applied to the root element if `checked={true}`. */\r\n      checked: {},\r\n\r\n      /* Pseudo-class applied to the root element if `disabled={true}`. */\r\n      disabled: {},\r\n\r\n      /* Styles applied to the root element if `color=\"primary\"`. */\r\n      colorPrimary: {\r\n        '&$checked': {\r\n          color: bookitColors.primary.components,\r\n          '&:hover': {\r\n            backgroundColor: bookitColors.primary.regular,\r\n            // Reset on touch devices, it doesn't add specificity\r\n            '@media (hover: none)': {\r\n              backgroundColor: 'transparent',\r\n            },\r\n          },\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.grayscale.grayBorders,\r\n        },\r\n      },\r\n\r\n      /* Styles applied to the root element if `color=\"secondary\"`. */\r\n      colorSecondary: {\r\n        '&$checked': {\r\n          color: bookitColors.danger.components,\r\n          '&:hover': {\r\n            backgroundColor: bookitColors.danger.regular,\r\n            // Reset on touch devices, it doesn't add specificity\r\n            '@media (hover: none)': {\r\n              backgroundColor: 'transparent',\r\n            },\r\n          },\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.danger.disabled,\r\n        },\r\n      },\r\n    },\r\n    PrivateSwitchBase: {\r\n      root: {\r\n        padding: 0,\r\n      },\r\n      checked: {},\r\n      disabled: {},\r\n      input: {\r\n        cursor: 'inherit',\r\n        position: 'absolute',\r\n        opacity: 0,\r\n        width: '100%',\r\n        height: '100%',\r\n        top: 0,\r\n        left: 0,\r\n        margin: 0,\r\n        padding: 0,\r\n        zIndex: 1,\r\n      },\r\n    },\r\n    MuiBadge: {\r\n      badge: {\r\n        whiteSpace: 'nowrap',\r\n        height: '14px',\r\n        padding: '2px 0px',\r\n        fontSize: '8px',\r\n        minWidth: '14px',\r\n        lineHeight: '168%',\r\n        letterSpacing: '0.8px',\r\n      },\r\n    },\r\n    MUIDataTableBodyCell: {\r\n      root: {\r\n        padding: '0px 8px 0px 8px',\r\n        //textAlign: 'center',\r\n      },\r\n      // stackedCommon: {\r\n      //   display: 'flex',\r\n      //   // alignItems: 'center',\r\n      //   // flexWrap: 'nowrap',\r\n      //   // justifyContent: 'center',\r\n      // },\r\n    },\r\n    MUIDataTableBody: {\r\n      root: {\r\n        border: '1px solid #ccc',\r\n      },\r\n    },\r\n    MUIDataTableHeadCell: {\r\n      root: {\r\n        border: '1px solid #ccc',\r\n      },\r\n      contentWrapper: {\r\n        //justifyContent: 'center',\r\n      },\r\n      data: {\r\n        fontWeight: 'bold',\r\n      },\r\n      fixedHeader: {\r\n        //textAlign: 'center',\r\n        fontWeight: 'bold',\r\n        border: '1px solid #ccc',\r\n      },\r\n      toolButton: {\r\n        whiteSpace: 'nowrap',\r\n      },\r\n    },\r\n    MUIDataTableToolbarSelect: {\r\n      title: {\r\n        paddingRight: '26px',\r\n        paddingLe: '26px',\r\n        fontSize: '1rem',\r\n        fontWeight: 700,\r\n        lineHeight: '1.5rem',\r\n      },\r\n    },\r\n    MuiDialog: {\r\n      root: {},\r\n      paper: {\r\n        //width: '100%',\r\n        borderRadius: '12px',\r\n        '.coverRoot &': {\r\n          margin: '0px 4px',\r\n          overflowY: 'hidden',\r\n          borderRadius: '12px 12px 0px 0px',\r\n        },\r\n      },\r\n      paperWidthXs: {\r\n        maxWidth: '480px',\r\n      },\r\n      scrollPaper: {\r\n        '.coverRoot &': {\r\n          justifyContent: 'flex-end',\r\n          alignItems: 'flex-end',\r\n        },\r\n      },\r\n      paperWidthFalse: {\r\n        '.coverRoot &': {\r\n          maxWidth: COVER_WIDTH,\r\n          width: '100%',\r\n        },\r\n      },\r\n      paperScrollPaper: {\r\n        '.coverRoot &': {\r\n          maxHeight: 'calc(100% - 50px)',\r\n          // height: '100vh',\r\n        },\r\n      },\r\n      paperFullWidth: {\r\n        '.coverRoot &': {\r\n          width: '100%',\r\n        },\r\n      },\r\n    },\r\n    MuiBackdrop: {\r\n      root: {\r\n        '&.sidePanelBackdrop': {\r\n          zIndex: 1201,\r\n        },\r\n      },\r\n    },\r\n    MuiAlert: {\r\n      root: {\r\n        padding: '0px 12px',\r\n        '&.showMore': {\r\n          alignItems: 'center',\r\n        },\r\n      },\r\n      action: {\r\n        flexDirection: 'column',\r\n        justifyContent: 'space-between',\r\n      },\r\n    },\r\n    MuiMenu: {\r\n      paper: {\r\n        '.hoverChildMenu &': {\r\n          boxShadow: box_shadow_m,\r\n          background: bookitColors.base.white,\r\n          borderRadius: '8px',\r\n        },\r\n      },\r\n      list: {\r\n        '.hoverChildMenu &': {\r\n          display: 'flex',\r\n          padding: '8px 0px 12px 0px',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          '& .menuItemName': {\r\n            display: 'flex',\r\n            padding: '4px 12px 8px 16px',\r\n            alignItems: 'flex-start',\r\n            gap: '10px',\r\n            alignSelf: 'stretch',\r\n            cursor: 'unset',\r\n            color: bookitColors.grayscale.blackRegular,\r\n            '&:hover': {\r\n              background: 'inherit',\r\n            },\r\n          },\r\n          '& .menuItem': {\r\n            display: 'flex',\r\n            width: '240px',\r\n            height: '32px',\r\n            padding: '0px 8px',\r\n            alignItems: 'center',\r\n            gap: '8px',\r\n            '& .menuItemContent': {\r\n              display: 'flex',\r\n              paddingLeft: '8px',\r\n              alignItems: 'center',\r\n              gap: '8px',\r\n              flex: '1 0 0',\r\n              '& .menuItemIcon': {\r\n                display: 'flex',\r\n                alignItems: 'flex-start',\r\n                gap: '7.5px',\r\n                width: 'auto',\r\n                height: 16,\r\n                color: bookitColors.grayscale.grayComponents,\r\n                '& > svg': {\r\n                  width: '16px',\r\n                },\r\n              },\r\n              '& .menuItemText': {\r\n                flex: '1 0 0',\r\n                color: bookitColors.grayscale.blackRegular,\r\n                ...bookitTypography.bodyS,\r\n                cursor: 'pointer',\r\n                whiteSpace: 'initial',\r\n              },\r\n            },\r\n            '&:hover, &:focus': {\r\n              background: bookitColors.primary.bgHover,\r\n              '& .menuItemContent': {\r\n                '& .menuItemText': {\r\n                  ...bookitTypography.bodyS,\r\n                },\r\n              },\r\n            },\r\n            '&:active': {\r\n              background: bookitColors.primary.bgHover,\r\n              '& .menuItemContent': {\r\n                '& .menuItemText': {\r\n                  ...bookitTypography.bodyS,\r\n                },\r\n              },\r\n            },\r\n            '&.Mui-selected': {\r\n              background: bookitColors.primary.bgHover,\r\n              '& .menuItemContent': {\r\n                '& .menuItemText': {\r\n                  ...bookitTypography.bodyS,\r\n                  fontWeight: 600,\r\n                },\r\n              },\r\n            },\r\n          },\r\n        },\r\n      },\r\n    },\r\n    MuiMenuItem: {\r\n      root: {\r\n        gap: 12,\r\n      },\r\n      dense: {\r\n        paddingTop: '2px',\r\n        paddingBottom: '2px',\r\n      },\r\n    },\r\n    MuiPickersDatePickerRoot: {\r\n      toolbar: {\r\n        alignItems: 'flex-start',\r\n        flexDirection: 'column',\r\n        gap: '8px',\r\n      },\r\n      toolbarLandscape: {\r\n        padding: 16,\r\n      },\r\n      dateLandscape: {\r\n        marginRight: 16,\r\n      },\r\n    },\r\n    MuiPickerDTToolbar: {\r\n      toolbar: {\r\n        paddingLeft: 16,\r\n        paddingRight: 16,\r\n        justifyContent: 'space-around',\r\n      },\r\n      separator: {\r\n        margin: '0 4px 0 2px',\r\n        cursor: 'default',\r\n        ...buttonM,\r\n      },\r\n    },\r\n    MuiDrawer: {\r\n      root: {\r\n        '&.sideBarDrawer': {\r\n          gap: 8,\r\n          width: DRAWER_WIDTH,\r\n          flexShrink: 0,\r\n          whiteSpace: 'nowrap',\r\n          backgroundColor: bookitColors.base.white,\r\n          zIndex: 1200,\r\n          '&.sideBarMobile': {\r\n            width: 'calc(100% - 48px)', //DRAWER_MOBILE_WIDTH,\r\n          },\r\n          '&.drawerOpen': {\r\n            width: DRAWER_WIDTH,\r\n            transition: transitions.create('width', {\r\n              easing: transitions.easing.sharp,\r\n              duration: transitions.duration.enteringScreen,\r\n            }),\r\n            '&.sideBarMobile': {\r\n              width: 'calc(100% - 48px)', //DRAWER_MOBILE_WIDTH,\r\n            },\r\n          },\r\n          '&.drawerClose': {\r\n            transition: transitions.create('width', {\r\n              easing: transitions.easing.sharp,\r\n              duration: transitions.duration.leavingScreen,\r\n            }),\r\n            overflowX: 'hidden',\r\n            width: 0,\r\n            [breakpoints.up('sm')]: {\r\n              width: '60px',\r\n            },\r\n          },\r\n        },\r\n      },\r\n      paper: {\r\n        '.sideBarDrawer &': {\r\n          background: bookitColors.base.white,\r\n          position: 'fixed',\r\n          whiteSpace: 'nowrap',\r\n          width: DRAWER_WIDTH,\r\n          transition: transitions.create('width', {\r\n            easing: transitions.easing.sharp,\r\n            duration: transitions.duration.enteringScreen,\r\n          }),\r\n          gap: '16px',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          paddingTop: '12px',\r\n          '& .sideBarHeader': {\r\n            // minHeight: '48px',\r\n            // display: 'flex',\r\n            // flexDirection: 'row',\r\n            // justifyContent: 'space-between',\r\n            // alignItems: 'center',\r\n            // padding: props => (props.isOpen ? '0px 16px' : '0px 8px'),\r\n            // gap: 16,\r\n            display: 'flex',\r\n            padding: '0px 8px 0px 16px',\r\n            justifyContent: 'space-between',\r\n            alignItems: 'center',\r\n            alignSelf: 'stretch',\r\n            height: '32px',\r\n            '&.sideBarHeaderMobile': {},\r\n            '& .headerButtons': {\r\n              display: 'flex',\r\n              alignItems: 'center',\r\n            },\r\n            '& .headerButtonsMobile': {\r\n              gap: '4px',\r\n            },\r\n          },\r\n          '& .sideBarQickAction': {\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            alignItems: 'flex-start',\r\n            alignSelf: 'stretch',\r\n            padding: '0px 16px',\r\n            gap: '10px',\r\n            '&.sideBarQickActionMobile': {\r\n              padding: '16px 16px 8px 16px',\r\n              gap: '12px',\r\n            },\r\n          },\r\n        },\r\n        '.sideBarDrawer.sideBarMobile &': {\r\n          width: 'calc(100% - 48px)', // DRAWER_MOBILE_WIDTH,\r\n          gap: 0,\r\n        },\r\n        '.sideBarDrawer.drawerClose &': {\r\n          overflowX: 'hidden',\r\n          transition: transitions.create('width', {\r\n            easing: transitions.easing.sharp,\r\n            duration: transitions.duration.leavingScreen,\r\n          }),\r\n          width: '60px',\r\n          '& .sideBarHeader': {\r\n            padding: '0px 8px',\r\n          },\r\n          '& .sideBarQickAction': {\r\n            justifyContent: 'center',\r\n            alignItems: 'center',\r\n          },\r\n          // [breakpoints.up('sm')]: {\r\n          //   width: 7 * 8 + 1,\r\n          // },\r\n        },\r\n      },\r\n      paperAnchorDockedLeft: {\r\n        '.sideBarDrawer &': {\r\n          border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n        },\r\n      },\r\n    },\r\n    // MuiPickerDTTabs: {\r\n    //   tabs: {\r\n    //     color: theme.palette.getContrastText(tabsBackground),\r\n    //     backgroundColor: tabsBackground,\r\n    // },\r\n    // },\r\n    MuiPickersToolbar: {\r\n      toolbar: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        justifyContent: 'center',\r\n        height: 100,\r\n        backgroundColor: bookitColors.primary.regular,\r\n        // theme.palette.type === 'light'\r\n        //   ? theme.palette.primary.main\r\n        //   : theme.palette.background.default,\r\n      },\r\n      toolbarLandscape: {\r\n        height: 'auto',\r\n        maxWidth: 150,\r\n        padding: 8,\r\n        justifyContent: 'flex-start',\r\n      },\r\n    },\r\n    MuiPickersToolbarButton: {\r\n      toolbarBtn: {\r\n        padding: 0,\r\n        minWidth: '32px',\r\n        textTransform: 'none',\r\n      },\r\n    },\r\n    MuiPickersToolbarText: {\r\n      toolbarTxt: {\r\n        color: fade(bookitColors.base.white, 0.54),\r\n        ...buttonM,\r\n      },\r\n      toolbarBtnSelected: {\r\n        color: bookitColors.base.white,\r\n        // color: theme.palette.type === 'light'\r\n        // ? theme.palette.primary.contrastText\r\n        // : theme.palette.getContrastText(theme.palette.background.default);,\r\n      },\r\n    },\r\n    MuiAutocomplete: {\r\n      inputRoot: {\r\n        flexWrap: 'wrap',\r\n        '.atable &': {\r\n          flexWrap: 'nowrap',\r\n        },\r\n        '& $input': {\r\n          width: 'auto',\r\n          minWidth: 56,\r\n        },\r\n        '.date-dropdown-picker-inputs &': {\r\n          '& $input': {\r\n            width: '100%',\r\n            minWidth: 30,\r\n          },\r\n        },\r\n      },\r\n    },\r\n    MuiTabs: {\r\n      root: {\r\n        minHeight: '40px',\r\n        '&.sizeSmall': {\r\n          minHeight: '32px',\r\n        },\r\n      },\r\n      flexContainer: {\r\n        '.tabsHorizontal &': {\r\n          gap: 24,\r\n        },\r\n        '.sizeSmall &': {\r\n          '.tabsHorizontal &': {\r\n            gap: 20,\r\n          },\r\n        },\r\n      },\r\n      scrollable: {},\r\n      indicator: {\r\n        display: 'flex',\r\n        justifyContent: 'flex-start',\r\n        backgroundColor: bookitColors.primary.regular,\r\n        // '& > span': {\r\n        //   maxWidth: 40,\r\n        //   width: '100%',\r\n        //   backgroundColor: '#635ee7',\r\n        // },\r\n      },\r\n    },\r\n    MuiTab: {\r\n      root: {\r\n        textTransform: 'none',\r\n        ...bookitTypography.boldM,\r\n        '.tabsHorizontal &': {\r\n          padding: '8px 0px 0px',\r\n          minHeight: '40px',\r\n          alignItems: 'flex-start',\r\n          gap: '4px',\r\n          '&.tabSizeSmall': {\r\n            minHeight: '32px',\r\n            padding: '4px 0px 0px',\r\n            ...bookitTypography.boldS,\r\n          },\r\n          [breakpoints.up('sm')]: {\r\n            minWidth: 'auto',\r\n          },\r\n        },\r\n      },\r\n      wrapper: {\r\n        display: 'inline-flex',\r\n        alignItems: 'center',\r\n        justifyContent: 'center',\r\n        width: '100%',\r\n        flexDirection: 'column',\r\n        '.startIcon &': {\r\n          flexDirection: 'row',\r\n          gap: '8px',\r\n        },\r\n        '.endIcon &': {\r\n          flexDirection: 'row',\r\n          gap: '8px',\r\n        },\r\n      },\r\n      textColorInherit: {\r\n        color: bookitColors.grayscale.graySubtitles,\r\n        opacity: 1,\r\n        '&$selected': {\r\n          color: bookitColors.grayscale.blackRegular,\r\n        },\r\n        '&$disabled': {\r\n          color: bookitColors.grayscale.grayComponentsLight,\r\n        },\r\n      },\r\n    },\r\n    MuiTooltip: {\r\n      tooltip: {\r\n        display: 'flex',\r\n        padding: 12,\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        color: bookitColors.base.white,\r\n        backgroundColor: bookitColors.overlays.overlayBlack,\r\n        flex: '1 0 0',\r\n        ...bookitTypography.bodyS,\r\n        '.colorDark &': {\r\n          color: bookitColors.base.white,\r\n          backgroundColor: bookitColors.overlays.overlayBlack,\r\n        },\r\n        '.colorLight &': {\r\n          color: bookitColors.base.black,\r\n          backgroundColor: bookitColors.base.white,\r\n          boxShadow: box_shadow_s,\r\n        },\r\n        '& .content': {\r\n          maxHeight: 360,\r\n          overflowY: 'auto',\r\n          '&::-webkit-scrollbar': {\r\n            width: '6px',\r\n          },\r\n          '&::-webkit-scrollbar-thumb': {\r\n            boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n            borderRadius: '6px',\r\n            backgroundColor: bookitColors.grayscale.grayBorders,\r\n            '.colorDark &': {\r\n              backgroundColor: bookitColors.overlays.overlayBlack,\r\n            },\r\n          },\r\n        },\r\n      },\r\n      arrow: {\r\n        color: bookitColors.overlays.overlayBlack,\r\n        '.colorDark &': {\r\n          color: bookitColors.overlays.overlayBlack,\r\n        },\r\n        '.colorLight &': {\r\n          color: bookitColors.base.white,\r\n          '&::before': {\r\n            border: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n          },\r\n        },\r\n      },\r\n    },\r\n  },\r\n};\r\nexport const darkTheme: ThemeOptions = {\r\n  palette: {\r\n    background: { default: grey[400], paper: grey[100] },\r\n    primary: { main: green[100] },\r\n    secondary: {\r\n      main: '#4a4a4a',\r\n    },\r\n    text: {\r\n      primary: '#e1dada',\r\n      secondary: 'rgba(255, 255, 255, 0.54)',\r\n      disabled: '#757575',\r\n    },\r\n  },\r\n};\r\nexport const animalsThemeSettings: ThemeOptions = {\r\n  palette: {\r\n    primary: {\r\n      main: '#ffdc64',\r\n      dark: '#c9ab33',\r\n      light: '#ffff95',\r\n      contrastText: '#000000',\r\n    },\r\n    secondary: {\r\n      main: '#3247e1',\r\n      dark: '#001fae',\r\n      light: '#7673ff',\r\n      contrastText: '#ffffff',\r\n    },\r\n    error: {\r\n      main: '#E53F58',\r\n      dark: '#AC2F42',\r\n      light: '#F195A3',\r\n      contrastText: '#ffffff',\r\n    },\r\n    background: {\r\n      default: '#F3F3F3',\r\n      paper: '#FFF',\r\n    },\r\n    default: {\r\n      main: '#ffdc64',\r\n      dark: '#c9ab33',\r\n      light: '#ffff95',\r\n      contrastText: '#000000',\r\n    },\r\n  },\r\n  shape: {\r\n    borderRadius: 12,\r\n  },\r\n\r\n  typography: {\r\n    fontFamily: [\"'Open Sans Hebrew'\", 'system-ui'].join(','),\r\n    h1: {\r\n      //styleName: Bkt/Header 1;\r\n      fontSize: '2.5rem',\r\n      fontWeight: 700,\r\n      lineHeight: '3rem',\r\n    },\r\n    h2: {\r\n      //styleName: Bkt/Header 2;\r\n      fontSize: '2rem',\r\n      fontWeight: 700,\r\n      lineHeight: '2.875rem', //46/16\r\n    },\r\n    h3: {\r\n      //styleName: Bkt/Header 3;\r\n      fontSize: '1.5rem',\r\n      fontWeight: 700,\r\n      lineHeight: '2.375rem', //46/16\r\n    },\r\n    h4: {\r\n      //styleName: Bkt/Header 4:\r\n      fontSize: '1.5rem',\r\n      fontWeight: 700,\r\n      lineHeight: '2rem',\r\n    },\r\n    h5: {\r\n      fontSize: '1.25rem',\r\n      fontWeight: 700,\r\n      lineHeight: '1.5rem',\r\n    },\r\n    h6: {\r\n      fontSize: '1rem',\r\n      fontWeight: 700,\r\n      lineHeight: '1.375rem',\r\n    },\r\n    subtitle1: {\r\n      fontSize: '1.25rem',\r\n      lineHeight: '2rem',\r\n      fontWeight: 700,\r\n    },\r\n    subtitle2: {\r\n      fontSize: '1.25rem',\r\n      lineHeight: '2rem',\r\n      fontWeight: 400,\r\n    },\r\n    body1: {\r\n      fontSize: '1rem',\r\n      lineHeight: '1.375rem',\r\n      fontWeight: 400,\r\n    },\r\n    body2: {\r\n      fontSize: '1rem',\r\n      lineHeight: '1.375rem',\r\n      fontWeight: 400,\r\n      //color: grey[600],\r\n    },\r\n  },\r\n  overrides: {\r\n    MuiTextField: {},\r\n    MuiAppBar: {},\r\n  },\r\n};\r\n\r\nexport const CreateTheme = (direction, baseTheme: BaseTheme) =>\r\n  createMuiTheme(getBaseTheme(baseTheme), { direction: direction }); //DefaultThemeSettings\r\n\r\nconst getBaseTheme = (type: BaseTheme) => {\r\n  switch (type) {\r\n    case 'bookit':\r\n      return BookitThemeSettings;\r\n    case 'animals':\r\n      return animalsThemeSettings;\r\n    case 'dark':\r\n      return darkTheme;\r\n    case 'default':\r\n    default:\r\n      return DefaultThemeSettings;\r\n  }\r\n};\r\n","/**\r\n *\r\n * BuildingPickerFilter\r\n *\r\n */\r\nimport { BuildingPicker } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const BuildingPickerFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <BuildingPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n      urlType={props.urlType}\r\n      withoutServiceGroups={props.withoutServiceGroups}\r\n    />\r\n  );\r\n};\r\n","import { AxiosError } from 'axios';\r\nimport { IModelState } from 'types/Modelstate';\r\n\r\nexport function handleBadRequest(err: any): string[] | undefined {\r\n  if (\r\n    err.isAxiosError === true &&\r\n    err.response &&\r\n    err.response.status === 400 &&\r\n    err.response.data &&\r\n    err.response.data.ModelState\r\n  ) {\r\n    const ms = err.response.data.ModelState as IModelState;\r\n    const messages = Object.keys(ms)\r\n      .map(key => ms[key])\r\n      .flat();\r\n    return messages;\r\n  }\r\n}\r\n\r\n/**\r\n * Extracts ModelState errors from odata responses\r\n * @param error http error\r\n * @returns\r\n */\r\nexport const getModelStateErrors = (\r\n  error: unknown,\r\n): Record<string, Array<string>> | undefined => {\r\n  const axiosError = error as AxiosError;\r\n  const isAxiosError = axiosError.isAxiosError === true;\r\n  if (!isAxiosError) {\r\n    return undefined;\r\n  }\r\n  const message = axiosError.response?.data?.error?.innererror\r\n    ?.message as string;\r\n  if (message === undefined) {\r\n    return axiosError.response?.data?.error?.message;\r\n  }\r\n  return message?.split('\\r\\n').reduce((accumulator, currentValue) => {\r\n    const separator = currentValue.indexOf(':');\r\n    const key = currentValue.substring(0, separator).trim();\r\n    if (key.length > 0) {\r\n      const message = currentValue.substring(separator + 1).trim();\r\n      if (accumulator[key] === undefined) {\r\n        accumulator[key] = [];\r\n      }\r\n      accumulator[key].push(message);\r\n    }\r\n    return accumulator;\r\n  }, {});\r\n};\r\n\r\nexport function extractErrorMessages(error: unknown): string[] | undefined {\r\n  if ((error as AxiosError).isAxiosError === true) {\r\n    const response = (error as AxiosError).response;\r\n    if (response?.data?.error?.message !== undefined) {\r\n      return [response?.data?.error?.message];\r\n    }\r\n    if (response === undefined) {\r\n      return [String(error)];\r\n    }\r\n    const status = (error as AxiosError)?.response?.status;\r\n    switch (status) {\r\n      case 400:\r\n        return handleBadRequest(error);\r\n      case 403:\r\n        return ['NotAllowed'];\r\n      default:\r\n        return [String(error)];\r\n    }\r\n  } else if (typeof error === 'string') {\r\n    return [error];\r\n  } else if (error instanceof Error) {\r\n    return [error.message];\r\n  } else {\r\n    return [String(error)];\r\n  }\r\n}\r\n","/**\r\n *\r\n * LocationPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface LocationPickerProps\r\n  extends Omit<AutocompletePickerProps<ILocationListDto>, 'loadData'> {\r\n  withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/LocationList';\r\nexport const initLocationData = (\r\n  initval: string | undefined,\r\n): Promise<ILocationListDto[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<ILocationListDto[]>((resolve, reject) => {\r\n      resolve([] as ILocationListDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        'Id,Name,LocationTypeId,LocationType,RoomId,RoomName,SubLocationListCount,ServiceGroups',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as ILocationListDto[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<ILocationListDto>)[] | undefined,\r\n  globalServiceGroupFilter?: Entity<number>[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<ILocationListDto>({\r\n    url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'LocationType',\r\n      'LocationTypeId',\r\n      'RoomId',\r\n      'RoomName',\r\n      'SubLocationListCount',\r\n      'ServiceGroups',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      globalServiceGroupFilter?.map(\r\n        serviceGroup =>\r\n          new Condition<ILocationListDto>(\r\n            'ServiceGroups',\r\n            ODataOperators.AnyIn,\r\n            serviceGroup.Id,\r\n            'Id',\r\n          ),\r\n      ) ?? [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\nexport function LocationPicker(props: LocationPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    !props.withoutServiceGroups\r\n      ? globalServiceGroupFilter || undefined\r\n      : undefined,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'locationId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * ServiceGroupsPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\nimport { GroupUrl } from '../../ServiceGroupPicker';\r\nimport { splitFilterValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsAuthenticated } from 'app/slice/selectors';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\n\r\nexport interface ServiceGroupsPickerProps\r\n  extends Omit<AutocompleteMultiPickerExProps<IServiceGroupDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  selectArray?: Array<keyof IServiceGroupDto>;\r\n  urlType?: GroupUrl;\r\n  separator?: string;\r\n  useSearchOrPredicate?: boolean;\r\n}\r\nconst url = '/api/odata/v4/servicegroups';\r\nconst adminUrl = '/api/odata/v4/servicegroups/GetAdminServiceGroups';\r\nconst publicUrl = '/api/odata/v4/servicegroups/GetPublicServiceGroups';\r\nconst regPublicUrl = '/api/odata/v4/servicegroups/GetRegistrationServiceGroups';\r\n\r\nexport const initServiceGroupsMultiData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: GroupUrl,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IServiceGroupDto[]>((resolve, reject) => {\r\n      resolve([] as IServiceGroupDto[]);\r\n    });\r\n  } else {\r\n    let ids = splitFilterValue(initval).map(item => {\r\n      return { Id: parseInt(item) };\r\n    }) as Identifiable<number>[];\r\n    let filters: string | undefined = undefined;\r\n    if (ids.length > 0) {\r\n      const predicates: (string | Condition<IServiceGroupDto>)[] = [];\r\n      predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n      filters = predicates.map(f => f.toString()).join(' and ');\r\n    }\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: filters,\r\n      $select: 'Id,Name,DivisionId,DivisionName',\r\n    };\r\n    let initUrl =\r\n      sourceUrl === undefined\r\n        ? url\r\n        : sourceUrl === 'public'\r\n        ? publicUrl\r\n        : sourceUrl === 'regpublic'\r\n        ? regPublicUrl\r\n        : sourceUrl === 'admin'\r\n        ? adminUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IServiceGroupDto[]);\r\n  }\r\n};\r\n\r\nexport const initFiltersServiceGroupsData = (filter: string | undefined) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: filter,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IServiceGroupDto>)[] | undefined,\r\n  isAuthenticated?: boolean,\r\n  urlType?: GroupUrl,\r\n  useSearchOrPredicate?: boolean,\r\n) => {\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicUrl\r\n      : urlType === 'regpublic'\r\n      ? regPublicUrl\r\n      : urlType === 'admin'\r\n      ? adminUrl\r\n      : url;\r\n  let filters: (string | Condition<IServiceGroupDto>)[] = [];\r\n  if (sourceUrl === url) {\r\n    if (!!predicates && predicates.length > 0) {\r\n      filters = [...predicates, ...['Active eq true']];\r\n    } else {\r\n      filters = ['Active eq true'];\r\n    }\r\n  }\r\n\r\n  return getAutoCompleteLoadDataFn<IServiceGroupDto>({\r\n    url: sourceUrl,\r\n    predicates: filters,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'DivisionId', 'DivisionName'],\r\n    useSearchOrPredicate: useSearchOrPredicate,\r\n  });\r\n};\r\nexport const ServiceGroupByDivisionsFilter = (value: FilterValueType) => {\r\n  if (value !== undefined && value !== null && Array.isArray(value)) {\r\n    return [\r\n      `${new Condition<IServiceGroupDto>(\r\n        'DivisionId',\r\n        ODataOperators.Includes,\r\n        (value as Identifiable<number>[]).map(f => f.Id),\r\n      ).toString()}`,\r\n    ];\r\n  }\r\n  return [];\r\n};\r\nexport function ServiceGroupsPicker(props: ServiceGroupsPickerProps) {\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const { predicates, urlType, useSearchOrPredicate, ...other } = props;\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    isAuth,\r\n    urlType,\r\n    useSearchOrPredicate,\r\n  );\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      ariaLabel=\"Service Group search\"\r\n      id={props.id || 'servicegroupsid'}\r\n      loadData={innerLoadData}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useEffectOnMount } from './useEffectOnMount';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport const useGlobalServiceGroupsFilter = (\r\n  applyGlobalServiceGroupsFilter: boolean,\r\n) => {\r\n  const dispatch = useDispatch();\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const gloabalSettings = useSelector(selectglobalSettings);\r\n  const { actions } = useAppSettingsSlice();\r\n  useEffectOnMount(() => {\r\n    dispatch(\r\n      actions.showGlobalServiceGroupFilter(\r\n        !gloabalSettings.GetBooleanByKey(\r\n          AllowedSettings.HideTopServiceGroupFilter,\r\n        ) && applyGlobalServiceGroupsFilter,\r\n      ),\r\n    );\r\n  });\r\n  const serviceGroups = React.useMemo(() => {\r\n    return applyGlobalServiceGroupsFilter ? selectedServiceGroups || [] : [];\r\n  }, [applyGlobalServiceGroupsFilter, selectedServiceGroups]);\r\n  return { serviceGroups };\r\n};\r\n","import { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { IAssetRelated } from 'types/IAssetRelated';\r\n\r\n/**\r\n * Renders an Asset Link (Popup/sidepanel)\r\n * Requires for the AssetId property to be present on the row, otherwise the value is rendered without the link\r\n * @param param0\r\n * @returns\r\n */\r\nconst AssetRenderer: Renderer<CellProps<IAssetRelated>> = ({\r\n  row: { original },\r\n  value,\r\n}) =>\r\n  !!original.AssetId ? (\r\n    <AssetLink id={original.AssetId}>{value}</AssetLink>\r\n  ) : (\r\n    <>{value}</>\r\n  );\r\nexport default AssetRenderer;\r\n","/**\r\n *\r\n * ButtonConfirm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\n\r\nexport interface ButtonConfirmProps extends Omit<ButtonProps, 'onClick'> {\r\n  onClick: React.MouseEventHandler<HTMLButtonElement>;\r\n  confirmationDialogTitle?: string;\r\n  confirmationDialogBody?: string;\r\n  disabled?: boolean;\r\n}\r\n\r\n/**\r\n * Button with a confirmation dialog\r\n * @param param0 primary click handler\r\n * @returns\r\n */\r\nexport function ButtonConfirm({\r\n  onClick,\r\n  confirmationDialogTitle,\r\n  confirmationDialogBody,\r\n  ...props\r\n}: ButtonConfirmProps) {\r\n  const { t } = useTranslation();\r\n  const [open, setOpen] = React.useState(false);\r\n  const title = confirmationDialogTitle ?? t(translations.Confirm);\r\n  const body = confirmationDialogBody ?? t(translations.AreYouSure);\r\n  const handleConfirmClick = e => {\r\n    setOpen(false);\r\n    onClick(e);\r\n  };\r\n  return (\r\n    <>\r\n      <Button {...props} onClick={() => setOpen(true)} />\r\n      <DialogConfirm\r\n        isOpen={open}\r\n        title={title}\r\n        body={body}\r\n        onCancel={() => setOpen(false)}\r\n        onConfirm={handleConfirmClick}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReactNode } from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { InvoiceDetails } from '..';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface InvoiceDetailsSidePanelProps extends SidePanelContentProps {\r\n  id: number;\r\n}\r\n\r\nexport const InvoiceDetailsSidePanel = (\r\n  props: InvoiceDetailsSidePanelProps,\r\n) => {\r\n  return <InvoiceDetails id={props.id} useSidePanel={true} />;\r\n};\r\n\r\nexport const InvoiceDetailsSidePanelLink = ({\r\n  children,\r\n  ...props\r\n}: InvoiceDetailsSidePanelProps & { children: ReactNode }) => {\r\n  const { t } = useTranslation();\r\n  const { openPanel } = useSidePanelState();\r\n  const isMobile = DetectIsMobile();\r\n\r\n  const onClick = () => {\r\n    openPanel({\r\n      renderPageType: RenderPageType.InvoiceDetails,\r\n      renderPageProps: props,\r\n      expanded: !isMobile && !props.useSidePanel,\r\n      useSidePanel: props.useSidePanel,\r\n      isCover: props.useSidePanel,\r\n    } as SidePanelOpenState);\r\n  };\r\n  return (\r\n    <Tooltip title={t(translations.InvoiceDetails) as string} arrow>\r\n      <Link onClick={onClick}>{children}</Link>\r\n    </Tooltip>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { getIn } from 'formik';\r\nimport { useContext, createContext, ReactNode } from 'react';\r\n\r\ninterface IRequiredFields {\r\n  requiredFields: Record<string, boolean> | undefined;\r\n}\r\nconst RequiredFieldsContext: React.Context<IRequiredFields> = createContext<\r\n  IRequiredFields\r\n>({\r\n  requiredFields: undefined,\r\n});\r\n/**\r\n * Usage example:\r\n *      <Formik\r\n *        validationSchema={schema}\r\n *        ...>\r\n *            <ValidationSchemaProvider schema={schema}>\r\n *                Form fields/form content\r\n *            </ValidationSchemaProvider>\r\n *        </Formik>\r\n * @param props Yup schema + children\r\n * @returns Validation schema provider\r\n */\r\nexport const ValidationSchemaProvider = (props: {\r\n  schema: any;\r\n  children: ReactNode;\r\n  skipValidation?: boolean;\r\n}) => {\r\n  const { schema, children, skipValidation } = props;\r\n\r\n  const requiredFields = {} as Record<string, boolean>;\r\n  const fields = schema.describe().fields;\r\n  for (const key in fields) {\r\n    if (fields.hasOwnProperty(key)) {\r\n      const fieldValidationSchema = fields ? getIn(fields, key) : false;\r\n      const tests =\r\n        fieldValidationSchema && !skipValidation\r\n          ? fieldValidationSchema.tests\r\n          : false;\r\n      requiredFields[key] = tests\r\n        ? !!tests.find(test => test.name === 'required')\r\n        : false;\r\n    }\r\n  }\r\n\r\n  return (\r\n    <RequiredFieldsContext.Provider value={{ requiredFields }}>\r\n      {children}\r\n    </RequiredFieldsContext.Provider>\r\n  );\r\n};\r\n/**\r\n * Provides access to required setting of a field in Formik+Yup form\r\n * Usage example:\r\n *  const isRequired = useIsRequired('email');\r\n *  <FormControl required={isRequried} ...\r\n * @param name form element name\r\n * @returns true if field is required\r\n */\r\nexport const useIsRequired = (name: string) => {\r\n  const { requiredFields } = useContext(RequiredFieldsContext);\r\n  return requiredFields?.[name];\r\n};\r\nexport const useRequiredFields = () => {\r\n  const { requiredFields } = useContext(RequiredFieldsContext);\r\n\r\n  return {\r\n    requiredFields,\r\n  };\r\n};\r\n","import { TFunction } from 'i18next';\r\nimport { Entity } from 'types/common';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nexport enum RUN_TYPES {\r\n  StandardRun = 'RUN_TYPEStandardRun',\r\n  MassSpec = 'RUN_TYPEMassSpec',\r\n  Labeling = 'RUN_TYPELabeling',\r\n  Fractioning = 'RUN_TYPEFractioning',\r\n}\r\nexport type RunTypesUnion = keyof typeof RUN_TYPES;\r\nexport function getRunTypeOptions(t: TFunction) {\r\n  return Object.entries(RUN_TYPES).map(([key, value], index) => ({\r\n    Id: key as RunTypesUnion,\r\n    Name: t(value),\r\n  }));\r\n}\r\nexport function getRunTypeValue(t: TFunction, runtype?: RunTypesUnion) {\r\n  if (runtype === undefined) {\r\n    return undefined;\r\n  }\r\n  return getRunTypeOptions(t).find(item => item.Id === runtype)?.Name;\r\n}\r\n\r\nexport interface RunTypesSelectOptions\r\n  extends Omit<AutocompletePickerProps<Entity<RunTypesUnion>>, 'loadData'> {}\r\n\r\nexport const getOptions = (t: TFunction) => {\r\n  return Object.entries(RUN_TYPES).map(([key, value], index) => ({\r\n    Id: key as RunTypesUnion,\r\n    Name: t(value),\r\n  }));\r\n};\r\nexport function RunTypePicker(props: RunTypesSelectOptions) {\r\n  const { t } = useTranslation();\r\n  const loadData = () => {\r\n    const options = getOptions(t);\r\n    return Promise.resolve<Entity<RunTypesUnion>[]>(options);\r\n  };\r\n  return <AutocompletePicker loadData={loadData} {...props} />;\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\nexport const BooleanRenderer: Renderer<CellProps<\r\n  Record<string, any>,\r\n  boolean | null\r\n>> = ({ value }) => {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      {value === true\r\n        ? t(translations.Yes)\r\n        : value === false\r\n        ? t(translations.No)\r\n        : t(translations.NA)}\r\n    </>\r\n  );\r\n};\r\nexport default BooleanRenderer;\r\n","export enum OnlineServiceType {\r\n  Software = 0,\r\n  Relay = 1,\r\n  IpRelay = 2,\r\n  UsageForm = 3,\r\n  DoorAccess = 4,\r\n  WebRelayTm = 5,\r\n  NiDAQmx = 7,\r\n  LoanDesk = 6,\r\n  Room = 10,\r\n  KmTronicRelay = 11,\r\n  WebRelayX600m = 12,\r\n  RaspberryPi = 13,\r\n}\r\n","/**\r\n *\r\n * FundingTypePicker\r\n *\r\n */\r\n\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { OnlineServiceType } from 'enums/OnlineServiceTypeEnum';\r\nimport { useSelector } from 'react-redux';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface OnlineServiceTypePickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSingleOnlineServiceType = (val: number): Entity<number> => {\r\n  return enumToEntityArray(OnlineServiceType).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\nexport const GetAvailableOnlineServiceTypes = (\r\n  items: Entity<number>[],\r\n  appSettings: AppSettings | null,\r\n  roomsEnabled: boolean,\r\n) => {\r\n  return items.filter(f => {\r\n    if (f.Id === OnlineServiceType.Software) {\r\n      return IsModuleEnabled(appSettings, KnownModules.LocalApp);\r\n    }\r\n    if (f.Id === OnlineServiceType.Relay) {\r\n      return IsModuleEnabled(appSettings, KnownModules.Relay);\r\n    }\r\n    if (f.Id === OnlineServiceType.IpRelay) {\r\n      return IsModuleEnabled(appSettings, KnownModules.IpRelay);\r\n    }\r\n    if (f.Id === OnlineServiceType.WebRelayTm) {\r\n      return IsModuleEnabled(appSettings, KnownModules.WebRelayTm);\r\n    }\r\n    if (f.Id === OnlineServiceType.WebRelayX600m) {\r\n      return IsModuleEnabled(appSettings, KnownModules.WebRelayX600m);\r\n    }\r\n    if (f.Id === OnlineServiceType.UsageForm) {\r\n      return IsModuleEnabled(appSettings, KnownModules.UsageForm);\r\n    }\r\n    if (f.Id === OnlineServiceType.LoanDesk) {\r\n      return IsModuleEnabled(appSettings, KnownModules.LoanDesk);\r\n    }\r\n    if (f.Id === OnlineServiceType.DoorAccess) {\r\n      return IsModuleEnabled(appSettings, KnownModules.DoorAccess);\r\n    }\r\n    if (f.Id === OnlineServiceType.Room) {\r\n      return roomsEnabled;\r\n    }\r\n    if (f.Id === OnlineServiceType.NiDAQmx) {\r\n      return IsModuleEnabled(appSettings, KnownModules.NiDAQmx);\r\n    }\r\n    if (f.Id === OnlineServiceType.KmTronicRelay) {\r\n      return IsModuleEnabled(appSettings, KnownModules.KmTronicRelay);\r\n    }\r\n    if (f.Id === OnlineServiceType.RaspberryPi) {\r\n      return IsModuleEnabled(appSettings, KnownModules.RaspberryPi);\r\n    }\r\n    return false;\r\n  });\r\n};\r\nexport const initOnlineServiceTypeData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        enumToEntityArray(OnlineServiceType).filter(item => {\r\n          return item.Id.toString() === initval;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\nexport const getOnlineServiceTypeAssetFilter = (\r\n  appSettings: AppSettings | null,\r\n  roomsEnabled: boolean,\r\n): string => {\r\n  const enabledTypes = GetAvailableOnlineServiceTypes(\r\n    enumToEntityArray(OnlineServiceType),\r\n    appSettings,\r\n    roomsEnabled,\r\n  );\r\n  let filter: string[] = [];\r\n  const enabledUsageTypes = enabledTypes.filter(\r\n    f =>\r\n      f.Id === OnlineServiceType.UsageForm ||\r\n      f.Id === OnlineServiceType.IpRelay ||\r\n      f.Id === OnlineServiceType.WebRelayTm ||\r\n      f.Id === OnlineServiceType.WebRelayX600m ||\r\n      f.Id === OnlineServiceType.NiDAQmx ||\r\n      f.Id === OnlineServiceType.Room ||\r\n      f.Id === OnlineServiceType.RaspberryPi,\r\n  );\r\n  const enabledRemoteTypes = enabledTypes.filter(\r\n    f =>\r\n      f.Id === OnlineServiceType.Relay || f.Id === OnlineServiceType.Software,\r\n  );\r\n  if (enabledUsageTypes.length > 0) {\r\n    filter.push(\r\n      `${new Condition(\r\n        'OperationTypeID',\r\n        ODataOperators.Includes,\r\n        enabledUsageTypes.map(f => f.Id),\r\n      ).toString()}`,\r\n    );\r\n  }\r\n  if (enabledRemoteTypes.length > 0) {\r\n    filter.push(\r\n      `(${new Condition(\r\n        'RemoteControlEnabled',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ).toString()} and ${new Condition(\r\n        'OperationTypeID',\r\n        ODataOperators.Includes,\r\n        enabledRemoteTypes.map(f => f.Id),\r\n      ).toString()})`,\r\n    );\r\n  }\r\n  return filter.length > 1\r\n    ? `(${filter.join(' or ')})`\r\n    : filter.length > 0\r\n    ? filter[0]\r\n    : '';\r\n};\r\nexport function OnlineServiceTypePicker(props: OnlineServiceTypePickerProps) {\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const roomsEnabled = settings.GetBoolean(\r\n    AllowedSettings[AllowedSettings.RoomUserRoleEnabled],\r\n  );\r\n  const getOptions = (searchTerm: string | null) => {\r\n    let items = GetAvailableOnlineServiceTypes(\r\n      enumToEntityArray(OnlineServiceType),\r\n      appSettings,\r\n      roomsEnabled,\r\n    );\r\n\r\n    if (searchTerm !== null && searchTerm !== '') {\r\n      return items.filter(\r\n        f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n      );\r\n    }\r\n    return items;\r\n  };\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RegionPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { IRegionDtoFilter } from 'app/pages/Regions/IRegionDto';\r\n\r\nexport type RegionUrl = 'base' | 'filter' | 'public';\r\n\r\nexport interface RegionPickerProps\r\n  extends Omit<AutocompletePickerProps<IRegionDtoFilter>, 'loadData'> {\r\n  urlType: RegionUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/regions';\r\nconst filterUrl = '/api/odata/v4/regions/RegionsFilter';\r\nconst publicUrl = '/api/odata/v4/regions/PublicRegionsFilter';\r\n\r\nexport const initRegionData = (\r\n  initval: string | undefined,\r\n  urlType: RegionUrl | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IRegionDtoFilter[]>((resolve, reject) => {\r\n      resolve([] as IRegionDtoFilter[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        urlType === 'base' || urlType === undefined\r\n          ? 'Id,Name,'\r\n          : 'Id,Name,ServiceGroups',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      urlType === undefined\r\n        ? url\r\n        : urlType === 'public'\r\n        ? publicUrl\r\n        : urlType === 'filter'\r\n        ? filterUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IRegionDtoFilter[]);\r\n  }\r\n};\r\n\r\nexport function RegionPicker(props: RegionPickerProps) {\r\n  const loadData = getAutoCompleteLoadDataFn<IRegionDtoFilter>({\r\n    url:\r\n      props.urlType === 'public'\r\n        ? publicUrl\r\n        : props.urlType === 'filter'\r\n        ? filterUrl\r\n        : url,\r\n    select:\r\n      props.urlType === 'base' || props.urlType === undefined\r\n        ? ['Id', 'Name']\r\n        : ['Id', 'Name', 'ServiceGroups'],\r\n    predicates: props.predicates,\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      id={props.id || 'regionId'}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nexport const regionFilterUrl = url;\r\n","import { useAppSettingsSlice } from 'app/slice';\r\nimport { useCallback } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport const useResponseModel = () => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const res = useCallback(\r\n    (result: IResponseType) => {\r\n      if (result.ErrorMessages.length > 0) {\r\n        dispatch(\r\n          actions.addNotifications(\r\n            result.ErrorMessages.map(e => {\r\n              return { variant: 'error', message: e };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (result.WarningMessages.length > 0) {\r\n        dispatch(\r\n          actions.addNotifications(\r\n            result.WarningMessages.map(e => {\r\n              return { variant: 'warning', message: e };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (result.SuccessMessages.length > 0) {\r\n        dispatch(\r\n          actions.addNotifications(\r\n            result.SuccessMessages.map(e => {\r\n              return { variant: 'success', message: e };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n    },\r\n    [dispatch, actions],\r\n  );\r\n  return res;\r\n};\r\n","import React, { ReactNode } from 'react';\r\nimport { AssetUser, IAsset } from '../IAsset';\r\nimport { AttributeValue } from '../IAssetRow';\r\nimport parse from 'html-react-parser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport styled from 'styled-components';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { List, ListItem, ListItemText, useTheme } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport clsx from 'clsx';\r\nimport { DemSize } from 'app/components/BasicCards';\r\n\r\nexport const DateRenderer = (\r\n  props: AttributeValue<IAsset>,\r\n): React.ReactNode => {\r\n  let date = props.value as Date;\r\n  return <>{dateUtils.shortDateFormat(date)}</>;\r\n};\r\nconst ShortText = styled('span')`\r\n  overflow: hidden;\r\n  text-overflow: ellipsis;\r\n  display: -webkit-box;\r\n  -webkit-line-clamp: 6;\r\n  -webkit-box-orient: vertical;\r\n  * {\r\n    margin: 0px;\r\n  }\r\n`;\r\nconst FullText = styled('span')`\r\n  * {\r\n    margin: 0px;\r\n  }\r\n`;\r\nexport const ImageGallery = styled('div')(({ theme }) => ({\r\n  '&.imageSlider': {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'flex-start',\r\n    width: '100%',\r\n    gap: 8,\r\n    height: 'auto',\r\n    alignSelf: 'stretch',\r\n    '& .imgSliderCenter': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      gap: 10,\r\n      alignSelf: 'stretch',\r\n      '& .cardImage': {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        height: '340px',\r\n        alignItems: 'flex-start',\r\n        alignSelf: 'stretch',\r\n        '&.cardImageMobile': {\r\n          height: '220px',\r\n        },\r\n        '& .frame': {\r\n          display: 'flex',\r\n          alignItems: 'flex-start',\r\n          gap: 10,\r\n          alignSelf: 'stretch',\r\n          flex: '1 0 0',\r\n          borderRadius: '4px',\r\n          '& .mediaStyle': {\r\n            imageRendering: '-webkit-optimize-contrast',\r\n            backgroundSize: 'auto',\r\n            width: '100%',\r\n            backgroundBlendMode: 'multiply',\r\n            minWidth: 'unset',\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            justifyContent: 'center',\r\n            alignItems: 'center',\r\n            gap: 15,\r\n            // '&.position_vertical': {\r\n            //   height: '100%',\r\n            //   width: '100%',\r\n            // },\r\n          },\r\n        },\r\n      },\r\n    },\r\n  },\r\n}));\r\nexport const HtmlRenderer = (props: AttributeValue<IAsset>): ReactNode => {\r\n  const { t } = useTranslation();\r\n  const [fullText, setFullText] = React.useState<boolean>(false);\r\n  const [needButton, setNeedButton] = React.useState<boolean>(false);\r\n  let html = props.value as string;\r\n  const text = parse(html);\r\n  const ref = React.useRef<HTMLDivElement>(null);\r\n  React.useEffect(() => {\r\n    if (ref.current !== null) {\r\n      if (\r\n        ref.current.clientHeight === ref.current.scrollHeight &&\r\n        ref.current.clientWidth === ref.current.scrollWidth\r\n      ) {\r\n        setNeedButton(false);\r\n      } else {\r\n        setNeedButton(true);\r\n      }\r\n    }\r\n  }, []);\r\n  return (\r\n    <>\r\n      <div>\r\n        {fullText ? (\r\n          <FullText>{text}</FullText>\r\n        ) : (\r\n          <ShortText ref={ref}>{text}</ShortText>\r\n        )}\r\n        {needButton && (\r\n          <div>\r\n            <Button\r\n              variant=\"text\"\r\n              size=\"small\"\r\n              onClick={() => setFullText(!fullText)}\r\n              endIcon={<Icon icon={fullText ? 'chevron-up' : 'chevron-down'} />}\r\n            >\r\n              {fullText ? t(translations.ShowLess) : t(translations.ShowMore)}\r\n            </Button>\r\n          </div>\r\n        )}\r\n      </div>\r\n    </>\r\n  );\r\n};\r\n\r\nexport function ArrayRenderer<T>(\r\n  callback: (value: T, original: IAsset | undefined) => ReactNode | undefined,\r\n) {\r\n  const mapper = (props: AttributeValue<IAsset>) => {\r\n    if (!!props.value && !!props.value.length) {\r\n      return (\r\n        // <ul style={{ margin: 0 }}>\r\n        //   {props.value.map(v => (\r\n        //     <li>{callback(v, props.original)}</li>\r\n        //   ))}\r\n        // </ul>\r\n        <List dense disablePadding key={`array_list_${props.original.Id}`}>\r\n          {props.value.map((v, indx) => (\r\n            <ListItem\r\n              dense\r\n              disableGutters\r\n              key={`array_listItem_${props.original.Id}_${indx}`}\r\n            >\r\n              <ListItemText\r\n                style={{ margin: 0 }}\r\n                key={`array_listItemText_${props.original.Id}_${indx}`}\r\n              >\r\n                {callback(v, props.original)}\r\n              </ListItemText>\r\n            </ListItem>\r\n          ))}\r\n        </List>\r\n      );\r\n    }\r\n  };\r\n  return mapper;\r\n}\r\nexport const AssetDetailsImageRender = (\r\n  props: AttributeValue<IAsset>,\r\n): ReactNode => {\r\n  const theme = useTheme();\r\n  const defaultImgSrc = process.env.PUBLIC_URL + `/images/400x300.png`;\r\n  const defaultImgMobileSrc = process.env.PUBLIC_URL + `/images/200x150.png`;\r\n  const defaultImg = React.useMemo(() => {\r\n    return props.shortView ? defaultImgMobileSrc : defaultImgSrc;\r\n  }, [defaultImgMobileSrc, defaultImgSrc, props.shortView]);\r\n\r\n  const [pathSrc, setPathSrc] = React.useState<string | undefined>(defaultImg);\r\n\r\n  const [loadingImg, setLoadingImg] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [imageDimensions, setImageDimensions] = React.useState<\r\n    DemSize | undefined\r\n  >(undefined);\r\n  const checkImage = React.useCallback(\r\n    async (path: any) =>\r\n      new Promise<{\r\n        path?: string;\r\n        status: string;\r\n        height: number;\r\n        width: number;\r\n      }>(resolve => {\r\n        const img = new Image();\r\n        img.src = props.value;\r\n        img.onload = () =>\r\n          resolve({ path, status: 'ok', height: img.height, width: img.width });\r\n        img.onerror = () =>\r\n          resolve({\r\n            path,\r\n            status: 'error',\r\n            height: props.shortView ? 150 : 300,\r\n            width: props.shortView ? 200 : 400,\r\n          });\r\n      }),\r\n    [props.shortView, props.value],\r\n  );\r\n  React.useEffect(() => {\r\n    let active = props.value !== undefined && loadingImg === undefined;\r\n    if (active) {\r\n      if (loadingImg) return;\r\n      setLoadingImg(true);\r\n      (async () => {\r\n        try {\r\n          const res = await checkImage(props.value);\r\n          if (res.status === 'ok') {\r\n            setPathSrc(res.path);\r\n            setImageDimensions({\r\n              height: res.height,\r\n              width: res.width,\r\n            });\r\n            setLoadingImg(false);\r\n          } else {\r\n            setPathSrc(defaultImg);\r\n            setImageDimensions({\r\n              height: res.height,\r\n              width: res.width,\r\n            });\r\n            setLoadingImg(false);\r\n          }\r\n        } catch {\r\n          setPathSrc(defaultImg);\r\n          setImageDimensions({\r\n            height: props.shortView ? 150 : 300,\r\n            width: props.shortView ? 200 : 400,\r\n          });\r\n          setLoadingImg(false);\r\n        }\r\n      })();\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [checkImage, defaultImg, loadingImg, props.shortView, props.value]);\r\n  const backgroundSize = React.useMemo(() => {\r\n    if (!!imageDimensions) {\r\n      let horizontal = imageDimensions.width - imageDimensions.height > 0;\r\n      if (\r\n        imageDimensions.height === imageDimensions.width ||\r\n        (horizontal && imageDimensions.width / 1.1 < imageDimensions.height) ||\r\n        (!horizontal && imageDimensions.height / 1.1 < imageDimensions.width)\r\n      ) {\r\n        return 'contain';\r\n      }\r\n      if (!horizontal) {\r\n        if (imageDimensions.height < (props.shortView ? 220 : 340) / 1.8) {\r\n          return 'contain';\r\n        } else {\r\n          return imageDimensions.height / imageDimensions.width > 1.8\r\n            ? 'cover'\r\n            : 'contain';\r\n        }\r\n      } else {\r\n        if (imageDimensions.width < (props.shortView ? 220 : 340) / 1.8) {\r\n          return 'contain';\r\n        } else {\r\n          return imageDimensions.width / imageDimensions.height < 1.8\r\n            ? 'cover'\r\n            : 'contain';\r\n        }\r\n      }\r\n    }\r\n    return undefined;\r\n  }, [imageDimensions, props.shortView]);\r\n  return !!pathSrc && loadingImg === false ? (\r\n    <ImageGallery className={'imageSlider'} theme={theme}>\r\n      <div className={'imgSliderCenter'}>\r\n        <div\r\n          className={clsx('cardImage', { cardImageMobile: props.shortView })}\r\n        >\r\n          <div className={'frame'}>\r\n            <div\r\n              className={'mediaStyle'}\r\n              style={{\r\n                backgroundImage: `url(${pathSrc})`,\r\n                backgroundSize: backgroundSize,\r\n                backgroundRepeat: 'no-repeat',\r\n                backgroundPosition: 'center',\r\n                paddingTop: props.shortView ? 220 : 340,\r\n              }}\r\n            ></div>\r\n            {/* <img\r\n              src={props.value}\r\n              alt=\"\"\r\n              // style={\r\n              //   (setting.GetNullableByKey(AllowedSettings.AssetImageSizeType) ??\r\n              //     '2') === '1' && !isMobile\r\n              //     ? { maxWidth: '400px', maxHeight: '300px' }\r\n              //     : { maxWidth: '200px', maxHeight: '150px' }\r\n              // }\r\n            /> */}\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </ImageGallery>\r\n  ) : (\r\n    <></>\r\n  );\r\n};\r\nexport function UsersRenderer() {\r\n  return ArrayRenderer<AssetUser>(v => (\r\n    <div style={{ display: 'flex', alignItems: 'center', gap: 8 }} key={v.Name}>\r\n      <BasicTypography component={'span'} variant={'bodyS'}>\r\n        {v.Name}\r\n      </BasicTypography>\r\n      {!!v.Email && (\r\n        <Link\r\n          style={{ color: bookitColors.primary.regular }}\r\n          href={'mailto:' + v.Email}\r\n          useInlineUrl={true}\r\n        >\r\n          {v.Email}\r\n        </Link>\r\n      )}\r\n\r\n      {!!v.OfficeTel && (\r\n        <BasicTypography component={'span'} variant={'bodyS'}>\r\n          {v.OfficeTel}\r\n        </BasicTypography>\r\n      )}\r\n    </div>\r\n  ));\r\n}\r\n","import React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IAsset } from './IAsset';\r\n\r\nexport interface IAssetRow extends Entity<string> {\r\n  Cell?: (value: AttributeValue<IAsset>) => React.ReactNode | undefined;\r\n  PropName?: keyof IAsset;\r\n  NoHeader?: boolean;\r\n  Header?: (value: AttributeValue<IAsset>) => React.ReactNode;\r\n  dependencies?: string[];\r\n  validToRender?: (value: AttributeValue<IAsset>) => boolean;\r\n  State?: AssetRowState;\r\n}\r\n\r\nexport interface AttributeValue<T extends object> {\r\n  original: T;\r\n  value: any;\r\n  shortView?: boolean;\r\n}\r\n\r\nexport enum AssetRowState {\r\n  SectionName,\r\n  Mandatory,\r\n}\r\n","import * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { IAssetBarcodeScanLogDto } from 'api/odata/generated/entities/IAssetBarcodeScanLogDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\n/**\r\n * Fetches & shows last location update details (user/date) for a given asset\r\n */\r\n\r\nexport function AssetLocationLastUpdate(props: { assetId: number }) {\r\n  const f = React.useCallback(async (assetId: number) => {\r\n    const url = `/api/odata/v4/AssetDetails2/${assetId}/BarcodeScanLog`;\r\n    const result: IODataQueryResponse<IState> = await httpClient.get(url, {\r\n      $select: 'Date,User',\r\n      $expand: 'User($select=Id,Name)',\r\n      $top: 1,\r\n      $orderBy: 'Date desc',\r\n    });\r\n    return result.value[0];\r\n  }, []);\r\n  type IState = Pick<IAssetBarcodeScanLogDto, 'Date' | 'User'>;\r\n\r\n  const [fetchState, fetch] = usePromise(f);\r\n  const [state, setState] = useAsyncExtendedState<IState | undefined>(\r\n    undefined,\r\n  );\r\n  useEffectOnMount(() => setState(fetch(props.assetId)));\r\n  const { t } = useTranslation();\r\n\r\n  if (fetchState.status === 'resolved' && state !== undefined) {\r\n    return (\r\n      <>\r\n        &emsp;{t(translations.Updated)}:{' '}\r\n        {dateUtils.shortDateFormat(state?.Date)} {state?.User?.Name}\r\n      </>\r\n    );\r\n  } else {\r\n    return null;\r\n  }\r\n}\r\n","import * as React from 'react';\r\n\r\nexport interface DoubleRenderProps {\r\n  value?: number | null;\r\n}\r\n\r\nexport const DoubleRender = (props: DoubleRenderProps) => {\r\n  return <React.Fragment>{props.value}</React.Fragment>;\r\n};\r\n","import { Comments } from 'app/components/Comments';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTheme } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { FormFieldsSection } from 'app/components/Forms/FormsLayout';\r\nimport { Identifiable } from 'types/common';\r\nexport interface AssetCommentsprops {\r\n  assetId: number;\r\n  isAdmin: boolean;\r\n  staffonly: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\nexport const FloatingComments = styled('div')(({ theme }) => ({\r\n  '&.floatingComments': {\r\n    display: 'flex',\r\n    alignItems: 'center',\r\n    justifyContent: 'space-between',\r\n    gap: 8,\r\n    height: 'auto',\r\n    maxHeight: '540px',\r\n    zIndex: 1070, //zIndex: 1500,\r\n    padding: '16px 8px',\r\n    //bottom: 'unset',\r\n    position: 'fixed',\r\n    bottom: '0px',\r\n    width: '100%',\r\n    left: 0,\r\n    background: bookitColors.grayscale.grayBackground,\r\n    //borderRadius: 8,\r\n    boxShadow: '0px 2px 18px rgba(8, 24, 41, 0.16)',\r\n  },\r\n}));\r\nexport const AssetComments = ({\r\n  assetId,\r\n  isAdmin,\r\n  staffonly,\r\n  serviceGroups,\r\n}: AssetCommentsprops) => {\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  return (\r\n    <Comments\r\n      commentType={CommentReferenceTypes.Assets}\r\n      referenceId={assetId}\r\n      isAdmin={isAdmin}\r\n      defaultComment={{ IsInternal: staffonly }}\r\n      noTitle\r\n      onCommentAdded={onCommentAdded}\r\n      serviceGroups={serviceGroups}\r\n    />\r\n  );\r\n};\r\nexport const AssetMobileComments = ({\r\n  assetId,\r\n  isAdmin,\r\n  staffonly,\r\n}: AssetCommentsprops) => {\r\n  const { t } = useTranslation();\r\n  const theme = useTheme();\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  return (\r\n    <FloatingComments theme={theme} className={'floatingComments'}>\r\n      <FormFieldsSection\r\n        titleSection={t(translations.CommentsAndAttachments) as string}\r\n      >\r\n        <Comments\r\n          commentType={CommentReferenceTypes.Assets}\r\n          referenceId={assetId}\r\n          isAdmin={isAdmin}\r\n          defaultComment={{ IsInternal: staffonly }}\r\n          pageName={t(translations.Instrument)}\r\n          noTitle\r\n          onCommentAdded={onCommentAdded}\r\n        />\r\n      </FormFieldsSection>\r\n    </FloatingComments>\r\n  );\r\n};\r\n","import { toRootedURL } from 'utils/url-utils';\r\nimport { AvailabilityTypesUnion } from 'api/odata/generated/enums/AvailabilityTypes';\r\n\r\nexport const getAssetEditLink = (\r\n  availabilityType: AvailabilityTypesUnion,\r\n  assetId?: number,\r\n  serviceId?: number,\r\n  serviceGroupId?: number,\r\n  divisionId?: number,\r\n) => {\r\n  switch (availabilityType) {\r\n    case 'NotAvailable':\r\n    case 'AvailableNotBookable':\r\n    case 'FreelyBookable':\r\n    case 'TrainingProgram':\r\n    case 'LoanableEquipment':\r\n    case 'LectureRoom':\r\n      return toRootedURL(\r\n        `/NewResource.aspx?Edit=${serviceId}&back=assetdetails&assetid=${assetId}`,\r\n      );\r\n    case 'ServiceRelated':\r\n      return toRootedURL(\r\n        `/OfflineServiceType.aspx?ID=${serviceId}&back=assetdetails&assetid=${assetId}`,\r\n      );\r\n    case 'RequestRelated':\r\n      return toRootedURL(\r\n        `/SampleType.aspx?ID=${serviceId}&back=assetdetails&assetid=${assetId}`,\r\n      );\r\n    case 'ServiceGroup':\r\n      return toRootedURL(`/newgroup.aspx?edit=${serviceGroupId}`);\r\n    case 'SuperGroup':\r\n      return toRootedURL(`/newsupergroup.aspx?edit=${divisionId}`);\r\n    default:\r\n      return undefined;\r\n  }\r\n};\r\n","import { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport * as React from 'react';\r\nimport { ExternalLink, Link } from 'app/components/ExternalLink';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Fragment } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport {\r\n  ArrayRenderer,\r\n  AssetDetailsImageRender,\r\n  DateRenderer,\r\n  HtmlRenderer,\r\n  UsersRenderer,\r\n} from './AttributeRenderers';\r\nimport { AssetRowState, IAssetRow } from './IAssetRow';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { getAssetImageSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { AssetLocationLastUpdate } from './AssetLocationLastUpdate';\r\nimport { DoubleRender } from 'app/components/BasicTable/components/DoubleRenderer';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { Tooltip } from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IAssetAssemblyStructure } from './IAssetAssemblyStructure';\r\nimport { AssetComments } from './components/AssetComments';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { AssetsSelectionProps } from '../MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IMyAssetsRow } from '../MyAssetsPage/IMyAssetsRow';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { getAssetEditLink } from './getAssetEditLink';\r\nimport { AssetLink } from './OpenAssetDetails';\r\nimport { Skeleton } from '@material-ui/lab';\r\n\r\nexport const getRows = (\r\n  t: TFunction,\r\n  setting: GlobalSettings,\r\n  openPanel: (state: SidePanelOpenState) => void,\r\n  publicUrl?: string,\r\n  isCover?: boolean,\r\n  useSidePanel?: boolean,\r\n  // setCover?: Dispatch<SetStateAction<ReactNode>>,\r\n  isAdmin?: boolean,\r\n  isMobile?: boolean,\r\n  isAuthenticated?: boolean,\r\n): IAssetRow[] => {\r\n  return [\r\n    {\r\n      Id: 'ImageName',\r\n      PropName: 'ImageName',\r\n      Name: t(translations.Image) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value &&\r\n        AssetDetailsImageRender({\r\n          value: getAssetImageSrc(\r\n            value,\r\n            undefined,\r\n            (setting.GetNullableByKey(AllowedSettings.AssetImageSizeType) ??\r\n              '2') === '1' && !isMobile\r\n              ? '/images/400x300.png'\r\n              : '/images/200x150.png',\r\n          ),\r\n          original: original,\r\n          shortView: isMobile,\r\n        }),\r\n\r\n      // <img\r\n      //   src={getAssetImageSrc(\r\n      //     value,\r\n      //     undefined,\r\n      //     (setting.GetNullableByKey(AllowedSettings.AssetImageSizeType) ??\r\n      //       '2') === '1' && !isMobile\r\n      //       ? '/images/400x300.png'\r\n      //       : '/images/200x150.png',\r\n      //   )}\r\n      //   alt=\"\"\r\n      //   style={\r\n      //     (setting.GetNullableByKey(AllowedSettings.AssetImageSizeType) ??\r\n      //       '2') === '1' && !isMobile\r\n      //       ? { maxWidth: '400px', maxHeight: '300px' }\r\n      //       : { maxWidth: '200px', maxHeight: '150px' }\r\n      //   }\r\n      // />\r\n      NoHeader: true,\r\n      validToRender: ({ value }) => !!value,\r\n    },\r\n    {\r\n      Id: 'ServiceGroup',\r\n      Name: t(translations.ServiceGroup) as string,\r\n      Cell: ({ value, original }) => {\r\n        const editLink = getAssetEditLink(\r\n          'ServiceGroup',\r\n          original.Id,\r\n          original.ServiceId ?? undefined,\r\n          original.ServiceGroup?.Id ?? undefined,\r\n          original.ServiceGroup?.DivisionId ?? undefined,\r\n        );\r\n        return (\r\n          <Button\r\n            style={{ justifyContent: 'left' }}\r\n            size={'small'}\r\n            variant=\"text\"\r\n            href={\r\n              original.AvailabilityType.Id === 'ServiceGroup'\r\n                ? editLink\r\n                : undefined\r\n            }\r\n            target={\r\n              original.AvailabilityType.Id === 'ServiceGroup'\r\n                ? '_blank'\r\n                : undefined\r\n            }\r\n            component={\r\n              original.AvailabilityType.Id === 'ServiceGroup' ? 'a' : undefined\r\n            }\r\n            onClick={\r\n              original.AvailabilityType.Id === 'ServiceGroup'\r\n                ? undefined\r\n                : () =>\r\n                    openPanel({\r\n                      renderPageType: RenderPageType.AssetDetails,\r\n                      renderPageProps: {\r\n                        Id: original.ServiceGroup.AssetId ?? undefined,\r\n                        useSidePanel: true,\r\n                      },\r\n                      expanded: false,\r\n                      useSidePanel: useSidePanel,\r\n                      isCover: useSidePanel,\r\n                    })\r\n            }\r\n          >\r\n            {value.Name}\r\n          </Button>\r\n        );\r\n      },\r\n      // Cell: ({ value, original }) => {\r\n      //   const editLink = getAssetEditLink(\r\n      //     'ServiceGroup',\r\n      //     original.Id,\r\n      //     original.ServiceId ?? undefined,\r\n      //     original.ServiceGroup?.Id ?? undefined,\r\n      //     original.ServiceGroup?.DivisionId ?? undefined,\r\n      //   );\r\n      //   if (editLink !== undefined) {\r\n      //     return (\r\n      //       <Button\r\n      //         style={{ justifyContent: 'left' }}\r\n      //         size={'small'}\r\n      //         variant=\"text\"\r\n      //         component={'a'}\r\n      //         href={editLink}\r\n      //         target={'_blank'}\r\n      //       >\r\n      //         {value.Name}\r\n      //       </Button>\r\n      //     );\r\n      //   }\r\n      // },\r\n    },\r\n    {\r\n      Id: 'AvailabilityType',\r\n      PropName: 'AvailabilityType',\r\n      Name: t(translations.Availability),\r\n      Cell: ({ value, original }) => {\r\n        return (\r\n          <Fragment>\r\n            {original.ApprovalRequired ? (\r\n              <Fragment>\r\n                {`${value.Name} - ${t(translations.ApprovalRequired)}`}\r\n              </Fragment>\r\n            ) : (\r\n              <Fragment>{value.Name}</Fragment>\r\n            )}\r\n          </Fragment>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Id: 'ForceTutoring',\r\n      Name: t(translations.TrainingMandatory) as string,\r\n      validToRender: ({ value, original }) =>\r\n        value === true && original.NotAllowReservations === false,\r\n      Cell: ({ value }) => {\r\n        return (\r\n          <Fragment>\r\n            <strong>{t(translations.ApprovalRequired)}</strong>\r\n          </Fragment>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Id: 'minorder',\r\n      Name: t(translations.MinimumReservationDurationH) as string,\r\n      validToRender: ({ value, original }) =>\r\n        !!value && value > 0 && original.NotAllowReservations === false,\r\n      Cell: DoubleRender,\r\n    },\r\n    {\r\n      Id: 'maxorder',\r\n      Name: t(translations.MaximumReservationDurationH) as string,\r\n      validToRender: ({ value, original }) =>\r\n        !!value && value > 0 && original.NotAllowReservations === false,\r\n      Cell: DoubleRender,\r\n    },\r\n    {\r\n      Id: 'ReservationMinimumGap',\r\n      Name: t(translations.ReservationMinimumGap) as string,\r\n      validToRender: ({ value, original }) =>\r\n        !!value && value > 0 && original.NotAllowReservations === false,\r\n      Cell: DoubleRender,\r\n    },\r\n    {\r\n      Id: 'CarryOverTimeSlotTypeId',\r\n      Name: t(translations.CarryOverTimeSlotGap) as string,\r\n      validToRender: ({ value, original }) =>\r\n        !!value &&\r\n        value !== null &&\r\n        value > 0 &&\r\n        original.NotAllowReservations === false,\r\n      Cell: ({ value, original }) => {\r\n        return (\r\n          <>{`${original.CarryOverTimeSlotGap} hours over timeslot ${original.CarryOverTimeSlotTypeName}`}</>\r\n        );\r\n      },\r\n      dependencies: ['CarryOverTimeSlotGap', 'CarryOverTimeSlotTypeName'],\r\n    },\r\n    // {\r\n    //   Id: 'MinimumTimeAhead',\r\n    //   Name: t(translations.MinimumTimeAhead) as string,\r\n    //   validToRender: ({ value, original }) => {\r\n    //     return (\r\n    //       original.ReservationEnabled &&\r\n    //       ((original.MinTimeAheadPeriodType !== undefined &&\r\n    //         !!original.MinTimeAheadPeriodValue) ||\r\n    //         !!original.MinTimeAheadMinutesSinceMidnight)\r\n    //     );\r\n    //   },\r\n    //   Cell: ({ value, original }) => {\r\n    //     let results = '';\r\n    //     if (!!original.MinTimeAheadPeriodValue) {\r\n    //       results = `${t(\r\n    //         translations.Before,\r\n    //       )}: ${original.MinTimeAheadPeriodValue.toFixed(2)}\r\n    //          ${(t(translations.AdvancedReservation) as string).replace(\r\n    //            '{0}',\r\n    //            enumToEntityArray(MinTimeAheadPeriodTypes).filter(\r\n    //              f => f.Id === original.MinTimeAheadPeriodType,\r\n    //            )[0].Name,\r\n    //          )}`;\r\n    //     } else if (!!original.MinTimeAheadMinutesSinceMidnight) {\r\n    //       results = `${t(translations.OnTheSameDay)}: ${(t(\r\n    //         translations.ToBeBookedBy,\r\n    //       ) as string).replace(\r\n    //         '{0}',\r\n    //         dateUtils.dateFnsUtils.format(\r\n    //           new Date(0, 0, 0, 0, original.MinTimeAheadMinutesSinceMidnight),\r\n    //           dateUtils.DateIOFormats.fullDateTime24h,\r\n    //         ),\r\n    //       )}`;\r\n    //     }\r\n    //     if (results !== '') {\r\n    //       return (\r\n    //         <Fragment>\r\n    //           {results}\r\n    //           <Tooltip\r\n    //             title={\r\n    //               !!original.MinTimeAheadPeriodValue\r\n    //                 ? t(translations.AdvancedReservation_info)\r\n    //                 : t(translations.ToBeBookedBy_info)\r\n    //             }\r\n    //           >\r\n    //             <span style={{ marginLeft: '1ch' }}>\r\n    //               <Icon icon=\"info-circle\" />\r\n    //             </span>\r\n    //           </Tooltip>\r\n    //         </Fragment>\r\n    //       );\r\n    //     }\r\n    //   },\r\n    // },\r\n    // {\r\n    //   Id: 'RestrictedReservationsOption',\r\n    //   Name: t(translations.InstrumentRestrictions) as string,\r\n    //   validToRender: ({ value, original }) => {\r\n    //     return (\r\n    //       (value !== null &&\r\n    //         value !== (RestrictedReservationsOptions.NoLimitations as number) &&\r\n    //         original.ReservationEnabled &&\r\n    //         original.ServiceType === 'Online' &&\r\n    //         !setting.GetBooleanByKey(\r\n    //           AllowedSettings.HideInstrumentRestrictions,\r\n    //         ) &&\r\n    //         original.AssemblyId === null) ||\r\n    //       original.PrerequisiteEquipments?.length > 0\r\n    //     );\r\n    //   },\r\n    //   //dependencies: ['PrerequisiteEquipments'],\r\n    //   Cell: ({ value, original }) => {\r\n    //     return (\r\n    //       <Tooltip title={t(translations.ShowRestrictionsFull)}>\r\n    //         <MuiLink\r\n    //           style={{ cursor: 'pointer' }}\r\n    //           onClick={() =>\r\n    //             !!setCover &&\r\n    //             setCover(() => {\r\n    //               return (\r\n    //                 <InstrumentRestrictions\r\n    //                   serviceId={original.ServiceId ?? -1}\r\n    //                   serviceGroupId={original.ServiceGroup?.Id}\r\n    //                   useSidePanel\r\n    //                   isCover\r\n    //                   closeCover={() => setCover(undefined)}\r\n    //                   onClose={() => setCover(undefined)}\r\n    //                 />\r\n    //               );\r\n    //             })\r\n    //           }\r\n    //         >\r\n    //           {t(translations.CheckTrainingStatus)}\r\n    //         </MuiLink>\r\n    //       </Tooltip>\r\n    //     );\r\n    //   },\r\n    // },\r\n    {\r\n      Id: 'Division',\r\n      Name: t(translations.AssetsInstituteBusiness) as string,\r\n      Cell: ({ original }) => original.ServiceGroup.DivisionName,\r\n    },\r\n    {\r\n      Id: 'AssetAccessories',\r\n      Name: t(translations.Accessories) as string,\r\n      Cell: ArrayRenderer<Entity<number>>(v => <>{v.Name}</>),\r\n    },\r\n    {\r\n      Id: 'AssetCatGroup',\r\n      Name: t(translations.AssetCatGroupName) as string,\r\n      Cell: ({ value, original }) => {\r\n        if (\r\n          !!value &&\r\n          setting.GetBooleanByKey(AllowedSettings.AssetCatEnabled)\r\n        ) {\r\n          return (\r\n            <div>\r\n              {value}\r\n              {isAuthenticated && (\r\n                <Tooltip title={t(translations.SeeAllRelatedAssets) as string}>\r\n                  <span>\r\n                    <IconButton\r\n                      aria-label=\"link\"\r\n                      variant=\"ghost\"\r\n                      shape=\"square\"\r\n                      size=\"small\"\r\n                      title={''}\r\n                      onClick={() => {\r\n                        let setProps = {\r\n                          useSidePanel: true,\r\n                          actionType: 'AssetSearch',\r\n                          assetCatGroupId: original.AssetCat.GroupId,\r\n                          customPredicates: [\r\n                            `${new Condition<IMyAssetsRow>(\r\n                              'AssetCatGroupId',\r\n                              ODataOperators.Equals,\r\n                              original.AssetCat.GroupId,\r\n                            ).toString()}`,\r\n                          ],\r\n                          hideCoresToggle: true,\r\n                        } as AssetsSelectionProps;\r\n\r\n                        openPanel({\r\n                          renderPageType: RenderPageType.AssetsSelection,\r\n                          renderPageProps: setProps,\r\n                          expanded: !useSidePanel,\r\n                          isCover: isCover,\r\n                          useSidePanel: !isCover,\r\n                        } as SidePanelOpenState);\r\n                      }}\r\n                      // onClick={() =>\r\n                      //   window.open(\r\n                      //     toRootedURL(\r\n                      //       '/AssetSearch?active=true&AssetCatGroupId=' +\r\n                      //         original.AssetCat.GroupId,\r\n                      //     ),\r\n                      //     '_blank',\r\n                      //   )\r\n                      // }\r\n                    >\r\n                      <Icon icon=\"arrow-up-right-from-square\" />\r\n                    </IconButton>\r\n                  </span>\r\n                </Tooltip>\r\n              )}\r\n            </div>\r\n          );\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Id: 'AssetCat',\r\n      Name: t(translations.AssetCategory) as string,\r\n      PropName: 'AssetCat',\r\n      validToRender: ({ value }) => {\r\n        return (\r\n          !!value && setting.GetBooleanByKey(AllowedSettings.AssetCatEnabled)\r\n        );\r\n      },\r\n      Cell: ({ original }) => {\r\n        return (\r\n          <div>\r\n            {original.AssetCat.Name}\r\n\r\n            <>\r\n              {!!original.AssetCat.InternalServiceAvaliable && (\r\n                <>{t(translations.InternalServiceAvaliable)}</>\r\n              )}\r\n            </>\r\n            {isAuthenticated && (\r\n              <Tooltip title={t(translations.SeeAllRelatedAssets) as string}>\r\n                <span>\r\n                  <IconButton\r\n                    aria-label=\"link\"\r\n                    variant=\"ghost\"\r\n                    shape=\"square\"\r\n                    size=\"small\"\r\n                    title={''}\r\n                    onClick={() => {\r\n                      let setProps = {\r\n                        useSidePanel: true,\r\n                        actionType: 'AssetSearch',\r\n                        assetCatId: original.AssetCat.Id,\r\n                        customPredicates: [\r\n                          `${new Condition<IMyAssetsRow>(\r\n                            'AssetCatId',\r\n                            ODataOperators.Equals,\r\n                            original.AssetCat.Id,\r\n                          ).toString()}`,\r\n                        ],\r\n                        hideCoresToggle: true,\r\n                      } as AssetsSelectionProps;\r\n\r\n                      openPanel({\r\n                        renderPageType: RenderPageType.AssetsSelection,\r\n                        renderPageProps: setProps,\r\n                        expanded: !useSidePanel,\r\n                        isCover: isCover,\r\n                        useSidePanel: !isCover,\r\n                      } as SidePanelOpenState);\r\n                    }}\r\n                    // onClick={() =>\r\n                    //   window.open(\r\n                    //     toRootedURL(\r\n                    //       '/AssetSearch?active=true&AssetCatId=' +\r\n                    //         original.AssetCat.Id,\r\n                    //     ),\r\n                    //     '_blank',\r\n                    //   )\r\n                    // }\r\n                  >\r\n                    <Icon icon=\"arrow-up-right-from-square\" />\r\n                  </IconButton>\r\n                </span>\r\n              </Tooltip>\r\n            )}\r\n          </div>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Id: 'NickName',\r\n      Name: t(translations.NickName) as string,\r\n    },\r\n    {\r\n      Id: 'OtherNames',\r\n      Name: t(translations.OtherNames) as string,\r\n    },\r\n    {\r\n      Id: 'Brand',\r\n      Name: t(translations.Brand),\r\n    },\r\n    {\r\n      Id: 'Model',\r\n      Name: t(translations.Model) as string,\r\n    },\r\n    {\r\n      Id: 'ModelID',\r\n      Name: t(translations.Model) as string,\r\n      validToRender: ({ value }) => !!value,\r\n      Cell: ({ original, value }) => (\r\n        <Link\r\n          href={'/Assets/AssetModelDetails/Details.aspx?id' + value}\r\n          target=\"_blank\"\r\n        >\r\n          {value}\r\n        </Link>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'ModelNumber',\r\n      Name: t(translations.ModelNumber) as string,\r\n    },\r\n    {\r\n      Id: 'Campus',\r\n      Name: t(translations.Campus) as string,\r\n      validToRender: ({ value, original }) => !!value && value !== null,\r\n      Cell: ({ value }) => <Fragment>{value.Name}</Fragment>,\r\n    },\r\n    {\r\n      Id: 'Building',\r\n      Name: t(translations.Building) as string,\r\n    },\r\n    {\r\n      Id: 'Room',\r\n      Name: t(translations.RoomNumber) as string,\r\n      validToRender: ({ value, original }) => !!value,\r\n      Cell: ({ value, original }) => (\r\n        <>\r\n          {!!value && <>{value}</>}\r\n          {isAdmin === true && (\r\n            <AssetLocationLastUpdate assetId={original.Id} />\r\n          )}\r\n        </>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'LocationsList',\r\n      Name: t(translations.LocationsList) as string,\r\n      PropName: 'LocationsList',\r\n    },\r\n    {\r\n      Id: 'SubLocationName',\r\n      Name: t(translations.LocationsList) as string,\r\n      PropName: 'SubLocationsList',\r\n    },\r\n    {\r\n      Id: 'Experts',\r\n      Name: t(translations.EquipmentExpert) as string,\r\n      validToRender: ({ value }) => !!value && value.length > 0,\r\n      Cell: UsersRenderer(),\r\n    },\r\n    {\r\n      Id: 'Contacts',\r\n      Name: t(translations.ContactsPersonForEquipment) as string,\r\n      validToRender: ({ value }) => !!value && value.length > 0,\r\n      Cell: UsersRenderer(),\r\n    },\r\n    {\r\n      Id: 'Suppliers',\r\n      Name: t(translations.ExternalCompany) as string,\r\n      validToRender: ({ value }) => !!value && value.length > 0,\r\n      Cell: ArrayRenderer<Entity<string>>(v => <>{v.Name}</>),\r\n    },\r\n    {\r\n      Id: 'MainSpecRange',\r\n      Name: t(translations.MainSpecificationRange) as string,\r\n    },\r\n    {\r\n      Id: 'ElectricalSpecs',\r\n      Name: t(translations.ElectricalSpecs) as string,\r\n    },\r\n    {\r\n      Id: 'FunctionalCharacteristics',\r\n      Name: t(translations.FunctionalCharacteristics) as string,\r\n    },\r\n    {\r\n      Id: 'Description',\r\n      Name: t(translations.Description) as string,\r\n      Cell: HtmlRenderer,\r\n    },\r\n    {\r\n      Id: 'WebLink',\r\n      Name: t(translations.WebLink) as string,\r\n      Cell: ({ value }) => value && <Link href={value}>{value}</Link>,\r\n    },\r\n    {\r\n      Id: 'Raac',\r\n      Name: t(translations.RoutineActiveAnalysisCapable) as string,\r\n      Cell: BooleanRender,\r\n    },\r\n    {\r\n      Id: 'Tags',\r\n      Name: t(translations.Tags) as string,\r\n      validToRender: ({ value }) => !!value && value.length > 0,\r\n      Cell: ArrayRenderer<Entity<number>>(v => <>{v.Name}</>),\r\n    },\r\n    {\r\n      Id: 'ExtraDate0',\r\n      Name: t(translations.Asset_ExtraDate0) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate1',\r\n      Name: t(translations.Asset_ExtraDate1) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate2',\r\n      Name: t(translations.Asset_ExtraDate2) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate3',\r\n      Name: t(translations.Asset_ExtraDate3) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate4',\r\n      Name: t(translations.Asset_ExtraDate4) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate5',\r\n      Name: t(translations.Asset_ExtraDate5) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate6',\r\n      Name: t(translations.Asset_ExtraDate6) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate7',\r\n      Name: t(translations.Asset_ExtraDate7) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate8',\r\n      Name: t(translations.Asset_ExtraDate8) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraDate9',\r\n      Name: t(translations.Asset_ExtraDate9) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'ExtraText0',\r\n      Name: t(translations.Asset_ExtraText0) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText1',\r\n      Name: t(translations.Asset_ExtraText1) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText2',\r\n      Name: t(translations.Asset_ExtraText2) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText3',\r\n      Name: t(translations.Asset_ExtraText3) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText4',\r\n      Name: t(translations.Asset_ExtraText4) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText5',\r\n      Name: t(translations.Asset_ExtraText5) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText6',\r\n      Name: t(translations.Asset_ExtraText6) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText7',\r\n      Name: t(translations.Asset_ExtraText7) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText8',\r\n      Name: t(translations.Asset_ExtraText8) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText9',\r\n      Name: t(translations.Asset_ExtraText9) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText10',\r\n      Name: t(translations.Asset_ExtraText10) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText11',\r\n      Name: t(translations.Asset_ExtraText11) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText12',\r\n      Name: t(translations.Asset_ExtraText12) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText13',\r\n      Name: t(translations.Asset_ExtraText13) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText14',\r\n      Name: t(translations.Asset_ExtraText14) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraText15',\r\n      Name: t(translations.Asset_ExtraText15) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraInt0',\r\n      Name: t(translations.Asset_ExtraInt0) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraInt1',\r\n      Name: t(translations.Asset_ExtraInt1) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraInt2',\r\n      Name: t(translations.Asset_ExtraInt2) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraInt3',\r\n      Name: t(translations.Asset_ExtraInt3) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraInt4',\r\n      Name: t(translations.Asset_ExtraInt4) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraDec0',\r\n      Name: t(translations.Asset_ExtraDec0) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraDec1',\r\n      Name: t(translations.Asset_ExtraDec1) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraDec2',\r\n      Name: t(translations.Asset_ExtraDec2) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraDec3',\r\n      Name: t(translations.Asset_ExtraDec3) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraDec4',\r\n      Name: t(translations.Asset_ExtraDec4) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraBool0',\r\n      Name: t(translations.Asset_ExtraBool0) as string,\r\n      Cell: BooleanRender,\r\n    },\r\n    {\r\n      Id: 'ExtraBool1',\r\n      Name: t(translations.Asset_ExtraBool1) as string,\r\n      Cell: BooleanRender,\r\n    },\r\n    {\r\n      Id: 'ExtraBool2',\r\n      Name: t(translations.Asset_ExtraBool2) as string,\r\n      Cell: BooleanRender,\r\n    },\r\n    {\r\n      Id: 'ExtraBool3',\r\n      Name: t(translations.Asset_ExtraBool3) as string,\r\n      Cell: BooleanRender,\r\n    },\r\n    {\r\n      Id: 'ExtraBool4',\r\n      Name: t(translations.Asset_ExtraBool4) as string,\r\n      Cell: BooleanRender,\r\n    },\r\n    {\r\n      Id: 'ExtraUrl0',\r\n      Name: t(translations.Asset_ExtraUrl0) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraUrl1',\r\n      Name: t(translations.Asset_ExtraUrl1) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraUrl2',\r\n      Name: t(translations.Asset_ExtraUrl2) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraUrl3',\r\n      Name: t(translations.Asset_ExtraUrl3) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraUrl4',\r\n      Name: t(translations.Asset_ExtraUrl4) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraRichText0',\r\n      Name: t(translations.Asset_ExtraRichText0) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraRichText1',\r\n      Name: t(translations.Asset_ExtraRichText1) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraRichText2',\r\n      Name: t(translations.Asset_ExtraRichText2) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraRichText3',\r\n      Name: t(translations.Asset_ExtraRichText3) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraRichText4',\r\n      Name: t(translations.Asset_ExtraRichText4) as string,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL0',\r\n      Name: t(translations.Asset_ExtraDDL0) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL0?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL1',\r\n      Name: t(translations.Asset_ExtraDDL1) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL1?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL2',\r\n      Name: t(translations.Asset_ExtraDDL2) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL2?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL3',\r\n      Name: t(translations.Asset_ExtraDDL3) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL3?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL4',\r\n      Name: t(translations.Asset_ExtraDDL4) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL4?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL5',\r\n      Name: t(translations.Asset_ExtraDDL5) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL5?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL6',\r\n      Name: t(translations.Asset_ExtraDDL6) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL6?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL7',\r\n      Name: t(translations.Asset_ExtraDDL7) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL7?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL8',\r\n      Name: t(translations.Asset_ExtraDDL8) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL8?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL9',\r\n      Name: t(translations.Asset_ExtraDDL9) as string,\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL9?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL10',\r\n      Name: t(translations.Asset_ExtraDDL10) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value && <>{original.ExtraDDL10?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL11',\r\n      Name: t(translations.Asset_ExtraDDL11) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value && <>{original.ExtraDDL11?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL12',\r\n      Name: t(translations.Asset_ExtraDDL12) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value && <>{original.ExtraDDL12?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL13',\r\n      Name: t(translations.Asset_ExtraDDL13) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value && <>{original.ExtraDDL13?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL14',\r\n      Name: t(translations.Asset_ExtraDDL14) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value && <>{original.ExtraDDL14?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'ExtraDDL15',\r\n      Name: t(translations.Asset_ExtraDDL15) as string,\r\n      Cell: ({ value, original }) =>\r\n        !!value && <>{original.ExtraDDL15?.Name}</>,\r\n    },\r\n    {\r\n      Id: 'BrandCode',\r\n      Name: t(translations.BrandBarcodeNumber) as string,\r\n    },\r\n    {\r\n      Id: 'ServiceContract',\r\n      Name: t(translations.ServiceContract) as string,\r\n    },\r\n    {\r\n      Id: 'POnumber',\r\n      Name: t(translations.PurchaseOrder) as string,\r\n    },\r\n    {\r\n      Id: 'WarrantyEndDate',\r\n      Name: t(translations.WarrantyEndDate) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Id: 'LifeDate',\r\n      Name: t(translations.LifeDateView) as string,\r\n      validToRender: ({ value }) => !!value,\r\n      Cell: ({ value, original }) =>\r\n        value !== null && <>{dateUtils.formatDistanceToNow(value)}</>,\r\n    },\r\n    {\r\n      Id: 'ExportLicense',\r\n      Name: t(translations.ExportLicense) as string,\r\n    },\r\n    {\r\n      Id: 'InternalCode',\r\n      Name: t(translations.InternalEquipmentBarcodeNumber) as string,\r\n    },\r\n    {\r\n      Id: 'AccountingId',\r\n      Name: t(translations.AccountingId) as string,\r\n    },\r\n    {\r\n      Id: 'Active',\r\n      Name: t(translations.Active) as string,\r\n      Cell: ({ value }) => <BooleanRender value={value === true} />,\r\n    },\r\n    {\r\n      Id: 'Details',\r\n      Name: t(translations.AssetDetails) as string,\r\n      State: AssetRowState.SectionName,\r\n      Cell: ({ value, original }) => (\r\n        <H4 style={{ fontWeight: 'bolder', lineHeight: '164%' }}>\r\n          {t('AssetDetails')}\r\n        </H4>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'Classification',\r\n      Name: t(translations.AssetClassification) as string,\r\n      State: AssetRowState.SectionName,\r\n      Cell: ({ value, original }) => (\r\n        <H4 style={{ fontWeight: 'bolder', lineHeight: '164%' }}>\r\n          {t('AssetClassification')}\r\n        </H4>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'Location',\r\n      Name: t(translations.AssetLocation) as string,\r\n      State: AssetRowState.SectionName,\r\n      Cell: ({ value, original }) => (\r\n        <H4 style={{ fontWeight: 'bolder', lineHeight: '164%' }}>\r\n          {t('AssetLocation')}\r\n        </H4>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'SectionContacts',\r\n      Name: t(translations.AssetContacts) as string,\r\n      State: AssetRowState.SectionName,\r\n      Cell: ({ value, original }) => (\r\n        <H4 style={{ fontWeight: 'bolder', lineHeight: '164%' }}>\r\n          {t('AssetContacts')}\r\n        </H4>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'Identifiers',\r\n      Name: t(translations.AssetIdentifiers) as string,\r\n      State: AssetRowState.SectionName,\r\n      Cell: ({ value, original }) => (\r\n        <H4 style={{ fontWeight: 'bolder', lineHeight: '164%' }}>\r\n          {t('AssetIdentifiers')}\r\n        </H4>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'AdditionalInfo',\r\n      Name: t(translations.AssetAdditionalInfo) as string,\r\n      State: AssetRowState.SectionName,\r\n      Cell: ({ value, original }) => (\r\n        <H4 style={{ fontWeight: 'bolder', lineHeight: '164%' }}>\r\n          {t('AssetAdditionalInfo')}\r\n        </H4>\r\n      ),\r\n    },\r\n    {\r\n      Id: 'SectionLabel7',\r\n      Name: t(translations.AssetSectionLabel7) as string,\r\n      State: AssetRowState.SectionName,\r\n    },\r\n    {\r\n      Id: 'SectionLabel8',\r\n      Name: t(translations.AssetSectionLabel8) as string,\r\n      State: AssetRowState.SectionName,\r\n    },\r\n    {\r\n      Id: 'SectionLabel9',\r\n      Name: t(translations.AssetSectionLabel9) as string,\r\n      State: AssetRowState.SectionName,\r\n    },\r\n    {\r\n      Id: 'SectionLabel10',\r\n      Name: t(translations.AssetSectionLabel10) as string,\r\n      State: AssetRowState.SectionName,\r\n    },\r\n    {\r\n      Id: 'DOI',\r\n      Name: t(translations.Doi) as string,\r\n      Cell: ({ value, original }) => {\r\n        const doiURL = `https://doi.org/${value}`;\r\n        return (\r\n          <Tooltip title={t(translations.AssetDoiTooltip) as string}>\r\n            <span>\r\n              <ExternalLink showIcon href={doiURL}>\r\n                {value}\r\n              </ExternalLink>\r\n            </span>\r\n          </Tooltip>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Id: 'Status',\r\n      Name: t(translations.Status) as string,\r\n      Cell: ({ value, original }) => {\r\n        let color = bookitColors.base.black;\r\n        let backgroundColor = bookitColors.base.white;\r\n        switch (original.StatusId) {\r\n          case 1:\r\n            color = bookitColors.success.dark;\r\n            backgroundColor = bookitColors.success.background;\r\n            break;\r\n          case 2:\r\n            color = bookitColors.warning.dark;\r\n            backgroundColor = bookitColors.warning.background;\r\n            break;\r\n          case 3:\r\n            color = bookitColors.danger.dark;\r\n            backgroundColor = bookitColors.danger.background;\r\n            break;\r\n          default:\r\n            color = bookitColors.base.black;\r\n            backgroundColor = bookitColors.base.white;\r\n        }\r\n        const RenderStatus = (props: {}) => {\r\n          return (\r\n            <>\r\n              <BookitChip\r\n                variant=\"default\"\r\n                customsize=\"small\"\r\n                label={\r\n                  <>\r\n                    {value !== ' ' ? (\r\n                      <>{value}</>\r\n                    ) : (\r\n                      <Skeleton\r\n                        width={'40px'}\r\n                        height={'32px'}\r\n                        style={{\r\n                          backgroundColor: bookitColors.grayscale.graySelection,\r\n                        }}\r\n                      />\r\n                    )}\r\n                  </>\r\n                }\r\n                custombgcolor={backgroundColor}\r\n                customcolor={color}\r\n                shape=\"squar\"\r\n                key={'status'}\r\n                notremoved={true}\r\n              />\r\n            </>\r\n          );\r\n        };\r\n        return <RenderStatus />;\r\n      },\r\n    },\r\n    {\r\n      Id: 'AssetAssemblyStructure',\r\n      Name: t(translations.AssemblyStructure) as string,\r\n      Cell: ({ value, original }) => {\r\n        const AssetDetailsLink = (props: { name: string; id: number }) => {\r\n          // const history = useHistory();\r\n          // const dispatch = useDispatch();\r\n          // const { actions: layoutActions } = useLayoutSlice();\r\n          return (\r\n            <AssetLink\r\n              id={props.id}\r\n              key={`${props.name}-${props.id}`}\r\n              title={t(translations.Details)}\r\n              useSidePanel={useSidePanel}\r\n              openPanelWithCover={openPanel}\r\n            >\r\n              {props.name}\r\n            </AssetLink>\r\n            // <MuiLink\r\n            //   style={{ cursor: 'pointer' }}\r\n            //   onClick={() => {\r\n            //     history.push(`/Assets/Details?id=${props.id}`);\r\n            //     dispatch(layoutActions.resetSidePanel());\r\n            //   }}\r\n            // >\r\n            //   {props.name}\r\n            // </MuiLink>\r\n          );\r\n        };\r\n        const renderItem = (item: IAssetAssemblyStructure) => {\r\n          if (item.Children.length > 0) {\r\n            let res: React.ReactNode[] = [];\r\n            for (const v of item.Children) {\r\n              res.push(\r\n                <li>\r\n                  <AssetLink\r\n                    id={v.AssetId}\r\n                    key={`${v.Name}-${v.AssetId}`}\r\n                    title={t(translations.Details)}\r\n                    useSidePanel={useSidePanel}\r\n                    openPanelWithCover={openPanel}\r\n                  >\r\n                    {v.Name}\r\n                  </AssetLink>\r\n                </li>,\r\n              );\r\n              let childRes = renderItem(v);\r\n              if (childRes !== undefined && childRes.length > 0) {\r\n                res.push(\r\n                  <ul style={{ margin: 0 }}>{childRes.map((v, i) => v)}</ul>,\r\n                );\r\n              }\r\n            }\r\n            return res;\r\n          } else return undefined;\r\n        };\r\n        return (\r\n          <>\r\n            <li>\r\n              <AssetDetailsLink name={value.Name} id={value.AssetId} />\r\n            </li>\r\n            <ul style={{ margin: 0 }}>{renderItem(value)}</ul>\r\n          </>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Id: 'Range',\r\n      Name: t(translations.Range) as string,\r\n      Cell: ({ value, original }) => {\r\n        return (\r\n          <>\r\n            {value.map(v => {\r\n              if (v.MinValue !== undefined) {\r\n                if (v.MaxValue !== undefined) {\r\n                  return (\r\n                    <div>\r\n                      {v.MinValue} {' - '}\r\n                      {v.MaxValue} {'   '}\r\n                      {v.UnitTypeName}\r\n                    </div>\r\n                  );\r\n                } else {\r\n                  return (\r\n                    <div>\r\n                      {v.MinValue} {'   '}\r\n                      {v.UnitTypeName} {'(Min)'}\r\n                    </div>\r\n                  );\r\n                }\r\n              } else {\r\n                if (v.MaxValue !== undefined) {\r\n                  return (\r\n                    <div>\r\n                      {v.MaxValue} {'   '}\r\n                      {v.UnitTypeName} {'(Max)'}\r\n                    </div>\r\n                  );\r\n                } else {\r\n                  return <></>;\r\n                }\r\n              }\r\n            })}\r\n          </>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Id: 'Comments',\r\n      Name: t(translations.CommentsAndAttachments) as string,\r\n      validToRender: val => {\r\n        return (\r\n          isAuthenticated === true &&\r\n          (!val.original.CommentsAreStaffonly || !!isAdmin)\r\n        );\r\n      },\r\n      State: AssetRowState.Mandatory,\r\n      Cell(value) {\r\n        return (\r\n          <AssetComments\r\n            isAdmin={!!isAdmin}\r\n            assetId={value.original.Id}\r\n            staffonly={!!value.original.CommentsAreStaffonly}\r\n            serviceGroups={\r\n              !!value.original.ServiceGroup\r\n                ? [value.original.ServiceGroup]\r\n                : undefined\r\n            }\r\n          />\r\n        );\r\n      },\r\n    },\r\n    // stub, could be used when full screen asset details will be migrated to react https://prog4biz.atlassian.net/browse/BKT-6902\r\n    // {\r\n    //   Id: 'Articles',\r\n    //   PropName: 'Articles',\r\n    //   Name: t(translations.RelatedPublications),\r\n    //   Cell: ({ value }: { value?: IArticleDto[] }) => {\r\n    //     return <AssetArticles value={value} />;\r\n    //   },\r\n    // },\r\n  ];\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\n\r\nimport { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport {\r\n  AvailabilityTypes,\r\n  AvailabilityTypesUnion,\r\n} from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { AutoMode } from 'enums/GlobalEnums';\r\nimport { ServiceTypeUnion } from 'enums/ServiceTypes';\r\nimport { IAsset } from '../IAsset';\r\nimport { AssetRowState, IAssetRow } from '../IAssetRow';\r\nimport {\r\n  AssetDetailsAdditionalData,\r\n  RawSection,\r\n  Section,\r\n  Sections,\r\n} from './types';\r\n\r\nexport const isBookable = (availabilityType?: AvailabilityTypesUnion) => {\r\n  if (availabilityType === undefined) {\r\n    return false;\r\n  }\r\n  const bookable: AvailabilityTypesUnion[] = [\r\n    'FreelyBookable',\r\n    'LectureRoom',\r\n    'LoanableEquipment',\r\n    'TrainingProgram',\r\n  ];\r\n  return bookable.includes(availabilityType);\r\n};\r\nexport const isOnlineService = (availabilityType?: AvailabilityTypesUnion) => {\r\n  if (availabilityType === undefined) {\r\n    return false;\r\n  }\r\n  const notOnline: AvailabilityTypesUnion[] = [\r\n    'ServiceGroup',\r\n    'ServiceRelated',\r\n    'RequestRelated',\r\n    'SuperGroup',\r\n  ];\r\n  return !notOnline.includes(availabilityType);\r\n};\r\nexport function removeArrayItem(target, id: string) {\r\n  const ri = target.findIndex(v => v.Id === id);\r\n  if (ri >= 0) {\r\n    const rows = target.splice(ri, 1);\r\n    return rows[0];\r\n  } else return null;\r\n}\r\nexport function moveArrayItem(target, id: string, pos: number) {\r\n  const ri = target.findIndex(v => v.Id === id);\r\n  if (pos < target.length && ri >= 0 && pos !== ri) {\r\n    const row = target.splice(ri, 1);\r\n    target.splice(pos, 0, row[0]);\r\n  }\r\n}\r\nexport function moveArrayItemToEnd(target, id: string) {\r\n  const ri = target.findIndex(v => v.Id === id);\r\n  if (ri >= 0) {\r\n    const row = target.splice(ri, 1);\r\n    target.splice(target.length, 0, row[0]);\r\n  }\r\n}\r\nexport function moveArrayItemByName(target, id: string, name: string) {\r\n  if (id !== name) {\r\n    const ri = target.findIndex(v => v.Id === id);\r\n    if (ri >= 0) {\r\n      const rn = target.findIndex(v => v.Id === name);\r\n      if (rn >= 0) {\r\n        const row = target.splice(ri, 1);\r\n        if (rn < ri) {\r\n          target.splice(rn + 1, 0, row[0]);\r\n        } else {\r\n          target.splice(rn, 0, row[0]);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\nexport function addArrayItemByName(target, id: string, name: string) {\r\n  const ri = target.findIndex(v => v.Id === id);\r\n  if (ri < 0) {\r\n    const rn = target.findIndex(v => v.Id === name);\r\n    if (rn > 0) {\r\n      target.splice(rn + 1, 0, {\r\n        Id: id,\r\n        Visible: true,\r\n      });\r\n    } else {\r\n      target.unshift({\r\n        Id: id,\r\n        Visible: true,\r\n      });\r\n    }\r\n  }\r\n}\r\nexport function moveArrayItemByKey(target, key: string, pos: number) {\r\n  const ri = target.findIndex(v => v.key === key);\r\n  if (pos < target.length && ri >= 0 && pos !== ri) {\r\n    const row = target.splice(ri, 1);\r\n    target.splice(pos, 0, row[0]);\r\n  }\r\n}\r\n\r\nexport function GetReservationEnabled(\r\n  availabilityType: AvailabilityTypes,\r\n  active: boolean,\r\n  notAllowReservations: boolean,\r\n) {\r\n  let reservationEnabled: boolean = false;\r\n  switch (availabilityType) {\r\n    case AvailabilityTypes.FreelyBookable:\r\n    case AvailabilityTypes.LoanableEquipment:\r\n    case AvailabilityTypes.LectureRoom:\r\n      reservationEnabled = notAllowReservations === false && active === true;\r\n      break;\r\n    case AvailabilityTypes.TrainingProgram:\r\n      reservationEnabled = active === true;\r\n      break;\r\n    case AvailabilityTypes.ServiceRelated:\r\n    case AvailabilityTypes.ServiceGroup:\r\n    case AvailabilityTypes.SuperGroup:\r\n    case AvailabilityTypes.NotAvailable:\r\n    case AvailabilityTypes.AvailableNotBookable:\r\n    default:\r\n      reservationEnabled = false;\r\n      break;\r\n  }\r\n  return reservationEnabled;\r\n}\r\n\r\nexport function GetUsageEnabled(\r\n  availabilityType: AvailabilityTypes,\r\n  active: boolean,\r\n  autoMode?: number,\r\n) {\r\n  var result: boolean = autoMode === AutoMode?.LocalAppEnabled;\r\n  switch (availabilityType) {\r\n    case AvailabilityTypes.FreelyBookable:\r\n    case AvailabilityTypes.TrainingProgram:\r\n    case AvailabilityTypes.LoanableEquipment:\r\n    case AvailabilityTypes.LectureRoom:\r\n      result = result && active === true;\r\n      break;\r\n    case AvailabilityTypes.ServiceRelated:\r\n    case AvailabilityTypes.ServiceGroup:\r\n    case AvailabilityTypes.SuperGroup:\r\n    case AvailabilityTypes.NotAvailable:\r\n    case AvailabilityTypes.AvailableNotBookable:\r\n    default:\r\n      result = result && false;\r\n      break;\r\n  }\r\n  return result;\r\n}\r\n\r\nexport function GetAlertsEnabled(\r\n  availabilityType: AvailabilityTypes,\r\n  active: boolean,\r\n) {\r\n  let alertsEnabled: boolean = false;\r\n  switch (availabilityType) {\r\n    case AvailabilityTypes.FreelyBookable:\r\n    case AvailabilityTypes.LoanableEquipment:\r\n    case AvailabilityTypes.LectureRoom:\r\n    case AvailabilityTypes.TrainingProgram:\r\n    case AvailabilityTypes.NotAvailable:\r\n    case AvailabilityTypes.AvailableNotBookable:\r\n      alertsEnabled = active === true;\r\n      break;\r\n    case AvailabilityTypes.ServiceGroup:\r\n    case AvailabilityTypes.SuperGroup:\r\n    case AvailabilityTypes.ServiceRelated:\r\n    case AvailabilityTypes.RequestRelated:\r\n    default:\r\n      alertsEnabled = false;\r\n      break;\r\n  }\r\n  return alertsEnabled;\r\n}\r\nexport const isValid = (row: IAssetRow, data: IAsset) => {\r\n  if (\r\n    row.State === AssetRowState.SectionName ||\r\n    row.State === AssetRowState.Mandatory\r\n  ) {\r\n    return true;\r\n  }\r\n  const value = data![row.PropName ?? row.Id];\r\n  if (value !== null && value !== undefined && value !== '') {\r\n    if (Array.isArray(value)) {\r\n      return value.length > 0;\r\n    } else {\r\n      return true;\r\n    }\r\n  } else {\r\n    return false;\r\n  }\r\n};\r\nexport function GetValidRos(rows: IAssetRow[], data: IAsset): IAssetRow[] {\r\n  return rows.filter(row => isValid(row, data));\r\n}\r\nexport function RemoveLastEmptySections(rows: IAssetRow[]) {\r\n  if (rows.length > 0) {\r\n    if (rows[rows.length - 1].State === AssetRowState.SectionName) {\r\n      do {\r\n        rows.pop();\r\n      } while (\r\n        rows.length > 0 &&\r\n        rows[rows.length - 1].State === AssetRowState.SectionName\r\n      );\r\n    }\r\n  }\r\n  return rows;\r\n}\r\n\r\nexport function GetRawSections(rows: IAssetRow[]): RawSection[] {\r\n  const sections: RawSection[] = rows\r\n    .map((r, index) => {\r\n      return {\r\n        Id: r.Id,\r\n        Index: index,\r\n        SectionName: r.State === AssetRowState.SectionName,\r\n        remove: false,\r\n      };\r\n    })\r\n    .filter(f => f.SectionName);\r\n  return sections;\r\n}\r\nexport function CheckEmptyRawSections(sections: RawSection[]) {\r\n  if (sections.length > 1) {\r\n    for (let i = 0; i < sections.length - 1; i++) {\r\n      const s = sections[i];\r\n      const s1 = sections[i + 1];\r\n      if (s1.Index - s.Index === 1) {\r\n        s.remove = true;\r\n      }\r\n    }\r\n  }\r\n}\r\nexport function RemoveEmptySections(sections: RawSection[], rows: IAssetRow[]) {\r\n  for (let i = 0; i < sections.length - 1; i++) {\r\n    const s = sections[i];\r\n    if (s.remove) {\r\n      const ri = rows.findIndex(v => v.Id === s.Id);\r\n      rows.splice(ri, 1);\r\n    }\r\n  }\r\n}\r\n\r\nexport function GetSections(rows: IAssetRow[]): Section[] {\r\n  const noNameSection: Section = { Id: '', row: {} as IAssetRow, rows: [] };\r\n  const sections: Section[] = [];\r\n  let section: number = -1;\r\n  for (let r of rows) {\r\n    if (r.State === AssetRowState.SectionName) {\r\n      section++;\r\n      sections.push({\r\n        Id: r.Id,\r\n        Index: -1,\r\n        row: r,\r\n        rows: [],\r\n      } as Section);\r\n    } else {\r\n      if (section >= 0) {\r\n        sections[section].rows.push(r);\r\n      } else {\r\n        noNameSection.rows.push(r);\r\n      }\r\n    }\r\n  }\r\n  if (noNameSection.rows.length > 0) {\r\n    sections.unshift(noNameSection);\r\n  }\r\n  return sections;\r\n}\r\nexport function RowsToSections(rows: IAssetRow[]): Section[] {\r\n  const sections: Section[] = [];\r\n  for (let r of rows) {\r\n    sections.push({\r\n      Id: r.Id,\r\n      Index: -1,\r\n      row: r,\r\n      rows: [r],\r\n    } as Section);\r\n  }\r\n  return sections;\r\n}\r\nexport function RowToSections(rows: IAssetRow[], id: string): Section | null {\r\n  const row = removeArrayItem(rows, id);\r\n  if (row !== null) {\r\n    const section = {\r\n      Id: row.Id,\r\n      Index: -1,\r\n      row: row,\r\n      rows: [row],\r\n    } as Section;\r\n    return section;\r\n  } else return null;\r\n}\r\nexport function GetRowsWithSections(\r\n  rows: IAssetRow[],\r\n  data: IAsset,\r\n): IAssetRow[] {\r\n  let res: IAssetRow[] = GetValidRos(rows, data);\r\n  res = RemoveLastEmptySections(res);\r\n  const sections = GetRawSections(res);\r\n  CheckEmptyRawSections(sections);\r\n  RemoveEmptySections(sections, res);\r\n  return res;\r\n}\r\nexport function GetRowsSections(\r\n  rows: IAssetRow[],\r\n  data: IAsset,\r\n  isMobile?: boolean,\r\n): Sections {\r\n  let leftRes: IAssetRow[] = [];\r\n  let rightRes: IAssetRow[] = [];\r\n  const checkSection = (row: IAssetRow) => {\r\n    return isMobile\r\n      ? ['Description', 'Comments', 'AssetAssemblyStructure'].includes(\r\n          row.Id,\r\n        ) === false\r\n      : [\r\n          'ImageName',\r\n          'Description',\r\n          'Comments',\r\n          'AssetAssemblyStructure',\r\n        ].includes(row.Id) === false;\r\n  };\r\n  for (const row of rows) {\r\n    if (isValid(row, data)) {\r\n      if (checkSection(row)) {\r\n        leftRes.push(row);\r\n      } else {\r\n        rightRes.push(row);\r\n      }\r\n    }\r\n  }\r\n  leftRes = RemoveLastEmptySections(leftRes);\r\n  const sections = GetRawSections(leftRes);\r\n  CheckEmptyRawSections(sections);\r\n  RemoveEmptySections(sections, leftRes);\r\n  if (isMobile) {\r\n    if (rightRes.length > 0) {\r\n      moveArrayItem(rightRes, 'Description', 0);\r\n      moveArrayItem(rightRes, 'AssetAssemblyStructure', 1);\r\n      moveArrayItem(rightRes, 'Comments', 2);\r\n    }\r\n  } else {\r\n    if (rightRes.length > 0) {\r\n      moveArrayItem(rightRes, 'ImageName', 0);\r\n      moveArrayItem(rightRes, 'Description', 1);\r\n      moveArrayItem(rightRes, 'AssetAssemblyStructure', 2);\r\n      moveArrayItem(rightRes, 'Comments', 3);\r\n    }\r\n  }\r\n\r\n  leftRes = leftRes.filter(getSectionsFilter(data));\r\n  rightRes = rightRes.filter(getSectionsFilter(data));\r\n  const resSections: Sections = {} as Sections;\r\n  if (isMobile) {\r\n    const imageSection = RowToSections(leftRes, 'ImageName');\r\n    resSections.leftSections = GetSections(leftRes);\r\n    if (imageSection !== null) {\r\n      resSections.leftSections.unshift(imageSection);\r\n    }\r\n  } else {\r\n    resSections.leftSections = GetSections(leftRes);\r\n  }\r\n  resSections.rightSections = RowsToSections(rightRes);\r\n  return resSections;\r\n}\r\n\r\nconst getSectionsFilter = (data: IAssetDetails2Dto) => (row: IAssetRow) => {\r\n  return (\r\n    row.validToRender === undefined ||\r\n    row.validToRender({\r\n      value: data![row.PropName ?? row.Id],\r\n      original: data,\r\n    })\r\n  );\r\n};\r\n/**\r\n * Main asset identifier based on primary key\r\n */\r\nexport interface AssetIdIdentifier {\r\n  id: number;\r\n}\r\n/**\r\n * Service/ServiceType identification. In this case both properties must be supplied in order to prevent potential conflicts between different service types.\r\n */\r\nexport interface AssetServiceIdentifier {\r\n  serviceType: ServiceTypeUnion;\r\n  serviceId: number;\r\n}\r\n/**\r\n * Internal code based identifier.\r\n */\r\nexport interface AssetInternalCodeIdentifier {\r\n  internalCode: string;\r\n}\r\nexport interface AssetEmptyIdentifier {\r\n  id: AssetIdIdentifier['id'] | undefined;\r\n}\r\n/**\r\n * Combined interface that uniquely identifies asset by one of the unioned interfaces\r\n */\r\nexport type AssetIdentifier =\r\n  | AssetIdIdentifier\r\n  | AssetServiceIdentifier\r\n  | AssetInternalCodeIdentifier\r\n  | AssetEmptyIdentifier;\r\n\r\nexport async function fetchAssetBy(props: {\r\n  id: AssetIdentifier;\r\n  params: Record<string, string>;\r\n  isAuth?: boolean;\r\n}) {\r\n  const res = await fetchAssetByInternal(props);\r\n  if (res !== undefined) {\r\n    res.Division = res.ServiceGroup?.DivisionName;\r\n    res.AssetCatGroup =\r\n      res.AssetCat !== null && !!res.AssetCat\r\n        ? res.AssetCat.AssetCatGroupName\r\n        : null;\r\n    res.Status = ' ';\r\n    res.AlertsEnabled =\r\n      props.isAuth === true\r\n        ? GetAlertsEnabled(\r\n            AvailabilityTypes[res.AvailabilityType.Id],\r\n            res.Active,\r\n          )\r\n        : false;\r\n  }\r\n  return res;\r\n}\r\nasync function fetchAssetByInternal(props: {\r\n  id: AssetIdentifier;\r\n  params: Record<string, string>;\r\n  isAuth?: boolean;\r\n}) {\r\n  const url = props.isAuth\r\n    ? `/api/odata/v4/AssetDetails2`\r\n    : `/api/odata/v4/PublicAsset`;\r\n  if ((props.id as AssetIdIdentifier).id !== undefined) {\r\n    const res: IAssetDetails2Dto = await httpClient.get(\r\n      `${url}/${(props.id as AssetIdIdentifier).id}`,\r\n      props.params,\r\n    );\r\n    return res;\r\n  } else if (\r\n    (props.id as AssetServiceIdentifier).serviceId !== undefined &&\r\n    (props.id as AssetServiceIdentifier).serviceType !== undefined\r\n  ) {\r\n    const res: IODataQueryResponse<IAssetDetails2Dto> = await httpClient.get(\r\n      url,\r\n      {\r\n        ...props.params,\r\n        $filter: `ServiceType eq '${\r\n          (props.id as AssetServiceIdentifier).serviceType\r\n        }' and ServiceId eq ${(props.id as AssetServiceIdentifier).serviceId}`,\r\n      },\r\n    );\r\n    return res.value[0];\r\n  } else if (\r\n    (props.id as AssetInternalCodeIdentifier).internalCode !== undefined\r\n  ) {\r\n    const res: IODataQueryResponse<IAssetDetails2Dto> = await httpClient.get(\r\n      `${url}`,\r\n      {\r\n        ...props.params,\r\n        $filter: new Condition<IAssetDetails2Dto>(\r\n          'InternalCode',\r\n          ODataOperators.Equals,\r\n          (props.id as AssetInternalCodeIdentifier).internalCode,\r\n        ).toString(),\r\n      },\r\n    );\r\n    return res.value[0];\r\n  }\r\n}\r\nexport async function fetchAssetAdditionalData(props: {\r\n  Id: number;\r\n  typeId: number;\r\n  isAuth?: boolean;\r\n  buttonsData?: boolean;\r\n}) {\r\n  try {\r\n    const res = await httpClient.post<AssetDetailsAdditionalData>(\r\n      props.isAuth\r\n        ? `/api/odata/v4/AssetDetails2/GetAdditionalDetails`\r\n        : `/api/odata/v4/PublicAsset/GetAdditionalDetails`,\r\n      { key: props.Id, buttonsData: props.buttonsData, typeId: props.typeId },\r\n    );\r\n    return res;\r\n  } catch {}\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport { MenuItemLinkProps } from 'app/components/Menu/MenuItemLink';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { IAsset, mapToAssetDto } from '../IAsset';\r\nimport { alertsEnabled } from '..';\r\nimport { getAssetEditLink } from '../getAssetEditLink';\r\nimport { isBookable } from './Utils';\r\nimport { RenderTypes } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes';\r\nimport { useAssetsPermissions } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { PrintSelectedAssetLabelsButton } from 'app/components/LabelPrint/PrintSelectedAssetLabelsButton';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { ExportQRCodesButton } from 'app/components/QrCodeExport';\r\nimport { Roles } from 'api/odata/generated/enums/Roles';\r\n\r\nexport interface TopAssetActionsDropDownProps {\r\n  data: IAsset;\r\n  buttonsData: IAsset;\r\n}\r\n\r\nconst ButtonOrLink = (props: MenuItemLinkProps) => {\r\n  const { icon, target, text, disabled, ...rest } = props;\r\n  return (\r\n    <Button\r\n      startIcon={!icon ? undefined : <Icon icon={icon} />}\r\n      size={'small'}\r\n      variant=\"white\"\r\n      component={'a'}\r\n      disabled={disabled}\r\n      target={!!target ? '_blank' : '_self'}\r\n      {...rest}\r\n    >\r\n      {text}\r\n    </Button>\r\n  );\r\n};\r\nexport const useTopAssetActionsDropDown = ({\r\n  isMismatchCore,\r\n  isAdmin,\r\n}: {\r\n  isMismatchCore?: boolean;\r\n  isAdmin: boolean;\r\n}) => {\r\n  const { t } = useTranslation();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const roles = authenticatedUser?.Roles;\r\n  const canAddQuiz = React.useCallback((): boolean => {\r\n    return (\r\n      authenticatedUser !== undefined &&\r\n      authenticatedUser.Roles.indexOf(Roles.GroupAdministrators) >= 0\r\n    );\r\n  }, [authenticatedUser]);\r\n  const { allowedToView } = useAssetsPermissions();\r\n\r\n  const getMenuItems = React.useCallback(\r\n    ({ data, buttonsData }: TopAssetActionsDropDownProps) => {\r\n      const rows = [\r\n        {\r\n          Id: data.Id,\r\n          Name: data.Name,\r\n          AssetCatId: data?.AssetCat?.Id,\r\n          AvailabilityTypeId: AvailabilityTypes[data.AvailabilityType.Id],\r\n          AvailabilityTypeName: data.AvailabilityType.Name,\r\n          ServiceGroupId: data.ServiceGroup?.Id,\r\n          ServiceGroupName: data.ServiceGroup?.Name,\r\n          ServiceId: data?.ServiceId,\r\n          ServiceTypeId:\r\n            data?.ServiceType === null\r\n              ? null\r\n              : (ServiceType[data.ServiceType] as number) ?? null,\r\n          ServiceGroupAssetId: data?.ServiceGroup?.AssetId,\r\n        },\r\n      ];\r\n      const NotificationIsAvailable = [\r\n        'FreelyBookableBillable',\r\n        'ApprovalRequiredBillable',\r\n        'FreelyBookable',\r\n        'BookableWApproval',\r\n        'TrainingProgram',\r\n        'LoanableEquipment',\r\n        'LectureRoom',\r\n      ].includes(data.AvailabilityType.Id);\r\n      let items: React.ReactNode[] = [];\r\n      if (\r\n        isAdmin &&\r\n        [\r\n          'NotAvailable',\r\n          'AvailableNotBookable',\r\n          'FreelyBookableBillable',\r\n          'ApprovalRequiredBillable',\r\n          'FreelyBookable',\r\n          'BookableWApproval',\r\n          'TrainingProgram',\r\n          'LoanableEquipment',\r\n          'LectureRoom',\r\n          'ServiceRelated',\r\n          'RequestRelated',\r\n          'ServiceGroup',\r\n          'SuperGroup',\r\n        ].includes(data.AvailabilityType.Id)\r\n      ) {\r\n        const editLink = getAssetEditLink(\r\n          data.AvailabilityType.Id,\r\n          data.Id,\r\n          data.ServiceId ?? undefined,\r\n          data.ServiceGroup?.Id ?? undefined,\r\n          data.ServiceGroup?.DivisionId ?? undefined,\r\n        );\r\n        if (editLink !== undefined) {\r\n          items.push(\r\n            <ButtonOrLink\r\n              key=\"edit-service\"\r\n              href={editLink}\r\n              title={t(translations.EditSettings)}\r\n              text={t(translations.Settings)}\r\n              icon=\"pencil-alt\"\r\n              target={'_blank'}\r\n            />,\r\n          );\r\n        }\r\n      }\r\n      /*items.push(\r\n        <ButtonOrLink\r\n          key=\"asset-details\"\r\n          href={toRootedURL('/Assets/Details?id=' + data.Id)}\r\n          title={t(translations.AssetDetails)}\r\n          text={t(translations.AssetDetails)}\r\n          target=\"_blank\"\r\n          icon=\"file\"\r\n        />,\r\n      );*/\r\n      if (\r\n        (buttonsData.ReservationEnabled &&\r\n          roles?.includes(Roles.Administrators)) ||\r\n        roles?.includes(Roles.LabTech)\r\n      ) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"new-session\"\r\n            href={toRootedURL(\r\n              '/TrainingSession/AddNew.aspx?eqid=' + data.ServiceId,\r\n            )}\r\n            title={t(translations.menu_AddNewTrainingSessions)}\r\n            disabled={isMismatchCore}\r\n            icon=\"plus\"\r\n            target=\"_blank\"\r\n            text={t(translations.NewTrainingSession)}\r\n          />,\r\n        );\r\n      }\r\n      if (\r\n        buttonsData.ReservationEnabled &&\r\n        data.ServiceType === 'Online' &&\r\n        isBookable(data.AvailabilityType?.Id)\r\n      ) {\r\n        items.push(\r\n          <CalendarButton\r\n            key=\"calendar-open\"\r\n            equipments={data.ServiceId !== null ? [data.ServiceId] : undefined}\r\n            openToBook={true}\r\n            disabled={isMismatchCore}\r\n            title={\r\n              data.Allowed_ByTraining === false\r\n                ? t(translations.UntrainedToolTip)\r\n                : 'Calendar'\r\n            }\r\n            startIcon={<Icon icon=\"calendar-alt\" />}\r\n            variant=\"white\"\r\n            component={'a'}\r\n            size={'small'}\r\n          >\r\n            {t(translations.Calendar)}\r\n          </CalendarButton>,\r\n        );\r\n      }\r\n      if (\r\n        buttonsData.ReservationEnabled &&\r\n        isBookable(data.AvailabilityType?.Id)\r\n      ) {\r\n        items.push(\r\n          <CalendarButton\r\n            key=\"timeline-open\"\r\n            equipments={[data.ServiceId ?? undefined]}\r\n            openToBook={true}\r\n            viewType=\"timeline\"\r\n            disabled={isMismatchCore}\r\n            title={t(translations.Timeline)}\r\n            variant=\"white\"\r\n            component={'a'}\r\n            startIcon={<Icon icon=\"stream\" />}\r\n            size={'small'}\r\n          >\r\n            {t(translations.Timeline)}\r\n          </CalendarButton>,\r\n        );\r\n        if (\r\n          allowedToView(\r\n            ((rows as unknown) as IMyAssetsRow[]).map(mapToAssetDto),\r\n            RenderTypes.ExportQRCodes,\r\n          )\r\n        ) {\r\n          items.push(\r\n            <ExportQRCodesButton url=\"/api/QrCodes/assets\" rows={rows} />,\r\n          );\r\n        }\r\n        if (\r\n          allowedToView(\r\n            ((rows as unknown) as IMyAssetsRow[]).map(mapToAssetDto),\r\n            RenderTypes.PrintAssetLabels,\r\n          )\r\n        ) {\r\n          items.push(\r\n            <PrintSelectedAssetLabelsButton\r\n              key=\"printlabels\"\r\n              rows={rows}\r\n              title={t(translations.PrintLabels)}\r\n            />,\r\n          );\r\n        }\r\n        if (isBookable(data.AvailabilityType?.Id)) {\r\n          items.push(\r\n            <ButtonOrLink\r\n              key=\"res-history\"\r\n              href={toRootedURL('/reservations?eid=' + data.ServiceId)}\r\n              title={t(translations.menu_ReservationsHistory)}\r\n              icon=\"calendar-alt\"\r\n              text={t(translations.menu_ReservationsHistory)}\r\n              disabled={isMismatchCore}\r\n            />,\r\n          );\r\n        }\r\n      }\r\n      if (buttonsData.UsageEnabled) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"usage-history\"\r\n            href={toRootedURL('/usagehistory.aspx?sid=' + data.ServiceId)}\r\n            title={t(translations.UsageHistory)}\r\n            icon=\"ruler-triangle\"\r\n            text={t(translations.UsageHistory)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n      }\r\n      if (data.ServiceType === 'Offline' && data.AllowToUser) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"offline-services\"\r\n            href={toRootedURL('/otherservices?sid=' + data.ServiceId)}\r\n            title={t(translations.OfflineService)}\r\n            icon=\"th-list\"\r\n            text={t(translations.OfflineService)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n      }\r\n      if (\r\n        data.ServiceType === 'Online' &&\r\n        IsModuleEnabled(appSettings, KnownModules.Quizzes) &&\r\n        canAddQuiz()\r\n      ) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"quizzes\"\r\n            href={toRootedURL('/quizzes?eid=' + data.ServiceId)}\r\n            title={t(translations.TrainingQuiz)}\r\n            icon=\"plus\"\r\n            text={t(translations.TrainingQuiz)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n      }\r\n      if (alertsEnabled(data.AvailabilityType.Id)) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"workorders\"\r\n            href={toRootedURL(`/workorders?aid=${data.Id}`)}\r\n            title={t(translations.Alerts)}\r\n            icon=\"comment-alt-dots\"\r\n            text={t(translations.AlertsIcon)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n      }\r\n      if (buttonsData.PlanedEventsEnabled) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"incident-track\"\r\n            href={toRootedURL(\r\n              '/Alerts/IncidentAssetsTracking.aspx?assetIds=' + data.Id,\r\n            )}\r\n            title={t(translations.ScheduledEvents)}\r\n            icon=\"clipboard-list-check\"\r\n            text={t(translations.ScheduledEvents)}\r\n            target={'_blank'}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n      }\r\n      if (data.ServiceType === 'Offline' && data.AllowToUser) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"request-otherservice\"\r\n            href={toRootedURL('/OfflineServices.aspx?sid=' + data.ServiceId)}\r\n            title={t(translations.RequestAnOtherService)}\r\n            icon=\"history\"\r\n            text={t(translations.RequestAnOtherService)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n      }\r\n      if (\r\n        data.ServiceType === 'Sample' &&\r\n        data.CanBeCreatedFromLinkOnly === false\r\n      ) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"workflow-step\"\r\n            href={toRootedURL('/WorkflowStep.aspx?ostid=' + data.ServiceId)}\r\n            title={t(translations.CreateNewSampleRequest)}\r\n            icon=\"bolt\"\r\n            target={'_blank'}\r\n            text={t(translations.CreateNewSampleRequest)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );\r\n        /*items.push(\r\n          <ButtonOrLink\r\n            key=\"service-request\"\r\n            href={toRootedURL('/ServiceRequests.aspx?OfflineServiceTypeId=' + data.ServiceId)}\r\n            title={t(translations.SampleRequests)}\r\n            icon=\"history\"\r\n            text={t(translations.SampleRequests)}\r\n            disabled={isMismatchCore}\r\n          />,\r\n        );*/\r\n      }\r\n      if (\r\n        isBookable(data.AvailabilityType?.Id) &&\r\n        data.ServiceType === 'Online' &&\r\n        buttonsData.ReservationEnabled &&\r\n        (IsModuleEnabled(appSettings, KnownModules.ResCancelNotifications) ||\r\n          IsModuleEnabled(appSettings, KnownModules.ReservationNotification)) &&\r\n        NotificationIsAvailable\r\n      ) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"notifications\"\r\n            href={toRootedURL(\r\n              `/UserNotifications.aspx?exist=${\r\n                buttonsData.NotifyExists ? 'yes' : 'no'\r\n              }&EquipId=${data.ServiceId}&prev=home`,\r\n            )}\r\n            title={t(\r\n              buttonsData.NotifyExists\r\n                ? translations.NotifyToolTip\r\n                : translations.NoNotifyToolTip,\r\n            )}\r\n            icon=\"bell\"\r\n            target={'_blank'}\r\n            text={t(\r\n              buttonsData.NotifyExists\r\n                ? translations.EditRemainders\r\n                : translations.AddRemainders,\r\n            )}\r\n          />,\r\n        );\r\n      }\r\n      if (\r\n        buttonsData.ShowFeed &&\r\n        globalSettings.GetBoolean('CalendarPublicIntegrationFeed')\r\n      ) {\r\n        items.push(\r\n          <ButtonOrLink\r\n            key=\"calendar-feed\"\r\n            title={t(translations.CalendarPublicIntegrationFeed_Icon)}\r\n            href={toRootedURL(\r\n              '/api/ICalController/import?EquipmentName=' + data.Name,\r\n            )}\r\n            icon=\"calendar-plus\"\r\n            text={t(translations.OutlookGoogle)}\r\n          />,\r\n        );\r\n      }\r\n      return items;\r\n    },\r\n    [\r\n      allowedToView,\r\n      appSettings,\r\n      canAddQuiz,\r\n      globalSettings,\r\n      isAdmin,\r\n      isMismatchCore,\r\n      roles,\r\n      t,\r\n    ],\r\n  );\r\n  return getMenuItems;\r\n};\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { MenuItem } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { IAlertTypesFilterDto } from 'api/odata/generated/entities/IAlertTypesFilterDto';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from '../WorkOrders/WorkOrderDetailsPage/Details';\r\n\r\nexport function CreateAnAssetRelatedEvent(props: {\r\n  assetId: number;\r\n  downtime?: boolean;\r\n  mismatchCore: boolean;\r\n  useSidePanel?: boolean;\r\n  openPanel?: (state: SidePanelOpenState) => void;\r\n}) {\r\n  const { t } = useTranslation();\r\n  const [state, setState] = useAsyncExtendedState<IAlertTypesFilterDto[]>([]);\r\n  const [fetchAlertTypesState, fetchAlertTypes] = usePromise(\r\n    fetchAlertTypesPromise,\r\n  );\r\n  React.useEffect(() => {\r\n    setState(fetchAlertTypes(props.assetId));\r\n  }, [fetchAlertTypes, props.assetId, setState]);\r\n  const downtimeProps = React.useMemo(() => {\r\n    return props.downtime ? { offH: true, down: true } : {};\r\n  }, [props.downtime]);\r\n  return (\r\n    <DropDown\r\n      size=\"small\"\r\n      startIcon={<Icon icon=\"plus\" />}\r\n      title={t(translations.CreateAnAssetRelatedEvent)}\r\n      processing={fetchAlertTypesState.status === 'pending'}\r\n      color=\"primary\"\r\n      variant={/*!props.bookable ? 'main' : */ 'white'}\r\n      disabled={props.mismatchCore}\r\n      addChevron\r\n      menuChildren={onClose => [\r\n        <MenuItem key={'title for this menu'} disabled>\r\n          {t(translations.PleaseSelectAnEventType)}\r\n        </MenuItem>,\r\n\r\n        ...state.map(\r\n          a =>\r\n            a.Name !== null && (\r\n              <MenuItem\r\n                component={!!props.openPanel ? 'span' : 'a'}\r\n                key={a.Id + a.Name + 'key'}\r\n                href={\r\n                  !!props.openPanel\r\n                    ? undefined\r\n                    : toRootedURL(\r\n                        `/workorders/details?${toQueryString({\r\n                          aType: a.Id,\r\n                          assetId: props.assetId,\r\n                          ...downtimeProps,\r\n                        })}`,\r\n                      )\r\n                }\r\n                onClick={() => {\r\n                  !!props.openPanel &&\r\n                    props.openPanel({\r\n                      renderPageType: RenderPageType.WorkOrderDetails,\r\n                      renderPageProps: {\r\n                        queryParams: {\r\n                          aType: a.Id.toString(),\r\n                          assetId: props.assetId.toString(),\r\n                          down: !!downtimeProps.down\r\n                            ? downtimeProps.down.toString()\r\n                            : undefined,\r\n                          offH: !!downtimeProps.offH\r\n                            ? downtimeProps.offH.toString()\r\n                            : undefined,\r\n                        },\r\n                        useSidePanel: true,\r\n                      } as WorkOrderDetailsProps,\r\n                      expanded: false,\r\n                      useSidePanel: props.useSidePanel,\r\n                      isCover: props.useSidePanel,\r\n                    });\r\n                  onClose();\r\n                }}\r\n              >\r\n                {a.Name}\r\n              </MenuItem>\r\n            ),\r\n        ),\r\n      ]}\r\n      menuProps={{}}\r\n    >\r\n      {t(translations.Event)}\r\n    </DropDown>\r\n  );\r\n}\r\nexport const fetchAlertTypesPromise = async (assetId: number) => {\r\n  const response: IODataQueryResponse<IAlertTypesFilterDto> = await httpClient.get(\r\n    `/api/odata/v4/AssetDetails2(${assetId})/AlertTypes`,\r\n  );\r\n  return response.value;\r\n};\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { DocumentsTable } from 'app/pages/Documents/DocumentsTable';\r\nimport { IDocumentsDirectoryRow } from 'app/pages/Documents/IDocumentsDirectoryRow';\r\n//import { useFilters } from './TableFilters';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IBasicTableState } from 'app/components/BasicTable';\r\nimport React from 'react';\r\nimport { getColumns } from 'app/pages/Documents/Columns';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Column } from 'react-table';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst ExcludeAssetDocumentsColumns: string[] = ['AssetName', 'ServiceGroup'];\r\nexport interface AssetDetailsFilesProps {\r\n  assetId: number;\r\n  getFiltersDefinition?: GetPageFilters<IDocumentsDirectoryRow>;\r\n  isMobile?: boolean;\r\n  serviceGroupId?: number;\r\n  availabilityType?: string;\r\n  user?: AuthenticatedUser;\r\n}\r\nexport function AssetDetailsFiles(props: AssetDetailsFilesProps) {\r\n  const { t } = useTranslation();\r\n  const documentsColumns = React.useMemo(() => getColumns(t), [t]);\r\n  const { assetId, isMobile, serviceGroupId, availabilityType } = props;\r\n  const columns = React.useMemo(() => {\r\n    let res: Column<IDocumentsDirectoryRow>[] = documentsColumns.filter(\r\n      f =>\r\n        f.accessor !== undefined &&\r\n        !ExcludeAssetDocumentsColumns.includes(f.accessor as string),\r\n    );\r\n    return res;\r\n  }, [documentsColumns]);\r\n  const predicates: Array<\r\n    Condition<IDocumentsDirectoryRow> | string\r\n  > = React.useMemo(() => {\r\n    // The asset matches and the service group matches or there is only a service group and it matches.\r\n    const res: Array<Condition<IDocumentsDirectoryRow> | string> = [];\r\n    const assetPredicate = new Condition<IDocumentsDirectoryRow>(\r\n      'AssetId',\r\n      ODataOperators.Equals,\r\n      assetId,\r\n    );\r\n    const groupPredicate = new Condition<IDocumentsDirectoryRow>(\r\n      'ServiceGroupId',\r\n      ODataOperators.Equals,\r\n      serviceGroupId,\r\n    );\r\n    if (!!availabilityType && availabilityType === 'ServiceGroup') {\r\n      res.push(\r\n        `(${[assetPredicate.toString(), groupPredicate.toString()].join(\r\n          ' or ',\r\n        )})`,\r\n      );\r\n    } else {\r\n      res.push(assetPredicate);\r\n    }\r\n    return res;\r\n  }, [assetId, availabilityType, serviceGroupId]);\r\n  /*const {\r\n    allfilters,\r\n    appliedFilters,\r\n    handleFilterChange,\r\n    getFilterValue,\r\n    setFilterValue,\r\n  } = useFilters(props.getFiltersDefinition, 'AssetId');*/\r\n  const initialState: IBasicTableState<IDocumentsDirectoryRow> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Id', desc: false }],\r\n    }),\r\n    [],\r\n  );\r\n  return (\r\n    <DocumentsTable\r\n      initialState={initialState}\r\n      predicates={predicates}\r\n      columns={columns}\r\n      /*availableFilters={allfilters}\r\n      appliedFilters={appliedFilters}\r\n      onFilterChange={handleFilterChange}\r\n      getFilterValue={getFilterValue}\r\n      setFilterValue={setFilterValue}*/\r\n      useConfigurable={false}\r\n      useCardsByDefault={isMobile}\r\n      allowCards={isMobile}\r\n      // compactTable={true}\r\n      useExport={false}\r\n      hideMenuOnMobile={true}\r\n      screenNameVariant=\"section\"\r\n      tablePaddingVariant={'dense'}\r\n      compactTable={isMobile}\r\n      serviceGroups={[]}\r\n    />\r\n  );\r\n}\r\n","import { IAsset } from '../IAsset';\r\nimport { Section, SectionsProps } from './types';\r\nimport { AttributeValue } from '../IAssetRow';\r\nimport React from 'react';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { GhostInput } from 'app/components/BasicInputs/GhostInput';\r\n\r\nexport interface SectionRowsProps {\r\n  sections: Section[];\r\n  data?: IAsset;\r\n  noLabel?: boolean;\r\n}\r\nexport const notFullWidth = ['Status', 'DOI'];\r\nexport const noLabelRendersArray = ['ImageName', 'Comments'];\r\nexport const asHtmlRenderArray = ['Comments', 'ImageName'];\r\nexport const DefautltCell = ({ value }: AttributeValue<IAsset>) => (\r\n  <React.Fragment>{value}</React.Fragment>\r\n);\r\nexport function RenderRows({\r\n  sections,\r\n  data,\r\n  noLabel,\r\n  ...props\r\n}: SectionRowsProps) {\r\n  // const rows = React.useCallback(\r\n  //   (rows: IAssetRow[]) => {\r\n  //     if (!!data) {\r\n  //       return (\r\n  //         <>\r\n  //           {rows\r\n  //             .filter(f => {\r\n  //               return (\r\n  //                 f.validToRender === undefined ||\r\n  //                 f.validToRender({\r\n  //                   value: data![f.PropName ?? f.Id],\r\n  //                   original: data,\r\n  //                 })\r\n  //               );\r\n  //             })\r\n  //             .map(r => {\r\n  //               let cell = r.Cell ?? DefautltCell;\r\n  //               let cellData = {\r\n  //                 original: data,\r\n  //                 value: data![r.PropName ?? r.Id],\r\n  //               };\r\n  //               return (\r\n  //                 <FormRow key={`asset_row-${r.Id}`}>\r\n  //                   <GhostInput\r\n  //                     key={`input-${r.Id}`}\r\n  //                     label={\r\n  //                       noLabel === true\r\n  //                         ? undefined\r\n  //                         : noLabelRendersArray.includes(r.Id)\r\n  //                         ? undefined\r\n  //                         : r.Name\r\n  //                     }\r\n  //                     valueHtml={\r\n  //                       asHtmlRenderArray.includes(r.Id)\r\n  //                         ? cell(cellData)\r\n  //                         : undefined\r\n  //                     }\r\n  //                     valueText={\r\n  //                       !asHtmlRenderArray.includes(r.Id)\r\n  //                         ? cell(cellData)\r\n  //                         : undefined\r\n  //                     }\r\n  //                     fullWidth={notFullWidth.includes(r.Id) ? false : true}\r\n  //                   />\r\n  //                 </FormRow>\r\n  //               );\r\n  //             })}\r\n  //         </>\r\n  //       );\r\n  //     } else {\r\n  //       return <> </>;\r\n  //     }\r\n  //   },\r\n  //   [data, noLabel],\r\n  // );\r\n  return !!data ? (\r\n    <React.Fragment>\r\n      {sections.map(s => {\r\n        return (\r\n          <FormFieldsSection titleSection={s.row.Name} key={`section_${s.Id}`}>\r\n            {s.rows\r\n              .filter(f => {\r\n                return (\r\n                  f.validToRender === undefined ||\r\n                  f.validToRender({\r\n                    value: data![f.PropName ?? f.Id],\r\n                    original: data,\r\n                  })\r\n                );\r\n              })\r\n              .map(r => {\r\n                let cell = r.Cell ?? DefautltCell;\r\n                let cellData = {\r\n                  original: data,\r\n                  value: data![r.PropName ?? r.Id],\r\n                };\r\n                return (\r\n                  <FormRow key={`asset_row-${r.Id}`}>\r\n                    <GhostInput\r\n                      key={`input-${r.Id}`}\r\n                      labelBolder\r\n                      label={\r\n                        noLabel === true\r\n                          ? undefined\r\n                          : noLabelRendersArray.includes(r.Id)\r\n                          ? undefined\r\n                          : r.Name\r\n                      }\r\n                      valueHtml={\r\n                        asHtmlRenderArray.includes(r.Id)\r\n                          ? cell(cellData)\r\n                          : undefined\r\n                      }\r\n                      valueText={\r\n                        !asHtmlRenderArray.includes(r.Id)\r\n                          ? cell(cellData)\r\n                          : undefined\r\n                      }\r\n                      fullWidth={notFullWidth.includes(r.Id) ? false : true}\r\n                    />\r\n                  </FormRow>\r\n                );\r\n              })}\r\n          </FormFieldsSection>\r\n        );\r\n      })}\r\n    </React.Fragment>\r\n  ) : null;\r\n}\r\nexport const RenderLeftSection = React.memo(function RenderSection({\r\n  sections,\r\n  data,\r\n  ...props\r\n}: SectionsProps) {\r\n  return sections.length > 0 ? (\r\n    <RenderRows key={'leftsection'} sections={sections} data={data} />\r\n  ) : null;\r\n});\r\nexport const RenderRightSection = React.memo(function RenderSection({\r\n  sections,\r\n  data,\r\n}: SectionsProps) {\r\n  return sections.length > 0 ? (\r\n    <RenderRows\r\n      key={'rightsection'}\r\n      sections={sections}\r\n      data={data}\r\n      noLabel={true}\r\n    />\r\n  ) : null;\r\n});\r\n","import { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Body } from 'app/components/Typography';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport function MismatchCore(\r\n  data: IAssetDetails2Dto | undefined,\r\n  isAuthenticated: boolean | undefined,\r\n  topServiceGroupsIsHidden: boolean,\r\n  selectedServiceGroups: Entity<number>[] | undefined,\r\n): boolean {\r\n  if (isAuthenticated && !topServiceGroupsIsHidden) {\r\n    const showAllCores =\r\n      !!data &&\r\n      !!data.ServiceGroup &&\r\n      selectedServiceGroups?.find(f => f.Id === data?.ServiceGroup.Id) ===\r\n        undefined;\r\n    return showAllCores\r\n      ? !!data &&\r\n          !!data.AvailabilityType &&\r\n          data.AvailabilityType?.Id !== 'ServiceGroup' &&\r\n          data.AvailabilityType?.Id !== 'SuperGroup' &&\r\n          !!selectedServiceGroups &&\r\n          selectedServiceGroups.length > 0 &&\r\n          !selectedServiceGroups.some(f => f.Id === data.ServiceGroup.Id)\r\n      : false;\r\n  } else {\r\n    return false;\r\n  }\r\n}\r\n\r\nexport interface MismatchCoreMessageProps {\r\n  data: IAssetDetails2Dto | undefined;\r\n  mismatchCore: boolean;\r\n}\r\nexport function MismatchCoreMessage({\r\n  data,\r\n  mismatchCore,\r\n}: MismatchCoreMessageProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const { actions } = useAppSettingsSlice();\r\n  const updateGlobalServiceGroup = React.useCallback(() => {\r\n    const showAllCores =\r\n      !!data &&\r\n      !!data.ServiceGroup &&\r\n      selectedServiceGroups?.find(f => f.Id === data?.ServiceGroup.Id) ===\r\n        undefined;\r\n    if (showAllCores && !!data && !!data.ServiceGroup.Id) {\r\n      const groups = [\r\n        ...(selectedServiceGroups ?? []),\r\n        ...(data.ServiceGroup !== null ? [data.ServiceGroup] : []).map(sg => ({\r\n          Id: sg.Id,\r\n          Name: sg.Name,\r\n        })),\r\n      ];\r\n\r\n      dispatch(actions.saveGlobalServiceGroupFilter(groups));\r\n    }\r\n  }, [actions, data, dispatch, selectedServiceGroups]);\r\n  return mismatchCore ? (\r\n    <BasicAlert\r\n      content={{\r\n        closable: true,\r\n        type: 'warning',\r\n        children: (\r\n          <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>\r\n            <Body size=\"small\">\r\n              {t(translations.MismatchAssetCore_warning) as string}\r\n            </Body>\r\n            <Button size=\"small\" onClick={() => updateGlobalServiceGroup()}>\r\n              {t(translations.SwitchToThisCore) as string}\r\n            </Button>\r\n          </div>\r\n        ),\r\n        variant: 'outlined',\r\n      }}\r\n    />\r\n  ) : (\r\n    <></>\r\n  );\r\n}\r\n","import { IAssetRow } from '../IAssetRow';\r\nimport React from 'react';\r\nimport { IAsset } from '../IAsset';\r\nimport { AssetDetailsFiles } from './AssetDetailsFiles';\r\nimport {\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { GetRowsSections } from './Utils';\r\nimport { RenderLeftSection, RenderRightSection } from './RenderAssetRows';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectGlobalSettingBool,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { MismatchCore, MismatchCoreMessage } from './MismatchCoreMessage';\r\n\r\nexport interface AssetDetailsTabContentProps {\r\n  rows: IAssetRow[];\r\n  data: IAsset;\r\n  loadingAdditionalData?: boolean;\r\n  isAdmin: boolean;\r\n  commentsForStaff?: boolean;\r\n  shortView?: boolean;\r\n  isCover?: boolean;\r\n}\r\n\r\nexport function AssetDetailsTabContent(props: AssetDetailsTabContentProps) {\r\n  const { rows, data, shortView, isCover } = props;\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const topServiceGroupsIsHidden = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.HideTopServiceGroupFilter),\r\n  );\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const sections = React.useMemo(() => {\r\n    return GetRowsSections(rows, data, shortView);\r\n  }, [data, shortView, rows]);\r\n  const leftSections = React.useMemo(() => {\r\n    return sections.leftSections;\r\n  }, [sections]);\r\n  const rightSections = React.useMemo(() => {\r\n    return sections.rightSections;\r\n  }, [sections]);\r\n  // const getMobileRows = React.useCallback(() => {\r\n  //   let res = leftSections;\r\n  //   if (rightSections.length > 0 && rightSections[0].rows.length > 0) {\r\n  //     res.unshift(...rightSections);\r\n  //   }\r\n  //   return res;\r\n  // }, [leftSections, rightSections]);\r\n  const mismatchCore = React.useMemo(() => {\r\n    return MismatchCore(\r\n      data,\r\n      isAuthenticated,\r\n      topServiceGroupsIsHidden,\r\n      selectedServiceGroups,\r\n    );\r\n  }, [data, isAuthenticated, selectedServiceGroups, topServiceGroupsIsHidden]);\r\n  return (\r\n    <>\r\n      <StyledFormFieldsContainer noPadding isCover={isCover}>\r\n        <FormLeftSection isCover={isCover}>\r\n          {shortView && (\r\n            <MismatchCoreMessage data={data} mismatchCore={mismatchCore} />\r\n          )}\r\n          <RenderLeftSection sections={leftSections} data={data} />\r\n        </FormLeftSection>\r\n        <FormRightSection isCover={isCover}>\r\n          {!shortView && (\r\n            <MismatchCoreMessage data={data} mismatchCore={mismatchCore} />\r\n          )}\r\n\r\n          <RenderRightSection sections={rightSections} data={data} />\r\n        </FormRightSection>\r\n      </StyledFormFieldsContainer>\r\n      {!!data && isAuthenticated && (\r\n        <AssetDetailsFiles\r\n          assetId={data.Id}\r\n          isMobile={shortView}\r\n          serviceGroupId={data.ServiceGroup.Id}\r\n          availabilityType={data.AvailabilityType.Id}\r\n        />\r\n      )}\r\n\r\n      {/*TODO: should be implemented mobile floating comment component and separate input from comments section\r\n      Jira task BKT-9685*/}\r\n      {/* {isMobile && (\r\n        <AssetMobileComments\r\n          isAdmin={isAdmin}\r\n          assetId={data.Id}\r\n          staffonly={commentsForStaff || false}\r\n        />\r\n      )} */}\r\n    </>\r\n  );\r\n}\r\n","import { InstrumentRestrictions } from 'app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions';\r\n\r\nexport interface AssetBookingRulesProps {\r\n  serviceId?: number;\r\n  serviceGroupId?: number;\r\n  user?: string;\r\n  useShortView?: boolean;\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function AssetBookingRules(props: AssetBookingRulesProps) {\r\n  return (\r\n    <InstrumentRestrictions\r\n      serviceId={props.serviceId}\r\n      serviceGroupId={props.serviceGroupId}\r\n      initUser={props.user}\r\n      useSidePanel={props.useSidePanel ?? false}\r\n      showTable={false}\r\n      assetPickerDisabled={true}\r\n      withNoPadding={true}\r\n      hideEquipmentFormTitle={true}\r\n      useShortView={props.useShortView}\r\n      withNoWrapper\r\n    />\r\n  );\r\n}\r\n","import { IRow } from 'app/components/BasicTable';\r\nimport { getDependencyFilters } from 'app/components/BasicTable/BasicFilter';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { getFilterValue } from 'app/components/BasicTable/getFilterValue';\r\nimport { initFilterData } from 'app/components/BasicTable/initFilterData';\r\nimport { visibleFiltersFilter } from 'app/components/BasicTable/withSavedHistory';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nexport interface FilterValue {\r\n  Name: string;\r\n  Value: FilterValueType | null;\r\n}\r\nexport class BaseFilterValues {\r\n  GetFilter = (): Array<FilterValue> => {\r\n    const res: Array<FilterValue> = Object.entries(this)\r\n      .filter(v => typeof v[1] !== 'function')\r\n      .map(v => {\r\n        return { Name: v[0], Value: v[1] as FilterValueType | null };\r\n      });\r\n    return res;\r\n  };\r\n  SetValue = (name: string, value: FilterValueType | null) => {\r\n    this[name] = value;\r\n  };\r\n}\r\nexport function useFilters<TRow extends IRow>(\r\n  GetFiltersDefinition: GetPageFilters<TRow>,\r\n  filterBy?: FilterValue[],\r\n  setValue?: (name: string, value: FilterValueType | null) => void,\r\n) {\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const showFiltersFn = React.useCallback(visibleFiltersFilter, []);\r\n  const getLocalizedFilters = useMemo(() => {\r\n    const result = GetFiltersDefinition(\r\n      t,\r\n      appSettings,\r\n      authenticatedUser ?? null,\r\n      settings,\r\n    );\r\n    return result;\r\n  }, [GetFiltersDefinition, appSettings, authenticatedUser, settings, t]);\r\n\r\n  const allFilters = useMemo(() => {\r\n    var result = getLocalizedFilters('');\r\n    // get the necessary filters\r\n    if (filterBy !== undefined && filterBy.length > 0) {\r\n      result = result.filter(\r\n        f => filterBy.findIndex(v => v.Name === f.fieldName) >= 0,\r\n      );\r\n      // Set saved values\r\n      for (const f of filterBy) {\r\n        let rf = result.find(r => r.fieldName === f.Name);\r\n        if (rf !== undefined) {\r\n          rf.value = f.Value;\r\n        }\r\n      }\r\n    }\r\n    return result;\r\n  }, [filterBy, getLocalizedFilters]);\r\n\r\n  const [appliedFilters, setAppliedFilters] = useAsyncExtendedState<\r\n    IFilterSettings<TRow>[] | undefined\r\n  >(undefined);\r\n  const handleFilterChange: (\r\n    items: IFilterSettings<TRow>[],\r\n  ) => void = React.useCallback(\r\n    items => {\r\n      const newState = [...items.filter(showFiltersFn)];\r\n\r\n      setAppliedFilters(getDependencyFilters(newState));\r\n\r\n      // Save values\r\n      if (setValue !== undefined) {\r\n        for (const f of newState) {\r\n          setValue(\r\n            f.fieldName as string,\r\n            f.value !== undefined ? f.value : null,\r\n          );\r\n        }\r\n      }\r\n    },\r\n    [setAppliedFilters, setValue, showFiltersFn],\r\n  );\r\n  const setFilterValueCallback = React.useCallback(\r\n    (id: string, value: FilterValueType) => {\r\n      if (allFilters === undefined) {\r\n        return;\r\n      }\r\n      const filter = allFilters?.find(f => f.id === id);\r\n      // in cases when applied filter is not defined call to setAppliedFilters will just only mutate appliedFilters array and cause duplicate/unnecessary invocation of hooks that have appliedFilters as a dependency\r\n      if (filter !== undefined) {\r\n        filter.value = value;\r\n        const x = allFilters\r\n          .map(f => (f === filter ? { ...filter, ...{ value: value } } : f))\r\n          .filter(showFiltersFn);\r\n        handleFilterChange(x);\r\n      }\r\n    },\r\n    [allFilters, handleFilterChange, showFiltersFn],\r\n  );\r\n  const getFilterValueCallback = React.useCallback(\r\n    (id: string) => {\r\n      const f = getFilterValue(appliedFilters, id);\r\n      return f;\r\n    },\r\n    [appliedFilters],\r\n  );\r\n  React.useEffect(() => {\r\n    if (authenticatedUser === undefined) {\r\n      return;\r\n    }\r\n    // get the filters\r\n    let visibleFilters = allFilters?.filter(showFiltersFn);\r\n    let depFilters = getDependencyFilters(visibleFilters);\r\n    setAppliedFilters(depFilters);\r\n    setAppliedFilters(initFilterData(depFilters, globalServiceGroupFilter));\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [globalServiceGroupFilter]);\r\n  return {\r\n    allfilters: allFilters,\r\n    appliedFilters,\r\n    handleFilterChange,\r\n    getFilterValue: getFilterValueCallback,\r\n    setFilterValue: setFilterValueCallback,\r\n  };\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { buildParams } from 'api/odata/ODataParamsBuilder';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\n\r\nfunction getUrlAndParams(\r\n  api: string | IPathAndQuery,\r\n  oDataParams: {\r\n    $count?: boolean;\r\n    $select?: string;\r\n    $filter?: string | undefined;\r\n  },\r\n) {\r\n  var url = typeof api === 'string' ? api : (api as IPathAndQuery).path;\r\n  var search = (api as IPathAndQuery).search;\r\n  const params = { ...oDataParams, ...search };\r\n  return { url, params };\r\n}\r\nexport async function GettableCount(state: {\r\n  api: string;\r\n  predicates: Array<Condition<IRow> | string>;\r\n  columns: Array<keyof IRow>;\r\n  globalFilterValue?: string;\r\n  customFilter: IFilterSettings<IRow>[];\r\n  serviceGroups: Entity<number>[];\r\n  isOptionalServiceGroup: boolean;\r\n}) {\r\n  const oDataParams = buildParams<IRow>({\r\n    ...state,\r\n    select: state.columns,\r\n    serviceGroups: state.serviceGroups,\r\n    pageSize: 1,\r\n    pageIndex: 0,\r\n  });\r\n  var { url, params } = getUrlAndParams(state.api, oDataParams);\r\n  const response = await httpClient.get(url, params /*, cancelToken*/);\r\n  const dataLength = response['@odata.count'];\r\n  return dataLength;\r\n}\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IBasicTableState, IRow } from 'app/components/BasicTable';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { GetFilters as getTrainingFilters } from 'app/pages/TrainingSessionsPage/Filter';\r\nimport { getColumns } from 'app/pages/TrainingSessionsPage/Columns';\r\nimport { ITrainingSessionsRow } from 'app/pages/TrainingSessionsPage/ITrainingSessionsRow';\r\nimport { TrainingSessionsTable } from 'app/pages/TrainingSessionsPage/TrainingSessionsTable';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Column } from 'react-table';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { BaseFilterValues, useFilters } from './TableFilters';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { GettableCount } from './GetTableCount';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport trainingSessionPrimaryAction from 'app/pages/TrainingSessionsPage/PrimaryAction';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\n\r\nconst AssetTrainingSessionsColumns: string[] = [\r\n  'Id',\r\n  'TrainingState',\r\n  'TrainerName',\r\n  'StartDate',\r\n  'EndDate',\r\n  'Duration',\r\n  'Campus',\r\n  'Building',\r\n  'Room',\r\n  'hasReservation',\r\n  'myReservationId',\r\n  'MinAttendance',\r\n  'MaxAttendance',\r\n  'RemainedSlots',\r\n  'Remarks',\r\n];\r\nconst url = '/api/odata/v4/TrainingSessions';\r\nconst GetPredicates = (\r\n  assetId: number,\r\n  serviceGroupId?: number,\r\n  availabilityType?: string,\r\n): Array<Condition<ITrainingSessionsRow> | string> => {\r\n  const res: Array<Condition<ITrainingSessionsRow> | string> = [];\r\n  const assetPredicate = new Condition<ITrainingSessionsRow>(\r\n    'AssetId',\r\n    ODataOperators.Equals,\r\n    assetId,\r\n  );\r\n  const serviceGroupPredicate = new Condition<ITrainingSessionsRow>(\r\n    'ServiceGroupId',\r\n    ODataOperators.Equals,\r\n    serviceGroupId,\r\n  );\r\n  if (!!availabilityType && availabilityType === 'ServiceGroup') {\r\n    res.push(serviceGroupPredicate);\r\n  } else {\r\n    res.push(assetPredicate);\r\n  }\r\n  res.push(\r\n    new Condition<ITrainingSessionsRow>(\r\n      'IsUpcoming',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n\r\n  return res;\r\n};\r\nclass FilterValues extends BaseFilterValues {\r\n  TrainingState: FilterValueType | null = null;\r\n  Trainer: FilterValueType | null = null;\r\n}\r\nconst filterValues = new FilterValues();\r\nexport interface AssetTrainingSessionsProps {\r\n  assetId: number;\r\n  serviceId: number | null;\r\n  serviceTypeId?: ServiceType;\r\n  isMobile?: boolean;\r\n  serviceGroupId?: number;\r\n  availabilityType?: string;\r\n  useSidePanel?: boolean;\r\n  openPanel: (state: SidePanelOpenState) => void;\r\n}\r\nexport async function GetTrainingSessionsTableCount(\r\n  assetId: number,\r\n  name: string,\r\n  updateCounters: (name: string, count: number) => void,\r\n  serviceGroupId?: number,\r\n  availabilityType?: string,\r\n) {\r\n  const res = await GettableCount({\r\n    api: url,\r\n    predicates: GetPredicates(\r\n      assetId,\r\n      serviceGroupId,\r\n      availabilityType,\r\n    ) as Array<Condition<IRow> | string>,\r\n    columns: ['Id'],\r\n    globalFilterValue: '',\r\n    customFilter: [],\r\n    serviceGroups: [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n  updateCounters(name, res);\r\n}\r\nexport function AssetTrainingSessions(props: AssetTrainingSessionsProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const history = useHistory();\r\n  const { actions } = useLayoutSlice();\r\n  const {\r\n    assetId,\r\n    serviceId,\r\n    serviceTypeId,\r\n    isMobile,\r\n    serviceGroupId,\r\n    availabilityType,\r\n    useSidePanel,\r\n    openPanel,\r\n  } = props;\r\n  const {\r\n    allfilters,\r\n    appliedFilters,\r\n    handleFilterChange,\r\n    getFilterValue,\r\n    setFilterValue,\r\n  } = useFilters(\r\n    getTrainingFilters,\r\n    filterValues.GetFilter(),\r\n    filterValues.SetValue,\r\n  );\r\n  const trainingSessionsColumns = React.useMemo(() => getColumns(t), [t]);\r\n  const columns = React.useMemo(() => {\r\n    let res: Column<ITrainingSessionsRow>[] = [];\r\n    for (const c of AssetTrainingSessionsColumns) {\r\n      const column = trainingSessionsColumns.find(f => f.accessor === c);\r\n      if (column !== undefined) {\r\n        res.push(column);\r\n      }\r\n    }\r\n    return res;\r\n  }, [trainingSessionsColumns]);\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  /*const menuItems: React.ReactNode[] = React.useMemo(() => {\r\n    let items: React.ReactNode[] = [\r\n      <MenuItem\r\n        key=\"rename-dashboard\"\r\n        onClick={() =>\r\n          window.open(\r\n            toRootedURL('/TrainingSession/Details.aspx', {\r\n              eqid: serviceId,\r\n            }),\r\n            '_blank',\r\n          )\r\n        }\r\n      >\r\n        {t(translations.menu_DetailsTrainingSessions)}\r\n      </MenuItem>,\r\n    ];\r\n    return items;\r\n  }, [serviceId, t]);*/\r\n\r\n  const pageActions: PageActionRenderer[] = React.useMemo(() => {\r\n    const actions: PageActionRenderer[] = [];\r\n    if (serviceTypeId !== undefined && serviceId !== null) {\r\n      if (\r\n        user?.HasAdminServicePermissions(serviceTypeId, serviceId) ||\r\n        user?.HasLabTechServicePermissions(serviceTypeId, serviceId)\r\n      ) {\r\n        actions.push(() => (\r\n          <TopActionButton\r\n            icon=\"plus\"\r\n            startIcon=\"plus\"\r\n            text={t(translations.AddNew)}\r\n            isIconButton={isMobile}\r\n            onClick={() => {\r\n              window.open(\r\n                toRootedURL('/TrainingSession/AddNew.aspx', {\r\n                  eqid: serviceId,\r\n                }),\r\n                '_blank',\r\n              );\r\n            }}\r\n          />\r\n        ));\r\n        actions.push(() => (\r\n          <TopActionButton\r\n            icon={'file'}\r\n            startIcon=\"file\"\r\n            text={t(translations.ManageSessions) as string}\r\n            variant=\"white\"\r\n            isIconButton={isMobile}\r\n            onClick={() => {\r\n              window.open(\r\n                toRootedURL('/TrainingSession/Details.aspx', {\r\n                  eqid: serviceId,\r\n                }),\r\n                '_blank',\r\n              );\r\n            }}\r\n          />\r\n        ));\r\n      }\r\n    }\r\n    return actions;\r\n  }, [isMobile, serviceId, serviceTypeId, t, user]);\r\n  const goToTrainingSessions = React.useCallback(() => {\r\n    history.push(`trainingsessions?eqid=${serviceId}`);\r\n    dispatch(actions.toggleSidePanel(false));\r\n  }, [actions, dispatch, history, serviceId]);\r\n  const customScreenName: React.ReactNode = React.useMemo(() => {\r\n    const result = (\r\n      <>\r\n        <FormSectionTitle title={t(translations.UpcomingTrainingSessions)} />\r\n        <IconButton\r\n          aria-label=\"link\"\r\n          variant=\"ghost\"\r\n          shape=\"square\"\r\n          size=\"small\"\r\n          title={''}\r\n          onClick={goToTrainingSessions}\r\n        >\r\n          <Icon icon=\"arrow-up-right-from-square\" />\r\n        </IconButton>\r\n      </>\r\n    );\r\n    return result;\r\n  }, [goToTrainingSessions, t]);\r\n  const primaryAction: PrimaryAction<ITrainingSessionsRow> = React.useCallback(\r\n    (...args) => {\r\n      const hasNextSession =\r\n        getOffsetDate(args[0].original.StartDate) >\r\n        dateUtils.truncateTime(newDate());\r\n      if (hasNextSession) {\r\n        trainingSessionPrimaryAction(\r\n          openPanel,\r\n          args[0],\r\n          args[1],\r\n          args[2],\r\n          useSidePanel,\r\n        );\r\n      }\r\n    },\r\n    [getOffsetDate, newDate, openPanel, useSidePanel],\r\n  );\r\n  const initialState: IBasicTableState<ITrainingSessionsRow> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'StartDate', desc: false }],\r\n    }),\r\n    [],\r\n  );\r\n  return (\r\n    <>\r\n      <TrainingSessionsTable\r\n        style={{ padding: 0 }}\r\n        columns={columns}\r\n        initialState={initialState}\r\n        predicates={GetPredicates(assetId, serviceGroupId, availabilityType)}\r\n        availableFilters={allfilters}\r\n        appliedFilters={appliedFilters}\r\n        onFilterChange={handleFilterChange}\r\n        getFilterValue={getFilterValue}\r\n        setFilterValue={setFilterValue}\r\n        useConfigurable={false}\r\n        useCardsByDefault={isMobile}\r\n        allowCards={isMobile}\r\n        pageActions={pageActions}\r\n        useExport={false}\r\n        serviceGroups={[]}\r\n        customScreenName={customScreenName}\r\n        hideMenuOnMobile={true}\r\n        screenNameVariant=\"section\"\r\n        tablePaddingVariant={'dense'}\r\n        compactTable={isMobile}\r\n        primaryAction={primaryAction}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport React from 'react';\r\nimport { ArticlesTable } from 'app/pages/ArticlesPage/ArticlesTable';\r\nimport { IBasicTableState, IRow } from 'app/components/BasicTable';\r\nimport { GettableCount } from './GetTableCount';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport articlePrimaryAction from 'app/pages/ArticlesPage/PrimaryAction';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst url = '/api/odata/v4/articles';\r\nconst GetPredicates = (\r\n  assetId: number,\r\n  serviceGroupId: number | undefined,\r\n  availabilityType?: string,\r\n): string[] => {\r\n  // The asset matches and the service group matches or there is only a service group and it matches.\r\n  const res: string[] = [];\r\n  if (!!availabilityType && availabilityType === 'ServiceGroup') {\r\n    res.push(\r\n      `Assets/any(a: a/Id eq ${assetId} ${\r\n        !!serviceGroupId ? 'or a/ServiceGroupId eq ' + serviceGroupId : ''\r\n      })`,\r\n    );\r\n  } else {\r\n    res.push(\r\n      `Assets/any(a: a/Id eq ${assetId} ${\r\n        !!serviceGroupId ? 'and a/ServiceGroupId eq ' + serviceGroupId : ''\r\n      })`,\r\n    );\r\n  }\r\n  return res;\r\n};\r\nexport async function GetArticlesTableCount(\r\n  assetId: number,\r\n  serviceGroupId: number | undefined,\r\n  name: string,\r\n  updateCounters: (name: string, count: number) => void,\r\n  availabilityType: string,\r\n) {\r\n  let res = 0;\r\n  res = await GettableCount({\r\n    api: url,\r\n    predicates: GetPredicates(\r\n      assetId,\r\n      serviceGroupId,\r\n      availabilityType,\r\n    ) as Array<Condition<IRow> | string>,\r\n    columns: ['Id'],\r\n    globalFilterValue: '',\r\n    customFilter: [],\r\n    serviceGroups: [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n  updateCounters(name, res);\r\n}\r\nexport interface AssetArticlesTableProps {\r\n  assetId: number;\r\n  serviceGroupId?: number;\r\n  isMobile?: boolean;\r\n  useSidePanel?: boolean;\r\n  openPanel: (state: SidePanelOpenState) => void;\r\n  availabilityType?: string;\r\n  user?: AuthenticatedUser;\r\n}\r\nexport function AssetArticlesTable(props: AssetArticlesTableProps) {\r\n  //const { serviceGroups } = useGlobalServiceGroupsFilter(true);\r\n  /*const {\r\n    allfilters,\r\n    appliedFilters,\r\n    handleFilterChange,\r\n    getFilterValue,\r\n    setFilterValue,\r\n  } = useFilters(props.getFiltersDefinition, 'AssetId');*/\r\n  const predicates = React.useMemo(() => {\r\n    return GetPredicates(\r\n      props.assetId,\r\n      props.serviceGroupId,\r\n      props.availabilityType,\r\n    );\r\n  }, [props.assetId, props.availabilityType, props.serviceGroupId]);\r\n  const initialState: IBasicTableState<IArticleDto> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Id', desc: false }],\r\n    }),\r\n    [],\r\n  );\r\n  const primaryAction: PrimaryAction<IArticleDto> = React.useCallback(\r\n    (...args) => {\r\n      articlePrimaryAction(\r\n        props.openPanel,\r\n        args[0],\r\n        undefined,\r\n        args[2],\r\n        props.useSidePanel,\r\n      );\r\n    },\r\n    [props.openPanel, props.useSidePanel],\r\n  );\r\n  return (\r\n    <ArticlesTable\r\n      initialState={initialState}\r\n      predicates={predicates}\r\n      /*availableFilters={allfilters}\r\n      appliedFilters={appliedFilters}\r\n      onFilterChange={handleFilterChange}\r\n      getFilterValue={getFilterValue}\r\n      setFilterValue={setFilterValue}*/\r\n      useConfigurable={false}\r\n      useCardsByDefault={props.isMobile}\r\n      allowCards={props.isMobile}\r\n      useExport={false}\r\n      //serviceGroups={serviceGroups}\r\n      hideMenuOnMobile={true}\r\n      screenNameVariant=\"section\"\r\n      tablePaddingVariant={'dense'}\r\n      compactTable={props.isMobile}\r\n      useSidePanel={props.useSidePanel}\r\n      openPanel={props.openPanel}\r\n      primaryAction={primaryAction}\r\n    />\r\n  );\r\n}\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IDocumentsDirectoryRow } from 'app/pages/Documents/IDocumentsDirectoryRow';\r\n//import { useFilters } from './TableFilters';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { WorkOrdersTable } from 'app/pages/WorkOrdersPage/WorkOrdersTable';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { NewWorkOrderButton } from 'app/pages/WorkOrdersPage/Actions/NewWorkOrder';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { getColumns } from 'app/pages/WorkOrdersPage/Columns';\r\nimport { Column } from 'react-table';\r\nimport { IBasicTableState, IRow } from 'app/components/BasicTable';\r\nimport { GettableCount } from './GetTableCount';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport workOrderPrimaryAction from 'app/pages/WorkOrdersPage/PrimaryAction';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst AssetWorkOrdersColumns: string[] = [\r\n  'Id',\r\n  'AlertType',\r\n  'AlertTitle',\r\n  'AlertDescription',\r\n  'AssignedUsers',\r\n  'AlertOfflineTime',\r\n  'ReportedBy',\r\n  'LastUpdated',\r\n  'LastComment',\r\n  'LastCommentAt',\r\n  'LastCommentBy',\r\n];\r\nconst AssetCalibrationColumns: string[] = [\r\n  'Id',\r\n  'AlertType',\r\n  'EventStart',\r\n  'EventEnd',\r\n  'AlertTitle',\r\n  'AlertDescription',\r\n  'ReportedBy',\r\n];\r\nconst url = '/api/odata/v4/WorkOrders';\r\n\r\nconst GetPredicates = (\r\n  assetId: number,\r\n  availabilityType?: string,\r\n  serviceGroupId?: number,\r\n  calibration?: boolean,\r\n): Array<Condition<IWorkOrderDetailsDto> | string> => {\r\n  const res: Array<Condition<IWorkOrderDetailsDto> | string> = [];\r\n  const assetPredicate = new Condition<IWorkOrderDetailsDto>(\r\n    'AssetId',\r\n    ODataOperators.Equals,\r\n    assetId,\r\n  );\r\n  const groupPredicate = new Condition<IWorkOrderDetailsDto>(\r\n    'ServiceGroupId',\r\n    ODataOperators.Equals,\r\n    serviceGroupId,\r\n  );\r\n  const calibrationPredicate = `(${[\r\n    new Condition<IWorkOrderDetailsDto>(\r\n      'ShowOnCalibrationHistory',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ).toString(),\r\n    new Condition<IWorkOrderDetailsDto>(\r\n      'IsClosed',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ).toString(),\r\n  ].join(' and ')})`;\r\n\r\n  if (\r\n    !!availabilityType &&\r\n    availabilityType === 'ServiceGroup' &&\r\n    !!serviceGroupId\r\n  ) {\r\n    res.push(groupPredicate);\r\n  } else {\r\n    res.push(assetPredicate);\r\n  }\r\n  if (calibration) {\r\n    res.push(calibrationPredicate);\r\n  }\r\n\r\n  return res;\r\n};\r\nexport async function GetWorkOrdersTableCount(\r\n  assetId: number,\r\n  calibration: boolean,\r\n  name: string,\r\n  updateCounters: (name: string, count: number) => void,\r\n  serviceGroupId?: number,\r\n  availabilityType?: string,\r\n) {\r\n  const res = await GettableCount({\r\n    api: url,\r\n    predicates: GetPredicates(\r\n      assetId,\r\n      availabilityType,\r\n      serviceGroupId,\r\n      calibration,\r\n    ) as Array<Condition<IRow> | string>,\r\n    columns: ['Id'],\r\n    globalFilterValue: '',\r\n    customFilter: [],\r\n    serviceGroups: [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n  updateCounters(name, res);\r\n}\r\nexport interface AssetWorkOrdersProps {\r\n  assetId: number;\r\n  assetName: string;\r\n  serviceGroupId: number | undefined;\r\n  calibration?: boolean;\r\n  getFiltersDefinition?: GetPageFilters<IDocumentsDirectoryRow>;\r\n  isMobile?: boolean;\r\n  useSidePanel?: boolean;\r\n  openPanel: (state: SidePanelOpenState) => void;\r\n  allowToAddNew?: boolean;\r\n  availabilityType?: string;\r\n  user?: AuthenticatedUser;\r\n}\r\nexport function AssetWorkOrders(props: AssetWorkOrdersProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const history = useHistory();\r\n  const { actions } = useLayoutSlice();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  /*const {\r\n    allfilters,\r\n    appliedFilters,\r\n    handleFilterChange,\r\n    getFilterValue,\r\n    setFilterValue,\r\n  } = useFilters(props.getFiltersDefinition, 'AssetId');*/\r\n  const workOrdersColumns = React.useMemo(\r\n    () =>\r\n      getColumns(\r\n        t,\r\n        undefined,\r\n        undefined,\r\n        authenticatedUser,\r\n        props.useSidePanel,\r\n        props.openPanel,\r\n      ),\r\n    [authenticatedUser, props.openPanel, props.useSidePanel, t],\r\n  );\r\n  const columns = React.useMemo(() => {\r\n    let res: Column<IWorkOrderDetailsDto>[] = [];\r\n    if (props.calibration) {\r\n      for (const c of AssetCalibrationColumns) {\r\n        const column = workOrdersColumns.find(f => f.accessor === c);\r\n        if (column !== undefined) {\r\n          res.push(column);\r\n        }\r\n      }\r\n      return res;\r\n    } else {\r\n      for (const c of AssetWorkOrdersColumns) {\r\n        const column = workOrdersColumns.find(f => f.accessor === c);\r\n        if (column !== undefined) {\r\n          res.push(column);\r\n        }\r\n      }\r\n      return res;\r\n    }\r\n  }, [props.calibration, workOrdersColumns]);\r\n\r\n  const PageActions: PageActionRenderer[] = React.useMemo(() => {\r\n    if (props.calibration || !props.allowToAddNew) {\r\n      return [];\r\n    } else {\r\n      return [\r\n        () => (\r\n          <NewWorkOrderButton\r\n            noChangeOnMobile\r\n            text={t(translations.WorkOrder)}\r\n            assetIds={props.assetId.toString()}\r\n            initAsset={\r\n              { Id: props.assetId, Name: props.assetName } as IAssetDto\r\n            }\r\n            useSidePanel={props.useSidePanel}\r\n            openPanelWithCover={props.openPanel}\r\n          />\r\n        ),\r\n      ];\r\n    }\r\n  }, [\r\n    props.allowToAddNew,\r\n    props.assetId,\r\n    props.assetName,\r\n    props.calibration,\r\n    props.openPanel,\r\n    props.useSidePanel,\r\n    t,\r\n  ]);\r\n  const primaryAction: PrimaryAction<IWorkOrderDetailsDto> = React.useCallback(\r\n    (...args) => {\r\n      workOrderPrimaryAction(\r\n        props.openPanel,\r\n        args[0],\r\n        args[1],\r\n        args[2],\r\n        props.useSidePanel,\r\n      );\r\n    },\r\n    [props.openPanel, props.useSidePanel],\r\n  );\r\n  const goToWorkOrders = React.useCallback(() => {\r\n    dispatch(actions.toggleSidePanel(false));\r\n    history.push('/workorders?aid=' + props.assetId);\r\n  }, [actions, dispatch, history, props.assetId]);\r\n\r\n  const predicates = React.useMemo(() => {\r\n    return GetPredicates(\r\n      props.assetId,\r\n      props.availabilityType,\r\n      props.serviceGroupId,\r\n      props.calibration,\r\n    );\r\n  }, [\r\n    props.assetId,\r\n    props.availabilityType,\r\n    props.calibration,\r\n    props.serviceGroupId,\r\n  ]);\r\n  const initialState: IBasicTableState<IWorkOrderDetailsDto> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Id', desc: true }],\r\n    }),\r\n    [],\r\n  );\r\n  return (\r\n    <WorkOrdersTable\r\n      columns={columns}\r\n      initialState={initialState}\r\n      predicates={predicates}\r\n      /*availableFilters={allfilters}\r\n      appliedFilters={appliedFilters}\r\n      onFilterChange={handleFilterChange}\r\n      getFilterValue={getFilterValue}\r\n      setFilterValue={setFilterValue}*/\r\n      pageActions={PageActions}\r\n      useConfigurable={false}\r\n      useCardsByDefault={props.isMobile}\r\n      allowCards={props.isMobile}\r\n      useExport={false}\r\n      serviceGroups={[]}\r\n      primaryAction={primaryAction}\r\n      customScreenName={\r\n        <React.Fragment>\r\n          <FormSectionTitle title={t(translations.ActiveIncidents)} />\r\n          <IconButton\r\n            aria-label=\"link\"\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n            size=\"small\"\r\n            title={''}\r\n            onClick={goToWorkOrders}\r\n          >\r\n            <Icon icon=\"arrow-up-right-from-square\" />\r\n          </IconButton>\r\n        </React.Fragment>\r\n      }\r\n      hideMenuOnMobile={true}\r\n      screenNameVariant=\"section\"\r\n      tablePaddingVariant={'dense'}\r\n      compactTable={props.isMobile}\r\n    />\r\n  );\r\n}\r\n","import styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport clsx from 'clsx';\r\n\r\nexport interface BadgeCounterProps {\r\n  count?: number;\r\n}\r\nconst Badge = styled('div')(({ theme }) => ({\r\n  '&.badgeRoot': {\r\n    display: 'flex',\r\n    width: '16px',\r\n    height: '16px',\r\n    //padding: '1.5px 0px 2px 0px',\r\n    padding: 0,\r\n    flexDirection: 'column',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n    borderRadius: '100px',\r\n    background: bookitColors.grayscale.grayComponentsLight,\r\n    '&.hasValue': {\r\n      background: bookitColors.primary.components,\r\n    },\r\n    '& .badgeText': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      justifyContent: 'center',\r\n      flex: '1 0 0',\r\n      alignSelf: 'stretch',\r\n      color: bookitColors.base.white,\r\n      textAlign: 'center',\r\n      /* Bkt/Tips Regular */\r\n      fontFamily: `'Lato', sans-serif`,\r\n      fontSize: '10px',\r\n      fontStyle: 'normal',\r\n      lineHeight: '141%' /* 19.2px */,\r\n      fontWeight: 400,\r\n      letterSpacing: '0.2px',\r\n    },\r\n  },\r\n}));\r\nexport function BadgeCounter(props: BadgeCounterProps) {\r\n  return (\r\n    <Badge\r\n      className={clsx('badgeRoot', {\r\n        hasValue: !!props.count && props.count > 0,\r\n      })}\r\n    >\r\n      <span className=\"badgeText\">{props.count ?? 0}</span>\r\n    </Badge>\r\n  );\r\n}\r\n","import {\r\n  ListItemSecondaryAction,\r\n  ListItemText,\r\n  MenuItem,\r\n  useTheme,\r\n} from '@material-ui/core';\r\nimport { TabContent } from 'app/components/BasicTabs/TabContent';\r\nimport styled from 'styled-components';\r\nimport * as React from 'react';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { TabPanel, TabPanelProps } from 'app/components/BasicTabs/TabPanel';\r\n\r\nexport interface AssetMobileDropDownTabsProps {\r\n  tabs: TabContent[];\r\n  tabsId: string;\r\n  tabsPanelId: string;\r\n  isMobile?: boolean;\r\n  handleTabChange: (tab: TabContent) => void;\r\n  selectedTab: TabContent;\r\n  tabPanels?: Array<React.ReactElement<TabPanelProps>>;\r\n}\r\nexport const DropDownTabsWrapper = styled('div')(({ theme }) => ({\r\n  '&.drpTabsWrapper': {\r\n    display: 'flex',\r\n    padding: '0px 16px',\r\n    flexDirection: 'column',\r\n    alignItems: 'flex-start',\r\n    alignSelf: 'stretch',\r\n    gap: '16px',\r\n    width: '100%',\r\n    overflow: 'hidden',\r\n    '& .asset-mobile-tabs': {\r\n      '& .asset-mobile-tabs-paper': {\r\n        width: '100%',\r\n      },\r\n    },\r\n  },\r\n}));\r\n\r\nexport function AssetMobileDropDownTabs(props: AssetMobileDropDownTabsProps) {\r\n  const {\r\n    tabs,\r\n    tabsId,\r\n    tabsPanelId,\r\n    isMobile,\r\n    handleTabChange,\r\n    selectedTab,\r\n    tabPanels,\r\n  } = props;\r\n  const theme = useTheme();\r\n  // const [selectedOption, setSelectedOption] = React.useState<TabContent>(\r\n  //   tabs[0],\r\n  // );\r\n  const handleSelectedTabIndexChange = (newValue: TabContent) => {\r\n    handleTabChange(newValue);\r\n  };\r\n  const getTabProps = React.useCallback(\r\n    (item: TabContent) => {\r\n      return {\r\n        id: `${tabsId}-${item.Id}`,\r\n        'aria-controls': `${tabsPanelId}-${item.Id}`,\r\n        label: item.Name,\r\n      };\r\n    },\r\n    [tabsId, tabsPanelId],\r\n  );\r\n  return (\r\n    <DropDownTabsWrapper theme={theme} className={'drpTabsWrapper'}>\r\n      <DropDown\r\n        variant=\"gray\"\r\n        size=\"small\"\r\n        fullWidth\r\n        id={'asset-mobile-tabs-ddl'}\r\n        endIcon={!!selectedTab.endIcon ? selectedTab.endIcon : undefined}\r\n        menuChildren={close =>\r\n          tabs.map(tab => (\r\n            <MenuItem\r\n              button\r\n              key={tab.Id}\r\n              onClick={() => {\r\n                handleSelectedTabIndexChange(tab);\r\n                close();\r\n              }}\r\n              selected={selectedTab.Id === tab.Id}\r\n              {...getTabProps(tab)}\r\n            >\r\n              <ListItemText primary={tab.Name} />\r\n              {!!tab.endIcon && (\r\n                <ListItemSecondaryAction>{tab.endIcon}</ListItemSecondaryAction>\r\n              )}\r\n            </MenuItem>\r\n          ))\r\n        }\r\n        menuProps={{\r\n          anchorOrigin: {\r\n            vertical: 'bottom',\r\n            horizontal: 'left',\r\n          },\r\n          transformOrigin: {\r\n            vertical: 'top',\r\n            horizontal: 'left',\r\n          },\r\n          getContentAnchorEl: null,\r\n          className: 'asset-mobile-tabs',\r\n          PaperProps: {\r\n            style: { width: isMobile ? '100%' : '340px' },\r\n            className: 'asset-mobile-tabs-paper',\r\n          },\r\n        }}\r\n        addChevron\r\n      >\r\n        {selectedTab.Name}\r\n      </DropDown>\r\n      {!!tabPanels && tabPanels.length > 0 ? (\r\n        <React.Fragment>{tabPanels}</React.Fragment>\r\n      ) : (\r\n        <React.Fragment>\r\n          {tabs.map((item, index) => (\r\n            <TabPanel\r\n              value={selectedTab.Id}\r\n              index={item.Id}\r\n              tabsId={tabsId}\r\n              tabsPanelId={tabsPanelId}\r\n              scrollableContent={true}\r\n            >\r\n              {item.Content}\r\n            </TabPanel>\r\n          ))}\r\n        </React.Fragment>\r\n      )}\r\n      {/* {tabs.map((item, index) => (\r\n        <TabPanel\r\n          value={selectedTab.Id}\r\n          index={item.Id}\r\n          tabsId={tabsId}\r\n          tabsPanelId={tabsPanelId}\r\n          scrollableContent={true}\r\n        >\r\n          {item.Content}\r\n        </TabPanel>\r\n      ))} */}\r\n    </DropDownTabsWrapper>\r\n  );\r\n}\r\n","import { BasicTabs } from 'app/components/BasicTabs';\r\nimport { TabContent } from 'app/components/BasicTabs/TabContent';\r\nimport { TabPanel, TabPanelProps } from 'app/components/BasicTabs/TabPanel';\r\nimport * as React from 'react';\r\nimport { AssetMobileDropDownTabs } from './AssetMobileDropDownTabs';\r\n\r\nexport interface AssetDetailsTabsProps {\r\n  tabs: TabContent[];\r\n  shortView: boolean;\r\n  isMobile: boolean;\r\n}\r\nexport function AssetDetailsTabs(props: AssetDetailsTabsProps) {\r\n  const { tabs, shortView, isMobile } = props;\r\n\r\n  const [selectedTab, setSelectedTab] = React.useState<TabContent>(tabs[0]);\r\n\r\n  const tabsId = 'assetdetails-tab';\r\n  const tabsPanelId = 'assetdetails-tabpanel';\r\n\r\n  const handleSelectedTabChange = (newValue: TabContent) => {\r\n    setSelectedTab(newValue);\r\n  };\r\n  const tabsPanels: Array<React.ReactElement<\r\n    TabPanelProps\r\n  >> = React.useMemo(() => {\r\n    return tabs.map((item, index) => (\r\n      <TabPanel\r\n        value={tabs.findIndex(f => f.Id === selectedTab.Id)}\r\n        index={index}\r\n        tabsId={tabsId}\r\n        tabsPanelId={tabsPanelId}\r\n        scrollableContent={true}\r\n        key={item.Id}\r\n      >\r\n        {item.Content}\r\n      </TabPanel>\r\n    ));\r\n  }, [selectedTab.Id, tabs]);\r\n  return (\r\n    <React.Fragment>\r\n      {shortView ? (\r\n        <AssetMobileDropDownTabs\r\n          tabsId={'assetdetails-tab'}\r\n          tabsPanelId={'assetdetails-tabpanel'}\r\n          tabs={tabs}\r\n          isMobile={isMobile}\r\n          handleTabChange={handleSelectedTabChange}\r\n          selectedTab={selectedTab}\r\n          tabPanels={tabsPanels}\r\n        />\r\n      ) : (\r\n        <BasicTabs\r\n          orientation=\"horizontal\"\r\n          tabsId={'assetdetails-tab'}\r\n          tabsPanelId={'assetdetails-tabpanel'}\r\n          tabs={tabs}\r\n          variant={'scrollable'}\r\n          selectedTabIndex={tabs.findIndex(f => f.Id === selectedTab.Id)}\r\n          scrollableContent={true}\r\n          handleTabChange={handleSelectedTabChange}\r\n          tabPanels={tabsPanels}\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { IAssetRangeDto } from 'api/odata/generated/complexTypes/IAssetRangeDto';\r\nimport { Entity } from 'types/common';\r\nimport { AlertInfo, IAsset } from '../IAsset';\r\nimport { IAssetAssemblyStructure } from '../IAssetAssemblyStructure';\r\nimport { IAssetRow } from '../IAssetRow';\r\n\r\nexport interface RawSection {\r\n  Id: string;\r\n  Index: number;\r\n  SectionName: boolean;\r\n  remove: boolean;\r\n}\r\nexport interface Section {\r\n  Id: string;\r\n  row: IAssetRow;\r\n  rows: IAssetRow[];\r\n}\r\nexport interface Sections {\r\n  leftSections: Section[];\r\n  rightSections: Section[];\r\n}\r\nexport interface SectionsProps {\r\n  sections: Section[];\r\n  data?: IAsset;\r\n}\r\nexport interface AssetDetailsAdditionalData {\r\n  ApprovalRequired: boolean;\r\n  Status: string;\r\n  StatusId: number;\r\n  AssemblyStructure?: IAssetAssemblyStructure;\r\n  HideTrainingSession: boolean;\r\n  Range: IAssetRangeDto[];\r\n  ForceTutoring: boolean;\r\n  AutoMode?: number;\r\n  Allowed_ByTraining?: boolean;\r\n  CanStartUsage: boolean;\r\n  CanEndUsage: boolean;\r\n  UsageId?: number;\r\n  EndUsageIds?: number[];\r\n  Alerts?: Entity<number>[];\r\n  PlanedEventsEnabled: boolean;\r\n  AlertInfo?: AlertInfo;\r\n  NotifyExists?: boolean;\r\n  CanBeCreatedFromLinkOnly?: boolean;\r\n  NotAllowReservations: boolean | null;\r\n  ShowFeed?: boolean;\r\n  AssemblyId: number | null;\r\n  CanRequestAccess: boolean;\r\n  ApprovalStatusId: number | null;\r\n}\r\n\r\nexport class CountersForTabs {\r\n  Reservations: { Enabled: boolean; Count: number } = {\r\n    Enabled: true,\r\n    Count: 0,\r\n  };\r\n  Schedule: { Enabled: boolean; Count: number } = {\r\n    Enabled: true,\r\n    Count: 0,\r\n  };\r\n  WorkOrders: { Enabled: boolean; Count: number } = {\r\n    Enabled: true,\r\n    Count: 0,\r\n  };\r\n  Calibrations: { enabled: boolean; Count: number } = {\r\n    enabled: true,\r\n    Count: 0,\r\n  };\r\n  Publications: { Enabled: boolean; Count: number } = {\r\n    Enabled: true,\r\n    Count: 0,\r\n  };\r\n  TrainingSessions: { Enabled: boolean; Count: number } = {\r\n    Enabled: true,\r\n    Count: 0,\r\n  };\r\n}\r\nexport const ExpandableRows: Array<string> = [\r\n  //'Alerts',\r\n  'Tags',\r\n  'Suppliers',\r\n  'Contacts',\r\n  'Experts',\r\n  'AssetAccessories',\r\n  'ServiceGroup',\r\n  'AssetCat',\r\n  'AvailabilityType',\r\n  'ExtraDDL0',\r\n  'ExtraDDL1',\r\n  'ExtraDDL2',\r\n  'ExtraDDL3',\r\n  'ExtraDDL4',\r\n  'ExtraDDL5',\r\n  'ExtraDDL6',\r\n  'ExtraDDL7',\r\n  'ExtraDDL8',\r\n  'ExtraDDL9',\r\n  'ExtraDDL10',\r\n  'ExtraDDL11',\r\n  'ExtraDDL12',\r\n  'ExtraDDL13',\r\n  'ExtraDDL14',\r\n  'ExtraDDL15',\r\n  //'Articles',\r\n];\r\nexport const DefaultRows: Array<string> = [\r\n  //'ImageName',\r\n  //'DivisionName',\r\n  //'AvailabilityType',\r\n  'Articles',\r\n  'Comments',\r\n];\r\nexport const DefaultAttributes: Array<string> = [\r\n  'Id',\r\n  'Name',\r\n  'ImageName',\r\n  'ServiceId',\r\n  'ServiceType',\r\n  'AvailabilityType',\r\n  'CommentsAreStaffonly',\r\n  'ServiceGroup',\r\n];\r\n","import * as React from 'react';\r\nimport { useCallback, useEffect, useMemo, useState, Fragment } from 'react';\r\nimport {\r\n  selectAppSettings,\r\n  selectAssetPopupSettings,\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n  selectGlobalSettingBool,\r\n  selectglobalSettings,\r\n  selectIsAuthenticated,\r\n  selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nimport { IAsset } from './IAsset';\r\nimport { IAssetRow } from './IAssetRow';\r\nimport { getRows } from './Rows';\r\nimport { Badge, MenuItem } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { buildURL, toRootedURL } from 'utils/url-utils';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useTopAssetActionsDropDown } from './components/TopAssetActionsDropDown';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { CreateAnAssetRelatedEvent } from './CreateAnAssetRelatedEvent';\r\nimport {\r\n  AvailabilityTypes,\r\n  AvailabilityTypesUnion,\r\n} from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IAssetDetails2Dto } from 'api/odata/generated/entities/IAssetDetails2Dto';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { AssetDetailsTabContent } from './components/AssetDetailsTabContent';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { AssetBookingRules } from './components/AssetBookingRules';\r\nimport {\r\n  AssetTrainingSessions,\r\n  GetTrainingSessionsTableCount,\r\n} from './components/AssetTrainingSessions';\r\nimport {\r\n  AssetArticlesTable,\r\n  GetArticlesTableCount,\r\n} from './components/AssetArcticlesTable';\r\nimport {\r\n  AssetWorkOrders,\r\n  GetWorkOrdersTableCount,\r\n} from './components/AssetWorkOrders';\r\nimport {\r\n  GetAlertsEnabled,\r\n  GetReservationEnabled,\r\n  GetUsageEnabled,\r\n  addArrayItemByName,\r\n  isBookable,\r\n  moveArrayItem,\r\n  fetchAssetBy,\r\n  fetchAssetAdditionalData,\r\n  moveArrayItemByName,\r\n  isOnlineService,\r\n  AssetIdentifier,\r\n  AssetIdIdentifier,\r\n  AssetServiceIdentifier,\r\n  AssetInternalCodeIdentifier,\r\n} from './components/Utils';\r\nimport { TabContent } from 'app/components/BasicTabs/TabContent';\r\nimport { BadgeCounter } from './components/BadgeCounter';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { EndUsageConfirm, EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { AssetDetailsApi } from 'api/AssetDetailsApi';\r\nimport { AssetDetailsTabs } from './components/AssetDetailsTabs';\r\nimport { MismatchCore } from './components/MismatchCoreMessage';\r\nimport { ServiceGroupRegistrationStatus } from 'enums/ServiceGroupRegistrationStatus';\r\nimport {\r\n  AssetDetailsAdditionalData,\r\n  CountersForTabs,\r\n  DefaultAttributes,\r\n  DefaultRows,\r\n  ExpandableRows,\r\n} from './components/types';\r\nimport {\r\n  AssetTypes,\r\n  GetAssetTypeFrom,\r\n  IsAssetFieldEnabled,\r\n  IsAssetFieldIsPublic,\r\n} from 'types/AppSettings';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { ReservationCreateButton } from 'app/components/ReservationCreateButton';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from '../WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { TrendingUpRounded } from '@material-ui/icons';\r\nimport { ReportConsumablesProps } from '../OtherServiceDetails/ReportConsumables';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport { Messages } from 'app/components/Messages';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { NotFoundPage } from '../NotFoundPage';\r\n\r\nexport function alertsEnabled(availabilityType: AvailabilityTypesUnion) {\r\n  switch (availabilityType) {\r\n    case 'FreelyBookable':\r\n    case 'LoanableEquipment':\r\n    case 'LectureRoom':\r\n    case 'TrainingProgram':\r\n    case 'NotAvailable':\r\n    case 'AvailableNotBookable':\r\n      return true;\r\n    case 'ServiceGroup':\r\n    case 'SuperGroup':\r\n    case 'ServiceRelated':\r\n    case 'RequestRelated':\r\n      return false;\r\n    default:\r\n      assertExhaustive(availabilityType);\r\n  }\r\n}\r\n\r\nconst maxLeftTopButtonsLength = 2;\r\nconst countersForTabs = new CountersForTabs();\r\n\r\nexport interface AssetPopUpProps extends CoverProps {\r\n  identifier: AssetIdentifier;\r\n  onClose?: () => void;\r\n  showAllCores?: boolean;\r\n  useSidePanel: boolean;\r\n  useRedirectToDash?: boolean;\r\n  addFromCalendar?: boolean;\r\n}\r\n\r\nexport const AssetPopUp = ({\r\n  identifier,\r\n  onClose,\r\n  showAllCores,\r\n  useSidePanel = true,\r\n  useRedirectToDash,\r\n  isCover,\r\n  addFromCalendar = true,\r\n\r\n  closeCover,\r\n  ...props\r\n}: AssetPopUpProps) => {\r\n  const { t } = useTranslation();\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const history = useHistory();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n\r\n  const [rows, setRows] = useState<IAssetRow[]>([]);\r\n  const [selectColumns, setSelectColumns] = useState<string>('');\r\n  const [expandColumns, setExpandColumns] = useState<string>('');\r\n  const [data, setData] = useState<IAsset | undefined>();\r\n  const [buttonsData, setButtonsData] = useState<IAsset | undefined>();\r\n  const [loading, setLoading] = useState<boolean>(true);\r\n  const [idChanged, setIdChanged] = useState<boolean>(false);\r\n  const [loadingAdditionalData, setLoadingAdditionalData] = useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [\r\n    loadingButtonsAdditionalData,\r\n    setLoadingButtonsAdditionalData,\r\n  ] = useState<boolean | undefined>(undefined);\r\n  const [openEndUsage, setOpenEndUsage] = useState(false);\r\n  const [endUsageProcessing, setEndUsageProcessing] = useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const {\r\n    cover: assetCover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState();\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const topServiceGroupsIsHidden = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.HideTopServiceGroupFilter),\r\n  );\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const [counters, setCounters] = useState<CountersForTabs>(countersForTabs);\r\n  const location = useLocation();\r\n  const isMobile = DetectIsMobile();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const assetProps = useSelector(selectAssetPopupSettings);\r\n  const shortView = React.useMemo(() => {\r\n    return isMobile || (useSidePanel === true && !sidePanelExpanded) || isCover;\r\n  }, [isCover, isMobile, sidePanelExpanded, useSidePanel]);\r\n  const isAdmin = React.useMemo(() => {\r\n    if (data === undefined) {\r\n      return false;\r\n    }\r\n    const serviceGroupId = data?.ServiceGroup?.Id ?? undefined;\r\n    const serviceId = data?.ServiceId ?? undefined;\r\n    const serviceTypeId =\r\n      data?.ServiceType === null\r\n        ? undefined\r\n        : ServiceType[data.ServiceType] ?? undefined;\r\n    const result =\r\n      authenticatedUser?.HasAdminGroupOnlyPermissions(serviceGroupId) ||\r\n      authenticatedUser?.HasAdminServiceOnlyPermissions(\r\n        serviceTypeId !== undefined ? serviceTypeId : 1,\r\n        serviceId,\r\n      );\r\n    console.debug('foo', result);\r\n    return result ?? false;\r\n  }, [authenticatedUser, data]);\r\n  const isDashboardCore = React.useMemo(() => {\r\n    var path = location.pathname;\r\n    return path.toLowerCase() === '/dashboards/core/' + data?.ServiceGroup?.Id;\r\n  }, [data?.ServiceGroup?.Id, location.pathname]);\r\n  const assetFieldEnabled = React.useCallback(\r\n    (\r\n      AssetField: AssetAttributes,\r\n      AssetAvailabilityType?: AssetTypes,\r\n    ): boolean => {\r\n      if (isAuthenticated) {\r\n        return IsAssetFieldEnabled(\r\n          appSettings,\r\n          AssetField,\r\n          AssetAvailabilityType,\r\n        );\r\n      } else {\r\n        return (\r\n          IsAssetFieldEnabled(appSettings, AssetField, AssetAvailabilityType) &&\r\n          IsAssetFieldIsPublic(appSettings, AssetField, AssetAvailabilityType)\r\n        );\r\n      }\r\n    },\r\n    [appSettings, isAuthenticated],\r\n  );\r\n  const updateCounters = useCallback(\r\n    (name: string, count: number) => {\r\n      const tempCounters = Object.assign({}, counters);\r\n      tempCounters[name].Count = count;\r\n      setCounters(tempCounters);\r\n    },\r\n    [counters],\r\n  );\r\n  const updateCountersEnable = useCallback(\r\n    (name: string, enabled: boolean) => {\r\n      const tempCounters = counters;\r\n      tempCounters[name].Enabled = enabled;\r\n      setCounters(tempCounters);\r\n    },\r\n    [counters],\r\n  );\r\n  const dict: Record<string, IAssetRow> = useMemo(() => {\r\n    return getRows(\r\n      t,\r\n      globalSettings,\r\n      openPanel,\r\n      publicUrl,\r\n      isCover,\r\n      useSidePanel,\r\n      isAdmin,\r\n      shortView,\r\n      isAuthenticated,\r\n    ).reduce((res, current) => {\r\n      res[current.Id] = current;\r\n      return res;\r\n    }, {});\r\n  }, [\r\n    t,\r\n    globalSettings,\r\n    openPanel,\r\n    publicUrl,\r\n    isCover,\r\n    useSidePanel,\r\n    isAdmin,\r\n    shortView,\r\n    isAuthenticated,\r\n  ]);\r\n\r\n  const mismatchCore = useMemo(() => {\r\n    return MismatchCore(\r\n      data,\r\n      isAuthenticated,\r\n      topServiceGroupsIsHidden,\r\n      selectedServiceGroups,\r\n    );\r\n  }, [data, isAuthenticated, selectedServiceGroups, topServiceGroupsIsHidden]);\r\n  const loadAdditionalData = useCallback(\r\n    async (data: IAssetDetails2Dto) => {\r\n      const res = Object.assign({}, data);\r\n      if (!!res) {\r\n        setLoadingAdditionalData(true);\r\n        try {\r\n          const ad:\r\n            | AssetDetailsAdditionalData\r\n            | undefined = await fetchAssetAdditionalData({\r\n            Id: res.Id,\r\n            typeId: AvailabilityTypes[res.AvailabilityType.Id] as number,\r\n            isAuth: isAuthenticated,\r\n            buttonsData: false,\r\n          });\r\n          if (!!ad) {\r\n            res.ApprovalRequired = ad.ApprovalRequired;\r\n            res.Status = ad.Status;\r\n            res.StatusId = ad.StatusId;\r\n            res.AssetAssemblyStructure = ad.AssemblyStructure;\r\n            res.HideTrainingSession = ad.HideTrainingSession;\r\n            res.Range = ad.Range;\r\n            res.ForceTutoring = ad.ForceTutoring;\r\n            res.Allowed_ByTraining = ad.Allowed_ByTraining;\r\n            res.EndUsageIds = ad.EndUsageIds;\r\n            if (res.ServiceGroup !== undefined && res.ServiceGroup !== null) {\r\n              res.ServiceGroup.CanRequestAccess = ad.CanRequestAccess;\r\n              res.ServiceGroup.ApprovalStatusId = ad.ApprovalStatusId;\r\n            }\r\n            res.CanBeCreatedFromLinkOnly = ad.CanBeCreatedFromLinkOnly;\r\n            res.NotAllowReservations = ad.NotAllowReservations;\r\n            res.ReservationEnabled = GetReservationEnabled(\r\n              AvailabilityTypes[res.AvailabilityType.Id],\r\n              res.Active,\r\n              !!res.NotAllowReservations,\r\n            );\r\n            setData(res);\r\n          }\r\n        } finally {\r\n          setLoadingAdditionalData(false);\r\n        }\r\n      }\r\n    },\r\n    [isAuthenticated],\r\n  );\r\n  const loadButtonsAdditionalData = useCallback(\r\n    async (data: IAssetDetails2Dto) => {\r\n      const res = Object.assign({}, buttonsData);\r\n      if (!!data) {\r\n        setLoadingButtonsAdditionalData(true);\r\n        try {\r\n          const ad:\r\n            | AssetDetailsAdditionalData\r\n            | undefined = await fetchAssetAdditionalData({\r\n            Id: data.Id,\r\n            typeId: AvailabilityTypes[data.AvailabilityType.Id] as number,\r\n            isAuth: isAuthenticated,\r\n            buttonsData: true,\r\n          });\r\n          if (!!ad) {\r\n            res.AutoMode = ad.AutoMode;\r\n            res.UsageEnabled = GetUsageEnabled(\r\n              AvailabilityTypes[data.AvailabilityType.Id],\r\n              data.Active,\r\n              res.AutoMode,\r\n            );\r\n            res.UsageId = ad.UsageId;\r\n            res.CanStartUsage = ad.CanStartUsage;\r\n            res.CanEndUsage = ad.CanEndUsage;\r\n            res.Alerts = ad.Alerts;\r\n            res.PlanedEventsEnabled = ad.PlanedEventsEnabled;\r\n            res.AlertInfo = ad.AlertInfo;\r\n            res.NotifyExists = ad.NotifyExists;\r\n            res.NotAllowReservations = ad.NotAllowReservations;\r\n            res.AssemblyId = ad.AssemblyId;\r\n            res.ReservationEnabled = GetReservationEnabled(\r\n              AvailabilityTypes[data.AvailabilityType.Id],\r\n              data.Active,\r\n              !!res.NotAllowReservations,\r\n            );\r\n            res.ShowFeed = ad.ShowFeed;\r\n            setButtonsData(res);\r\n          }\r\n        } finally {\r\n          setLoadingButtonsAdditionalData(false);\r\n        }\r\n      }\r\n    },\r\n    [buttonsData, isAuthenticated],\r\n  );\r\n\r\n  const loadCounters = useCallback(\r\n    (data: IAssetDetails2Dto) => {\r\n      if (data.Id !== undefined) {\r\n        if (counters.TrainingSessions.Enabled) {\r\n          GetTrainingSessionsTableCount(\r\n            data.Id,\r\n            'TrainingSessions',\r\n            updateCounters,\r\n            data.ServiceGroup.Id,\r\n            data.AvailabilityType.Id,\r\n          );\r\n        }\r\n        GetWorkOrdersTableCount(\r\n          data.Id,\r\n          false,\r\n          'WorkOrders',\r\n          updateCounters,\r\n          data.ServiceGroup.Id,\r\n          data.AvailabilityType.Id,\r\n        );\r\n        GetWorkOrdersTableCount(\r\n          data.Id,\r\n          true,\r\n          'Calibrations',\r\n          updateCounters,\r\n          data.ServiceGroup.Id,\r\n          data.AvailabilityType.Id,\r\n        );\r\n        GetArticlesTableCount(\r\n          data.Id,\r\n          data.ServiceGroup?.Id,\r\n          'Publications',\r\n          updateCounters,\r\n          data.AvailabilityType.Id,\r\n        );\r\n      }\r\n    },\r\n    [counters.TrainingSessions.Enabled, updateCounters],\r\n  );\r\n\r\n  const enabledAssetProps = React.useMemo(() => {\r\n    const id = data?.AvailabilityType?.Id;\r\n    if (id !== undefined) {\r\n      const res = assetProps.filter(a =>\r\n        assetFieldEnabled(\r\n          AssetAttributes[a.Id],\r\n          GetAssetTypeFrom(AvailabilityTypes[id]),\r\n        ),\r\n      );\r\n      return res;\r\n    } else {\r\n      return assetProps;\r\n    }\r\n  }, [assetFieldEnabled, assetProps, data?.AvailabilityType?.Id]);\r\n  const columnNamesFilter = React.useCallback((r: IAssetRow) => {\r\n    return (\r\n      r.State === undefined &&\r\n      [\r\n        'AssetAssemblyStructure',\r\n        'Status',\r\n        'Division',\r\n        'AssetCatGroup',\r\n        'Range',\r\n      ].includes(r.PropName ?? r.Id) === false &&\r\n      r.Id !== 'ForceTutoring'\r\n    );\r\n  }, []);\r\n  const setRequestParams = React.useCallback(\r\n    (rows: IAssetRow[]) => {\r\n      if (rows.length > 0) {\r\n        let columns = [\r\n          ...rows\r\n            .filter(r => columnNamesFilter(r))\r\n            .map(v => v.PropName ?? v.Id),\r\n          ...DefaultAttributes,\r\n        ];\r\n        setSelectColumns('Active,' + columns.join(','));\r\n        setExpandColumns(\r\n          columns\r\n            .filter(column => ExpandableRows.includes(column))\r\n            //.concat('ServiceGroup')\r\n            .join(','),\r\n        );\r\n      }\r\n    },\r\n    [columnNamesFilter],\r\n  );\r\n  useEffect(() => {\r\n    if (!!data) {\r\n      if ((identifier as AssetIdIdentifier).id !== undefined) {\r\n        if (data.Id !== (identifier as AssetIdIdentifier).id) {\r\n          setIdChanged(true);\r\n        }\r\n      } else if (\r\n        (identifier as AssetServiceIdentifier).serviceId !== undefined &&\r\n        (identifier as AssetServiceIdentifier).serviceType !== undefined\r\n      ) {\r\n        if (\r\n          data.ServiceId !== (identifier as AssetServiceIdentifier).serviceId\r\n        ) {\r\n          setIdChanged(true);\r\n        }\r\n      } else if (\r\n        (identifier as AssetInternalCodeIdentifier).internalCode !== undefined\r\n      ) {\r\n        if (\r\n          data.InternalCode !==\r\n          (identifier as AssetInternalCodeIdentifier).internalCode\r\n        ) {\r\n          setIdChanged(true);\r\n        }\r\n      }\r\n    }\r\n  }, [data, identifier]);\r\n  useEffect(() => {\r\n    moveArrayItem(enabledAssetProps, 'ImageName', 0);\r\n    addArrayItemByName(\r\n      enabledAssetProps,\r\n      'AssetAssemblyStructure',\r\n      'ImageName',\r\n    );\r\n    moveArrayItemByName(enabledAssetProps, 'Status', 'ServiceGroup');\r\n    const rs = [\r\n      ...DefaultRows.map(r => dict[r]),\r\n      ...enabledAssetProps.flatMap(assetProp => {\r\n        let val = dict[assetProp.Id];\r\n        if (!!val) {\r\n          val.Name = assetProp.DisplayName ?? val.Name;\r\n          if (val.dependencies && !!val.dependencies.length) {\r\n            return [val, ...val.dependencies.map(v => dict[v])];\r\n          }\r\n        }\r\n        return val;\r\n      }),\r\n    ].filter(v => !!v);\r\n    setRequestParams(rs);\r\n    setRows(rs);\r\n  }, [assetProps, dict, enabledAssetProps, setRequestParams]);\r\n  useEffect(() => {\r\n    if (rows.length === 0 || (data !== undefined && idChanged === false))\r\n      return;\r\n    setLoading(true);\r\n    let active = true;\r\n    const cancelToken = httpClient.cancelToken.source();\r\n    async function fetchData() {\r\n      try {\r\n        const params = {\r\n          $select: selectColumns,\r\n          $expand: expandColumns,\r\n        };\r\n\r\n        const res = await fetchAssetBy({\r\n          id: identifier,\r\n          params,\r\n          isAuth: isAuthenticated,\r\n        });\r\n\r\n        if (active && res !== undefined) {\r\n          res.Division = res.ServiceGroup?.DivisionName;\r\n          res.AssetCatGroup =\r\n            res.AssetCat !== null && !!res.AssetCat\r\n              ? res.AssetCat.AssetCatGroupName\r\n              : null;\r\n          res.Status = ' ';\r\n          res.AlertsEnabled = isAuthenticated\r\n            ? GetAlertsEnabled(\r\n                AvailabilityTypes[res.AvailabilityType.Id],\r\n                res.Active,\r\n              )\r\n            : false;\r\n          setData(res);\r\n          loadButtonsAdditionalData(res);\r\n          loadAdditionalData(res);\r\n          if (isAuthenticated) {\r\n            loadCounters(res);\r\n          }\r\n        }\r\n        setLoading(false);\r\n        setIdChanged(false);\r\n      } catch (error) {\r\n        console.error(error);\r\n        setLoading(false);\r\n      }\r\n    }\r\n\r\n    fetchData();\r\n\r\n    return () => {\r\n      active = false;\r\n      setLoading(false);\r\n      cancelToken.cancel('cancelled');\r\n    };\r\n  }, [\r\n    data,\r\n    expandColumns,\r\n    idChanged,\r\n    identifier,\r\n    isAuthenticated,\r\n    loadAdditionalData,\r\n    loadButtonsAdditionalData,\r\n    loadCounters,\r\n    rows.length,\r\n    selectColumns,\r\n  ]);\r\n\r\n  const handleEndUsage = React.useCallback(\r\n    (usageData: EndUsageData) => {\r\n      if (buttonsData?.UsageId) {\r\n        setEndUsageProcessing(true);\r\n        AssetDetailsApi.endUsage(buttonsData?.UsageId, usageData)\r\n          .then(response => {\r\n            setEndUsageProcessing(false);\r\n\r\n            if (response.ErrorMessages.length > 0) {\r\n              response.ErrorMessages.forEach(errmsg =>\r\n                dispatch(\r\n                  actions.addNotification({\r\n                    variant: 'error',\r\n                    message: errmsg,\r\n                  }),\r\n                ),\r\n              );\r\n            } else {\r\n              setOpenEndUsage(false);\r\n              if (data !== undefined) {\r\n                loadButtonsAdditionalData(data);\r\n              }\r\n              if (response.SuccessMessages.length > 0) {\r\n                response.SuccessMessages.forEach(msg =>\r\n                  dispatch(\r\n                    actions.addNotification({\r\n                      variant: 'success',\r\n                      message: msg,\r\n                    }),\r\n                  ),\r\n                );\r\n              }\r\n              if (response.WarningMessages.length > 0) {\r\n                response.WarningMessages.forEach(wrnmsg =>\r\n                  dispatch(\r\n                    actions.addNotification({\r\n                      variant: 'warning',\r\n                      message: wrnmsg,\r\n                    }),\r\n                  ),\r\n                );\r\n              }\r\n            }\r\n          })\r\n          .catch(e => console.error(e))\r\n          .finally(() => setEndUsageProcessing(false));\r\n      }\r\n    },\r\n    [actions, buttonsData?.UsageId, data, dispatch, loadButtonsAdditionalData],\r\n  );\r\n\r\n  const getTopAssetActionsDropDown = useTopAssetActionsDropDown({\r\n    isMismatchCore: mismatchCore,\r\n    isAdmin: isAdmin,\r\n  });\r\n\r\n  const topActions = useMemo(() => {\r\n    let buttonActions = [] as ActionRenderer[];\r\n    if (\r\n      data !== undefined &&\r\n      buttonsData !== undefined &&\r\n      data.AvailabilityType !== undefined &&\r\n      loading === false &&\r\n      loadingButtonsAdditionalData === false\r\n    ) {\r\n      const bookable = isBookable(data.AvailabilityType.Id);\r\n      const addWorkOrder = () => {\r\n        if (alertsEnabled(data.AvailabilityType.Id) && isAuthenticated) {\r\n          buttonActions.push(() => (\r\n            <CreateAnAssetRelatedEvent\r\n              assetId={data.Id}\r\n              mismatchCore={mismatchCore}\r\n              useSidePanel={useSidePanel}\r\n              openPanel={openPanel}\r\n            />\r\n          ));\r\n        }\r\n      };\r\n      const addReservation = () => {\r\n        if (!buttonsData.AssemblyId && buttonsData.ReservationEnabled) {\r\n          buttonActions.push(() => (\r\n            <ReservationCreateButton\r\n              size=\"small\"\r\n              color=\"primary\"\r\n              startIcon={<Icon icon=\"plus\" />}\r\n              variant={bookable ? 'main' : 'white'}\r\n              title={t(translations.PlaceAReservation)}\r\n              disabled={mismatchCore}\r\n              instruments={data.ServiceId === null ? [] : [data.ServiceId]}\r\n              useSidePanel={useSidePanel}\r\n              openPanelOrCover={openPanel}\r\n            >\r\n              {t(translations.Reservation)}\r\n            </ReservationCreateButton>\r\n          ));\r\n        }\r\n      };\r\n      const addServiceRequest = () => {\r\n        if (\r\n          data.ServiceType === 'Sample' &&\r\n          data.CanBeCreatedFromLinkOnly === false\r\n        ) {\r\n          buttonActions.push(() => (\r\n            <Button\r\n              key=\"service-request\"\r\n              size=\"small\"\r\n              onClick={() => {\r\n                history.push(\r\n                  '/ServiceRequests?OfflineServiceTypeId=' +\r\n                    data.ServiceId +\r\n                    '&Active=true',\r\n                );\r\n              }}\r\n              title={t(translations.SampleRequests)}\r\n              startIcon={<Icon icon={'history'} />}\r\n              disabled={mismatchCore}\r\n            >\r\n              {t(translations.SampleRequests)}\r\n            </Button>\r\n          ));\r\n        }\r\n      };\r\n      const addReservationFromCalendar = () => {\r\n        if (!buttonsData.AssemblyId && buttonsData.ReservationEnabled) {\r\n          buttonActions.push(() => (\r\n            <CalendarButton\r\n              size=\"small\"\r\n              color=\"primary\"\r\n              variant={bookable ? 'main' : 'white'}\r\n              startIcon={<Icon icon=\"plus\" />}\r\n              title={t(translations.PlaceAReservation)}\r\n              equipments={data.ServiceId === null ? [] : [data.ServiceId]}\r\n              disabled={mismatchCore}\r\n              openToBook={true}\r\n              target={isAuthenticated ? '_self' : '_blank'}\r\n            >\r\n              {t(translations.Reservation)}\r\n            </CalendarButton>\r\n          ));\r\n        }\r\n      };\r\n      const addUsage = () => {\r\n        if (!!buttonsData.UsageEnabled) {\r\n          if (!!buttonsData.CanStartUsage && !buttonsData.AssemblyId) {\r\n            buttonActions.push(() => (\r\n              <Button\r\n                size=\"small\"\r\n                variant=\"white\"\r\n                startIcon={<Icon icon=\"play\" />}\r\n                href={toRootedURL(`/Usage.aspx?id=${data.ServiceId}`)}\r\n                target={'_blank'}\r\n                title={t(translations.StartUsage)}\r\n                disabled={mismatchCore}\r\n              >\r\n                {t(translations.Use)}\r\n              </Button>\r\n            ));\r\n          }\r\n          if (!!buttonsData.CanEndUsage && !!buttonsData.UsageId) {\r\n            buttonActions.push(() => (\r\n              <Button\r\n                size=\"small\"\r\n                variant=\"white\"\r\n                startIcon={<Icon icon=\"pause\" />}\r\n                title={t(translations.StopUsage)}\r\n                onClick={() => setOpenEndUsage(true)}\r\n                disabled={mismatchCore}\r\n              >\r\n                {t(translations.Stop)}\r\n              </Button>\r\n            ));\r\n          }\r\n        }\r\n      };\r\n      const addTakeDown = () => {\r\n        if (\r\n          isBookable(data.AvailabilityType?.Id) &&\r\n          buttonsData.AlertInfo !== undefined &&\r\n          !!buttonsData.PlanedEventsEnabled &&\r\n          !!buttonsData.AlertInfo.show &&\r\n          isAuthenticated\r\n        ) {\r\n          if (!buttonsData.AlertInfo.hasDownActive) {\r\n            if (\r\n              !!buttonsData.AlertInfo.isAdmin &&\r\n              !!buttonsData.AlertInfo.assetId\r\n            ) {\r\n              buttonActions.push(() => (\r\n                <DropDown\r\n                  size=\"small\"\r\n                  color=\"primary\"\r\n                  variant=\"white\"\r\n                  disabled={mismatchCore}\r\n                  title={t(translations.HasNoAlertsAdmin_info)}\r\n                  menuChildren={() => {\r\n                    let res = [\r\n                      <MenuItem key={'title for this menu'} disabled>\r\n                        {t(translations.PleaseSelectAnEventType)}\r\n                      </MenuItem>,\r\n                    ];\r\n                    if (buttonsData.Alerts !== undefined) {\r\n                      res.push(\r\n                        ...buttonsData.Alerts.map(a => (\r\n                          <MenuItem\r\n                            onClick={() =>\r\n                              openPanel({\r\n                                renderPageType: RenderPageType.WorkOrderDetails,\r\n                                renderPageProps: {\r\n                                  queryParams: {\r\n                                    aType: a.Id.toString(),\r\n                                    assetId:\r\n                                      !!buttonsData.AlertInfo &&\r\n                                      !!buttonsData.AlertInfo.assetId\r\n                                        ? buttonsData.AlertInfo.assetId.toString()\r\n                                        : undefined,\r\n                                    down: true.toString(),\r\n\r\n                                    offH: true.toString(),\r\n                                  },\r\n                                  useSidePanel: true,\r\n                                } as WorkOrderDetailsProps,\r\n                                expanded: false,\r\n                                useSidePanel: useSidePanel,\r\n                                isCover: useSidePanel,\r\n                              })\r\n                            }\r\n                            key={a.Id + a.Name + 'key'}\r\n                          >\r\n                            {a.Name}\r\n                          </MenuItem>\r\n                        )),\r\n                      );\r\n                    }\r\n                    return res;\r\n                  }}\r\n                >\r\n                  <Icon icon=\"power-off\" color=\"danger\" />\r\n                </DropDown>\r\n              ));\r\n            }\r\n          } else if (\r\n            !!buttonsData.AlertInfo.noAlerts ||\r\n            !!buttonsData.AlertInfo.hasActive\r\n          ) {\r\n            if (\r\n              !!buttonsData.AlertInfo.isAdmin &&\r\n              !!buttonsData.AlertInfo.alertId\r\n            ) {\r\n              buttonActions.push(() => (\r\n                <Button\r\n                  size=\"small\"\r\n                  variant=\"white\"\r\n                  disabled={mismatchCore}\r\n                  title={t(translations.HasActiveDownAlertsAdmin_info)}\r\n                  onClick={() =>\r\n                    openPanel({\r\n                      renderPageType: RenderPageType.WorkOrderDetails,\r\n                      renderPageProps: {\r\n                        queryParams: {\r\n                          id: (buttonsData.AlertInfo?.alertId ?? -1).toString(),\r\n                          Up: TrendingUpRounded.toString(),\r\n                        },\r\n                        useSidePanel: true,\r\n                      } as WorkOrderDetailsProps,\r\n                      expanded: false,\r\n                      useSidePanel: useSidePanel,\r\n                      isCover: useSidePanel,\r\n                    } as SidePanelOpenState)\r\n                  }\r\n                >\r\n                  <Icon icon=\"plug\" color=\"success\" />\r\n                </Button>\r\n              ));\r\n            }\r\n          }\r\n        }\r\n      };\r\n\r\n      const addConsumable = () => {\r\n        if (data.ServiceType === 'Offline' && isAuthenticated) {\r\n          buttonActions.push(() => (\r\n            <Button\r\n              size=\"small\"\r\n              variant=\"main\"\r\n              disabled={mismatchCore}\r\n              startIcon={<Icon icon=\"plus\" />}\r\n              title={t(translations.ReportAConsumable)}\r\n              onClick={() => {\r\n                let params = {\r\n                  useSidePanel: true,\r\n                  queryParams: {\r\n                    stid: data.ServiceId?.toString(),\r\n                    user: authenticatedUser?.Id,\r\n                  },\r\n                } as ReportConsumablesProps;\r\n                openPanel({\r\n                  renderPageType: RenderPageType.ReportConsumables,\r\n                  renderPageProps: params,\r\n                  expanded: false,\r\n                  useSidePanel: useSidePanel,\r\n                  isCover: useSidePanel,\r\n                } as SidePanelOpenState);\r\n              }}\r\n              //href={toRootedURL(`/reportConsumables?stid=${data.ServiceId}`)}\r\n            >\r\n              {t(translations.LogConsumables)}\r\n            </Button>\r\n          ));\r\n        }\r\n      };\r\n\r\n      const addCoreBoard = () => {\r\n        if (!isDashboardCore) {\r\n          buttonActions.push(() => (\r\n            <Button\r\n              size=\"small\"\r\n              variant=\"white\"\r\n              disabled={mismatchCore}\r\n              title={t(translations.SwitchToCoreOpenItsBoard)}\r\n              onClick={() => {\r\n                dispatch(\r\n                  actions.saveGlobalServiceGroupFilter([\r\n                    {\r\n                      Id: data.ServiceGroup?.Id,\r\n                      Name: data.ServiceGroup?.Name,\r\n                    },\r\n                  ]),\r\n                );\r\n                dispatch(layoutActions.resetSidePanel());\r\n                history.push('/dashboards/core/' + data.ServiceGroup?.Id ?? '');\r\n              }}\r\n            >\r\n              {t(translations.CoreBoard)}\r\n            </Button>\r\n          ));\r\n        }\r\n      };\r\n      const addRequestAccess = () => {\r\n        if (!isAdmin && isAuthenticated) {\r\n          const approvalStatus =\r\n            data.ServiceGroup?.ApprovalStatusId ===\r\n            ServiceGroupRegistrationStatus.Approved;\r\n          if (data.ServiceGroup?.CanRequestAccess && !approvalStatus) {\r\n            buttonActions.push(() => (\r\n              <Button\r\n                size=\"small\"\r\n                variant=\"main\"\r\n                onClick={() => {\r\n                  window.open(\r\n                    toRootedURL(\r\n                      `/ServiceGroupRegister.aspx?sgid=${data.ServiceGroup?.Id}`,\r\n                    ),\r\n                    '_blank',\r\n                  );\r\n                }}\r\n              >\r\n                {t(translations.RequestAccess)}\r\n              </Button>\r\n            ));\r\n          } else {\r\n            buttonActions.push(() => (\r\n              <Badge>\r\n                {t(\r\n                  translations[\r\n                    ServiceGroupRegistrationStatus[\r\n                      data.ServiceGroup?.ApprovalStatusId ?? 0\r\n                    ]\r\n                  ],\r\n                )}\r\n              </Badge>\r\n            ));\r\n          }\r\n        }\r\n      };\r\n      if (\r\n        data.ServiceType === 'Sample' &&\r\n        data.CanBeCreatedFromLinkOnly === false\r\n      ) {\r\n        addServiceRequest();\r\n      }\r\n      if (bookable) {\r\n        if (addFromCalendar) {\r\n          addReservationFromCalendar();\r\n        } else {\r\n          addReservation();\r\n        }\r\n\r\n        addUsage();\r\n        addWorkOrder();\r\n        addTakeDown();\r\n      } else {\r\n        addWorkOrder();\r\n        addTakeDown();\r\n        addUsage();\r\n        addReservation();\r\n        addConsumable();\r\n      }\r\n      addCoreBoard();\r\n      addRequestAccess();\r\n      if (isAuthenticated) {\r\n        const assetActionsDropDown = getTopAssetActionsDropDown({\r\n          data,\r\n          buttonsData,\r\n        });\r\n\r\n        buttonActions.push(...assetActionsDropDown.map(item => () => item));\r\n      }\r\n    }\r\n    return buttonActions;\r\n  }, [\r\n    actions,\r\n    addFromCalendar,\r\n    authenticatedUser?.Id,\r\n    buttonsData,\r\n    data,\r\n    dispatch,\r\n    getTopAssetActionsDropDown,\r\n    history,\r\n    isAdmin,\r\n    isAuthenticated,\r\n    isDashboardCore,\r\n    layoutActions,\r\n    loading,\r\n    loadingButtonsAdditionalData,\r\n    mismatchCore,\r\n    openPanel,\r\n    t,\r\n    useSidePanel,\r\n  ]);\r\n\r\n  const tabs = useMemo(() => {\r\n    if (data !== undefined) {\r\n      const res: TabContent[] = [];\r\n      res.push({\r\n        Name: t(translations.AssetDetailsTab_Details),\r\n        Id: 'details',\r\n        Content: (\r\n          <AssetDetailsTabContent\r\n            rows={rows}\r\n            data={data}\r\n            shortView={shortView}\r\n            loadingAdditionalData={loadingAdditionalData}\r\n            isAdmin={isAdmin === true}\r\n            isCover={isCover}\r\n            commentsForStaff={!!data.CommentsAreStaffonly}\r\n          />\r\n        ),\r\n      });\r\n      if (isBookable(data.AvailabilityType?.Id) && isAuthenticated) {\r\n        res.push({\r\n          Name: t(translations.BookingRules),\r\n          Id: 'BookingRules',\r\n          Content: (\r\n            <AssetBookingRules\r\n              serviceId={data.ServiceId ?? undefined}\r\n              serviceGroupId={data.ServiceGroup?.Id ?? undefined}\r\n              useShortView={shortView}\r\n              useSidePanel={useSidePanel}\r\n            />\r\n          ),\r\n        });\r\n      }\r\n      if (isBookable(data.AvailabilityType?.Id) && isAuthenticated) {\r\n        if (\r\n          data.AvailabilityType?.Id !== 'LectureRoom' ||\r\n          (!data.HideTrainingSession && data.Active)\r\n        ) {\r\n          const serviceType =\r\n            data.ServiceType !== null\r\n              ? ServiceType[data.ServiceType]\r\n              : undefined;\r\n          res.push({\r\n            Name: t(translations.TrainingSessions),\r\n            Id: 'trainingSessions',\r\n            Content: (\r\n              <AssetTrainingSessions\r\n                assetId={data.Id}\r\n                serviceId={data.ServiceId}\r\n                serviceTypeId={serviceType}\r\n                isMobile={shortView}\r\n                serviceGroupId={data.ServiceGroup?.Id}\r\n                availabilityType={data.AvailabilityType?.Id}\r\n                openPanel={openPanel}\r\n                useSidePanel={useSidePanel}\r\n              />\r\n            ),\r\n            endIcon: <BadgeCounter count={counters.TrainingSessions.Count} />,\r\n          });\r\n          updateCountersEnable('TrainingSessions', true);\r\n        } else {\r\n          updateCountersEnable('TrainingSessions', false);\r\n        }\r\n      }\r\n      if (isAuthenticated) {\r\n        res.push({\r\n          Name: t(translations.AssetDetailsTab_WorkOrders),\r\n          Id: 'workOrders',\r\n          Content: (\r\n            <AssetWorkOrders\r\n              assetId={data.Id}\r\n              assetName={data.Name}\r\n              isMobile={shortView}\r\n              allowToAddNew={isOnlineService(data.AvailabilityType?.Id)}\r\n              openPanel={openPanel}\r\n              useSidePanel={useSidePanel}\r\n              serviceGroupId={data.ServiceGroup?.Id}\r\n              availabilityType={data.AvailabilityType?.Id}\r\n            />\r\n          ),\r\n          endIcon: <BadgeCounter count={counters.WorkOrders.Count} />,\r\n        });\r\n      }\r\n      if (isAuthenticated) {\r\n        res.push({\r\n          Name: t(translations.Calibrations),\r\n          Id: 'calibrations',\r\n          Content: (\r\n            <AssetWorkOrders\r\n              assetId={data.Id}\r\n              assetName={data.Name}\r\n              calibration={true}\r\n              isMobile={shortView}\r\n              openPanel={openPanel}\r\n              useSidePanel={useSidePanel}\r\n              allowToAddNew={isOnlineService(data.AvailabilityType?.Id)}\r\n              serviceGroupId={data.ServiceGroup?.Id}\r\n              availabilityType={data.AvailabilityType?.Id}\r\n            />\r\n          ),\r\n          endIcon: <BadgeCounter count={counters.Calibrations.Count} />,\r\n        });\r\n      }\r\n      if (isAuthenticated) {\r\n        res.push({\r\n          Name: t(translations.Publications),\r\n          Id: 'publications',\r\n          Content: (\r\n            <AssetArticlesTable\r\n              assetId={data.Id}\r\n              serviceGroupId={data.ServiceGroup?.Id}\r\n              isMobile={shortView}\r\n              openPanel={openPanel}\r\n              availabilityType={data.AvailabilityType?.Id}\r\n              useSidePanel={useSidePanel}\r\n            />\r\n          ),\r\n          endIcon: <BadgeCounter count={counters.Publications.Count} />,\r\n        });\r\n      }\r\n      /*res.push({\r\n          Name:\r\n            t(translations.AssetDetailsTab_MyReservations) +\r\n            ` (${counters.Reservations.Count})`,\r\n          Id: 'my_reservations',\r\n          Content: <>reservations</>,\r\n        });*/\r\n      /*res.push({\r\n          Name: t(translations.AssetDetailsTab_Schedule),\r\n          Id: 'schedule',\r\n          Content: <>schedule</>,\r\n        });*/\r\n      return res;\r\n    } else return [];\r\n  }, [\r\n    counters.Calibrations.Count,\r\n    counters.Publications.Count,\r\n    counters.TrainingSessions.Count,\r\n    counters.WorkOrders.Count,\r\n    data,\r\n    isAdmin,\r\n    isAuthenticated,\r\n    isCover,\r\n    loadingAdditionalData,\r\n    openPanel,\r\n    rows,\r\n    shortView,\r\n    t,\r\n    updateCountersEnable,\r\n    useSidePanel,\r\n  ]);\r\n\r\n  const handleCloselClick = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: isCover,\r\n      useSidePanel: useSidePanel,\r\n      onClose: () => {\r\n        !!onClose && onClose();\r\n      },\r\n    } as SidePanelCloseState);\r\n  }, [closePanel, isCover, onClose, useSidePanel]);\r\n\r\n  // more direct loading/fetch state indicator will be more appropriate here to determine that fetch operations are finished and no asset details were found\r\n  const dataFound = data && tabs !== undefined && tabs.length > 0;\r\n  if (!loading && !dataFound && data === undefined) {\r\n    return <NotFoundPage />;\r\n  }\r\n  return (\r\n    <PageWrapper\r\n      id=\"asset_details\"\r\n      useSidePanel={useSidePanel ?? false}\r\n      hideMenu={!isAuthenticated}\r\n      closable={useSidePanel === true}\r\n      loading={loading || rows.length === 0}\r\n      pageLink={\r\n        data === undefined\r\n          ? undefined\r\n          : buildURL(`${publicUrl}Assets/Details`, { id: data?.Id })\r\n      }\r\n      toPageLink={\r\n        data === undefined ? undefined : `Assets/Details?id=${data?.Id}`\r\n      }\r\n      pageName={t(translations.Instrument)}\r\n      titlePage={data?.Name ?? undefined}\r\n      titleTooltip={data?.Name + t(translations.ShowAssetFull)}\r\n      children={\r\n        <Fragment>\r\n          {dataFound ? (\r\n            <React.Fragment>\r\n              <AssetDetailsTabs\r\n                tabs={tabs}\r\n                isMobile={isMobile}\r\n                shortView={shortView ?? false}\r\n              />\r\n              {isAuthenticated && buttonsData?.UsageId && (\r\n                <React.Fragment>\r\n                  <EndUsageConfirm\r\n                    ids={data.EndUsageIds}\r\n                    usageId={buttonsData?.UsageId}\r\n                    isopen={openEndUsage}\r\n                    usageProcessing={endUsageProcessing}\r\n                    onClose={() => setOpenEndUsage(false)}\r\n                    onConfirm={handleEndUsage}\r\n                  />\r\n                </React.Fragment>\r\n              )}\r\n              <Messages pageName=\"assetDetails\" />\r\n            </React.Fragment>\r\n          ) : (\r\n            <>{t(translations.err_Equipment_NotFound)}</>\r\n          )}\r\n        </Fragment>\r\n      }\r\n      closeSidePanel={handleCloselClick}\r\n      rightTopActions={!shortView ? topActions : undefined}\r\n      rightActionsLoading={!shortView && loadingButtonsAdditionalData}\r\n      leftTopActions={shortView ? topActions : undefined}\r\n      leftActionsLoading={shortView && loadingButtonsAdditionalData}\r\n      maxLeftTopButtonsLength={\r\n        data?.ReservationEnabled ? maxLeftTopButtonsLength : 1\r\n      }\r\n      rightTopActionsLength={data?.ReservationEnabled ? 2 : 1}\r\n      isCover={isCover}\r\n      closeCover={!isCover ? onCloseCover : closeCover}\r\n      cover={assetCover}\r\n      coverClosed={coverClosed}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * Link\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport * as H from 'history';\r\nimport { IPathAndQuery, toQueryString } from 'utils/url-utils';\r\nimport {\r\n  Link as RouterLink,\r\n  LinkProps as RouterLinkProps,\r\n} from 'react-router-dom';\r\n\r\nexport interface LinkProps<T> extends Omit<RouterLinkProps<T>, 'to'> {\r\n  to: t<T>;\r\n}\r\n\r\ntype routerLinkType<S> = H.LocationDescriptor<S>;\r\n//| ((location: H.Location<S>) => H.LocationDescriptor<S>);\r\n\r\ntype t<S> = routerLinkType<S> | IPathAndQuery;\r\n/**\r\n * Link to a resource inside the larger system but external to the React app\r\n * Renders <a href=\"path\" ...\r\n * @param param0\r\n * @returns\r\n */\r\nexport function Link<T>({ to, ...props }: LinkProps<T>) {\r\n  const toto = toLocationDescriptor(to);\r\n  return <RouterLink to={toto} {...props} />;\r\n}\r\n\r\nexport function toLocationDescriptor<T>(\r\n  tt: t<T>,\r\n): H.LocationDescriptorObject<T> {\r\n  if (isPathAndQuery(tt)) {\r\n    return toLocationDescriptorObject(tt as IPathAndQuery);\r\n  } else {\r\n    return tt as H.LocationDescriptorObject<T>;\r\n  }\r\n}\r\n\r\nfunction isPathAndQuery<S>(value: t<S>) {\r\n  var s = value as IPathAndQuery;\r\n  if (value === null) {\r\n    return false;\r\n  }\r\n\r\n  return (\r\n    s.path !== undefined &&\r\n    s.search !== undefined &&\r\n    typeof s.search === 'object'\r\n  );\r\n}\r\n\r\nfunction toLocationDescriptorObject<S>(\r\n  to: IPathAndQuery,\r\n): H.LocationDescriptorObject<S> {\r\n  return {\r\n    pathname: to.path,\r\n    search: toQueryString(to.search).toString(),\r\n  };\r\n}\r\n","/**\r\n *\r\n * ActionIconButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ButtonsVariant } from '../Button';\r\n\r\nexport interface ActionIconButtonProps {\r\n  onClick?: React.MouseEventHandler<HTMLButtonElement>;\r\n  disabled?: boolean;\r\n  icon: IconProp;\r\n  title: string;\r\n  variant?: ButtonsVariant;\r\n  size?: 'large' | 'medium' | 'small' | 'xs';\r\n  autoFocus?: boolean;\r\n  shape?: 'circle' | 'square';\r\n  customIcon?: React.ReactNode;\r\n  to?: string;\r\n  href?: string | IPathAndQuery;\r\n  id?: string;\r\n  target?: string;\r\n}\r\n\r\nexport function ActionIconButton({\r\n  disabled,\r\n  onClick,\r\n  title,\r\n  icon,\r\n  variant,\r\n  size,\r\n  autoFocus,\r\n  shape,\r\n  customIcon,\r\n  to,\r\n  href,\r\n  id,\r\n  target,\r\n  ...other\r\n}: ActionIconButtonProps) {\r\n  return (\r\n    <Tooltip title={title} arrow>\r\n      <span>\r\n        <IconButton\r\n          variant={variant || 'ghost'}\r\n          shape={shape || 'square'}\r\n          disabled={disabled}\r\n          onClick={onClick}\r\n          size={size}\r\n          to={to}\r\n          href={href}\r\n          autoFocus={autoFocus}\r\n          aria-label={title}\r\n          id={id}\r\n          target={target}\r\n          {...other}\r\n        >\r\n          {customIcon ? customIcon : <Icon icon={icon} />}\r\n        </IconButton>\r\n      </span>\r\n    </Tooltip>\r\n  );\r\n}\r\n","import { BaseToggleButtonGroup } from 'app/components/BasicButtons/BaseToggleButtonGroup';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SwitchActionsProps {\r\n  target: SwitchTarget;\r\n  getProps: () => ReservationDetailsProps | WorkOrderDetailsProps;\r\n}\r\nexport enum SwitchTarget {\r\n  WorkOrder = 1,\r\n  Reservation = 2,\r\n}\r\n\r\nexport function SwitchActions(props: SwitchActionsProps) {\r\n  const { target, getProps } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { updateValue: updateX } = useProfileSetting({\r\n    profileSettingKey: 'EmptySlotAdminClick',\r\n  });\r\n  const openReservation = React.useCallback(() => {\r\n    let params = getProps() as ReservationDetailsProps;\r\n    setTimeout(\r\n      () =>\r\n        dispatch(\r\n          actions.openSidePanel({\r\n            type: RenderPageType.ReservationDetails,\r\n            props: params,\r\n          }),\r\n        ),\r\n      null,\r\n    );\r\n    updateX(EmptySlotAdminClick.ReservationsOnly.toString());\r\n  }, [actions, dispatch, getProps, updateX]);\r\n  const openWorkOrder = React.useCallback(() => {\r\n    let params = getProps() as WorkOrderDetailsProps;\r\n    setTimeout(\r\n      () =>\r\n        dispatch(\r\n          actions.openSidePanel({\r\n            type: RenderPageType.WorkOrderDetails,\r\n            props: params,\r\n          }),\r\n        ),\r\n      null,\r\n    );\r\n    updateX(EmptySlotAdminClick.DownTimeOnly.toString());\r\n  }, [actions, dispatch, getProps, updateX]);\r\n  const options = [\r\n    {\r\n      Id: 2,\r\n      Name: t(translations.SwitchToReservationTitle),\r\n    },\r\n    {\r\n      Id: 1,\r\n      Name: t(translations.SwitchToDowntime),\r\n    },\r\n  ];\r\n  const [selectedOption, setSelectedOption] = React.useState<Entity<number>>(\r\n    options.filter(f => f.Id !== (target as number))[0],\r\n  );\r\n  const handleChange = (item: Entity<number> | null) => {\r\n    let selected = item === null ? options[0] : item;\r\n    if (selected.Id === (target as number)) {\r\n      setSelectedOption(selected);\r\n      if (selected.Id === (SwitchTarget.WorkOrder as number)) {\r\n        openWorkOrder();\r\n      } else {\r\n        openReservation();\r\n      }\r\n    }\r\n  };\r\n  return (\r\n    <React.Fragment>\r\n      <BaseToggleButtonGroup\r\n        size={'small'}\r\n        options={options as Entity<number>[]}\r\n        onChange={handleChange}\r\n        fullWidth={true}\r\n        value={selectedOption}\r\n        orientation={'horizontal'}\r\n        variant={'white'}\r\n      />\r\n      {/* <Button\r\n        fullWidth\r\n        variant={target === SwitchTarget.WorkOrder ? 'white' : 'ghost'}\r\n        key=\"swithToReservation\"\r\n        disabled={target === SwitchTarget.WorkOrder}\r\n        size=\"small\"\r\n        onClick={() => openReservation()}\r\n      >\r\n        {t(translations.SwitchToReservationTitle)}\r\n      </Button>\r\n      <Button\r\n        fullWidth\r\n        variant={target === SwitchTarget.Reservation ? 'ghost' : 'white'}\r\n        key=\"swithToWorkOrder\"\r\n        disabled={target === SwitchTarget.Reservation}\r\n        size=\"small\"\r\n        onClick={() => openWorkOrder()}\r\n      >\r\n        {t(translations.SwitchToDowntime)}\r\n      </Button> */}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport React from 'react';\r\n\r\nexport interface OpenWorkOrderButtonProps extends ButtonProps {\r\n  buttonName: React.ReactNode;\r\n  orderId: number;\r\n  bringBackUp?: boolean;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}\r\nexport function OpenWorkOrderButton(props: OpenWorkOrderButtonProps) {\r\n  const {\r\n    buttonName,\r\n    orderId,\r\n    bringBackUp,\r\n    useSidePanel,\r\n    openPanelWithCover,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const { openPanel } = useSidePanelState();\r\n  const openOrder = () => {\r\n    let orderProps = {\r\n      queryParams: {\r\n        id: orderId.toString(),\r\n        Up: (bringBackUp === true).toString(),\r\n      },\r\n      useSidePanel: true,\r\n    } as WorkOrderDetailsProps;\r\n    let panelProps = {\r\n      renderPageType: RenderPageType.WorkOrderDetails,\r\n      renderPageProps: orderProps,\r\n      expanded: false,\r\n      useSidePanel: useSidePanel,\r\n      isCover: useSidePanel,\r\n    } as SidePanelOpenState;\r\n    !!openPanelWithCover\r\n      ? openPanelWithCover(panelProps)\r\n      : openPanel(panelProps);\r\n  };\r\n\r\n  return (\r\n    <Button\r\n      variant={props.variant || 'white'}\r\n      size=\"small\"\r\n      onClick={() => openOrder()}\r\n    >\r\n      {buttonName || t(translations.menu_EditWorkOrder)}\r\n    </Button>\r\n  );\r\n}\r\nexport const WorkOrderLink = (props: {\r\n  id: number;\r\n  Up?: boolean;\r\n  children: React.ReactNode;\r\n  title?: string;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) => {\r\n  const { t } = useTranslation();\r\n  const openOrder = useOpenWorkOrderPopUp();\r\n  const open = () => {\r\n    openOrder(\r\n      {\r\n        id: props.id,\r\n        Up: props.Up,\r\n        useSidePanel: props.useSidePanel,\r\n      },\r\n      props.openPanelWithCover,\r\n    );\r\n  };\r\n  return (\r\n    <Tooltip title={props.title ?? t(translations.menu_EditWorkOrder)}>\r\n      <MuiLink\r\n        style={{ cursor: 'pointer' }}\r\n        onClick={() => open()}\r\n        color=\"textPrimary\"\r\n      >\r\n        {props.children}\r\n      </MuiLink>\r\n    </Tooltip>\r\n  );\r\n};\r\n\r\nexport const useOpenWorkOrderPopUp = () => {\r\n  const { openPanel } = useSidePanelState();\r\n  return React.useCallback(\r\n    (\r\n      props: { id: number; Up?: boolean; useSidePanel?: boolean },\r\n      openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n    ) => {\r\n      let orderProps = {\r\n        queryParams: {\r\n          id: props.id.toString(),\r\n          Up: (props.Up === true).toString(),\r\n        },\r\n        useSidePanel: true,\r\n      } as WorkOrderDetailsProps;\r\n      const panelState = {\r\n        renderPageType: RenderPageType.WorkOrderDetails,\r\n        renderPageProps: orderProps,\r\n        expanded: false,\r\n        useSidePanel: props.useSidePanel,\r\n        isCover: props.useSidePanel,\r\n      } as SidePanelOpenState;\r\n      if (!!openPanelWithCover) {\r\n        openPanelWithCover(panelState);\r\n      } else {\r\n        openPanel({\r\n          renderPageType: RenderPageType.WorkOrderDetails,\r\n          renderPageProps: orderProps,\r\n          expanded: false,\r\n          useSidePanel: false,\r\n          isCover: false,\r\n        } as SidePanelOpenState);\r\n      }\r\n    },\r\n    [openPanel],\r\n  );\r\n};\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\nexport const useCommentStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    commentSection: {\r\n      display: 'flex',\r\n      alignItems: 'flex-start',\r\n      padding: theme.spacing(2, 0),\r\n      gap: '16px',\r\n      alignSelf: 'stretch',\r\n      borderBottom: `1px solid ${theme.palette.common.grayDividers}`,\r\n      width: '100%',\r\n    },\r\n    commentTextFiles: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      flex: '1 0 0',\r\n      gap: '16px',\r\n    },\r\n    commentText: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      gap: '8px',\r\n      alignSelf: 'stretch',\r\n    },\r\n    nameAndTime: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      gap: '4px',\r\n      alignSelf: 'stretch',\r\n    },\r\n    nameTitleButtons: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      gap: '12px',\r\n      alignSelf: 'stretch',\r\n    },\r\n    nameTitle: {\r\n      flex: '1 0 0',\r\n    },\r\n  }),\r\n);\r\nexport const useContainerStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    commentsContainer: {\r\n      display: 'flex',\r\n      alignItems: 'flex-start',\r\n      flexDirection: 'column',\r\n      gap: '8px',\r\n      width: '100%',\r\n    },\r\n    sectionTitle: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      paddingBottom: '0px',\r\n      gap: '16px',\r\n      alignSelf: 'stretch',\r\n    },\r\n    controlBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      //paddingTop: '16px',\r\n      alignItems: 'flex-start',\r\n      gap: '24px',\r\n      alignSelf: 'stretch',\r\n    },\r\n    addCommentBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      gap: '12px',\r\n      alignSelf: 'stretch',\r\n    },\r\n  }),\r\n);\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    section: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      //padding: theme.spacing(0, 4),\r\n      maxWidth: '100%',\r\n    },\r\n    leftSide: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      flexGrow: 1,\r\n      padding: 0,\r\n      width: '100%',\r\n    },\r\n    rightSide: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      flexGrow: 0,\r\n      padding: 0,\r\n    },\r\n    form: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n      width: '100%',\r\n    },\r\n    fields: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      boxSizing: 'border-box',\r\n      width: '100%',\r\n      gap: '16px',\r\n      //paddingBottom: '36px',\r\n    },\r\n    // fieldsSpacing: {\r\n    //   width: 'calc(100% + 24px)',\r\n    //   margin: '-12px',\r\n    //   '& > $row': {\r\n    //     padding: theme.spacing(0.75, 0, 0.75, 0),\r\n    //   },\r\n    // },\r\n    row: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n      width: '100%',\r\n      gap: '16px',\r\n    },\r\n    sectionTitle: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: theme.spacing(0, 0, 2.5),\r\n    },\r\n    alertSpacing: {\r\n      width: 'calc(100% + 24px)',\r\n      margin: '12px -12px 12px -12px',\r\n    },\r\n    item: {\r\n      flexBasis: '100%',\r\n      maxWidth: '100%',\r\n    },\r\n    itemCheck: {\r\n      display: 'flex',\r\n      justifyContent: 'start',\r\n      alignItems: 'center',\r\n      flexDirection: 'row',\r\n    },\r\n  }),\r\n);\r\n","import { Grid } from '@material-ui/core';\r\nimport { Body, InputLabel } from '../Typography';\r\nimport { CommentFile } from './IComment';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { DialogConfirm } from '../DialogConfirm';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useState } from 'react';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\nimport { useResponseModel } from 'app/hooks/useResponseModel';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { DownloadFileButon } from '../DownloadFileButton';\r\n\r\nconst fileSizeToString = (size: number, dp: number = 1) => {\r\n  const thresh = 1000;\r\n  if (Math.abs(size) < thresh) {\r\n    return size + ' B';\r\n  }\r\n  const units = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n  let i = -1;\r\n  const r = 10 ** dp;\r\n  do {\r\n    size /= thresh;\r\n    i++;\r\n  } while (\r\n    Math.round(Math.abs(size) * r) / r >= thresh &&\r\n    i < units.length - 1\r\n  );\r\n  return size.toFixed(dp) + ' ' + units[i];\r\n};\r\n\r\nexport const FileButton = ({\r\n  file,\r\n  canRemove,\r\n  onDeleteFile,\r\n}: {\r\n  file: CommentFile;\r\n  canRemove: Boolean;\r\n  onDeleteFile: (id: string) => void;\r\n}) => {\r\n  const shortenName = (name: string) => {\r\n    const [rawName, suffix] = name.split('.');\r\n    if (rawName.length < 25) return name;\r\n    return rawName.slice(0, 24) + '...' + suffix;\r\n  };\r\n  const { t } = useTranslation();\r\n  const [openDelete, setOpenDelete] = useState(false);\r\n  const sendNotifications = useResponseModel();\r\n  const close = () => setOpenDelete(false);\r\n  const onDelete = useCallback(() => {\r\n    close();\r\n    onDeleteFile(file.Id);\r\n    sendNotifications({\r\n      ErrorMessages: [],\r\n      SuccessMessages: [t(translations.msg_DeleteFile)],\r\n      WarningMessages: [],\r\n    });\r\n  }, [file.Id, onDeleteFile, sendNotifications, t]);\r\n  return (\r\n    <Grid container>\r\n      <Grid item>\r\n        <DownloadFileButon\r\n          id={file.Id}\r\n          name={<Icon icon=\"link\" color=\"primary\" />}\r\n        />\r\n      </Grid>\r\n      <Grid item>\r\n        <Grid container direction=\"column\">\r\n          <Grid item>\r\n            <DownloadFileButon\r\n              id={file.Id}\r\n              name={<Body>{shortenName(file.Name)}</Body>}\r\n            />\r\n          </Grid>\r\n        </Grid>\r\n        <InputLabel size=\"xs\">\r\n          {file.Size && <Grid item>{fileSizeToString(file.Size)}</Grid>}\r\n        </InputLabel>\r\n      </Grid>\r\n      {canRemove && (\r\n        <Grid item>\r\n          <IconButton\r\n            variant=\"ghost\"\r\n            title={t(translations.Delete)}\r\n            icon=\"times\"\r\n            onClick={() => setOpenDelete(true)}\r\n          />\r\n          <DialogConfirm\r\n            onConfirm={() =>\r\n              CommentsApi.removeFile(file.Id)\r\n                .then(onDelete)\r\n                .catch(e => {\r\n                  console.error(e);\r\n                  sendNotifications({\r\n                    ErrorMessages: [t(translations.err_DeleteFileFailure)],\r\n                    SuccessMessages: [],\r\n                    WarningMessages: [],\r\n                  });\r\n                })\r\n            }\r\n            onCancel={close}\r\n            onClose={close}\r\n            body={undefined}\r\n            title={t(translations.AreYouSure)}\r\n            isOpen={openDelete}\r\n          />\r\n        </Grid>\r\n      )}\r\n    </Grid>\r\n  );\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.largeFilesUpload || initialState;\r\n\r\nexport const selectLargeFilesUpload = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\nexport const selectLargeFilesCanUpload = createSelector(\r\n  [selectLargeFilesUpload],\r\n  state => state.canUpload,\r\n);\r\nexport const selectLargeFilesUploading = createSelector(\r\n  [selectLargeFilesUpload],\r\n  state => state.uploading,\r\n);\r\nexport const selectLargeFilesStartedToUpload = createSelector(\r\n  [selectLargeFilesUpload],\r\n  state => state.startedToUpload,\r\n);\r\nexport const selectLargeFilesUploadTargetId = createSelector(\r\n  [selectLargeFilesUpload],\r\n  state => state.targetId,\r\n);\r\nexport const selectLargeFilesUploadFilesNumber = createSelector(\r\n  [selectLargeFilesUpload],\r\n  state => state.numberOfUploadedFiles,\r\n);\r\nexport const selectLargeFilesUploadSelectedFiles = createSelector(\r\n  [selectLargeFilesUpload],\r\n  state => state.selectedFiles,\r\n);\r\n","import axios from 'axios';\r\nimport { CancelTokenSource } from 'axios';\r\nimport { UploadLargeFileApi } from './Api';\r\nimport { CancelToken } from 'axios';\r\nimport { Guid } from 'guid-typescript';\r\n\r\nexport interface AddFileResponse {\r\n  Result: boolean;\r\n  FileId: Guid | null;\r\n  UploadId: string | null;\r\n  ETag: string | null;\r\n  PartNumber: number | null;\r\n  Message: string | null;\r\n  NeedCompleteMultipartUpload: boolean;\r\n}\r\nexport interface S3DS_UploadRespunse {\r\n  ETag: string;\r\n  PartNumber: number;\r\n}\r\n//  Each part must be at least 5 MB in size, except the last part.\r\n// https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html\r\nexport const minChunkSize = 5 * 1024 * 1024;\r\nexport class UploadLargeFile {\r\n  private cancelTokenSource?: CancelTokenSource;\r\n  private cancelToken?: any;\r\n  private _pause: boolean = false;\r\n  private _busy: boolean = false;\r\n  public finished: boolean = false;\r\n  public fileId: Guid | null = null;\r\n  public uploadId: string | null = null;\r\n  public NeedCompleteMultipartUpload: boolean = false;\r\n  private uploadResponses: S3DS_UploadRespunse[] = [];\r\n  public get pause() {\r\n    return this._pause;\r\n  }\r\n  public set pause(value: boolean) {\r\n    if (this._pause !== value) {\r\n      this._pause = value;\r\n      if (value) {\r\n        this.cancel();\r\n      }\r\n    }\r\n  }\r\n  public get busy() {\r\n    return this._busy;\r\n  }\r\n  public set busy(value: boolean) {\r\n    this._busy = value;\r\n  }\r\n  public cancel() {\r\n    this.cancelTokenSource?.cancel();\r\n  }\r\n  public stopAndCancel() {\r\n    this.cancelTokenSource?.cancel();\r\n    this.pause = true;\r\n  }\r\n  conscreateCancelToken() {\r\n    this.cancelTokenSource = axios.CancelToken.source();\r\n    this.cancelToken = this.cancelTokenSource.token;\r\n  }\r\n  public async deleteUnfinishedLargeFiles() {\r\n    if (!this.finished && this.fileId !== null) {\r\n      await DeleteUnfinishedLargeFiles([this.fileId], this.uploadId);\r\n      this.fileId = null;\r\n      this.uploadId = null;\r\n      this.uploadResponses = [];\r\n    }\r\n  }\r\n  private finish() {\r\n    this.finished = true;\r\n    this.fileId = null;\r\n    this.uploadId = null;\r\n  }\r\n  async upload(\r\n    file: File,\r\n    chunkSendResult: (\r\n      res: boolean,\r\n      pos: number,\r\n      part: number,\r\n      error?: string,\r\n    ) => void,\r\n    continueFrom: { start: number; part: number } | null,\r\n    uploadEnd: () => void,\r\n    targetId: number,\r\n    CompletionResult: (value: boolean) => void,\r\n  ) {\r\n    if (this.finished === false && this.busy === false && targetId > 0) {\r\n      this.busy = true;\r\n      let start = 0;\r\n      let part = 0;\r\n      this.conscreateCancelToken();\r\n      try {\r\n        this.pause = false;\r\n        if (file !== undefined && file.size > 0) {\r\n          const size = Math.floor(file.size / 100);\r\n          const chunkSize: number = size < minChunkSize ? minChunkSize : size;\r\n          if (continueFrom !== null) {\r\n            start = continueFrom.start;\r\n            part = continueFrom.part;\r\n          } else {\r\n            this.fileId = null;\r\n            this.uploadResponses = [];\r\n          }\r\n          while (start < file.size) {\r\n            const res = await uploadChunk(\r\n              file,\r\n              file.slice(start, start + chunkSize),\r\n              start,\r\n              part,\r\n              targetId,\r\n              this.fileId,\r\n              this.uploadId,\r\n              this.cancelToken,\r\n            );\r\n            if (res.Result) {\r\n              this.fileId = res.FileId;\r\n              this.uploadId = res.UploadId;\r\n              this.NeedCompleteMultipartUpload =\r\n                res.NeedCompleteMultipartUpload;\r\n              if (\r\n                this.uploadId !== null &&\r\n                this.uploadId !== '' &&\r\n                res.ETag !== null &&\r\n                res.PartNumber !== null &&\r\n                res.NeedCompleteMultipartUpload\r\n              ) {\r\n                this.uploadResponses.push({\r\n                  ETag: res.ETag,\r\n                  PartNumber: res.PartNumber,\r\n                });\r\n              }\r\n              start += chunkSize;\r\n              part++;\r\n              chunkSendResult(true, start, part);\r\n              if (this.pause) {\r\n                uploadEnd();\r\n                return;\r\n              }\r\n            } else {\r\n              chunkSendResult(false, start, part, res.Message ?? undefined);\r\n              return;\r\n            }\r\n          }\r\n        }\r\n      } finally {\r\n        if (start >= file.size) {\r\n          if (\r\n            this.uploadId !== null &&\r\n            this.uploadResponses.length > 0 &&\r\n            this.NeedCompleteMultipartUpload\r\n          ) {\r\n            const res = await CompleteMultipartUpload(\r\n              this.fileId,\r\n              this.uploadId,\r\n              this.uploadResponses,\r\n            );\r\n            if (res) {\r\n              this.finish();\r\n            } else {\r\n              CompletionResult(false);\r\n            }\r\n          } else {\r\n            this.finish();\r\n          }\r\n        }\r\n        uploadEnd();\r\n        this.busy = false;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nconst Api = new UploadLargeFileApi();\r\nasync function uploadChunk(\r\n  file: File,\r\n  chunk: Blob,\r\n  pos: number,\r\n  part: number,\r\n  targetId: number,\r\n  fileId: Guid | null,\r\n  uploadId: string | null,\r\n  cancel?: CancelToken,\r\n): Promise<AddFileResponse> {\r\n  try {\r\n    const res = await Api.uploadChunck<AddFileResponse>(\r\n      //'api/LargeFilesUpload/Upload',\r\n      '/api/odata/v4/Comments/AddFile',\r\n      file.name,\r\n      file.size,\r\n      chunk,\r\n      pos,\r\n      part,\r\n      targetId,\r\n      fileId,\r\n      uploadId,\r\n      cancel,\r\n    );\r\n    return Promise.resolve(res.data);\r\n  } catch (error: unknown) {\r\n    return Promise.resolve({\r\n      Result: false,\r\n      FileId: null,\r\n      UploadId: null,\r\n      ETag: null,\r\n      PartNumber: null,\r\n      Message: null,\r\n      NeedCompleteMultipartUpload: false,\r\n    });\r\n  }\r\n}\r\n\r\nexport async function CompleteMultipartUpload(\r\n  fileId: Guid | null,\r\n  uploadId: string | null,\r\n  uploadResponses: S3DS_UploadRespunse[],\r\n): Promise<boolean> {\r\n  const url = '/api/odata/v4/Comments/CompleteMultipartUpload';\r\n  try {\r\n    await Api.CompleteMultipartUpload(url, fileId, uploadId, uploadResponses);\r\n    return Promise.resolve(true);\r\n  } catch {\r\n    return Promise.resolve(false);\r\n  }\r\n}\r\n\r\nexport async function DeleteUnfinishedLargeFiles(\r\n  ids: Guid[],\r\n  uploadId: string | null,\r\n): Promise<any> {\r\n  const url = '/api/odata/v4/Comments/DeleteUnfinishedLargeFileIds';\r\n  try {\r\n    await Api.DeleteUnfinishedLargeFiles(url, ids, uploadId);\r\n    return Promise.resolve(true);\r\n  } catch {\r\n    return Promise.resolve(false);\r\n  }\r\n}\r\n","import axios, { CancelToken } from 'axios';\r\nimport { Guid } from 'guid-typescript';\r\nimport { S3DS_UploadRespunse } from '.';\r\n\r\nexport class UploadLargeFileApi {\r\n  uploadChunck = async <T>(\r\n    url: string,\r\n    fileName: string,\r\n    fileSize: number,\r\n    chunck: Blob,\r\n    pos: number,\r\n    part: number,\r\n    targetId: number,\r\n    fileId: Guid | null,\r\n    uploadId: string | null,\r\n    cancel?: CancelToken,\r\n  ) => {\r\n    const formData = new FormData();\r\n    formData.append('File', chunck);\r\n    formData.append('rawFileName', fileName);\r\n    formData.append('fileSize', fileSize.toString());\r\n    formData.append('pos', pos.toString());\r\n    formData.append('part', part.toString());\r\n    formData.append('targetId', targetId.toString());\r\n    formData.append('uploadId', uploadId ?? '');\r\n    formData.append('fileId', fileId !== null ? fileId.toString() : Guid.EMPTY);\r\n    const response = await axios.post<T>(url, formData, {\r\n      headers: {\r\n        'Content-Type': 'multipart/form-data',\r\n      },\r\n      cancelToken: cancel,\r\n    });\r\n    return response;\r\n  };\r\n  CompleteMultipartUpload = async (\r\n    url: string,\r\n    fileId: Guid | null,\r\n    uploadId: string | null,\r\n    uploadResponses: S3DS_UploadRespunse[],\r\n  ) => {\r\n    const data = {\r\n      fileId: fileId,\r\n      uploadId: uploadId,\r\n      uploadResponses: uploadResponses,\r\n    };\r\n    return axios.post(url, data);\r\n  };\r\n  DeleteUnfinishedLargeFiles = async (\r\n    url: string,\r\n    ids: Guid[],\r\n    uploadId: string | null,\r\n  ) => {\r\n    const data = { ids: ids, uploadId: uploadId };\r\n    return axios.post(url, data);\r\n  };\r\n}\r\n","import {\r\n  Card,\r\n  CardContent,\r\n  createStyles,\r\n  LinearProgress,\r\n  makeStyles,\r\n} from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Body } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport React, { useCallback, useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectLargeFilesCanUpload,\r\n  selectLargeFilesUploadTargetId,\r\n} from '../slice/selectoes';\r\nimport { UploadLargeFile } from '../Upload';\r\nimport { useLargeFilesUploadSlice } from '../slice';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\nexport interface FileSize {\r\n  size: number;\r\n  name: string;\r\n}\r\nexport interface FileData {\r\n  name: string;\r\n  path: string;\r\n  size: FileSize;\r\n}\r\nexport interface FileCardProps {\r\n  file: File;\r\n  remorFile: (name: string) => void;\r\n}\r\nexport const FileCard = ({ file, remorFile }: FileCardProps) => {\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const canUplpoad = useSelector(selectLargeFilesCanUpload);\r\n  const targetId = useSelector(selectLargeFilesUploadTargetId);\r\n  const [inProgress, setInProgress] = React.useState<boolean>(false);\r\n  const [progress, setProgress] = React.useState<number>(0);\r\n  const [part, setPart] = React.useState<number>(0);\r\n  const [error, setError] = React.useState<boolean>(false);\r\n  const [show, setShow] = React.useState<boolean>(true);\r\n  const [pause, setPause] = React.useState<boolean>(false);\r\n  const fileSize = getFileSize(file.size);\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const { actions: notificationActions } = useAppSettingsSlice();\r\n  const fileName = React.useMemo(() => file.name, [file.name]);\r\n  const uploadLargeFile = React.useMemo(() => new UploadLargeFile(), []);\r\n  const closeHandler = useCallback(async () => {\r\n    if (!inProgress) {\r\n      setShow(false);\r\n      await uploadLargeFile.deleteUnfinishedLargeFiles();\r\n      remorFile(file.name);\r\n    } else {\r\n      setPause(true);\r\n      uploadLargeFile.pause = true;\r\n    }\r\n  }, [file.name, inProgress, remorFile, uploadLargeFile]);\r\n  const chunkSendResult = useCallback(\r\n    (res: boolean, pos: number, part: number, error?: string) => {\r\n      if (res) {\r\n        setProgress(pos);\r\n        setPart(part);\r\n      } else {\r\n        setProgress(pos);\r\n        setPart(part);\r\n        setInProgress(false);\r\n        if (uploadLargeFile.pause === false) {\r\n          setError(true);\r\n        }\r\n        if (error !== undefined) {\r\n          dispatch(\r\n            notificationActions.addNotification({\r\n              variant: 'error',\r\n              message: error,\r\n            }),\r\n          );\r\n        }\r\n      }\r\n    },\r\n    [dispatch, notificationActions, uploadLargeFile.pause],\r\n  );\r\n  const CompletionResult = useCallback(\r\n    (value: boolean) => {\r\n      if (!value) {\r\n        setError(true);\r\n        dispatch(\r\n          notificationActions.addNotification({\r\n            variant: 'error',\r\n            message: 'Upload is failed',\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [dispatch, notificationActions],\r\n  );\r\n\r\n  const uploadEnd = useCallback(() => {\r\n    if (pause) {\r\n      setInProgress(false);\r\n    } else {\r\n      setInProgress(false);\r\n      dispatch(largeFileActions.removeFile(fileName));\r\n      setShow(false);\r\n    }\r\n  }, [dispatch, fileName, largeFileActions, pause]);\r\n  useEffect(() => {\r\n    if (canUplpoad) {\r\n      setInProgress(true);\r\n      dispatch(largeFileActions.addFile(fileName));\r\n      uploadLargeFile.upload(\r\n        file,\r\n        chunkSendResult,\r\n        null,\r\n        uploadEnd,\r\n        targetId,\r\n        CompletionResult,\r\n      );\r\n    }\r\n    return () => {\r\n      uploadLargeFile.stopAndCancel();\r\n      uploadLargeFile.deleteUnfinishedLargeFiles();\r\n      dispatch(largeFileActions.removeFile(fileName));\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [canUplpoad]);\r\n  return (\r\n    <>\r\n      {show === true ? (\r\n        <Card\r\n          className={classes.base}\r\n          style={\r\n            error\r\n              ? { backgroundColor: '#fef0ec', border: '2px solid #fab9b7' }\r\n              : { border: '2px solid #cdd5df' }\r\n          }\r\n        >\r\n          <CardContent className={classes.container}>\r\n            <Box className={classes.content}>\r\n              <Box\r\n                display=\"flex\"\r\n                justifyContent=\"space-between\"\r\n                alignItems=\"center\"\r\n                margin=\"5px\"\r\n                width={'100%'}\r\n              >\r\n                <Box>\r\n                  <Icon\r\n                    icon=\"file\"\r\n                    size=\"1x\"\r\n                    color={error ? 'danger' : 'black'}\r\n                  />\r\n                </Box>\r\n                <Box style={{ width: '80%' }}>\r\n                  {error === false ? (\r\n                    <>\r\n                      <Tooltip title={file.name}>\r\n                        <span>\r\n                          <Body\r\n                            bold={true}\r\n                            style={{\r\n                              color: '#418fb9',\r\n                              overflow: 'hidden',\r\n                              whiteSpace: 'nowrap',\r\n                              textOverflow: 'ellipsis',\r\n                            }}\r\n                          >\r\n                            {file.name}\r\n                          </Body>\r\n                        </span>\r\n                      </Tooltip>\r\n                      {inProgress ? (\r\n                        <LinearProgress\r\n                          variant={progress > 0 ? 'determinate' : 'query'}\r\n                          value={\r\n                            progress > 0\r\n                              ? (progress / file.size) * 100\r\n                              : undefined\r\n                          }\r\n                        />\r\n                      ) : (\r\n                        <>\r\n                          {pause === false && (\r\n                            <Body bold={false}>\r\n                              {fileSize.size + fileSize.name}\r\n                            </Body>\r\n                          )}\r\n                        </>\r\n                      )}\r\n                    </>\r\n                  ) : (\r\n                    <>\r\n                      <Body bold={true} style={{ color: '#cb4765' }}>\r\n                        {file.name}\r\n                      </Body>\r\n                      <Body bold={false} style={{ color: '#cb4765' }}>\r\n                        {t(translations.ErrorDueUpload)}\r\n                      </Body>\r\n                    </>\r\n                  )}\r\n                </Box>\r\n                <Box>\r\n                  <IconButton\r\n                    onClick={closeHandler}\r\n                    title={t(translations.Close)}\r\n                    variant=\"ghost\"\r\n                    shape=\"square\"\r\n                    size=\"small\"\r\n                  >\r\n                    <Icon icon=\"times\" color={error ? 'danger' : 'black'} />\r\n                  </IconButton>\r\n                </Box>\r\n              </Box>\r\n            </Box>\r\n            {(error || pause) && (\r\n              <Box>\r\n                <Button\r\n                  variant=\"ghost\"\r\n                  size=\"small\"\r\n                  startIcon={<Icon icon=\"file-upload\" size=\"xs\" />}\r\n                  onClick={() => {\r\n                    if (uploadLargeFile.busy === false) {\r\n                      setPause(false);\r\n                      setInProgress(true);\r\n                      setError(false);\r\n                      uploadLargeFile.upload(\r\n                        file,\r\n                        chunkSendResult,\r\n                        {\r\n                          start: progress,\r\n                          part: part,\r\n                        },\r\n                        uploadEnd,\r\n                        targetId,\r\n                        CompletionResult,\r\n                      );\r\n                    }\r\n                  }}\r\n                >\r\n                  {t(translations.ReUploadFile)}\r\n                </Button>\r\n              </Box>\r\n            )}\r\n          </CardContent>\r\n        </Card>\r\n      ) : (\r\n        <></>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n\r\nconst getFileSize = (size): FileSize => {\r\n  var string;\r\n  if (size >= 1024 * 1024 * 1024 * 1024) {\r\n    size = size / (1024 * 1024 * 1024 * 1024);\r\n    string = 'TiB';\r\n  } else if (size >= 1024 * 1024 * 1024) {\r\n    size = size / (1024 * 1024 * 1024);\r\n    string = 'GiB';\r\n  } else if (size >= 1024 * 1024) {\r\n    size = size / (1024 * 1024);\r\n    string = 'MiB';\r\n  } else if (size >= 1024) {\r\n    size = size / 1024;\r\n    string = 'KiB';\r\n  } else {\r\n    string = 'b';\r\n  }\r\n  return { size: Math.round(size), name: string };\r\n};\r\n\r\nconst useStyles = makeStyles(theme =>\r\n  createStyles({\r\n    base: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      justifyContent: 'center',\r\n      backgroundColor: theme.palette.background.default,\r\n      //height: '163px',\r\n      borderRadius: '8px',\r\n      //width: '400px',\r\n      marginTop: '8px',\r\n    },\r\n    container: {\r\n      boxSizing: 'border-box',\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      //alignItems: 'center',\r\n      justifyContent: 'center',\r\n    },\r\n    content: {\r\n      display: 'flex',\r\n      alignItems: 'flex-start',\r\n      justifyContent: 'center',\r\n      width: '100%',\r\n    },\r\n  }),\r\n);\r\n","import * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { useDropzone } from 'react-dropzone';\r\nimport { styled } from '@material-ui/core';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\nimport { FileCard } from './FileCard';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLargeFilesUploadSlice } from '../slice';\r\n\r\nexport interface SelectFileProps {\r\n  accept: any;\r\n  downloadFileName?: string;\r\n  filesPlaceholder: React.ReactNode;\r\n  height?: number;\r\n  maxFilesCount?: number;\r\n  maxSize: number;\r\n  disableFileUpload?: boolean;\r\n}\r\n\r\nexport const SelectFile = ({\r\n  label,\r\n  onBlur,\r\n  value,\r\n  name,\r\n  error,\r\n  helperText,\r\n  accept,\r\n  downloadFileName,\r\n  filesPlaceholder,\r\n  maxFilesCount,\r\n  maxSize,\r\n  disableFileUpload,\r\n  ...props\r\n}: FieldHookConfig<string> & TextFieldProps & SelectFileProps) => {\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const showShortView = isMobile || (sidePanelOpen && !sidePanelExpanded);\r\n  const maxFiles =\r\n    maxFilesCount === undefined ? 1 : maxFilesCount > 20 ? 20 : maxFilesCount;\r\n  const onDrop = React.useCallback(\r\n    (acceptedFiles: File[]) => {\r\n      dispatch(largeFileActions.setSeletedFiles(acceptedFiles.length));\r\n    },\r\n    [dispatch, largeFileActions],\r\n  );\r\n\r\n  const { acceptedFiles, getRootProps, getInputProps } = useDropzone({\r\n    onDrop,\r\n    maxFiles: maxFiles,\r\n    //minSize: minChunkSize,\r\n    maxSize: maxSize,\r\n    accept: accept,\r\n    disabled: disableFileUpload,\r\n  });\r\n  const remorFile = React.useCallback(\r\n    (filename: string) => {\r\n      const index = acceptedFiles.findIndex(item => item.name === filename);\r\n      acceptedFiles.splice(index, 1);\r\n      dispatch(largeFileActions.setSeletedFiles(acceptedFiles.length));\r\n    },\r\n    [acceptedFiles, dispatch, largeFileActions],\r\n  );\r\n  return (\r\n    <>\r\n      <Box style={{ width: showShortView ? '100%' : '400px' }}>\r\n        <StyledDropboxContainer {...getRootProps({ className: 'dropzone' })}>\r\n          <input {...getInputProps()} />\r\n          <p>{filesPlaceholder}</p>\r\n        </StyledDropboxContainer>\r\n        {acceptedFiles.length > 0 && (\r\n          <div style={{ overflowY: 'auto', height: props.height }}>\r\n            {acceptedFiles.map(file => (\r\n              <FileCard file={file} remorFile={remorFile} />\r\n            ))}\r\n          </div>\r\n        )}\r\n      </Box>\r\n    </>\r\n  );\r\n};\r\nconst StyledDropboxContainer = styled('div')(({ theme }) => ({\r\n  flex: 1,\r\n  display: 'flex',\r\n  flexDirection: 'column',\r\n  alignItems: 'center',\r\n  padding: '20px',\r\n  borderWidth: '2px',\r\n  borderRadius: '2px',\r\n  borderColor: theme.palette.common.grayBorders,\r\n  borderStyle: 'dashed',\r\n  backgroundColor: theme.palette.background.paper,\r\n  color: '#bdbdbd',\r\n  outline: 'none',\r\n  transition: 'border .24s ease-in-out',\r\n}));\r\n","import { useTranslation } from 'react-i18next';\r\nimport { SelectFile } from './Components/SelectFile';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { Body } from '../Typography';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface LargeFilesUpdateProps {\r\n  maxFilesCount?: number;\r\n  disableFileUpload?: boolean;\r\n}\r\nexport function LargeFilesUpdate({\r\n  maxFilesCount,\r\n  disableFileUpload,\r\n}: LargeFilesUpdateProps) {\r\n  const { t } = useTranslation();\r\n  const systemSettings = useSelector(selectglobalSettings);\r\n  const AllowLargeFilesUpload = systemSettings.GetBooleanByKey(\r\n    AllowedSettings.AllowLargeFilesUpload,\r\n  );\r\n  const fh = React.useMemo((): React.ReactNode => {\r\n    let s = AllowLargeFilesUpload\r\n      ? t(translations.MaxLargeFileSize)\r\n      : t(translations.MaxUploadFileSize);\r\n    s = s.replace('{0}', AllowLargeFilesUpload ? '2' : '20');\r\n    return (\r\n      <>\r\n        <Body bold={true}>{t(translations.DragTheFilesOrBrowse)}</Body>\r\n        <div style={{ textAlign: 'center' }}> {s} </div>\r\n      </>\r\n    );\r\n  }, [AllowLargeFilesUpload, t]);\r\n  return (\r\n    <>\r\n      <Box>\r\n        <BasicTypography>{t(translations.Attachments)}</BasicTypography>\r\n        <SelectFile\r\n          name=\"SelectFile\"\r\n          multiline={true}\r\n          fullWidth\r\n          placeholder={t(translations.Template)}\r\n          label={t(translations.Template)}\r\n          disabled={false}\r\n          accept={'.*'}\r\n          filesPlaceholder={fh}\r\n          maxFilesCount={maxFilesCount}\r\n          maxSize={\r\n            AllowLargeFilesUpload ? 2 * 1024 * 1024 * 1024 : 20 * 1024 * 1024\r\n          }\r\n          disableFileUpload={disableFileUpload}\r\n        />\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n","import { MenuItem } from '@material-ui/core';\r\nimport { useMemo, useState, useRef } from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { CommentFile, IComment, NewComment } from './IComment';\r\nimport { parse } from './commentParser';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Caption } from '../Typography';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport * as Yup from 'yup';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Form, Formik } from 'formik';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { FormRichTextField } from '../Forms/FormRichTextField';\r\nimport { TextField } from '../TextField';\r\nimport clsx from 'clsx';\r\nimport { useCommentStyles, useContainerStyles, useStyles } from './styles';\r\nimport { DropDown } from '../DropDown';\r\nimport { IEmail } from 'api/EmailApi';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSendMail } from 'app/hooks/useSendMail';\r\nimport { renderToStaticMarkup } from 'react-dom/server';\r\nimport { FormListener } from '../Forms/FormRender/FormRenderer';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Avatar } from '../Avatar';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { EmailTypeUnion } from 'api/odata/generated/enums/EmailType';\r\nimport { Alert } from '@material-ui/lab';\r\nimport { Body } from '../Typography';\r\nimport * as React from 'react';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\nimport { FileButton } from './FileButton';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { orderBy } from 'lodash';\r\nimport { LargeFilesUpdate } from '../LargeFilesUpload';\r\nimport { useLargeFilesUploadSlice } from '../LargeFilesUpload/slice';\r\nimport {\r\n  selectLargeFilesStartedToUpload,\r\n  selectLargeFilesUpload,\r\n  selectLargeFilesUploadFilesNumber,\r\n  selectLargeFilesUploadSelectedFiles,\r\n  selectLargeFilesUploadTargetId,\r\n  selectLargeFilesUploading,\r\n} from '../LargeFilesUpload/slice/selectoes';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\n\r\nexport interface CommentsContainerProps extends EmailRelated {\r\n  Comments: IComment[];\r\n  onSubmit: (comment: NewComment) => void;\r\n  withMentions?: boolean;\r\n  isAdmin?: boolean;\r\n  onEditComment?: (comment: IComment, newComment: NewComment) => void;\r\n  onDeleteComment?: (comment: IComment) => void;\r\n  shouldSendEmail?: boolean;\r\n  disabled?: boolean;\r\n  bindSubmitComment?: any;\r\n  defaultComment?: Partial<IComment>;\r\n  cannotComment?: boolean;\r\n  sectionTitle?: React.ReactNode;\r\n  noTitle?: boolean;\r\n  disableFileUpload?: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\n\r\nexport interface EmailRelated {\r\n  emailBody?: string;\r\n  emailSubject?: string;\r\n  emailType?: EmailTypeUnion;\r\n  pageName?: string;\r\n  referenceName?: string;\r\n  linkUrl?: string;\r\n}\r\n\r\nconst AddComment = ({\r\n  onSubmit,\r\n  onClose,\r\n  withMentions,\r\n  isAdmin,\r\n  defaultComment,\r\n  disabled,\r\n  bindSubmitComment,\r\n  disableFileUpload,\r\n  serviceGroups,\r\n}: {\r\n  onSubmit: (comment: NewComment) => void;\r\n  onClose: () => void;\r\n  withMentions: boolean;\r\n  isAdmin?: boolean;\r\n  defaultComment?: Partial<IComment>;\r\n  disabled?: boolean;\r\n  bindSubmitComment?: any;\r\n  disableFileUpload?: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}) => {\r\n  const { t } = useTranslation();\r\n  const formRef = useRef<HTMLFormElement>(null);\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const selectedFiles = useSelector(selectLargeFilesUploadSelectedFiles);\r\n  const classes = useStyles();\r\n\r\n  useEffectOnMount(() => {\r\n    formRef.current?.scrollIntoView({\r\n      behavior: 'smooth',\r\n      block: 'nearest',\r\n      inline: 'nearest',\r\n    });\r\n  });\r\n  React.useEffect(() => {\r\n    dispatch(largeFileActions.setCanUpload(0));\r\n  }, [dispatch, largeFileActions]);\r\n  const userSchema: Yup.SchemaOf<Entity<string>> = Yup.object({\r\n    Id: Yup.string().ensure(),\r\n    Name: Yup.string().ensure(),\r\n  });\r\n\r\n  const schema: Yup.SchemaOf<NewComment> = Yup.object({\r\n    Users: Yup.array().of(userSchema),\r\n    Files: Yup.mixed().notRequired(),\r\n    Text: Yup.string()\r\n      .notRequired()\r\n      .test(val => (val ?? '').length > 0),\r\n    IsInternal: Yup.boolean().nullable(),\r\n  });\r\n\r\n  const initial: NewComment = {\r\n    Text: defaultComment?.Text,\r\n    Users: [],\r\n    IsInternal: defaultComment?.IsInternal,\r\n  };\r\n\r\n  const handleSubmit = ({ Files, ...values }: NewComment) => {\r\n    const comment: NewComment = {\r\n      ...values,\r\n    };\r\n    onSubmit(comment);\r\n    if (selectedFiles === 0) onClose();\r\n  };\r\n  return (\r\n    <Formik\r\n      onSubmit={(values, action) => {\r\n        handleSubmit(values);\r\n        action.resetForm();\r\n      }}\r\n      initialValues={initial}\r\n      validationSchema={schema}\r\n    >\r\n      {formik => {\r\n        if (bindSubmitComment && formik.isValid) {\r\n          bindSubmitComment(formik.submitForm);\r\n        }\r\n        const additionalButtons = [\r\n          (className, key) => {\r\n            return isAdmin ? (\r\n              <DropDown\r\n                variant=\"ghost\"\r\n                menuProps={{ closeAfterTransition: true }}\r\n                className={className}\r\n                disabled={disabled}\r\n                key={key}\r\n                menuChildren={close => [\r\n                  <MenuItem>\r\n                    <Button\r\n                      color={formik.values.IsInternal ? 'default' : 'primary'}\r\n                      variant={formik.values.IsInternal ? 'ghost' : 'main'}\r\n                      fullWidth\r\n                      startIcon={<Icon icon=\"globe\" />}\r\n                      onClick={() => {\r\n                        formik.getFieldHelpers('IsInternal').setValue(false);\r\n                        close();\r\n                      }}\r\n                    >\r\n                      {t(translations.VisibleToUsers)}\r\n                    </Button>\r\n                  </MenuItem>,\r\n                  <MenuItem>\r\n                    <Button\r\n                      color={formik.values.IsInternal ? 'primary' : 'default'}\r\n                      variant={formik.values.IsInternal ? 'main' : 'ghost'}\r\n                      fullWidth\r\n                      startIcon={<Icon icon=\"lock\" />}\r\n                      onClick={() => {\r\n                        formik.getFieldHelpers('IsInternal').setValue(true);\r\n                        close();\r\n                      }}\r\n                    >\r\n                      {t(translations.StaffOnly)}\r\n                    </Button>\r\n                  </MenuItem>,\r\n                ]}\r\n              >\r\n                <Icon\r\n                  icon={formik.values.IsInternal ? 'lock' : 'lock-open'}\r\n                  fixedWidth\r\n                />\r\n              </DropDown>\r\n            ) : (\r\n              <></>\r\n            );\r\n          },\r\n        ];\r\n        return (\r\n          <Form\r\n            ref={formRef}\r\n            onSubmit={formik.handleSubmit}\r\n            className={classes.section}\r\n          >\r\n            <FormListener onFormChange={() => {}} fields={[]} />\r\n            <Box className={classes.form}>\r\n              <Box className={clsx(classes.fields)}>\r\n                <Box className={classes.row}>\r\n                  <FormRichTextField\r\n                    autoFocus\r\n                    name=\"Text\"\r\n                    placeholder={t(translations.WriteAComment)}\r\n                    hasMentions={withMentions}\r\n                    disabled={disabled}\r\n                    onChangeMentions={v =>\r\n                      formik.getFieldHelpers('Users').setValue(v, true)\r\n                    }\r\n                    additionalButtons={additionalButtons}\r\n                    serviceGroups={serviceGroups}\r\n                  />\r\n                </Box>\r\n                <Box style={{ width: '100%' }}>\r\n                  <LargeFilesUpdate\r\n                    maxFilesCount={20}\r\n                    disableFileUpload={disableFileUpload}\r\n                  />\r\n                </Box>\r\n                <Box className={classes.row}>\r\n                  <Button\r\n                    size=\"small\"\r\n                    type=\"submit\"\r\n                    disabled={disabled || formik.isSubmitting}\r\n                  >\r\n                    {t(translations.Save)}\r\n                  </Button>\r\n                  <Button\r\n                    size=\"small\"\r\n                    onClick={onClose}\r\n                    color=\"primary\"\r\n                    variant=\"white\"\r\n                  >\r\n                    {t(translations.Close)}\r\n                  </Button>\r\n                </Box>\r\n              </Box>\r\n            </Box>\r\n          </Form>\r\n        );\r\n      }}\r\n    </Formik>\r\n  );\r\n};\r\n\r\nconst CommentCell = ({\r\n  comment,\r\n  onSubmit,\r\n  onClose,\r\n  withMentions,\r\n  isAdmin,\r\n  onEditComment,\r\n  onDeleteComment,\r\n  disabled,\r\n  bindSubmitComment,\r\n  disableFileUpload,\r\n}: {\r\n  comment: IComment;\r\n  onSubmit: (comment: NewComment) => void;\r\n  onClose: () => void;\r\n  withMentions: boolean;\r\n  isAdmin?: boolean;\r\n  onEditComment?: (comment: IComment, newComment: NewComment) => void;\r\n  onDeleteComment?: (comment: IComment) => void;\r\n  disabled?: boolean;\r\n  bindSubmitComment?: any;\r\n  disableFileUpload?: boolean;\r\n}) => {\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const [hover, setHover] = useState(false);\r\n  const [edit, setEdit] = useState(false);\r\n  const { t } = useTranslation();\r\n  const { newDate, withoutOffset } = useSystemDate();\r\n  const classes = useCommentStyles();\r\n  const [files, setFiles] = useState<CommentFile[]>([]);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const currentUserComment = authenticatedUser?.Id === comment.CreatedBy.Id;\r\n  const uploadedFiles = useSelector(selectLargeFilesUploadFilesNumber);\r\n  const commentId = useSelector(selectLargeFilesUploadTargetId);\r\n  const startedToUpload = useSelector(selectLargeFilesStartedToUpload);\r\n  const uploading = useSelector(selectLargeFilesUploading);\r\n  const filesUpload = useSelector(selectLargeFilesUpload);\r\n  React.useEffect(() => {\r\n    setFiles(comment.Files);\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, []);\r\n  React.useEffect(() => {\r\n    const getComments = async () => {\r\n      if (\r\n        filesUpload.commentType !== undefined &&\r\n        filesUpload.referenceId !== undefined\r\n      ) {\r\n        var result = await CommentsApi.GetComments(\r\n          filesUpload.commentType,\r\n          filesUpload.referenceId,\r\n          commentId,\r\n        );\r\n        if (result.length > 0) {\r\n          setFiles(result[0].Files);\r\n        }\r\n      }\r\n      dispatch(largeFileActions.resetNumberOfUploadedFiles());\r\n    };\r\n    if (\r\n      commentId === comment.Id &&\r\n      startedToUpload &&\r\n      !uploading &&\r\n      uploadedFiles > 0\r\n    ) {\r\n      getComments();\r\n      onClose();\r\n    }\r\n  }, [\r\n    commentId,\r\n    startedToUpload,\r\n    uploading,\r\n    uploadedFiles,\r\n    dispatch,\r\n    largeFileActions,\r\n    filesUpload.commentType,\r\n    filesUpload.referenceId,\r\n    comment.Id,\r\n    onClose,\r\n  ]);\r\n  return (\r\n    <React.Fragment>\r\n      {onEditComment && edit ? (\r\n        <>\r\n          <AddComment\r\n            withMentions={withMentions}\r\n            isAdmin={isAdmin}\r\n            defaultComment={comment}\r\n            disabled={disabled}\r\n            onSubmit={newComment => {\r\n              onEditComment(comment, newComment);\r\n              setEdit(false);\r\n            }}\r\n            onClose={() => setEdit(false)}\r\n            bindSubmitComment={bindSubmitComment}\r\n            disableFileUpload={disableFileUpload}\r\n          />\r\n        </>\r\n      ) : (\r\n        <Box className={classes.commentSection}>\r\n          <Box>\r\n            <Avatar user={comment.CreatedBy} />\r\n          </Box>\r\n          <Box\r\n            className={classes.commentTextFiles}\r\n            onMouseEnter={() => setHover(true)}\r\n            onMouseLeave={() => setHover(false)}\r\n          >\r\n            <Box className={classes.commentText}>\r\n              <Box className={classes.nameAndTime}>\r\n                <Box className={classes.nameTitleButtons}>\r\n                  <Box className={classes.nameTitle}>\r\n                    <BasicTypography variant=\"boldS\">\r\n                      {comment.CreatedBy.Name}\r\n                    </BasicTypography>\r\n                    {isAdmin && comment.IsInternal && <Icon icon=\"lock\" />}\r\n                  </Box>\r\n                  {withMentions && hover && (\r\n                    <>\r\n                      {isAdmin && (\r\n                        <>\r\n                          {onEditComment && (\r\n                            <Button\r\n                              variant=\"text\"\r\n                              startIcon={<Icon icon=\"edit\" />}\r\n                              size=\"small\"\r\n                              onClick={() => setEdit(true)}\r\n                            >\r\n                              {t(translations.Edit)}\r\n                            </Button>\r\n                          )}\r\n                          {onDeleteComment && (\r\n                            <Button\r\n                              variant=\"text\"\r\n                              startIcon={<Icon icon=\"trash\" />}\r\n                              size=\"small\"\r\n                              onClick={() => onDeleteComment(comment)}\r\n                            >\r\n                              {t(translations.Delete)}\r\n                            </Button>\r\n                          )}\r\n                        </>\r\n                      )}\r\n                    </>\r\n                  )}\r\n                </Box>\r\n                <Caption color=\"secondary\">\r\n                  <Tooltip\r\n                    title={\r\n                      dateUtils.format(\r\n                        comment.CreatedAt,\r\n                        dateUtils.DateIOFormats.keyboardDateTime24h,\r\n                      ) ?? ''\r\n                    }\r\n                    arrow\r\n                  >\r\n                    <span>\r\n                      {Math.abs(\r\n                        dateUtils.differenceInDays(\r\n                          dateUtils.dateOrStringToDate(comment.CreatedAt),\r\n                          newDate(),\r\n                        ),\r\n                      ) > 30\r\n                        ? dateUtils.format(\r\n                            comment.CreatedAt,\r\n                            dateUtils.DateIOFormats.keyboardDateTime24h, //'PP hh:mm',\r\n                          )\r\n                        : dateUtils.formatDistanceToNow(\r\n                            withoutOffset(comment.CreatedAt),\r\n                          )}\r\n                    </span>\r\n                  </Tooltip>\r\n                </Caption>\r\n              </Box>\r\n              <BasicTypography variant=\"bodyS\">\r\n                {comment.Text.trim() !== '' ? parse(comment.Text) : ''}\r\n              </BasicTypography>\r\n            </Box>\r\n\r\n            {files.map(f => {\r\n              return (\r\n                <>\r\n                  <FileButton\r\n                    canRemove={isAdmin || currentUserComment}\r\n                    onDeleteFile={id => {\r\n                      setFiles(prev => prev.filter(file => file.Id !== id));\r\n                    }}\r\n                    key={f.Id}\r\n                    file={f}\r\n                  />\r\n                </>\r\n              );\r\n            })}\r\n          </Box>\r\n        </Box>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n};\r\n\r\nexport const CommentsContainer = ({\r\n  Comments,\r\n  onSubmit,\r\n  withMentions,\r\n  isAdmin,\r\n  onEditComment,\r\n  onDeleteComment,\r\n  emailBody,\r\n  emailSubject,\r\n  pageName,\r\n  referenceName,\r\n  emailType,\r\n  linkUrl,\r\n  disabled,\r\n  shouldSendEmail = true,\r\n  bindSubmitComment,\r\n  defaultComment,\r\n  cannotComment,\r\n  sectionTitle,\r\n  noTitle,\r\n  disableFileUpload,\r\n  serviceGroups,\r\n}: CommentsContainerProps) => {\r\n  const [count, setCount] = useState<number>(5);\r\n  const sortedComments = useMemo(() => {\r\n    return orderBy(\r\n      Comments,\r\n      c => dateUtils.dateOrStringToDate(c.CreatedAt),\r\n      'desc',\r\n    ).filter(c => !c.IsInternal || isAdmin);\r\n  }, [Comments, isAdmin]);\r\n  const [writeCommentOpen, setWriteCommentOpen] = useState(false);\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const sendMail = useSendMail();\r\n  const handleSubmit = (comment: NewComment) => {\r\n    if (shouldSendEmail && withMentions) {\r\n      const email = createEmail({\r\n        emailBody: emailBody ?? t(translations.DefaultEmailTemplateBody),\r\n        emailSubject:\r\n          emailSubject ?? t(translations.DefaultEmailTemplateSubject),\r\n        pageName: pageName ?? t(translations.DefaultPageName),\r\n        referenceName: referenceName ?? t(translations.DefaultReferenceName),\r\n        emailType: emailType,\r\n        linkUrl: linkUrl ?? '',\r\n        userName: authenticatedUser?.Name ?? '',\r\n        comment: comment,\r\n      });\r\n      if (email) {\r\n        sendMail(email);\r\n      }\r\n    }\r\n    onSubmit(comment);\r\n  };\r\n  const classes = useContainerStyles();\r\n  return (\r\n    <Box className={classes.commentsContainer}>\r\n      {!noTitle && (\r\n        <Box className={classes.sectionTitle}>\r\n          <Body bold={true}>\r\n            {sectionTitle || t(translations.CommentsCount)}\r\n          </Body>\r\n        </Box>\r\n      )}\r\n      {sortedComments\r\n        .slice(0, count < sortedComments.length ? count : undefined)\r\n        .map((c, i) => (\r\n          <CommentCell\r\n            key={`${i}-${c.Id}`}\r\n            comment={c}\r\n            onSubmit={handleSubmit}\r\n            onClose={() => setWriteCommentOpen(false)}\r\n            withMentions={!!withMentions}\r\n            isAdmin={isAdmin}\r\n            onEditComment={onEditComment}\r\n            onDeleteComment={onDeleteComment}\r\n            bindSubmitComment={bindSubmitComment}\r\n            disableFileUpload={disableFileUpload}\r\n          />\r\n        ))}\r\n      <Box className={classes.controlBox}>\r\n        {count < sortedComments.length && (\r\n          <Button\r\n            color=\"default\"\r\n            fullWidth\r\n            onClick={() => setCount(prev => prev + 5)}\r\n          >\r\n            {(('Load more ' + t(translations.CommentsCount)) as string) +\r\n              ' (' +\r\n              (sortedComments.length - count) +\r\n              ')'}\r\n          </Button>\r\n        )}\r\n        {!cannotComment && (\r\n          <Box className={classes.addCommentBox}>\r\n            {writeCommentOpen ? (\r\n              <AddComment\r\n                defaultComment={defaultComment}\r\n                onSubmit={handleSubmit}\r\n                disabled={disabled}\r\n                onClose={() => setWriteCommentOpen(false)}\r\n                withMentions={!!withMentions}\r\n                isAdmin={isAdmin}\r\n                bindSubmitComment={bindSubmitComment}\r\n                disableFileUpload={disableFileUpload}\r\n                serviceGroups={serviceGroups}\r\n              />\r\n            ) : (\r\n              <TextField\r\n                fullWidth\r\n                id=\"commentId\"\r\n                inputProps={{ 'aria-label': 'comments input' }}\r\n                disabled={disabled}\r\n                placeholder={t(translations.WriteAComment)}\r\n                onClick={() => setWriteCommentOpen(true)}\r\n              />\r\n            )}\r\n          </Box>\r\n        )}\r\n        {cannotComment && sortedComments.length === 0 && (\r\n          <Alert color=\"info\">{t(translations.Comments_EmptyMessage)}</Alert>\r\n        )}\r\n      </Box>\r\n    </Box>\r\n  );\r\n};\r\n\r\nconst createEmail = ({\r\n  comment,\r\n  emailBody,\r\n  emailSubject,\r\n  pageName,\r\n  referenceName,\r\n  emailType,\r\n  userName,\r\n  linkUrl,\r\n}: {\r\n  emailBody: string;\r\n  emailSubject: string;\r\n  emailType?: EmailTypeUnion;\r\n  pageName: string;\r\n  referenceName: string;\r\n  comment: NewComment;\r\n  userName: string;\r\n  linkUrl: string;\r\n}) => {\r\n  if (emailType === undefined || comment.Users.length === 0) return;\r\n  const subject = emailSubject\r\n    .replaceAll('{@UserName}', userName)\r\n    .replaceAll('{@PageName}', pageName)\r\n    .replaceAll('{@Reference}', referenceName);\r\n  const body = emailBody\r\n    .replaceAll('{@UserName}', userName)\r\n    .replaceAll('{@PageName}', pageName)\r\n    .replaceAll('{@Reference}', referenceName)\r\n    .replaceAll('{@Link}', linkUrl)\r\n    .replaceAll(\r\n      '{@Body}',\r\n      renderToStaticMarkup(<>{parse(comment.Text ?? '')}</>),\r\n    );\r\n  return {\r\n    Subject: subject,\r\n    Body: body,\r\n    Files: comment.Files,\r\n    SaveToLog: true,\r\n    To: [],\r\n    Cc: [],\r\n    Bcc: comment.Users,\r\n    Type: emailType,\r\n  } as IEmail;\r\n};\r\n","import { DropDown } from 'app/components/DropDown';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { LinearProgress, List, ListItem, MenuItem } from '@material-ui/core';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { loadOfflineServiceData } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport styled from 'styled-components';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nexport interface AddServiceProps {\r\n  getServiceTypes?: (\r\n    searchTerm: string | null,\r\n    predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n  ) => Promise<IOfflineServiceFilterDto[]>;\r\n  addService: (serviceType: IOfflineServiceFilterDto) => void;\r\n  selected: IOtherServices[];\r\n  disabled?: boolean;\r\n}\r\n\r\nexport function AddService({\r\n  addService,\r\n  getServiceTypes,\r\n  selected,\r\n  disabled,\r\n}: AddServiceProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n\r\n  const [input, setInnput] = React.useState<string>('');\r\n  const fetchServiceTypes = async (): Promise<IOfflineServiceFilterDto[]> => {\r\n    const filter =\r\n      !!selected && selected.length > 0\r\n        ? [\r\n            new Condition<IOfflineServiceFilterDto>(\r\n              'Id',\r\n              ODataOperators.Excludes,\r\n              selected.map(s => s.ServiceTypeID),\r\n            ),\r\n          ]\r\n        : undefined;\r\n    return new Promise(async (resolve, reject) => {\r\n      if (!!getServiceTypes) {\r\n        try {\r\n          const data = await getServiceTypes(input || null, filter);\r\n          resolve(data);\r\n        } catch {\r\n          resolve([]);\r\n        }\r\n      } else {\r\n        try {\r\n          const data = await loadOfflineServiceData(\r\n            filter,\r\n            'base',\r\n            globalServiceGroupFilter || [],\r\n          )(input || null, undefined);\r\n          resolve(\r\n            data.value.filter(\r\n              f => !selected.some(s => s.ServiceTypeID === f.Id),\r\n            ),\r\n          );\r\n        } catch (error) {\r\n          resolve([]);\r\n        }\r\n      }\r\n    });\r\n  };\r\n  const [serviceTypes, setServiceTypes] = useAsyncExtendedState<\r\n    IOfflineServiceFilterDto[]\r\n  >([]);\r\n\r\n  const [fetchServiceTypeState, fetchServiceTypePromise] = usePromise(\r\n    fetchServiceTypes,\r\n  );\r\n  const stopImmediatePropagation = (e: any) => {\r\n    e.stopPropagation();\r\n    e.preventDefault();\r\n  };\r\n  useEffectOnMount(() => {\r\n    setServiceTypes(fetchServiceTypePromise());\r\n  });\r\n\r\n  return (\r\n    <DropDown\r\n      variant=\"white\"\r\n      size=\"small\"\r\n      disabled={disabled}\r\n      onOpen={() => {\r\n        setServiceTypes([]);\r\n        setServiceTypes(fetchServiceTypePromise());\r\n      }}\r\n      onHandleClose={() => {\r\n        setInnput('');\r\n        setServiceTypes([]);\r\n      }}\r\n      menuChildren={onClose => [\r\n        <ListItem\r\n          key=\"lists-search\"\r\n          onKeyDown={e => e.stopPropagation()}\r\n          onClickCapture={stopImmediatePropagation}\r\n        >\r\n          <TextControlField\r\n            placeholder={t(translations.SearchFilter)}\r\n            startIcon={\r\n              <Icon icon=\"search\" color=\"filters\" colorExtend=\"light\" />\r\n            }\r\n            value={input || ''}\r\n            size=\"small\"\r\n            aria-label={t(translations.SearchFilter)}\r\n            inputProps={{\r\n              'aria-label': t(translations.SearchFilter),\r\n            }}\r\n            onChange={e => {\r\n              setInnput(e.target.value);\r\n              setTimeout(() => setServiceTypes(fetchServiceTypePromise()), 200);\r\n            }}\r\n            autoFocus\r\n            fullWidth\r\n          />\r\n        </ListItem>,\r\n        <ListItem key=\"list-results\">\r\n          <ContentWrapper>\r\n            <List>\r\n              {fetchServiceTypeState.status === 'pending' && (\r\n                <LinearProgress variant=\"query\" color=\"primary\" />\r\n              )}\r\n              {serviceTypes.length > 0 &&\r\n                serviceTypes.map(s => (\r\n                  <MenuItem\r\n                    key={s.Id}\r\n                    onClick={e => {\r\n                      addService(s);\r\n                      onClose();\r\n                    }}\r\n                  >\r\n                    {s.Name}\r\n                  </MenuItem>\r\n                ))}\r\n              {fetchServiceTypeState.status !== 'pending' &&\r\n                serviceTypes.length < 1 && (\r\n                  <BasicTypography display=\"inline\">\r\n                    {t(translations.NotFound)}\r\n                  </BasicTypography>\r\n                )}\r\n            </List>\r\n          </ContentWrapper>\r\n        </ListItem>,\r\n      ]}\r\n      menuProps={{\r\n        anchorOrigin: {\r\n          vertical: 'bottom',\r\n          horizontal: 'left',\r\n        },\r\n        transformOrigin: {\r\n          vertical: 'top',\r\n          horizontal: 'left',\r\n        },\r\n        getContentAnchorEl: null,\r\n      }}\r\n      addChevron\r\n    >\r\n      {t(translations.AddConsumable)}\r\n    </DropDown>\r\n  );\r\n}\r\nconst ContentWrapper = styled.div`\r\n  width: 300px;\r\n  height: 300px;\r\n  max-height: 300px;\r\n  max-width: 300px;\r\n  overflow-y: auto;\r\n`;\r\n","import { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { BookitChip } from 'app/components/BasicChip';\r\nimport {\r\n  BatchesByServiceTypeFilter,\r\n  convertInventoryBatchName,\r\n  loadInventoryBatchesData,\r\n} from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { InventoryBatchList } from './InventoryBatchList';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectCreatableService,\r\n  selectInventoryBatchEditable,\r\n} from '../slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface InventoryBatchChipProps {\r\n  renderService: IOtherServices;\r\n  onServiceClick?: (service: IOtherServices) => void;\r\n  onAddBatchClick?: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n  renewStock?: boolean;\r\n  isAdmin?: boolean;\r\n  handleServiceChange: (item: IOtherServices) => Promise<any>;\r\n  disabled?: boolean;\r\n  onRenewStockClick?: (service: IOtherServices) => void;\r\n}\r\nexport const InventoryBatchChip = React.memo(function InventoryBatchChip(\r\n  props: InventoryBatchChipProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const {\r\n    renderService,\r\n    onServiceClick,\r\n    onAddBatchClick,\r\n    renewStock,\r\n    isAdmin,\r\n    handleServiceChange,\r\n    disabled,\r\n    onRenewStockClick,\r\n  } = props;\r\n  const batchRequested = useSelector(selectInventoryBatchEditable);\r\n  const savedCreatableRenewal = useSelector(selectCreatableService);\r\n  const [anchorEl, setAnchorEl] = React.useState(null);\r\n  const handleBatchListOpen = event => {\r\n    setAnchorEl(event.currentTarget);\r\n  };\r\n  const handleBatchListClose = () => {\r\n    setAnchorEl(null);\r\n  };\r\n  const availableBatches = useAsyncGetWthEffect<IInventoryBatchDto[]>(\r\n    async () =>\r\n      loadInventoryBatchesData(\r\n        BatchesByServiceTypeFilter(\r\n          renderService.ServiceTypeID,\r\n          renewStock === true ? undefined : true,\r\n        ),\r\n      )(null, undefined).then(res => res.value),\r\n    [],\r\n    [renderService, batchRequested, savedCreatableRenewal],\r\n  );\r\n  const currentBatch = React.useMemo(() => {\r\n    return renderService.InventoryBatchesEnabled\r\n      ? renderService.InventoryBatchId !== null\r\n        ? availableBatches.find(f => f.Id === renderService.InventoryBatchId)\r\n        : null\r\n      : null;\r\n  }, [\r\n    availableBatches,\r\n    renderService.InventoryBatchId,\r\n    renderService.InventoryBatchesEnabled,\r\n  ]);\r\n  const onChipClick = event => {\r\n    if (renewStock && !onAddBatchClick) {\r\n      !!onServiceClick && onServiceClick(renderService);\r\n    } else {\r\n      if (isAdmin && !disabled) {\r\n        handleBatchListOpen(event);\r\n      }\r\n    }\r\n  };\r\n  const handleChipSelect = React.useCallback(\r\n    (batch: IInventoryBatchDto) => {\r\n      return new Promise(async resolve => {\r\n        try {\r\n          handleBatchListClose();\r\n          await handleServiceChange(\r\n            Object.assign({}, renderService, {\r\n              InventoryBatchId: batch.Id,\r\n              InventoryBatchName: batch.Name,\r\n              InventoryBatchAmount: batch.Inventory,\r\n            }),\r\n          );\r\n        } catch (error) {}\r\n      });\r\n    },\r\n    [handleServiceChange, renderService],\r\n  );\r\n  React.useEffect(() => {\r\n    if (batchRequested !== undefined) {\r\n      handleChipSelect(batchRequested);\r\n      dispatch(actions.setInventoryBatchEditable(undefined));\r\n    }\r\n  }, [actions, batchRequested, dispatch, handleChipSelect]);\r\n  React.useEffect(() => {\r\n    if (savedCreatableRenewal !== undefined) {\r\n      handleChipSelect({\r\n        Id: savedCreatableRenewal.InventoryBatchId,\r\n        Name: savedCreatableRenewal.InventoryBatchName,\r\n        Inventory: savedCreatableRenewal.InventoryBatchAmount,\r\n      } as IInventoryBatchDto);\r\n      dispatch(actions.getCreatableService(undefined));\r\n    }\r\n  }, [actions, dispatch, handleChipSelect, savedCreatableRenewal]);\r\n  return (\r\n    <React.Fragment>\r\n      <BookitChip\r\n        shape=\"circle\"\r\n        customsize=\"small\"\r\n        notremoved={true}\r\n        disabled={!isAdmin || disabled}\r\n        custombgcolor={bookitColors.primary.bgLight}\r\n        customcolor={bookitColors.primary.dark}\r\n        label={\r\n          currentBatch !== null && currentBatch !== undefined\r\n            ? convertInventoryBatchName(\r\n                currentBatch.Id,\r\n                currentBatch.Name,\r\n                currentBatch.Inventory,\r\n              )\r\n            : renderService.AutoGenerateNewBatches === true\r\n            ? t(translations.InventoryBatchEmptyGenerateOn_info)\r\n            : isAdmin\r\n            ? t(translations.InventoryBatchEmptyGenerateOff_info)\r\n            : t(translations.InventoryBatch_notFound)\r\n        }\r\n        onClick={onChipClick}\r\n      />\r\n      {(!renewStock || (renewStock && !!onAddBatchClick)) && (\r\n        <InventoryBatchList\r\n          anchorEl={anchorEl}\r\n          addNewBatchClick={() => {\r\n            !!onAddBatchClick &&\r\n              onAddBatchClick(null, renderService.ServiceTypeID);\r\n            handleBatchListClose();\r\n          }}\r\n          isAdmin={isAdmin ?? false}\r\n          onClose={handleBatchListClose}\r\n          serviceTypeId={renderService.ServiceTypeID}\r\n          onBatchClick={handleChipSelect}\r\n          selectedBatch={currentBatch ?? undefined}\r\n          showRenewStockButtons={!renewStock}\r\n          createdRenewal={savedCreatableRenewal}\r\n          onRenewStockClick={batchId => {\r\n            !!onRenewStockClick &&\r\n              onRenewStockClick(\r\n                Object.assign({}, renderService, {\r\n                  InventoryBatchId: batchId ?? null,\r\n                }),\r\n              );\r\n            handleBatchListClose();\r\n          }}\r\n          batches={[]}\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { useTheme, FormHelperText } from '@material-ui/core';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\n\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { AuthenticatedUser, IIsAdminOfParams } from 'types/AuthenticatedUser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ErrorServices } from '../slice/types';\r\nimport { InventoryBatchChip } from './InventoryBatchChip';\r\n\r\nexport interface QuickServiceItemProps {\r\n  service: IOtherServices;\r\n  handleRemove: (item: IOtherServices) => Promise<any>;\r\n  handleChange: (item: IOtherServices) => Promise<any>;\r\n  onServiceClick?: (item: IOtherServices) => void;\r\n  mandatory?: boolean;\r\n  isEditMode?: boolean;\r\n  createdEditable?: boolean;\r\n  count: number | null;\r\n  minStep: number;\r\n  step: number;\r\n  maxStep: number;\r\n  disabled?: boolean;\r\n  renewStock?: boolean;\r\n  user?: AuthenticatedUser;\r\n  onAddBatchClick?: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n  onRenewStockClick?: (service: IOtherServices) => void;\r\n  setError?: (error: ErrorServices) => void;\r\n  focused?: boolean;\r\n}\r\nconst QuickItem = styled('div')(({ theme }) => ({\r\n  display: 'flex',\r\n  flexDirection: 'column',\r\n  background: theme.palette.common.white,\r\n  boxShadow: 'inset 0px -1px 0px #E3E8EF',\r\n  '& .errorsRoot': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'flex-start',\r\n  },\r\n  '& .contentRoot': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: '12px 12px',\r\n    gap: '8px',\r\n    '& .textandImage': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '0px',\r\n      gap: '12px',\r\n      width: '100%',\r\n      flexGrow: 1,\r\n    },\r\n    '& .quantity': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '0px',\r\n      gap: '8px',\r\n      flexGrow: 0,\r\n    },\r\n    '& .adjustment': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: '0px 0px 0px 8px',\r\n      gap: '10px',\r\n    },\r\n  },\r\n  '& .bottomRoot': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'flex-start',\r\n    justifyContent: 'flex-end',\r\n    padding: '0px 8px 8px 8px',\r\n  },\r\n}));\r\n\r\nexport const QuickServiceItem = React.memo(function QuickServiceItem(\r\n  props: QuickServiceItemProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const {\r\n    service,\r\n    mandatory,\r\n    handleChange,\r\n    handleRemove,\r\n    onServiceClick,\r\n    isEditMode,\r\n    createdEditable,\r\n    count,\r\n    minStep,\r\n    step,\r\n    maxStep,\r\n    disabled,\r\n    renewStock,\r\n    onAddBatchClick,\r\n    onRenewStockClick,\r\n    user,\r\n    setError,\r\n    focused,\r\n  } = props;\r\n  const theme = useTheme();\r\n  const inputProps = {\r\n    step: step,\r\n    min: minStep,\r\n    max: maxStep,\r\n    'aria-label': 'Counter',\r\n    style: {\r\n      minWidth: '30px',\r\n      padding: '6px 6px',\r\n      textAlign: 'center' as 'center',\r\n    },\r\n  };\r\n  const [errorMessage, setErrorMessage] = React.useState<string | undefined>(\r\n    undefined,\r\n  );\r\n  const handleAddError = React.useCallback(\r\n    (error: string | undefined) => {\r\n      setErrorMessage(error);\r\n      if (!!setError) {\r\n        setError({\r\n          id: service.ServiceTypeID,\r\n          error: !!error ? `${service.ServiceType}: ${error}` : undefined,\r\n        } as ErrorServices);\r\n      }\r\n    },\r\n    [service.ServiceType, service.ServiceTypeID, setError],\r\n  );\r\n  const [quantity, setQuantity] = React.useState<number | null>(count);\r\n  React.useEffect(() => {\r\n    setQuantity(count);\r\n  }, [count]);\r\n  React.useEffect(() => {\r\n    if (quantity === null || quantity === undefined || quantity === 0) {\r\n      handleAddError(t(translations.err_Quantity_required) as string);\r\n    }\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [quantity, t]);\r\n\r\n  // const IsGroupAdmin = React.useMemo(() => {\r\n  //   return user?.HasAdminGroupPermissions(service?.ServiceGroupId ?? undefined);\r\n  // }, [service?.ServiceGroupId, user]);\r\n  const IsAdminOfService = React.useMemo(() => {\r\n    return user?.IsAdminOf({\r\n      ServiceGroupId: service?.ServiceGroupId,\r\n      ServiceId: service?.Id,\r\n      ServiceTypeId: ServiceType.Offline,\r\n    } as IIsAdminOfParams);\r\n  }, [service?.Id, service?.ServiceGroupId, user]);\r\n  const [counterUpdated, setCounterUpdated] = React.useState<boolean>(false);\r\n  const arrowTitle = React.useMemo(() => {\r\n    if (service.TrackInventory && service.RenewStockInventory) {\r\n      return t(translations.RenewStockArrow_info) as string;\r\n    } else {\r\n      return isEditMode && service.Id > 0\r\n        ? (t(translations.ReservationOfflineServiceEditArrow_info) as string)\r\n        : createdEditable\r\n        ? (t(translations.ConsumableCreateArrow_info) as string)\r\n        : (t(translations.ReservationOfflineServiceCreateArrow_info) as string);\r\n    }\r\n  }, [\r\n    createdEditable,\r\n    isEditMode,\r\n    service.Id,\r\n    service.RenewStockInventory,\r\n    service.TrackInventory,\r\n    t,\r\n  ]);\r\n  const serviceChange = React.useCallback(\r\n    (change: number | null, item: IOtherServices, withError?: boolean) => {\r\n      return new Promise(async resolve => {\r\n        const precision = service.IntQuantityOnly === true ? 0 : 2;\r\n        try {\r\n          await handleChange(\r\n            Object.assign({}, item, {\r\n              Quantity: change === null ? null : +change.toFixed(precision),\r\n              DefaultQuantity: change === null ? null : item.DefaultQuantity,\r\n              ServiceDate: dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(item.ServiceDate),\r\n              ),\r\n            }),\r\n          );\r\n\r\n          setQuantity(change === null ? null : +change.toFixed(precision));\r\n          setCounterUpdated(false);\r\n          if (!withError) {\r\n            handleAddError(undefined);\r\n          }\r\n        } catch (error) {\r\n          handleAddError(error as string);\r\n          setQuantity(change === null ? null : +change.toFixed(precision));\r\n          setCounterUpdated(false);\r\n        }\r\n      });\r\n    },\r\n    [handleAddError, handleChange, service.IntQuantityOnly],\r\n  );\r\n  const remove = (service: IOtherServices) => {\r\n    return new Promise(async resolve => {\r\n      try {\r\n        await handleRemove(service);\r\n        resolve(undefined);\r\n        setCounterUpdated(false);\r\n      } catch (error) {\r\n        handleAddError(error as string);\r\n        setCounterUpdated(false);\r\n      }\r\n    });\r\n  };\r\n  const onInputChange = React.useCallback(\r\n    event => {\r\n      const precision = service.IntQuantityOnly === true ? 0 : 2;\r\n      if (event.target.value === '') {\r\n        //setCounterUpdated(true);\r\n        setQuantity(null);\r\n        serviceChange(null, service, true);\r\n        handleAddError(\r\n          (t(translations.err_LowQuantity) as string).replace(\r\n            '{0}',\r\n            minStep.toString(),\r\n          ),\r\n        );\r\n        return;\r\n      } else {\r\n        const value = +(+event.target.value).toFixed(precision);\r\n        if (value < minStep) {\r\n          // event.preventDefault();\r\n          // event.stopPropagation();\r\n          setCounterUpdated(true);\r\n          serviceChange(value, service, true);\r\n          handleAddError(\r\n            (t(translations.err_LowQuantity) as string).replace(\r\n              '{0}',\r\n              minStep.toString(),\r\n            ),\r\n          );\r\n        } else if (value > 0 && value > maxStep) {\r\n          event.preventDefault();\r\n          event.stopPropagation();\r\n          handleAddError(\r\n            (t(translations.err_HighQuantity) as string).replace(\r\n              '{0}',\r\n              maxStep.toString(),\r\n            ),\r\n          );\r\n        } else {\r\n          handleAddError(undefined);\r\n          // setCounterUpdated(true);\r\n          serviceChange(value, service);\r\n        }\r\n      }\r\n    },\r\n    [handleAddError, maxStep, minStep, service, serviceChange, t],\r\n  );\r\n  return (\r\n    <QuickItem theme={theme}>\r\n      <div className={'errorsRoot'}>\r\n        <FormHelperText error={errorMessage !== undefined}>\r\n          {errorMessage}\r\n        </FormHelperText>\r\n      </div>\r\n      <div className={'contentRoot'}>\r\n        <div className={'textandImage'}>\r\n          <BasicTypography display=\"inline\">{`${service.ServiceType}`}</BasicTypography>\r\n        </div>\r\n        <div className={'quantity'}>\r\n          <IconButton\r\n            variant=\"white\"\r\n            size=\"small\"\r\n            shape=\"square\"\r\n            title={\r\n              mandatory\r\n                ? (t(translations.OfflineServiceMandatory_info) as string)\r\n                : undefined\r\n            }\r\n            disabled={disabled || counterUpdated}\r\n            onClick={() => {\r\n              let valid = mandatory\r\n                ? (quantity ?? 0) - step > 0\r\n                : (quantity ?? 0) - step >= 0;\r\n              if (\r\n                !mandatory &&\r\n                !valid &&\r\n                (quantity === null || quantity <= 0)\r\n              ) {\r\n                setCounterUpdated(true);\r\n                remove(service);\r\n                return;\r\n              }\r\n              if (valid) {\r\n                handleAddError(undefined);\r\n                if (!mandatory && (quantity ?? 0) - step === 0) {\r\n                  setCounterUpdated(true);\r\n                  remove(service);\r\n                } else {\r\n                  setCounterUpdated(true);\r\n                  serviceChange((quantity ?? 0) - step, service);\r\n                }\r\n              } else {\r\n                handleAddError(\r\n                  (t(translations.err_LowQuantity) as string).replace(\r\n                    '{0}',\r\n                    minStep.toString(),\r\n                  ),\r\n                );\r\n              }\r\n            }}\r\n          >\r\n            {(quantity ?? 0) <= step ? (\r\n              <Icon icon=\"trash\" />\r\n            ) : (\r\n              <Icon icon=\"minus\" />\r\n            )}\r\n          </IconButton>\r\n          <StyledBaseTextField\r\n            error={errorMessage !== undefined}\r\n            type=\"number\"\r\n            variant=\"standard\"\r\n            id={`ServiceCount_${service.ServiceTypeID}`}\r\n            inputProps={inputProps}\r\n            value={quantity ?? ''}\r\n            disabled={counterUpdated}\r\n            autoFocus={focused}\r\n            required\r\n            style={{ width: '56px' }}\r\n            //helperText={errorMessage}\r\n            onChange={onInputChange}\r\n          />\r\n          <IconButton\r\n            variant=\"white\"\r\n            size=\"small\"\r\n            shape=\"square\"\r\n            disabled={counterUpdated}\r\n            onClick={() => {\r\n              let valid = (quantity ?? 0) + step < maxStep;\r\n              if (valid) {\r\n                setCounterUpdated(true);\r\n                serviceChange((quantity ?? 0) + step, service);\r\n              } else {\r\n                handleAddError(\r\n                  (t(translations.err_HighQuantity) as string).replace(\r\n                    '{0}',\r\n                    maxStep.toString(),\r\n                  ),\r\n                );\r\n              }\r\n            }}\r\n          >\r\n            <Icon icon=\"plus\" />\r\n          </IconButton>\r\n        </div>\r\n\r\n        <div className={'adjustment'}>\r\n          {counterUpdated ? (\r\n            <IconButton variant=\"ghost\" size=\"xs\" shape=\"square\">\r\n              <Icon icon=\"spinner\" spin={true} />\r\n            </IconButton>\r\n          ) : (\r\n            <React.Fragment>\r\n              {!!onServiceClick && (\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  size=\"xs\"\r\n                  shape=\"square\"\r\n                  disabled={\r\n                    (!isEditMode && !createdEditable) ||\r\n                    (isEditMode && service.Id < 1)\r\n                  }\r\n                  title={arrowTitle}\r\n                  onClick={() => !!onServiceClick && onServiceClick(service)}\r\n                >\r\n                  <Icon icon=\"chevron-right\" />\r\n                </IconButton>\r\n              )}\r\n            </React.Fragment>\r\n          )}\r\n        </div>\r\n      </div>\r\n      {service.InventoryBatchesEnabled && IsAdminOfService && (\r\n        <div className={'bottomRoot'}>\r\n          <InventoryBatchChip\r\n            renderService={service}\r\n            onServiceClick={onServiceClick}\r\n            onAddBatchClick={onAddBatchClick}\r\n            renewStock={renewStock}\r\n            isAdmin={IsAdminOfService}\r\n            handleServiceChange={handleChange}\r\n            disabled={isEditMode && service.Id > 0}\r\n            onRenewStockClick={onRenewStockClick}\r\n          />\r\n        </div>\r\n      )}\r\n    </QuickItem>\r\n  );\r\n});\r\nconst StyledBaseTextField = styled(BaseTextField)(({ theme }) => ({\r\n  '& input[type=number]': {\r\n    '-moz-appearance': 'textfield',\r\n  },\r\n  '& input[type=number]::-webkit-outer-spin-button': {\r\n    '-webkit-appearance': 'none',\r\n    margin: 0,\r\n  },\r\n  '& input[type=number]::-webkit-inner-spin-button': {\r\n    '-webkit-appearance': 'none',\r\n    margin: 0,\r\n  },\r\n}));\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\n\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { PageTopActionsProps } from '../type';\r\n\r\nexport function AddConsumable(\r\n  props: PageTopActionsProps & { services: number[] },\r\n) {\r\n  const location = useLocation();\r\n  //const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { t } = useTranslation();\r\n  const {\r\n    size,\r\n    text,\r\n    variant,\r\n    icon,\r\n    services,\r\n    disabled,\r\n    compact = true,\r\n  } = props;\r\n\r\n  return (\r\n    <TopActionButton\r\n      text={text || (t(translations.AddConsumable) as string)}\r\n      icon={icon || 'plus'}\r\n      startIcon={icon || 'plus'}\r\n      variant={variant || 'ghost'}\r\n      size={size || 'small'}\r\n      disabled={disabled}\r\n      noChangeOnMobile={!compact}\r\n      onClick={() => {\r\n        let selParams = {\r\n          useSidePanel: true,\r\n          actionType: 'OfflineService',\r\n          offTypeIds:\r\n            services.length > 0\r\n              ? services.join(',')\r\n              : GetRawValue(new URLSearchParams(location.search), 'stid'),\r\n        } as AssetsSelectionProps;\r\n        dispatch(\r\n          actions.openSidePanel({\r\n            type: RenderPageType.AssetsSelection,\r\n            props: selParams,\r\n            expanded: false,\r\n          }),\r\n        );\r\n      }}\r\n    />\r\n  );\r\n}\r\nexport function AddCoverConsumable(\r\n  props: PageTopActionsProps & {\r\n    services: number[];\r\n    onAddClick: (services: number[]) => void;\r\n  },\r\n) {\r\n  const { t } = useTranslation();\r\n  const {\r\n    size,\r\n    text,\r\n    variant,\r\n    icon,\r\n    services,\r\n    disabled,\r\n    onAddClick,\r\n    compact = true,\r\n  } = props;\r\n\r\n  return (\r\n    <TopActionButton\r\n      text={text || (t(translations.AddConsumable) as string)}\r\n      icon={icon || 'plus'}\r\n      startIcon={icon || 'plus'}\r\n      variant={variant || 'ghost'}\r\n      size={size || 'small'}\r\n      disabled={disabled}\r\n      noChangeOnMobile={!compact}\r\n      onClick={() => onAddClick(services)}\r\n    />\r\n  );\r\n}\r\n","import { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { AddCoverConsumable } from 'app/pages/Actions/PageTopActions/AddConsumable';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport {\r\n  selectBarcodeScanned,\r\n  selectSelectedServiceType,\r\n} from '../slice/selectors';\r\nimport * as React from 'react';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport { loadOfflineServiceData } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nexport interface AddServiceFromSelectionProps {\r\n  onAddClick: (services: number[]) => void;\r\n  getServiceTypes?: (\r\n    searchTerm: string | null,\r\n    predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n  ) => Promise<IOfflineServiceFilterDto[]>;\r\n  addServices: (serviceType: IOfflineServiceFilterDto[]) => void;\r\n  removeServices: (services: IOtherServices[]) => void;\r\n  addAndRemoveServices: (\r\n    serviceType: IOfflineServiceFilterDto[],\r\n    services: IOtherServices[],\r\n  ) => void;\r\n  selected: IOtherServices[];\r\n  disabled?: boolean;\r\n}\r\nexport function AddServiceFromSelection(props: AddServiceFromSelectionProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const {\r\n    getServiceTypes,\r\n    addServices,\r\n    selected,\r\n    disabled,\r\n    onAddClick,\r\n    removeServices,\r\n    addAndRemoveServices,\r\n  } = props;\r\n  const newSelectedServices = useSelector(selectSelectedServiceType);\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const [updated, setUpdated] = React.useState<boolean | undefined>(undefined);\r\n  const isBarcodeScanned = useSelector(selectBarcodeScanned);\r\n  const fetchServiceTypes = async (): Promise<IOfflineServiceFilterDto[]> => {\r\n    const filter: (string | Condition<IOfflineServiceFilterDto>)[] = [];\r\n    if (!!selected && selected.length > 0) {\r\n      filter.push(\r\n        new Condition<IOfflineServiceFilterDto>(\r\n          'Id',\r\n          ODataOperators.Excludes,\r\n          selected.map(s => s.ServiceTypeID),\r\n        ),\r\n      );\r\n    }\r\n    if (!!newSelectedServices && newSelectedServices.length > 0) {\r\n      filter.push(\r\n        new Condition<IOfflineServiceFilterDto>(\r\n          'Id',\r\n          ODataOperators.Includes,\r\n          newSelectedServices.map(s => s),\r\n        ),\r\n      );\r\n    }\r\n    return new Promise(async (resolve, reject) => {\r\n      if (!!getServiceTypes) {\r\n        try {\r\n          const data = await getServiceTypes(null, filter);\r\n          resolve(data);\r\n        } catch {\r\n          resolve([]);\r\n        }\r\n      } else {\r\n        try {\r\n          const data = await loadOfflineServiceData(\r\n            filter,\r\n            'base',\r\n            globalServiceGroupFilter || [],\r\n            undefined,\r\n            'InventoryBatches',\r\n          )(null, undefined);\r\n          resolve(data.value);\r\n        } catch (error) {\r\n          resolve([]);\r\n        }\r\n      }\r\n    });\r\n  };\r\n  const [serviceTypes, setServiceTypes] = useAsyncExtendedState<\r\n    IOfflineServiceFilterDto[]\r\n  >([]);\r\n  const [fetchServiceTypeState, fetchServiceTypePromise] = usePromise(\r\n    fetchServiceTypes,\r\n  );\r\n  React.useEffect(() => {\r\n    if (\r\n      newSelectedServices.length > 0 &&\r\n      !updated &&\r\n      fetchServiceTypeState.status !== 'pending'\r\n    ) {\r\n      setServiceTypes(fetchServiceTypePromise());\r\n      setUpdated(true);\r\n    }\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    fetchServiceTypePromise,\r\n    fetchServiceTypeState.status,\r\n    newSelectedServices,\r\n    newSelectedServices.length,\r\n    selected,\r\n    serviceTypes,\r\n    setServiceTypes,\r\n    updated,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let added = newSelectedServices.filter(\r\n      f => !selected.some(s => s.ServiceTypeID === f),\r\n    );\r\n    let removed = isBarcodeScanned\r\n      ? []\r\n      : selected.filter(\r\n          f => !newSelectedServices.some(c => c === f.ServiceTypeID),\r\n        );\r\n    if (\r\n      (added.length > 0 || removed.length > 0) &&\r\n      updated &&\r\n      fetchServiceTypeState.status === 'resolved' &&\r\n      serviceTypes.length > 0\r\n    ) {\r\n      setUpdated(undefined);\r\n      dispatch(actions.resetSelectedServiceType());\r\n      dispatch(actions.setBarcodeScanned(undefined));\r\n\r\n      if (added.length > 0 && removed.length > 0) {\r\n        addAndRemoveServices(\r\n          serviceTypes.filter(f => added.includes(f.Id)),\r\n          removed,\r\n        );\r\n      } else {\r\n        if (added.length > 0) {\r\n          addServices(serviceTypes.filter(f => added.includes(f.Id)));\r\n        }\r\n        if (removed.length > 0) {\r\n          removeServices(removed);\r\n        }\r\n      }\r\n\r\n      setServiceTypes([]);\r\n    }\r\n  }, [\r\n    actions,\r\n    addAndRemoveServices,\r\n    addServices,\r\n    dispatch,\r\n    fetchServiceTypeState.status,\r\n    isBarcodeScanned,\r\n    newSelectedServices,\r\n    removeServices,\r\n    selected,\r\n    serviceTypes,\r\n    setServiceTypes,\r\n    updated,\r\n  ]);\r\n  return (\r\n    <AddCoverConsumable\r\n      compact={false}\r\n      text={t(translations.AddConsumable) as string}\r\n      size=\"small\"\r\n      variant=\"white\"\r\n      services={selected.map(f => f.ServiceTypeID)}\r\n      disabled={disabled}\r\n      onAddClick={onAddClick}\r\n    />\r\n  );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport * as React from 'react';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { AddService } from './AddService';\r\nimport { QuickServiceItem } from './QuickServiceItem';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { selectRefreshOfflineServices } from 'app/pages/ReservationDetails/Details/slice/selectors';\r\nimport { useReservationSlice } from 'app/pages/ReservationDetails/Details/slice';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { AddServiceFromSelection } from './AddServiceFromSelection';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { ScannerView } from 'app/components/ScannerView';\r\nimport { selectRefreshConsumableServices } from '../slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { ErrorServices } from '../slice/types';\r\nimport clsx from 'clsx';\r\nimport styled from 'styled-components';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\n\r\nexport interface BookQuickServicesProps {\r\n  initServicesFunc: () => Promise<IOtherServices[]>;\r\n  loadSeviceTypes?: (\r\n    searchTerm: string | null,\r\n    predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n  ) => Promise<IOfflineServiceFilterDto[]>;\r\n  onServiceUpdate?: (service: IOtherServices) => Promise<any>;\r\n  onServiceRemove?: (service: IOtherServices) => Promise<any>;\r\n  onServicesRemove?: (service: IOtherServices[]) => Promise<any>;\r\n  onServiceClick?: (item: IOtherServices) => void;\r\n  onRenewStockClick?: (service: IOtherServices) => void;\r\n  onAddBatchClick?: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n  createServiceFromServiceType?: (\r\n    serviceTypes: IOfflineServiceFilterDto,\r\n  ) => Promise<IOtherServices | undefined>;\r\n  createServicesFromServiceType?: (\r\n    serviceTypes: IOfflineServiceFilterDto[],\r\n  ) => Promise<IOtherServices[]>;\r\n  userName?: string;\r\n  isEditMode?: boolean;\r\n  disabled?: boolean;\r\n  useAssetSelection?: boolean;\r\n  onAddClick?: (services: number[]) => void;\r\n  onAddAndRemoveServices?: (\r\n    serviceType: IOfflineServiceFilterDto[],\r\n    services: IOtherServices[],\r\n  ) => Promise<IOtherServices[]>;\r\n  createdEditable?: boolean;\r\n  renewStock?: boolean;\r\n  setError?: (errors: ErrorServices) => void;\r\n  showScannerView?: boolean;\r\n}\r\nconst QuickServiceItems = styled('div')(({ theme }) => ({\r\n  width: '100%',\r\n  '& .addNewSection': {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'flex-start',\r\n    padding: 0,\r\n    gap: '16px',\r\n    '&.hasServices': {\r\n      padding: '16px 0px 0px',\r\n    },\r\n    '& .sectionRow': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0',\r\n      gap: '12px',\r\n      '& .sectionItems': {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        padding: '0',\r\n        gap: '8px',\r\n      },\r\n    },\r\n  },\r\n}));\r\n\r\nexport const BookQuickServices = React.memo(function BookQuickServices(\r\n  props: BookQuickServicesProps,\r\n) {\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const refreshServices = useSelector(selectRefreshOfflineServices);\r\n  const refreshCosumables = useSelector(selectRefreshConsumableServices);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useReservationSlice();\r\n  const { actions: offlineActions } = useOfflineServiceStateSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const {\r\n    initServicesFunc,\r\n    onServiceRemove,\r\n    onServicesRemove,\r\n    onServiceUpdate,\r\n    createServiceFromServiceType,\r\n    createServicesFromServiceType,\r\n    loadSeviceTypes,\r\n    onServiceClick,\r\n    userName,\r\n    isEditMode,\r\n    disabled,\r\n    useAssetSelection,\r\n    onAddClick,\r\n    onAddAndRemoveServices,\r\n    createdEditable,\r\n    renewStock,\r\n    onAddBatchClick,\r\n    onRenewStockClick,\r\n    setError,\r\n    showScannerView,\r\n  } = props;\r\n  const theme = useTheme();\r\n  const fetchServices = async (): Promise<IOtherServices[]> => {\r\n    return new Promise(async resolve => {\r\n      try {\r\n        let data = await initServicesFunc();\r\n        resolve(data);\r\n      } catch {\r\n        resolve([]);\r\n      }\r\n    });\r\n  };\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  const currentUser = React.useMemo(() => {\r\n    return !!userName ? userName : user?.Id;\r\n  }, [user?.Id, userName]);\r\n  const [serviceCreated, setServiceCreated] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [services, setServices] = useAsyncExtendedState<IOtherServices[]>([]);\r\n  const [fetchServicesState, fetchServicesPromise] = usePromise(fetchServices);\r\n  React.useEffect(() => {\r\n    if (\r\n      !fetchServicesState.status ||\r\n      (fetchServicesState.status !== 'pending' &&\r\n        fetchServicesState.status !== 'resolved')\r\n    ) {\r\n      setServices(fetchServicesPromise());\r\n    }\r\n    return () => {};\r\n  }, [\r\n    fetchServicesPromise,\r\n    fetchServicesState.status,\r\n    initServicesFunc,\r\n    setServices,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = refreshServices || refreshCosumables;\r\n    if (active === true && fetchServicesState.status !== 'pending') {\r\n      dispatch(actions.setRefreshOfflineServices(undefined));\r\n      dispatch(offlineActions.setRefreshConsumableOfflineServices(undefined));\r\n      setServices(fetchServicesPromise());\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    fetchServicesPromise,\r\n    fetchServicesState.status,\r\n    initServicesFunc,\r\n    offlineActions,\r\n    refreshCosumables,\r\n    refreshServices,\r\n    setServices,\r\n  ]);\r\n  const handleServiceChange = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      if (!!onServiceUpdate) {\r\n        try {\r\n          let data = await onServiceUpdate(service);\r\n          if (!!data) {\r\n            setServices(\r\n              services.map(f => {\r\n                if (f.ServiceTypeID === service.ServiceTypeID) {\r\n                  return Object.assign({}, f, service);\r\n                } else {\r\n                  return f;\r\n                }\r\n              }),\r\n            );\r\n            resolve(data);\r\n          } else {\r\n            reject('error occured');\r\n          }\r\n        } catch (error) {\r\n          reject(error);\r\n        }\r\n      } else {\r\n        setServices(\r\n          services.map(f => {\r\n            if (f.ServiceTypeID === service.ServiceTypeID) {\r\n              return Object.assign({}, f, service);\r\n            } else {\r\n              return f;\r\n            }\r\n          }),\r\n        );\r\n        resolve(service);\r\n      }\r\n    });\r\n  };\r\n  const handleRemoveService = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      if (!!onServiceRemove) {\r\n        try {\r\n          let res = await onServiceRemove(service);\r\n          setServices(\r\n            services.filter(f => {\r\n              if (isEditMode) {\r\n                return f.Id !== service.Id;\r\n              } else {\r\n                return f.ServiceTypeID !== service.ServiceTypeID;\r\n              }\r\n            }),\r\n          );\r\n          resolve(res);\r\n        } catch (error) {\r\n          reject(error);\r\n        }\r\n      } else {\r\n        setServices(\r\n          services.filter(f => {\r\n            return f.ServiceTypeID !== service.ServiceTypeID;\r\n          }),\r\n        );\r\n        resolve(service);\r\n      }\r\n    });\r\n  };\r\n  const handleAddService = React.useCallback(\r\n    (serviceType: IOfflineServiceFilterDto) => {\r\n      setServiceCreated(true);\r\n      setServices(\r\n        new Promise(async resolve => {\r\n          try {\r\n            if (!!createServiceFromServiceType) {\r\n              let data = await createServiceFromServiceType(serviceType);\r\n              if (!!data) {\r\n                resolve([...services, data]);\r\n              } else {\r\n                resolve([...services]);\r\n              }\r\n            } else {\r\n              let batch = serviceType.InventoryBatchesEnabled\r\n                ? !!serviceType.InventoryBatches &&\r\n                  serviceType.InventoryBatches.length > 0\r\n                  ? serviceType.InventoryBatches.filter(\r\n                      f =>\r\n                        (f.ExpirationDate === null ||\r\n                          getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n                        (serviceType.NotLessThanZero\r\n                          ? f.Inventory > 0\r\n                          : true) &&\r\n                        (renewStock === true || f.StokRenewed === true),\r\n                    ).sort((a, b) => b.Id - a.Id)[0]\r\n                  : null\r\n                : null;\r\n              resolve([\r\n                ...services,\r\n                {\r\n                  Id: 0,\r\n                  ServiceTypeID: serviceType.Id,\r\n                  BookedBy: currentUser,\r\n                  DefaultQuantity: serviceType.DefaultQuantity,\r\n                  IntQuantityOnly: serviceType.IntQuantityOnly,\r\n                  Mandatory: false,\r\n                  Quantity: serviceType.DefaultQuantity,\r\n                  ServiceDate: newDate(),\r\n                  ServiceType: serviceType.Name,\r\n                  Units: serviceType.UnitTypeName,\r\n                  ServiceGroupId: serviceType.ServiceGroupId,\r\n                  NotLessThanZero: serviceType.NotLessThanZero,\r\n                  TrackInventory: serviceType.TrackInventory,\r\n                  InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n                  InventoryBatchId: batch === null ? null : batch.Id,\r\n                  InventoryBatchName: batch === null ? null : batch.Name,\r\n                  InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n                } as IOtherServices,\r\n              ]);\r\n            }\r\n          } catch {\r\n            resolve([...services]);\r\n          } finally {\r\n            setServiceCreated(undefined);\r\n          }\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      createServiceFromServiceType,\r\n      currentUser,\r\n      getOffsetDate,\r\n      newDate,\r\n      renewStock,\r\n      services,\r\n      setServices,\r\n    ],\r\n  );\r\n  const handleAddServices = React.useCallback(\r\n    (serviceTypes: IOfflineServiceFilterDto[]) => {\r\n      setServiceCreated(true);\r\n      setServices(\r\n        new Promise(async resolve => {\r\n          try {\r\n            if (!!createServicesFromServiceType) {\r\n              let data = await createServicesFromServiceType(serviceTypes);\r\n              if (!!data && data.length > 0) {\r\n                resolve([...services, ...data]);\r\n              } else {\r\n                resolve([...services]);\r\n              }\r\n            } else {\r\n              resolve([\r\n                ...services,\r\n                ...serviceTypes.map(s => {\r\n                  let batch = s.InventoryBatchesEnabled\r\n                    ? !!s.InventoryBatches && s.InventoryBatches.length > 0\r\n                      ? s.InventoryBatches.filter(\r\n                          f =>\r\n                            (f.ExpirationDate === null ||\r\n                              getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n                            (s.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n                            (renewStock === true || f.StokRenewed === true),\r\n                        ).sort((a, b) => b.Id - a.Id)[0]\r\n                      : null\r\n                    : null;\r\n                  return {\r\n                    Id: 0,\r\n                    ServiceTypeID: s.Id,\r\n                    BookedBy: currentUser,\r\n                    DefaultQuantity: s.DefaultQuantity,\r\n                    IntQuantityOnly: s.IntQuantityOnly,\r\n                    Mandatory: false,\r\n                    Quantity: s.DefaultQuantity,\r\n                    ServiceDate: newDate(),\r\n                    ServiceType: s.Name,\r\n                    Units: s.UnitTypeName,\r\n                    UnitTypeId: s.UnitTypeID,\r\n                    ServiceGroupId: s.ServiceGroupId,\r\n                    NotLessThanZero: s.NotLessThanZero,\r\n                    TrackInventory: s.TrackInventory,\r\n                    InventoryBatchesEnabled: s.InventoryBatchesEnabled,\r\n                    InventoryBatchId: batch === null ? null : batch.Id,\r\n                    InventoryBatchName: batch === null ? null : batch.Name,\r\n                    InventoryBatchAmount:\r\n                      batch === null ? null : batch.Inventory,\r\n                  } as IOtherServices;\r\n                }),\r\n              ]);\r\n            }\r\n          } catch {\r\n            resolve([...services]);\r\n          } finally {\r\n            setServiceCreated(undefined);\r\n          }\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      createServicesFromServiceType,\r\n      currentUser,\r\n      getOffsetDate,\r\n      newDate,\r\n      renewStock,\r\n      services,\r\n      setServices,\r\n    ],\r\n  );\r\n  const handleRemoveServices = async (items: IOtherServices[]) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      if (!!onServicesRemove) {\r\n        try {\r\n          let res = await onServicesRemove(items);\r\n          setServices(\r\n            services.filter(f => {\r\n              if (isEditMode) {\r\n                return !items.some(a => a.Id === f.Id);\r\n              } else {\r\n                return !items.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n              }\r\n            }),\r\n          );\r\n          resolve(res);\r\n        } catch (error) {\r\n          reject(error);\r\n        }\r\n      } else {\r\n        let newServices = services.filter(f => {\r\n          return !items.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n        });\r\n        setServices(newServices);\r\n        resolve(newServices);\r\n      }\r\n    });\r\n  };\r\n  const handleAddAndRemoveServices = async (\r\n    serviceTypes: IOfflineServiceFilterDto[],\r\n    removed: IOtherServices[],\r\n  ) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      if (!!onAddAndRemoveServices) {\r\n        try {\r\n          let res = await onAddAndRemoveServices(serviceTypes, removed);\r\n          setServices(res);\r\n          resolve(res);\r\n        } catch (error) {\r\n          reject(error);\r\n        }\r\n      } else {\r\n        let staticServices = serviceTypes.map(s => {\r\n          return {\r\n            Id: 0,\r\n            ServiceTypeID: s.Id,\r\n            BookedBy: currentUser,\r\n            DefaultQuantity: s.DefaultQuantity,\r\n            IntQuantityOnly: s.IntQuantityOnly,\r\n            Mandatory: false,\r\n            Quantity: s.DefaultQuantity,\r\n            ServiceDate: newDate(),\r\n            ServiceType: s.Name,\r\n            Units: s.UnitTypeName,\r\n            ServiceGroupId: s.ServiceGroupId,\r\n          } as IOtherServices;\r\n        });\r\n        let addedServ = staticServices.filter(\r\n          f => !services.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n        );\r\n        let otherServices = services.filter(f => {\r\n          return !removed.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n        });\r\n        setServices([...otherServices, ...addedServ]);\r\n        resolve([...otherServices, ...addedServ]);\r\n      }\r\n    });\r\n  };\r\n  const focusedService = React.useMemo(() => {\r\n    return services.some(f => f.Quantity === null && f.DefaultQuantity === null)\r\n      ? services.filter(\r\n          f => f.Quantity === null && f.DefaultQuantity === null,\r\n        )[0]\r\n      : services[0];\r\n  }, [services]);\r\n  return (\r\n    <QuickServiceItems theme={theme}>\r\n      {services.map(item => (\r\n        <QuickServiceItem\r\n          key={item.Id + '' + item.ServiceTypeID}\r\n          handleChange={handleServiceChange}\r\n          handleRemove={handleRemoveService}\r\n          onServiceClick={onServiceClick}\r\n          onRenewStockClick={onRenewStockClick}\r\n          onAddBatchClick={onAddBatchClick}\r\n          mandatory={item.Mandatory}\r\n          service={item}\r\n          isEditMode={isEditMode}\r\n          createdEditable={createdEditable}\r\n          count={item.Quantity ?? item.DefaultQuantity}\r\n          minStep={item.IntQuantityOnly === true ? 1 : 0.01}\r\n          step={1}\r\n          maxStep={9999}\r\n          user={user}\r\n          renewStock={renewStock}\r\n          setError={setError}\r\n          focused={\r\n            item.ServiceTypeID === focusedService.ServiceTypeID\r\n              ? true\r\n              : undefined\r\n          }\r\n          disabled={\r\n            item.Mandatory\r\n              ? (item.Quantity ?? (item.IntQuantityOnly === true ? 1 : 0.01)) <\r\n                (item.IntQuantityOnly === true ? 1 : 0.01) * 2\r\n              : (item.Quantity ?? 0) <= -1\r\n          }\r\n        />\r\n      ))}\r\n      <div\r\n        className={clsx('addNewSection', { hasServices: services.length > 0 })}\r\n      >\r\n        {(useAssetSelection || showScannerView) && services.length < 1 && (\r\n          <ScannerView />\r\n        )}\r\n\r\n        <div className={'sectionRow'}>\r\n          <div className={'sectionItems'}>\r\n            {useAssetSelection ? (\r\n              <React.Fragment>\r\n                <AddServiceFromSelection\r\n                  addServices={handleAddServices}\r\n                  getServiceTypes={loadSeviceTypes}\r\n                  removeServices={handleRemoveServices}\r\n                  addAndRemoveServices={handleAddAndRemoveServices}\r\n                  selected={services}\r\n                  disabled={serviceCreated || disabled}\r\n                  onAddClick={\r\n                    !!onAddClick\r\n                      ? onAddClick\r\n                      : (services: number[]) => {\r\n                          let selParams = {\r\n                            useSidePanel: true,\r\n                            actionType: 'OfflineService',\r\n                            offTypeIds: services,\r\n                          } as AssetsSelectionProps;\r\n                          dispatch(\r\n                            layoutActions.openSidePanel({\r\n                              type: RenderPageType.AssetsSelection,\r\n                              props: selParams,\r\n                              expanded: false,\r\n                            }),\r\n                          );\r\n                        }\r\n                  }\r\n                />\r\n              </React.Fragment>\r\n            ) : (\r\n              <AddService\r\n                addService={handleAddService}\r\n                getServiceTypes={loadSeviceTypes}\r\n                selected={services}\r\n                disabled={serviceCreated || disabled}\r\n              />\r\n            )}\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </QuickServiceItems>\r\n  );\r\n});\r\n","export enum ReservationOrDowntimeEnum {\r\n  All = 0,\r\n  ReservationsOnly = 1,\r\n  DownTimeOnly = 2,\r\n}\r\n","import { capitalize } from 'lodash';\r\nimport { BookitDatePicker, BookitDatePickerProps } from '.';\r\nimport * as React from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport FormControl from '../Forms/FormControls/FormControl';\r\nimport FormHelperText from '../Forms/FormControls/FormHelperText';\r\nimport clsx from 'clsx';\r\nimport { InputLabel } from '@material-ui/core';\r\nimport { ParsableDate } from '@material-ui/pickers/constants/prop-types';\r\nimport { useUtils } from '@material-ui/pickers';\r\nimport { validateError } from '../DatePicker/utils/pickerDateValidate';\r\nimport { v4 as uuid } from 'uuid';\r\n\r\nexport interface BookitDateTimePickerProps extends BookitDatePickerProps {\r\n  labelInline?: boolean;\r\n}\r\n\r\nexport function BookitDateTimePicker({\r\n  value,\r\n  endTime,\r\n  onChange,\r\n  truncateTime,\r\n  label,\r\n  helperText,\r\n  error,\r\n  size,\r\n  labelInline = false,\r\n  dateLabel,\r\n  timeLabel,\r\n  maskIfEmpty,\r\n  id = 'datetime_picker',\r\n  ...props\r\n}: BookitDateTimePickerProps) {\r\n  const utils = useUtils();\r\n  const inputLabelId = label && id ? `${id}-label` : undefined;\r\n  const helperTextId = id ? `${id}-helper-text` : undefined;\r\n  const dateId = !!id ? `${id}-date` : uuid();\r\n  const timeId = !!id ? `${id}-time` : uuid();\r\n  const dateName = !!props.name ? `${props.name}-date` : uuid();\r\n  const timeName = !!props.name ? `${props.name}-time` : uuid();\r\n  const sizeClass = `inputSize${capitalize(size ?? 'large')}`;\r\n  const dateLabelInline = labelInline\r\n    ? dateLabel ?? `${label} Date`\r\n    : undefined;\r\n  const timeLabelInline = labelInline\r\n    ? timeLabel ?? `${label} Time`\r\n    : undefined;\r\n  const dateTimeValue = React.useMemo(() => {\r\n    return value;\r\n  }, [value]);\r\n  const [dateValue, setDateValue] = React.useState<\r\n    Date | string | null | undefined\r\n  >(() => {\r\n    if (dateTimeValue === null || dateTimeValue === undefined) {\r\n      return null;\r\n    } else {\r\n      let parsedValue = dateUtils.dateOrStringToDate(dateTimeValue);\r\n      return parsedValue === null ? null : dateUtils.truncateTime(parsedValue);\r\n    }\r\n  });\r\n  const [timeValue, setTimeValue] = React.useState<\r\n    Date | string | null | undefined\r\n  >(() => {\r\n    if (dateTimeValue === null || dateTimeValue === undefined) {\r\n      return null;\r\n    } else {\r\n      return dateUtils.dateOrStringToDate(dateTimeValue);\r\n    }\r\n  });\r\n  React.useEffect(() => {\r\n    setTimeValue(() => {\r\n      if (dateTimeValue === null || dateTimeValue === undefined) {\r\n        return null;\r\n      } else {\r\n        return dateUtils.dateOrStringToDate(dateTimeValue);\r\n      }\r\n    });\r\n    setDateValue(() => {\r\n      if (dateTimeValue === null || dateTimeValue === undefined) {\r\n        return null;\r\n      } else {\r\n        let parsedValue = dateUtils.dateOrStringToDate(dateTimeValue);\r\n        return parsedValue === null\r\n          ? null\r\n          : dateUtils.truncateTime(parsedValue);\r\n      }\r\n    });\r\n  }, [dateTimeValue]);\r\n\r\n  const handleChange = React.useCallback(\r\n    (date: MaterialUiPickersDate, inpValue?: string | null): void => {\r\n      let error = validateError(\r\n        date,\r\n        {\r\n          maxDate: props.maxDate,\r\n          minDate: props.minDate,\r\n          disablePast: props.disablePast,\r\n          disableFuture: props.disableFuture,\r\n          maxDateMessage: props.maxDateMessage,\r\n          minDateMessage: props.minDateMessage,\r\n          invalidDateMessage: props.invalidDateMessage,\r\n          strictCompareDates: props.strictCompareDates,\r\n        },\r\n        utils,\r\n      );\r\n      if (!!error) {\r\n        setDateError(error);\r\n      } else {\r\n        if (!(date?.toString() === 'Invalid Date')) {\r\n          if (props.required && (date === null || date === undefined)) {\r\n            setDateError(`${label} is a required field`);\r\n            if (!!props.onError) {\r\n              props.onError(`${label} is a required field`, date);\r\n            }\r\n          } else {\r\n            onChange(\r\n              date === null || date === undefined\r\n                ? null\r\n                : new CustomDate(date, 'complete'),\r\n              inpValue,\r\n            );\r\n          }\r\n        }\r\n      }\r\n      // onChange(\r\n      //   date === null || date === undefined\r\n      //     ? null\r\n      //     : new CustomDate(date, 'complete'),\r\n      //   inpValue,\r\n      // );\r\n    },\r\n    [label, onChange, props, utils],\r\n  );\r\n  const handleDateChange = React.useCallback(\r\n    (displayValue: MaterialUiPickersDate): void => {\r\n      const finalValue =\r\n        displayValue === null\r\n          ? null\r\n          : displayValue === undefined\r\n          ? null\r\n          : displayValue;\r\n      setDateValue(finalValue);\r\n      if (finalValue !== null) {\r\n        if (timeValue === null || timeValue === undefined) {\r\n          setTimeValue(dateUtils.startOfDay(finalValue));\r\n          if (props.saveOnSelect) {\r\n            handleChange(dateUtils.startOfDay(finalValue));\r\n          }\r\n        } else {\r\n          let time = dateUtils.dateOrStringToDate(timeValue);\r\n          let val = dateUtils.set(dateUtils.truncateTime(finalValue), {\r\n            hours: time === null ? 0 : time.getHours(),\r\n            minutes: time === null ? 0 : time.getMinutes(),\r\n            seconds: time === null ? 0 : time.getSeconds(),\r\n          });\r\n          handleChange(val);\r\n        }\r\n      } else {\r\n        if (props.saveOnSelect) {\r\n          setTimeValue(null);\r\n          handleChange(null);\r\n        } else {\r\n          if (timeValue === null || timeValue === undefined) {\r\n            handleChange(null);\r\n          }\r\n        }\r\n      }\r\n    },\r\n    [handleChange, props.saveOnSelect, timeValue],\r\n  );\r\n  const handleTimeChange = React.useCallback(\r\n    (displayValue: MaterialUiPickersDate): void => {\r\n      const finalValue =\r\n        displayValue === null\r\n          ? null\r\n          : displayValue === undefined\r\n          ? null\r\n          : displayValue;\r\n      setTimeValue(finalValue);\r\n      if (finalValue !== null) {\r\n        if (dateValue !== null && dateValue !== undefined) {\r\n          let val = dateUtils.set(dateUtils.truncateTime(dateValue), {\r\n            hours: finalValue.getHours(),\r\n            minutes: finalValue.getMinutes(),\r\n            seconds: finalValue.getSeconds(),\r\n          });\r\n          handleChange(val);\r\n        }\r\n      } else {\r\n        if (dateValue === null || dateValue === undefined) {\r\n          handleChange(null);\r\n        }\r\n      }\r\n    },\r\n    [dateValue, handleChange],\r\n  );\r\n  const [dateError, setDateError] = React.useState<React.ReactNode | undefined>(\r\n    undefined,\r\n  );\r\n  const [timeError, setTimeError] = React.useState<React.ReactNode | undefined>(\r\n    undefined,\r\n  );\r\n  const validationError = React.useMemo(() => {\r\n    return dateError || timeError || undefined;\r\n  }, [dateError, timeError]);\r\n  const handleOnError = React.useCallback(\r\n    (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n      if (!!props.onError) {\r\n        props.onError(validationError, value);\r\n      }\r\n    },\r\n    [props, validationError],\r\n  );\r\n  const onDateError = React.useCallback(\r\n    (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n      setDateError(error);\r\n      if (!!props.onError) {\r\n        handleOnError(error, value);\r\n      }\r\n    },\r\n    [handleOnError, props.onError],\r\n  );\r\n  const onTimeError = React.useCallback(\r\n    (error: React.ReactNode, value: MaterialUiPickersDate | ParsableDate) => {\r\n      setTimeError(error);\r\n      if (!!props.onError) {\r\n        handleOnError(error, value);\r\n      }\r\n    },\r\n    [handleOnError, props.onError],\r\n  );\r\n\r\n  return (\r\n    <FormControl\r\n      className={clsx('datetime-picker', sizeClass, {\r\n        withLabel: !!label && labelInline,\r\n      })}\r\n      disabled={props.disabled}\r\n      error={error || Boolean(validationError)}\r\n      fullWidth={props.fullWidth}\r\n      required={props.required}\r\n      variant={props.inputVariant || 'filled'}\r\n      size={'medium'}\r\n    >\r\n      <div className=\"datetime-picker-inputs\">\r\n        {label && !labelInline && (\r\n          <InputLabel\r\n            htmlFor={id}\r\n            id={inputLabelId}\r\n            className={clsx('datetime-picker', sizeClass, {\r\n              noLabelInline: labelInline === false,\r\n            })}\r\n            required={props.required}\r\n            error={error || Boolean(validationError)}\r\n            disabled={props.disabled}\r\n          >\r\n            {label}\r\n          </InputLabel>\r\n        )}\r\n        <BookitDatePicker\r\n          inputVariant={props.inputVariant || 'filled'}\r\n          size={size}\r\n          margin={props.margin}\r\n          disableFuture={props.disableFuture}\r\n          disablePast={props.disablePast}\r\n          label={dateLabelInline}\r\n          ariaLabel={label as string}\r\n          value={dateTimeValue}\r\n          placeholder={props.datePlaceholder}\r\n          required={props.required}\r\n          disabled={props.disabled}\r\n          autoFocus={props.autoFocus}\r\n          id={props.dateId || dateId}\r\n          name={props.dateName || dateName}\r\n          clearable={props.clearable}\r\n          onChange={handleDateChange}\r\n          minDate={props.minDate}\r\n          maxDate={props.maxDate}\r\n          strictCompareDates={props.strictCompareDates}\r\n          onError={onDateError}\r\n          onBlur={props.onBlur}\r\n          className={'datetime-date-picker'}\r\n          variant={'date'}\r\n          saveOnSelect={props.saveOnSelect}\r\n          maskIfEmpty={maskIfEmpty}\r\n        />\r\n        <BookitDatePicker\r\n          inputVariant={props.inputVariant || 'filled'}\r\n          variant={'time'}\r\n          size={size}\r\n          margin={props.margin}\r\n          minutesStep={props.minutesStep}\r\n          id={props.timeId || timeId}\r\n          name={props.timeName || timeName}\r\n          clearable={props.clearable}\r\n          onChange={handleTimeChange}\r\n          onBlur={props.onBlur}\r\n          onError={onTimeError}\r\n          label={timeLabelInline}\r\n          ariaLabel={label as string}\r\n          value={timeValue}\r\n          placeholder={props.timePlaceholder}\r\n          strictCompareDates={props.strictCompareDates}\r\n          required={props.required}\r\n          disabled={props.disabled}\r\n          // autoFocus={props.autoFocus}\r\n          minDate={props.minDate}\r\n          maxDate={props.maxDate}\r\n          className={'datetime-time-picker'}\r\n          saveOnSelect={props.saveOnSelect}\r\n          maskIfEmpty={maskIfEmpty}\r\n        />\r\n      </div>\r\n      {(!!helperText || !!validationError) && (\r\n        <FormHelperText\r\n          id={helperTextId}\r\n          className={clsx('datetime-picker', sizeClass)}\r\n          disabled={props.disabled}\r\n          error={error || Boolean(validationError)}\r\n          required={props.required}\r\n        >\r\n          {helperText || validationError}\r\n        </FormHelperText>\r\n      )}\r\n    </FormControl>\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.assetInventory || initialState;\r\n\r\nexport const selectAssetInventory = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectRoomSelected = createSelector(\r\n  [selectAssetInventory],\r\n  state => state.selectedRoomState,\r\n);\r\nexport const selectLocationSelected = createSelector(\r\n  [selectAssetInventory],\r\n  state => state.selectedLocationState,\r\n);\r\nexport const selectSubLocationSelected = createSelector(\r\n  [selectAssetInventory],\r\n  state => state.selectedSubLocationState,\r\n);\r\nexport const selectScanProcessing = createSelector(\r\n  [selectAssetInventory],\r\n  state => state.scanProcessing,\r\n);\r\nexport const selectNoRoomAccessProcessing = createSelector(\r\n  [selectAssetInventory],\r\n  state => state.noRoomAccessProcessing,\r\n);\r\nexport const selectInventoryLogFilters = createSelector(\r\n  [selectAssetInventory],\r\n  state => state.logFilters,\r\n);\r\n","export enum MultipleInstrumentReservations {\r\n  NotAllowed = 0,\r\n  AllowedDefaultMultiple = 1,\r\n  AllowedDefaultSingle = 2,\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { IOptionWithIcon } from 'app/components/Dashboard/TableViewEdit/ViewTypePicker';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { RestrictDurationUnitTypes } from 'enums/RestrictDurationUnitTypes';\r\nimport { Entity } from 'types/common';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { ISchedulerParseEvent } from '../types/ISchedulerParseEvent';\r\n\r\n/* --- STATE --- */\r\n\r\nexport interface SchedulerState {\r\n  viewState?: IViewState;\r\n  previousViewState?: IViewState;\r\n  selectedServices?: Array<ISchedulerService>;\r\n  derivedServices?: Array<ISchedulerService>;\r\n  filters?: ISerializableFilterSettings;\r\n  events: Record<string, Array<ICalendarReservationDto>>;\r\n  offlineHours: Record<string, Array<IWorkingHoursDto>>;\r\n  trainingSessions: Record<string, Array<ITrainingSessionSlotDto>>;\r\n  nonWorkingHours?: Array<IEquipmentTimeSlot>;\r\n  tempReservations?: INewEvent;\r\n  multipleInstrumentsMode?: boolean;\r\n  notUseLocation?: boolean;\r\n  emptySlotAdminClick: EmptySlotAdminClick;\r\n  selectedReservationEvents: Array<IEditEvent>;\r\n  loadingEvents?: boolean;\r\n  TimelineGroupBy: TimelineGroupByUnion;\r\n  exportToPDF: boolean;\r\n}\r\nexport type ViewTypes = 'calendar' | 'timeline';\r\nexport type ViewMultiToggleType = 'single' | 'multi';\r\nexport const ViewLengthsArray = [\r\n  'day',\r\n  'twodays',\r\n  'customdays',\r\n  'week',\r\n  'month',\r\n  'quarter',\r\n  'year',\r\n  'customPeriod',\r\n] as const;\r\ntype ViewLengthsTuple = typeof ViewLengthsArray;\r\nexport type ViewLengths = ViewLengthsTuple[number];\r\nexport const viewLengthOptions: IOptionWithIcon<ViewLengths>[] = [\r\n  { Id: 'day', Name: 'SchedulerDay', shortName: 'SchedulerShortDay' },\r\n  { Id: 'twodays', Name: 'TimelineTwoDays', shortName: 'TimelineShortTwoDays' },\r\n  {\r\n    Id: 'customdays',\r\n    Name: 'TimelineCustomDays',\r\n    shortName: 'TimelineShortCustomDays',\r\n  },\r\n  { Id: 'week', Name: 'SchedulerWeek', shortName: 'SchedulerShortWeek' },\r\n  { Id: 'month', Name: 'SchedulerMonth', shortName: 'SchedulerShortMonth' },\r\n  {\r\n    Id: 'quarter',\r\n    Name: 'TimelinePeriodQuarter',\r\n    shortName: 'TimelineShortQuarter',\r\n  },\r\n  { Id: 'year', Name: 'TimelinePeriodYear', shortName: 'TimelineShortYear' },\r\n  {\r\n    Id: 'customPeriod',\r\n    Name: 'TimelineCustomDays',\r\n    shortName: 'TimelineShortCustomDays',\r\n    Icon: 'cog',\r\n  },\r\n];\r\nexport const viewTypeOptions: IOptionWithIcon<ViewTypes>[] = [\r\n  {\r\n    Id: 'calendar',\r\n    Name: 'Calendar',\r\n    Icon: 'calendar',\r\n  },\r\n  {\r\n    Id: 'timeline',\r\n    Name: 'Timeline',\r\n    Icon: 'list-timeline',\r\n  },\r\n];\r\nexport type ISerializableFilterSettings = Record<\r\n  string,\r\n  {\r\n    value: any;\r\n    predicate: string | Condition<ICalendarReservationDto>;\r\n  }\r\n>;\r\nexport const getViewType = (type: ViewTypes) => {\r\n  return viewTypeOptions.find(f => f.Id === type);\r\n};\r\nexport const getViewLength = (length: ViewLengths) => {\r\n  return viewLengthOptions.find(f => f.Id === length);\r\n};\r\n// Parsing error: Type expected.\r\n// TODO: upgrade prettier to support Template Literal Types (https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html)\r\n// prettier v2.2.0 + - https://prettier.io/blog/2020/11/20/2.2.0.html#typescript\r\n// eslint-disable-next-line prettier/prettier\r\nexport type ViewModesTimeline = `${ViewLengths}_timeline`;\r\n// eslint-disable-next-line prettier/prettier\r\nexport type ViewModesUnit = `${ViewLengths}_unit`;\r\nexport type ViewModes = ViewLengths | ViewModesTimeline | ViewModesUnit;\r\n\r\nexport interface IInstrument extends Entity<number> {\r\n  ServiceGroup: Entity<number>;\r\n  Color: string;\r\n}\r\n\r\nexport interface IChangeViewModePayload {\r\n  current: IViewState;\r\n  withNoChangeLocation?: boolean;\r\n  forceEvents?: boolean;\r\n}\r\n\r\nexport interface IEventBase {\r\n  start_date: Timestamp;\r\n  end_date: Timestamp;\r\n  service_id: number;\r\n  service_name: string;\r\n  color?: string | null;\r\n}\r\n\r\nexport interface IEvent extends IEventBase {\r\n  id: number;\r\n  reservation_id?: number;\r\n  alert_id?: number;\r\n  service_id: number;\r\n  service_name: string;\r\n  user_id: string;\r\n  user_name: string;\r\n}\r\n\r\nexport interface INonWorkingHours extends IEventBase {\r\n  id: `nonworking_${number}`;\r\n}\r\nexport interface IOfflineHours extends IEventBase {\r\n  id: `offline_${number}`;\r\n  offline: true;\r\n}\r\n\r\nexport type ISchedulerService = IServiceFilterDto;\r\n\r\nexport interface INewEvent {\r\n  id: string | number;\r\n  start_date: Timestamp;\r\n  end_date: Timestamp;\r\n  service_id?: number | Array<number>;\r\n  alert_type?: number;\r\n  sample_run_id?: number;\r\n  defaultMulti?: boolean;\r\n  bid?: number;\r\n  srid?: number;\r\n  srrid?: number;\r\n  un?: string;\r\n  duration?: number;\r\n}\r\nexport interface IEditEvent extends ISchedulerParseEvent {}\r\n\r\nexport type EventType = 'offline' | 'reservation' | 'trainingsession';\r\n\r\nexport interface IViewState {\r\n  preset: SchedulerDatePositionUnion | null;\r\n  viewType: ViewTypes;\r\n  viewLength: ViewLengths;\r\n  date: Timestamp;\r\n  search: string;\r\n  customDays?: number;\r\n  customStart?: boolean;\r\n  groupBy?: TimelineGroupByUnion;\r\n}\r\nexport interface RestrictDuration {\r\n  durationType: RestrictDurationUnitTypes;\r\n  durationAmount: number;\r\n}\r\n\r\nexport type ChangeViewModeAction = PayloadAction<IChangeViewModePayload>;\r\nexport type GetServicesAction = PayloadAction<\r\n  Array<ISchedulerService> | undefined\r\n>;\r\nexport type ChangeServicesAction = PayloadAction<Array<number>>;\r\nexport type SetFilterAction = PayloadAction<\r\n  ISerializableFilterSettings | undefined\r\n>;\r\n\r\nexport interface IOnlineEventDto {\r\n  StartTime: string;\r\n  EndTime: string;\r\n  EquipmentId: number;\r\n  ServiceGroupId: number;\r\n  AssetRoomId: number | null;\r\n  AssetCampusId: number | null;\r\n  AssetBuildingId: number | null;\r\n  AssetGroupId: number | null;\r\n  AssetCatId: number | null;\r\n  AvailabilityTypeId: number | null;\r\n  BookedById: string;\r\n}\r\nexport interface DateSection {\r\n  date: Date;\r\n  section?: number;\r\n}\r\nexport interface LeftTop {\r\n  left: number;\r\n  top: number;\r\n}\r\nexport type ScrollPosition = DateSection | LeftTop | Date | number;\r\n","import { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { OnlineServiceMultiPicker } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ServiceMultiFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <OnlineServiceMultiPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={false}\r\n      placeholder={t(translations.AllValues)}\r\n      additionalItem={props.additionalItem as IServiceFilterDto}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport const ServiceAdminFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <OnlineServiceMultiPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={false}\r\n      placeholder={t(translations.AllValues)}\r\n      additionalItem={props.additionalItem as IServiceFilterDto}\r\n      ariaLabel={props.label}\r\n      urlType=\"admin\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport const ServiceReservationFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <OnlineServiceMultiPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={false}\r\n      placeholder={t(translations.AllValues)}\r\n      additionalItem={props.additionalItem as IServiceFilterDto}\r\n      ariaLabel={props.label}\r\n      urlType=\"reserved\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\n","import styled from 'styled-components/macro';\r\n\r\nexport const P = styled.p`\r\n  font-size: 1rem;\r\n  line-height: 1.5;\r\n  color: black;\r\n  margin: 0.625rem 0 1.5rem 0;\r\n`;\r\n","import * as React from 'react';\r\nimport styled from 'styled-components/macro';\r\nimport { P } from './P';\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Button } from '../../components/BasicButtons/Button';\r\n\r\nexport function NotFoundPage() {\r\n  return (\r\n    <>\r\n      <Helmet>\r\n        <title>404 Page Not Found</title>\r\n        <meta name=\"description\" content=\"Page not found\" />\r\n      </Helmet>\r\n      <Wrapper id=\"not_found_page\">\r\n        <DivStyle>\r\n          <svg\r\n            width=\"270\"\r\n            height=\"276\"\r\n            viewBox=\"0 0 270 276\"\r\n            fill=\"none\"\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n          >\r\n            <g clipPath=\"url(#clip0)\">\r\n              <path\r\n                d=\"M150.747 77.6918L147.08 58.562L143.959 41.7158V41.6921C143.932 41.7565 143.908 41.8242 143.881 41.8852C144.263 43.8639 150.476 76.1061 150.612 77.7426L150.747 77.6918Z\"\r\n                fill=\"#F8F8F8\"\r\n              />\r\n              <path\r\n                d=\"M144.91 37.7242V37.7008C144.912 37.7197 144.912 37.7388 144.91 37.7577V37.7242Z\"\r\n                fill=\"#F8F8F8\"\r\n              />\r\n              <path\r\n                d=\"M238.303 92.3591C231.64 80.9273 226.026 70.9456 220.639 62.2041C199.272 59.7815 186.938 50.1082 176.232 50.1082C174.986 50.1082 173.049 50.6164 172.314 50.6164L170.689 53.6658L170.737 57.8638L173.252 58.3381L176.638 60.144L179.039 62.3836L181.977 66.7612L181.778 66.8933C183.223 67.4524 184.361 68.313 185.001 69.5633C185.837 71.1896 185.766 73.1006 185.099 75.0827C190.276 94.4768 186.917 123.321 184.984 124.923C182.059 127.349 150.872 119.163 148.282 115.551C147.206 114.061 147.426 103.859 149.359 92.4201L149.606 92.3015C145.357 92.8098 141.541 92.3015 139.148 89.9128C133.69 84.451 136.365 46.1677 136.663 42.1391C135.799 40.0976 135.372 37.8978 135.41 35.6812C135.43 30.3888 137.573 26.0892 140.228 26.0892C141.409 26.0892 142.493 26.9464 143.329 28.3627L142.99 27.5495H144.236L145.547 28.4236L147.24 31.4967L147.659 33.8448L147.531 42.2035L152.481 70.6983L155.487 70.4035L157.014 67.0153L160.322 62.3667L162.912 59.5443V57.7554C157.888 56.8948 153.974 50.0167 153.974 41.6614C153.974 41.0312 153.994 40.4077 154.038 39.7979L154.323 36.2131L154.851 35.0307C154.874 34.9392 154.898 34.8477 154.925 34.7596C154.536 34.5461 153.232 33.3467 153.232 29.2131C153.232 21.0814 162.225 16.7106 169.765 15.0165C159.736 10.6796 148.513 7.31512 136.151 4.58083C110.944 -0.887732 81.1734 -3.75077 63.1545 9.48696C45.1355 22.7247 38.8753 51.887 28.5893 84.2342C18.229 116.578 3.84628 152.097 11.2712 184.525C18.6149 216.872 47.8373 246.123 79.8598 250.222C111.882 254.322 146.671 233.281 183.633 219.271C220.595 205.261 259.721 198.373 268.152 177.017C276.582 155.661 254.385 119.831 238.303 92.3591ZM98.2884 205.827H78.8L92.0248 201.148V198.413H98.2884V205.827Z\"\r\n                fill=\"#EDF0F4\"\r\n              />\r\n              <path\r\n                d=\"M156.449 31.4697C156.447 31.2999 156.456 31.1301 156.476 30.9615C155.856 31.9983 155.051 34.3497 154.918 34.7834L154.942 34.8342L156.449 31.4697Z\"\r\n                fill=\"#F8F8F8\"\r\n              />\r\n              <path\r\n                d=\"M57.9234 262.512H47.326V275.072H31.7888V262.512H0V257.768L36.7286 207.535H47.326V249.128H57.9234V262.512ZM31.7888 249.128V233.478L20.6802 249.128H31.7888Z\"\r\n                fill=\"#E0E5EC\"\r\n              />\r\n              <path\r\n                d=\"M66.7705 241.406C66.7705 221.948 72.4281 206.606 92.1636 206.606C111.801 206.606 117.266 221.948 117.266 241.406C117.266 260.763 111.815 276 92.1636 276C72.4281 276 66.7705 260.763 66.7705 241.406ZM101.749 241.406C101.749 229.67 99.4836 220.61 92.1806 220.61C84.7725 220.61 82.2027 229.67 82.2027 241.406C82.2027 253.038 84.7725 261.895 92.1806 261.895C99.4836 261.909 101.749 253.038 101.749 241.406Z\"\r\n                fill=\"#E0E5EC\"\r\n              />\r\n              <path\r\n                d=\"M181.171 262.512H170.574V275.072H155.04V262.512H123.241V257.768L159.977 207.535H170.574V249.128H181.171V262.512ZM155.04 249.128V233.478L143.928 249.128H155.04Z\"\r\n                fill=\"#E0E5EC\"\r\n              />\r\n              <path\r\n                d=\"M181.527 136.955C181.818 139.726 187.936 259.232 187.936 259.232H181.527L150.361 146.709L181.527 136.955Z\"\r\n                fill=\"#081829\"\r\n              />\r\n              <path\r\n                d=\"M184.997 124.93C185.807 141.258 178.856 154.631 166.785 154.631C150.216 154.631 128.279 144.06 122.242 138.093C120.736 142.552 99.365 198.715 99.365 198.715H90.5146C90.5146 198.715 96.1858 133.323 106.817 116.551C110.314 111.889 133.876 112.062 148.296 115.558C159.743 122.806 181.046 126.041 184.997 124.93Z\"\r\n                fill=\"#081829\"\r\n              />\r\n              <path\r\n                d=\"M142.99 27.8511C143.364 27.6247 143.801 27.5226 144.236 27.5597C145.533 27.6512 147.652 31.0801 147.652 33.855C147.652 36.63 146.87 37.6735 147.107 39.6895C147.344 41.7055 152.474 69.0416 152.474 70.7085C153.479 70.7104 154.483 70.6459 155.48 70.5154\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M170.567 57.742C175.754 58.3248 179.489 61.8621 182.13 67.0392\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-miterlimit=\"10\"\r\n                stroke-linecap=\"round\"\r\n              />\r\n              <path\r\n                d=\"M153.114 76.7702C155.484 69.4517 158.714 63.0886 162.905 59.88\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-miterlimit=\"10\"\r\n                stroke-linecap=\"round\"\r\n              />\r\n              <path\r\n                d=\"M185.112 75.0897C190.289 94.4838 186.93 123.328 184.997 124.93C182.072 127.356 150.886 119.17 148.296 115.558C147.219 114.068 147.439 103.866 149.372 92.4271\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-miterlimit=\"10\"\r\n                stroke-linecap=\"round\"\r\n              />\r\n              <path\r\n                d=\"M160.078 74.1205C158.7 74.588 150.618 77.7425 150.618 77.7425C150.483 76.1161 144.27 43.8604 143.888 41.8851C144.672 39.9134 145.059 37.8064 145.029 35.6846C145.029 30.3889 142.879 26.0892 140.228 26.0892C137.577 26.0892 135.43 30.3889 135.43 35.6846C135.392 37.9012 135.819 40.1011 136.683 42.1426C136.385 46.1745 133.71 84.4579 139.168 89.9163C144.734 95.4865 157.969 90.8243 166.528 87.0126\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M154.077 37.202L149.005 35.8543L148.064 39.4008L153.136 40.7486L154.077 37.202Z\"\r\n                fill=\"#081829\"\r\n              />\r\n              <path\r\n                d=\"M178.69 66.1786C181.585 66.5175 183.961 67.5339 185.014 69.5669C188.837 76.9938 173.699 90.3739 169.511 89.3777C165.323 88.3816 158.568 73.426 159.831 70.7426C160.19 69.9734 162.11 68.9536 164.747 68.0625\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-miterlimit=\"10\"\r\n                stroke-linecap=\"round\"\r\n              />\r\n              <path\r\n                d=\"M162.905 59.88V57.7793\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M170.567 53.8524V63.9424C170.567 64.5523 168.763 64.942 166.907 64.9996\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M172.314 50.6098C171.855 51.7527 171.269 52.8404 170.567 53.8524\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M165.986 57.542C165.332 57.7643 164.646 57.8787 163.955 57.8808C158.429 57.8808 153.953 50.6335 153.953 41.6954C153.942 39.3613 154.263 37.0375 154.905 34.7936\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M170.798 47.8313C170.994 49.6779 171.691 50.6097 172.314 50.6097C173.049 50.6097 174.986 50.1014 176.232 50.1014C188.468 50.1014 202.837 62.7428 230.404 62.7428C244.803 62.7428 267.4 59.1073 267.4 37.9445C267.4 26.5161 263.289 12.7058 241.563 12.7058C227.766 12.7058 218.1 19.4822 206.764 19.4822C192.206 19.4822 186.592 14.2068 176.533 14.2068C169.369 14.2068 153.246 18.3607 153.246 29.2436C153.246 33.3772 154.539 34.5767 154.939 34.7901C155.071 34.3497 155.877 32.005 156.496 30.9682C156.387 32.4874 156.822 33.9958 157.722 35.2238\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M168.692 41.9055C168.975 42.2285 169.24 42.5679 169.484 42.922\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M168.289 43.3997C168.709 43.1133 169.206 42.9609 169.714 42.9627C170.295 42.9622 170.859 43.1601 171.312 43.5236C171.766 43.8871 172.081 44.3946 172.208 44.9621C172.334 45.5296 172.263 46.1232 172.007 46.6449C171.75 47.1666 171.324 47.5852 170.797 47.8315\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M145.029 35.6847C145.05 37.6073 144.74 39.5192 144.111 41.3362C146.992 41.675 149.078 41.9224 149.078 41.9224L151.065 33.8821C151.065 33.8821 148.127 32.659 144.467 31.1716C144.848 32.6453 145.037 34.1623 145.029 35.6847Z\"\r\n                fill=\"#081829\"\r\n              />\r\n              <path\r\n                d=\"M135.43 35.6846C135.43 32.6929 136.107 30.0229 137.191 28.2645C134.032 27.021 131.374 26.0113 130.619 25.8216C128.422 25.2795 125.202 38.5646 127.338 39.0966C128.202 39.31 131.916 39.8081 136.036 40.3299C135.627 38.8157 135.423 37.2532 135.43 35.6846Z\"\r\n                fill=\"#081829\"\r\n              />\r\n              <path\r\n                d=\"M98.2884 198.414V205.827H78.8L92.0282 201.148V198.414\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n              <path\r\n                d=\"M187.598 258.951V266.364H170.141L181.987 261.685V258.951\"\r\n                stroke=\"#081829\"\r\n                stroke-width=\"2.5\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              />\r\n            </g>\r\n            <defs>\r\n              <clipPath id=\"clip0\">\r\n                <rect width=\"270\" height=\"276\" fill=\"white\" />\r\n              </clipPath>\r\n            </defs>\r\n          </svg>\r\n        </DivStyle>\r\n        <DivStyle>\r\n          <h1>Page not found!</h1>\r\n          <P>\r\n            Unfortunately the page you a looking for doesn’t exist <br />\r\n            (anymore) or there was an error in the link that you <br />\r\n            followed or typed.\r\n          </P>\r\n          <Button\r\n            style={{ width: '100%' }}\r\n            onClick={() => window.open(toRootedURL('Divisions.aspx'), '_self')}\r\n          >\r\n            {' '}\r\n            Go back to main{' '}\r\n          </Button>\r\n        </DivStyle>\r\n      </Wrapper>\r\n    </>\r\n  );\r\n}\r\n\r\nconst DivStyle = styled.div`\r\n  display: inline-block;\r\n  padding: 70px;\r\n`;\r\n\r\nconst Wrapper = styled.div`\r\n  height: 100vh;\r\n  display: flex;\r\n  align-items: center;\r\n  justify-content: center;\r\n  min-height: 320px;\r\n`;\r\n\r\n/* const Title = styled.div`\r\n  margin-top: -8vh;\r\n  font-weight: bold;\r\n  color: black;\r\n  font-size: 3.375rem;\r\n\r\n  span {\r\n    font-size: 3.125rem;\r\n  }\r\n`;*/\r\n","import { makeStyles, Theme } from '@material-ui/core/styles';\r\nexport const autocompleteExtendStyles = makeStyles((theme: Theme) => ({\r\n  extendRoot: {\r\n    '&.Mui-focused $infoWidthPlus': {\r\n      right: '48px',\r\n    },\r\n    '@media (pointer: fine)': {\r\n      '&:hover $infoWidthPlus': {\r\n        right: '48px',\r\n      },\r\n    },\r\n  },\r\n  infoIcon: {\r\n    padding: '4px',\r\n    top: 'calc(50% - 14px)',\r\n    position: 'absolute',\r\n    cursor: 'auto',\r\n    zIndex: 4,\r\n    '& > svg': {\r\n      width: '12px',\r\n      height: '12px',\r\n    },\r\n  },\r\n  infoWidthPlus: {\r\n    right: '26px',\r\n  },\r\n  infoWidthMinus: {\r\n    right: '26px',\r\n  },\r\n}));\r\n/* These styles was taken from original place https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/Autocomplete/Autocomplete.js\r\n  and partially redefined for for our components */\r\nexport const autocompleteStyles = makeStyles((theme: Theme) => ({\r\n  /* Styles applied to the root element. */\r\n  root: {\r\n    '&$focused $clearIndicatorDirty': {\r\n      visibility: 'visible',\r\n      //display: 'inline-flex',\r\n    },\r\n    /* Avoid double tap issue on iOS */\r\n    '@media (pointer: fine)': {\r\n      '&:hover $clearIndicatorDirty': {\r\n        visibility: 'visible',\r\n        //display: 'inline-flex',\r\n      },\r\n      // '&:hover $infoWidthPlus': {\r\n      //   right: '54px',\r\n      // },\r\n    },\r\n    // '&$focused $infoWidthPlus': {\r\n    //   right: '54px',\r\n    // },\r\n    '&>[class*=\"MuiFormControl-root\"]': {\r\n      '&>[class*=\"multiSelect\"]': {\r\n        maxWidth: '400px',\r\n        // paddingTop: '6px',\r\n        // paddingBottom: '6px',\r\n        '&>[class*=\"shortView\"]': {\r\n          maxWidth: 360,\r\n        },\r\n        '&.hasLabel': {\r\n          '& > $tag:first-child': {\r\n            marginTop: '6px',\r\n            //marginBottom: '6px',\r\n          },\r\n        },\r\n        [theme.breakpoints.up('sm')]: {\r\n          maxWidth: '100%',\r\n          '&>[class*=\"shortView\"]': {\r\n            maxWidth: '100%',\r\n          },\r\n        },\r\n      },\r\n      '&>[class*=\"MuiInputLabel-filled\"]': {\r\n        transform: 'translate(12px, 16px) scale(1)',\r\n        // long placeholder/label might break in 2+ lines - show only single line here\r\n        // setting up width to minimum assuming there might be clear as well as other adornments just in case\r\n        // 12px is the left translate value, the other sum equals to max paddingRight of filled inputRoot\r\n        width: 'calc(100% - 12px - (52px + 4px + 9px))',\r\n        whiteSpace: 'nowrap',\r\n        overflow: 'hidden',\r\n        textOverflow: 'ellipsis',\r\n        paddingTop: 0,\r\n        paddingBottom: 0,\r\n        '&.adornedStart-label': {\r\n          transform: 'translate(41px, 16px) scale(0.85)',\r\n        },\r\n        '&[class*=\"MuiInputLabel-shrink\"]': {\r\n          letterSpacing: '0.2px',\r\n          transform: 'translate(12px, 8px) scale(1)',\r\n          // '&$marginDense': {\r\n          //   transform: 'translate(12px, 4px) scale(0.75)',\r\n          // },\r\n          '&.adornedStart-label': {\r\n            transform: 'translate(41px, 27px) scale(0.85)',\r\n          },\r\n        },\r\n        '&[class*=\"multiSelect\"][class*=\"MuiInputLabel-shrink\"]': {\r\n          letterSpacing: '0.2px',\r\n          transform: 'translate(12px, 4px) scale(1)',\r\n          // '&$marginDense': {\r\n          //   transform: 'translate(12px, 4px) scale(0.75)',\r\n          // },\r\n          '&.adornedStart-label': {\r\n            transform: 'translate(41px, 27px) scale(0.85)',\r\n          },\r\n        },\r\n      },\r\n    },\r\n    '&>[class*=\"MuiInputLabel-shrink\"]': {\r\n      transform: 'translate(0, -2.5px) scale(1.1)',\r\n    },\r\n  },\r\n  /* Styles applied to the root element if `fullWidth={true}`. */\r\n  fullWidth: {\r\n    width: '100%',\r\n    '&>[class*=\"MuiFormControl-root\"]': {\r\n      '&>[class*=\"multiSelect\"]': {\r\n        maxWidth: '100%',\r\n      },\r\n      '&>[class*=\"shortView\"]': {\r\n        maxWidth: 360,\r\n      },\r\n      [theme.breakpoints.up('sm')]: {\r\n        maxWidth: '100%',\r\n        '&>[class*=\"shortView\"]': {\r\n          maxWidth: '100%',\r\n        },\r\n      },\r\n    },\r\n  },\r\n  /* Pseudo-class applied to the root element if focused. */\r\n  focused: {},\r\n  /* Styles applied to the tag elements, e.g. the chips. */\r\n  tag: {\r\n    margin: 0,\r\n    // maxWidth: 400, //'calc(100% - 56px)',\r\n    // //width: 'inherit',\r\n    // [theme.breakpoints.down('sm')]: {\r\n    //   maxWidth: 300,\r\n    // },\r\n  },\r\n  /* Styles applied to the tag elements, e.g. the chips if `size=\"small\"`. */\r\n  tagSizeSmall: {\r\n    margin: 0,\r\n    maxWidth: 'calc(100% - 4px)',\r\n  },\r\n  /* Styles applied when the popup icon is rendered. */\r\n  hasPopupIcon: {},\r\n  /* Styles applied when the clear icon is rendered. */\r\n  hasClearIcon: {\r\n    '& > * > * > [class*=\"infoWidthPlus\"]': {\r\n      right: '48px',\r\n    },\r\n  },\r\n  /* Styles applied to the Input element. */\r\n  // inputRoot: {\r\n  //   backgroundColor: theme.palette.common.white,\r\n  //   border: `1px solid ${theme.palette.common.grayBorders}`,\r\n  //   borderRadius: 6,\r\n  //   cursor: 'auto',\r\n  //   flexWrap: 'wrap',\r\n  //   height: 32,\r\n  //   '$hasPopupIcon &, $hasClearIcon &': {\r\n  //     paddingRight: 26 + 4,\r\n  //   },\r\n  //   '$hasPopupIcon$hasClearIcon &': {\r\n  //     paddingRight: 24 + 4,\r\n  //   },\r\n  //   gap: 4,\r\n  //   // 'label + &': {\r\n  //   //   marginTop: '21px',\r\n  //   // },\r\n  //   // 'label + &[class*=\"MuiFilledInput-root\"]': {\r\n  //   //   marginTop: '0',\r\n  //   // },\r\n  //   '& $input': {\r\n  //     width: 'auto',\r\n  //     minWidth: 30,\r\n  //     padding: '7px 12px',\r\n  //   },\r\n  //   '&:hover': {\r\n  //     backgroundColor: 'unset', //'rgba(255, 255, 255, 0.80)',\r\n  //     // Reset on touch devices, it doesn't add specificity\r\n  //     '@media (hover: none)': {\r\n  //       backgroundColor: 'unset', //'rgba(255, 255, 255, 0.90)',\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"Mui-focused\"]': {\r\n  //     backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n  //     border: `1px solid ${theme.palette.primary.main}`,\r\n  //   },\r\n  //   '&[class*=\"Mui-disabled\"]': {\r\n  //     backgroundColor: theme.palette.common.backgroundHover,\r\n  //   },\r\n  //   '&[class*=\"MuiInput-root\"]': {\r\n  //     paddingBottom: 1,\r\n  //     '& $input': {\r\n  //       padding: 4,\r\n  //     },\r\n  //     '& $input:first-child': {\r\n  //       padding: '6px 0',\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"marginDense\"]': {\r\n  //     borderRadius: 4,\r\n  //     '& $input': {\r\n  //       padding: '4px 4px 5px',\r\n  //     },\r\n  //     '& $input:first-child': {\r\n  //       padding: '1px 0px 1px 6px',\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"MuiOutlinedInput-root\"]': {\r\n  //     padding: 9,\r\n  //     '$hasPopupIcon &, $hasClearIcon &': {\r\n  //       paddingRight: 26 + 4 + 9,\r\n  //     },\r\n  //     '$hasPopupIcon$hasClearIcon &': {\r\n  //       paddingRight: 52 + 4 + 9,\r\n  //     },\r\n  //     '& $input': {\r\n  //       padding: '9.5px 4px',\r\n  //     },\r\n  //     '& $input:first-child': {\r\n  //       paddingLeft: 6,\r\n  //     },\r\n  //     '& $endAdornment': {\r\n  //       right: 9,\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"MuiOutlinedInput-root\"][class*=\"MuiOutlinedInput-marginDense\"]': {\r\n  //     padding: 6,\r\n  //     '& $input': {\r\n  //       padding: '4.5px 4px',\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"MuiFilledInput-root\"]': {\r\n  //     paddingTop: 16,\r\n  //     paddingLeft: 8,\r\n  //     '$hasPopupIcon &, $hasClearIcon &': {\r\n  //       paddingRight: 26 + 4 + 9,\r\n  //     },\r\n  //     '$hasPopupIcon$hasClearIcon &': {\r\n  //       paddingRight: 52 + 4 + 9,\r\n  //     },\r\n  //     '& $input': {\r\n  //       padding: '6px 4px 4px',\r\n  //     },\r\n  //     '& $endAdornment': {\r\n  //       right: 4,\r\n  //     },\r\n  //     '&[class*=\"MuiFilledInput-adornedStart\"]': {\r\n  //       //paddingLeft: '36px',\r\n  //       '&>.adornedStart': {\r\n  //         cursor: 'auto',\r\n  //         position: 'absolute',\r\n  //         left: 12,\r\n  //         top: 'calc(50% - 3px)',\r\n  //       },\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"MuiFilledInput-root\"][class*=\"MuiFilledInput-marginDense\"]': {\r\n  //     paddingTop: 14,\r\n  //     paddingBottom: 0,\r\n  //     '& $input': {\r\n  //       padding: '4.5px 4px',\r\n  //     },\r\n  //   },\r\n  //   '&[class*=\"MuiFilledInput-root\"][class*=\"MuiFilledInput-marginDense\"][class*=\"miniDense\"]': {\r\n  //     paddingTop: 2,\r\n  //     paddingBottom: 2,\r\n  //     //borderRadius: '6px',\r\n  //     border: `1px solid ${theme.palette.primary.main}`,\r\n  //     '& $input': {\r\n  //       padding: '3.5px 3px',\r\n  //     },\r\n  //   },\r\n  // },\r\n  inputRoot: {\r\n    flexWrap: 'wrap',\r\n    backgroundColor: theme.palette.common.white,\r\n    border: `1px solid ${theme.palette.common.grayBorders}`,\r\n    borderRadius: 6,\r\n    cursor: 'auto',\r\n    minHeight: 32,\r\n    '$hasPopupIcon &, $hasClearIcon &': {\r\n      paddingRight: 56, //26 + 4,\r\n    },\r\n    '$hasPopupIcon$hasClearIcon &': {\r\n      paddingRight: 56, //24 + 4,\r\n    },\r\n    gap: 4,\r\n    '& $input': {\r\n      width: 'auto',\r\n      minWidth: 30,\r\n      //padding: '6px 12px',\r\n    },\r\n    '&[class*=\"MuiInput-root\"]': {\r\n      paddingBottom: 0,\r\n      '& $input': {\r\n        padding: 4,\r\n      },\r\n      '& $input:first-child': {\r\n        padding: '6px 12px',\r\n      },\r\n    },\r\n    '&[class*=\"MuiInput-root\"][class*=\"MuiInput-marginDense\"]': {\r\n      // '& $input': {\r\n      //   padding: '4px 4px 5px',\r\n      // },\r\n      // '& $input:first-child': {\r\n      //   padding: '4px 4px 5px', //'3px 0 6px',\r\n      // },\r\n      borderRadius: 6,\r\n      '& $input': {\r\n        padding: '4px 4px 5px',\r\n      },\r\n      '& $input:first-child': {\r\n        padding: '1px 0px 1px 7px',\r\n      },\r\n    },\r\n    '&:hover': {\r\n      backgroundColor: 'rgba(255, 255, 255, 0.80)',\r\n      // Reset on touch devices, it doesn't add specificity\r\n      '@media (hover: none)': {\r\n        backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n      },\r\n    },\r\n    '&[class*=\"Mui-focused\"]': {\r\n      backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n      border: `1px solid ${theme.palette.primary.main}`,\r\n    },\r\n    '&[class*=\"Mui-disabled\"]': {\r\n      backgroundColor: theme.palette.common.backgroundHover,\r\n    },\r\n    '&[class*=\"MuiOutlinedInput-root\"]': {\r\n      padding: 9,\r\n      '$hasPopupIcon &, $hasClearIcon &': {\r\n        paddingRight: 26 + 4 + 9,\r\n      },\r\n      '$hasPopupIcon$hasClearIcon &': {\r\n        paddingRight: 52 + 4 + 9,\r\n      },\r\n      '& $input': {\r\n        padding: '9.5px 4px',\r\n      },\r\n      '& $input:first-child': {\r\n        paddingLeft: 6,\r\n      },\r\n      '& $endAdornment': {\r\n        right: 9,\r\n      },\r\n    },\r\n    '&[class*=\"MuiOutlinedInput-root\"][class*=\"MuiOutlinedInput-marginDense\"]': {\r\n      padding: 6,\r\n      '& $input': {\r\n        padding: '4.5px 4px',\r\n      },\r\n    },\r\n    '&[class*=\"MuiFilledInput-root\"]': {\r\n      paddingTop: 16,\r\n      paddingLeft: 8,\r\n      minHeight: 48,\r\n      height: 'auto',\r\n      '$hasPopupIcon &, $hasClearIcon &': {\r\n        paddingRight: 26 + 4 + 9,\r\n      },\r\n      '$hasPopupIcon$hasClearIcon &': {\r\n        paddingRight: 52 + 4 + 9,\r\n      },\r\n      '& $input': {\r\n        padding: '6px 4px 4px',\r\n      },\r\n      '& $endAdornment': {\r\n        right: 4,\r\n      },\r\n      '&[class*=\"MuiFilledInput-adornedStart\"]': {\r\n        //paddingLeft: '36px',\r\n        '&>.adornedStart': {\r\n          cursor: 'auto',\r\n          position: 'absolute',\r\n          left: 12,\r\n          top: 'calc(50% - 3px)',\r\n        },\r\n      },\r\n    },\r\n    '&[class*=\"MuiFilledInput-root\"][class*=\"MuiFilledInput-marginDense\"]': {\r\n      paddingTop: 14,\r\n      paddingBottom: 0,\r\n      '& $input': {\r\n        padding: '4.5px 4px',\r\n      },\r\n    },\r\n  },\r\n  /* Styles applied to the input element. */\r\n  input: {\r\n    flexGrow: 1,\r\n    textOverflow: 'ellipsis',\r\n    opacity: 0,\r\n    padding: '6px 12px',\r\n  },\r\n  /* Styles applied to the input element if tag focused. */\r\n  inputFocused: {\r\n    opacity: 1,\r\n  },\r\n  /* Styles applied to the endAdornment element. */\r\n  endAdornment: {\r\n    // We use a position absolute to support wrapping tags.\r\n    position: 'absolute',\r\n    right: 8,\r\n    top: 'calc(50% - 11px)', // Center vertically\r\n  },\r\n  /* Styles applied to the clear indicator. */\r\n  clearIndicator: {\r\n    marginRight: 2,\r\n    padding: 4,\r\n    '& > * > svg': {\r\n      width: 12,\r\n      height: 12,\r\n      cursor: 'pointer',\r\n    },\r\n    visibility: 'hidden',\r\n    //display: 'none',\r\n  },\r\n  /* Styles applied to the clear indicator if the input is dirty. */\r\n  clearIndicatorDirty: { visibility: 'visible', display: 'inline-flex' },\r\n  /* Styles applied to the popup indicator. */\r\n  popupIndicator: {\r\n    padding: 4,\r\n    marginRight: 0,\r\n    '& > * > svg': {\r\n      width: 12,\r\n      height: 12,\r\n    },\r\n  },\r\n  /* Styles applied to the popup indicator if the popup is open. */\r\n  popupIndicatorOpen: {\r\n    transform: 'rotate(180deg)',\r\n  },\r\n  /* Styles applied to the popper element. */\r\n  popper: {\r\n    zIndex: theme.zIndex.modal,\r\n  },\r\n  /* Styles applied to the popper element if `disablePortal={true}`. */\r\n  popperDisablePortal: {\r\n    position: 'absolute',\r\n  },\r\n  /* Styles applied to the `Paper` component. */\r\n  paper: {\r\n    ...theme.typography.bodyM,\r\n    overflow: 'hidden',\r\n    margin: '4px 0',\r\n  },\r\n  /* Styles applied to the `listbox` component. */\r\n  listbox: {\r\n    listStyle: 'none',\r\n    margin: 0,\r\n    padding: '8px 0',\r\n    maxHeight: '40vh',\r\n    overflow: 'auto',\r\n  },\r\n  /* Styles applied to the loading wrapper. */\r\n  loading: {\r\n    color: theme.palette.text.disabled,\r\n    padding: '14px 16px',\r\n  },\r\n  /* Styles applied to the no option wrapper. */\r\n  noOptions: {\r\n    color: theme.palette.text.secondary,\r\n    padding: '14px 16px',\r\n  },\r\n  /* Styles applied to the option elements. */\r\n  option: {\r\n    minHeight: 48,\r\n    display: 'flex',\r\n    justifyContent: 'flex-start',\r\n    alignItems: 'center',\r\n    cursor: 'pointer',\r\n    paddingTop: 6,\r\n    boxSizing: 'border-box',\r\n    outline: '0',\r\n    WebkitTapHighlightColor: 'transparent',\r\n    paddingBottom: 6,\r\n    paddingLeft: 16,\r\n    paddingRight: 16,\r\n    [theme.breakpoints.up('sm')]: {\r\n      minHeight: 'auto',\r\n    },\r\n    '&[aria-selected=\"true\"]': {\r\n      backgroundColor: theme.palette.action.selected,\r\n    },\r\n    '&[data-focus=\"true\"]': {\r\n      backgroundColor: theme.palette.action.hover,\r\n    },\r\n    '&:active': {\r\n      backgroundColor: theme.palette.action.selected,\r\n    },\r\n    '&[aria-disabled=\"true\"]': {\r\n      opacity: theme.palette.action.disabledOpacity,\r\n      pointerEvents: 'none',\r\n    },\r\n  },\r\n  /* Styles applied to the group's label elements. */\r\n  groupLabel: {\r\n    backgroundColor: theme.palette.background.paper,\r\n    top: -8,\r\n  },\r\n  /* Styles applied to the group's ul elements. */\r\n  groupUl: {\r\n    padding: 0,\r\n    '& $option': {\r\n      paddingLeft: 24,\r\n    },\r\n  },\r\n}));\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { intersection } from 'lodash';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const initFilterData = async <TRow>(\r\n  filters: IFilterSettings<TRow>[],\r\n  serviceGroups?: Identifiable<number>[],\r\n): Promise<IFilterSettings<TRow>[]> => {\r\n  var result = Promise.all(\r\n    filters.map(async item => {\r\n      if (item.initData === undefined) {\r\n        return item;\r\n      }\r\n      if (item.value === undefined) {\r\n        return item;\r\n      }\r\n      if (item.value === null) {\r\n        return item;\r\n      }\r\n      if (typeof item.value === 'string') {\r\n        return item;\r\n      }\r\n      if (\r\n        Array.isArray(item.value) &&\r\n        item.value.some(f => f.Name !== undefined)\r\n      ) {\r\n        return item;\r\n      }\r\n      try {\r\n        const data = await item.initData(item.value, serviceGroups);\r\n        if (data !== undefined) {\r\n          return {\r\n            ...item,\r\n            ...{\r\n              value: filterByServiceGroups(\r\n                data,\r\n                serviceGroups?.map(f => f.Id) ?? [],\r\n              ),\r\n              initCompleted: item.refreshAfterInit ? true : undefined,\r\n            },\r\n          };\r\n        } else {\r\n          return item;\r\n        }\r\n      } catch {\r\n        return item;\r\n      }\r\n    }),\r\n  );\r\n  return result;\r\n};\r\n\r\nfunction filterByServiceGroups(item, serviceGroups: number[]) {\r\n  if (serviceGroups.length === 0) {\r\n    return item;\r\n  }\r\n  if (item.ServiceGroupId !== undefined) {\r\n    if (serviceGroups.includes(item.ServiceGroupId)) {\r\n      return item;\r\n    } else {\r\n      return null;\r\n    }\r\n  } else if (item.ServiceGroups !== undefined) {\r\n    let a = [];\r\n    if (item.ServiceGroups.length === 0) {\r\n      return item;\r\n    } else {\r\n      if (typeof item.ServiceGroups[0] === 'number') {\r\n        a = item.ServiceGroups;\r\n      } else {\r\n        a = item.ServiceGroups.map(f => f.Id);\r\n      }\r\n    }\r\n    const intersectsWithServiceGroups =\r\n      intersection(a, serviceGroups).length > 0;\r\n    if (intersectsWithServiceGroups) {\r\n      return item;\r\n    } else {\r\n      return null;\r\n    }\r\n  } else if (Array.isArray(item)) {\r\n    return item\r\n      .map(c => filterByServiceGroups(c, serviceGroups))\r\n      .filter(f => f != null);\r\n  }\r\n  return item;\r\n}\r\n","export enum InvoiceStatuses {\r\n  New,\r\n  SentToBilling,\r\n  SentToReview,\r\n  BillingRejected,\r\n  Paid,\r\n  ReviewApproved,\r\n  ReviewRejected,\r\n}\r\n","import { AsyncDataState } from 'types/common';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { FieldHandlerProps } from '../../FormRender/FormRenderer';\r\n\r\n/* --- STATE --- */\r\nexport interface RepetitiveState extends AsyncDataState<IRepetitiveDto> {\r\n  repetitiveValueHandler?: FieldHandlerProps<IRepetitiveDto>;\r\n}\r\nexport enum RepetitiveFor {\r\n  WorkOrder = 1,\r\n  Reservations = 2,\r\n  Schedule = 3,\r\n}\r\n","import {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport {\r\n  ALL_PERIOD_TYPES,\r\n  PeriodTypes,\r\n  PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport i18next from 'i18next';\r\nimport * as React from 'react';\r\n\r\nconst DATE_PERIODS = (periods?: Array<PeriodTypes>) => {\r\n  const all = ALL_PERIOD_TYPES.map((value, index) => {\r\n    return { Id: value, Name: value };\r\n  });\r\n  if (periods === undefined) {\r\n    return all;\r\n  } else {\r\n    return all.filter(f => periods.includes(f.Name));\r\n  }\r\n};\r\n\r\nexport interface DatePeriodsPickerProps\r\n  extends Omit<BaseOptionsPickerProps<PeriodTypesEntity>, 'getOptions'> {\r\n  periods?: Array<PeriodTypes>;\r\n  twoDaysDisabled?: boolean;\r\n}\r\nexport function getPeriods(periods?: Array<PeriodTypes>) {\r\n  return DATE_PERIODS(periods);\r\n}\r\nconst getOptions = (\r\n  searchTerm: string | null,\r\n  periods?: Array<PeriodTypes>,\r\n) => {\r\n  let items = DATE_PERIODS(periods).map(item => {\r\n    return {\r\n      Id: item.Id,\r\n      Name: i18next.t(item.Name),\r\n      type: item.Name as PeriodTypes,\r\n    };\r\n  });\r\n\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\nexport function DatePeriodsPicker(props: DatePeriodsPickerProps) {\r\n  const getOptionsCallback = React.useCallback(\r\n    (searchTerm: string | null) => {\r\n      return getOptions(searchTerm, props.periods);\r\n    },\r\n    [props.periods],\r\n  );\r\n  return (\r\n    <>\r\n      <BaseOptionsPicker\r\n        mini={props.mini ? true : undefined}\r\n        size={props.size}\r\n        getOptions={getOptionsCallback}\r\n        value={props.value}\r\n        style={{ marginRight: '4px' }}\r\n        id={props.id || 'dateperiodsId'}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nconst url = '/api/odata/v4/UnitTypesFilter';\r\n\r\nexport interface UnitTypePickerProps\r\n  extends Omit<AutocompletePickerProps<UnitType>, 'loadData'> {\r\n  type?: number;\r\n  $select?: Array<keyof UnitType>;\r\n}\r\n\r\nexport interface UnitType extends Entity<number> {\r\n  SourceUnits: Conversion[];\r\n  TargetUnits: Conversion[];\r\n  CategoryType: number | null;\r\n}\r\n\r\ninterface Conversion {\r\n  ConversionRate: number;\r\n  TargetId: number;\r\n}\r\n\r\nexport const getUnitTypesData = () => {\r\n  const params: {\r\n    $orderby: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $skip: 0,\r\n    $top: 100,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as UnitType[]);\r\n};\r\n\r\nexport const initUnitTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return Promise.resolve([]);\r\n  }\r\n  const id = parseInt(initval);\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: '(Id eq ' + id + ')',\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as UnitType[]);\r\n};\r\nconst loadData = (\r\n  $select?: Array<keyof UnitType> | undefined,\r\n  predicates?: (string | Condition<UnitType>)[],\r\n) => {\r\n  return getAutoCompleteLoadDataFn<UnitType>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: $select ?? [\r\n      'Id',\r\n      'Name',\r\n      'CategoryType',\r\n      'SourceUnits',\r\n      'TargetUnits',\r\n    ],\r\n  });\r\n};\r\n// const getLoadData = (\r\n//   type?: number,\r\n//   $select?: Array<keyof UnitType> | undefined,\r\n// ) => (searchTerm: string | null) => {\r\n//   const params: {\r\n//     $orderby: string;\r\n//     $filter?: string;\r\n//     $select?: string | undefined;\r\n//   } = {\r\n//     $orderby: 'Name asc',\r\n//     $select: $select?.join(','),\r\n//   };\r\n\r\n//   const predicates: Condition<UnitType>[] = [];\r\n//   if (type !== undefined) {\r\n//     predicates.push(new Condition('CategoryType', ODataOperators.Equals, type));\r\n//   }\r\n//   params.$filter = new ODataFilterBuilder<UnitType>({\r\n//     predicates: predicates,\r\n//     stringColumns: ['Name'],\r\n//     stringSearch: searchTerm,\r\n//   }).toString();\r\n\r\n//   return httpClient\r\n//     .get(url, params)\r\n//     .then(response => response.value as UnitType[]);\r\n// };\r\nexport const UnitTypePicker = ({\r\n  type,\r\n  $select,\r\n  ...props\r\n}: UnitTypePickerProps) => {\r\n  const predicates: Condition<UnitType>[] = React.useMemo(() => {\r\n    return !!type\r\n      ? [new Condition('CategoryType', ODataOperators.Equals, type)]\r\n      : [];\r\n  }, [type]);\r\n\r\n  const innerLoadData = loadData($select, predicates);\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * AssetThumbImage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Avatar, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { getAssetImageThumbSrc } from './getAssetImageSrc';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectImageExist } from 'app/slice/selectors';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n// asset thumbs have max size of 64px\r\nconst MAX_SIZE_DEFAULT = 64;\r\n\r\nexport interface AssetThumbImageProps {\r\n  maxSize?: number;\r\n  imageName: string | null;\r\n}\r\n\r\nexport const defaultImgSrc =\r\n  process.env.PUBLIC_URL + `/images/DefaultImage.png`;\r\n\r\nexport function AssetThumbImage(props: AssetThumbImageProps) {\r\n  const [hasImgeBroken, setHasImgeBroken] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const handleImgError = event => {\r\n    setHasImgeBroken(true);\r\n  };\r\n  const imageExist = useSelector(state =>\r\n    selectImageExist(state, props.imageName),\r\n  );\r\n  const classes = useStyles(props);\r\n  const src = imageExist\r\n    ? getAssetImageThumbSrc(props.imageName, 'thumb')\r\n    : null;\r\n  return (\r\n    <div className={classes.root}>\r\n      {src === null || hasImgeBroken ? (\r\n        <Avatar variant=\"square\" className={classes.avatar}>\r\n          {'A'}\r\n        </Avatar>\r\n      ) : (\r\n        <img\r\n          onError={handleImgError}\r\n          src={src}\r\n          alt=\"asset\"\r\n          className={classes.image}\r\n        />\r\n      )}\r\n    </div>\r\n  );\r\n}\r\n\r\nconst useStyles = makeStyles<Theme, AssetThumbImageProps>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      display: 'flex',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n      maxWidth: props =>\r\n        Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n      maxHeight: props =>\r\n        Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n    },\r\n    image: {\r\n      maxWidth: props =>\r\n        Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n      maxHeight: props =>\r\n        Math.min(props.maxSize ?? MAX_SIZE_DEFAULT, MAX_SIZE_DEFAULT),\r\n      borderRadius: '4px',\r\n    },\r\n    avatar: {\r\n      color: theme.palette.getContrastText(bookitColors.grayscale.grayBorders),\r\n      backgroundColor: theme.palette.common.grayDividers,\r\n      width: '32px',\r\n      height: '32px',\r\n      borderRadius: '4px',\r\n    },\r\n  }),\r\n);\r\n","import * as React from 'react';\r\nimport { EntityType } from 'types/common';\r\nimport { FormAutocomplete, FormAutocompleteProps } from './FormAutocomplete';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormAutocompleteOptionsProps<T extends EntityType>\r\n  extends Omit<FormAutocompleteProps<T>, 'loadData'>,\r\n    IFieldProps {\r\n  getOptions: (searchTerm: string | null) => T[];\r\n  disabled?: boolean;\r\n  id?: string;\r\n}\r\n\r\nexport function FormAutocompleteOptions<T extends EntityType>({\r\n  getOptions,\r\n  ...props\r\n}: FormAutocompleteOptionsProps<T>) {\r\n  const loadData = async (searchTerm: string | null): Promise<T[]> =>\r\n    new Promise<T[]>(resolve => {\r\n      const opts = getOptions(searchTerm);\r\n      resolve(opts);\r\n    });\r\n  return <FormAutocomplete loadData={loadData} variant=\"filled\" {...props} />;\r\n}\r\n","import * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  FormAutocompleteMulti,\r\n  FormAutocompleteMultiProps,\r\n} from './FormAutocompleteMulti';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormAutocompleteMultiOptionsProps<T>\r\n  extends Omit<FormAutocompleteMultiProps<T>, 'loadData'>,\r\n    IFieldProps {\r\n  getOptions: (searchTerm: string | null) => Entity<T>[];\r\n  disabled?: boolean;\r\n  id?: string;\r\n}\r\n\r\nexport function FormAutocompleteMultiOptions<T>({\r\n  getOptions,\r\n  ...props\r\n}: FormAutocompleteMultiOptionsProps<T>) {\r\n  const loadData = async (searchTerm: string | null): Promise<Entity<T>[]> =>\r\n    new Promise<Entity<T>[]>(resolve => {\r\n      const opts = getOptions(searchTerm);\r\n      resolve(opts);\r\n    });\r\n  return (\r\n    <FormAutocompleteMulti loadData={loadData} variant=\"filled\" {...props} />\r\n  );\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const ExternalApi = {\r\n  getExternalItems(\r\n    formFieldId: number,\r\n    payload: { filter: string | null; pageSize: number; pageIndex: number },\r\n  ) {\r\n    const url = `/api/externalitems/${formFieldId}/query`;\r\n    const data = { param: payload };\r\n    return httpClient.get(url, data);\r\n  },\r\n};\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { Entity } from 'types/common';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { FormAutocompleteOptions } from 'app/components/Forms/FormAutocompleteOptions';\r\nimport { FormAutocompleteMultiOptions } from 'app/components/Forms/FormAutocompleteMultiOptions';\r\nimport { ExternalApi } from 'api/ExternalApi';\r\nimport { FormAutocompleteMulti } from 'app/components/Forms/FormAutocompleteMulti';\r\nimport { FormAutocomplete } from 'app/components/Forms/FormAutocomplete';\r\n\r\nexport const initCustomDropDownData = (\r\n  initialValue: string | undefined,\r\n  formField: IFormFieldDto | undefined,\r\n) => {\r\n  if (initialValue === undefined || formField === undefined) {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve([] as Entity<string>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      const options = createOptions(formField);\r\n      resolve(\r\n        getDropDownInitValue(initialValue, formField.IsMultiple, options),\r\n      );\r\n    });\r\n  }\r\n};\r\nexport const getDropDownInitValue = (\r\n  initialValue: string | undefined,\r\n  isMultiple: boolean,\r\n  options: IFormFieldOptionDto[],\r\n) => {\r\n  if (initialValue === undefined) {\r\n    return [] as Entity<string>[];\r\n  } else {\r\n    if (isMultiple) {\r\n      let values = initialValue.split(',');\r\n      return options.filter(item => values.includes(item.Id));\r\n    } else {\r\n      return options.filter(item => item.Id === initialValue);\r\n    }\r\n  }\r\n};\r\nexport const createOptions = (\r\n  field: Pick<IFormFieldDto, 'Options' | 'OptionsSourceType'>,\r\n): IFormFieldOptionDto[] => {\r\n  if (field.Options && field.Options !== null) {\r\n    switch (field.OptionsSourceType) {\r\n      case 'Internal':\r\n        return deserializeOptions(field.Options);\r\n\r\n      case 'SimpleList':\r\n        return deserializeOptions(field.Options.split(','));\r\n      case 'External':\r\n        return [] as IFormFieldOptionDto[];\r\n    }\r\n  } else {\r\n    return [] as IFormFieldOptionDto[];\r\n  }\r\n};\r\nconst deserializeOptions = (options: any): IFormFieldOptionDto[] => {\r\n  let optsArray = [] as IFormFieldOptionDto[];\r\n  if (Array.isArray(options)) {\r\n    optsArray = options.map(opt => {\r\n      return { Id: opt, Name: opt, Parent: null } as IFormFieldOptionDto;\r\n    });\r\n  } else {\r\n    try {\r\n      let items = JSON.parse(options);\r\n      if (Array.isArray(items)) {\r\n        let arr = items.map(o => {\r\n          if (typeof o == 'string') {\r\n            return { Id: o, Name: o, Parent: null } as IFormFieldOptionDto;\r\n          } else if (o.hasOwnProperty('id') && o.hasOwnProperty('text')) {\r\n            return {\r\n              Id: o.id,\r\n              Name: o.text,\r\n              Parent: o.parent,\r\n            } as IFormFieldOptionDto;\r\n          } else {\r\n            return undefined;\r\n          }\r\n        });\r\n        optsArray =\r\n          (arr.filter(o => o !== undefined) as IFormFieldOptionDto[]) ||\r\n          ([] as IFormFieldOptionDto[]);\r\n      }\r\n      return optsArray;\r\n    } catch {\r\n      return optsArray;\r\n    }\r\n  }\r\n\r\n  return optsArray;\r\n};\r\n\r\nexport function CustomFormDropDown({\r\n  formField,\r\n  readonly,\r\n  parentValue,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  const getOptions = (searchTerm: string | null): Entity<string>[] => {\r\n    if (formField) {\r\n      let options = createOptions(formField);\r\n      if (formField.ParentId !== null && parentValue !== undefined) {\r\n        return options.filter(\r\n          item =>\r\n            parentValue === undefined ||\r\n            parentValue.length < 1 ||\r\n            parentValue.filter(p => p.Id === item.Parent).length > 0,\r\n        ) as Entity<string>[];\r\n      } else {\r\n        return options as Entity<string>[];\r\n      }\r\n    } else {\r\n      return [] as Entity<string>[];\r\n    }\r\n  };\r\n  const externalLoadData = (searchTerm: string | null) => {\r\n    const params: {\r\n      filter: string | null;\r\n      pageSize: number;\r\n      pageIndex: number;\r\n    } = {\r\n      filter: searchTerm,\r\n      pageSize: 50,\r\n      pageIndex: 0,\r\n    };\r\n\r\n    return ExternalApi.getExternalItems(formField.Id, params).then(response => {\r\n      if (!!response.data.data) {\r\n        let options = response.data.data.map(option => {\r\n          return { Id: option.name, Name: option.value };\r\n        });\r\n        return options as Entity<string>[];\r\n      } else if (!!response.data && response.data.length > 0) {\r\n        let options = response.data.map(option => {\r\n          return { Id: option.name, Name: option.value };\r\n        });\r\n        return options as Entity<string>[];\r\n      } else {\r\n        return [] as Entity<string>[];\r\n      }\r\n    });\r\n  };\r\n  return (\r\n    <React.Fragment>\r\n      {formField.OptionsSourceType === 'External' ? (\r\n        formField.IsMultiple ? (\r\n          <FormAutocompleteMulti\r\n            key={formField.Id}\r\n            disabled={disabled}\r\n            loadData={externalLoadData}\r\n            label={formField.Label}\r\n            info={formField.Description ?? undefined}\r\n            fullWidth\r\n            {...props}\r\n          />\r\n        ) : (\r\n          <FormAutocomplete\r\n            key={formField.Id}\r\n            disabled={disabled}\r\n            loadData={externalLoadData}\r\n            label={formField.Label}\r\n            info={formField.Description ?? undefined}\r\n            fullWidth\r\n            {...props}\r\n          />\r\n        )\r\n      ) : formField.IsMultiple ? (\r\n        <FormAutocompleteMultiOptions\r\n          key={formField.Id}\r\n          disabled={disabled}\r\n          getOptions={getOptions}\r\n          label={formField.Label}\r\n          info={formField.Description ?? undefined}\r\n          fullWidth\r\n          {...props}\r\n        />\r\n      ) : (\r\n        <FormAutocompleteOptions\r\n          key={formField.Id}\r\n          disabled={disabled}\r\n          getOptions={getOptions}\r\n          label={formField.Label}\r\n          info={formField.Description ?? undefined}\r\n          fullWidth\r\n          {...props}\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { Theme } from '@material-ui/core';\r\nimport { PropTypes } from '@material-ui/core';\r\nimport { PaletteColor } from '@material-ui/core/styles/createPalette';\r\n\r\nexport type TypeColor =\r\n  | Exclude<PropTypes.Color, 'inherit'>\r\n  | 'danger'\r\n  | 'accent'\r\n  | 'filters'\r\n  | 'success'\r\n  | 'black'\r\n  | 'info'\r\n  | 'warning';\r\nexport type TypeColorOptions =\r\n  | 'dark'\r\n  | 'main'\r\n  | 'light'\r\n  | 'textHover'\r\n  | 'bgHover'\r\n  | 'contrastText';\r\nexport const getColor = (\r\n  theme: Theme,\r\n  color: TypeColor | undefined = 'primary',\r\n  options: TypeColorOptions | undefined = 'main',\r\n): string | undefined => {\r\n  switch (color) {\r\n    case 'black':\r\n      return getBlackColorOption(options, theme);\r\n    case 'accent':\r\n    case 'danger':\r\n    case 'default':\r\n    case 'filters':\r\n    case 'info':\r\n    case 'primary':\r\n    case 'secondary':\r\n    case 'success':\r\n    case 'warning':\r\n      return getColorOption(options, theme.palette[color]);\r\n    default:\r\n      return getColorOption(options, theme.palette.primary);\r\n  }\r\n};\r\nfunction getBlackColorOption(options: string, theme: Theme) {\r\n  switch (options) {\r\n    case 'main':\r\n      return theme.palette.common.graySubtitle;\r\n    case 'dark':\r\n      return theme.palette.common.blackRegular;\r\n    case 'light':\r\n      return theme.palette.common.grayComponentsLight;\r\n    case 'textHover':\r\n      return theme.palette.common.blackComponent;\r\n    case 'bgHover':\r\n      return theme.palette.common.backgroundHover;\r\n    case 'contrastText':\r\n      return theme.palette.common.white;\r\n    default:\r\n      return theme.palette.common.graySubtitle;\r\n  }\r\n}\r\nfunction getColorOption(options: string | undefined, color: PaletteColor) {\r\n  switch (options) {\r\n    case 'main':\r\n      return color.main;\r\n    case 'dark':\r\n      return color.dark;\r\n    case 'light':\r\n      return color.light;\r\n    case 'textHover':\r\n      return color.textHover;\r\n    case 'bgHover':\r\n      return color.bgHover;\r\n    case 'contrastText':\r\n      return color.contrastText;\r\n    default:\r\n      return color.main;\r\n  }\r\n}\r\n","import { Timestamp } from '../../../../../types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const serializeSchedulerDateOrUndefined = (\r\n  d: Date | null | undefined,\r\n): Timestamp | undefined => {\r\n  if (d === null || d === undefined) {\r\n    return undefined;\r\n  }\r\n  return serializeSchedulerDate(d);\r\n};\r\nexport const serializeSchedulerDate = (d: Date): Timestamp => {\r\n  try {\r\n    return dateUtils.formatISO(d);\r\n  } catch (error) {\r\n    throw error;\r\n  }\r\n};\r\n","export enum FileTypes {\r\n  Undefined = -1,\r\n  ServiceFile = 0,\r\n  ServiceRequestFile = 1,\r\n  ServiceRequestComment = 2,\r\n  ServiceRequestRowFile = 3,\r\n  ServiceRequestRowComment = 4,\r\n  ExperimentFile = 5,\r\n  ExperimentComment = 6,\r\n  AssetFile = 7,\r\n  SrpFile = 8,\r\n  SrpComment = 9,\r\n  AlertFile = 10,\r\n  BudgetExperimentFile = 11,\r\n  Expense = 12,\r\n  ReservationFile = 13,\r\n  AlertComment = 14,\r\n  AlertTypeFile = 15,\r\n  ServiceGroupFile = 16,\r\n  InvoiceTemplate = 17,\r\n}\r\n","import { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\n\r\nexport interface UpdateFilesModel {\r\n  files: IFormFileValue[];\r\n  typeId: number;\r\n  referenceId: number;\r\n  formType: number;\r\n  operation: string;\r\n  updateOption: number;\r\n  reccurentAssetId: number | null;\r\n  recurrentGroupId: number | null;\r\n  alertTypeId: number | null;\r\n}\r\nexport const getFilesModel = (\r\n  original: IFormFileValue[],\r\n  current: IFormFileValue[],\r\n  type: number,\r\n  referenceId: number,\r\n  formType: number,\r\n  updateOption: number,\r\n  reccurentAssetId: number | null,\r\n  recurrentGroupId: number | null,\r\n  alertTypeId: number | null,\r\n) => {\r\n  const filesData: UpdateFilesModel[] = [];\r\n  if (current.length > 0 || original.length > 0) {\r\n    let added =\r\n      current.length > 0\r\n        ? current.filter(f => f.Value === null && f.PostedFile !== null)\r\n        : [];\r\n    let removed =\r\n      original.length > 0 && current.length > 0\r\n        ? original.filter(\r\n            f => f.Value !== null && !current.some(s => s.Value === f.Value),\r\n          )\r\n        : [];\r\n    if (added.length > 0) {\r\n      filesData.push({\r\n        files: added,\r\n        typeId: type,\r\n        referenceId: referenceId,\r\n        formType: formType,\r\n        operation: 'added',\r\n        updateOption: updateOption,\r\n        reccurentAssetId: reccurentAssetId,\r\n        recurrentGroupId: recurrentGroupId,\r\n        alertTypeId: alertTypeId,\r\n      });\r\n    }\r\n    if (removed.length > 0) {\r\n      filesData.push({\r\n        files: removed,\r\n        typeId: type,\r\n        referenceId: referenceId,\r\n        formType: formType,\r\n        operation: 'removed',\r\n        updateOption: updateOption,\r\n        reccurentAssetId: reccurentAssetId,\r\n        recurrentGroupId: recurrentGroupId,\r\n        alertTypeId: alertTypeId,\r\n      });\r\n    }\r\n  }\r\n  return filesData;\r\n};\r\n","/**\r\n *\r\n * auto generated interface for Default.Roles\r\n *\r\n */\r\n\r\nexport enum Roles {\r\n  Administrators = 1,\r\n  GroupAdministrators = 2,\r\n  InstituteCoord = 3,\r\n  HeadOfLab = 4,\r\n  CagesAdministrators = 5,\r\n  LabTech = 6,\r\n  FinAdmin = 7,\r\n  RepAdmin = 8,\r\n  InventoryAdmin = 9,\r\n  UserGroupCoord = 10,\r\n  InstrumentEventsAdmin = 11,\r\n  GroupBudgetsAdmin = 12,\r\n  CalendarOnly = 13,\r\n  Readonly = 14,\r\n  LoanDeskManager = 15,\r\n  EquipmentAdministrator = 16,\r\n  UserInquiryAdmin = 17,\r\n  ModelAdmin = 18,\r\n  RoomOnly = 19,\r\n  InvoicesReader = 20,\r\n  KioskAdmin = 21,\r\n  CustomRole = 22,\r\n  BudgetAdmin = 23,\r\n  GroupAdminAffiliated = 24,\r\n  AnimalAdmin = 25,\r\n  LargeAnimalsOperatingRoomUser = 26,\r\n  LargeAnimalsOperatingRoomTechnician = 27,\r\n  LargeAnimalsOperatingRoomVeterinarian = 28,\r\n  CoreBudgetsAdmin = 29,\r\n  ConsumableKiosk = 30,\r\n  CreateNewAssetsAdmin = 31,\r\n}\r\nexport type RolesUnion = keyof typeof Roles;\r\nexport const RolesUnionArray: Array<RolesUnion> = [\r\n  'Administrators',\r\n  'GroupAdministrators',\r\n  'InstituteCoord',\r\n  'HeadOfLab',\r\n  'CagesAdministrators',\r\n  'LabTech',\r\n  'FinAdmin',\r\n  'RepAdmin',\r\n  'InventoryAdmin',\r\n  'UserGroupCoord',\r\n  'InstrumentEventsAdmin',\r\n  'GroupBudgetsAdmin',\r\n  'CalendarOnly',\r\n  'Readonly',\r\n  'LoanDeskManager',\r\n  'EquipmentAdministrator',\r\n  'UserInquiryAdmin',\r\n  'ModelAdmin',\r\n  'RoomOnly',\r\n  'InvoicesReader',\r\n  'KioskAdmin',\r\n  'CustomRole',\r\n  'BudgetAdmin',\r\n  'GroupAdminAffiliated',\r\n  'AnimalAdmin',\r\n  'LargeAnimalsOperatingRoomUser',\r\n  'LargeAnimalsOperatingRoomTechnician',\r\n  'LargeAnimalsOperatingRoomVeterinarian',\r\n  'CoreBudgetsAdmin',\r\n  'ConsumableKiosk',\r\n  'CreateNewAssetsAdmin',\r\n];\r\n","import { Dictionary, keyBy, omit, orderBy, transform } from 'lodash';\r\nimport {\r\n  IServiceRequestTableRowModel,\r\n  IServiceRequestTableRowValueModel,\r\n} from './types';\r\nimport { fromDtoValue } from './selectors';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport { serializeCustomFormRowValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { ServiceRequestTableColumnsCollection } from './utils/ServiceRequestTableColumn';\r\n\r\nexport function prepareServiceRequestRowModel(\r\n  rows: Array<IServiceRequestRowDto>,\r\n  columns: ServiceRequestTableColumnsCollection,\r\n) {\r\n  const result: IServiceRequestTableRowModel[] | undefined = orderBy(\r\n    rows,\r\n    f => f.Id,\r\n  )?.map(row => {\r\n    const values = keyBy(row.Values, value => value.ColumnId);\r\n    const rowValues: Dictionary<IServiceRequestTableRowValueModel> = transform(\r\n      columns.columnsObj,\r\n      (result, column, columnId) => {\r\n        result[column.getFieldName()] = fromDtoValue(\r\n          column.ColumnType,\r\n          values[column.Id],\r\n        );\r\n      },\r\n      {},\r\n    );\r\n    const model: IServiceRequestTableRowModel = {\r\n      ...omit(row, 'Values', '@odata.context'),\r\n      ...{\r\n        Values: rowValues,\r\n      },\r\n    };\r\n    return model;\r\n  });\r\n  return result;\r\n}\r\n\r\nexport function serviceRequestModelToDto(\r\n  model: Partial<IServiceRequestTableRowModel>,\r\n  columns: ServiceRequestTableColumnsCollection,\r\n) {\r\n  const result: Partial<\r\n    Omit<IServiceRequestRowDto, 'Values'> & {\r\n      Values: Array<Partial<IServiceRequestRowValueDto>>;\r\n    }\r\n  > = {\r\n    ...omit(model, 'Values'),\r\n    Values: columns\r\n      .getArray()\r\n      .filter(column => column.CopyPrevValues)\r\n      .map(column => {\r\n        const dto: Partial<IServiceRequestRowValueDto> = {\r\n          ColumnId: column.Id,\r\n        };\r\n        const modelValue = model.Values?.[column.Id];\r\n        if (modelValue !== undefined) {\r\n          Object.assign(dto, serializeCustomFormRowValue(modelValue));\r\n        }\r\n        return dto;\r\n      }),\r\n  };\r\n  return result;\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectExpandedSidePanel,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { omit } from 'lodash';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { push } from 'connected-react-router';\r\nimport { DeatilsOperations } from './ditails';\r\nimport { SaveFormButton } from 'app/pages/UserTrainings/TrainingDetailsPage/Details/Actions/TrainingActions';\r\nimport { TFunction } from 'i18next';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { INotification } from '../Actions/Actions';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface DetailsFormProps {\r\n  initialValues?: LocationDetailsProps;\r\n  ModelDetails: any;\r\n  isEdit?: boolean;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  onSubmit: (item: any) => void;\r\n  onCancel?: () => void;\r\n}\r\n\r\nexport interface LocationDetailsProps extends SidePanelContentProps {\r\n  Id: number;\r\n  Title: string;\r\n  AddNew: string;\r\n  ModelDetails: any;\r\n  PageComponent: string;\r\n  component: React.FC<DetailsFormProps>;\r\n  operation: DeatilsOperations;\r\n  submitcall: (\r\n    t: TFunction,\r\n    Id: number,\r\n    operation: DeatilsOperations,\r\n    details: any,\r\n    handleSubmitCallResult: (values: INotification[]) => void,\r\n  ) => void;\r\n}\r\n\r\nexport function LocationDetails(props: LocationDetailsProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const initialValues: LocationDetailsProps = props;\r\n  const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n  const edit = initialValues.operation === DeatilsOperations.edit;\r\n  const busy = false;\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const requestCompleted = true;\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const handleSubmitForm = e => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const handleCancelClick = React.useCallback(() => {\r\n    if (props.useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    } else {\r\n      dispatch(push('/' + initialValues.PageComponent));\r\n    }\r\n  }, [\r\n    dispatch,\r\n    initialValues.PageComponent,\r\n    layoutActions,\r\n    props.useSidePanel,\r\n  ]);\r\n  const handleClose = () => {\r\n    if (hasChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCancelClick();\r\n    }\r\n  };\r\n\r\n  React.useEffect(() => {\r\n    if (confirmApproved) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n  });\r\n\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n  const handleSubmitCallResult = React.useCallback(\r\n    (values: INotification[]) => {\r\n      values.forEach(v =>\r\n        dispatch(\r\n          actions.addNotification({ variant: v.variant, message: v.message }),\r\n        ),\r\n      );\r\n      dispatch(layoutActions.resetSidePanel());\r\n      dispatch(layoutActions.setRefreshTable(true));\r\n    },\r\n    [actions, dispatch, layoutActions],\r\n  );\r\n  const handleSubmit = React.useCallback(\r\n    values => {\r\n      initialValues.submitcall(\r\n        t,\r\n        initialValues.Id,\r\n        initialValues.operation,\r\n        values,\r\n        handleSubmitCallResult,\r\n      );\r\n    },\r\n    [handleSubmitCallResult, initialValues, t],\r\n  );\r\n  const LocationContent = React.useMemo(() => {\r\n    return (\r\n      <initialValues.component\r\n        initialValues={initialValues}\r\n        ModelDetails={initialValues.ModelDetails}\r\n        bindSubmitForm={bindSubmitForm}\r\n        onSubmit={handleSubmit}\r\n      />\r\n    );\r\n  }, [bindSubmitForm, handleSubmit, initialValues]);\r\n  const leftActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <SaveFormButton\r\n            size={isMobile || !sidePanelExpanded ? 'small' : 'medium'}\r\n            startIcon={<Icon icon=\"save\" />}\r\n            onClick={handleSubmitForm}\r\n            disabled={busy}\r\n            processing={!requestCompleted && busy}\r\n            edit={edit}\r\n            text={t(translations.Save)}\r\n          />\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [busy, edit, isMobile, requestCompleted, sidePanelExpanded, t]);\r\n\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size={isMobile || !sidePanelExpanded ? 'small' : 'medium'}\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCancelClick}\r\n          >\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCancelClick, isMobile, sidePanelExpanded, t]);\r\n  return (\r\n    <>\r\n      <PageWrapper\r\n        pageName={edit ? props.Title : props.Title}\r\n        titlePage={\r\n          edit\r\n            ? ` ${t(translations.Update)} ${t(translations.IdSpec)}${\r\n                initialValues.Id\r\n              }`\r\n            : ` ${props.AddNew}`\r\n        }\r\n        closable={true}\r\n        closeSidePanel={handleClose}\r\n        children={LocationContent}\r\n        pageLink={buildURL(\r\n          publicUrl + initialValues.PageComponent,\r\n          omit(props, ['useSidePanel']),\r\n        )}\r\n        toPageLink={`${initialValues.PageComponent}?${toQueryString(\r\n          omit(props, ['useSidePanel']),\r\n        )}`}\r\n        leftActions={leftActions}\r\n        rightActions={rightActions}\r\n        useSidePanel={props.useSidePanel}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","/**\r\n * Bookit.Data.CatRate.CatRateTypes\r\n */\r\nexport enum CatRateTypes {\r\n  Usage = 1,\r\n\r\n  FixedUsage = 2,\r\n\r\n  Reservation = 3,\r\n\r\n  FixedReservation = 4,\r\n\r\n  TutoringUsage = 5,\r\n\r\n  FixedTutoringUsage = 6,\r\n\r\n  TutoringReservation = 7,\r\n\r\n  FixedTutoringReservation = 8,\r\n\r\n  ReservationCancelation = 9,\r\n\r\n  OfflineService = 10,\r\n\r\n  ServiceRequestLine = 11,\r\n\r\n  ServiceRequest = 12,\r\n\r\n  Other = 13,\r\n\r\n  UsageExceededReservation = 16,\r\n\r\n  /// <summary>\r\n  /// This Fee Type is used for display purposes in the invoice rows to differentiate offlin services from service requests\r\n  /// </summary>\r\n\r\n  ServiceRequestServices = 17,\r\n  /// <summary>\r\n  /// This Fee Type is used for setup Milistones Requests in the Price Sheet screen\r\n  /// </summary>\r\n\r\n  ServiceRequestMilestones = 18,\r\n\r\n  TrainingSessions = 19,\r\n\r\n  FixedTrainingSessions = 20,\r\n\r\n  Subscription = 21,\r\n\r\n  PartialReservationCancellation = 22,\r\n\r\n  Refund = 23,\r\n  System = 24,\r\n  Discount = 25,\r\n}\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport { BudgetEntitySechema, ServiceGroupEntitySchema } from '..';\r\n\r\n/**\r\n *\r\n * @param t localization TFunction\r\n * @returns base validation schema for paymet or charge\r\n */\r\nexport function InvoiceChildRowBaseSchema(t: TFunction) {\r\n  return Yup.object({\r\n    Id: Yup.number().notRequired(),\r\n    InvoiceId: Yup.number().notRequired(),\r\n    Budget: BudgetEntitySechema.nullable().required(\r\n      t(translations.PleaseSelectABudgetNumber),\r\n    ),\r\n    ServiceGroup: ServiceGroupEntitySchema.required(\r\n      t(translations.PleaseSelectServiceGroup),\r\n    ).nullable(),\r\n    Date: Yup.date().required(t(translations.PleaseSelectADate)),\r\n  });\r\n}\r\n","export enum AllowCreateInvoicesBy {\r\n  AlllowCreateInvoicesBy_AllowToChooseOnCreation,\r\n  AlllowCreateInvoicesBy_BudgetsOnly,\r\n  AlllowCreateInvoicesBy_UserGroupOnly,\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { PaymentApi } from 'api/PaymentApi';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n// import { FormAdminServiceGroupPicker } from 'app/components/Forms/FormAdminServiceGroupPicker';\r\nimport { FormBudgetPicker } from 'app/components/Forms/FormBudgetPicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormPaymentMethodPicker } from 'app/components/Forms/FormPaymentMethodPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { serviceGroupFilterUrl } from 'app/components/pickers/ServiceGroupPicker';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useResponseModel } from 'app/hooks/useResponseModel';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\nimport { IPayment } from './IPayment';\r\nimport { getPaymentSchema } from './PaymentSchema';\r\nimport { getPaymentSchemaWithBudgetNotRequired } from './PaymentSchema';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface PaymentProps extends CoverProps {\r\n  invoiceId?: number;\r\n  budget: Entity<number> | null;\r\n  serviceGroup: Entity<number> | null;\r\n  amount?: number;\r\n  paymentId?: number;\r\n  serviceGroupPredicate?: (string | Condition<Entity<number>>)[];\r\n  userGroupId?: string;\r\n}\r\n\r\nexport const AddPayment = (props: PaymentProps) => {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const { actions: notifyActions } = useAppSettingsSlice();\r\n  const submitRef = useRef<any>();\r\n  const [busy, setBusy] = useState(false);\r\n  const close = useCallback(() => {\r\n    if (props.isCover) {\r\n      props.closeCover?.();\r\n    } else {\r\n      dispatch(actions.resetSidePanel());\r\n    }\r\n  }, [props, dispatch, actions]);\r\n  const refreshTable = useCallback(() => {\r\n    dispatch(actions.setRefreshTable(true));\r\n  }, [dispatch, actions]);\r\n  const sendResponse = useResponseModel();\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const closeApproved = useSelector(selectConfirmApproved);\r\n  const closeRejected = useSelector(selectConfirmRejected);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const isEdit = !!props.paymentId && !!props.invoiceId;\r\n  const { newDate } = useSystemDate();\r\n  const submit = useCallback(\r\n    (payment: IPayment) => {\r\n      setBusy(true);\r\n      if (!isEdit) {\r\n        PaymentApi.AddPayment(payment)\r\n          .then(v => {\r\n            if (v.SuccessMessages.length > 0) {\r\n              dispatch(\r\n                notifyActions.addNotification({\r\n                  key: 'payment_success',\r\n                  message: v.SuccessMessages[0],\r\n                  variant: 'success',\r\n                }),\r\n              );\r\n              v.SuccessMessages = [];\r\n            }\r\n            sendResponse(v);\r\n          })\r\n          .catch(() => {\r\n            dispatch(\r\n              notifyActions.addNotification({\r\n                message: t(translations.err_InvoicePaymentAdd),\r\n                variant: 'error',\r\n              }),\r\n            );\r\n          })\r\n          .finally(() => {\r\n            close();\r\n            refreshTable();\r\n          });\r\n      } else {\r\n        PaymentApi.UpdatePayment(props.paymentId!, payment)\r\n          .then(() => {\r\n            dispatch(\r\n              notifyActions.addNotification({\r\n                message: t(translations.success_EditInvoicePayment),\r\n                variant: 'success',\r\n              }),\r\n            );\r\n          })\r\n          .catch(() => {\r\n            dispatch(\r\n              notifyActions.addNotification({\r\n                message: t(translations.err_EditInvoicePayment),\r\n                variant: 'error',\r\n              }),\r\n            );\r\n          })\r\n          .finally(() => {\r\n            close();\r\n            refreshTable();\r\n          });\r\n      }\r\n    },\r\n    [\r\n      close,\r\n      dispatch,\r\n      isEdit,\r\n      notifyActions,\r\n      props.paymentId,\r\n      refreshTable,\r\n      sendResponse,\r\n      t,\r\n    ],\r\n  );\r\n  const [initialValues, setinitialValues] = useState<IPayment>({\r\n    InvoiceId: props.invoiceId,\r\n    Budget: props.budget,\r\n    ServiceGroup: props.serviceGroup,\r\n    Amount: props.amount,\r\n    Method: null,\r\n    Date: newDate(),\r\n  });\r\n  useEffect(() => {\r\n    if (closeApproved) {\r\n      dispatch(actions.resetSidePanel());\r\n    }\r\n    if (closeRejected) {\r\n      dispatch(actions.resetConfirmState());\r\n    }\r\n  }, [actions, closeApproved, closeRejected, dispatch]);\r\n  useEffectOnMount(() => {\r\n    //dispatch(layoutActions.setUpSnackBarIndex(true)); // increase snack bar z-index\r\n    if (!isEdit) {\r\n      if (props.serviceGroup === null) {\r\n        setBusy(true);\r\n        let isMounted = true;\r\n        (async () => {\r\n          const res = await getAutoCompleteLoadDataFn<Entity<number>>({\r\n            url: serviceGroupFilterUrl,\r\n            predicates: authenticatedUser\r\n              ? [\r\n                  new Condition(\r\n                    'Id',\r\n                    ODataOperators.Includes,\r\n                    authenticatedUser.AdminServiceGroups,\r\n                  ),\r\n                ]\r\n              : undefined,\r\n          })('', props.serviceGroupPredicate).then(v => v.value);\r\n          if (isMounted) {\r\n            if (res && res.length === 1) {\r\n              setinitialValues(prev => ({ ...prev, ServiceGroup: res[0] }));\r\n            }\r\n            setBusy(false);\r\n          }\r\n        })();\r\n        return () => {\r\n          isMounted = false;\r\n        };\r\n      }\r\n      return;\r\n    }\r\n    setBusy(true);\r\n    let mounted = true;\r\n    (async () => {\r\n      try {\r\n        let res = await httpClient.get(\r\n          '/api/odata/v4/InvoicePayments(' + props.paymentId + ')',\r\n          {\r\n            id: props.invoiceId,\r\n            $select: [\r\n              'InvoiceId',\r\n              'MethodId',\r\n              'PaymentMethodName',\r\n              'Amount',\r\n              'Date',\r\n              'Remarks',\r\n              'Reference',\r\n              'BudgetId',\r\n              'BudgetNumber',\r\n              'ServiceGroupId',\r\n              'ServiceGroupName',\r\n            ].join(','),\r\n          },\r\n        );\r\n        if (mounted) {\r\n          setinitialValues({\r\n            Id: props.paymentId,\r\n            InvoiceId: res.InvoiceId,\r\n            Budget: res.BudgetId\r\n              ? { Id: res.BudgetId, Name: res.BudgetNumber }\r\n              : null,\r\n            ServiceGroup: res.ServiceGroupId\r\n              ? { Id: res.ServiceGroupId, Name: res.ServiceGroupName }\r\n              : null,\r\n            Method: { Id: res.MethodId, Name: res.PaymentMethodName },\r\n            Date: res.Date,\r\n            Amount: res.Amount,\r\n            Reference: res.Reference ?? undefined,\r\n            Remarks: res.Remarks ?? undefined,\r\n          });\r\n          setBusy(false);\r\n        }\r\n      } catch (error) {\r\n        console.error(error);\r\n      }\r\n    })();\r\n    return () => {\r\n      //dispatch(layoutActions.setUpSnackBarIndex(false)); // decrease snack bar z-index\r\n      mounted = false;\r\n    };\r\n  });\r\n\r\n  const PaymentSchema: Yup.SchemaOf<IPayment> = getPaymentSchema(t);\r\n  const PaymentSchemaWithBudgetNotRequired: Yup.SchemaOf<IPayment> = getPaymentSchemaWithBudgetNotRequired(\r\n    t,\r\n  );\r\n  if (isEdit) {\r\n    PaymentSchema.fields.ServiceGroup = PaymentSchema.fields.ServiceGroup.notRequired();\r\n  }\r\n\r\n  const Paymentform = () => (\r\n    <Formik\r\n      validationSchema={\r\n        IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n        initialValues.Budget !== null\r\n          ? PaymentSchema\r\n          : PaymentSchemaWithBudgetNotRequired\r\n      }\r\n      initialValues={initialValues}\r\n      validateOnMount\r\n      onSubmit={submit}\r\n    >\r\n      {formik => {\r\n        submitRef.current = formik.submitForm;\r\n        return (\r\n          <StyledForm onSubmit={formik.handleSubmit}>\r\n            {/* By using FormListener, the fields become not editable */}\r\n            {/* <FormListener fields={[]} onFormChange={() => {}} /> */}\r\n            <FormLeftSection>\r\n              <FormFieldsSection>\r\n                <FormRow fullRow>\r\n                  <FormServiceGroupPicker\r\n                    name=\"ServiceGroup\"\r\n                    fullWidth\r\n                    placeholder={t(translations.ServiceGroup)}\r\n                    label={t(translations.ServiceGroup)}\r\n                    disabled={\r\n                      busy || initialValues.ServiceGroup !== null || isEdit\r\n                    }\r\n                    urlType=\"admin\"\r\n                    predicates={props.serviceGroupPredicate}\r\n                    autoFocus\r\n                  />\r\n                </FormRow>\r\n                {IsModuleEnabled(appSettings, KnownModules.Budgets) && (\r\n                  <FormRow fullRow>\r\n                    <FormBudgetPicker\r\n                      name=\"Budget\"\r\n                      fullWidth\r\n                      placeholder={t(translations.Budget)}\r\n                      label={t(translations.Budget)}\r\n                      disabled={initialValues.Budget !== null || isEdit}\r\n                      predicates={\r\n                        props.userGroupId\r\n                          ? [\r\n                              new Condition(\r\n                                'UserGroupId',\r\n                                ODataOperators.Equals,\r\n                                props.userGroupId,\r\n                              ),\r\n                            ]\r\n                          : undefined\r\n                      }\r\n                    />\r\n                  </FormRow>\r\n                )}\r\n                <FormRow fullRow>\r\n                  <FormBookitDatePicker\r\n                    fullWidth\r\n                    name=\"PaymentDate\"\r\n                    id=\"paymentDate_id\"\r\n                    placeholder={t(translations.Date)}\r\n                    label={t(translations.Date)}\r\n                    disabled={busy || isEdit}\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormNumberField\r\n                    fullWidth\r\n                    name=\"Amount\"\r\n                    id=\"payment_amount_Id\"\r\n                    inputMode=\"decimal\"\r\n                    placeholder={t(translations.Amount)}\r\n                    label={t(translations.Amount)}\r\n                    disabled={busy}\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormPaymentMethodPicker\r\n                    fullWidth\r\n                    name=\"Method\"\r\n                    placeholder={t(translations.PaymentMethod)}\r\n                    label={t(translations.PaymentMethod)}\r\n                    disabled={busy || isEdit}\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormTextField\r\n                    name=\"Reference\"\r\n                    id=\"referenceId\"\r\n                    fullWidth\r\n                    placeholder={t(translations.Reference)}\r\n                    label={t(translations.Reference)}\r\n                    disabled={busy}\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormRichTextField\r\n                    fullWidth\r\n                    name=\"Remarks\"\r\n                    id=\"remarksId\"\r\n                    placeholder={t(translations.Remarks)}\r\n                    label={t(translations.Remarks)}\r\n                    disabled={busy}\r\n                  />\r\n                </FormRow>\r\n              </FormFieldsSection>\r\n            </FormLeftSection>\r\n          </StyledForm>\r\n        );\r\n      }}\r\n    </Formik>\r\n  );\r\n  const leftActions = [\r\n    () => (\r\n      <>\r\n        <Button\r\n          onClick={() => submitRef.current?.()}\r\n          size=\"small\"\r\n          disabled={busy}\r\n        >\r\n          {t(translations.Submit)}\r\n        </Button>\r\n      </>\r\n    ),\r\n  ];\r\n  const rightActions = [\r\n    () => (\r\n      <>\r\n        <Button\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={close}\r\n          disabled={busy}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </>\r\n    ),\r\n  ];\r\n  return (\r\n    <PageWrapper\r\n      id=\"add_payment_page\"\r\n      loading={busy}\r\n      titlePage={\r\n        isEdit\r\n          ? `${t(translations.Payment)} #${props.paymentId}`\r\n          : t(translations.AddPaymentInvoice)\r\n      }\r\n      closable\r\n      useSidePanel\r\n      children={<Paymentform />}\r\n      leftActions={leftActions}\r\n      rightActions={rightActions}\r\n      disableExpandToggle\r\n      closeSidePanel={() => {\r\n        if (hasChanges) {\r\n          dispatch(actions.setConfirmOpen(true));\r\n        } else {\r\n          dispatch(actions.resetSidePanel());\r\n        }\r\n      }}\r\n      isCover={props.isCover}\r\n      closeCover={props.closeCover}\r\n    />\r\n  );\r\n};\r\n","import {\r\n  BudgetEntitySechema,\r\n  FeeTypeEntitySchema,\r\n  OfflineServiceTypeEntitySchema,\r\n  OnlineServiceEntitySchema,\r\n  PaymentMethodEntitySchema,\r\n  ServiceGroupEntitySchema,\r\n  UserEntitySchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { InvoiceChildRowBaseSchema } from 'app/components/Forms/Schemas/InvoiceChildRowBaseSchema';\r\nimport { CatRateTypes } from 'enums/CatRateTypes';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\n\r\nimport { IPayment } from './IPayment';\r\n\r\nexport function getPaymentSchema(t: TFunction): Yup.SchemaOf<IPayment> {\r\n  return InvoiceChildRowBaseSchema(t).shape({\r\n    Budget: BudgetEntitySechema.nullable().notRequired().optional(),\r\n    Method: PaymentMethodEntitySchema.required(\r\n      t(translations.err_PaymentMethodRequired),\r\n    ).nullable(),\r\n    Amount: Yup.number()\r\n      .required(t(translations.PleaseEnterAnAmount))\r\n      .positive(t(translations.InvalidValue)),\r\n\r\n    Reference: Yup.string().notRequired(),\r\n    Remarks: Yup.string().notRequired(),\r\n  });\r\n}\r\n\r\nexport function getPaymentSchemaWithBudgetNotRequired(\r\n  t: TFunction,\r\n): Yup.SchemaOf<IPayment> {\r\n  return InvoiceChildRowBaseSchema(t).shape({\r\n    Method: PaymentMethodEntitySchema.required(\r\n      t(translations.err_PaymentMethodRequired),\r\n    ).nullable(),\r\n    Amount: Yup.number()\r\n      .required(t(translations.PleaseEnterAnAmount))\r\n      .positive(t(translations.InvalidValue)),\r\n\r\n    Reference: Yup.string().notRequired(),\r\n    Remarks: Yup.string().notRequired(),\r\n    Budget: BudgetEntitySechema.nullable().notRequired().optional(),\r\n  });\r\n}\r\n\r\nexport function foo(t: TFunction) {\r\n  return InvoiceChildRowBaseSchema(t).shape({\r\n    User: UserEntitySchema.nullable().when(\r\n      'FeeType',\r\n      (catRateType, schema: Yup.SchemaOf<Entity<string>>) =>\r\n        [CatRateTypes.Refund, CatRateTypes.Other].includes(\r\n          (catRateType as Entity<number>)?.Id,\r\n        )\r\n          ? schema.notRequired()\r\n          : schema.required(),\r\n    ),\r\n    Resource: OnlineServiceEntitySchema.notRequired().nullable(),\r\n    OtherService: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n    SampleType: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n    FeeType: FeeTypeEntitySchema.required().nullable(),\r\n    Quantity: Yup.number().defined(),\r\n    Rate: Yup.number()\r\n      .defined()\r\n      .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n        return (catRateType as Entity<number>)?.Id === CatRateTypes.Refund ||\r\n          (catRateType as Entity<number>)?.Id === CatRateTypes.Discount\r\n          ? schema.negative()\r\n          : schema.positive();\r\n      }),\r\n    Amount: Yup.number()\r\n      .defined()\r\n      .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n        return (catRateType as Entity<number>)?.Id === CatRateTypes.Refund ||\r\n          (catRateType as Entity<number>)?.Id === CatRateTypes.Discount\r\n          ? schema.negative()\r\n          : schema.positive();\r\n      }),\r\n\r\n    ServiceGroup: ServiceGroupEntitySchema.required().nullable(),\r\n  });\r\n}\r\n","import { ICharge } from 'app/pages/AddChargePage/ICharge';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nconst url = '/api/odata/v4/Charge';\r\nexport const ChargeApi = {\r\n  AddCharge: (charge: ICharge) => {\r\n    const data = {\r\n      Id: charge.Id,\r\n      Username: charge.User?.Id,\r\n      BudgetId: charge.Budget?.Id,\r\n      EquipmentId: charge.Resource?.Id,\r\n      OfflineServiceTypeId: charge.OtherService?.Id,\r\n      Quantity: charge.Quantity,\r\n      BaseRate: charge.Rate,\r\n      CatRateTypeId: charge.FeeType?.Id,\r\n      Date: charge.Date,\r\n      SampleTypeId: charge.SampleType?.Id,\r\n      ServiceGroupId: charge.ServiceGroup?.Id,\r\n      UserGroupId: charge.UserGroup?.Id,\r\n      Remarks: charge.Remarks,\r\n      PurchaseOrder: charge.PurchaseOrder,\r\n    };\r\n    return httpClient.post(url, data);\r\n  },\r\n  UpdateCharge: (charge: ICharge, rowId: number) => {\r\n    const data = {\r\n      Id: charge.Id,\r\n      Username: charge.User?.Id,\r\n      BudgetId: charge.Budget?.Id,\r\n      EquipmentId: charge.Resource?.Id,\r\n      OfflineServiceTypeId: charge.OtherService?.Id,\r\n      Quantity: charge.Quantity,\r\n      BaseRate: charge.Rate,\r\n      CatRateTypeId: charge.FeeType?.Id,\r\n      Date: charge.Date,\r\n      SampleTypeId: charge.SampleType?.Id,\r\n      ServiceGroupId: charge.ServiceGroup?.Id,\r\n      ActualRate: charge.ActualRate,\r\n      UserGroupId: charge.UserGroup?.Id,\r\n      Remarks: charge.Remarks,\r\n      PurchaseOrder: charge.PurchaseOrder,\r\n    };\r\n    return httpClient.put<any, IResponseType>(url + '(' + rowId + ')', data);\r\n  },\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  CatRateTypePicker,\r\n  CatRateTypeProps,\r\n} from '../pickers/AutocompletePickers/CatRateTypePicker';\r\n\r\ninterface FormCatRateTypePickerIntrinsicProps\r\n  extends Omit<CatRateTypeProps, 'onBlur' | 'value' | 'error' | 'onChange'> {\r\n  serviceGroupId?: number;\r\n}\r\nexport const FormCatRateTypePicker = ({\r\n  onChange,\r\n  onBlur,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  FormCatRateTypePickerIntrinsicProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <CatRateTypePicker\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nconst url = '/api/odata/v4/OfflineServiceFilter';\r\nconst filter = 'ServiceTypeId eq 2 and Active eq true';\r\nexport interface OfflineServicePickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url'> {}\r\n// this picker is redundand, instead use OfflineServiceTyePicker\r\nexport const OfflineServicePicker = (props: OfflineServicePickerProps) => {\r\n  const { queryfilter, ...other } = props;\r\n  const predicate =\r\n    queryfilter && queryfilter !== ''\r\n      ? [queryfilter, filter].join(' and ')\r\n      : filter;\r\n  return (\r\n    <BaseURLPicker\r\n      url={url}\r\n      queryfilter={predicate}\r\n      {...other}\r\n      id={props.id || 'offserviceId'}\r\n    />\r\n  );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  OfflineServicePicker,\r\n  OfflineServicePickerProps,\r\n} from '../pickers/AutocompletePickers/OfflineServicePicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\ninterface FormOfflineServicePickerIntrinsicProps\r\n  extends Omit<\r\n    OfflineServicePickerProps,\r\n    'onBlur' | 'value' | 'error' | 'onChange'\r\n  > {\r\n  serviceGroupId?: number;\r\n}\r\nexport const FormOfflineServicePicker = ({\r\n  onChange,\r\n  onBlur,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  FormOfflineServicePickerIntrinsicProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <OfflineServicePicker\r\n        placeholder={props.placeholder}\r\n        disabled={props.disabled}\r\n        label={props.label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (onChange) {\r\n            onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        variant=\"filled\"\r\n        queryfilter={\r\n          props.serviceGroupId\r\n            ? new Condition(\r\n                'ServiceGroupId',\r\n                ODataOperators.Equals,\r\n                props.serviceGroupId,\r\n              ).toString()\r\n            : undefined\r\n        }\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  SampleTypePicker,\r\n  SampleTypePickerProps,\r\n} from '../pickers/AutocompletePickers/SampleTypePicker.index';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\ninterface FormOfflineServicePickerIntrinsicProps\r\n  extends Omit<\r\n    SampleTypePickerProps,\r\n    'onBlur' | 'value' | 'error' | 'onChange'\r\n  > {\r\n  serviceGroupId?: number;\r\n}\r\nexport const FormSampleTypePicker = ({\r\n  onChange,\r\n  onBlur,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  FormOfflineServicePickerIntrinsicProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <SampleTypePicker\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        queryfilter={\r\n          props.serviceGroupId\r\n            ? new Condition(\r\n                'ServiceGroupId',\r\n                ODataOperators.Equals,\r\n                props.serviceGroupId,\r\n              ).toString()\r\n            : undefined\r\n        }\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { ServiceUserGroupPicker } from '../pickers/AutocompletePickers/ServiceUserGroupPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormServiceUserGroupPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<string> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<string> | null>(props);\r\n  return (\r\n    <ServiceUserGroupPicker\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      predicates={props.predicates}\r\n      disabled={props.disabled}\r\n    />\r\n  );\r\n};\r\n","import { ChargeApi } from 'api/ChargeApi';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FormBudgetPicker } from 'app/components/Forms/FormBudgetPicker';\r\nimport { FormCatRateTypePicker } from 'app/components/Forms/FormCatRateTypePicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormOfflineServicePicker } from 'app/components/Forms/FormOfflineServicePicker';\r\nimport { FormSampleTypePicker } from 'app/components/Forms/FormSampleTypePicker';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormServiceUserGroupPicker } from 'app/components/Forms/FormServiceUserGroupPicker';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { loadBudgets } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { serviceGroupFilterUrl } from 'app/components/pickers/ServiceGroupPicker';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n  selectContinueToLink,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { AllowCreateInvoicesBy } from 'enums/allowCreateInvoicesBy';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React, {\r\n  useCallback,\r\n  useEffect,\r\n  useMemo,\r\n  useRef,\r\n  useState,\r\n} from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { GetChargeSchema } from './ChargeSchema';\r\nimport { ICharge } from './ICharge';\r\nimport { FormOnlineServicesSinglePicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { ServiceGroupFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport useGlobalSettingsHook from '../ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport produce from 'immer';\r\nimport { restrictedBudgetFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\n\r\nexport interface ChargeProps extends CoverProps {\r\n  invoiceId?: number;\r\n  budget: Entity<number> | null;\r\n  serviceGroup: Entity<number> | null;\r\n  rowId?: number;\r\n  serviceGroupPredicate?: (string | Condition<Entity<number>>)[];\r\n}\r\n\r\nconst onlyManual = true;\r\n\r\nexport const AddCharge = ({ serviceGroupPredicate, ...props }: ChargeProps) => {\r\n  const { newDate } = useSystemDate();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { actions: notifyActions } = useAppSettingsSlice();\r\n  const submitRef = useRef<any>();\r\n  const [busy, setBusy] = useState(false);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const closeApproved = useSelector(selectConfirmApproved);\r\n  const closeRejected = useSelector(selectConfirmRejected);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  const globalSettings = useGlobalSettingsHook();\r\n\r\n  const [insertedAt, setinsertedAt] = useState<Date | null>(null);\r\n  const [insertedBy, setinsertedBy] = useState<string | null>(null);\r\n  const isEdit = !!props.rowId;\r\n  const userGroupByBudeget = settings.GetBoolean(\r\n    AllowedSettings[AllowedSettings.ReservationUserGroupGroupByBudgetUserGroup],\r\n  );\r\n  const fundingTypeVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.fundingTypeBudgetEnabled &&\r\n      globalSettings.budgetModuleEnabled\r\n    );\r\n  }, [globalSettings]);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const [initialValues, setInitialValue] = useState<ICharge>({\r\n    Id: props.invoiceId,\r\n    Quantity: 0,\r\n    Rate: 0,\r\n    Amount: 0,\r\n    Date: newDate(),\r\n    User: null,\r\n    FeeType: null,\r\n    OtherService: null,\r\n    Resource: null,\r\n    SampleType: null,\r\n    Budget: props.budget,\r\n    ServiceGroup: props.serviceGroup,\r\n    Manual: true,\r\n    UserGroup: null,\r\n    Remarks: '',\r\n    FundingType:\r\n      fundingTypeVisible &&\r\n      !!props.budget &&\r\n      props.budget !== null &&\r\n      (props.budget as IBudgetFilterDto).FundingTypeId !== null\r\n        ? getSingleInvoiceFundingType(\r\n            (props.budget as IBudgetFilterDto).FundingTypeId ?? 0,\r\n          )\r\n        : null,\r\n    PurchaseOrder: null,\r\n  });\r\n\r\n  useEffect(() => {\r\n    if (closeApproved) {\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(actions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            actions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(actions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(notifyActions.navigate(continueLink));\r\n        dispatch(actions.resetSidePanel());\r\n      } else {\r\n        dispatch(actions.resetSidePanel());\r\n      }\r\n    }\r\n    if (closeRejected) {\r\n      dispatch(actions.resetConfirmState());\r\n    }\r\n  }, [\r\n    actions,\r\n    closeApproved,\r\n    closeRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    notifyActions,\r\n  ]);\r\n  useEffect(() => {\r\n    if (!isEdit) {\r\n      if (props.budget !== null) {\r\n        setBusy(true);\r\n        let isMounted = true;\r\n        (async () => {\r\n          try {\r\n            let queryBudg = loadBudgets([\r\n              new Condition('Id', ODataOperators.Equals, props.budget!.Id),\r\n              new Condition('Active', ODataOperators.Equals, true),\r\n            ]);\r\n            const budgetRes = await queryBudg(null);\r\n            const serviceGroupRes = await (() => {\r\n              if (props.serviceGroup !== null) return Promise.resolve([]);\r\n              return getAutoCompleteLoadDataFn<Entity<number>>({\r\n                url: serviceGroupFilterUrl,\r\n                predicates: authenticatedUser\r\n                  ? [\r\n                      new Condition(\r\n                        'Id',\r\n                        ODataOperators.Includes,\r\n                        authenticatedUser.AdminServiceGroups,\r\n                      ),\r\n                    ]\r\n                  : undefined,\r\n              })('', serviceGroupPredicate).then(v => v.value);\r\n            })();\r\n            if (isMounted) {\r\n              const values = { ...initialValues };\r\n              if (budgetRes && budgetRes.value.length > 0) {\r\n                const budegtval = budgetRes.value[0];\r\n                values.UserGroup =\r\n                  budegtval.UserGroupId && budegtval.UserGroupName\r\n                    ? {\r\n                        Id: budegtval.UserGroupId,\r\n                        Name: budegtval.UserGroupName,\r\n                      }\r\n                    : values.UserGroup;\r\n              }\r\n              if (serviceGroupRes && serviceGroupRes.length === 1) {\r\n                values.ServiceGroup = serviceGroupRes[0];\r\n              }\r\n              setInitialValue(values);\r\n              setBusy(false);\r\n            }\r\n          } catch (error) {\r\n            console.error(error);\r\n          }\r\n        })();\r\n        return () => {\r\n          isMounted = false;\r\n        };\r\n      }\r\n      return;\r\n    }\r\n    setBusy(true);\r\n    let mounted = true;\r\n    (async () => {\r\n      try {\r\n        const res = await httpClient.get(\r\n          '/api/odata/v4/InvoiceRows(' + props.rowId + ')',\r\n          {\r\n            id: props.invoiceId ?? 'null',\r\n            $select: [\r\n              'InvoiceId',\r\n              'BudgetId',\r\n              'Budget',\r\n              'OnlineService',\r\n              'OnlineServiceId',\r\n              'OfflineServiceType',\r\n              'OfflineServiceTypeId',\r\n              'SampleService',\r\n              'SampleServiceId',\r\n              'CatRateTypeId',\r\n              'CatRateType',\r\n              'Quantity',\r\n              'BaseRate',\r\n              'Amount',\r\n              'SubsProfPercentage',\r\n              'User',\r\n              'UserId',\r\n              'Date',\r\n              'ServiceGroupId',\r\n              'ServiceGroupName',\r\n              'Manual',\r\n              'ActualRate',\r\n              'UserGroupId',\r\n              'UserGroup',\r\n              'InsertedAt',\r\n              'InsertedByDisplay',\r\n              'Remarks',\r\n              'FundingTypeId',\r\n              'PurchaseOrder',\r\n              'PurchaseOrderOptionId',\r\n            ].join(','),\r\n          },\r\n        );\r\n        if (mounted) {\r\n          setInitialValue({\r\n            Id: res.InvoiceId ?? 0,\r\n            Budget:\r\n              !!res.BudgetId && res.BudgetId !== null\r\n                ? ({\r\n                    Id: res.BudgetId,\r\n                    Name: res.Budget,\r\n                    PurchaseOrderOptionId: res.PurchaseOrderOptionId,\r\n                  } as Entity<number>)\r\n                : null,\r\n            User: res.UserId ? { Id: res.UserId, Name: res.User } : null,\r\n            Resource: res.OnlineServiceId\r\n              ? { Id: res.OnlineServiceId, Name: res.OnlineService }\r\n              : null,\r\n            OtherService: res.OfflineServiceTypeId\r\n              ? { Id: res.OfflineServiceTypeId, Name: res.OfflineServiceType }\r\n              : null,\r\n            FeeType: { Id: res.CatRateTypeId, Name: res.CatRateType },\r\n            SampleType: res.SampleServiceId\r\n              ? { Id: res.SampleServiceId, Name: res.SampleService }\r\n              : null,\r\n            Quantity: res.Quantity,\r\n            Rate: res.BaseRate,\r\n            Amount: res.Amount,\r\n            Date: res.Date,\r\n            ServiceGroup: res.ServiceGroupId\r\n              ? { Id: res.ServiceGroupId, Name: res.ServiceGroupName }\r\n              : null,\r\n            Manual: res.Manual,\r\n            ActualRate: res.ActualRate,\r\n            UserGroup: res.UserGroupId\r\n              ? {\r\n                  Id: res.UserGroupId,\r\n                  Name: res.UserGroup,\r\n                }\r\n              : null,\r\n            Remarks: res.Remarks,\r\n            FundingType:\r\n              res.FundingTypeId !== null\r\n                ? getSingleInvoiceFundingType(res.FundingTypeId)\r\n                : null,\r\n            PurchaseOrder: res.PurchaseOrder,\r\n          });\r\n          setinsertedAt(res.InsertedAt);\r\n          setinsertedBy(res.InsertedBy);\r\n          setBusy(false);\r\n        }\r\n      } catch (error) {\r\n        console.error(error);\r\n      }\r\n    })();\r\n    return () => {\r\n      mounted = false;\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [props.rowId]);\r\n  const close = useCallback(() => {\r\n    if (props.isCover) {\r\n      props.closeCover?.();\r\n    } else {\r\n      dispatch(actions.resetSidePanel());\r\n    }\r\n  }, [props, dispatch, actions]);\r\n  const refreshTable = useCallback(() => {\r\n    dispatch(actions.setRefreshTable(true));\r\n  }, [dispatch, actions]);\r\n  const submit = useCallback(\r\n    (charge: ICharge) => {\r\n      setBusy(true);\r\n      if (!isEdit) {\r\n        ChargeApi.AddCharge(charge)\r\n          .then(() => {\r\n            dispatch(\r\n              notifyActions.addNotification({\r\n                message: t(translations.msg_addedChargeSuccessfully),\r\n                variant: 'success',\r\n              }),\r\n            );\r\n          })\r\n          .catch(e => console.error(e))\r\n          .finally(() => {\r\n            close();\r\n            refreshTable();\r\n          });\r\n      } else {\r\n        ChargeApi.UpdateCharge(charge, props.rowId!)\r\n          .then(res => {\r\n            if (res.ErrorMessages.length > 0) {\r\n              dispatch(\r\n                notifyActions.addNotification({\r\n                  message: res.ErrorMessages[0],\r\n                  variant: 'error',\r\n                }),\r\n              );\r\n              setBusy(false);\r\n              return;\r\n            }\r\n            dispatch(\r\n              notifyActions.addNotification({\r\n                message: t(translations.success_EditInvoiceLine),\r\n                variant: 'success',\r\n              }),\r\n            );\r\n            close();\r\n            refreshTable();\r\n          })\r\n          .catch(e => console.error(e));\r\n      }\r\n    },\r\n    [close, dispatch, isEdit, notifyActions, props.rowId, refreshTable, t],\r\n  );\r\n  const budgetOnly = useMemo(() => {\r\n    return (\r\n      settings.GetString(AllowedSettings.CreateInovicesBy) ===\r\n      AllowCreateInvoicesBy[\r\n        AllowCreateInvoicesBy.AlllowCreateInvoicesBy_BudgetsOnly\r\n      ]\r\n    );\r\n  }, [settings]);\r\n  const ChargeSchema = GetChargeSchema(t, isEdit, globalSettings);\r\n  const ChargeForm = () => {\r\n    return (\r\n      <Formik\r\n        validationSchema={ChargeSchema}\r\n        initialValues={initialValues}\r\n        onSubmit={submit}\r\n      >\r\n        {formik => {\r\n          submitRef.current = formik.submitForm;\r\n          const setAmount = (rate: number, quantity: number) => {\r\n            formik\r\n              .getFieldHelpers('Amount')\r\n              .setValue(+(quantity * rate).toFixed(2), true);\r\n          };\r\n          const serviceGroupChanged = () => {\r\n            formik.getFieldHelpers('Resource').setValue(null, true);\r\n            formik.getFieldHelpers('OtherService').setValue(null, true);\r\n            formik.getFieldHelpers('SampleType').setValue(null, true);\r\n          };\r\n          return (\r\n            <StyledForm onSubmit={formik.handleSubmit}>\r\n              {/* By using FormListener, the fields become not editable */}\r\n              {/* <FormListener fields={[]} onFormChange={() => {}} /> */}\r\n              <FormLeftSection>\r\n                <FormFieldsSection>\r\n                  {/* ServiceGroup */}\r\n                  <FormRow fullRow>\r\n                    <FormServiceGroupPicker\r\n                      name=\"ServiceGroup\"\r\n                      fullWidth\r\n                      placeholder={t(translations.ServiceGroup)}\r\n                      label={t(translations.ServiceGroup)}\r\n                      onChange={serviceGroupChanged}\r\n                      disabled={\r\n                        busy ||\r\n                        initialValues.ServiceGroup !== null ||\r\n                        (isEdit && !initialValues.Manual)\r\n                      }\r\n                      urlType=\"admin\"\r\n                      predicates={serviceGroupPredicate}\r\n                      autoFocus\r\n                    />\r\n                  </FormRow>\r\n                  {/* FeeType */}\r\n                  <FormRow fullRow>\r\n                    <FormCatRateTypePicker\r\n                      variant=\"filled\"\r\n                      name=\"FeeType\"\r\n                      bySystemSetting\r\n                      fullWidth\r\n                      manual={onlyManual}\r\n                      label={t(translations.FeeType)}\r\n                      placeholder={t(translations.FeeType)}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                    />\r\n                  </FormRow>\r\n                  {/* Date */}\r\n                  <FormRow fullRow>\r\n                    <FormBookitDatePicker\r\n                      name=\"SampleDate\"\r\n                      fullWidth\r\n                      id=\"chargeDate_id\"\r\n                      placeholder={t(translations.PleaseSelectADate)}\r\n                      label={t(translations.Date)}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                      onChange={value => {\r\n                        formik.setFieldValue('Date', value);\r\n                      }}\r\n                    />\r\n                  </FormRow>\r\n                  {/* UserGroup */}\r\n                  <FormRow fullRow>\r\n                    <FormServiceUserGroupPicker\r\n                      fullWidth\r\n                      label={t(translations.UserGroup)}\r\n                      placeholder={t(translations.UserGroup)}\r\n                      disabled={\r\n                        isEdit && !initialValues.Manual\r\n                        // || !userGroupByBudeget\r\n                      }\r\n                      name=\"UserGroup\"\r\n                      predicates={\r\n                        [\r\n                          formik.values.User\r\n                            ? new Condition(\r\n                                'Users',\r\n                                ODataOperators.In,\r\n                                formik.values.User.Id,\r\n                              )\r\n                            : undefined,\r\n                          formik.values.Budget\r\n                            ? new Condition(\r\n                                'Id',\r\n                                ODataOperators.Equals,\r\n                                formik.values.Budget['UserGroupId'],\r\n                              )\r\n                            : undefined,\r\n                        ].filter(v => v !== undefined) as Condition<any>[]\r\n                      }\r\n                    />\r\n                  </FormRow>\r\n                  {/* User */}\r\n                  <FormRow fullRow>\r\n                    <FormUserPicker\r\n                      predicates={\r\n                        [\r\n                          // formik.values.Budget\r\n                          //   ? new Condition(\r\n                          //       'Budgets',\r\n                          //       ODataOperators.In,\r\n                          //       formik.values.Budget.Id,\r\n                          //     )\r\n                          //   : undefined,\r\n                          formik.values.UserGroup\r\n                            ? new Condition<IUserFilterDto>(\r\n                                'UserGroups',\r\n                                ODataOperators.Any,\r\n                                formik.values.UserGroup.Id,\r\n                                'Id',\r\n                              )\r\n                            : undefined,\r\n                        ].filter(v => v !== undefined) as Condition<any>[]\r\n                      }\r\n                      name=\"User\"\r\n                      fullWidth\r\n                      placeholder={t(translations.User)}\r\n                      label={t(translations.User)}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                    />\r\n                  </FormRow>\r\n                  {/* FundingType */}\r\n                  {fundingTypeVisible && (\r\n                    <FormRow>\r\n                      <FormFundingTypePicker\r\n                        name=\"FundingType\"\r\n                        label={t(translations.FundingType)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          (isEdit && !initialValues.Manual)\r\n                        }\r\n                        onChange={value => {\r\n                          formik.setValues(\r\n                            produce(values => {\r\n                              // clear budget selection when funding type is changed to an incompatible value\r\n                              // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n                              if (\r\n                                (value as Entity<number>).Id !==\r\n                                (values.Budget as IBudgetFilterDto)\r\n                                  ?.FundingTypeId\r\n                              ) {\r\n                                values.Budget = null;\r\n                              }\r\n                              values.FundingType = value;\r\n                            }),\r\n                          );\r\n                        }}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  )}\r\n                  {/* Budget */}\r\n                  {IsModuleEnabled(appSettings, KnownModules.Budgets) && (\r\n                    <FormRow fullRow>\r\n                      <FormBudgetPicker\r\n                        onChange={val => {\r\n                          if (!userGroupByBudeget && val && val.UserGroupId) {\r\n                            formik.getFieldHelpers('UserGroup').setValue(\r\n                              {\r\n                                Id: val.UserGroupId,\r\n                                Name: val.UserGroup,\r\n                              },\r\n                              true,\r\n                            );\r\n                          }\r\n                        }}\r\n                        name=\"Budget\"\r\n                        fullWidth\r\n                        placeholder={t(translations.Budget)}\r\n                        label={t(translations.Budget)}\r\n                        predicates={restrictedBudgetFilter({\r\n                          budgetLimitedByUsers:\r\n                            globalSettings.budgetLimitedByUsers,\r\n                          isBudgetsWithoutUserGroup:\r\n                            globalSettings.isBudgetsWithoutUserGroup,\r\n                          userGroupId: globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n                            ? undefined\r\n                            : formik.values.UserGroup?.Id,\r\n                          serviceGroupId: formik.values.ServiceGroup?.Id,\r\n                          services: formik.values.Resource\r\n                            ? [\r\n                                {\r\n                                  Id: formik.values.Resource.Id,\r\n                                  Name: formik.values.Resource.Name,\r\n                                  ServiceTypeId: 1,\r\n                                  ServiceGroupId:\r\n                                    formik.values.ServiceGroup?.Id ?? null,\r\n                                } as IServiceTypeFilterDto,\r\n                              ]\r\n                            : formik.values.OtherService\r\n                            ? [\r\n                                {\r\n                                  Id: formik.values.OtherService.Id,\r\n                                  Name: formik.values.OtherService.Name,\r\n                                  ServiceTypeId: 2,\r\n                                  ServiceGroupId:\r\n                                    formik.values.ServiceGroup?.Id ?? null,\r\n                                } as IServiceTypeFilterDto,\r\n                              ]\r\n                            : formik.values.SampleType\r\n                            ? [\r\n                                {\r\n                                  Id: formik.values.SampleType.Id,\r\n                                  Name: formik.values.SampleType.Name,\r\n                                  ServiceTypeId: 3,\r\n                                  ServiceGroupId:\r\n                                    formik.values.ServiceGroup?.Id ?? null,\r\n                                } as IServiceTypeFilterDto,\r\n                              ]\r\n                            : undefined,\r\n                          startTime: !!formik.values.Date\r\n                            ? dateUtils.dateOrStringToDate(formik.values.Date)\r\n                            : undefined,\r\n                          endTime: !!formik.values.Date\r\n                            ? dateUtils.dateOrStringToDate(formik.values.Date)\r\n                            : undefined,\r\n                          user: formik.values.User?.Id ?? authenticatedUser?.Id,\r\n                          defaultBudgetEnabled:\r\n                            globalSettings.defaultBudgetEnabled,\r\n                          userDefaultBudgetEnabled:\r\n                            globalSettings.userDefaultBudgetEnabled,\r\n                          hideNonDefaultBudgets:\r\n                            globalSettings.hideNonDefaultBudgets,\r\n                          // funding type is set to Internal by default even if it's not in use\r\n                          fundingType: fundingTypeVisible\r\n                            ? formik.values.FundingType\r\n                            : null,\r\n                        })}\r\n                        disabled={\r\n                          (initialValues.Budget !== null && budgetOnly) ||\r\n                          (isEdit && !initialValues.Manual)\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                  )}\r\n                  {/* PurchaseOrder */}\r\n                  {fundingTypeVisible &&\r\n                    ((formik.values.Budget as IBudgetFilterDto)\r\n                      ?.PurchaseOrderOptionId ??\r\n                      PurchaseOrderOptions.Hidden) !==\r\n                      PurchaseOrderOptions.Hidden && (\r\n                      <FormRow>\r\n                        <FormTextField\r\n                          name=\"PurchaseOrder\"\r\n                          label={t(translations.PurchaseOrder)}\r\n                          disabled={\r\n                            formik.isSubmitting ||\r\n                            (isEdit && !initialValues.Manual)\r\n                          }\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n\r\n                  {/* Quantity */}\r\n                  {onlyManual && (\r\n                    <>\r\n                      <FormRow fullRow>\r\n                        <FormNumberField\r\n                          placeholder={t(translations.Quantity)}\r\n                          label={t(translations.Quantity)}\r\n                          name=\"Quantity\"\r\n                          id=\"quantity_Id\"\r\n                          fullWidth\r\n                          onChange={v =>\r\n                            setAmount(\r\n                              +formik\r\n                                .getFieldMeta<number>('Rate')\r\n                                .value.toFixed(2),\r\n                              +v.target.value,\r\n                            )\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                      {/* Rate */}\r\n                      <FormRow fullRow>\r\n                        <FormNumberField\r\n                          placeholder={t(translations.BaseRate)}\r\n                          label={t(translations.BaseRate)}\r\n                          name=\"Rate\"\r\n                          id=\"rate_Id\"\r\n                          fullWidth\r\n                          onChange={v =>\r\n                            setAmount(\r\n                              +v.target.value,\r\n                              +formik\r\n                                .getFieldMeta<number>('Quantity')\r\n                                .value.toFixed(2),\r\n                            )\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                    </>\r\n                  )}\r\n                  {/* Amount */}\r\n                  <FormRow fullRow>\r\n                    <FormNumberField\r\n                      placeholder={t(translations.Amount)}\r\n                      label={t(translations.Amount)}\r\n                      name=\"Amount\"\r\n                      id=\"amount_Id\"\r\n                      fullWidth\r\n                      onChange={v => {\r\n                        formik.getFieldHelpers('Quantity').setValue(1, false);\r\n                        formik\r\n                          .getFieldHelpers('Rate')\r\n                          .setValue(+v.target.value, true);\r\n                      }}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                    />\r\n                  </FormRow>\r\n\r\n                  {/* Resource */}\r\n                  <FormRow fullRow>\r\n                    <FormOnlineServicesSinglePicker\r\n                      name=\"Resource\"\r\n                      fullWidth\r\n                      placeholder={t(translations.Equipment)}\r\n                      label={t(translations.Equipment)}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                      predicates={ServiceGroupFilter(\r\n                        formik.values.ServiceGroup?.Id,\r\n                      )}\r\n                    />\r\n                  </FormRow>\r\n                  {/* OtherService */}\r\n                  <FormRow fullRow>\r\n                    <FormOfflineServicePicker\r\n                      serviceGroupId={formik.values.ServiceGroup?.Id}\r\n                      name=\"OtherService\"\r\n                      fullWidth\r\n                      placeholder={t(translations.OfflineServiceType)}\r\n                      label={t(translations.OfflineServiceType)}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                      variant=\"filled\"\r\n                    />\r\n                  </FormRow>\r\n                  {/* SampleType */}\r\n                  <FormRow fullRow>\r\n                    <FormSampleTypePicker\r\n                      serviceGroupId={formik.values.ServiceGroup?.Id}\r\n                      name=\"SampleType\"\r\n                      fullWidth\r\n                      placeholder={t(translations.SampleType)}\r\n                      label={t(translations.SampleType)}\r\n                      disabled={isEdit && !initialValues.Manual}\r\n                      variant=\"filled\"\r\n                    />\r\n                  </FormRow>\r\n\r\n                  {/* Remarks */}\r\n                  <FormRow>\r\n                    <FormRichTextField\r\n                      id=\"RemarksID\"\r\n                      fullWidth\r\n                      name=\"Remarks\"\r\n                      label={t(translations.Remarks)}\r\n                      disabled={formik.isSubmitting}\r\n                    />\r\n                  </FormRow>\r\n                </FormFieldsSection>\r\n                {insertedAt && (\r\n                  <FormRow fullRow>\r\n                    <InputLabel size=\"xs\">\r\n                      {t(translations.InsertedAt)}\r\n                    </InputLabel>\r\n                    {dateUtils.shortDateTimeFormat(insertedAt)}\r\n                  </FormRow>\r\n                )}\r\n                {insertedBy && (\r\n                  <FormRow fullRow>\r\n                    <InputLabel size=\"xs\">\r\n                      {t(translations.InsertedBy)}\r\n                    </InputLabel>\r\n                    {insertedBy}\r\n                  </FormRow>\r\n                )}\r\n              </FormLeftSection>\r\n            </StyledForm>\r\n          );\r\n        }}\r\n      </Formik>\r\n    );\r\n  };\r\n  const leftActions = [\r\n    () => (\r\n      <>\r\n        <Button\r\n          onClick={() => submitRef.current?.()}\r\n          size=\"small\"\r\n          disabled={busy}\r\n        >\r\n          {t(translations.Submit)}\r\n        </Button>\r\n      </>\r\n    ),\r\n  ];\r\n  const rightActions = [\r\n    () => (\r\n      <>\r\n        <Button\r\n          variant=\"ghost\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={close}\r\n          size=\"small\"\r\n          disabled={busy}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </>\r\n    ),\r\n  ];\r\n  return (\r\n    <PageWrapper\r\n      id=\"add_charge_page\"\r\n      loading={busy}\r\n      titlePage={\r\n        isEdit\r\n          ? `${t(translations.Charge)} #${props.rowId}`\r\n          : t(translations.AddManualInvoiceLine)\r\n      }\r\n      closable={true}\r\n      useSidePanel={true}\r\n      children={<ChargeForm />}\r\n      leftActions={leftActions}\r\n      rightActions={rightActions}\r\n      disableExpandToggle={true}\r\n      closeSidePanel={() => {\r\n        if (hasChanges) {\r\n          dispatch(actions.setConfirmOpen(true));\r\n        } else {\r\n          dispatch(actions.resetSidePanel());\r\n        }\r\n      }}\r\n      isCover={props.isCover}\r\n      closeCover={props.closeCover}\r\n    />\r\n  );\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport {\r\n  FeeTypeEntitySchema,\r\n  OfflineServiceTypeEntitySchema,\r\n  OnlineServiceEntitySchema,\r\n  UserEntitySchema,\r\n  UserGroupEntitySchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { InvoiceChildRowBaseSchema } from 'app/components/Forms/Schemas/InvoiceChildRowBaseSchema';\r\nimport { CatRateTypes } from 'enums/CatRateTypes';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\nimport { ICharge } from '../AddChargePage/ICharge';\r\nimport { GlobalSettingsType } from '../ReservationDetails/Details/components/useGlobalSettingsHook';\r\n\r\nexport function GetChargeSchema(\r\n  t: TFunction,\r\n  isEdit: boolean,\r\n  globalSettings: GlobalSettingsType,\r\n): Yup.SchemaOf<ICharge> {\r\n  const result = InvoiceChildRowBaseSchema(t).concat(\r\n    Yup.object({\r\n      User: UserEntitySchema.nullable().notRequired(),\r\n      Resource: OnlineServiceEntitySchema.notRequired().nullable(),\r\n      OtherService: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n      UserGroup: UserGroupEntitySchema.nullable().when(\r\n        'User',\r\n        (_, schema: Yup.SchemaOf<Entity<string>>) =>\r\n          isEdit ? schema.notRequired() : schema.required(),\r\n      ),\r\n      SampleType: OfflineServiceTypeEntitySchema.notRequired().nullable(),\r\n      FeeType: FeeTypeEntitySchema.required().nullable(),\r\n      Quantity: Yup.number().defined(),\r\n      Rate: Yup.number()\r\n        .defined()\r\n        .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n          return (catRateType as Entity<number>)?.Id === CatRateTypes.Refund ||\r\n            (catRateType as Entity<number>)?.Id === CatRateTypes.Discount\r\n            ? schema.negative().max(0)\r\n            : schema.positive().min(0);\r\n        }),\r\n      Amount: Yup.number()\r\n        .defined()\r\n        .when('FeeType', (catRateType, schema: Yup.NumberSchema) => {\r\n          return (catRateType as Entity<number>)?.Id === CatRateTypes.Refund ||\r\n            (catRateType as Entity<number>)?.Id === CatRateTypes.Discount\r\n            ? schema.negative().max(0)\r\n            : schema.positive().min(0);\r\n        }),\r\n      Manual: Yup.bool().notRequired(),\r\n      ActualRate: Yup.number().notRequired(),\r\n      Remarks: Yup.string().nullable().default('').notRequired(),\r\n      FundingType: Yup.mixed().label(t(translations.FundingType) as string),\r\n      PurchaseOrder: Yup.string()\r\n        .label(t(translations.PurchaseOrder) as string)\r\n        .nullable(true)\r\n        .min(globalSettings.purchaseOrderLengthSetting ?? 0)\r\n        .when('Budget', {\r\n          is: budget => {\r\n            const result =\r\n              globalSettings.purchaseOrderBudgetEnabled &&\r\n              (budget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n                PurchaseOrderOptions.Mandatory;\r\n            return result;\r\n          },\r\n          then: schema => schema.required(),\r\n        }),\r\n    }),\r\n  );\r\n  return result;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for LabelTypePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelTypePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LabelTypeEdit,\r\n);\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectArticleDetailsForm } from '../slice/selectors';\r\n\r\nexport type AllowedToChangeStatusFunc = (asset: IAssetDto) => boolean;\r\nexport const useAllowedToChangeStatus = (): AllowedToChangeStatusFunc => {\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const admin = authenticatedUser?.Roles.includes(Roles.GroupAdministrators);\r\n  const readOnlyUser =\r\n    authenticatedUser?.Roles.includes(Roles.Readonly) ||\r\n    authenticatedUser?.Roles.includes(Roles.CalendarOnly);\r\n  const allowedToChangeStatus = React.useCallback(\r\n    asset => {\r\n      if (admin && asset !== undefined && asset !== null && !readOnlyUser) {\r\n        return asset.ServiceGroupId !== null &&\r\n          asset.ServiceGroupId !== undefined &&\r\n          (authenticatedUser?.HasAdminGroupOnlyPermissions(\r\n            asset.ServiceGroupId,\r\n          ) ||\r\n            authenticatedUser?.HasLabTechGroupPermissions(asset.ServiceGroupId))\r\n          ? true\r\n          : false;\r\n      } else {\r\n        return false;\r\n      }\r\n    },\r\n    [admin, authenticatedUser, readOnlyUser],\r\n  );\r\n  return allowedToChangeStatus;\r\n};\r\n\r\nexport const useCanEdit = (): [boolean, string] => {\r\n  const { t } = useTranslation();\r\n  const articleDetailsForm = useSelector(selectArticleDetailsForm);\r\n  const allowedToChangeStatus = useAllowedToChangeStatus();\r\n  if (allowedToChangeStatus(articleDetailsForm?.ServiceGroupAssets[0])) {\r\n    return [true, ''];\r\n  } else {\r\n    // simple user rights\r\n    if (articleDetailsForm?.CreatedByMe) {\r\n      if (articleDetailsForm?.Status === ArticleStatus.Approved) {\r\n        return [false, t(translations.PublicationRecordApproved_info)];\r\n      } else {\r\n        return [true, ''];\r\n      }\r\n    } else {\r\n      return [false, ''];\r\n    }\r\n  }\r\n};\r\n\r\nexport const useCanAdd = (): boolean => {\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const readOnlyUser =\r\n    authenticatedUser?.Roles.includes(Roles.Readonly) ||\r\n    authenticatedUser?.Roles.includes(Roles.CalendarOnly);\r\n  return !readOnlyUser;\r\n};\r\n","/**\r\n *\r\n * ArticleDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useArticlesSlice } from 'app/pages/ArticlesPage/slice';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport {\r\n  selectArticleDetails,\r\n  selectArticleDetailsBusy,\r\n  selectArticleDetailsForm,\r\n  selectRefreshEditArticleAssociation,\r\n} from 'app/pages/ArticlesPage/slice/selectors';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { useCanAdd, useCanEdit } from '../Hooks/useAllowedToChangeStatus';\r\nimport { WorkOrderLink } from 'app/pages/Actions/GlobalSelectedActions/OpenWorkOrder';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { selectDoRefreshTable } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { GhostInput } from 'app/components/BasicInputs/GhostInput';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { ArticleDoiLink } from '../ArticleDoiLink';\r\n\r\nexport interface ArticleDetailsProps extends SidePanelContentProps, CoverProps {\r\n  value?: IArticleDto;\r\n  Id?: number;\r\n  externalId?: string;\r\n  externalIdSource?: string;\r\n  onClose?: () => void;\r\n}\r\n\r\nexport function ArticleDetails({\r\n  useSidePanel = true,\r\n  closeCover,\r\n  isCover,\r\n  ...props\r\n}: ArticleDetailsProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useArticlesSlice();\r\n  const selectedArticle = useSelector(selectArticleDetails);\r\n  const articleDetails = useSelector(selectArticleDetailsForm);\r\n  const refreshDetails = useSelector(selectRefreshEditArticleAssociation);\r\n  const busy = useSelector(selectArticleDetailsBusy);\r\n  const refresh = useSelector(selectDoRefreshTable);\r\n\r\n  const isSaved = React.useMemo(() => {\r\n    return articleDetails?.Id !== undefined && articleDetails?.Id > 0;\r\n  }, [articleDetails?.Id]);\r\n  const [canEdit, msg] = useCanEdit();\r\n  const canAdd = useCanAdd();\r\n\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n\r\n    if (active && !busy) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.showDetails({\r\n          Id: props.Id,\r\n          externalId: props.externalId,\r\n          externalIdSource: props.externalIdSource,\r\n          article: props.value,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    busy,\r\n    dispatch,\r\n    firstLoad,\r\n    props.Id,\r\n    props.externalId,\r\n    props.externalIdSource,\r\n    props.value,\r\n    refresh,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = refreshDetails === true;\r\n\r\n    if (active && !busy) {\r\n      dispatch(\r\n        actions.showDetails({\r\n          Id: selectedArticle?.Id,\r\n          externalId: selectedArticle?.ExternalId ?? undefined,\r\n          externalIdSource: selectedArticle?.ExternalIdSource ?? undefined,\r\n          article: selectedArticle,\r\n        }),\r\n      );\r\n      dispatch(actions.refreshEditArticleAssociation(undefined));\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actions, busy, dispatch, refreshDetails, selectedArticle]);\r\n\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(() => false, undefined, isCover, useSidePanel);\r\n  const openExternalEntry = React.useCallback(\r\n    (article: IArticleDto | undefined) => {\r\n      openPanel({\r\n        renderPageType: RenderPageType.ArticleEdit,\r\n        renderPageProps: {\r\n          useSidePanel: true,\r\n          value: article,\r\n        },\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const editArticle = React.useCallback(() => {\r\n    openPanel({\r\n      renderPageType: RenderPageType.ArticleForm,\r\n      renderPageProps: {\r\n        useSidePanel: true,\r\n      },\r\n      expanded: false,\r\n      useSidePanel: useSidePanel,\r\n      isCover: useSidePanel,\r\n    } as SidePanelOpenState);\r\n  }, [openPanel, useSidePanel]);\r\n  // const setCover = React.useCallback(\r\n  //   showCover => {\r\n  //     if (\r\n  //       selectedArticle !== undefined &&\r\n  //       selectedArticle.ExternalIdSource === 'Manual Entry'\r\n  //     ) {\r\n  //       const sidePanelProps: EditArticleDetailsFormProps = {\r\n  //         useSidePanel: true,\r\n  //         value: selectedArticle,\r\n  //       };\r\n  //       dispatch(\r\n  //         layoutActions.openSidePanel({\r\n  //           type: RenderPageType.ArticleEdit,\r\n  //           props: sidePanelProps,\r\n  //         }),\r\n  //       );\r\n  //     } else {\r\n  //       dispatch(actions.showEditArticleAssociation(showCover));\r\n  //     }\r\n  //   },\r\n  //   [actions, dispatch, selectedArticle],\r\n  // );\r\n  // const showEditArticle = useSelector(selectShowEditArticleAssociation);\r\n\r\n  //CSS\r\n  /*const useStyles = makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      articleLabelColorPaddingTop: {\r\n        color: 'grey',\r\n        paddingTop: '10px',\r\n      },\r\n      articleValueLabelBold: {\r\n        fontWeight: 'bold',\r\n      },\r\n    }),\r\n  );*/\r\n  //const classes = useStyles();\r\n  const handleCancelClick = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: isCover,\r\n      useSidePanel: useSidePanel,\r\n      showConfirm: false,\r\n      onClose: () => {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n      },\r\n    } as SidePanelCloseState);\r\n  }, [closePanel, dispatch, isCover, useSidePanel]);\r\n  const isEmpty = React.useCallback(value => {\r\n    if (value === undefined || value === null) {\r\n      return true;\r\n    } else {\r\n      if (typeof value === 'string') {\r\n        const res = value.trim();\r\n        return res !== '' ? false : true;\r\n      } else {\r\n        return false;\r\n      }\r\n    }\r\n  }, []);\r\n  const getValue = React.useCallback(\r\n    value => {\r\n      if (value === undefined || value === null) {\r\n        return t(translations.NA);\r\n      } else {\r\n        if (typeof value === 'string') {\r\n          const res = value.trim();\r\n          return res !== '' ? res : t(translations.NA);\r\n        } else {\r\n          return value;\r\n        }\r\n      }\r\n    },\r\n    [t],\r\n  );\r\n  return (\r\n    <PageWrapper\r\n      pageName={t(translations.PublicationDetails)}\r\n      titlePage={articleDetails.Title ?? undefined}\r\n      useSidePanel={true}\r\n      closable={true}\r\n      closeSidePanel={handleCancelClick}\r\n      //loading={busy}\r\n      topProcessing={busy}\r\n      leftTopActions={\r\n        (selectedArticle !== undefined && selectedArticle.Id > 0 && canEdit) ||\r\n        (selectedArticle !== undefined &&\r\n          selectedArticle.Id === 0 &&\r\n          !busy &&\r\n          canAdd)\r\n          ? [\r\n              () => (\r\n                <>\r\n                  <EditAssociationButton\r\n                    item={selectedArticle}\r\n                    onClick={() =>\r\n                      selectedArticle !== undefined &&\r\n                      selectedArticle.ExternalIdSource === 'Manual Entry'\r\n                        ? openExternalEntry(selectedArticle)\r\n                        : editArticle()\r\n                    }\r\n                    disabled={!canEdit}\r\n                  />\r\n                </>\r\n              ),\r\n            ]\r\n          : undefined\r\n      }\r\n      // cover={\r\n      //   cover\r\n      //   // && <ArticleAssociationForm closeCover={() => setCover(false)} />\r\n      // }\r\n      cover={cover}\r\n      closeCover={!isCover ? onCloseCover : closeCover}\r\n      isCover={isCover}\r\n      coverClosed={coverClosed}\r\n      useSwitchActions={true}\r\n    >\r\n      <StyledFormFieldsContainer isCover={isCover}>\r\n        <FormLeftSection isCover={isCover}>\r\n          <FormFieldsSection>\r\n            {/*<Box height={'100%'} p={1}>\r\n            <Grid\r\n              container\r\n              direction=\"row\"\r\n              justify=\"space-around\"\r\n              spacing={0}\r\n              style={{ paddingBottom: '5px', paddingTop: '5px' }}\r\n            >\r\n              {msg !== '' && (\r\n                <Grid\r\n                  item\r\n                  xs={12}\r\n                  className={classes.articleLabelColorPaddingTop}\r\n                >\r\n                  <InputLabel size=\"xs\">{msg}</InputLabel>\r\n                </Grid>\r\n              )}\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.Title)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.Title} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.Abstract)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.Abstract} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.Authors)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.Authors?.join(', ')} />\r\n              </Grid>\r\n              {!isNullOrUndefined(articleDetails.ExternalIdSource) && (\r\n                <>\r\n                  <Grid\r\n                    item\r\n                    xs={12}\r\n                    className={classes.articleLabelColorPaddingTop}\r\n                  >\r\n                    <InputLabel size=\"xs\">{t(translations.Source)}</InputLabel>\r\n                  </Grid>\r\n                  <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                    <ValueLabel value={articleDetails.ExternalIdSource} />\r\n                  </Grid>\r\n                </>\r\n              )}\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.EnteredBy)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.UserDisplayName} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.InsertedAt)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <DateTimeLabel value={articleDetails.EnteredAt ?? null} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.Doi)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ArticleDoiLink doi={articleDetails.Doi} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">\r\n                  {t(translations.ArticleDataset)}\r\n                </InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ArticleDatasetLink dataset={articleDetails.Dataset} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.ISSN)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.ISSN} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.ORCID)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.ORCIDs?.join(', ')} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.Year)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.Year} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">\r\n                  {t(translations.ArticleStatus)}\r\n                </InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel\r\n                  value={\r\n                    articleDetails.Status !== undefined\r\n                      ? (t(\r\n                          'Article' + ArticleStatus[articleDetails.Status],\r\n                        ) as string)\r\n                      : 'undefined'\r\n                  }\r\n                />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.RelatedUser)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.RelatedUserDisplayName} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">\r\n                  {t(translations.CalibrationRecord)}\r\n                </InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                {articleDetails.CalibrationRecord !== undefined &&\r\n                  articleDetails.CalibrationRecord !== null && (\r\n                    <WorkOrderLink\r\n                      id={articleDetails.CalibrationRecord}\r\n                      useSidePanel={true}\r\n                      openPanelWithCover={openPanel}\r\n                      //openPanelWithCover={openPanel}\r\n                    >\r\n                      {articleDetails.CalibrationRecord}\r\n                    </WorkOrderLink>\r\n                  )}\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">{t(translations.Journal)}</InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.Journal} />\r\n              </Grid>\r\n              <Grid\r\n                item\r\n                xs={12}\r\n                className={classes.articleLabelColorPaddingTop}\r\n              >\r\n                <InputLabel size=\"xs\">\r\n                  {t(translations.ArticlePageNumber)}\r\n                </InputLabel>\r\n              </Grid>\r\n              <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                <ValueLabel value={articleDetails.PageNumber} />\r\n              </Grid>\r\n              {isSaved && (\r\n                <>\r\n                  <Grid\r\n                    item\r\n                    xs={12}\r\n                    className={classes.articleLabelColorPaddingTop}\r\n                  >\r\n                    <InputLabel size=\"xs\">\r\n                      {t(translations.ParticipatedLabs)}\r\n                    </InputLabel>\r\n                  </Grid>\r\n                  <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                    {articleDetails.ServiceGroupAssets.length === 0 ? (\r\n                      t(translations.NA)\r\n                    ) : (\r\n                      <ul>\r\n                        {articleDetails.ServiceGroupAssets.map(asset => (\r\n                          <li key={asset.Id}>\r\n                            <AssetLink\r\n                              openPanelWithCover={openPanel}\r\n                              useSidePanel={true}\r\n                              id={asset.Id}\r\n                            >\r\n                              {asset.Name}\r\n                            </AssetLink>\r\n                          </li>\r\n                        ))}\r\n                      </ul>\r\n                    )}\r\n                  </Grid>\r\n                  <Grid\r\n                    item\r\n                    xs={12}\r\n                    className={classes.articleLabelColorPaddingTop}\r\n                  >\r\n                    <InputLabel size=\"xs\">\r\n                      {t(translations.ParticipatedInstruments)}\r\n                    </InputLabel>\r\n                  </Grid>\r\n                  <Grid item xs={12} className={classes.articleValueLabelBold}>\r\n                    {articleDetails.InstrumentAssets.length === 0 ? (\r\n                      t(translations.NA)\r\n                    ) : (\r\n                      <ul>\r\n                        {articleDetails.InstrumentAssets.map(asset => (\r\n                          <li key={asset.Id}>\r\n                            <AssetLink\r\n                              openPanelWithCover={openPanel}\r\n                              useSidePanel={true}\r\n                              id={asset.Id}\r\n                            >\r\n                              {asset.Name}\r\n                            </AssetLink>\r\n                          </li>\r\n                        ))}\r\n                      </ul>\r\n                    )}\r\n                  </Grid>\r\n                </>\r\n              )}\r\n            </Grid>\r\n          </Box>*/}\r\n            {msg !== '' && (\r\n              <FormRow>\r\n                <InputLabel size=\"xs\">{msg}</InputLabel>\r\n              </FormRow>\r\n            )}\r\n\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.Authors)}\r\n                valueText={getValue(articleDetails.Authors?.join(', '))}\r\n              />\r\n            </FormRow>\r\n            {!isNullOrUndefined(articleDetails.ExternalIdSource) && (\r\n              <>\r\n                <FormRow>\r\n                  <GhostInput\r\n                    labelBolder\r\n                    label={t(translations.Source)}\r\n                    valueText={getValue(articleDetails.ExternalIdSource)}\r\n                  />\r\n                </FormRow>\r\n              </>\r\n            )}\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.EnteredBy)}\r\n                valueText={getValue(articleDetails.UserDisplayName)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.InsertedAt)}\r\n                valueText={\r\n                  articleDetails.EnteredAt !== undefined &&\r\n                  articleDetails.EnteredAt !== null ? (\r\n                    <DateTimeLabel value={articleDetails.EnteredAt ?? null} />\r\n                  ) : (\r\n                    t(translations.NA)\r\n                  )\r\n                }\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.Doi)}\r\n                valueText={\r\n                  isEmpty(articleDetails.Doi) === false ? (\r\n                    <ArticleDoiLink doi={articleDetails.Doi} />\r\n                  ) : (\r\n                    t(translations.NA)\r\n                  )\r\n                }\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.ArticleDataset)}\r\n                valueText={getValue(articleDetails.Dataset)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.ISSN)}\r\n                valueText={getValue(articleDetails.ISSN)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.ORCID)}\r\n                valueText={getValue(articleDetails.ORCIDs?.join(', '))}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.Year)}\r\n                valueText={getValue(articleDetails.Year)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.ArticleStatus)}\r\n                valueText={\r\n                  articleDetails.Status !== undefined\r\n                    ? (t(\r\n                        'Article' + ArticleStatus[articleDetails.Status],\r\n                      ) as string)\r\n                    : 'undefined'\r\n                }\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.RelatedUser)}\r\n                valueText={getValue(articleDetails.RelatedUserDisplayName)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.CalibrationRecord)}\r\n                valueText={\r\n                  articleDetails.CalibrationRecord !== undefined &&\r\n                  articleDetails.CalibrationRecord !== null ? (\r\n                    <WorkOrderLink\r\n                      id={articleDetails.CalibrationRecord}\r\n                      useSidePanel={true}\r\n                      openPanelWithCover={openPanel}\r\n                      //openPanelWithCover={openPanel}\r\n                    >\r\n                      {articleDetails.CalibrationRecord}\r\n                    </WorkOrderLink>\r\n                  ) : (\r\n                    t(translations.NA)\r\n                  )\r\n                }\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.Journal)}\r\n                valueText={getValue(articleDetails.Journal)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.ArticlePageNumber)}\r\n                valueText={getValue(articleDetails.PageNumber)}\r\n              />\r\n            </FormRow>\r\n            {isSaved && (\r\n              <>\r\n                <FormRow>\r\n                  <GhostInput\r\n                    labelBolder\r\n                    label={t(translations.ParticipatedLabs)}\r\n                    valueText={\r\n                      articleDetails.ServiceGroupAssets.length === 0 ? (\r\n                        t(translations.NA)\r\n                      ) : (\r\n                        <ul>\r\n                          {articleDetails.ServiceGroupAssets.map(asset => (\r\n                            <li key={asset.Id}>\r\n                              <AssetLink\r\n                                openPanelWithCover={openPanel}\r\n                                useSidePanel={true}\r\n                                id={asset.Id}\r\n                              >\r\n                                {asset.Name}\r\n                              </AssetLink>\r\n                            </li>\r\n                          ))}\r\n                        </ul>\r\n                      )\r\n                    }\r\n                  />\r\n                </FormRow>\r\n                <FormRow>\r\n                  <GhostInput\r\n                    labelBolder\r\n                    label={t(translations.ParticipatedInstruments)}\r\n                    valueText={\r\n                      articleDetails.InstrumentAssets.length === 0 ? (\r\n                        t(translations.NA)\r\n                      ) : (\r\n                        <ul>\r\n                          {articleDetails.InstrumentAssets.map(asset => (\r\n                            <li key={asset.Id}>\r\n                              <AssetLink\r\n                                openPanelWithCover={openPanel}\r\n                                useSidePanel={true}\r\n                                id={asset.Id}\r\n                              >\r\n                                {asset.Name}\r\n                              </AssetLink>\r\n                            </li>\r\n                          ))}\r\n                        </ul>\r\n                      )\r\n                    }\r\n                  />\r\n                </FormRow>\r\n              </>\r\n            )}\r\n          </FormFieldsSection>\r\n        </FormLeftSection>\r\n        <FormRightSection isCover={isCover}>\r\n          <FormFieldsSection>\r\n            <FormRow>\r\n              <GhostInput\r\n                labelBolder\r\n                label={t(translations.Abstract)}\r\n                valueText={getValue(articleDetails.Abstract)}\r\n              />\r\n            </FormRow>\r\n          </FormFieldsSection>\r\n        </FormRightSection>\r\n      </StyledFormFieldsContainer>\r\n    </PageWrapper>\r\n  );\r\n}\r\nfunction EditAssociationButton({\r\n  item,\r\n  onClick,\r\n  disabled,\r\n}: {\r\n  item?: IArticleDto;\r\n  onClick: () => void;\r\n  disabled: boolean;\r\n}) {\r\n  const { t } = useTranslation();\r\n  //const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  if (item === undefined) {\r\n    return <></>;\r\n  }\r\n  /*const show =\r\n    authenticatedUser?.Roles?.includes(Roles.GroupAdministrators) === true;\r\n  if (!show) {\r\n    return <></>;\r\n  }*/\r\n  if (item.Id > 0) {\r\n    if (item.ExternalIdSource === 'Manual Entry') {\r\n      return (\r\n        <Button\r\n          title={t(translations.EditArticle)}\r\n          startIcon={<Icon icon=\"edit\" />}\r\n          onClick={onClick}\r\n          disabled={disabled}\r\n        >\r\n          {t(translations.EditArticle)}\r\n        </Button>\r\n      );\r\n    } else {\r\n      return (\r\n        <Button\r\n          title={t(translations.EditAssociation)}\r\n          startIcon={<Icon icon=\"edit\" />}\r\n          onClick={onClick}\r\n          disabled={disabled}\r\n        >\r\n          {t(translations.EditAssociation)}\r\n        </Button>\r\n      );\r\n    }\r\n  } else {\r\n    return (\r\n      <Button\r\n        title={t(translations.AssociateThisPublicationTitle)}\r\n        startIcon={<Icon icon=\"add\" />}\r\n        onClick={onClick}\r\n      >\r\n        {t(translations.AssociateThisPublication)}\r\n      </Button>\r\n    );\r\n  }\r\n}\r\n","/**\r\n *\r\n * AssetsPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { avTypes } from '../pickers/MultiSelectPickers/AssetsPicker/index';\r\nimport { AssetPicker } from '../pickers/AutocompletePickers/AssetPicker';\r\n\r\nexport const FormAssetPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps & {\r\n    restrictByAvType?: avTypes;\r\n    admin?: boolean;\r\n    showOnlyActiveAssets?: boolean;\r\n  }) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <AssetPicker\r\n      predicates={props.filter}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      restrictByAvType={props.restrictByAvType}\r\n      admin={props.admin}\r\n      showOnlyActiveAssets={props.showOnlyActiveAssets}\r\n      disabled={props.disabled}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      required={props.required}\r\n    />\r\n  );\r\n};\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface IArticleNewEditForm {\r\n  Title: string;\r\n  Authors: string;\r\n  Abstract: string;\r\n  Doi?: string | null;\r\n  Dataset?: string | null;\r\n  ISSN?: string | null;\r\n  ORCIDs?: string | null;\r\n  Year: number;\r\n  RelatedUser: Entity<string> | null;\r\n  ServiceGroupAsset: IAssetDto | null;\r\n  Journal?: string | null;\r\n  PageNumber?: number | null;\r\n  //ServiceGroupAssets: Array<IAssetDto>;\r\n  InstrumentAssets: Array<IAssetDto>;\r\n  Status: Entity<number>;\r\n  CalibrationRecord: Entity<number> | null;\r\n}\r\n\r\nexport const assetSchema = Yup.mixed();\r\nexport const assetsSchema = Yup.array().of(\r\n  Yup.mixed() as Yup.SchemaOf<IAssetDto>,\r\n);\r\n\r\nexport const GetInstrumentFilter = (serviceGroups: IAssetDto[]) => {\r\n  const sv = serviceGroups.filter(f => f !== null && f !== undefined);\r\n  if (sv.length > 0) {\r\n    const f = [\r\n      `(ServiceGroupId in (${sv.map(f => f.ServiceGroupId).join(',')}))`,\r\n    ];\r\n    return f;\r\n  } else {\r\n    return [];\r\n  }\r\n};\r\nexport const GetCalibrationRecordFilter = (assets: IAssetDto[]) => {\r\n  const services = assets.filter(f => f !== null && f !== undefined);\r\n  if (services.length > 0) {\r\n    const test = services.map(f => f.Id);\r\n    const test_s = test.join(',');\r\n    const f = [`(AssetId in (${test_s}))`];\r\n    return f;\r\n  } else {\r\n    return [];\r\n  }\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { FormControl } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { Entity } from 'types/common';\r\nimport CustomPickerFilter from '../BasicTable/Filters/CustomPickerFilter';\r\n\r\nexport interface FormCustomPickerProps extends IFieldProps {\r\n  data: Entity<number>[];\r\n}\r\nexport const FormCustomPicker = ({\r\n  label,\r\n  disableFuture,\r\n  disablePast,\r\n  data,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & FormCustomPickerProps) => {\r\n  const [field, , helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <FormControl fullWidth={true}>\r\n      <CustomPickerFilter\r\n        id={props.id}\r\n        name={props.name}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        value={field.value}\r\n        customData={data}\r\n        fullWidth={true}\r\n        open={false}\r\n        placeholder={props.placeholder}\r\n        disabled={props.disabled}\r\n      />\r\n    </FormControl>\r\n  );\r\n};\r\n","import {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ArticleWorkOrdersPickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url'> {}\r\n\r\nexport function ArticleWorkOrdersPicker(props: ArticleWorkOrdersPickerProps) {\r\n  return <BaseURLPicker url=\"/api/odata/v4/WorkOrders\" {...props} />;\r\n}\r\n","import { IFieldProps } from 'app/components/Forms/FormRender/IFormFieldSetting';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { ArticleWorkOrdersPicker } from '../ArticlePickers';\r\n\r\nexport const ArticleFormPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <ArticleWorkOrdersPicker\r\n        name={props.name}\r\n        queryfilter={props.filter}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * NewArticleDetailsForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport { selectEditArticleAssociationBusy } from '../slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { useArticlesSlice } from '../slice';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport { ValueLabel } from 'app/components/ValueLabel';\r\nimport {\r\n  EntityNumberSchema,\r\n  UserEntitySchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormAssetPicker } from 'app/components/Forms/FormAssetPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport {\r\n  assetSchema,\r\n  assetsSchema,\r\n  GetCalibrationRecordFilter,\r\n  GetInstrumentFilter,\r\n  IArticleNewEditForm,\r\n} from '../utils';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { FormCustomPicker } from 'app/components/Forms/FormCustomPicker';\r\nimport { Entity } from 'types/common';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useAllowedToChangeStatus } from '../Hooks/useAllowedToChangeStatus';\r\nimport { Roles } from 'app/slice/types';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ArticleFormPicker } from '../ArticleFormPickers';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface NewArticleDetailsFormProps\r\n  extends SidePanelContentProps,\r\n    CoverProps {\r\n  Journal?: string | null;\r\n  PageNumber?: number | null;\r\n}\r\n\r\nexport function NewArticleDetailsForm(props: NewArticleDetailsFormProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const [oldServiceGroups, setOldServiceGroups] = React.useState<IAssetDto[]>(\r\n    [],\r\n  );\r\n  const [serviceGroups, setServiceGroups] = React.useState<IAssetDto[]>([]);\r\n  const [instruments, setInstruments] = React.useState<IAssetDto[]>([]);\r\n\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const processing = useSelector(selectEditArticleAssociationBusy);\r\n  const admin = authenticatedUser?.Roles.includes(Roles.GroupAdministrators);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useArticlesSlice();\r\n  const [canEditStatus, setCanEditStatus] = React.useState<boolean>(false);\r\n  const allowedToChangeStatus = useAllowedToChangeStatus();\r\n  const schema: Yup.SchemaOf<IArticleNewEditForm> = Yup.object().shape(\r\n    {\r\n      Title: Yup.string().required().label(t(translations.Title)).trim(),\r\n      Authors: Yup.string().required().label(t(translations.Authors)).trim(),\r\n      Abstract: Yup.string().required().label(t(translations.Abstract)).trim(),\r\n      Doi: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.Doi))\r\n        .trim(),\r\n      Dataset: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.ArticleDataset))\r\n        .trim(),\r\n      ISSN: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.ISSN))\r\n        .trim(),\r\n      ORCIDs: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.ORCID))\r\n        .trim(),\r\n      Year: Yup.number().required().label(t(translations.Year)).min(1),\r\n      RelatedUser: UserEntitySchema.nullable().notRequired(),\r\n      CalibrationRecord: Yup.mixed().nullable().notRequired(),\r\n      /*ServiceGroupAssets: assetsSchema.when(['InstrumentAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetsSchema\r\n          .required()\r\n          .label(t(translations.ServiceGroup))\r\n          .min(1)\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),*/\r\n      ServiceGroupAsset: assetSchema.when(['InstrumentAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetSchema\r\n          .required()\r\n          .label(t(translations.ServiceGroup))\r\n          .nullable(),\r\n        otherwise: assetSchema.nullable().notRequired(),\r\n      }),\r\n      /*InstrumentAssets: assetsSchema.when(['ServiceGroupAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),*/\r\n      InstrumentAssets: assetsSchema.when(['ServiceGroupAsset'], {\r\n        is: v => v === null,\r\n        then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),\r\n      Status: EntityNumberSchema.required().label(\r\n        t(translations.ArticleStatus),\r\n      ),\r\n      Journal: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.Journal))\r\n        .trim(),\r\n      PageNumber: Yup.number(),\r\n    },\r\n    [['ServiceGroupAsset', 'InstrumentAssets']],\r\n  );\r\n  const initialValues: IArticleNewEditForm = React.useMemo(\r\n    () => ({\r\n      Title: '',\r\n      Authors: '',\r\n      Abstract: '',\r\n      Doi: null,\r\n      Dataset: null,\r\n      ISSN: null,\r\n      ORCIDs: null,\r\n      Year: 0,\r\n      RelatedUser: null,\r\n      CalibrationRecord: null,\r\n      InstrumentAssets: [],\r\n      //ServiceGroupAssets: [],\r\n      ServiceGroupAsset: null,\r\n      Status: admin\r\n        ? { Id: 1, Name: t('Article' + ArticleStatus[1]) }\r\n        : { Id: 0, Name: t('Article' + ArticleStatus[0]) },\r\n    }),\r\n    [admin, t],\r\n  );\r\n\r\n  const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState();\r\n\r\n  const handleCloseClick = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: props.isCover,\r\n      useSidePanel: props.useSidePanel,\r\n      showConfirm: undefined,\r\n      onClose: () => {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n        dispatch(actions.resetArticleAssociationState());\r\n      },\r\n    } as SidePanelCloseState);\r\n  }, [\r\n    actions,\r\n    closePanel,\r\n    dispatch,\r\n    layoutActions,\r\n    props.isCover,\r\n    props.useSidePanel,\r\n  ]);\r\n\r\n  React.useEffect(() => {\r\n    if (processing === false) {\r\n      handleCloseClick();\r\n    }\r\n    return () => undefined;\r\n  }, [processing, handleCloseClick]);\r\n\r\n  const instrumentFilter = React.useCallback(() => {\r\n    return GetInstrumentFilter(serviceGroups);\r\n  }, [serviceGroups]);\r\n  const CalibrationRecordFilter = React.useCallback(() => {\r\n    return GetCalibrationRecordFilter(instruments);\r\n  }, [instruments]);\r\n\r\n  const handleFormChange = React.useCallback(\r\n    (\r\n      values: IArticleNewEditForm,\r\n      isValid,\r\n      dirty,\r\n      setValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (\r\n        serviceGroups.length !== oldServiceGroups.length ||\r\n        serviceGroups[0] !== oldServiceGroups[0]\r\n      ) {\r\n        setOldServiceGroups(serviceGroups);\r\n        setValue('InstrumentAssets', []);\r\n        return;\r\n      }\r\n      if (\r\n        values.ServiceGroupAsset === null &&\r\n        values.InstrumentAssets.length > 0\r\n      ) {\r\n        setOldServiceGroups(serviceGroups);\r\n        setValue('ServiceGroupAsset', {\r\n          Id: values.InstrumentAssets[0].ServiceGroupAssetId,\r\n          Name: values.InstrumentAssets[0].ServiceGroupName,\r\n          ServiceGroupId: values.InstrumentAssets[0].ServiceGroupId,\r\n          ServiceGroupName: values.InstrumentAssets[0].ServiceGroupName,\r\n        });\r\n      }\r\n      setCanEditStatus(allowedToChangeStatus(serviceGroups[0]));\r\n    },\r\n    [allowedToChangeStatus, oldServiceGroups, serviceGroups],\r\n  );\r\n  const handleSubmit = React.useCallback(\r\n    (values: IArticleNewEditForm) => {\r\n      if (\r\n        //values.ServiceGroupAssets.length === 0 &&\r\n        (values.ServiceGroupAsset === null &&\r\n          values.InstrumentAssets.length === 0) ||\r\n        values.Status === null\r\n      ) {\r\n        return;\r\n      }\r\n      const payload: IArticleDto = {\r\n        Id: 0,\r\n        Title: values.Title.trim(),\r\n        Authors: values.Authors.trim().split(','),\r\n        Abstract: values.Abstract.trim(),\r\n        Year: values.Year,\r\n        ExternalId: null,\r\n        ExternalIdSource: 'Manual Entry',\r\n        Doi:\r\n          values.Doi !== undefined && values.Doi !== null\r\n            ? values.Doi.trim()\r\n            : null,\r\n        Dataset:\r\n          values.Dataset !== undefined && values.Dataset !== null\r\n            ? values.Dataset.trim()\r\n            : null,\r\n        ISSN:\r\n          values.ISSN !== undefined && values.ISSN !== null\r\n            ? values.ISSN.trim()\r\n            : null,\r\n        Journal: values.Journal !== undefined ? values.Journal : null,\r\n        PageNumber: values.PageNumber !== undefined ? values.PageNumber : null,\r\n        ORCIDs:\r\n          values.ORCIDs !== undefined && values.ORCIDs !== null\r\n            ? values.ORCIDs.trim().split(',')\r\n            : [],\r\n        ArticleContributionLevelId: null,\r\n        FirstInstrumentAssetName: null,\r\n        FirstServiceGroupAssetName: null,\r\n        ...{\r\n          //Assets: values.ServiceGroupAssets.concat(values.InstrumentAssets),\r\n          Assets:\r\n            values.ServiceGroupAsset !== null\r\n              ? values.InstrumentAssets.concat([values.ServiceGroupAsset])\r\n              : values.InstrumentAssets,\r\n        },\r\n        Status: values.Status.Id,\r\n        EnteredBy: null,\r\n        UserDisplayName: null,\r\n        EnteredAt: null,\r\n        RelatedUser:\r\n          values.RelatedUser !== null ? values.RelatedUser?.Id : null,\r\n        RelatedUserDisplayName: null,\r\n        CalibrationRecord:\r\n          values.CalibrationRecord !== null\r\n            ? values.CalibrationRecord?.Id\r\n            : null,\r\n        CalibrationRecordName: null,\r\n        UserGroupId: null,\r\n        UserGroupName: null,\r\n        DepartmentId: null,\r\n        DepartmentName: null,\r\n        InstituteId: null,\r\n        InstituteName: null,\r\n        InstituteTypeId: null,\r\n        InstituteTypeName: null,\r\n        CreatedByMe: false,\r\n      };\r\n      dispatch(actions.saveArticleAssociation(payload));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n\r\n  const statusPickerData: Entity<number>[] = React.useMemo(() => {\r\n    const data = [\r\n      {\r\n        Id: ArticleStatus.AwaitingApproval,\r\n        Name: t('Article' + ArticleStatus[ArticleStatus.AwaitingApproval]),\r\n      },\r\n      {\r\n        Id: ArticleStatus.Approved,\r\n        Name: t('Article' + ArticleStatus[ArticleStatus.Approved]),\r\n      },\r\n    ] as Entity<number>[];\r\n    return data;\r\n  }, [t]);\r\n\r\n  return (\r\n    <PageWrapper\r\n      useSidePanel={true}\r\n      closable={true}\r\n      disableExpandToggle={true}\r\n      pageName={t(translations.AddPublication)}\r\n      titlePage={t(translations.AddPublication)}\r\n      titleTooltip={t(translations.AddPublication)}\r\n      closeSidePanel={handleCloseClick}\r\n      topProcessing={processing}\r\n      cover={cover}\r\n      closeCover={!props.isCover ? onCloseCover : props.closeCover}\r\n      isCover={props.isCover}\r\n      coverClosed={coverClosed}\r\n    >\r\n      <Box height={'100%'} p={1}>\r\n        <Formik\r\n          initialValues={initialValues}\r\n          onSubmit={handleSubmit}\r\n          validationSchema={schema}\r\n          validateOnMount={true}\r\n          validateOnBlur={false}\r\n        >\r\n          {formik => (\r\n            <StyledForm onSubmit={formik.handleSubmit}>\r\n              <FormLeftSection>\r\n                <FormFieldsSection>\r\n                  <FormListener\r\n                    onFormChange={handleFormChange}\r\n                    fields={['ServiceGroupAsset', 'InstrumentAssets']}\r\n                  />\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Title\"\r\n                      id=\"TitleId\"\r\n                      //variant={'filled'}\r\n                      label={t(translations.Title)}\r\n                      multiline={true}\r\n                      //size={'small'}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Authors\"\r\n                      id=\"AuthorsId\"\r\n                      label={t(translations.Authors)}\r\n                      multiline={true}\r\n                      //size={'small'}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Abstract\"\r\n                      id=\"AbstractId\"\r\n                      label={t(translations.Abstract)}\r\n                      multiline={true}\r\n                      //size={'small'}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <InputLabel size=\"xs\">{t(translations.Source)}</InputLabel>\r\n                    <ValueLabel value=\"Manual Entry\" />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Doi\"\r\n                      id=\"DoiId\"\r\n                      label={t(translations.Doi)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Dataset\"\r\n                      id=\"DatasetId\"\r\n                      label={t(translations.ArticleDataset)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"ISSN\"\r\n                      id=\"ISSNId\"\r\n                      label={t(translations.ISSN)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"ORCIDs\"\r\n                      id=\"ORCIDsId\"\r\n                      label={t(translations.ORCID)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Year\"\r\n                      id=\"YearId\"\r\n                      label={t(translations.Year)}\r\n                      type=\"number\"\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"Journal\"\r\n                      id=\"JournalId\"\r\n                      label={t(translations.Journal)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"PageNumber\"\r\n                      id=\"PageNumberId\"\r\n                      label={t(translations.ArticlePageNumber)}\r\n                      type=\"number\"\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormCustomPicker\r\n                      name=\"Status\"\r\n                      label={t(translations.ArticleStatus)}\r\n                      placeholder={t(translations.ArticleStatus)}\r\n                      disabled={formik.isSubmitting || !canEditStatus}\r\n                      fullWidth\r\n                      data={statusPickerData}\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <ArticleFormPicker\r\n                      name=\"CalibrationRecord\"\r\n                      label={\r\n                        instruments.length > 0\r\n                          ? t(translations.CalibrationRecord)\r\n                          : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n                      }\r\n                      placeholder={\r\n                        instruments.length > 0\r\n                          ? t(translations.PleaseSelectWorkOrder)\r\n                          : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n                      }\r\n                      disabled={\r\n                        formik.isSubmitting ||\r\n                        !canEditStatus ||\r\n                        instruments.length === 0\r\n                      }\r\n                      filter={CalibrationRecordFilter()}\r\n                      info={t(translations.CalibrationRecord_info)}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormUserPicker\r\n                      name=\"RelatedUser\"\r\n                      label={t(translations.RelatedUser)}\r\n                      placeholder={t(translations.PleaseSelectAUser)}\r\n                      disabled={formik.isSubmitting || !canEditStatus}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormAssetPicker\r\n                      admin={false}\r\n                      showOnlyActiveAssets={true}\r\n                      name=\"ServiceGroupAsset\"\r\n                      restrictByAvType=\"serviceGroup\"\r\n                      label={t(translations.ServiceGroup)}\r\n                      placeholder={t(translations.PleaseSelectAsset)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                      onChange={(value: any) => {\r\n                        setOldServiceGroups(serviceGroups);\r\n                        setServiceGroups([value]);\r\n                      }}\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormAssetsPicker\r\n                      admin={false}\r\n                      predicates={instrumentFilter()}\r\n                      showOnlyActiveAssets={true}\r\n                      name=\"InstrumentAssets\"\r\n                      restrictByAvType=\"bookableAndnotbookable\"\r\n                      label={t(translations.Instruments)}\r\n                      placeholder={t(translations.PleaseSelectAsset)}\r\n                      disabled={processing}\r\n                      fullWidth\r\n                      withoutServiceGroups={true}\r\n                      onChange={(value: any) => {\r\n                        setInstruments(value);\r\n                      }}\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <Button processing={processing} type=\"submit\">\r\n                      {t(translations.Submit)}\r\n                    </Button>\r\n                  </FormRow>\r\n                </FormFieldsSection>\r\n              </FormLeftSection>\r\n            </StyledForm>\r\n          )}\r\n        </Formik>\r\n      </Box>\r\n    </PageWrapper>\r\n  );\r\n}\r\n","import { CommentsApi } from 'api/CommentsApi';\r\nimport {\r\n  ConvertNewToComment,\r\n  IComment,\r\n  NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentsContainer } from 'app/components/CommentsContainer';\r\nimport { translations } from 'locales/translations';\r\nimport { Portal } from '@material-ui/core';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\r\n\r\nexport interface ArticleCommentsProps {\r\n  isAdmin?: boolean;\r\n  article: IArticleDto;\r\n  disabled?: boolean;\r\n  commentsFormRef: React.MutableRefObject<any>;\r\n  isEdit?: boolean;\r\n  user?: AuthenticatedUser;\r\n  sectionTitle?: React.ReactNode;\r\n}\r\n\r\nexport const ArticleComments = (props: ArticleCommentsProps) => {\r\n  const {\r\n    article,\r\n    isAdmin,\r\n    disabled,\r\n    commentsFormRef,\r\n    isEdit,\r\n    user,\r\n    sectionTitle,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const [changed, setchanged] = React.useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const [newSavedComments, setNewSavedComments] = React.useState<NewComment[]>(\r\n    [],\r\n  );\r\n  const [newComments, setNewComments] = React.useState<IComment[]>([]);\r\n  const comments = useAsyncGetWthEffect<IComment[]>(\r\n    () =>\r\n      CommentsApi.GetComments(\r\n        CommentReferenceTypes.Article,\r\n        article.Id > 0 ? article.Id : -1,\r\n      ),\r\n    [],\r\n    [changed],\r\n  );\r\n  const bindSubmitComment = React.useCallback(\r\n    submitForm => {\r\n      commentsFormRef.current = submitForm;\r\n    },\r\n    [commentsFormRef],\r\n  );\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n\r\n  React.useEffect(() => {\r\n    dispatch(\r\n      largeFileActions.setCommentProperties({\r\n        commentType: CommentReferenceTypes.Article,\r\n        referenceId: article.Id,\r\n      }),\r\n    );\r\n  }, [article.Id, dispatch, largeFileActions]);\r\n\r\n  const portalRef = React.useRef(null);\r\n  return (\r\n    <React.Fragment>\r\n      <div ref={portalRef} style={{ width: '100%' }} />\r\n      <Portal container={portalRef.current}>\r\n        <CommentsContainer\r\n          disabled={disabled}\r\n          Comments={isEdit ? comments : newComments}\r\n          sectionTitle={sectionTitle}\r\n          bindSubmitComment={bindSubmitComment}\r\n          onSubmit={c => {\r\n            if (!disabled) {\r\n              if (isEdit) {\r\n                CommentsApi.SendComment(\r\n                  CommentReferenceTypes.Article,\r\n                  article.Id,\r\n                  c,\r\n                )\r\n                  .then(res => onCommentAdded?.(res))\r\n                  .finally(() => setchanged(prev => !prev));\r\n              } else {\r\n                setNewSavedComments(() => [...newSavedComments, c]);\r\n                setNewComments(() => [\r\n                  ...newComments,\r\n                  ConvertNewToComment(c, newComments.length + 1, newDate(), {\r\n                    Id: user?.Id || '',\r\n                    Name: user?.Name || '',\r\n                  }),\r\n                ]);\r\n              }\r\n            }\r\n          }}\r\n          isAdmin={isAdmin}\r\n          withMentions\r\n          pageName={t(translations.Publications)}\r\n          referenceName={article?.Id?.toString()}\r\n        />\r\n      </Portal>\r\n    </React.Fragment>\r\n  );\r\n};\r\n","/**\r\n *\r\n * EditArticleDetailsForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport {\r\n  selectArticleDetails,\r\n  selectArticleDetailsBusy,\r\n  selectArticleDetailsForm,\r\n  selectEditArticleAssociationBusy,\r\n} from '../slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { useArticlesSlice } from '../slice';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { InputLabel } from 'app/components/Typography';\r\nimport { ValueLabel } from 'app/components/ValueLabel';\r\nimport { Entity } from 'types/common';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormAssetPicker } from 'app/components/Forms/FormAssetPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport {\r\n  assetSchema,\r\n  assetsSchema,\r\n  GetCalibrationRecordFilter,\r\n  GetInstrumentFilter,\r\n  IArticleNewEditForm,\r\n} from '../utils';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport { FormCustomPicker } from 'app/components/Forms/FormCustomPicker';\r\nimport { useAllowedToChangeStatus } from '../Hooks/useAllowedToChangeStatus';\r\nimport { ArticleComments } from '../ArticleComments';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ArticleFormPicker } from '../ArticleFormPickers';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface EditArticleDetailsFormProps\r\n  extends SidePanelContentProps,\r\n    CoverProps {\r\n  value: IArticleDto;\r\n  onClose?: () => void;\r\n  Journal?: string | null;\r\n  PageNumber?: number | null;\r\n}\r\nexport function EditArticleDetailsForm(props: EditArticleDetailsFormProps) {\r\n  const { t } = useTranslation();\r\n  const editProcessing = useSelector(selectEditArticleAssociationBusy);\r\n  const detailsLoading = useSelector(selectArticleDetailsBusy);\r\n  const articleDetailsForm = useSelector(selectArticleDetailsForm);\r\n  const articleDetails = useSelector(selectArticleDetails);\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const [canEditStatus, setCanEditStatus] = React.useState<boolean>(false);\r\n  const allowedToChangeStatus = useAllowedToChangeStatus();\r\n  const submitCommentRef = React.useRef<any>(null);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useArticlesSlice();\r\n  const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState(\r\n    undefined,\r\n    undefined,\r\n    props.isCover,\r\n    props.useSidePanel,\r\n    undefined,\r\n  );\r\n\r\n  const handleCloseClick = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: props.isCover,\r\n      useSidePanel: props.useSidePanel,\r\n      showConfirm: false,\r\n      onClose: () => {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n        dispatch(actions.resetArticleAssociationState());\r\n      },\r\n    } as SidePanelCloseState);\r\n  }, [\r\n    actions,\r\n    closePanel,\r\n    dispatch,\r\n    layoutActions,\r\n    props.isCover,\r\n    props.useSidePanel,\r\n  ]);\r\n\r\n  React.useEffect(() => {\r\n    if (editProcessing === false) {\r\n      handleCloseClick();\r\n    }\r\n    return () => undefined;\r\n  }, [editProcessing, handleCloseClick]);\r\n\r\n  const schema: Yup.SchemaOf<IArticleNewEditForm> = Yup.object().shape(\r\n    {\r\n      Title: Yup.string().required().label(t(translations.Title)).trim(),\r\n      Authors: Yup.string().required().label(t(translations.Authors)).trim(),\r\n      Abstract: Yup.string().required().label(t(translations.Abstract)).trim(),\r\n      Doi: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.Doi))\r\n        .trim(),\r\n      Dataset: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.ArticleDataset))\r\n        .trim(),\r\n      ISSN: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.ISSN))\r\n        .trim(),\r\n      ORCIDs: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.ORCID))\r\n        .trim(),\r\n      Year: Yup.number().required().label(t(translations.Year)).min(1),\r\n      CalibrationRecord: Yup.mixed().nullable().notRequired(),\r\n      RelatedUser: Yup.mixed().nullable().notRequired(),\r\n      /*ServiceGroupAssets: assetsSchema.when(['InstrumentAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetsSchema\r\n          .required()\r\n          .label(t(translations.ServiceGroup))\r\n          .min(1)\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),*/\r\n      ServiceGroupAsset: assetSchema.when(['InstrumentAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetSchema\r\n          .required()\r\n          .label(t(translations.ServiceGroup))\r\n          .nullable(),\r\n        otherwise: assetSchema.nullable().notRequired(),\r\n      }),\r\n      /*InstrumentAssets: assetsSchema.when(['ServiceGroupAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),*/\r\n      InstrumentAssets: assetsSchema.when(['ServiceGroupAsset'], {\r\n        is: v => v === null,\r\n        then: assetsSchema.required().label(t(translations.Instruments)).min(1),\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),\r\n      Status: EntityNumberSchema.required().label(\r\n        t(translations.ArticleStatus),\r\n      ),\r\n      Journal: Yup.string()\r\n        .notRequired()\r\n        .nullable()\r\n        .label(t(translations.Journal))\r\n        .trim(),\r\n      PageNumber: Yup.number().nullable().default(null),\r\n    },\r\n    [['ServiceGroupAsset', 'InstrumentAssets']],\r\n  );\r\n  const GetServiceGroupAsset = React.useCallback(asset => {\r\n    /*if (asset !== undefined && asset !== null) {\r\n        return asset.ServiceGroupId !== null &&\r\n          asset.ServiceGroupId !== undefined &&\r\n          (authenticatedUser?.HasAdminGroupOnlyPermissions(\r\n            asset.ServiceGroupId,\r\n          ) ||\r\n            authenticatedUser?.HasLabTechGroupPermissions(asset.ServiceGroupId))\r\n          ? asset\r\n          : null;\r\n      } else {\r\n        return null;\r\n      }*/\r\n    return asset;\r\n  }, []);\r\n  const initialValues: IArticleNewEditForm = React.useMemo(\r\n    () => ({\r\n      Title:\r\n        articleDetailsForm.Title === null ||\r\n        articleDetailsForm.Title === undefined\r\n          ? ''\r\n          : articleDetailsForm.Title,\r\n      Authors:\r\n        articleDetailsForm.Authors === null ||\r\n        articleDetailsForm.Authors === undefined\r\n          ? ''\r\n          : articleDetailsForm.Authors.join(','),\r\n      Abstract:\r\n        articleDetailsForm.Abstract === null ||\r\n        articleDetailsForm.Abstract === undefined\r\n          ? ''\r\n          : articleDetailsForm?.Abstract?.trim(),\r\n      Doi: articleDetailsForm.Doi,\r\n      Dataset: articleDetailsForm.Dataset,\r\n      ISSN: articleDetailsForm.ISSN,\r\n      ORCIDs:\r\n        articleDetailsForm.ORCIDs === null\r\n          ? null\r\n          : articleDetailsForm.ORCIDs.join(','),\r\n      Year: articleDetailsForm.Year ?? 0,\r\n      Journal: articleDetailsForm.Journal,\r\n      PageNumber: articleDetailsForm.PageNumber,\r\n      RelatedUser: {\r\n        Id: articleDetailsForm.RelatedUser,\r\n        Name: articleDetailsForm.RelatedUserDisplayName,\r\n      } as Entity<string>,\r\n      CalibrationRecord: {\r\n        Id: articleDetailsForm.CalibrationRecord,\r\n        Name: !!articleDetailsForm.CalibrationRecord\r\n          ? '#' +\r\n              articleDetailsForm.CalibrationRecord?.toString() +\r\n              ': ' +\r\n              articleDetailsForm.CalibrationRecordName ?? ''\r\n          : '',\r\n      } as Entity<number>,\r\n      InstrumentAssets:\r\n        articleDetailsForm !== undefined\r\n          ? articleDetailsForm?.InstrumentAssets\r\n          : /*? articleDetailsForm?.InstrumentAssets.filter(\r\n              asset =>\r\n                asset.ServiceId !== null &&\r\n                asset.ServiceId !== undefined &&\r\n                (authenticatedUser?.HasAdminServicePermissions(\r\n                  asset.ServiceTypeId ?? 1,\r\n                  asset.ServiceId,\r\n                ) ||\r\n                  authenticatedUser?.HasLabTechServicePermissions(\r\n                    asset.ServiceTypeId ?? 1,\r\n                    asset.ServiceId,\r\n                  ) ||\r\n                  authenticatedUser?.HasAdminGroupPermissions(\r\n                    asset.ServiceGroupId ?? undefined,\r\n                  ) ||\r\n                  authenticatedUser?.HasLabTechGroupPermissions(\r\n                    asset.ServiceGroupId ?? undefined,\r\n                  )),\r\n            )*/\r\n            [],\r\n      /*ServiceGroupAssets:\r\n        articleDetailsForm !== undefined\r\n          ? articleDetailsForm?.ServiceGroupAssets.filter(\r\n              asset =>\r\n                asset.ServiceGroupId !== null &&\r\n                asset.ServiceGroupId !== undefined &&\r\n                (authenticatedUser?.HasAdminGroupPermissions(\r\n                  asset.ServiceGroupId,\r\n                ) ||\r\n                  authenticatedUser?.HasLabTechGroupPermissions(\r\n                    asset.ServiceGroupId,\r\n                  )),\r\n            )\r\n          : [],*/\r\n      ServiceGroupAsset:\r\n        articleDetailsForm !== undefined\r\n          ? GetServiceGroupAsset(articleDetailsForm?.ServiceGroupAssets[0])\r\n          : null,\r\n      Status:\r\n        articleDetailsForm !== undefined &&\r\n        articleDetailsForm.Status !== undefined\r\n          ? {\r\n              Id: articleDetailsForm.Status,\r\n              Name: t('Article' + ArticleStatus[articleDetailsForm.Status]),\r\n            }\r\n          : { Id: 0, Name: t('Article' + ArticleStatus[0]) },\r\n    }),\r\n    [GetServiceGroupAsset, articleDetailsForm, t],\r\n  );\r\n  const [oldServiceGroups, setOldServiceGroups] = React.useState<IAssetDto[]>(\r\n    //initialValues.ServiceGroupAssets,\r\n    initialValues.ServiceGroupAsset === null\r\n      ? []\r\n      : [initialValues.ServiceGroupAsset],\r\n  );\r\n  const [serviceGroups, setServiceGroups] = React.useState<IAssetDto[]>(\r\n    //initialValues.ServiceGroupAssets,\r\n    initialValues.ServiceGroupAsset === null\r\n      ? []\r\n      : [initialValues.ServiceGroupAsset],\r\n  );\r\n  const [instruments, setInstruments] = React.useState<IAssetDto[]>(\r\n    initialValues.InstrumentAssets,\r\n  );\r\n  const instrumentFilter = React.useCallback(() => {\r\n    return GetInstrumentFilter(serviceGroups);\r\n  }, [serviceGroups]);\r\n  const CalibrationRecordFilter = React.useCallback(() => {\r\n    return GetCalibrationRecordFilter(instruments);\r\n  }, [instruments]);\r\n  const handleFormChange = React.useCallback(\r\n    (\r\n      values: IArticleNewEditForm,\r\n      isValid,\r\n      dirty,\r\n      setValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (\r\n        serviceGroups.length !== oldServiceGroups.length ||\r\n        serviceGroups[0] !== oldServiceGroups[0]\r\n      ) {\r\n        setOldServiceGroups(serviceGroups);\r\n        setValue('InstrumentAssets', []);\r\n        return;\r\n      }\r\n      if (\r\n        values.ServiceGroupAsset === null &&\r\n        values.InstrumentAssets.length > 0\r\n      ) {\r\n        setOldServiceGroups(serviceGroups);\r\n        setValue('ServiceGroupAsset', {\r\n          Id: values.InstrumentAssets[0].ServiceGroupAssetId,\r\n          Name: values.InstrumentAssets[0].ServiceGroupName,\r\n          ServiceGroupId: values.InstrumentAssets[0].ServiceGroupId,\r\n          ServiceGroupName: values.InstrumentAssets[0].ServiceGroupName,\r\n        });\r\n      }\r\n      setCanEditStatus(allowedToChangeStatus(serviceGroups[0]));\r\n    },\r\n    [allowedToChangeStatus, oldServiceGroups, serviceGroups],\r\n  );\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: IArticleNewEditForm) => {\r\n      if (\r\n        //values.ServiceGroupAssets.length === 0 &&\r\n        (values.ServiceGroupAsset === null &&\r\n          values.InstrumentAssets.length === 0) ||\r\n        values.Status === null\r\n      ) {\r\n        return;\r\n      }\r\n      const payload: IArticleDto = {\r\n        ...props.value,\r\n        Title: values.Title.trim(),\r\n        Authors: values.Authors.trim().split(','),\r\n        Abstract: values.Abstract.trim(),\r\n        Doi:\r\n          values.Doi !== undefined && values.Doi !== null\r\n            ? values.Doi.trim()\r\n            : null,\r\n        Dataset:\r\n          values.Dataset !== undefined && values.Dataset !== null\r\n            ? values.Dataset.trim()\r\n            : null,\r\n        ISSN:\r\n          values.ISSN !== undefined && values.ISSN !== null\r\n            ? values.ISSN.trim()\r\n            : null,\r\n        ORCIDs:\r\n          values.ORCIDs !== undefined && values.ORCIDs !== null\r\n            ? values.ORCIDs.trim().split(',')\r\n            : [],\r\n        Year: values.Year,\r\n        Status: values.Status.Id,\r\n        Journal: values.Journal !== undefined ? values.Journal : null,\r\n        PageNumber: values.PageNumber !== undefined ? values.PageNumber : null,\r\n        RelatedUser:\r\n          values.RelatedUser !== null ? values.RelatedUser?.Id : null,\r\n        CalibrationRecord:\r\n          values.CalibrationRecord !== null\r\n            ? values.CalibrationRecord?.Id\r\n            : null,\r\n        ExternalId: articleDetailsForm?.ExternalId ?? null,\r\n        ExternalIdSource: 'Manual Entry',\r\n        ...{\r\n          //Assets: values.ServiceGroupAssets.concat(values.InstrumentAssets),\r\n          Assets:\r\n            values.ServiceGroupAsset !== null\r\n              ? values.InstrumentAssets.concat([values.ServiceGroupAsset])\r\n              : values.InstrumentAssets,\r\n        },\r\n      };\r\n      dispatch(actions.saveArticleAssociation(payload));\r\n    },\r\n    [props.value, articleDetailsForm?.ExternalId, dispatch, actions],\r\n  );\r\n\r\n  const statusPickerData: Entity<number>[] = React.useMemo(() => {\r\n    const data = [\r\n      {\r\n        Id: ArticleStatus.AwaitingApproval,\r\n        Name: t('Article' + ArticleStatus[ArticleStatus.AwaitingApproval]),\r\n      },\r\n      {\r\n        Id: ArticleStatus.Approved,\r\n        Name: t('Article' + ArticleStatus[ArticleStatus.Approved]),\r\n      },\r\n    ] as Entity<number>[];\r\n    return data;\r\n  }, [t]);\r\n\r\n  return (\r\n    <PageWrapper\r\n      useSidePanel={true}\r\n      closable={true}\r\n      disableExpandToggle={true}\r\n      pageName={t(translations.EditArticle)}\r\n      titlePage={t(translations.EditArticle)}\r\n      titleTooltip={t(translations.EditArticle)}\r\n      closeSidePanel={handleCloseClick}\r\n      topProcessing={editProcessing}\r\n      cover={cover}\r\n      closeCover={!props.isCover ? onCloseCover : props.closeCover}\r\n      isCover={props.isCover}\r\n      coverClosed={coverClosed}\r\n      loading={detailsLoading}\r\n    >\r\n      <Box height={'100%'} p={1}>\r\n        {!detailsLoading && (\r\n          <Formik\r\n            initialValues={initialValues}\r\n            onSubmit={handleSubmit}\r\n            validationSchema={schema}\r\n            validateOnMount={true}\r\n            validateOnBlur={false}\r\n          >\r\n            {formik => (\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormLeftSection>\r\n                  <FormFieldsSection>\r\n                    <FormListener\r\n                      onFormChange={handleFormChange}\r\n                      fields={['ServiceGroupAsset']}\r\n                    />\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Title\"\r\n                        id=\"TitleId\"\r\n                        //variant={'filled'}\r\n                        label={t(translations.Title)}\r\n                        multiline={true}\r\n                        //size={'small'}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Authors\"\r\n                        id=\"AuthorsId\"\r\n                        label={t(translations.Authors)}\r\n                        multiline={true}\r\n                        //size={'small'}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Abstract\"\r\n                        id=\"AbstractId\"\r\n                        label={t(translations.Abstract)}\r\n                        multiline={true}\r\n                        //size={'small'}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <InputLabel size=\"xs\">\r\n                        {t(translations.Source)}\r\n                      </InputLabel>\r\n                      <ValueLabel value=\"Manual Entry\" />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Doi\"\r\n                        id=\"DoiId\"\r\n                        label={t(translations.Doi)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Dataset\"\r\n                        id=\"DatasetId\"\r\n                        label={t(translations.ArticleDataset)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"ISSN\"\r\n                        id=\"ISSNId\"\r\n                        label={t(translations.ISSN)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"ORCIDs\"\r\n                        id=\"ORCIDsId\"\r\n                        label={t(translations.ORCID)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Year\"\r\n                        id=\"YearId\"\r\n                        label={t(translations.Year)}\r\n                        type=\"number\"\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Journal\"\r\n                        id=\"JournalId\"\r\n                        label={t(translations.Journal)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"PageNumber\"\r\n                        id=\"PageNumberId\"\r\n                        label={t(translations.ArticlePageNumber)}\r\n                        type=\"number\"\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormCustomPicker\r\n                        name=\"Status\"\r\n                        label={t(translations.ArticleStatus)}\r\n                        placeholder={t(translations.ArticleStatus)}\r\n                        disabled={formik.isSubmitting || !canEditStatus}\r\n                        fullWidth\r\n                        data={statusPickerData}\r\n                      />\r\n                    </FormRow>\r\n                    {!!articleDetails && (\r\n                      <FormFieldsSection>\r\n                        <ArticleComments\r\n                          commentsFormRef={submitCommentRef}\r\n                          isEdit={true}\r\n                          user={user}\r\n                          article={articleDetails}\r\n                          disabled={false}\r\n                        />\r\n                      </FormFieldsSection>\r\n                    )}\r\n\r\n                    <FormRow>\r\n                      <ArticleFormPicker\r\n                        name=\"CalibrationRecord\"\r\n                        label={\r\n                          instruments.length > 0\r\n                            ? t(translations.CalibrationRecord)\r\n                            : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n                        }\r\n                        placeholder={\r\n                          instruments.length > 0\r\n                            ? t(translations.PleaseSelectWorkOrder)\r\n                            : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n                        }\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          !canEditStatus ||\r\n                          instruments.length === 0\r\n                        }\r\n                        filter={CalibrationRecordFilter()}\r\n                        info={t(translations.CalibrationRecord_info)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormUserPicker\r\n                        name=\"RelatedUser\"\r\n                        label={t(translations.RelatedUser)}\r\n                        placeholder={t(translations.PleaseSelectAUser)}\r\n                        disabled={formik.isSubmitting || !canEditStatus}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormAssetPicker\r\n                        admin={false}\r\n                        showOnlyActiveAssets={true}\r\n                        name=\"ServiceGroupAsset\"\r\n                        restrictByAvType=\"serviceGroup\"\r\n                        label={t(translations.ServiceGroup)}\r\n                        placeholder={t(translations.PleaseSelectAsset)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                        onChange={(value: any) => {\r\n                          setOldServiceGroups(serviceGroups);\r\n                          setServiceGroups([value]);\r\n                        }}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormAssetsPicker\r\n                        admin={false}\r\n                        predicates={instrumentFilter()}\r\n                        showOnlyActiveAssets={true}\r\n                        name=\"InstrumentAssets\"\r\n                        restrictByAvType=\"bookableAndnotbookable\"\r\n                        label={t(translations.Instruments)}\r\n                        placeholder={t(translations.PleaseSelectAsset)}\r\n                        disabled={editProcessing}\r\n                        fullWidth\r\n                        withoutServiceGroups={true}\r\n                        onChange={(value: any) => {\r\n                          setInstruments(value);\r\n                        }}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <Button processing={editProcessing} type=\"submit\">\r\n                        {t(translations.Submit)}\r\n                      </Button>\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            )}\r\n          </Formik>\r\n        )}\r\n      </Box>\r\n    </PageWrapper>\r\n  );\r\n}\r\n","/**\r\n *\r\n * UserAttributesActions\r\n *\r\n */\r\n\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: SaveFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\n","import { IUserAttributesDto } from 'api/odata/generated/entities/IUserAttributesDto';\r\nimport { AsyncDataState } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\n/* --- STATE --- */\r\nexport interface UserAttributesState {\r\n  createState: AsyncDataState<UserAttributesDetailsState>;\r\n  updateState: AsyncDataState<UserAttributesDetailsState>;\r\n  processing: boolean;\r\n}\r\n\r\nexport interface UserAttributesDetailsState {\r\n  Id: number;\r\n  Attribute?: string | null;\r\n  AttributeLocalized: string;\r\n  Disabled?: boolean | null;\r\n  SSO?: boolean | null;\r\n  SSOAttribute?: string | null;\r\n  Mandatory?: boolean | null;\r\n  RegistrationForm?: boolean | null;\r\n  UserDetails?: boolean | null;\r\n  UserSidePanel?: boolean | null;\r\n  UserProfile?: boolean | null;\r\n  Order?: number | null;\r\n}\r\n\r\nexport interface UserAttributesDetailsQStringParameters {\r\n  id?: string;\r\n  attr?: string;\r\n  attrL?: string;\r\n  disabled?: string;\r\n  sso?: string;\r\n  ssoAttr?: string;\r\n  mandatory?: string;\r\n  regForm?: string;\r\n  usrDetails?: string;\r\n  usrSidePanel?: string;\r\n  usrProfile?: string;\r\n  order?: string;\r\n}\r\n\r\nexport interface UserAttributesDetailsResponse extends IResponseType {\r\n  Id?: number;\r\n}\r\n\r\nexport function ConvertModelToEntityUserAttributesDetails(\r\n  entity: IUserAttributesDto,\r\n): UserAttributesDetailsState | undefined {\r\n  if (!entity) {\r\n    return undefined;\r\n  } else {\r\n    return {\r\n      Id: entity.Id,\r\n      Attribute: entity.Attribute,\r\n      AttributeLocalized: entity.AttributeLocalized,\r\n      Disabled: entity.Disabled,\r\n      SSO: entity.SSO,\r\n      SSOAttribute: entity.SSOAttribute,\r\n      Mandatory: entity.Mandatory,\r\n      RegistrationForm: entity.RegistrationForm,\r\n      UserDetails: entity.UserDetails,\r\n      UserSidePanel: entity.UserSidePanel,\r\n      UserProfile: entity.UserProfile,\r\n      Order: entity.Order,\r\n    } as UserAttributesDetailsState;\r\n  }\r\n}\r\n\r\nexport function ConvertEntityToModelUserAttributesDetails(\r\n  model: UserAttributesDetailsState,\r\n  original: UserAttributesDetailsState | undefined,\r\n): IUserAttributesDto {\r\n  let entity = {\r\n    Id: original?.Id === undefined ? model.Id : original.Id,\r\n    Attribute: model.Attribute,\r\n    AttributeLocalized: model.AttributeLocalized,\r\n    Disabled: model.Disabled,\r\n    SSO: model.SSO,\r\n    SSOAttribute: model.SSOAttribute,\r\n    Mandatory: model.Mandatory,\r\n    RegistrationForm: model.RegistrationForm,\r\n    UserDetails: model.UserDetails,\r\n    UserSidePanel: model.UserSidePanel,\r\n    UserProfile: model.UserProfile,\r\n    Order: model.Order,\r\n  } as IUserAttributesDto;\r\n  return entity;\r\n}\r\n","import { UserAttributesDetailsQStringParameters } from 'app/pages/UserAttributes/UserAttributesDetailsPage/Details/slice/types';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\nimport { IUserAttributesDto } from './odata/generated/entities/IUserAttributesDto';\r\n\r\nexport const UserAttributesApi = {\r\n  initCreateData: (payload: UserAttributesDetailsQStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = '/api/odata/v4/UserAttributes/InitUserAttributes';\r\n    return httpClient.post(url, data);\r\n  },\r\n  initUpdateData: (payload: UserAttributesDetailsQStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    console.log(data);\r\n    const url = '/api/odata/v4/UserAttributes/InitUserAttributes';\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertUserAttributesDetails: (payload: IUserAttributesDto) => {\r\n    const url = '/api/odata/v4/UserAttributes'; //POST action in Controller\r\n    return httpClient.post(url, payload);\r\n  },\r\n  updateUserAttributesDetails: (payload: IUserAttributesDto) => {\r\n    const url = `/api/odata/v4/UserAttributes(${payload.Id})`; //PUT action in Controller\r\n    return httpClient.put(url, payload);\r\n  },\r\n  deleteUserAttributesDetails: (\r\n    rows: IUserAttributesDto[],\r\n  ): Promise<IResponseType> => {\r\n    const userAttributesIds: number[] = rows.map(item => item.Id);\r\n    const data = { userAttributesIds };\r\n    const url = '/api/odata/v4/UserAttributes/DeleteUserAttributes';\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport {\r\n  ConvertEntityToModelUserAttributesDetails,\r\n  UserAttributesDetailsQStringParameters,\r\n  UserAttributesDetailsResponse,\r\n  UserAttributesDetailsState,\r\n} from './types';\r\nimport { userAttributesDetailsActions as actions } from '.';\r\nimport { UserAttributesApi } from '../../../../../../api/UserAttributesApi';\r\nimport { IUserAttributesDto } from 'api/odata/generated/entities/IUserAttributesDto';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { UserAttributesDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\n\r\nfunction* doInitCreate(\r\n  action: PayloadAction<UserAttributesDetailsQStringParameters>,\r\n) {\r\n  try {\r\n    const data = yield call(UserAttributesApi.initCreateData, action.payload);\r\n    yield put(actions.initUserAttributesDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initUserAttributesDetails_Error(error));\r\n  }\r\n}\r\n\r\nfunction* doInitUpdate(\r\n  action: PayloadAction<UserAttributesDetailsQStringParameters>,\r\n) {\r\n  try {\r\n    const data = yield call(UserAttributesApi.initUpdateData, action.payload);\r\n    yield put(actions.initUpdateUserAttributesDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initUpdateUserAttributesDetails_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction<UserAttributesDetailsState>) {\r\n  const httpPayloads: IUserAttributesDto = ConvertEntityToModelUserAttributesDetails(\r\n    action.payload,\r\n    undefined,\r\n  );\r\n  try {\r\n    const result = yield call(\r\n      UserAttributesApi.insertUserAttributesDetails,\r\n      httpPayloads,\r\n    );\r\n    let response: UserAttributesDetailsResponse = result as UserAttributesDetailsResponse;\r\n\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'userAttributesInsert',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'userAttributesInsert',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      if (response.Id) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'userAttributesInsert',\r\n            message: response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id,\r\n              created: true,\r\n              itemName: i18next.t(translations.menu_UserAttributes),\r\n              detailsType: RenderPageType.UserAttributesDetails,\r\n              detailsTypeProps: {\r\n                queryParams: {\r\n                  id: '' + response.Id,\r\n                } as UserAttributesDetailsQStringParameters,\r\n                useSidePanel: true,\r\n              } as UserAttributesDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      } else {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'userAttributesInsertSuccess',\r\n            message: response.SuccessMessages[0],\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.createUserAttributesDetails_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'userAttributesInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createUserAttributesDetails_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: UserAttributesDetailsState;\r\n    original: UserAttributesDetailsState | undefined;\r\n  }>,\r\n) {\r\n  const httpPayloads: IUserAttributesDto = ConvertEntityToModelUserAttributesDetails(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n  try {\r\n    const results = yield call(\r\n      UserAttributesApi.updateUserAttributesDetails,\r\n      httpPayloads,\r\n    );\r\n    let response = results as UserAttributesDetailsResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'userAttributesUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'userAttributesUpdateWarn',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'userAttributesUpdate',\r\n          message: response.SuccessMessages[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: response.Id,\r\n            created: false,\r\n            itemName: i18next.t(translations.menu_UserAttributes),\r\n            detailsType: RenderPageType.UserAttributesDetails,\r\n            detailsTypeProps: {\r\n              queryParams: {\r\n                id: '' + response.Id,\r\n              } as UserAttributesDetailsQStringParameters,\r\n              useSidePanel: true,\r\n            } as UserAttributesDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateUserAttributesDetails_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'userAttributesUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateUserAttributesDetails_Error(Error));\r\n  }\r\n}\r\n\r\nexport function* userAttributesDetailsSaga() {\r\n  yield takeLatest(actions.initUserAttributesDetails.type, doInitCreate);\r\n  yield takeLatest(actions.initUpdateUserAttributesDetails.type, doInitUpdate);\r\n  yield takeLatest(actions.createUserAttributesDetails.type, doCreate);\r\n  yield takeLatest(actions.updateUserAttributesDetails.type, doUpdate);\r\n}\r\n","import {\r\n  ConvertModelToEntityUserAttributesDetails,\r\n  UserAttributesDetailsQStringParameters,\r\n  UserAttributesDetailsState,\r\n  UserAttributesState,\r\n} from './types';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IUserAttributesDto } from 'api/odata/generated/entities/IUserAttributesDto';\r\nimport { userAttributesDetailsSaga } from './saga';\r\n\r\nexport const initialState: UserAttributesState = {\r\n  processing: false,\r\n  createState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  updateState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'userAttributesDetail',\r\n  initialState,\r\n  reducers: {\r\n    initUserAttributesDetails(\r\n      state,\r\n      action: PayloadAction<UserAttributesDetailsQStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUpdateUserAttributesDetails(\r\n      state,\r\n      action: PayloadAction<UserAttributesDetailsQStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUserAttributesDetails_Success(\r\n      state,\r\n      action: PayloadAction<IUserAttributesDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.createState.data = ConvertModelToEntityUserAttributesDetails(\r\n        action.payload,\r\n      );\r\n    },\r\n    initUpdateUserAttributesDetails_Success(\r\n      state,\r\n      action: PayloadAction<IUserAttributesDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.updateState.data = ConvertModelToEntityUserAttributesDetails(\r\n        action.payload,\r\n      );\r\n    },\r\n    initUserAttributesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    initUpdateUserAttributesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    //====================================================================\r\n    resetUpdateUserAttributesDetailsState(state, action: PayloadAction) {\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    resetCreateUserAttributesDetailsState(state, action: PayloadAction) {\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    //====================================================================\r\n    updateUserAttributesDetails(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: UserAttributesDetailsState;\r\n        original: UserAttributesDetailsState | undefined;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateUserAttributesDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.hasErrors = action.payload.hasErrors;\r\n      state.updateState.completed = true;\r\n    },\r\n    updateUserAttributesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      state.updateState.hasErrors = true;\r\n    },\r\n    //====================================================================\r\n    createUserAttributesDetails(\r\n      state,\r\n      action: PayloadAction<UserAttributesDetailsState>,\r\n    ) {\r\n      state.createState.processing = true;\r\n      state.createState.completed = undefined;\r\n      state.createState.hasErrors = undefined;\r\n    },\r\n    createUserAttributesDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.createState.processing = false;\r\n      state.createState.hasErrors = action.payload.hasErrors;\r\n      state.createState.completed = true;\r\n    },\r\n    createUserAttributesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.createState.processing = false;\r\n      state.createState.completed = true;\r\n      state.createState.hasErrors = true;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: userAttributesDetailsActions } = slice;\r\n\r\nexport const useUserAttributesDetailsSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: userAttributesDetailsSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.userAttributesDetail || initialState;\r\n\r\nexport const selectUserAttributesDetails = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n//====================================================================\r\nexport const selectCreateUserAttributesDetails = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.createState.data,\r\n);\r\n\r\nexport const selectCreateUserAttributesDetailsCompleted = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.createState.completed,\r\n);\r\n\r\nexport const selectCreateUserAttributesDetailsHasError = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.createState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUpdateUserAttributesDetails = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.updateState.data,\r\n);\r\n\r\nexport const selectUpdateUserAttributesDetailsCompleted = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.updateState.completed,\r\n);\r\nexport const selectUpdateUserAttributesDetailsHasError = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.updateState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUserAttributesDetailsProcessing = createSelector(\r\n  [selectUserAttributesDetails],\r\n  state => state.processing,\r\n);\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UserAttributesDetailsState } from '../slice/types';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\n\r\nexport interface UserAttributesFormProps {\r\n  initialValues: UserAttributesDetailsState;\r\n  onSubmit: (item: UserAttributesDetailsState) => void;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  bindSubmitForm: any;\r\n}\r\n\r\nexport const UserAttributesForm = React.memo(function UserAttributesForm({\r\n  initialValues,\r\n  onSubmit,\r\n  isEdit,\r\n  isAdmin,\r\n  bindSubmitForm,\r\n}: UserAttributesFormProps): JSX.Element {\r\n  //SETTINGS\r\n  const { t } = useTranslation();\r\n\r\n  //STATES\r\n  //const [ssoChanged, setSsoChanged] = useState<boolean>(false);\r\n  /* const [ssoAttributeChanged, setSsoAttributeChanged] = useState<boolean>(\r\n      false,\r\n    ); */\r\n\r\n  //FUNCTIONS\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n\r\n  //check if the field's props (Disabled, Mandatory) can't be editted\r\n  const isNotEditableField = () => {\r\n    if (initialValues.Attribute === 'UserName') {\r\n      return true;\r\n    }\r\n    if (initialValues.Attribute === 'Password') {\r\n      return true;\r\n    }\r\n    if (initialValues.Attribute === 'Email') {\r\n      return true;\r\n    }\r\n    if (initialValues.Attribute === 'UserGroup') {\r\n      return true;\r\n    }\r\n    return false;\r\n  };\r\n\r\n  /*     const handleFormChange = useCallback(\r\n      (values, isValid, dirty, setValue) => {\r\n        if (\r\n          initialValues.Attribute === 'UserName' ||\r\n          initialValues.Attribute === 'Password' ||\r\n          initialValues.Attribute === 'Email' ||\r\n          initialValues.Attribute === 'UserGroup'\r\n        ) {\r\n          setValue('Disabled', false, false);\r\n          setValue('Mandatory', true, false);\r\n        }\r\n        /*         if (ssoChanged) {\r\n          if (values.SSO === true) {\r\n            setValue('Mandatory', false, false);\r\n            setValue('RegistrationForm', false, false);\r\n            setValue('UserDetails', false, false);\r\n            setValue('UserSidePanel', false, false);\r\n            setValue('UserProfile', false, false);\r\n            setValue('Order', 0, false);\r\n          } else {\r\n            setValue('SSOAttribute', '', false);\r\n            setValue('Mandatory', false, false);\r\n          }\r\n          setSsoChanged(false);\r\n        }\r\n        if (ssoAttributeChanged) {\r\n          if (values.SSOAttribute !== '') {\r\n            setValue('Mandatory', true, false);\r\n          } else {\r\n            setValue('Mandatory', false, false);\r\n          }\r\n          setSsoAttributeChanged(false);\r\n        } */\r\n  //  },\r\n  //  [initialValues.Attribute],\r\n  //);\r\n\r\n  //SCHEMA\r\n  const userAttributesDetailsSchema: Yup.SchemaOf<UserAttributesDetailsState> = Yup.object(\r\n    {\r\n      Id: Yup.number().notRequired().default(-1),\r\n      Attribute: Yup.string().default('').notRequired().nullable(),\r\n      AttributeLocalized: Yup.string()\r\n        .default('')\r\n        .nullable()\r\n        .required()\r\n        .label(i18next.t(translations.Attribute)),\r\n      Disabled: Yup.boolean()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(false)\r\n        .label(i18next.t(translations.Disabled)),\r\n      SSO: Yup.boolean()\r\n        .notRequired()\r\n        .default(false)\r\n        .nullable()\r\n        .label(i18next.t(translations.SSO)),\r\n      SSOAttribute: Yup.string()\r\n        .label(i18next.t(translations.SSOAttribute))\r\n        .when('SSO', {\r\n          is: sso => sso === true,\r\n          then: Yup.string().nullable().required(),\r\n          otherwise: Yup.string().notRequired().nullable().default(''),\r\n        }),\r\n      Mandatory: Yup.boolean()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(false)\r\n        .label(i18next.t(translations.Mandatory)),\r\n      RegistrationForm: Yup.boolean()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(false)\r\n        .label(i18next.t(translations.RegistrationForm)),\r\n      UserDetails: Yup.boolean()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(false)\r\n        .label(i18next.t(translations.UserDetails)),\r\n      UserSidePanel: Yup.boolean()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(false)\r\n        .label(i18next.t(translations.UserSidePanel)),\r\n      UserProfile: Yup.boolean()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(false)\r\n        .label(i18next.t(translations.UserProfile)),\r\n      Order: Yup.number()\r\n        .notRequired()\r\n        .nullable()\r\n        .default(0)\r\n        .label(i18next.t(translations.Order)),\r\n    },\r\n  );\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <Formik\r\n        initialValues={initialValues}\r\n        validationSchema={userAttributesDetailsSchema}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('Submitting: ', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            //console.log('User Attributes Details Errors: ', formik.errors);\r\n          }\r\n          return (\r\n            <>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                {/* <FormListener\r\n                    onFormChange={handleFormChange}\r\n                    fields={['Disabled', 'Mandatory']}\r\n                  /> */}\r\n                <FormLeftSection>\r\n                  <FormFieldsSection\r\n                    titleSection={\r\n                      t(translations.UserAttributeDetails) as string\r\n                    }\r\n                  >\r\n                    <FormRow>\r\n                      <FormLabelText\r\n                        id=\"AttributeLocalizedID\"\r\n                        name=\"AttributeLocalized\"\r\n                        label={t(translations.Attribute)}\r\n                        text={initialValues.AttributeLocalized}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n                <FormRightSection>\r\n                  <FormFieldsSection>\r\n                    <FormRow fullRow>\r\n                      <FormSwitch\r\n                        id=\"DisabledID\"\r\n                        boldLebel\r\n                        name=\"Disabled\"\r\n                        label={t(translations.Disabled)}\r\n                        disabled={formik.isSubmitting || isNotEditableField()}\r\n                      />\r\n                    </FormRow>\r\n                    {/*                       <FormRow fullRow>\r\n                        <FormSwitch\r\n                          id=\"ssoID\"\r\n                          boldLebel\r\n                          name=\"SSO\"\r\n                          label={t(translations.SSO)}\r\n                          disabled={formik.isSubmitting}\r\n                          //onChange={() => setSsoChanged(true)}\r\n                        />\r\n                      </FormRow>\r\n                      <FormRow>\r\n                        <FormTextField\r\n                          id=\"SSOAttributeID\"\r\n                          name=\"SSOAttribute\"\r\n                          label={t(translations.SSOAttribute)}\r\n                          placeholder={t(translations.SSOAttribute)}\r\n                          disabled={!formik.values.SSO || formik.isSubmitting}\r\n                          onChange={() => setSsoAttributeChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow> */}\r\n                    <FormRow fullRow>\r\n                      <FormSwitch\r\n                        id=\"MandatoryID\"\r\n                        boldLebel\r\n                        name=\"Mandatory\"\r\n                        label={t(translations.Mandatory)}\r\n                        disabled={\r\n                          formik.values.SSO ||\r\n                          formik.isSubmitting ||\r\n                          isNotEditableField()\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormSwitch\r\n                        id=\"RegistrationFormID\"\r\n                        boldLebel\r\n                        name=\"RegistrationForm\"\r\n                        label={t(translations.RegistrationForm)}\r\n                        disabled={formik.values.SSO || formik.isSubmitting}\r\n                        info={t(\r\n                          translations.MandatoryFieldsArePartOfTheRegistrationForm,\r\n                        )}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormSwitch\r\n                        id=\"UserDetailsID\"\r\n                        boldLebel\r\n                        name=\"UserDetails\"\r\n                        label={t(translations.UserDetails)}\r\n                        disabled={formik.values.SSO || formik.isSubmitting}\r\n                        info={t(\r\n                          translations.MandatoryFieldsArePartOfTheRegistrationForm,\r\n                        )}\r\n                      />\r\n                    </FormRow>\r\n                    {/* <FormRow fullRow>\r\n                        <FormSwitch\r\n                          id=\"UserSidePanelID\"\r\n                          boldLebel\r\n                          name=\"UserSidePanel\"\r\n                          label={t(translations.UserSidePanel)}\r\n                          disabled={formik.values.SSO || formik.isSubmitting}\r\n                        />\r\n                      </FormRow> */}\r\n                    {/* <FormRow fullRow>\r\n                        <FormSwitch\r\n                          id=\"UserProfileID\"\r\n                          boldLebel\r\n                          name=\"UserProfile\"\r\n                          label={t(translations.UserProfile)}\r\n                          disabled={formik.values.SSO || formik.isSubmitting}\r\n                        />\r\n                      </FormRow> */}\r\n                    <FormRow fullRow>\r\n                      <FormNumberField\r\n                        fullWidth\r\n                        id=\"OrderID\"\r\n                        name=\"Order\"\r\n                        label={t(translations.Order)}\r\n                        placeholder={t(translations.Order)}\r\n                        disabled={formik.values.SSO || formik.isSubmitting}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormRightSection>\r\n              </StyledForm>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import Box from '@material-ui/core/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectHasNotSavedChanges,\r\n  selectContinueToLink,\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { push } from 'connected-react-router';\r\nimport { translations } from 'locales/translations';\r\nimport { Fragment, useCallback, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { SaveFormButton } from './Actions/UserAttributesActions';\r\nimport { useUserAttributesDetailsSlice } from './slice';\r\nimport {\r\n  selectUserAttributesDetailsProcessing,\r\n  selectCreateUserAttributesDetailsCompleted,\r\n  selectUpdateUserAttributesDetailsCompleted,\r\n  selectCreateUserAttributesDetails,\r\n  selectUpdateUserAttributesDetails,\r\n} from './slice/selectors';\r\nimport {\r\n  UserAttributesDetailsQStringParameters,\r\n  UserAttributesDetailsState,\r\n} from './slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { UserAttributesForm } from './UserAttributesForm';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface UserAttributesDetailsProps extends SidePanelContentProps {\r\n  queryParams: UserAttributesDetailsQStringParameters;\r\n}\r\n\r\nexport function UserAttributesDetails(\r\n  props: UserAttributesDetailsProps,\r\n): JSX.Element {\r\n  //PROPS\r\n  const { queryParams, useSidePanel } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n\r\n  //PERMISSIONS\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const IsAdmin =\r\n    User !== undefined && User.Roles.includes(Roles.Administrators);\r\n\r\n  //SLICES\r\n  const { actions } = useUserAttributesDetailsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n  //SELECTORS\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  //====================================================================\r\n  const hasUnsavedChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const loading = useSelector(selectUserAttributesDetailsProcessing);\r\n  //====================================================================\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  //====================================================================\r\n  const requestCreateCompleted = useSelector(\r\n    selectCreateUserAttributesDetailsCompleted,\r\n  );\r\n  const requestUpdateCompleted = useSelector(\r\n    selectUpdateUserAttributesDetailsCompleted,\r\n  );\r\n  //====================================================================\r\n  const createModel = useSelector(\r\n    selectCreateUserAttributesDetails,\r\n    shallowEqual,\r\n  );\r\n  const editModel = useSelector(\r\n    selectUpdateUserAttributesDetails,\r\n    shallowEqual,\r\n  );\r\n  const baseModel = createModel || editModel;\r\n  //====================================================================\r\n\r\n  //STATES\r\n  const [edit, setEdit] = useState<boolean>(false);\r\n  const [busy, setBusy] = useState<boolean>(false);\r\n  const [requestCompleted, setRequestCompleted] = useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n\r\n  //REF\r\n  const submitFormRef = useRef<any>(null);\r\n\r\n  //FUNCTIONS\r\n  const bindSubmitForm = useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n\r\n  const handleSaveClick = (e: any) => {\r\n    handleSubmitForm(e);\r\n  };\r\n\r\n  const handleSubmit = useCallback(\r\n    (values: UserAttributesDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateUserAttributesDetails({\r\n            current: values,\r\n            original: baseModel,\r\n          }),\r\n        );\r\n      } else {\r\n        let value = values as UserAttributesDetailsState;\r\n        console.debug('Data: ', value);\r\n        dispatch(actions.createUserAttributesDetails(values));\r\n      }\r\n    },\r\n    [actions, baseModel, dispatch, edit],\r\n  );\r\n\r\n  const handleCancelClick = useCallback(() => {\r\n    if (useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    } else {\r\n      dispatch(push('/UserAttributes'));\r\n    }\r\n    if (edit) {\r\n      dispatch(actions.resetUpdateUserAttributesDetailsState());\r\n    } else {\r\n      dispatch(actions.resetCreateUserAttributesDetailsState());\r\n    }\r\n  }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n  const handleClose = () => {\r\n    if (hasUnsavedChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCancelClick();\r\n    }\r\n  };\r\n\r\n  //USE EFFECT ON MOUNT\r\n  useEffectOnMount(() => {\r\n    if (\r\n      queryParams.id !== undefined &&\r\n      !isNaN(parseInt(queryParams.id || ''))\r\n    ) {\r\n      dispatch(actions.initUpdateUserAttributesDetails(queryParams));\r\n    } else {\r\n      dispatch(actions.initUserAttributesDetails(queryParams));\r\n    }\r\n    setBusy(false);\r\n    setEdit(false);\r\n    setRequestCompleted(undefined);\r\n    return () => {};\r\n  });\r\n\r\n  //USE EFFECT\r\n  useEffect(() => {\r\n    let active = loading === false;\r\n    if (active) {\r\n      if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n        setEdit(true);\r\n      }\r\n      if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n      } else if (\r\n        requestCreateCompleted === false ||\r\n        requestUpdateCompleted === false\r\n      ) {\r\n        setRequestCompleted(false);\r\n        setBusy(false);\r\n      }\r\n      if (requestUpdateCompleted === true || requestCreateCompleted === true) {\r\n        handleCancelClick();\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    handleCancelClick,\r\n    loading,\r\n    queryParams.id,\r\n    requestCreateCompleted,\r\n    requestUpdateCompleted,\r\n  ]);\r\n\r\n  //USE EFFECT 2\r\n  useEffect(() => {\r\n    if (confirmApproved) {\r\n      if (edit) {\r\n        dispatch(actions.resetUpdateUserAttributesDetailsState());\r\n      } else {\r\n        dispatch(actions.resetCreateUserAttributesDetailsState());\r\n      }\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(layoutActions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(appSettingsActions.navigate(continueLink));\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n    return () => undefined;\r\n  }, [\r\n    actions,\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n  ]);\r\n\r\n  //LEFT ACTIONS\r\n  const leftActions = [\r\n    () => (\r\n      <Fragment>\r\n        <SaveFormButton\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"save\" />}\r\n          onClick={handleSaveClick}\r\n          disabled={busy}\r\n          processing={!requestCompleted && busy}\r\n          edit={edit}\r\n          text={t(translations.Save)}\r\n        />\r\n      </Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n\r\n  //RIGHT ACTIONS\r\n  const rightActions = [\r\n    () => (\r\n      <Fragment>\r\n        <Button\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={handleCancelClick}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <PageWrapper\r\n        pageName={\r\n          edit ? t(translations.EditAttribute) : t(translations.AddNewAttribute)\r\n        }\r\n        titlePage={\r\n          baseModel\r\n            ? edit\r\n              ? ` ${t(translations.EditAttribute)} #${queryParams.id || 'N/A'}`\r\n              : ` ${t(translations.AddNewAttribute)}`\r\n            : undefined\r\n        }\r\n        loading={loading}\r\n        useSidePanel={useSidePanel}\r\n        leftActions={leftActions}\r\n        rightActions={rightActions}\r\n        closable={true}\r\n        disableExpandToggle={true}\r\n        closeSidePanel={handleClose}\r\n        pageLink={buildURL(\r\n          publicUrl + 'UserAttributes/details',\r\n          props.queryParams,\r\n        )}\r\n        children={\r\n          baseModel !== undefined && !loading ? (\r\n            <Fragment>\r\n              <UserAttributesForm\r\n                initialValues={baseModel || ({} as UserAttributesDetailsState)}\r\n                bindSubmitForm={bindSubmitForm}\r\n                onSubmit={handleSubmit}\r\n                isEdit={edit}\r\n                isAdmin={IsAdmin}\r\n              />\r\n            </Fragment>\r\n          ) : (\r\n            <Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={loading} size={80} />\r\n              </Box>\r\n            </Fragment>\r\n          )\r\n        }\r\n      />\r\n      {hasUnsavedChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.Enums.Priorities\r\n *\r\n */\r\n\r\nexport enum Priorities {\r\n  Lowest = 0,\r\n  Low = 1,\r\n  Medium = 2,\r\n  High = 3,\r\n  Highest = 4,\r\n}\r\nexport type PrioritiesUnion = keyof typeof Priorities;\r\nexport const PrioritiesUnionArray: Array<PrioritiesUnion> = [\r\n  'Lowest',\r\n  'Low',\r\n  'Medium',\r\n  'High',\r\n  'Highest',\r\n];\r\n","import { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { IUserBaseDto } from 'api/odata/generated/entities/IUserBaseDto';\r\nimport { PrioritiesUnion } from 'api/odata/generated/enums/Priorities';\r\nimport { TFunction } from 'i18next';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface IServiceRequestTicketEdit {\r\n  AssignedTo?: IUserBaseDto;\r\n  Status?: IServiceRequestStatusDto;\r\n  Priority?: PrioritiesUnion;\r\n  ParentTicketId?: number | null;\r\n  SamplesCount?: number | null;\r\n}\r\n\r\nexport type ServiceRequestSubTicketSchema = Pick<\r\n  IServiceRequestTicketDto,\r\n  'AssignedTo' | 'Priority' | 'Status' | 'SamplesCount'\r\n>;\r\nexport const getInitialValues = (\r\n  item: IServiceRequestTicketDto,\r\n  t: TFunction,\r\n) => ({\r\n  AssignedTo: item.AssignedTo,\r\n  Status: item.Status,\r\n  Priority: item.Priority,\r\n  ParentTicketId: item.ParentTicketId,\r\n  SamplesCount: item.ParentTicketId === null ? undefined : item.SamplesCount,\r\n});\r\n\r\nexport const getTicketSchema = (\r\n  t: TFunction,\r\n  item: IServiceRequestTicketDto,\r\n  samplesAutomationEnabled: boolean,\r\n): Yup.SchemaOf<IServiceRequestTicketEdit> => {\r\n  const base = {\r\n    AssignedTo: Yup.mixed().optional(),\r\n    Priority: Yup.mixed().required(),\r\n    Status: Yup.mixed().required(),\r\n    ParentTicketId: Yup.number().optional().nullable(),\r\n  };\r\n  const isSubTicket =\r\n    item.ParentTicketId !== null &&\r\n    item.ParentTicketId !== undefined &&\r\n    !isNaN(item.ParentTicketId);\r\n  if (!isSubTicket) {\r\n    return Yup.object({\r\n      ...base,\r\n      SamplesCount: Yup.number().optional(),\r\n    });\r\n  } else {\r\n    const parentSamplesCount = item.ParentTicket?.SamplesCount ?? 0;\r\n    const samplesRequired = samplesAutomationEnabled && parentSamplesCount > 0;\r\n    const max = parentSamplesCount + (item.SamplesCount ?? 0);\r\n    return Yup.object({\r\n      ...base,\r\n      SamplesCount: samplesRequired\r\n        ? Yup.number().required().min(0).max(max)\r\n        : Yup.number().optional(),\r\n    });\r\n  }\r\n};\r\n","/**\r\n *\r\n * PriorityPicker\r\n *\r\n */\r\n\r\nimport {\r\n  PrioritiesUnion,\r\n  PrioritiesUnionArray,\r\n} from 'api/odata/generated/enums/Priorities';\r\nimport {\r\n  EnumPicker,\r\n  withEnumOptions,\r\n} from 'app/components/BasicPickers/EnumPicker';\r\n\r\nexport const PriorityPicker = withEnumOptions<PrioritiesUnion>(\r\n  PrioritiesUnionArray,\r\n)(EnumPicker);\r\n","/**\r\n *\r\n * FormPriorityPicker\r\n *\r\n */\r\n\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { PriorityPicker } from '../pickers/StaticOptionsPickers/PriorityPicker';\r\nimport { PrioritiesUnion } from 'api/odata/generated/enums/Priorities';\r\n\r\nexport const FormPriorityPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<PrioritiesUnion | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<PrioritiesUnion | null>(props);\r\n  return (\r\n    <>\r\n      <PriorityPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * FormServiceRequestStatusPicker\r\n *\r\n */\r\n\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ServiceRequestStatusPicker } from '../pickers/AutocompletePickers/ServiceRequestStatusPicker';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\n\r\ntype optionType = IServiceRequestStatusDto;\r\nexport const FormServiceRequestStatusPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<optionType | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<optionType | null>(props);\r\n  return (\r\n    <>\r\n      <ServiceRequestStatusPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n        predicates={props.predicates}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { Formik } from 'formik';\r\nimport * as Yup from 'yup';\r\nimport {\r\n  FormFieldsSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormPriorityPicker } from 'app/components/Forms/FormPriorityPicker';\r\nimport { FormServiceRequestStatusPicker } from 'app/components/Forms/FormServiceRequestStatusPicker';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IServiceRequestTicketEdit } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectKnownModule } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\ninterface FormProps {\r\n  schema: Yup.SchemaOf<IServiceRequestTicketEdit>;\r\n  initialValues: IServiceRequestTicketEdit;\r\n  item: Partial<IServiceRequestTicketDto>;\r\n  onSubmit: (values: IServiceRequestTicketEdit) => void;\r\n  onCancel: () => void;\r\n  processing: boolean;\r\n}\r\nexport const Form = ({\r\n  schema,\r\n  initialValues,\r\n  onSubmit,\r\n  onCancel,\r\n  processing,\r\n  item,\r\n}: FormProps) => {\r\n  const { t } = useTranslation();\r\n\r\n  const samplesAutomationEnabled = useSelector(state =>\r\n    selectKnownModule(state, KnownModules.SamplesAutomation),\r\n  );\r\n  return (\r\n    <Formik\r\n      validationSchema={schema}\r\n      initialValues={initialValues}\r\n      onSubmit={onSubmit}\r\n    >\r\n      {formik => (\r\n        <StyledForm onSubmit={formik.handleSubmit}>\r\n          <FormFieldsSection>\r\n            <FormRow>\r\n              <FormServiceRequestStatusPicker\r\n                name=\"Status\"\r\n                id=\"Status\"\r\n                label={t(translations.Status)}\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <FormUserPicker\r\n                name=\"AssignedTo\"\r\n                id=\"AssignedTo\"\r\n                label={t(translations.AssignedTo)}\r\n                fullWidth\r\n              />\r\n            </FormRow>\r\n            <FormRow>\r\n              <FormPriorityPicker\r\n                name=\"Priority\"\r\n                id=\"Priority\"\r\n                label={t(translations.Priority)}\r\n                fullWidth\r\n              />\r\n            </FormRow>\r\n            {samplesAutomationEnabled &&\r\n              item.ParentTicketId !== null &&\r\n              item.SamplesCount !== undefined && (\r\n                <FormRow>\r\n                  <FormNumberField\r\n                    name=\"SamplesCount\"\r\n                    id=\"SamplesCount\"\r\n                    label={t(translations.AssignedSamplesToThisTicket)}\r\n                    min={1}\r\n                    max={item.SamplesCount ?? undefined}\r\n                    //disabled={!isSubTicket}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n              )}\r\n\r\n            <FormRow>\r\n              <Button\r\n                type=\"submit\"\r\n                startIcon={<Icon icon=\"save\" />}\r\n                disabled={processing}\r\n                processing={processing}\r\n              >\r\n                {t(translations.Submit)}\r\n              </Button>\r\n              <Button\r\n                startIcon={<Icon icon=\"times\" />}\r\n                color=\"default\"\r\n                onClick={onCancel}\r\n                disabled={processing}\r\n                variant=\"ghost\"\r\n              >\r\n                {t(translations.Cancel)}\r\n              </Button>\r\n            </FormRow>\r\n          </FormFieldsSection>\r\n        </StyledForm>\r\n      )}\r\n    </Formik>\r\n  );\r\n};\r\n","/**\r\n *\r\n * ServiceRequestTicketDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  IServiceRequestTicketEdit,\r\n  getInitialValues,\r\n  getTicketSchema,\r\n} from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema';\r\nimport { useServiceRequestsKanbanSlice } from 'app/pages/ServiceRequestsKanbanPage/slice';\r\n\r\nimport { Form } from '../Form';\r\nimport { Dto } from 'app/pages/ServiceRequestsKanbanPage/slice/types';\r\nimport { selectServiceRequestsKanbanProcessingInsert } from 'app/pages/ServiceRequestsKanbanPage/slice/selectors';\r\nimport { selectKnownModule } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { omit } from 'lodash';\r\n\r\nexport interface AddSubTicketProps {\r\n  parentTicket: IServiceRequestTicketDto;\r\n  useSidePanel: boolean;\r\n}\r\nexport function AddSubTicket({ parentTicket, ...props }: AddSubTicketProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useServiceRequestsKanbanSlice();\r\n  const processing = useSelector(selectServiceRequestsKanbanProcessingInsert);\r\n  const samplesAutomationEnabled = useSelector(state =>\r\n    selectKnownModule(state, KnownModules.SamplesAutomation),\r\n  );\r\n\r\n  const schema = React.useMemo(\r\n    () =>\r\n      getTicketSchema(\r\n        t,\r\n        {\r\n          Id: 0,\r\n          AssignedTo: parentTicket.AssignedTo,\r\n          AssignedTo_Id: parentTicket.AssignedTo_Id,\r\n          Index: parentTicket.Index + 1,\r\n          Priority: parentTicket.Priority,\r\n          SamplesCount: null,\r\n          ServiceRequest: parentTicket.ServiceRequest,\r\n          ServiceRequestId: parentTicket.ServiceRequestId,\r\n          ServiceRequestStatusId: parentTicket.ServiceRequestStatusId,\r\n          Status: parentTicket.Status,\r\n          SubSamplesCount: parentTicket.SubSamplesCount,\r\n          TotalSamplesCount: parentTicket.TotalSamplesCount,\r\n          ParentTicketId: parentTicket.Id,\r\n          ParentTicket: parentTicket,\r\n        },\r\n        samplesAutomationEnabled,\r\n      ),\r\n    [parentTicket, samplesAutomationEnabled, t],\r\n  );\r\n  const initialValues = React.useMemo(\r\n    () =>\r\n      getInitialValues(\r\n        {\r\n          ParentTicketId: parentTicket.Id,\r\n          AssignedTo: parentTicket.AssignedTo,\r\n          Status: parentTicket.Status,\r\n          Priority: parentTicket.Priority,\r\n        } as Dto,\r\n        t,\r\n      ),\r\n    [parentTicket, t],\r\n  );\r\n  const handleSubmit = React.useCallback(\r\n    (values: IServiceRequestTicketEdit) => {\r\n      dispatch(\r\n        actions.insert({\r\n          ...values,\r\n          ParentTicket: parentTicket,\r\n          // insert after the parent ticket\r\n          Index: parentTicket.Index + 1,\r\n          ServiceRequestId: parentTicket.ServiceRequestId,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch, parentTicket],\r\n  );\r\n  const item: Partial<Dto> = {\r\n    ...omit(parentTicket, 'Id', 'SamplesCount'),\r\n    ParentTicketId: parentTicket.Id,\r\n    SamplesCount: parentTicket.SamplesCount,\r\n  };\r\n\r\n  const handleCancel = () => dispatch(actions.showAddSubTicket());\r\n\r\n  const title = t(translations.AddSubServiceRequestTicket);\r\n\r\n  return (\r\n    <PageWrapper\r\n      topProcessing={processing}\r\n      titlePage={title}\r\n      closable\r\n      disableExpandToggle\r\n      hideTitleBar={false}\r\n      useSidePanel={props.useSidePanel}\r\n      closeCover={handleCancel}\r\n      isCover={true}\r\n    >\r\n      <>\r\n        <Form\r\n          schema={schema}\r\n          item={item}\r\n          processing={processing}\r\n          initialValues={initialValues}\r\n          onSubmit={handleSubmit}\r\n          onCancel={handleCancel}\r\n        />\r\n      </>\r\n    </PageWrapper>\r\n  );\r\n}\r\n","/**\r\n *\r\n * ServiceRequestTicketDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { getInitialValues, getTicketSchema } from './schema';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { IServiceRequestTicketEdit } from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails/schema';\r\nimport { useServiceRequestsKanbanSlice } from 'app/pages/ServiceRequestsKanbanPage/slice';\r\nimport { PartialExceptId } from 'utils/typeUtils';\r\nimport { Form } from './components/Form';\r\nimport {\r\n  selectEdit,\r\n  selectServiceRequestsKanbanProcessingUpdate,\r\n  selectShowAddSubTicket,\r\n} from 'app/pages/ServiceRequestsKanbanPage/slice/selectors';\r\nimport { AddSubTicket } from './components/AddSubTicket';\r\nimport { Comments } from 'app/components/Comments';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { getServiceRequestTicketTitle } from 'app/pages/ServiceRequestsKanbanPage/components/getServiceRequestTicketTitle';\r\nimport { ParentTicketDetailsButton } from 'app/pages/ServiceRequestsKanbanPage/components/ParentTicketDetailsButton';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\n\r\nexport interface ServiceRequestTicketDetailsProps {\r\n  item: IServiceRequestTicketDto;\r\n  useSidePanel: boolean;\r\n}\r\nexport function ServiceRequestTicketDetails({\r\n  item,\r\n  ...props\r\n}: ServiceRequestTicketDetailsProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useServiceRequestsKanbanSlice();\r\n  const showAddSubTicket = useSelector(selectShowAddSubTicket);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const samplesAutomationEnabled = useSelector(state =>\r\n    selectKnownModule(state, KnownModules.SamplesAutomation),\r\n  );\r\n  const processing = useSelector(selectServiceRequestsKanbanProcessingUpdate);\r\n  const editState = useSelector(selectEdit);\r\n  const editItem = editState.value;\r\n  const enableAddSubTicket =\r\n    !samplesAutomationEnabled || (editItem?.SamplesCount ?? 0) > 0;\r\n\r\n  const handleAddSubTicketClick = React.useCallback(() => {\r\n    dispatch(actions.showAddSubTicket(editItem));\r\n  }, [actions, dispatch, editItem]);\r\n  const rightTopActions: ActionRenderer[] = React.useMemo(() => {\r\n    const result: ActionRenderer[] = [];\r\n    if (editItem?.ParentTicketId === null) {\r\n      result.push(() => (\r\n        <TopActionButton\r\n          icon=\"plus\"\r\n          startIcon=\"plus\"\r\n          onClick={handleAddSubTicketClick}\r\n          disabled={!enableAddSubTicket}\r\n          title={t(translations.AddSubServiceRequestTicket)}\r\n          text={t(translations.AddSubServiceRequestTicket)}\r\n        />\r\n      ));\r\n    } else {\r\n      result.push(() => <ParentTicketDetailsButton item={editItem} />);\r\n    }\r\n    return result;\r\n  }, [editItem, handleAddSubTicketClick, enableAddSubTicket, t]);\r\n\r\n  const schema = React.useMemo(\r\n    () =>\r\n      editItem === undefined\r\n        ? undefined\r\n        : getTicketSchema(t, editItem, samplesAutomationEnabled),\r\n    [editItem, samplesAutomationEnabled, t],\r\n  );\r\n  const initialValues = React.useMemo(\r\n    () => getInitialValues(editItem as IServiceRequestTicketDto, t),\r\n    [editItem, t],\r\n  );\r\n  const handleSubmit = React.useCallback(\r\n    (values: IServiceRequestTicketEdit) => {\r\n      const updated: Partial<IServiceRequestTicketDto> = {\r\n        ...editItem,\r\n        ...{\r\n          AssignedTo: values.AssignedTo,\r\n          Status: values.Status,\r\n          Priority: values.Priority,\r\n          SamplesCount: values.SamplesCount,\r\n        },\r\n      };\r\n      if (\r\n        (updated as PartialExceptId<IServiceRequestTicketDto>).Id === undefined\r\n      ) {\r\n        return;\r\n      }\r\n      dispatch(\r\n        actions.update(updated as PartialExceptId<IServiceRequestTicketDto>),\r\n      );\r\n    },\r\n    [actions, dispatch, editItem],\r\n  );\r\n\r\n  const handleCancel = () => dispatch(layoutActions.resetSidePanel());\r\n  const cover = React.useMemo(() => {\r\n    return (\r\n      showAddSubTicket &&\r\n      editItem !== undefined && (\r\n        <AddSubTicket parentTicket={editItem} useSidePanel={false} />\r\n      )\r\n    );\r\n  }, [editItem, showAddSubTicket]);\r\n  const isAdmin = React.useMemo(\r\n    () =>\r\n      (editItem !== undefined &&\r\n        authenticatedUser?.IsAdminOf({\r\n          ServiceGroupId: editItem.ServiceRequest.Service.ServiceGroup.Id,\r\n          ServiceId: editItem.ServiceRequest.Service.Id,\r\n          ServiceTypeId: ServiceType.Sample,\r\n        })) ??\r\n      false,\r\n    [authenticatedUser, editItem],\r\n  );\r\n  const title =\r\n    editItem === undefined ? undefined : getServiceRequestTicketTitle(editItem);\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  return (\r\n    <PageWrapper\r\n      topProcessing={processing}\r\n      //pageName={t(translations.ServiceRequestTicketDetails)}\r\n      titlePage={title}\r\n      //pageLink={GetServiceRequestTicketDetailsPagePath(item.Id)}\r\n      loading={editState.status === 'pending'}\r\n      closable\r\n      disableExpandToggle\r\n      hideTitleBar={false}\r\n      cover={cover}\r\n      useSidePanel={props.useSidePanel}\r\n      rightTopActions={rightTopActions}\r\n    >\r\n      {schema !== undefined && editItem !== undefined && (\r\n        <>\r\n          <Form\r\n            schema={schema}\r\n            item={editItem}\r\n            initialValues={initialValues}\r\n            onSubmit={handleSubmit}\r\n            onCancel={handleCancel}\r\n            processing={processing}\r\n          />\r\n\r\n          {editItem.ParentTicketId === null && (\r\n            <Comments\r\n              defaultComment={{\r\n                IsInternal: isAdmin,\r\n              }}\r\n              commentType={CommentReferenceTypes.ServiceRequestTicket}\r\n              pageName={t(translations.ServiceRequestTickets)}\r\n              emailType=\"RequestComment\"\r\n              isAdmin={isAdmin}\r\n              referenceId={editItem.Id}\r\n              onCommentAdded={onCommentAdded}\r\n            />\r\n          )}\r\n        </>\r\n      )}\r\n    </PageWrapper>\r\n  );\r\n}\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { StockRenewalState } from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nimport {\r\n  selectEditCreatableService,\r\n  selectStockRenewalHasErrors,\r\n  selectStockRenewalValueHandler,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FieldHandler,\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { BookQuickServices } from '../Details/components/BookQuickServices';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\nimport { loadOfflineServiceData } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { ErrorsSummury } from 'app/components/Forms/FormsLayout/FormErrorSummury';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\n\r\nexport interface StockRenewalFormProps {\r\n  onSubmit: (item: StockRenewalState) => void;\r\n  onAddServiceClick: (services: number[]) => void;\r\n  initialValues: StockRenewalState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  innerFormRef: React.RefObject<FormikProps<StockRenewalState>>;\r\n  globalSettings: GlobalSettingsType;\r\n  onRenewStockClick?: (service: IOtherServices) => void;\r\n  editCreatable?: boolean;\r\n  onAddBatchClick: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n}\r\n\r\nexport const StockRenewalForm = React.memo(function StockRenewalForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isAdmin,\r\n  user,\r\n  globalSettings,\r\n  innerFormRef,\r\n  onRenewStockClick,\r\n  onAddServiceClick,\r\n  editCreatable,\r\n  onAddBatchClick,\r\n}: StockRenewalFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n\r\n  const fieldHandler = useSelector(selectStockRenewalValueHandler);\r\n  const hasError = useSelector(selectStockRenewalHasErrors);\r\n  const editCreatableService = useSelector(selectEditCreatableService);\r\n  const { newDate } = useSystemDate();\r\n  // const readonly = !isAdmin;\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const handleSubmit = (values: StockRenewalState) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values);\r\n      validateForms(true);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(actions.resetStockRenewalValueHandler());\r\n  };\r\n\r\n  /// Local State ///\r\n  const [serviceChanged, setServiceChanged] = React.useState(false);\r\n  const [\r\n    recentMostBatchesChanged,\r\n    setRecentMostBatchesChanged,\r\n  ] = React.useState(false);\r\n  const [allIsValid, setAllIsValid] = React.useState<boolean>(true);\r\n  const [servicesSelected, setServicesSelected] = useAsyncExtendedState<\r\n    IOtherServices[]\r\n  >(initialValues.Services ?? []);\r\n  // const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n  //   IOfflineServiceFilterDto | undefined\r\n  // >(initialValues.ServiceType ?? undefined);\r\n  // const IsAdmin = React.useCallback(\r\n  //   (service: IOtherServices) => {\r\n  //     return user?.IsAllGroupOrLabTechAdmin(\r\n  //       [service.ServiceGroupId ?? 0],\r\n  //       [\r\n  //         {\r\n  //           Id: service.ServiceTypeID,\r\n  //           Name: service.ServiceType,\r\n  //           ServiceTypeId: ServiceType.Offline,\r\n  //         } as IServiceTypeFilterDto,\r\n  //       ],\r\n  //     );\r\n  //   },\r\n  //   [user],\r\n  // );\r\n  // const [errorMessages, setErrorMessages] = React.useState<IndexNode[]>([]);\r\n  // const addErrorMessages = React.useCallback((data: string[]) => {\r\n  //   if (data.length > 0) {\r\n  //     setErrorMessages([]);\r\n  //     messagesHandler(data, 'error', (nodes: IndexNode[]) =>\r\n  //       setErrorMessages(() => nodes),\r\n  //     );\r\n  //   }\r\n  // }, []);\r\n  const handleFormChange = React.useCallback(\r\n    (\r\n      values: StockRenewalState,\r\n      isValid,\r\n      dirty,\r\n      setValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (recentMostBatchesChanged) {\r\n        setRecentMostBatchesChanged(false);\r\n      }\r\n      if (serviceChanged) {\r\n        setServiceChanged(false);\r\n      }\r\n    },\r\n    [recentMostBatchesChanged, serviceChanged],\r\n  );\r\n  const validateForms = React.useCallback((isValid: boolean) => {\r\n    setAllIsValid(isValid);\r\n  }, []);\r\n\r\n  // useEffects\r\n  React.useEffect(() => {\r\n    if (innerFormRef.current) {\r\n      innerFormRef.current.validateForm();\r\n    }\r\n  }, [innerFormRef]);\r\n\r\n  // React.useEffect(() => {\r\n  //   if (!!serviceChangeState) {\r\n  //     console.log('service settings: ', serviceSettings);\r\n  //     if (!!serviceChangeState) {\r\n  //       if (serviceSettings.budgetVisible) {\r\n  //         dispatch(\r\n  //           connectedFiltersActions.setConnectedValue({\r\n  //             fieldKey: 'Budget',\r\n  //             fieldValue: serviceChangeState.DefaultBudget,\r\n  //           }),\r\n  //         );\r\n  //         if (\r\n  //           serviceSettings.ReservationUserGroupGroupByBudgetUserGroup &&\r\n  //           serviceChangeState.DefaultBudget !== null\r\n  //         ) {\r\n  //           dispatch(\r\n  //             connectedFiltersActions.setConnectedValue({\r\n  //               fieldKey: 'UserGroup',\r\n  //               fieldValue: {\r\n  //                 Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n  //                 Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n  //               },\r\n  //             }),\r\n  //           );\r\n  //         }\r\n  //         if (\r\n  //           serviceSettings.budgetExpirementVisible &&\r\n  //           serviceChangeState.DefaultExperiment !== null\r\n  //         ) {\r\n  //           dispatch(\r\n  //             connectedFiltersActions.setConnectedValue({\r\n  //               fieldKey: 'BudgetExperiment',\r\n  //               fieldValue: serviceChangeState.DefaultExperiment,\r\n  //             }),\r\n  //           );\r\n  //         }\r\n  //       } else {\r\n  //         if (serviceSettings.isUserGroupCoordinator) {\r\n  //           dispatch(\r\n  //             connectedFiltersActions.setConnectedValue({\r\n  //               fieldKey: 'UserGroup',\r\n  //               fieldValue: {\r\n  //                 Id: user?.ActiveUserGroup?.Id,\r\n  //                 Name: user?.ActiveUserGroup?.Name,\r\n  //               },\r\n  //             }),\r\n  //           );\r\n  //         }\r\n  //       }\r\n  //     }\r\n  //     dispatch(actions.resetServiceChangeState());\r\n  //   }\r\n  // }, [\r\n  //   actions,\r\n  //   connectedFiltersActions,\r\n  //   dispatch,\r\n  //   serviceChangeState,\r\n  //   serviceSettings,\r\n  //   user?.ActiveUserGroup?.Id,\r\n  //   user?.ActiveUserGroup?.Name,\r\n  // ]);\r\n  React.useEffect(() => {\r\n    dispatch(\r\n      actions.setStockRenewalValue({\r\n        fieldKey: 'Services',\r\n        fieldValue: servicesSelected,\r\n      }),\r\n    );\r\n  }, [actions, dispatch, servicesSelected]);\r\n\r\n  const otherServicesSchema = Yup.array().of(\r\n    Yup.mixed() as Yup.SchemaOf<IOtherServices>,\r\n  );\r\n  const changeOfflineServices = React.useCallback(\r\n    (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n      if (operation === 'add') {\r\n        let addedServ = services.filter(\r\n          f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n        );\r\n        setServicesSelected([...servicesSelected, ...addedServ]);\r\n        setServiceChanged(true);\r\n      }\r\n      if (operation === 'remove') {\r\n        let otherServices = servicesSelected.filter(f => {\r\n          return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n        });\r\n        setServicesSelected(otherServices);\r\n        setServiceChanged(true);\r\n      }\r\n      if (operation === 'update') {\r\n        setServicesSelected(\r\n          servicesSelected.map(f => {\r\n            let service = services.find(\r\n              s => s.ServiceTypeID === f.ServiceTypeID,\r\n            );\r\n            if (!!service && service !== null) {\r\n              return Object.assign({}, f, service);\r\n            } else {\r\n              return f;\r\n            }\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [servicesSelected, setServicesSelected],\r\n  );\r\n  const stockRenwevalSchema: Yup.SchemaOf<StockRenewalState> = Yup.object({\r\n    Services: otherServicesSchema\r\n      .min(1)\r\n      .label(t(translations.Consumables) as string)\r\n      .required(t(translations.err_OfflineServiceTypeRequired) as string),\r\n    DateReceived: Yup.date()\r\n      .default(newDate())\r\n      .label(t(translations.DateReceived) as string)\r\n      .required(t(translations.err_DateReceived_required) as string),\r\n    AutoGenerateNewBatches: Yup.boolean()\r\n      .nullable()\r\n      .default(true)\r\n      .label(t(translations.AutoGenerateNewBatches) as string),\r\n  });\r\n  const initServices = async (): Promise<IOtherServices[]> => {\r\n    return new Promise(async resolve => {\r\n      resolve(servicesSelected);\r\n    });\r\n  };\r\n  const prepareService = (\r\n    serviceType: IOfflineServiceFilterDto,\r\n    otherData?: StockRenewalState,\r\n  ) => {\r\n    let batch =\r\n      otherData?.AutoGenerateNewBatches === false\r\n        ? serviceType.InventoryBatches.length > 0\r\n          ? serviceType.InventoryBatches.sort((a, b) => b.Id - a.Id)[0]\r\n          : null\r\n        : null;\r\n    let data = {\r\n      Id: 0,\r\n      BookedBy: user?.Id,\r\n      UserDisplayName: user?.Name,\r\n      BudgetID: null,\r\n      Budget: null,\r\n      Quantity: serviceType.DefaultQuantity,\r\n      DefaultQuantity: serviceType.DefaultQuantity,\r\n      IntQuantityOnly: serviceType.IntQuantityOnly,\r\n      DiscountFactor: 1,\r\n      Mandatory: false,\r\n      Remarks: t(translations.StockRenewal) as string,\r\n      ServiceDate: dateUtils.formatISO(\r\n        dateUtils.dateOrStringToDate(otherData?.DateReceived ?? newDate()),\r\n      ),\r\n      TrackInventory: serviceType.TrackInventory,\r\n      ServiceTypeID: serviceType.Id,\r\n      ServiceType: serviceType.Name,\r\n      ServiceGroupId: serviceType.ServiceGroupId,\r\n      Units: serviceType.UnitTypeName,\r\n      UserGroup: user?.ActiveUserGroup?.Id,\r\n      UserGroupName: user?.ActiveUserGroup?.Name,\r\n      AllowToUser: serviceType.AllowToUser,\r\n      BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n      StaffOnly: serviceType.StaffOnly,\r\n      InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n      InventoryBatchId: batch === null ? null : batch.Id,\r\n      InventoryBatchName: batch === null ? null : batch.Name,\r\n      InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n      RenewStockInventory: true,\r\n      AutoGenerateNewBatches: otherData?.AutoGenerateNewBatches ?? true,\r\n    } as IOtherServices;\r\n    return data;\r\n  };\r\n  const createService = (values: StockRenewalState) => async (\r\n    serviceType: IOfflineServiceFilterDto,\r\n  ): Promise<IOtherServices | undefined> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticService = prepareService(serviceType, values);\r\n      changeOfflineServices([staticService], 'add');\r\n      resolve(staticService);\r\n    });\r\n  };\r\n  const createServices = (values: StockRenewalState) => async (\r\n    serviceTypes: IOfflineServiceFilterDto[],\r\n  ): Promise<IOtherServices[]> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticServices = serviceTypes.map(f => prepareService(f, values));\r\n      changeOfflineServices(staticServices, 'add');\r\n      resolve(staticServices);\r\n    });\r\n  };\r\n  const onRemoveService = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices([service], 'remove');\r\n      resolve(service);\r\n    });\r\n  };\r\n  const onRemoveServices = async (services: IOtherServices[]) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices(services, 'remove');\r\n      resolve(services);\r\n    });\r\n  };\r\n  const onUpdateService = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices([service], 'update');\r\n      resolve(service);\r\n    });\r\n  };\r\n  const onAddAndRemoveServices = (values: StockRenewalState) => async (\r\n    serviceTypes: IOfflineServiceFilterDto[],\r\n    removed: IOtherServices[],\r\n  ): Promise<IOtherServices[]> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticServices = serviceTypes.map(f => prepareService(f, values));\r\n      let addedServ = staticServices.filter(\r\n        f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n      );\r\n      let otherServices = servicesSelected.filter(f => {\r\n        return !removed.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n      });\r\n      setServicesSelected([...otherServices, ...addedServ]);\r\n      setServiceChanged(true);\r\n      resolve([...otherServices, ...addedServ]);\r\n    });\r\n  };\r\n  const loadServiceTypes = async (\r\n    searchTerm: string | null,\r\n    predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n  ): Promise<IOfflineServiceFilterDto[]> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      try {\r\n        const data = await loadOfflineServiceData(\r\n          predicates,\r\n          'base',\r\n          [],\r\n          undefined,\r\n          'InventoryBatches',\r\n        )(searchTerm, undefined);\r\n        resolve(data.value);\r\n      } catch (error) {\r\n        resolve([]);\r\n      }\r\n    });\r\n  };\r\n\r\n  React.useEffect(() => {\r\n    if (\r\n      !!editCreatableService &&\r\n      servicesSelected.some(\r\n        f => f.ServiceTypeID === editCreatableService.ServiceTypeID,\r\n      )\r\n    ) {\r\n      changeOfflineServices([editCreatableService], 'update');\r\n      dispatch(actions.setEditCreatableService(undefined));\r\n      dispatch(actions.setRefreshConsumableOfflineServices(true));\r\n    }\r\n  }, [\r\n    actions,\r\n    changeOfflineServices,\r\n    dispatch,\r\n    editCreatableService,\r\n    servicesSelected,\r\n  ]);\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={stockRenwevalSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        validateOnChange={true}\r\n        enableReinitialize\r\n        innerRef={innerFormRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          if (allIsValid) {\r\n            formikHelpers.validateForm(values).then(responseErrors => {\r\n              if (!isEmpty(responseErrors)) {\r\n                formikHelpers.setSubmitting(false);\r\n                console.debug('errors', responseErrors);\r\n              } else if (\r\n                values.AutoGenerateNewBatches === false &&\r\n                values.Services.some(\r\n                  f => f.InventoryBatchesEnabled && f.InventoryBatchId === null,\r\n                )\r\n              ) {\r\n                // addErrorMessages([\r\n                //   `No batch associated with ${\r\n                //     values.Services.filter(\r\n                //       f =>\r\n                //         f.InventoryBatchesEnabled &&\r\n                //         f.InventoryBatchId === null,\r\n                //     )[0].ServiceType\r\n                //   }`,\r\n                // ]);\r\n                formikHelpers.setErrors({\r\n                  Services: `No batch associated with ${\r\n                    values.Services.filter(\r\n                      f =>\r\n                        f.InventoryBatchesEnabled &&\r\n                        f.InventoryBatchId === null,\r\n                    )[0].ServiceType\r\n                  }`,\r\n                });\r\n                formikHelpers.setSubmitting(false);\r\n              } else if (values.Services.length < 1) {\r\n                // addErrorMessages([\r\n                //   t(translations.err_OfflineServiceTypeRequired) as string,\r\n                // ]);\r\n                formikHelpers.setErrors({\r\n                  Services: t(\r\n                    translations.err_OfflineServiceTypeRequired,\r\n                  ) as string,\r\n                });\r\n                formikHelpers.setSubmitting(false);\r\n              }\r\n              // else if (errorMessages.length > 0) {\r\n              //   console.debug('errors', errorMessages);\r\n              //   formikHelpers.setSubmitting(false);\r\n              // }\r\n              else {\r\n                console.debug('submitting', values);\r\n                formikHelpers.setSubmitting(true);\r\n                handleSubmit(values);\r\n              }\r\n            });\r\n          } else {\r\n            formikHelpers.setSubmitting(false);\r\n          }\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Consumables errors', formik.errors);\r\n          }\r\n          console.log('Consumables submitting', formik.isSubmitting);\r\n          return (\r\n            <React.Fragment>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['Services']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={resetFieldHandler}\r\n                />\r\n                <SubmittingHandler\r\n                  value={hasError === true && submitting === undefined}\r\n                  resetSubmitting={resetSubmitting}\r\n                />\r\n                <ErrorsSummury errors={formik.errors} />\r\n                <FormLeftSection\r\n                // warningNodes={warningMessages}\r\n                // infoNodes={infoMessages}\r\n                //errors={errorMessages}\r\n                // successNodes={successMessages}\r\n                >\r\n                  <FormFieldsSection\r\n                    titleSection={\r\n                      t(translations.ReportConsumablesMainInfo) as string\r\n                    }\r\n                  >\r\n                    <FormRow fullRow>\r\n                      <FormBookitDateTimePicker\r\n                        fullWidth\r\n                        id=\"DateReceivedID\"\r\n                        name=\"DateReceived\"\r\n                        // clear={false}\r\n                        // label={t(translations.DateReceived) as string}\r\n                        label={t(translations.ReceivedDateTimeLabel) as string}\r\n                        labelInline={true}\r\n                        disabled={formik.isSubmitting}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow\r\n                      fullRow={true}\r\n                      hide={\r\n                        formik.values.Services.length > 0 &&\r\n                        !formik.values.Services.some(\r\n                          f => f.InventoryBatchesEnabled,\r\n                        )\r\n                      }\r\n                    >\r\n                      <FormCheckbox\r\n                        name=\"AutoGenerateNewBatches\"\r\n                        info={\r\n                          servicesSelected.length > 1\r\n                            ? t(\r\n                                translations.AutoGenerateNewBatchesDisabled_info,\r\n                              )\r\n                            : t(translations.AutoGenerateNewBatches_info)\r\n                        }\r\n                        label={t(translations.AutoGenerateNewBatches)}\r\n                        disabled={\r\n                          formik.isSubmitting || servicesSelected.length > 0\r\n                        }\r\n                        onChange={() => setRecentMostBatchesChanged(true)}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.ReportedConsumables) as string}\r\n                  >\r\n                    <BookQuickServices\r\n                      createServiceFromServiceType={createService(\r\n                        formik.values,\r\n                      )}\r\n                      createServicesFromServiceType={createServices(\r\n                        formik.values,\r\n                      )}\r\n                      onAddAndRemoveServices={onAddAndRemoveServices(\r\n                        formik.values,\r\n                      )}\r\n                      initServicesFunc={initServices}\r\n                      onServiceRemove={onRemoveService}\r\n                      onServicesRemove={onRemoveServices}\r\n                      onServiceUpdate={onUpdateService}\r\n                      onServiceClick={onRenewStockClick}\r\n                      isEditMode={false}\r\n                      disabled={false}\r\n                      useAssetSelection={true}\r\n                      onAddClick={onAddServiceClick}\r\n                      userName={user?.Id}\r\n                      createdEditable={editCreatable}\r\n                      loadSeviceTypes={loadServiceTypes}\r\n                      renewStock={true}\r\n                      onAddBatchClick={onAddBatchClick}\r\n                    />\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n  selectStockRenewalCompleted,\r\n  selectStockRenewalData,\r\n  selectStockRenewalHasErrors,\r\n  selectStockRenewalProcessing,\r\n} from '../Details/slice/selectors';\r\nimport {\r\n  RenewStockState,\r\n  StockRenewalParams,\r\n  StockRenewalState,\r\n} from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Roles, ScanTarget } from 'app/slice/types';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { StockRenewalForm } from './StockRenewalForm';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface StockRenewalProps extends CoverProps, SidePanelContentProps {\r\n  queryParams: StockRenewalParams;\r\n  initialServices: IOtherServices[];\r\n  onClose?: () => void;\r\n}\r\nexport const StockRenewal = React.memo(function StockRenewal(\r\n  props: StockRenewalProps,\r\n) {\r\n  const {\r\n    useSidePanel,\r\n    queryParams,\r\n    initialServices,\r\n    closeCover,\r\n    isCover,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const processing = useSelector(selectStockRenewalProcessing);\r\n  const actionCompleted = useSelector(selectStockRenewalCompleted);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const hasError = useSelector(selectStockRenewalHasErrors);\r\n  const stockRenewalServicesData = useSelector(selectStockRenewalData);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  //   const { checkIsMobile } = useIsMobile();\r\n  //   const mobile = checkIsMobile();\r\n  const globalSettings = useGlobalSettingsHook();\r\n  //Local State\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(\r\n    () => {\r\n      dispatch(actions.resetStockRenewalState());\r\n      return true;\r\n    },\r\n    undefined,\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  // const [submitAllowed, setSubmitAllowed] = React.useState<boolean | undefined>(\r\n  //   false,\r\n  // );\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n\r\n  //Refs\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<StockRenewalState>>(null);\r\n\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      User !== undefined &&\r\n      (User.Roles.includes(Roles.CalendarOnly) ||\r\n        User.Roles.includes(Roles.Readonly) ||\r\n        User.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [User]);\r\n  const assetsFilter = React.useMemo(() => {\r\n    const userGroups = User?.AdminServiceGroups.map(f => f.Id);\r\n    let filter: (string | Condition<IMyAssetsRow>)[] | undefined = [];\r\n    filter.push(\r\n      new Condition<IMyAssetsRow>(\r\n        'TrackInventory',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ),\r\n    );\r\n    filter.push(\r\n      new Condition<IMyAssetsRow>(\r\n        'ServiceGroupId',\r\n        ODataOperators.Includes,\r\n        userGroups || [],\r\n      ),\r\n    );\r\n    return filter.length > 0 ? filter : undefined;\r\n  }, [User?.AdminServiceGroups]);\r\n  //Methods\r\n\r\n  const handleCloselClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      closePanel({\r\n        isCover: isCover,\r\n        useSidePanel: useSidePanel,\r\n        showConfirm: hasChanges,\r\n        onClose: () => {\r\n          dispatch(actions.resetStockRenewalState());\r\n        },\r\n      } as SidePanelCloseState);\r\n    } else {\r\n      dispatch(push('/otherServices'));\r\n    }\r\n  }, [actions, closePanel, dispatch, hasChanges, isCover, useSidePanel]);\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: StockRenewalState) => {\r\n      setBusy(true);\r\n      dispatch(actions.createStockRenewals(values));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const onRenewStockClick = React.useCallback(\r\n    (service: IOtherServices) => {\r\n      let renewProps = {\r\n        initialService: service,\r\n        editCreatable: true,\r\n        queryParams: {\r\n          id: '' + service.Id ?? -1,\r\n        },\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.RenewStock,\r\n        renderPageProps: renewProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const onAddBatchClick = React.useCallback(\r\n    (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n      let batchProps = {\r\n        initialBatch: batch ?? undefined,\r\n        saveCreatable: true,\r\n        queryParams: {\r\n          id: '' + (batch?.Id ?? -1),\r\n          stid: '' + serviceType,\r\n        },\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.InventoryBatch,\r\n        renderPageProps: batchProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const onAddServiceClick = React.useCallback(\r\n    (services: number[]) => {\r\n      let selParams = {\r\n        actionType: 'OfflineService',\r\n        offTypeIds: services,\r\n        customPredicates: assetsFilter,\r\n      } as AssetsSelectionProps;\r\n      openPanel({\r\n        renderPageType: RenderPageType.AssetsSelection,\r\n        renderPageProps: selParams,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [assetsFilter, openPanel, useSidePanel],\r\n  );\r\n  //effects\r\n  useEffectOnMount(() => {\r\n    dispatch(\r\n      appSettingsActions.setBarcodeScannigTarget(ScanTarget.Consumables),\r\n    );\r\n    return () => {\r\n      dispatch(appSettingsActions.setBarcodeScannigTarget(ScanTarget.All));\r\n    };\r\n  });\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initStockRenewal({\r\n          query: queryParams,\r\n          services: initialServices,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    firstLoad,\r\n    globalSettings,\r\n    initialServices,\r\n    queryParams,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          dispatch(layoutActions.setNotSavedChanges(false));\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actionCompleted,\r\n    dispatch,\r\n    handleCloselClick,\r\n    hasError,\r\n    layoutActions,\r\n    processing,\r\n  ]);\r\n\r\n  // React.useEffect(() => {\r\n  //   setSubmitAllowed(\r\n  //     !!stockRenewalServicesData &&\r\n  //       stockRenewalServicesData.Services.length > 0,\r\n  //   );\r\n  // }, [setSubmitAllowed, stockRenewalServicesData]);\r\n  //memo\r\n  const IsAdmin = React.useMemo(() => {\r\n    return !!innerFormRef.current &&\r\n      innerFormRef.current.values.Services.length > 0\r\n      ? User?.IsAllGroupOrLabTechAdmin(\r\n          innerFormRef.current.values.Services.map(g => g.ServiceGroupId || 0),\r\n          innerFormRef.current.values.Services.map(f => {\r\n            return {\r\n              Id: f.ServiceTypeId,\r\n              Name: f.ServiceTypeName,\r\n              ServiceTypeId: ServiceType.Offline,\r\n            } as IServiceTypeFilterDto;\r\n          }),\r\n        )\r\n      : false;\r\n  }, [User]);\r\n  const rightActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={busy} // || !submitAllowed\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    actions.push(() => (\r\n      <Button\r\n        variant=\"ghost\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"times\" />}\r\n        onClick={handleCloselClick}\r\n      >\r\n        {t(translations.Close)}\r\n      </Button>\r\n    ));\r\n    return actions;\r\n  }, [busy, handleCloselClick, handleSaveClick, requestCompleted, t]);\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={t(translations.StockRenewals)}\r\n        titlePage={t(translations.StockRenewals)}\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || props.isCover}\r\n        disableExpandToggle={true}\r\n        closeSidePanel={handleCloselClick}\r\n        // leftTopActions={topButtons}\r\n        //rightTopActions={topButtons}\r\n        rightTopActionsAsMenu={true}\r\n        //leftTopActions={topActions}\r\n        //topProcessing={equipmentChangeCompleted === false}\r\n        leftActions={isReadOnlyUser ? [] : rightActions}\r\n        //rightActions={rightActions}\r\n        children={\r\n          stockRenewalServicesData !== undefined &&\r\n          !processing &&\r\n          globalSettings.loadCompleted ? (\r\n            <StockRenewalForm\r\n              initialValues={\r\n                stockRenewalServicesData || ({} as RenewStockState)\r\n              }\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              isAdmin={IsAdmin || false}\r\n              user={User}\r\n              globalSettings={globalSettings}\r\n              innerFormRef={innerFormRef}\r\n              editCreatable={true}\r\n              onRenewStockClick={onRenewStockClick}\r\n              onAddBatchClick={onAddBatchClick}\r\n              onAddServiceClick={onAddServiceClick}\r\n            />\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing || false} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + 'stockRenewals', queryParams)}\r\n        toPageLink={`stockRenewals?${toQueryString(queryParams)}`}\r\n        isCover={isCover}\r\n        cover={cover}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n        coverClosed={coverClosed}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { RenewStockState } from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nimport {\r\n  selectInventoryBatchEditable,\r\n  selectRenewStockHasErrors,\r\n  selectRenewStockValueHandler,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FieldHandler,\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { RenewStockRelatedFilter } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { ServiceTypeSchema } from 'app/components/Forms/Schemas';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { FormOfflineServiceTypePicker } from 'app/components/Forms/FormOfflineServiceTypePicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormInventoryBatchPicker } from 'app/components/Forms/FormInventoryBatchPicker';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BatchesByServiceTypeFilter } from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\n\r\nexport interface RenewStockFormProps {\r\n  onSubmit: (item: RenewStockState) => void;\r\n  initialValues: RenewStockState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  innerFormRef: React.RefObject<FormikProps<RenewStockState>>;\r\n  globalSettings: GlobalSettingsType;\r\n  isEdit: boolean;\r\n  editCreatable?: boolean;\r\n  onBatchClick: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n}\r\n\r\nexport const RenewStockForm = React.memo(function RenewStockForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isAdmin,\r\n  user,\r\n  globalSettings,\r\n  innerFormRef,\r\n  isEdit,\r\n  editCreatable,\r\n  onBatchClick,\r\n}: RenewStockFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n\r\n  const fieldHandler = useSelector(selectRenewStockValueHandler);\r\n  const hasError = useSelector(selectRenewStockHasErrors);\r\n  const batchRequested = useSelector(selectInventoryBatchEditable);\r\n  const { newDate } = useSystemDate();\r\n  // const readonly = !isAdmin;\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const handleSubmit = (values: RenewStockState) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(actions.resetRenewStockValueHandler());\r\n  };\r\n\r\n  /// Local State ///\r\n  const [serviceChanged, setServiceChanged] = React.useState(false);\r\n  const [batchChanged, setBatchChanged] = React.useState(false);\r\n\r\n  const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n    IOfflineServiceFilterDto | undefined\r\n  >(initialValues.ServiceType ?? undefined);\r\n  const minStep = React.useMemo(() => {\r\n    return !!serviceTypeSelected\r\n      ? serviceTypeSelected.IntQuantityOnly === true\r\n        ? 1\r\n        : 0.01\r\n      : 1;\r\n  }, [serviceTypeSelected]);\r\n  const step = React.useMemo(() => {\r\n    return !!serviceTypeSelected\r\n      ? serviceTypeSelected.IntQuantityOnly === true\r\n        ? 1\r\n        : 0.01\r\n      : 1;\r\n  }, [serviceTypeSelected]);\r\n\r\n  const maxStep = 9999;\r\n  const inputProps = {\r\n    step: step,\r\n    min: minStep,\r\n    max: maxStep,\r\n    'aria-label': 'Counter',\r\n  };\r\n\r\n  // const IsAdmin = React.useCallback(\r\n  //   (service: IOfflineServiceFilterDto) => {\r\n  //     return user?.IsAllGroupOrLabTechAdmin(\r\n  //       [service.ServiceGroupId ?? 0],\r\n  //       [\r\n  //         {\r\n  //           Id: service.Id,\r\n  //           Name: service.Name,\r\n  //           ServiceTypeId: ServiceType.Offline,\r\n  //         } as IServiceTypeFilterDto,\r\n  //       ],\r\n  //     );\r\n  //   },\r\n  //   [user],\r\n  // );\r\n\r\n  const handleFormChange = React.useCallback(\r\n    (values: RenewStockState) => {\r\n      if (serviceChanged) {\r\n        setServiceTypeSelected(values.ServiceType ?? undefined);\r\n        // dispatch(\r\n        //   connectedFiltersActions.extendSettingsState({\r\n        //     services:\r\n        //       values.Services.length < 1\r\n        //         ? []\r\n        //         : values.Services.map(f => {\r\n        //             return {\r\n        //               Id: f.ServiceTypeId,\r\n        //               Name: f.ServiceTypeName,\r\n        //               ServiceGroupId: f.ServiceGroupId,\r\n        //               ServiceTypeId: ServiceType.Offline,\r\n        //               Active: true,\r\n        //               BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n        //               HideProject: f.HideProjects,\r\n        //             } as IServiceTypeFilterDto;\r\n        //           }),\r\n        //     globalSettings: globalSettings,\r\n        //     settings: serviceSettings,\r\n        //     isEdit: false,\r\n        //     data: connectedData,\r\n        //   }),\r\n        // );\r\n        // if (values.Services.length > 0 && connectedData?.User !== null) {\r\n        //   const parameters = {\r\n        //     ServiceTypes: values.Services.map(f => f.ServiceTypeID),\r\n        //     ReservationId: null,\r\n        //     UsageId: null,\r\n        //     BookedBy: connectedData?.User?.Id || null,\r\n        //     ADGroup: connectedData?.UserGroup?.Id || null,\r\n        //     Start: dateUtils.formatISO(\r\n        //       dateUtils.dateOrStringToDate(\r\n        //         connectedData?.StartTime || newDate(),\r\n        //       ),\r\n        //     ),\r\n        //     BudgetId: connectedData?.Budget?.Id || null,\r\n        //     FundingTypeId: connectedData?.FundingType?.Id || 0,\r\n        //   } as ServiceChangeStateParameters;\r\n        //   dispatch(actions.initServiceChangeStateData(parameters));\r\n        // }\r\n        //setServiceTypesSelected(values.Services);\r\n        setServiceChanged(false);\r\n      }\r\n      if (batchChanged) {\r\n        setBatchChanged(false);\r\n      }\r\n    },\r\n    [batchChanged, serviceChanged, setServiceTypeSelected],\r\n  );\r\n\r\n  // useEffects\r\n  React.useEffect(() => {\r\n    if (innerFormRef.current) {\r\n      innerFormRef.current.validateForm();\r\n    }\r\n  }, [innerFormRef]);\r\n  React.useEffect(() => {\r\n    if (batchRequested !== undefined) {\r\n      dispatch(\r\n        actions.setRenewStockValue({\r\n          fieldKey: 'InventoryBatch',\r\n          fieldValue: batchRequested,\r\n        }),\r\n      );\r\n      dispatch(actions.setInventoryBatchEditable(undefined));\r\n    }\r\n  }, [actions, batchRequested, dispatch]);\r\n  // React.useEffect(() => {\r\n  //   if (!!serviceChangeState) {\r\n  //     console.log('service settings: ', serviceSettings);\r\n  //     if (!!serviceChangeState) {\r\n  //       if (serviceSettings.budgetVisible) {\r\n  //         dispatch(\r\n  //           connectedFiltersActions.setConnectedValue({\r\n  //             fieldKey: 'Budget',\r\n  //             fieldValue: serviceChangeState.DefaultBudget,\r\n  //           }),\r\n  //         );\r\n  //         if (\r\n  //           serviceSettings.ReservationUserGroupGroupByBudgetUserGroup &&\r\n  //           serviceChangeState.DefaultBudget !== null\r\n  //         ) {\r\n  //           dispatch(\r\n  //             connectedFiltersActions.setConnectedValue({\r\n  //               fieldKey: 'UserGroup',\r\n  //               fieldValue: {\r\n  //                 Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n  //                 Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n  //               },\r\n  //             }),\r\n  //           );\r\n  //         }\r\n  //         if (\r\n  //           serviceSettings.budgetExpirementVisible &&\r\n  //           serviceChangeState.DefaultExperiment !== null\r\n  //         ) {\r\n  //           dispatch(\r\n  //             connectedFiltersActions.setConnectedValue({\r\n  //               fieldKey: 'BudgetExperiment',\r\n  //               fieldValue: serviceChangeState.DefaultExperiment,\r\n  //             }),\r\n  //           );\r\n  //         }\r\n  //       } else {\r\n  //         if (serviceSettings.isUserGroupCoordinator) {\r\n  //           dispatch(\r\n  //             connectedFiltersActions.setConnectedValue({\r\n  //               fieldKey: 'UserGroup',\r\n  //               fieldValue: {\r\n  //                 Id: user?.ActiveUserGroup?.Id,\r\n  //                 Name: user?.ActiveUserGroup?.Name,\r\n  //               },\r\n  //             }),\r\n  //           );\r\n  //         }\r\n  //       }\r\n  //     }\r\n  //     dispatch(actions.resetServiceChangeState());\r\n  //   }\r\n  // }, [\r\n  //   actions,\r\n  //   connectedFiltersActions,\r\n  //   dispatch,\r\n  //   serviceChangeState,\r\n  //   serviceSettings,\r\n  //   user?.ActiveUserGroup?.Id,\r\n  //   user?.ActiveUserGroup?.Name,\r\n  // ]);\r\n  const computedSchema = React.useMemo(() => {\r\n    const renewStockSchema: Yup.SchemaOf<RenewStockState> = Yup.object({\r\n      Id: Yup.number().notRequired().default(-1),\r\n      ServiceType: ServiceTypeSchema.nullable().required(\r\n        t(translations.err_OfflineServiceTypeRequired),\r\n      ),\r\n      Quantity: Yup.number()\r\n        .label(t(translations.Quantity) as string)\r\n        .required(t(translations.err_Quantity_required))\r\n        .nullable()\r\n        .default(null)\r\n        .max(maxStep)\r\n        .min(minStep)\r\n        .test(\r\n          'empty',\r\n          t(translations.err_Quantity_required) as string,\r\n          (value, context) => {\r\n            let currVal = (context as any).from[0].value.Quantity;\r\n            if (\r\n              currVal === undefined ||\r\n              currVal === null ||\r\n              isNaN(currVal) ||\r\n              currVal === 0\r\n            ) {\r\n              return false;\r\n            }\r\n            return true;\r\n          },\r\n        )\r\n        .test(\r\n          'integerOnly',\r\n          t(translations.err_IntQuantityOnly) as string,\r\n          (value, context) => {\r\n            let currVal = (context as any).from[0].value.Quantity;\r\n            if (\r\n              !!serviceTypeSelected &&\r\n              serviceTypeSelected.IntQuantityOnly &&\r\n              currVal % 1 !== 0\r\n            ) {\r\n              return false;\r\n            }\r\n            return true;\r\n          },\r\n        ),\r\n      DateReceived: Yup.date()\r\n        .default(newDate())\r\n        .label(t(translations.DateReceived) as string)\r\n        .required(t(translations.err_DateReceived_required) as string),\r\n      Remarks: Yup.string()\r\n        .nullable()\r\n        .label(t(translations.Remarks) as string),\r\n      InventoryBatch: (Yup.mixed() as Yup.SchemaOf<IInventoryBatchDto>)\r\n        .nullable()\r\n        .label(t(translations.Batch) as string),\r\n    });\r\n    if (!!serviceTypeSelected && serviceTypeSelected.TrackInventory) {\r\n      if (serviceTypeSelected?.NotLessThanZero) {\r\n        if (serviceTypeSelected.Inventory === 0) {\r\n          renewStockSchema.fields.Quantity.withMutation(schema =>\r\n            schema\r\n              .label(t(translations.Quantity) as string)\r\n              .required(t(translations.err_Quantity_required))\r\n              .default(null)\r\n              .nullable()\r\n              .max(maxStep)\r\n              .min(minStep)\r\n              .test(\r\n                'empty',\r\n                t(translations.err_Quantity_required) as string,\r\n                (value, context) => {\r\n                  let currVal = context.from[0].value.Quantity;\r\n                  if (\r\n                    currVal === undefined ||\r\n                    currVal === null ||\r\n                    isNaN(currVal) ||\r\n                    currVal === 0\r\n                  ) {\r\n                    return false;\r\n                  }\r\n                  return true;\r\n                },\r\n              )\r\n              .test(\r\n                'minQuantWithZero',\r\n                t(\r\n                  translations.NotAllowNegativeInventory_currentEqualsZero_err,\r\n                ) as string,\r\n                (value, context) => {\r\n                  let currVal = context.from[0].value.Quantity;\r\n                  let current = currVal as number;\r\n                  if (current < 1) {\r\n                    return false;\r\n                  }\r\n                  return true;\r\n                },\r\n              ),\r\n          );\r\n        } else {\r\n          renewStockSchema.fields.Quantity.withMutation(schema =>\r\n            schema\r\n              .label(t(translations.Quantity) as string)\r\n              .required(t(translations.err_Quantity_required))\r\n              .max(maxStep)\r\n              .min(minStep)\r\n              .test(\r\n                'empty',\r\n                t(translations.err_Quantity_required) as string,\r\n                (value, context) => {\r\n                  let currVal = context.from[0].value.Quantity;\r\n                  if (\r\n                    currVal === undefined ||\r\n                    currVal === null ||\r\n                    isNaN(currVal) ||\r\n                    currVal === 0\r\n                  ) {\r\n                    return false;\r\n                  }\r\n                  return true;\r\n                },\r\n              )\r\n              .test(\r\n                'minQuant',\r\n                (t(\r\n                  translations.NotAllowNegativeInventory_currentMoreThanZero_err,\r\n                ) as string).replace(\r\n                  '{0}',\r\n                  serviceTypeSelected.Inventory.toString(),\r\n                ),\r\n                (value, context) => {\r\n                  let currVal = context.from[0].value.Quantity;\r\n                  let current = currVal as number;\r\n                  if (serviceTypeSelected.Inventory - current < 0) {\r\n                    return false;\r\n                  }\r\n                  return true;\r\n                },\r\n              ),\r\n          );\r\n        }\r\n      }\r\n      if (serviceTypeSelected?.InventoryBatchesEnabled) {\r\n        renewStockSchema.fields.InventoryBatch.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.Batch) as string)\r\n            .nullable()\r\n            .required(t(translations.err_InventoryBatch_required) as string),\r\n        );\r\n      }\r\n    }\r\n    return renewStockSchema;\r\n  }, [minStep, newDate, serviceTypeSelected, t]);\r\n\r\n  // const loadServiceTypes = async (\r\n  //   searchTerm: string | null,\r\n  // ): Promise<IOfflineServiceFilterDto[]> => {\r\n  //   return new Promise(async (resolve, reject) => {\r\n  //     try {\r\n  //       const data = await loadOfflineServiceType(\r\n  //         undefined,\r\n  //         [],\r\n  //         undefined,\r\n  //         'InventoryBatches',\r\n  //       )(searchTerm, undefined);\r\n  //       resolve(data.value);\r\n  //     } catch (error) {\r\n  //       resolve([]);\r\n  //     }\r\n  //   });\r\n  // };\r\n\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={computedSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        validateOnChange={true}\r\n        enableReinitialize\r\n        innerRef={innerFormRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n\r\n          formikHelpers.validateForm(values).then(responseErrors => {\r\n            if (!isEmpty(responseErrors)) {\r\n              formikHelpers.setSubmitting(false);\r\n              console.debug('errors', responseErrors);\r\n            } else {\r\n              console.debug('submitting', values);\r\n              formikHelpers.setSubmitting(true);\r\n              handleSubmit(values);\r\n            }\r\n          });\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Consumables errors', formik.errors);\r\n          }\r\n          console.log('Consumables submitting', formik.isSubmitting);\r\n          return (\r\n            <React.Fragment>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['ServiceType']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={resetFieldHandler}\r\n                />\r\n                <SubmittingHandler\r\n                  value={hasError === true && submitting === undefined}\r\n                  resetSubmitting={resetSubmitting}\r\n                />\r\n                <FormLeftSection\r\n                // warningNodes={warningMessages}\r\n                // infoNodes={infoMessages}\r\n                // errors={errorMessages}\r\n                // successNodes={successMessages}\r\n                >\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.RenewStockInfo) as string}\r\n                  >\r\n                    {editCreatable ? (\r\n                      <FormRow>\r\n                        <FormLabelText\r\n                          id=\"ServiceTypeID\"\r\n                          name=\"ServiceType\"\r\n                          label={t(translations.Consumable)}\r\n                          html={\r\n                            <Box\r\n                              width=\"100%\"\r\n                              display=\"flex\"\r\n                              flexDirection=\"row\"\r\n                              alignItems=\"center\"\r\n                              justifyContent=\"flex-start\"\r\n                            >\r\n                              {formik.values.ServiceType !== undefined &&\r\n                              formik.values.ServiceType !== null\r\n                                ? formik.values.ServiceType.Name\r\n                                : (t(translations.NA) as string)}\r\n                            </Box>\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                    ) : (\r\n                      <FormRow fullRow={true}>\r\n                        <FormOfflineServiceTypePicker\r\n                          fullWidth\r\n                          id=\"ServiceTypeID\"\r\n                          name=\"ServiceType\"\r\n                          predicates={RenewStockRelatedFilter()}\r\n                          urlType=\"base\"\r\n                          label={t(translations.Consumable)}\r\n                          placeholder={t(translations.PleaseSelectServices)}\r\n                          disabled={formik.isSubmitting || isEdit}\r\n                          onChange={val => {\r\n                            setServiceChanged(true);\r\n                          }}\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    <FormRow fullRow>\r\n                      <FormNumberField\r\n                        fullWidth\r\n                        id=\"QuantityID\"\r\n                        name=\"Quantity\"\r\n                        inputMode=\"decimal\"\r\n                        placeholder={t(translations.Quantity)}\r\n                        label={t(translations.Quantity)}\r\n                        disabled={formik.isSubmitting}\r\n                        onChange={event => {\r\n                          const precision =\r\n                            formik.values.ServiceType?.IntQuantityOnly === false\r\n                              ? 2\r\n                              : 0;\r\n                          const value = +(+event.target.value).toFixed(\r\n                            precision,\r\n                          );\r\n                          console.log('qyt', value);\r\n                        }}\r\n                        inputProps={inputProps}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormBookitDateTimePicker\r\n                        fullWidth\r\n                        id=\"DateReceivedID\"\r\n                        name=\"DateReceived\"\r\n                        // clear={false}\r\n                        label={t(translations.ReceivedDateTimeLabel) as string}\r\n                        labelInline={true}\r\n                        disabled={formik.isSubmitting}\r\n                      />\r\n                    </FormRow>\r\n                    {!!serviceTypeSelected &&\r\n                      serviceTypeSelected?.InventoryBatchesEnabled && (\r\n                        <React.Fragment>\r\n                          <FormRow>\r\n                            <FormInventoryBatchPicker\r\n                              name=\"InventoryBatch\"\r\n                              id=\"batchId\"\r\n                              fullWidth\r\n                              label={t(translations.Batch)}\r\n                              disabled={formik.isSubmitting}\r\n                              onChange={val => {\r\n                                setBatchChanged(true);\r\n                              }}\r\n                              predicates={BatchesByServiceTypeFilter(\r\n                                serviceTypeSelected.Id,\r\n                              )}\r\n                            />\r\n                          </FormRow>\r\n                          {formik.values.ServiceType !== null &&\r\n                            formik.values.ServiceType !== undefined && (\r\n                              <React.Fragment>\r\n                                <Button\r\n                                  variant=\"text\"\r\n                                  size=\"small\"\r\n                                  onClick={e =>\r\n                                    onBatchClick(\r\n                                      null,\r\n                                      formik.values.ServiceType?.Id ?? 0,\r\n                                    )\r\n                                  }\r\n                                >\r\n                                  {t(translations.AddNewBatch)}\r\n                                </Button>\r\n                                {formik.values.InventoryBatch !== null &&\r\n                                  formik.values.InventoryBatch !==\r\n                                    undefined && (\r\n                                    <Button\r\n                                      variant=\"text\"\r\n                                      size=\"small\"\r\n                                      onClick={e =>\r\n                                        onBatchClick(\r\n                                          formik.values.InventoryBatch ?? null,\r\n                                          formik.values.ServiceType?.Id ?? 0,\r\n                                        )\r\n                                      }\r\n                                    >\r\n                                      {t(translations.EditSelectedBatch)}\r\n                                    </Button>\r\n                                  )}\r\n                              </React.Fragment>\r\n                            )}\r\n                        </React.Fragment>\r\n                      )}\r\n\r\n                    <FormRow fullRow={true}>\r\n                      <FormRichTextField\r\n                        name=\"Remarks\"\r\n                        placeholder={t(translations.Remarks)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth={true}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n  selectIsEdit,\r\n  selectRenewStockCompleted,\r\n  selectRenewStockData,\r\n  selectRenewStockHasErrors,\r\n  selectRenewStockProcessing,\r\n} from '../Details/slice/selectors';\r\nimport { RenewStockParams, RenewStockState } from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { RenewStockForm } from './RenewStockForm';\r\nimport { Roles } from 'app/slice/types';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface RenewStockProps extends CoverProps, SidePanelContentProps {\r\n  queryParams: RenewStockParams;\r\n  initialService?: IOtherServices;\r\n  editCreatable?: boolean;\r\n  saveCreatable?: boolean;\r\n  preventRefreshTable?: boolean;\r\n  onClose?: () => void;\r\n}\r\nexport const RenewStock = React.memo(function RenewStock(\r\n  props: RenewStockProps,\r\n) {\r\n  const {\r\n    useSidePanel,\r\n    queryParams,\r\n    initialService,\r\n    editCreatable,\r\n    preventRefreshTable,\r\n    saveCreatable,\r\n    isCover,\r\n    closeCover,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const processing = useSelector(selectRenewStockProcessing);\r\n  const actionCompleted = useSelector(selectRenewStockCompleted);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const hasError = useSelector(selectRenewStockHasErrors);\r\n  const renewStockData = useSelector(selectRenewStockData);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const isEdit = useSelector(selectIsEdit);\r\n  //   const { checkIsMobile } = useIsMobile();\r\n  //   const mobile = checkIsMobile();\r\n  const globalSettings = useGlobalSettingsHook();\r\n  //Local State\r\n  // const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(\r\n    () => {\r\n      dispatch(actions.resetRenewStockState());\r\n      return true;\r\n    },\r\n    undefined,\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n\r\n  //Refs\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<RenewStockState>>(null);\r\n\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      User !== undefined &&\r\n      (User.Roles.includes(Roles.CalendarOnly) ||\r\n        User.Roles.includes(Roles.Readonly) ||\r\n        User.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [User]);\r\n\r\n  //Methods\r\n  // const closeCover = () => {\r\n  //   setCover(undefined);\r\n  // };\r\n  // const handleClose = () => {\r\n  //   if (hasChanges) {\r\n  //     dispatch(layoutActions.setConfirmOpen(true));\r\n  //   } else {\r\n  //     handleCloselClick();\r\n  //   }\r\n  // };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      closePanel({\r\n        isCover: isCover,\r\n        useSidePanel: useSidePanel,\r\n        showConfirm: hasChanges,\r\n        onClose: () => {\r\n          dispatch(actions.resetRenewStockState());\r\n        },\r\n      } as SidePanelCloseState);\r\n    } else {\r\n      dispatch(push('/otherServices'));\r\n    }\r\n    // if (!!onClose) {\r\n    //   onClose();\r\n    // } else {\r\n    //   if (useSidePanel) {\r\n    //     dispatch(layoutActions.resetSidePanel());\r\n    //   } else {\r\n    //     dispatch(push('/otherServices'));\r\n    //   }\r\n    // }\r\n    // dispatch(actions.resetRenewStockState());\r\n  }, [actions, closePanel, dispatch, hasChanges, isCover, useSidePanel]);\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: RenewStockState) => {\r\n      setBusy(true);\r\n      if (isEdit) {\r\n        dispatch(\r\n          actions.updateRenewStock({\r\n            current: values,\r\n            original: renewStockData || values,\r\n            editCreatable: editCreatable ?? false,\r\n            autoGenerateBatch: initialService?.AutoGenerateNewBatches,\r\n          }),\r\n        );\r\n      } else {\r\n        dispatch(\r\n          actions.createRenewStock({\r\n            model: values,\r\n            editCreatable: editCreatable ?? false,\r\n            preventRefreshTable: preventRefreshTable,\r\n            autoGenerateBatch: initialService?.AutoGenerateNewBatches,\r\n            saveCreatable: saveCreatable,\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      editCreatable,\r\n      initialService?.AutoGenerateNewBatches,\r\n      isEdit,\r\n      preventRefreshTable,\r\n      renewStockData,\r\n      saveCreatable,\r\n    ],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initRenewStock({\r\n          query: queryParams,\r\n          service: initialService,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    firstLoad,\r\n    globalSettings,\r\n    initialService,\r\n    queryParams,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          dispatch(layoutActions.setNotSavedChanges(false));\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actionCompleted,\r\n    dispatch,\r\n    handleCloselClick,\r\n    hasError,\r\n    layoutActions,\r\n    processing,\r\n  ]);\r\n  const onBatchClick = React.useCallback(\r\n    (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n      let batchProps = {\r\n        initialBatch:\r\n          batch?.OfflineServiceTypeId === undefined ? undefined : batch,\r\n        queryParams: {\r\n          id: '' + (batch?.Id ?? -1),\r\n          stid: '' + serviceType,\r\n        },\r\n        saveCreatable: true,\r\n        useSidePanel: true,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.InventoryBatch,\r\n        renderPageProps: batchProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  // React.useEffect(() => {\r\n  //   if (confirmApproved) {\r\n  //     dispatch(actions.resetRenewStockState());\r\n  //     if (continueToOther.continueOnApprove) {\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //       setTimeout(() => {\r\n  //         dispatch(\r\n  //           layoutActions.openSidePanel({\r\n  //             type: continueToOther.pageType,\r\n  //             props: continueToOther.pageProps,\r\n  //             expanded: continueToOther.expanded,\r\n  //           }),\r\n  //         );\r\n  //         dispatch(layoutActions.resetContinueState());\r\n  //       }, 200);\r\n  //     } else if (continueLink !== undefined) {\r\n  //       dispatch(appSettingsActions.navigate(continueLink));\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //     } else {\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //     }\r\n  //     //dispatch(actions.setChangedState(false));\r\n  //   }\r\n  //   if (confirmRejected) {\r\n  //     dispatch(layoutActions.resetConfirmState());\r\n  //   }\r\n\r\n  //   return () => undefined;\r\n  // }, [\r\n  //   actions,\r\n  //   appSettingsActions,\r\n  //   confirmApproved,\r\n  //   confirmRejected,\r\n  //   continueLink,\r\n  //   continueToOther,\r\n  //   dispatch,\r\n  //   layoutActions,\r\n  // ]);\r\n\r\n  //memo\r\n  const IsAdmin = React.useMemo(() => {\r\n    return !!innerFormRef.current &&\r\n      innerFormRef.current.values.ServiceType !== null\r\n      ? User?.IsAllGroupOrLabTechAdmin(\r\n          [innerFormRef.current.values.ServiceType.ServiceGroupId],\r\n          [\r\n            {\r\n              Id: innerFormRef.current.values.ServiceType.Id,\r\n              Name: innerFormRef.current.values.ServiceType.Name,\r\n              ServiceTypeId: ServiceType.Offline,\r\n            } as IServiceTypeFilterDto,\r\n          ],\r\n        )\r\n      : false;\r\n  }, [User]);\r\n  const rightActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={\r\n          busy ||\r\n          !(\r\n            !!innerFormRef.current &&\r\n            (innerFormRef.current.values.ServiceType ?? null) !== null\r\n          )\r\n        }\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    actions.push(() => (\r\n      <Button\r\n        variant=\"ghost\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"times\" />}\r\n        onClick={handleCloselClick}\r\n      >\r\n        {t(translations.Close)}\r\n      </Button>\r\n    ));\r\n    return actions;\r\n  }, [busy, handleCloselClick, handleSaveClick, requestCompleted, t]);\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={t(translations.RenewStockOfConsumables)}\r\n        titlePage={\r\n          renewStockData\r\n            ? isEdit\r\n              ? ` ${t(translations.RenewStock)} #${queryParams.id ?? 'N/A'}`\r\n              : ` ${t(translations.RenewStock)}`\r\n            : ` ${t(translations.RenewStock)}`\r\n        }\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || isCover}\r\n        disableExpandToggle={true}\r\n        closeSidePanel={handleCloselClick}\r\n        // leftTopActions={topButtons}\r\n        //rightTopActions={topButtons}\r\n        rightTopActionsAsMenu={true}\r\n        //leftTopActions={topActions}\r\n        //topProcessing={equipmentChangeCompleted === false}\r\n        leftActions={isReadOnlyUser ? [] : rightActions}\r\n        //rightActions={rightActions}\r\n        children={\r\n          renewStockData !== undefined &&\r\n          !processing &&\r\n          globalSettings.loadCompleted ? (\r\n            <RenewStockForm\r\n              initialValues={renewStockData || ({} as RenewStockState)}\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              isAdmin={IsAdmin || false}\r\n              user={User}\r\n              globalSettings={globalSettings}\r\n              innerFormRef={innerFormRef}\r\n              editCreatable={editCreatable}\r\n              isEdit={isEdit ?? false}\r\n              onBatchClick={onBatchClick}\r\n            />\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing || false} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + '/renwestock', queryParams)}\r\n        toPageLink={`renwestock?${toQueryString(queryParams)}`}\r\n        isCover={isCover}\r\n        cover={cover}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n        coverClosed={coverClosed}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { InventoryBatchState } from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nimport {\r\n  selectInventoryBatchHasErrors,\r\n  selectInventoryBatchValueHandler,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FieldHandler,\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { InventoryBatchRelatedFilter } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { ServiceTypeSchema } from 'app/components/Forms/Schemas';\r\nimport { FormOfflineServiceTypePicker } from 'app/components/Forms/FormOfflineServiceTypePicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface InventoryBatchFormProps {\r\n  onSubmit: (item: InventoryBatchState) => void;\r\n  initialValues: InventoryBatchState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  innerFormRef: React.RefObject<FormikProps<InventoryBatchState>>;\r\n  globalSettings: GlobalSettingsType;\r\n  isEdit: boolean;\r\n}\r\n\r\nexport const InventoryBatchForm = React.memo(function InventoryBatchForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isAdmin,\r\n  user,\r\n  globalSettings,\r\n  innerFormRef,\r\n  isEdit,\r\n}: InventoryBatchFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n\r\n  const fieldHandler = useSelector(selectInventoryBatchValueHandler);\r\n  const hasError = useSelector(selectInventoryBatchHasErrors);\r\n  const { newDate } = useSystemDate();\r\n  // const readonly = !isAdmin;\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const handleSubmit = (values: InventoryBatchState) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(actions.resetInventoryBatchValueHandler());\r\n  };\r\n\r\n  /// Local State ///\r\n  const [serviceChanged, setServiceChanged] = React.useState(false);\r\n  const [batchChanged, setBatchChanged] = React.useState(false);\r\n\r\n  const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n    IOfflineServiceFilterDto | undefined\r\n  >(initialValues.ServiceType ?? undefined);\r\n  const minStep = React.useMemo(() => {\r\n    return !!serviceTypeSelected\r\n      ? serviceTypeSelected.NotLessThanZero === true\r\n        ? 0\r\n        : -9999\r\n      : -9999;\r\n  }, [serviceTypeSelected]);\r\n  const maxStep = 9999;\r\n  const inputProps = {\r\n    step: 1,\r\n    min: minStep,\r\n    max: maxStep,\r\n    'aria-label': 'Inventory',\r\n  };\r\n\r\n  // const IsAdmin = React.useCallback(\r\n  //   (service: IOfflineServiceFilterDto) => {\r\n  //     return user?.IsAllGroupOrLabTechAdmin(\r\n  //       [service.ServiceGroupId ?? 0],\r\n  //       [\r\n  //         {\r\n  //           Id: service.Id,\r\n  //           Name: service.Name,\r\n  //           ServiceTypeId: ServiceType.Offline,\r\n  //         } as IServiceTypeFilterDto,\r\n  //       ],\r\n  //     );\r\n  //   },\r\n  //   [user],\r\n  // );\r\n\r\n  const handleFormChange = React.useCallback(\r\n    (values: InventoryBatchState) => {\r\n      if (serviceChanged) {\r\n        setServiceTypeSelected(values.ServiceType ?? undefined);\r\n        setServiceChanged(false);\r\n      }\r\n      if (batchChanged) {\r\n        setBatchChanged(false);\r\n      }\r\n    },\r\n    [batchChanged, serviceChanged, setServiceTypeSelected],\r\n  );\r\n\r\n  // useEffects\r\n  React.useEffect(() => {\r\n    if (innerFormRef.current) {\r\n      innerFormRef.current.validateForm();\r\n    }\r\n  }, [innerFormRef]);\r\n\r\n  const computedSchema = React.useMemo(() => {\r\n    const inventoryBatchSchema: Yup.SchemaOf<InventoryBatchState> = Yup.object({\r\n      Id: Yup.number().notRequired().default(-1),\r\n      Name: Yup.string()\r\n        .label(t(translations.BatchName) as string)\r\n        .required(t(translations.err_BatchName_required) as string),\r\n      ServiceType: ServiceTypeSchema.nullable().required(\r\n        t(translations.err_OfflineServiceTypeRequired),\r\n      ),\r\n      ExpirationDate: Yup.date()\r\n        .label(t(translations.BatchExpirationDate) as string)\r\n        .nullable()\r\n        .default(null),\r\n      PurchaseDate: Yup.date()\r\n        .default(newDate())\r\n        .label(t(translations.BatchPurchaseDate) as string)\r\n        .required(t(translations.err_BatchPurchaseDate_required) as string),\r\n      Inventory: Yup.number()\r\n        .label(t(translations.BatchInventory) as string)\r\n        .required(t(translations.err_BatchInventory_required) as string)\r\n        .max(maxStep)\r\n        .min(minStep)\r\n        .default(0)\r\n        .test(\r\n          'empty',\r\n          t(translations.err_BatchInventory_required) as string,\r\n          (value, context) => {\r\n            let currVal = (context as any).from[0].value.Inventory;\r\n            if (currVal === undefined || currVal === null || isNaN(currVal)) {\r\n              return false;\r\n            }\r\n            return true;\r\n          },\r\n        ),\r\n      Lot: Yup.string()\r\n        .nullable()\r\n        .label(t(translations.BatchLot) as string),\r\n      PurchasePricePerUnit: Yup.number()\r\n        .label(t(translations.BatchPurchasePricePerUnit) as string)\r\n        .nullable(true)\r\n        .default(null),\r\n    });\r\n\r\n    if (!!serviceTypeSelected && serviceTypeSelected.TrackInventory) {\r\n      if (serviceTypeSelected?.NotLessThanZero) {\r\n        inventoryBatchSchema.fields.Inventory.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.BatchInventory) as string)\r\n            .required(t(translations.err_BatchInventory_required))\r\n            .max(maxStep)\r\n            .min(minStep)\r\n            .default(0)\r\n            .test(\r\n              'empty',\r\n              t(translations.err_BatchInventory_required) as string,\r\n              (value, context) => {\r\n                let currVal = context.from[0].value.Inventory;\r\n                if (\r\n                  currVal === undefined ||\r\n                  currVal === null ||\r\n                  isNaN(currVal)\r\n                ) {\r\n                  return false;\r\n                }\r\n                return true;\r\n              },\r\n            )\r\n            .test(\r\n              'noLessThanZero',\r\n              t(translations.NotAllowNegativeInventory_err) as string,\r\n              (value, context) => {\r\n                let currVal = context.from[0].value.Inventory;\r\n                if (\r\n                  currVal === undefined ||\r\n                  currVal === null ||\r\n                  isNaN(currVal) ||\r\n                  currVal >= 0\r\n                ) {\r\n                  return true;\r\n                } else {\r\n                  return false;\r\n                }\r\n              },\r\n            ),\r\n        );\r\n      }\r\n    }\r\n    return inventoryBatchSchema;\r\n  }, [minStep, newDate, serviceTypeSelected, t]);\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={computedSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        validateOnChange={true}\r\n        enableReinitialize\r\n        innerRef={innerFormRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          formikHelpers.validateForm(values).then(responseErrors => {\r\n            if (!isEmpty(responseErrors)) {\r\n              formikHelpers.setSubmitting(false);\r\n              console.debug('errors', responseErrors);\r\n            } else {\r\n              console.debug('submitting', values);\r\n              formikHelpers.setSubmitting(true);\r\n              handleSubmit(values);\r\n            }\r\n          });\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Consumables errors', formik.errors);\r\n          }\r\n          return (\r\n            <React.Fragment>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['ServiceType']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={resetFieldHandler}\r\n                />\r\n                <SubmittingHandler\r\n                  value={hasError === true && submitting === undefined}\r\n                  resetSubmitting={resetSubmitting}\r\n                />\r\n                <FormLeftSection\r\n                // warningNodes={warningMessages}\r\n                // infoNodes={infoMessages}\r\n                // errors={errorMessages}\r\n                // successNodes={successMessages}\r\n                >\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.BatchInfo) as string}\r\n                  >\r\n                    <FormRow fullRow={true}>\r\n                      <FormOfflineServiceTypePicker\r\n                        fullWidth\r\n                        id=\"ServiceTypeID\"\r\n                        name=\"ServiceType\"\r\n                        predicates={InventoryBatchRelatedFilter()}\r\n                        urlType=\"base\"\r\n                        label={t(translations.Consumable)}\r\n                        placeholder={t(translations.PleaseSelectServices)}\r\n                        disabled={formik.isSubmitting || isEdit}\r\n                        onChange={val => {\r\n                          setServiceChanged(true);\r\n                        }}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormTextField\r\n                        name=\"Name\"\r\n                        label={t(translations.BatchName)}\r\n                        placeholder={t(translations.BatchName)}\r\n                        disabled={formik.isSubmitting}\r\n                        autoComplete=\"on\"\r\n                        id=\"BatchNameId\"\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormBookitDatePicker\r\n                        fullWidth\r\n                        id=\"PurchaseDateID\"\r\n                        name=\"PurchaseDate\"\r\n                        clearable={false}\r\n                        label={t(translations.BatchPurchaseDate) as string}\r\n                        disabled={formik.isSubmitting}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormBookitDatePicker\r\n                        fullWidth\r\n                        id=\"ExpirationDateID\"\r\n                        name=\"ExpirationDate\"\r\n                        clearable={true}\r\n                        label={t(translations.BatchExpirationDate) as string}\r\n                        disabled={formik.isSubmitting}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormNumberField\r\n                        fullWidth\r\n                        id=\"InventoryID\"\r\n                        name=\"Inventory\"\r\n                        inputMode=\"decimal\"\r\n                        info={\r\n                          t(\r\n                            translations.Inventory_ServiceType_Description,\r\n                          ) as string\r\n                        }\r\n                        placeholder={t(translations.BatchInventory)}\r\n                        label={t(translations.BatchInventory)}\r\n                        disabled={true}\r\n                        onChange={event => {\r\n                          const value = +(+event.target.value).toFixed(0);\r\n                          console.log('qyt', value);\r\n                        }}\r\n                        inputProps={inputProps}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormNumberField\r\n                        fullWidth\r\n                        id=\"InventoryID\"\r\n                        name=\"PurchasePricePerUnit\"\r\n                        inputMode=\"decimal\"\r\n                        placeholder={t(translations.BatchPurchasePricePerUnit)}\r\n                        label={t(translations.BatchPurchasePricePerUnit)}\r\n                        disabled={formik.isSubmitting}\r\n                        onChange={event => {\r\n                          const value = +(+event.target.value).toFixed(2);\r\n                          console.log('qyt', value);\r\n                        }}\r\n                        inputProps={{\r\n                          step: 1,\r\n                          min: 0,\r\n                          'aria-label': 'PurchasePricePerUnit',\r\n                        }}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormRichTextField\r\n                        name=\"Lot\"\r\n                        placeholder={t(translations.BatchLot)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth={true}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n  selectInventoryBatchCompleted,\r\n  selectInventoryBatchData,\r\n  selectInventoryBatchHasErrors,\r\n  selectInventoryBatchIsEdit,\r\n  selectInventoryBatchProcessing,\r\n} from '../Details/slice/selectors';\r\nimport {\r\n  InventoryBatchParams,\r\n  InventoryBatchState,\r\n} from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { InventoryBatchForm } from './InventoryBatchForm';\r\nimport { Roles } from 'app/slice/types';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface InventoryBatchProps extends CoverProps, SidePanelContentProps {\r\n  queryParams: InventoryBatchParams;\r\n  initialBatch?: IInventoryBatchDto;\r\n  onClose?: () => void;\r\n  saveCreatable?: boolean;\r\n  preventRefreshTable?: boolean;\r\n}\r\nexport const InventoryBatch = React.memo(function InventoryBatch(\r\n  props: InventoryBatchProps,\r\n) {\r\n  const {\r\n    useSidePanel,\r\n    queryParams,\r\n    initialBatch,\r\n    saveCreatable,\r\n    preventRefreshTable,\r\n    closeCover,\r\n    isCover,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const processing = useSelector(selectInventoryBatchProcessing);\r\n  const actionCompleted = useSelector(selectInventoryBatchCompleted);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const hasError = useSelector(selectInventoryBatchHasErrors);\r\n  const inventoryBatchData = useSelector(selectInventoryBatchData);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const isEdit = useSelector(selectInventoryBatchIsEdit);\r\n  //   const { checkIsMobile } = useIsMobile();\r\n  //   const mobile = checkIsMobile();\r\n  const globalSettings = useGlobalSettingsHook();\r\n  //Local State\r\n  // const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState(\r\n    () => {\r\n      dispatch(actions.resetInventoryBatchState());\r\n      return true;\r\n    },\r\n    undefined,\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n\r\n  //Refs\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<InventoryBatchState>>(null);\r\n\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      User !== undefined &&\r\n      (User.Roles.includes(Roles.CalendarOnly) ||\r\n        User.Roles.includes(Roles.Readonly) ||\r\n        User.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [User]);\r\n\r\n  //Methods\r\n  // const closeCover = () => {\r\n  //   setCover(undefined);\r\n  // };\r\n  // const handleClose = () => {\r\n  //   if (hasChanges) {\r\n  //     dispatch(layoutActions.setConfirmOpen(true));\r\n  //   } else {\r\n  //     handleCloselClick();\r\n  //   }\r\n  // };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    // if (!!onClose) {\r\n    //   onClose();\r\n    // } else {\r\n    //   if (useSidePanel) {\r\n    //     dispatch(layoutActions.resetSidePanel());\r\n    //   } else {\r\n    //     dispatch(push('/otherServices'));\r\n    //   }\r\n    // }\r\n    if (useSidePanel) {\r\n      closePanel({\r\n        isCover: isCover,\r\n        useSidePanel: useSidePanel,\r\n        showConfirm: hasChanges,\r\n        onClose: () => {\r\n          dispatch(actions.resetInventoryBatchState());\r\n        },\r\n      } as SidePanelCloseState);\r\n    } else {\r\n      dispatch(push('/otherServices'));\r\n    }\r\n  }, [actions, closePanel, dispatch, hasChanges, isCover, useSidePanel]);\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: InventoryBatchState) => {\r\n      setBusy(true);\r\n      if (isEdit) {\r\n        dispatch(\r\n          actions.updateInventoryBatch({\r\n            current: values,\r\n            original: inventoryBatchData || values,\r\n            saveCreatable: saveCreatable,\r\n            preventRefreshTable: preventRefreshTable,\r\n          }),\r\n        );\r\n      } else {\r\n        dispatch(\r\n          actions.createInventoryBatch({\r\n            model: values,\r\n            saveCreatable: saveCreatable,\r\n            preventRefreshTable: preventRefreshTable,\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      inventoryBatchData,\r\n      isEdit,\r\n      preventRefreshTable,\r\n      saveCreatable,\r\n    ],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initInventoryBatch({\r\n          query: queryParams,\r\n          batch: initialBatch,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actions, dispatch, firstLoad, globalSettings, initialBatch, queryParams]);\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actionCompleted, handleCloselClick, hasError, processing]);\r\n  // React.useEffect(() => {\r\n  //   if (confirmApproved) {\r\n  //     dispatch(actions.resetInventoryBatchState());\r\n  //     if (continueToOther.continueOnApprove) {\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //       setTimeout(() => {\r\n  //         dispatch(\r\n  //           layoutActions.openSidePanel({\r\n  //             type: continueToOther.pageType,\r\n  //             props: continueToOther.pageProps,\r\n  //             expanded: continueToOther.expanded,\r\n  //           }),\r\n  //         );\r\n  //         dispatch(layoutActions.resetContinueState());\r\n  //       }, 200);\r\n  //     } else if (continueLink !== undefined) {\r\n  //       dispatch(appSettingsActions.navigate(continueLink));\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //     } else {\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //     }\r\n  //     //dispatch(actions.setChangedState(false));\r\n  //   }\r\n  //   if (confirmRejected) {\r\n  //     dispatch(layoutActions.resetConfirmState());\r\n  //   }\r\n\r\n  //   return () => undefined;\r\n  // }, [\r\n  //   actions,\r\n  //   appSettingsActions,\r\n  //   confirmApproved,\r\n  //   confirmRejected,\r\n  //   continueLink,\r\n  //   continueToOther,\r\n  //   dispatch,\r\n  //   layoutActions,\r\n  // ]);\r\n\r\n  //memo\r\n  const IsAdmin = React.useMemo(() => {\r\n    return !!innerFormRef.current &&\r\n      innerFormRef.current.values.ServiceType !== null\r\n      ? User?.IsAllGroupOrLabTechAdmin(\r\n          [innerFormRef.current.values.ServiceType.ServiceGroupId],\r\n          [\r\n            {\r\n              Id: innerFormRef.current.values.ServiceType.Id,\r\n              Name: innerFormRef.current.values.ServiceType.Name,\r\n              ServiceTypeId: ServiceType.Offline,\r\n            } as IServiceTypeFilterDto,\r\n          ],\r\n        )\r\n      : false;\r\n  }, [User]);\r\n  const rightActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={\r\n          busy ||\r\n          !(\r\n            !!innerFormRef.current &&\r\n            (innerFormRef.current.values.ServiceType ?? null) !== null\r\n          )\r\n        }\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    actions.push(() => (\r\n      <Button\r\n        variant=\"ghost\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"times\" />}\r\n        onClick={handleCloselClick}\r\n      >\r\n        {t(translations.Close)}\r\n      </Button>\r\n    ));\r\n    return actions;\r\n  }, [busy, handleCloselClick, handleSaveClick, requestCompleted, t]);\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={t(translations.InventoryBatch)}\r\n        titlePage={\r\n          inventoryBatchData\r\n            ? isEdit\r\n              ? ` ${t(translations.Batch)} #${queryParams.id ?? 'N/A'}`\r\n              : ` ${t(translations.CreateNewBatch)}`\r\n            : ` ${t(translations.Batch)}`\r\n        }\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || props.isCover}\r\n        disableExpandToggle={true}\r\n        closeSidePanel={handleCloselClick}\r\n        // leftTopActions={topButtons}\r\n        //rightTopActions={topButtons}\r\n        rightTopActionsAsMenu={true}\r\n        //leftTopActions={topActions}\r\n        //topProcessing={equipmentChangeCompleted === false}\r\n        leftActions={isReadOnlyUser ? [] : rightActions}\r\n        //rightActions={rightActions}\r\n        children={\r\n          inventoryBatchData !== undefined &&\r\n          !processing &&\r\n          globalSettings.loadCompleted ? (\r\n            <InventoryBatchForm\r\n              initialValues={inventoryBatchData || ({} as InventoryBatchState)}\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              isAdmin={IsAdmin || false}\r\n              user={User}\r\n              globalSettings={globalSettings}\r\n              innerFormRef={innerFormRef}\r\n              isEdit={isEdit ?? false}\r\n            />\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing || false} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + '/inventoryBatch', queryParams)}\r\n        toPageLink={`inventoryBatch?${toQueryString(queryParams)}`}\r\n        isCover={isCover}\r\n        cover={cover}\r\n        coverClosed={coverClosed}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","/**\r\n *\r\n * ArticleAssociationForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport {\r\n  selectArticleDetails,\r\n  selectArticleDetailsForm,\r\n  selectArticles,\r\n  selectEditArticleAssociationBusy,\r\n} from '../slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { useArticlesSlice } from '../slice';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormAssetPicker } from 'app/components/Forms/FormAssetPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { GetCalibrationRecordFilter, GetInstrumentFilter } from '../utils';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useAllowedToChangeStatus } from '../Hooks/useAllowedToChangeStatus';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { ArticleComments } from '../ArticleComments';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ArticleFormPicker } from '../ArticleFormPickers';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport interface ArticleAssociationFormProps\r\n  extends SidePanelContentProps,\r\n    CoverProps {}\r\nexport interface IArticleAssociationForm {\r\n  RelatedUser: Entity<string> | null;\r\n  ServiceGroupAsset: IAssetDto | null;\r\n  //ServiceGroupAssets: Array<IAssetDto>;\r\n  InstrumentAssets: Array<IAssetDto>;\r\n  CalibrationRecord: Entity<number> | null;\r\n  PageNumber?: number | null;\r\n}\r\n\r\nconst assetSchema = Yup.mixed();\r\nconst assetsSchema = Yup.array().of(Yup.mixed() as Yup.SchemaOf<IAssetDto>);\r\n\r\nexport function ArticleAssociationForm(props: ArticleAssociationFormProps) {\r\n  const { useSidePanel = true, closeCover, isCover } = props;\r\n  const { t } = useTranslation();\r\n  const state = useSelector(selectArticles);\r\n  const articleDetails = useSelector(selectArticleDetails);\r\n  const articleDetailsForm = useSelector(selectArticleDetailsForm);\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const editProcessing = useSelector(selectEditArticleAssociationBusy);\r\n  const allowedToChangeStatus = useAllowedToChangeStatus();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const [canEditStatus, setCanEditStatus] = React.useState<boolean>(false);\r\n  const submitCommentRef = React.useRef<any>(null);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useArticlesSlice();\r\n  const schema: Yup.SchemaOf<IArticleAssociationForm> = Yup.object().shape(\r\n    {\r\n      CalibrationRecord: Yup.mixed().nullable().notRequired(),\r\n      RelatedUser: Yup.mixed().nullable().notRequired(),\r\n      //ServiceGroupAssets: assetsSchema.required(),\r\n      /*ServiceGroupAsset: assetSchema.nullable().required(),\r\n    InstrumentAssets: assetsSchema.required(),*/\r\n      ServiceGroupAsset: assetSchema.when(['InstrumentAssets'], {\r\n        is: v => (v === undefined ? true : v.length === 0),\r\n        then: assetSchema.required().nullable(),\r\n        otherwise: assetSchema.nullable().notRequired(),\r\n      }),\r\n      InstrumentAssets: assetsSchema.when(['ServiceGroupAsset'], {\r\n        is: v => v === null,\r\n        then: assetsSchema.required().min(1),\r\n        otherwise: assetsSchema.notRequired(),\r\n      }),\r\n      PageNumber: Yup.number().nullable().default(null),\r\n    },\r\n    [['ServiceGroupAsset', 'InstrumentAssets']],\r\n  );\r\n  const GetServiceGroupAsset = React.useCallback(asset => {\r\n    /*if (asset !== undefined && asset !== null) {\r\n        return asset.ServiceGroupId !== null &&\r\n          asset.ServiceGroupId !== undefined &&\r\n          (authenticatedUser?.HasAdminGroupOnlyPermissions(\r\n            asset.ServiceGroupId,\r\n          ) ||\r\n            authenticatedUser?.HasLabTechGroupPermissions(asset.ServiceGroupId))\r\n          ? asset\r\n          : null;\r\n      } else {\r\n        return null;\r\n      }*/\r\n    return asset;\r\n  }, []);\r\n  const initialValues: IArticleAssociationForm = React.useMemo(\r\n    () => ({\r\n      CalibrationRecord: {\r\n        Id: articleDetails?.CalibrationRecord,\r\n        Name: !!articleDetails?.CalibrationRecord\r\n          ? '#' +\r\n            articleDetails?.CalibrationRecord?.toString() +\r\n            ': ' +\r\n            articleDetails?.CalibrationRecordName\r\n          : '',\r\n      } as Entity<number>,\r\n      RelatedUser: {\r\n        Id: articleDetails?.RelatedUser,\r\n        Name: articleDetails?.RelatedUserDisplayName,\r\n      } as Entity<string>,\r\n      PageNumber: articleDetails?.PageNumber,\r\n      InstrumentAssets: articleDetailsForm?.InstrumentAssets,\r\n      /*articleDetailsForm?.InstrumentAssets.filter(\r\n        asset =>\r\n          asset.ServiceId !== null &&\r\n          asset.ServiceId !== undefined &&\r\n          (authenticatedUser?.HasAdminServicePermissions(\r\n            asset.ServiceTypeId ?? 1,\r\n            asset.ServiceId,\r\n          ) ||\r\n            authenticatedUser?.HasLabTechServicePermissions(\r\n              asset.ServiceTypeId ?? 1,\r\n              asset.ServiceId,\r\n            ) ||\r\n            authenticatedUser?.HasAdminGroupPermissions(\r\n              asset.ServiceGroupId ?? undefined,\r\n            ) ||\r\n            authenticatedUser?.HasLabTechGroupPermissions(\r\n              asset.ServiceGroupId ?? undefined,\r\n            )),\r\n      ),*/\r\n      /*ServiceGroupAssets: articleDetailsForm?.ServiceGroupAssets.filter(\r\n        asset =>\r\n          asset.ServiceGroupId !== null &&\r\n          asset.ServiceGroupId !== undefined &&\r\n          (authenticatedUser?.HasAdminGroupPermissions(asset.ServiceGroupId) ||\r\n            authenticatedUser?.HasLabTechGroupPermissions(\r\n              asset.ServiceGroupId,\r\n            )),\r\n      ),*/\r\n      ServiceGroupAsset:\r\n        articleDetailsForm !== undefined\r\n          ? GetServiceGroupAsset(articleDetailsForm?.ServiceGroupAssets[0])\r\n          : null,\r\n    }),\r\n    [\r\n      GetServiceGroupAsset,\r\n      articleDetails?.CalibrationRecord,\r\n      articleDetails?.CalibrationRecordName,\r\n      articleDetails?.PageNumber,\r\n      articleDetails?.RelatedUser,\r\n      articleDetails?.RelatedUserDisplayName,\r\n      articleDetailsForm,\r\n    ],\r\n  );\r\n  const [oldServiceGroups, setOldServiceGroups] = React.useState<IAssetDto[]>(\r\n    //initialValues.ServiceGroupAssets,\r\n    initialValues.ServiceGroupAsset === null\r\n      ? []\r\n      : [initialValues.ServiceGroupAsset],\r\n  );\r\n  const [serviceGroups, setServiceGroups] = React.useState<IAssetDto[]>(\r\n    //initialValues.ServiceGroupAssets,\r\n    initialValues.ServiceGroupAsset === null\r\n      ? []\r\n      : [initialValues.ServiceGroupAsset],\r\n  );\r\n  const [instruments, setInstruments] = React.useState<IAssetDto[]>(\r\n    initialValues.InstrumentAssets,\r\n  );\r\n\r\n  const { cover, closePanel, coverClosed, onCloseCover } = useSidePanelState();\r\n\r\n  const handleCloseClick = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: isCover,\r\n      useSidePanel: useSidePanel,\r\n      showConfirm: undefined,\r\n      onClose: () => {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n        dispatch(actions.resetArticleAssociationState());\r\n      },\r\n    } as SidePanelCloseState);\r\n  }, [actions, closePanel, dispatch, isCover, layoutActions, useSidePanel]);\r\n\r\n  React.useEffect(() => {\r\n    if (editProcessing === false) {\r\n      handleCloseClick();\r\n    }\r\n    return () => undefined;\r\n  }, [editProcessing, handleCloseClick]);\r\n\r\n  const instrumentFilter = React.useCallback(() => {\r\n    return GetInstrumentFilter(serviceGroups);\r\n  }, [serviceGroups]);\r\n  const CalibrationRecordFilter = React.useCallback(() => {\r\n    return GetCalibrationRecordFilter(instruments);\r\n  }, [instruments]);\r\n  const handleFormChange = React.useCallback(\r\n    (\r\n      values: IArticleAssociationForm,\r\n      isValid,\r\n      dirty,\r\n      setValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (\r\n        serviceGroups.length !== oldServiceGroups.length ||\r\n        serviceGroups[0] !== oldServiceGroups[0]\r\n      ) {\r\n        setOldServiceGroups(serviceGroups);\r\n        setValue('InstrumentAssets', []);\r\n        return;\r\n      }\r\n      if (\r\n        values.ServiceGroupAsset === null &&\r\n        values.InstrumentAssets.length > 0\r\n      ) {\r\n        setOldServiceGroups(serviceGroups);\r\n        setValue('ServiceGroupAsset', {\r\n          Id: values.InstrumentAssets[0].ServiceGroupAssetId,\r\n          Name: values.InstrumentAssets[0].ServiceGroupName,\r\n          ServiceGroupId: values.InstrumentAssets[0].ServiceGroupId,\r\n          ServiceGroupName: values.InstrumentAssets[0].ServiceGroupName,\r\n        });\r\n      }\r\n      setCanEditStatus(allowedToChangeStatus(serviceGroups[0]));\r\n    },\r\n    [allowedToChangeStatus, oldServiceGroups, serviceGroups],\r\n  );\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: IArticleAssociationForm) => {\r\n      if (articleDetails === undefined) {\r\n        return;\r\n      }\r\n      const payload: IArticleDto = {\r\n        ...articleDetails,\r\n        ...{\r\n          RelatedUser:\r\n            values.RelatedUser !== null && !!values.RelatedUser\r\n              ? values.RelatedUser?.Id\r\n              : null,\r\n        },\r\n        ...{\r\n          CalibrationRecord:\r\n            values.CalibrationRecord !== null && !!values.CalibrationRecord\r\n              ? values.CalibrationRecord?.Id\r\n              : null,\r\n        },\r\n        ...{\r\n          //Assets: values.ServiceGroupAssets.concat(values.InstrumentAssets),\r\n          Assets:\r\n            values.ServiceGroupAsset !== null && !!values.ServiceGroupAsset\r\n              ? values.InstrumentAssets.concat([values.ServiceGroupAsset])\r\n              : values.InstrumentAssets,\r\n        },\r\n        PageNumber:\r\n          articleDetails?.ExternalIdSource === 'PubMed'\r\n            ? values.PageNumber !== undefined\r\n              ? values.PageNumber\r\n              : null\r\n            : articleDetails?.PageNumber,\r\n        Status: allowedToChangeStatus(serviceGroups[0])\r\n          ? ArticleStatus.Approved\r\n          : ArticleStatus.AwaitingApproval,\r\n      };\r\n      dispatch(actions.saveArticleAssociation(payload));\r\n    },\r\n    [actions, allowedToChangeStatus, articleDetails, dispatch, serviceGroups],\r\n  );\r\n  const processing = state.editArticleAssociationBusy;\r\n\r\n  return (\r\n    <PageWrapper\r\n      useSidePanel={true}\r\n      closable={true}\r\n      disableExpandToggle={true}\r\n      pageName={t(translations.AssociateThisPublication)}\r\n      titlePage={articleDetails?.Title ?? undefined}\r\n      titleTooltip={articleDetails?.Title ?? undefined}\r\n      closeSidePanel={handleCloseClick}\r\n      topProcessing={processing}\r\n      cover={cover}\r\n      closeCover={!isCover ? onCloseCover : closeCover}\r\n      isCover={isCover}\r\n      coverClosed={coverClosed}\r\n    >\r\n      <Box height={'100%'} p={1}>\r\n        <Formik\r\n          initialValues={initialValues}\r\n          onSubmit={handleSubmit}\r\n          validationSchema={schema}\r\n        >\r\n          {formik => (\r\n            <StyledForm onSubmit={formik.handleSubmit}>\r\n              <FormFieldsSection>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['ServiceGroupAsset', 'InstrumentAssets']}\r\n                />\r\n                <FormRow>\r\n                  <FormUserPicker\r\n                    name=\"RelatedUser\"\r\n                    label={t(translations.RelatedUser)}\r\n                    placeholder={t(translations.PleaseSelectAUser)}\r\n                    disabled={formik.isSubmitting || !canEditStatus}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow>\r\n                  <ArticleFormPicker\r\n                    name=\"CalibrationRecord\"\r\n                    label={\r\n                      instruments.length > 0\r\n                        ? t(translations.CalibrationRecord)\r\n                        : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n                    }\r\n                    placeholder={\r\n                      instruments.length > 0\r\n                        ? t(translations.PleaseSelectWorkOrder)\r\n                        : t(translations.ArticlePleaseSelectEquipmentFirst)\r\n                    }\r\n                    disabled={\r\n                      formik.isSubmitting ||\r\n                      !canEditStatus ||\r\n                      instruments.length === 0\r\n                    }\r\n                    filter={CalibrationRecordFilter()}\r\n                    info={t(translations.CalibrationRecord_info)}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                {articleDetails?.ExternalIdSource === 'PubMed' && (\r\n                  <FormRow>\r\n                    <FormTextField\r\n                      name=\"PageNumber\"\r\n                      id=\"PageNumberId\"\r\n                      label={t(translations.ArticlePageNumber)}\r\n                      type=\"number\"\r\n                      disabled={processing}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                )}\r\n                <FormRow>\r\n                  <FormAssetPicker\r\n                    admin={false}\r\n                    showOnlyActiveAssets={true}\r\n                    name=\"ServiceGroupAsset\"\r\n                    restrictByAvType=\"serviceGroup\"\r\n                    label={t(translations.ServiceGroup)}\r\n                    placeholder={t(translations.PleaseSelectAsset)}\r\n                    //setCover\r\n                    //onChipClick={onAssetClicked}\r\n                    //onChange={() => setAssetChanged(true)}\r\n                    onChange={(value: any) => {\r\n                      setOldServiceGroups(serviceGroups);\r\n                      setServiceGroups([value]);\r\n                    }}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow>\r\n                  <FormAssetsPicker\r\n                    admin={false}\r\n                    predicates={instrumentFilter()}\r\n                    showOnlyActiveAssets={true}\r\n                    name=\"InstrumentAssets\"\r\n                    restrictByAvType=\"bookableAndnotbookable\"\r\n                    label={t(translations.Instruments)}\r\n                    placeholder={t(translations.PleaseSelectAsset)}\r\n                    //setCover\r\n                    //onChipClick={onAssetClicked}\r\n                    //onChange={() => setAssetChanged(true)}\r\n                    fullWidth\r\n                    withoutServiceGroups={true}\r\n                    onChange={(value: any) => {\r\n                      setInstruments(value);\r\n                    }}\r\n                  />\r\n                </FormRow>\r\n                {articleDetails && articleDetails.Id > 0 && (\r\n                  <FormFieldsSection>\r\n                    <ArticleComments\r\n                      commentsFormRef={submitCommentRef}\r\n                      isEdit={true}\r\n                      user={user}\r\n                      article={articleDetails}\r\n                      disabled={false}\r\n                    />\r\n                  </FormFieldsSection>\r\n                )}\r\n                <FormRow>\r\n                  <Button processing={processing} type=\"submit\">\r\n                    {t(translations.Submit)}\r\n                  </Button>\r\n                </FormRow>\r\n              </FormFieldsSection>\r\n            </StyledForm>\r\n          )}\r\n        </Formik>\r\n      </Box>\r\n    </PageWrapper>\r\n  );\r\n}\r\n","import { PageTypeProps, RenderPageType } from '../../slice/type';\r\nimport * as React from 'react';\r\nimport {\r\n  TrainingDetails,\r\n  TrainingDetailsProps,\r\n} from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { StartQuiz, StartQuizProps } from 'app/pages/QuizPage/StartQuiz';\r\nimport {\r\n  QuizDetails,\r\n  QuizDetailsProps,\r\n} from 'app/pages/QuizDetailsPage/QuizDetails';\r\nimport { AssetPopUp, AssetPopUpProps } from 'app/pages/AssetPopUp';\r\nimport {\r\n  LocationDetails,\r\n  LocationDetailsProps,\r\n} from 'app/pages/LocationsPage/Details';\r\nimport {\r\n  WorkOrderDetails,\r\n  WorkOrderDetailsProps,\r\n} from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { AddPayment, PaymentProps } from 'app/pages/AddPaymentPage';\r\nimport { AddCharge, ChargeProps } from 'app/pages/AddChargePage';\r\nimport {\r\n  InvoiceDetailsSidePanel,\r\n  InvoiceDetailsSidePanelProps,\r\n} from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport {\r\n  BillingActionsDetails,\r\n  BillingActionsDetailsProps,\r\n} from 'app/pages/BillingActions/BillingActionsDetailsPage/Details';\r\nimport {\r\n  SavedViewDetails,\r\n  SavedViewDetailsProps,\r\n} from 'app/pages/SavedViewsPage/SavedViewPage/Details';\r\nimport { LabelTypePage } from 'app/pages/LabelTypesPage/LabelTypeEdit/Loadable';\r\nimport { LabelTypeEditProps } from 'app/pages/LabelTypesPage/LabelTypeEdit';\r\nimport {\r\n  InstrumentRestrictions,\r\n  InstrumentRestrictionsProps,\r\n} from 'app/pages/InstrumentRestrictionsPage/Details/InstrumentRestrictions';\r\nimport {\r\n  ReservationDetails,\r\n  ReservationDetailsProps,\r\n} from 'app/pages/ReservationDetails/Details';\r\nimport {\r\n  InvoiceTemplatePopUp,\r\n  InvoiceTemplatePopUpProps,\r\n} from 'app/pages/InvoiceTemplates/InvoiceTemplatePopUp';\r\nimport {\r\n  OtherServiceDetails,\r\n  OtherServiceDetailsProps,\r\n} from 'app/pages/OtherServiceDetails/Details';\r\nimport {\r\n  PricePeriodDetails,\r\n  PricePeriodDetailsProps,\r\n} from 'app/pages/PriceSheetPeriodDetails/Details';\r\nimport {\r\n  ArticleDetails,\r\n  ArticleDetailsProps,\r\n} from 'app/pages/ArticlesPage/ArticleDetails';\r\nimport {\r\n  CoreSelection,\r\n  CoreSelectionProps,\r\n} from 'app/pages/CoreSelectionPage/CoreSelection';\r\nimport {\r\n  AssetsSelection,\r\n  AssetsSelectionProps,\r\n} from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport {\r\n  NewArticleDetailsForm,\r\n  NewArticleDetailsFormProps,\r\n} from 'app/pages/ArticlesPage/NewArticleDetailsForm';\r\nimport {\r\n  EditArticleDetailsForm,\r\n  EditArticleDetailsFormProps,\r\n} from 'app/pages/ArticlesPage/EditArticleDetailsForm';\r\nimport {\r\n  UserAttributesDetails,\r\n  UserAttributesDetailsProps,\r\n} from 'app/pages/UserAttributes/UserAttributesDetailsPage/Details';\r\nimport {\r\n  ServiceRequestDetails,\r\n  ServiceRequestDetailsProps,\r\n} from 'app/pages/Samples/RequestSamplesPage';\r\nimport {\r\n  ServiceRequestTicketDetails,\r\n  ServiceRequestTicketDetailsProps,\r\n} from 'app/pages/ServiceRequestTicketDetailsPage/ServiceRequestTicketDetails';\r\nimport {\r\n  ReportConsumables,\r\n  ReportConsumablesProps,\r\n} from 'app/pages/OtherServiceDetails/ReportConsumables';\r\nimport {\r\n  CalendarMessagesDetails,\r\n  CalendarMessagesDetailsProps,\r\n} from 'app/pages/CalendarMessages/CalendarMessagesDetails/Details';\r\nimport {\r\n  ServiceRequestMilestoneChargeDetails,\r\n  ServiceRequestMilestoneChargeDetailsProps,\r\n} from 'app/pages/Samples/components/ServiceRequestMilestoneChargeDetails';\r\nimport {\r\n  ServiceRequestMilestoneDetails,\r\n  ServiceRequestMilestoneDetailsProps,\r\n} from 'app/pages/Samples/components/ServiceRequestMilestoneDetails';\r\nimport {\r\n  StockRenewal,\r\n  StockRenewalProps,\r\n} from 'app/pages/OtherServiceDetails/StockRenewal';\r\nimport {\r\n  RenewStock,\r\n  RenewStockProps,\r\n} from 'app/pages/OtherServiceDetails/RenewStock';\r\nimport {\r\n  InventoryBatch,\r\n  InventoryBatchProps,\r\n} from 'app/pages/OtherServiceDetails/InventoryBatch';\r\nimport {\r\n  InvoiceBatchesComments,\r\n  InvoiceBatchesCommentsProps,\r\n} from 'app/pages/InvoiceBatches/InvoiceBatchesComments';\r\nimport {\r\n  InventoryLog,\r\n  InventoryLogProps,\r\n} from 'app/pages/AssetsInventoryLog/InventoryLog';\r\nimport {\r\n  ArticleAssociationForm,\r\n  ArticleAssociationFormProps,\r\n} from 'app/pages/ArticlesPage/ArticleAssociationForm';\r\nimport {\r\n  RegionDetails,\r\n  RegionDetailsProps,\r\n} from 'app/pages/Regions/RegionsDetailsPage/Details';\r\n\r\nexport interface SidePanelRendererProps {\r\n  renderPageType?: RenderPageType;\r\n  renderPageProps: PageTypeProps;\r\n}\r\n\r\nexport function SidePanelRenderer(props: SidePanelRendererProps) {\r\n  const { renderPageType, renderPageProps } = props;\r\n\r\n  switch (renderPageType) {\r\n    case RenderPageType.TrainingDetails:\r\n      return <TrainingDetails {...(renderPageProps as TrainingDetailsProps)} />;\r\n    case RenderPageType.QuizCreate:\r\n      return <StartQuiz {...(renderPageProps as StartQuizProps)} />;\r\n    case RenderPageType.QuizzDetails:\r\n      return <QuizDetails {...(renderPageProps as QuizDetailsProps)} />;\r\n    case RenderPageType.LocationDetails:\r\n      return <LocationDetails {...(renderPageProps as LocationDetailsProps)} />;\r\n    case RenderPageType.AssetDetails:\r\n      return <AssetPopUp {...(renderPageProps as AssetPopUpProps)} />;\r\n    case RenderPageType.WorkOrderDetails:\r\n      return (\r\n        <WorkOrderDetails {...(renderPageProps as WorkOrderDetailsProps)} />\r\n      );\r\n    case RenderPageType.AddCharge:\r\n      return <AddCharge {...(renderPageProps as ChargeProps)} />;\r\n    case RenderPageType.AddPayment:\r\n      return <AddPayment {...(renderPageProps as PaymentProps)} />;\r\n    case RenderPageType.InvoiceDetails:\r\n      return (\r\n        <InvoiceDetailsSidePanel\r\n          {...(renderPageProps as InvoiceDetailsSidePanelProps)}\r\n        />\r\n      );\r\n    case RenderPageType.AddBillingAction:\r\n      return (\r\n        <BillingActionsDetails\r\n          {...(renderPageProps as BillingActionsDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.SavedViewDetails:\r\n      return (\r\n        <SavedViewDetails {...(renderPageProps as SavedViewDetailsProps)} />\r\n      );\r\n    case RenderPageType.LabelType:\r\n      return <LabelTypePage {...(renderPageProps as LabelTypeEditProps)} />;\r\n    case RenderPageType.OtherServiceDetails:\r\n      return (\r\n        <OtherServiceDetails\r\n          {...(renderPageProps as OtherServiceDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.RestrictionDetails:\r\n      return (\r\n        <InstrumentRestrictions\r\n          {...(renderPageProps as InstrumentRestrictionsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.ReservationDetails:\r\n      return (\r\n        <ReservationDetails {...(renderPageProps as ReservationDetailsProps)} />\r\n      );\r\n    case RenderPageType.PricePeriodsDetails:\r\n      return (\r\n        <PricePeriodDetails {...(renderPageProps as PricePeriodDetailsProps)} />\r\n      );\r\n    case RenderPageType.Article:\r\n      return <ArticleDetails {...(renderPageProps as ArticleDetailsProps)} />;\r\n    case RenderPageType.ArticleNew:\r\n      return (\r\n        <NewArticleDetailsForm\r\n          {...(renderPageProps as NewArticleDetailsFormProps)}\r\n        />\r\n      );\r\n    case RenderPageType.ArticleEdit:\r\n      return (\r\n        <EditArticleDetailsForm\r\n          {...(renderPageProps as EditArticleDetailsFormProps)}\r\n        />\r\n      );\r\n    case RenderPageType.InvoiceTemplatePopUp:\r\n      return (\r\n        <InvoiceTemplatePopUp\r\n          {...(renderPageProps as InvoiceTemplatePopUpProps)}\r\n        />\r\n      );\r\n    case RenderPageType.CoreSelection:\r\n      return <CoreSelection {...(renderPageProps as CoreSelectionProps)} />;\r\n    case RenderPageType.AssetsSelection:\r\n      return <AssetsSelection {...(renderPageProps as AssetsSelectionProps)} />;\r\n    case RenderPageType.UserAttributesDetails:\r\n      return (\r\n        <UserAttributesDetails\r\n          {...(renderPageProps as UserAttributesDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.ServiceRequestDetails:\r\n      return (\r\n        <ServiceRequestDetails\r\n          {...(renderPageProps as ServiceRequestDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.ServiceRequestTicketDetails:\r\n      return (\r\n        <ServiceRequestTicketDetails\r\n          {...(renderPageProps as ServiceRequestTicketDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.CalendarMessagesDetails:\r\n      return (\r\n        <CalendarMessagesDetails\r\n          {...(renderPageProps as CalendarMessagesDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.ReportConsumables:\r\n      return (\r\n        <ReportConsumables {...(renderPageProps as ReportConsumablesProps)} />\r\n      );\r\n    case RenderPageType.ServiceRequestMilestone:\r\n      return (\r\n        <ServiceRequestMilestoneDetails\r\n          {...(renderPageProps as ServiceRequestMilestoneDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.ServiceRequestMilestoneCharge:\r\n      return (\r\n        <ServiceRequestMilestoneChargeDetails\r\n          {...(renderPageProps as ServiceRequestMilestoneChargeDetailsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.StockRenewal:\r\n      return <StockRenewal {...(renderPageProps as StockRenewalProps)} />;\r\n    case RenderPageType.RenewStock:\r\n      return <RenewStock {...(renderPageProps as RenewStockProps)} />;\r\n    case RenderPageType.InventoryBatch:\r\n      return <InventoryBatch {...(renderPageProps as InventoryBatchProps)} />;\r\n    case RenderPageType.InvoiceBatchesComments:\r\n      return (\r\n        <InvoiceBatchesComments\r\n          {...(renderPageProps as InvoiceBatchesCommentsProps)}\r\n        />\r\n      );\r\n    case RenderPageType.AssetInventoryLog:\r\n      return <InventoryLog {...(renderPageProps as InventoryLogProps)} />;\r\n    case RenderPageType.ArticleForm:\r\n      return (\r\n        <ArticleAssociationForm\r\n          {...(renderPageProps as ArticleAssociationFormProps)}\r\n        />\r\n      );\r\n    case RenderPageType.RegionDetails:\r\n      return <RegionDetails {...(renderPageProps as RegionDetailsProps)} />;\r\n    default:\r\n      return <React.Fragment> </React.Fragment>;\r\n  }\r\n}\r\n","/**\r\n *\r\n * AssetCatGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssetCatGroupDto } from 'api/odata/generated/entities/IAssetCatGroupDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\n\r\nexport type CatGroupUrl = 'base' | 'assetBase' | 'public';\r\nexport interface AssetCatGroupPickerProps\r\n  extends Omit<AutocompletePickerProps<IAssetCatGroupDto>, 'loadData'> {\r\n  noGlobalServiceGroupFilter?: boolean;\r\n  urlType?: CatGroupUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/AssetCatGroups';\r\nconst assetBaseUrl = '/api/odata/v4/AssetCatGroups/AssetCatGroupsFilter';\r\nconst publicUrl = '/api/odata/v4/AssetCatGroups/PublicAssetCatGroupsFilter';\r\nexport const initAssetCatGroupData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: CatGroupUrl,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IAssetCatGroupDto[]>((resolve, reject) => {\r\n      resolve([] as IAssetCatGroupDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,ServiceGroups',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'public'\r\n        ? publicUrl\r\n        : sourceUrl === 'assetBase'\r\n        ? assetBaseUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IAssetCatGroupDto[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IAssetCatGroupDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: CatGroupUrl,\r\n) => {\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicUrl\r\n      : urlType === 'assetBase'\r\n      ? assetBaseUrl\r\n      : url;\r\n  return getAutoCompleteLoadDataFn<IAssetCatGroupDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'ServiceGroups'],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IAssetCatGroupDto>(\r\n              'ServiceGroups',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function AssetCatGroupPicker(props: AssetCatGroupPickerProps) {\r\n  const { predicates, noGlobalServiceGroupFilter, urlType, ...other } = props;\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    isAuth\r\n      ? !noGlobalServiceGroupFilter\r\n        ? globalServiceGroupFilter || []\r\n        : []\r\n      : [],\r\n    isAuth,\r\n    urlType,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'AssertCatGroupId'}\r\n      loadData={innerLoadData}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\nexport const AssetCatGroupByServiceGroupFilter = (value: FilterValueType) => {\r\n  if (value !== undefined && value !== null) {\r\n    return [\r\n      `${new Condition<IAssetCatGroupDto>(\r\n        'ServiceGroups',\r\n        ODataOperators.In,\r\n        (value as Identifiable<number>).Id,\r\n      ).toString()}`,\r\n    ];\r\n  }\r\n  return [];\r\n};\r\n","/**\r\n *\r\n * CampusPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface InstitutePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/InstituteFilter';\r\nexport const initInstituteData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function InstitutePicker(props: InstitutePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'instituteId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetCatPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { IAssetCatDto } from 'app/pages/CategoriesPage/IAssetCatDto';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nexport type CatUrl = 'base' | 'assetBase' | 'public';\r\nexport interface AssetCatPickerProps\r\n  extends Omit<AutocompletePickerProps<IAssetCatDto>, 'loadData'> {\r\n  urlType?: CatUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/AssetCat';\r\nconst assetBaseUrl = '/api/odata/v4/AssetCat/AssetCatsFilter';\r\nconst publicUrl = '/api/odata/v4/AssetCat/PublicAssetCatsFilter';\r\nexport const initAssetCatData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: CatUrl,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<IAssetCatDto[]>((resolve, reject) => {\r\n      resolve([] as IAssetCatDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,GroupId,AssetCatGroupName',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'public'\r\n        ? publicUrl\r\n        : sourceUrl === 'assetBase'\r\n        ? assetBaseUrl\r\n        : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as IAssetCatDto[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IAssetCatDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: CatUrl,\r\n) => {\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicUrl\r\n      : urlType === 'assetBase'\r\n      ? assetBaseUrl\r\n      : url;\r\n  return getAutoCompleteLoadDataFn<IAssetCatDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'GroupId', 'AssetCatGroupName', 'ServiceGroups'],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IAssetCatDto>(\r\n              'ServiceGroups',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function AssetCatPicker(props: AssetCatPickerProps) {\r\n  const { predicates, urlType, ...other } = props;\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    isAuth ? globalServiceGroupFilter || [] : [],\r\n    isAuth,\r\n    urlType,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || 'AssetCatId'}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n\r\nexport const AssetCatByCategoryFilter = (\r\n  value: FilterValueType,\r\n  fieldName: any,\r\n) => {\r\n  if (value !== undefined && value !== null) {\r\n    if (fieldName === 'AssetCatGroupId') {\r\n      return [\r\n        `${new Condition<IAssetCatDto>(\r\n          'GroupId',\r\n          ODataOperators.Equals,\r\n          (value as Identifiable<number>).Id,\r\n        ).toString()}`,\r\n      ];\r\n    }\r\n    if (fieldName === 'ServiceGroupId') {\r\n      return [\r\n        `${new Condition<IAssetCatDto>('ServiceGroups', ODataOperators.AnyIn, [\r\n          (value as Identifiable<number>).Id,\r\n        ]).toString()}`,\r\n      ];\r\n    }\r\n  }\r\n  return [];\r\n};\r\n","/**\r\n *\r\n * DepartmentPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface DepartmentPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/DepartmentFilter';\r\nexport const initDepartmentData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function DepartmentPicker(props: DepartmentPickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n      id={props.id || 'departmentId'}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RoomPickerFilter\r\n *\r\n */\r\nimport { RoomPicker } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const RoomPickerFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <RoomPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      size=\"small\"\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n      urlType={props.urlType}\r\n    />\r\n  );\r\n};\r\nexport default RoomPickerFilter;\r\n","/**\r\n *\r\n * InstituteTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface InstituteTypePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/InstituteTypeFilter';\r\nexport const initInstituteTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function InstituteTypePicker(props: InstituteTypePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'institutetypeId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * Description\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport htmlParse from 'html-react-parser';\r\nimport styled from 'styled-components';\r\n\r\n/**\r\n * Predefined (column) widths\r\n */\r\ntype TextLength = 'short' | 'medium' | 'long' | 'auto';\r\n\r\nconst DEFAULT_WIDTH = 'medium';\r\n\r\nexport interface DescriptionProps\r\n  extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children' | 'title'> {\r\n  value?: string | null;\r\n  //className?: string;\r\n  title?: string | null | React.ReactNode;\r\n  /**\r\n   * predefined width - default = medium\r\n   */\r\n  width?: TextLength;\r\n  /**\r\n   * Makes a tooltip interactive, i.e. will not close when the user\r\n   * hovers over the tooltip before the `leaveDelay` is expired.\r\n   */\r\n  interactive?: boolean;\r\n  /**\r\n   * The number of milliseconds to wait before hiding the tooltip.\r\n   * This prop won't impact the leave touch delay (`leaveTouchDelay`).\r\n   */\r\n  leaveDelay?: number;\r\n  /**\r\n   * The number of milliseconds after the user stops touching an element before hiding the tooltip.\r\n   */\r\n  leaveTouchDelay?: number;\r\n}\r\n/**\r\n * Renders a long text Cell - truncates long text with a popup\r\n * @param param0 value to render\r\n * @returns\r\n */\r\nexport const Description = ({\r\n  value,\r\n  title,\r\n  width = DEFAULT_WIDTH,\r\n  interactive,\r\n  leaveDelay,\r\n  leaveTouchDelay,\r\n}: DescriptionProps) => {\r\n  // cleanup html tags for inline display and trim white spaces\r\n\r\n  const textValue = tryCleanValue(value);\r\n\r\n  if (value === '' || value === null || value === undefined) {\r\n    return <></>;\r\n  }\r\n\r\n  // use the title if provided, otherwise tooltip will show full text value\r\n  const titleValue = title ?? value;\r\n\r\n  // parse html title value for html values e.g. remarks, email body, etc.\r\n  const parsedTitle =\r\n    typeof titleValue === 'string' ? htmlParse(titleValue) : titleValue;\r\n\r\n  const maxChars = toCharsWidth(width);\r\n  const foo =\r\n    maxChars !== undefined &&\r\n    maxChars > 0 &&\r\n    typeof textValue === 'string' &&\r\n    textValue.length > maxChars;\r\n  if (foo) {\r\n    return (\r\n      <Tooltip\r\n        data-html=\"true\"\r\n        title={parsedTitle}\r\n        arrow\r\n        interactive={interactive}\r\n        leaveDelay={leaveDelay}\r\n        leaveTouchDelay={leaveTouchDelay}\r\n      >\r\n        <TruncatedDescriptionText value={textValue} width={width} />\r\n      </Tooltip>\r\n    );\r\n  } else {\r\n    return <>{String(textValue)}</>;\r\n  }\r\n};\r\n\r\n/***\r\n * Renders truncated text without tooltip\r\n */\r\nexport const TruncatedDescriptionText = React.forwardRef<\r\n  HTMLSpanElement,\r\n  DescriptionProps\r\n>(function TruncatedDescriptionText(\r\n  { value, width = DEFAULT_WIDTH, title, ...props }: DescriptionProps,\r\n  ref,\r\n) {\r\n  if (value === '' || value === null || value === undefined) {\r\n    return null;\r\n  }\r\n  return (\r\n    <Styled ref={ref} {...props} width={toCssWidth(width)}>\r\n      {value}\r\n    </Styled>\r\n  );\r\n});\r\nconst Styled = styled('span')<{ width: string }>`\r\n  display: inline-block;\r\n  white-space: nowrap;\r\n  max-width: ${props => props.width};\r\n  overflow: hidden;\r\n  text-overflow: ellipsis;\r\n`;\r\n\r\n/**\r\n * Converts preset width to value that can be used to set css width\r\n * @param lengthType preset width\r\n * @returns\r\n */\r\nconst toCharsWidth = (lengthType?: TextLength) => {\r\n  const length = lengthType ?? DEFAULT_WIDTH;\r\n  switch (length) {\r\n    case 'short':\r\n      return 15;\r\n    case 'medium':\r\n      return 30;\r\n    case 'long':\r\n      return 70;\r\n    case 'auto':\r\n      return undefined;\r\n    default:\r\n      assertExhaustive(length);\r\n  }\r\n};\r\n\r\n/**\r\n * Converts preset width to value that can be used to set css width\r\n * @param lengthType preset width\r\n * @returns\r\n */\r\nconst toCssWidth = (lengthType?: TextLength) => {\r\n  const length = lengthType ?? DEFAULT_WIDTH;\r\n  switch (length) {\r\n    case 'short':\r\n    case 'medium':\r\n    case 'long':\r\n      return `${toCharsWidth(length)}ch`;\r\n\r\n    case 'auto':\r\n      return 'auto';\r\n    default:\r\n      assertExhaustive(length);\r\n  }\r\n};\r\n\r\nfunction tryCleanValue(value: string | null | undefined) {\r\n  if (value === null || value === undefined) {\r\n    return undefined;\r\n  }\r\n\r\n  try {\r\n    return value?.replace(/<[^>]+>/g, '')?.trim();\r\n  } catch (error) {\r\n    return value;\r\n  }\r\n}\r\n","import clsx from 'clsx';\r\nimport {\r\n  Card,\r\n  CardActionArea,\r\n  CardActions,\r\n  CardContent,\r\n  CardMedia,\r\n  CardProps,\r\n  Theme,\r\n  useTheme,\r\n} from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { SimpleList } from 'app/components/BasicList/StyledList';\r\nimport React, { useState } from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { defaultImgSrc } from 'app/components/AssetThumbImage';\r\nimport { Body } from '../Typography';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport styled from 'styled-components';\r\nimport { bookitShadows } from 'styles/shadows/bookitShadow';\r\n// import useState from 'react-usestateref';\r\n\r\nexport type CardPosition = 'vertical' | 'horizontal';\r\nexport type CardBackground = 'white' | 'gray';\r\nexport type CardSize = 'small' | 'medium';\r\nexport type StatusType = 'info' | 'success' | 'warning' | 'error' | 'active';\r\nexport interface CardButton {\r\n  key: React.Key | null | undefined;\r\n  button: React.ReactNode;\r\n}\r\nexport interface CardContentRow {\r\n  key: React.Key | null | undefined;\r\n  label: React.ReactNode;\r\n  text: React.ReactNode;\r\n}\r\nexport interface CardTopActions {\r\n  key: React.Key | null | undefined;\r\n  action: React.ReactNode;\r\n}\r\nexport interface DemSize {\r\n  width: number;\r\n  height: number;\r\n}\r\nexport interface BasicCardProps {\r\n  position?: CardPosition;\r\n  backStyle?: CardBackground;\r\n  cardSize?: CardSize;\r\n  mobileSize?: CardSize;\r\n  useImage?: boolean;\r\n  imageSrc?: string;\r\n  showBullet?: boolean;\r\n  useButtons?: boolean;\r\n  useSelect?: boolean;\r\n  selectVisible?: boolean;\r\n  selected?: boolean;\r\n  title?: React.ReactNode;\r\n  disabled?: boolean;\r\n  primaryAction?: () => void;\r\n  checkBox?: React.ReactNode;\r\n  topActions?: Array<CardTopActions>;\r\n  hasTopActions?: boolean;\r\n  buttons?: Array<CardButton>;\r\n  cardContent?: React.ReactNode;\r\n  cardContentRows?: Array<CardContentRow>;\r\n  iconTitle?: React.ReactNode;\r\n  status?: StatusType;\r\n  maxContentHeight?: number;\r\n  preventInnerClicks?: boolean;\r\n  contentEditable?: boolean;\r\n  loading?: boolean;\r\n  info?: string;\r\n}\r\n\r\nexport function BasicCard(props: BasicCardProps) {\r\n  const {\r\n    position,\r\n    cardSize,\r\n    mobileSize,\r\n    useButtons,\r\n    useImage,\r\n    useSelect,\r\n    showBullet,\r\n    selected,\r\n    title,\r\n    imageSrc,\r\n    disabled,\r\n    primaryAction,\r\n    checkBox,\r\n    topActions,\r\n    buttons,\r\n    cardContent,\r\n    cardContentRows,\r\n    selectVisible,\r\n    iconTitle,\r\n    status,\r\n    maxContentHeight,\r\n    preventInnerClicks,\r\n    contentEditable,\r\n    hasTopActions,\r\n    loading,\r\n  } = props;\r\n  const theme = useTheme();\r\n  const [imgError, setImageError] = React.useState<boolean>(false);\r\n  const imgSrc = React.useMemo(() => {\r\n    return useImage\r\n      ? imgError\r\n        ? defaultImgSrc\r\n        : imageSrc !== undefined\r\n        ? imageSrc\r\n        : defaultImgSrc\r\n      : undefined;\r\n  }, [imageSrc, imgError, useImage]);\r\n  const [imageDimensions, setImageDimensions] = useState<DemSize | undefined>(\r\n    undefined,\r\n  );\r\n  React.useEffect(() => {\r\n    if (loading !== undefined) {\r\n      if (loading === true && imageDimensions !== undefined) {\r\n        setImageDimensions(undefined);\r\n      }\r\n    }\r\n  }, [imageDimensions, loading]);\r\n  const loadImage = (setImageDimensions, imageUrl) => {\r\n    const img = new Image();\r\n    img.src = imageUrl;\r\n    img.onload = () => {\r\n      setImageDimensions({\r\n        height: img.height,\r\n        width: img.width,\r\n      });\r\n      // console.debug('image loaded', img);\r\n    };\r\n    // img.onerror = err => {\r\n    //   console.log('img error');\r\n    //   console.error(err);\r\n    // };\r\n  };\r\n  const backgroundSize = React.useMemo(() => {\r\n    if (!!imageDimensions) {\r\n      let horizontal = imageDimensions.width - imageDimensions.height > 0;\r\n      if (imageDimensions.height === imageDimensions.width) {\r\n        return 'contain';\r\n      }\r\n      if (position === 'vertical') {\r\n        if (horizontal) {\r\n          if (\r\n            imageDimensions.height <\r\n            (cardSize === 'medium' ? 180 : 150) / 1.8\r\n          ) {\r\n            return 'contain';\r\n          } else {\r\n            if (imageDimensions.width < imageDimensions.height * 1.33) {\r\n              return 'contain';\r\n            }\r\n            return 'cover';\r\n          }\r\n        } else {\r\n          return 'contain';\r\n        }\r\n      } else {\r\n        if (!horizontal) {\r\n          if (\r\n            imageDimensions.height <\r\n            (cardSize === 'medium' ? 180 : 150) / 1.8\r\n          ) {\r\n            return 'contain';\r\n          } else {\r\n            return 'cover';\r\n          }\r\n        } else {\r\n          if (\r\n            imageDimensions.width <\r\n            (cardSize === 'medium' ? 180 : 150) / 1.8\r\n          ) {\r\n            return 'contain';\r\n          } else {\r\n            return 'cover';\r\n          }\r\n        }\r\n      }\r\n    }\r\n    return undefined;\r\n  }, [cardSize, imageDimensions, position]);\r\n  const [showSelect, setShowSelect] = useState(selectVisible);\r\n  React.useEffect(() => {\r\n    let active =\r\n      imgSrc !== undefined &&\r\n      imageDimensions === undefined &&\r\n      loading === false;\r\n    if (active) {\r\n      loadImage(setImageDimensions, imgSrc);\r\n    }\r\n    return () => {\r\n      active = false;\r\n      //setImageDimensions(undefined);\r\n    };\r\n  }, [imageDimensions, imgSrc, loading]);\r\n  const showHeader = React.useMemo(() => {\r\n    return !!title || !!iconTitle || (useSelect && showSelect) || hasTopActions;\r\n  }, [iconTitle, showSelect, title, hasTopActions, useSelect]);\r\n  // const headerHeight = React.useMemo(() => {\r\n  //   return showHeader ? 25 : 0;\r\n  // }, [showHeader]);\r\n  // const imageHeight = React.useMemo(() => {\r\n  //   return position === 'horizontal' || imgSrc === undefined\r\n  //     ? 0\r\n  //     : cardSize === 'medium'\r\n  //     ? 180\r\n  //     : 150;\r\n  // }, [cardSize, imgSrc, position]);\r\n\r\n  // const rowsHeight = 78;\r\n\r\n  const contentHeight = React.useMemo(() => {\r\n    let maxHeight = maxContentHeight || 60;\r\n    return cardContent === undefined ? 0 : maxHeight;\r\n  }, [cardContent, maxContentHeight]);\r\n  // const otherHeight = React.useMemo(() => {\r\n  //   //paddings and gaps\r\n  //   return (\r\n  //     (rowsHeight > 0 || maxContentHeight === undefined\r\n  //       ? cardSize === 'medium'\r\n  //         ? 16 * 2\r\n  //         : 8 * 2\r\n  //       : 6) + (useButtons ? 16 : 8)\r\n  //   );\r\n  // }, [cardSize, maxContentHeight, rowsHeight, useButtons]);\r\n\r\n  // const buttonsHeight = React.useMemo(() => {\r\n  //   return useButtons ? 32 : 0;\r\n  // }, [useButtons]);\r\n  const [mouseUp, setMouseUp] = React.useState<boolean>(false);\r\n  // const [preventPrimary, setPreventPrimary] = React.useState<boolean>(false);\r\n  // const cardHeight = React.useMemo(() => {\r\n  //   return (\r\n  //     headerHeight + rowsHeight + buttonsHeight + otherHeight + contentHeight\r\n  //   );\r\n  // }, [buttonsHeight, headerHeight, otherHeight, rowsHeight, contentHeight]);\r\n\r\n  const trimTitleText = React.useMemo(() => {\r\n    if (!!title && typeof title === 'string') {\r\n      let trimmedTitle = title as string;\r\n      let trimSize = cardSize === 'medium' ? 24 : 26;\r\n      if (trimmedTitle.length > trimSize) {\r\n        trimmedTitle = trimmedTitle.substring(0, trimSize).trim() + '...';\r\n      }\r\n      return trimmedTitle;\r\n    }\r\n    return title;\r\n  }, [cardSize, title]);\r\n\r\n  return (\r\n    <StyledCard\r\n      theme={theme}\r\n      //style={{ height: `${cardHeight}px` }}\r\n      className={clsx('card', {\r\n        cardActive: status === 'active' || selected,\r\n        cardInfo: status === 'info',\r\n        cardSuccess: status === 'success',\r\n        cardWarning: status === 'warning',\r\n        cardError: status === 'error',\r\n        position_vertical: position === 'vertical',\r\n        position_horizontal: position === 'horizontal',\r\n        cardSize_small: cardSize === 'small',\r\n        cardSize_medium: cardSize === 'medium',\r\n      })}\r\n    >\r\n      <CardActionArea\r\n        className={clsx('cardActionArea', {\r\n          position_vertical: position === 'vertical',\r\n          position_horizontal: position === 'horizontal',\r\n          disabled: disabled && !contentEditable,\r\n        })}\r\n        disabled={disabled && !contentEditable}\r\n        component=\"span\"\r\n        onMouseEnter={() => {\r\n          if (useSelect) {\r\n            setShowSelect(true);\r\n          }\r\n        }}\r\n        onMouseLeave={() => {\r\n          if (useSelect) setShowSelect(selectVisible);\r\n        }}\r\n        onMouseUp={event => {\r\n          if ('type' in event.target && event.target.type === 'checkbox') {\r\n            event.preventDefault();\r\n            event.stopPropagation();\r\n          } else if (\r\n            'className' in event.target &&\r\n            event.target.className !== undefined &&\r\n            event.target.className !== null &&\r\n            typeof event.target.className === 'string' &&\r\n            event.target.className.indexOf('MuiCardMedia-root') > -1\r\n          ) {\r\n            setMouseUp(true);\r\n            if (!!primaryAction) {\r\n              primaryAction();\r\n            }\r\n          } else if (\r\n            ('className' in event.target &&\r\n              event.target.className !== undefined &&\r\n              event.target.className !== null &&\r\n              typeof event.target.className === 'string' &&\r\n              event.target.className.indexOf('MuiLink-root') > -1) ||\r\n            event.target?.parentElement?.nodeName === 'A'\r\n          ) {\r\n            setMouseUp(true);\r\n          } else {\r\n            event.preventDefault();\r\n            event.stopPropagation();\r\n          }\r\n        }}\r\n        onClick={() => {\r\n          if (mouseUp) {\r\n            setMouseUp(false);\r\n            return;\r\n          }\r\n          if (!!primaryAction) {\r\n            primaryAction();\r\n          }\r\n        }}\r\n      >\r\n        {imgSrc !== undefined && (\r\n          <ImageContainer\r\n            theme={theme}\r\n            className={clsx('imgContainer', {\r\n              position_vertical: position === 'vertical',\r\n              position_horizontal: position === 'horizontal',\r\n              cardSize_small: cardSize === 'small',\r\n              cardSize_medium: cardSize === 'medium',\r\n              mobileSizeMedium: mobileSize === 'medium',\r\n              mobileSizeSmall: mobileSize === 'small',\r\n            })}\r\n          >\r\n            <div\r\n              className={clsx('frame', {\r\n                position_vertical: position === 'vertical',\r\n                position_horizontal: position === 'horizontal',\r\n                cardSize_small: cardSize === 'small',\r\n                cardSize_medium: cardSize === 'medium',\r\n                mobileSizeMedium: mobileSize === 'medium',\r\n                mobileSizeSmall: mobileSize === 'small',\r\n              })}\r\n              // style={\r\n              //   position === 'vertical' ? { height: imageHeight } : undefined\r\n              // }\r\n            >\r\n              <CardMedia\r\n                // style={\r\n                //   position === 'vertical'\r\n                //     ? { height: 0, paddingTop: imageHeight }\r\n                //     : undefined\r\n                // }\r\n                style={\r\n                  !!backgroundSize\r\n                    ? { backgroundSize: backgroundSize }\r\n                    : undefined\r\n                }\r\n                component=\"div\"\r\n                className={clsx('mediaStyles', {\r\n                  position_vertical: position === 'vertical',\r\n                  position_horizontal: position === 'horizontal',\r\n                  cardSize_small: cardSize === 'small',\r\n                  cardSize_medium: cardSize === 'medium',\r\n                  mobileSizeMedium: mobileSize === 'medium',\r\n                  mobileSizeSmall: mobileSize === 'small',\r\n                })}\r\n                image={imgSrc}\r\n                onLoadedMetadata={e => {\r\n                  console.log('img event', e);\r\n                }}\r\n                onLoad={e => {\r\n                  console.log('img event', e);\r\n                }}\r\n                src=\"\"\r\n                onError={() => setImageError(true)}\r\n              >\r\n                {useSelect &&\r\n                  (showSelect || selectVisible) &&\r\n                  position === 'vertical' &&\r\n                  !disabled && <div className=\"checkTop\">{checkBox}</div>}\r\n              </CardMedia>\r\n            </div>\r\n          </ImageContainer>\r\n        )}\r\n        <CardContent\r\n          className={clsx('cardContent', {\r\n            cardSize_small: cardSize === 'small',\r\n            cardSize_medium: cardSize === 'medium',\r\n          })}\r\n          // style={{ maxHeight: cardHeight, height: 'auto' }}\r\n        >\r\n          {showHeader && (\r\n            <div className={'cardTitle'}>\r\n              <div className={'title'}>\r\n                {!!iconTitle && iconTitle}\r\n                {title !== undefined && (\r\n                  <div className={'titleOverRule'}>\r\n                    <Tooltip title={title as string}>\r\n                      <span>\r\n                        <Body\r\n                          bold={true}\r\n                          size={cardSize === 'medium' ? 'large' : 'small'}\r\n                        >\r\n                          <React.Fragment>{trimTitleText}</React.Fragment>\r\n                        </Body>\r\n                      </span>\r\n                    </Tooltip>\r\n                  </div>\r\n                )}\r\n              </div>\r\n              <div className={'checkWithAction'}>\r\n                {(imgSrc === undefined || position === 'horizontal') &&\r\n                  useSelect &&\r\n                  (showSelect || selectVisible) &&\r\n                  !disabled && <React.Fragment>{checkBox}</React.Fragment>}\r\n                {!!topActions &&\r\n                  topActions.map(c => {\r\n                    return (\r\n                      <span key={c.key} onClick={e => e.stopPropagation()}>\r\n                        <React.Fragment>{c.action}</React.Fragment>\r\n                      </span>\r\n                    );\r\n                  })}\r\n              </div>\r\n            </div>\r\n          )}\r\n          {!!cardContent && (\r\n            <div className={'content'} style={{ height: contentHeight }}>\r\n              <React.Fragment>{cardContent}</React.Fragment>\r\n            </div>\r\n          )}\r\n          {!!cardContentRows && cardContentRows.length > 0 && (\r\n            <SimpleList\r\n              className={clsx('cardContentRows', {\r\n                position_horizontal: position === 'horizontal',\r\n                mobileSizeMedium: mobileSize === 'medium',\r\n                mobileSizeSmall: mobileSize === 'small',\r\n              })}\r\n            >\r\n              {cardContentRows.map(c => {\r\n                return (\r\n                  <li key={`list-key-${c.key}`} className={'contentRow'}>\r\n                    {showBullet && (\r\n                      <Icon\r\n                        icon=\"circle\"\r\n                        fontSize=\"6px\"\r\n                        color=\"primary\"\r\n                        style={{ paddingTop: '8px' }}\r\n                      />\r\n                    )}\r\n\r\n                    <span\r\n                      onClickCapture={e => {\r\n                        if (preventInnerClicks) {\r\n                          e.preventDefault();\r\n                        }\r\n                      }}\r\n                      className={'rowOverRule'}\r\n                    >\r\n                      <Body size=\"small\" className={'rowTitle'}>\r\n                        <span>{c.label}</span>\r\n                      </Body>\r\n                      <Body size=\"small\" className={'rowText'}>\r\n                        <span>{c.text}</span>\r\n                      </Body>\r\n                    </span>\r\n                  </li>\r\n                );\r\n              })}\r\n            </SimpleList>\r\n          )}\r\n\r\n          {useButtons && !!buttons && (\r\n            <CardActions\r\n              className={'cardActions'}\r\n              style={\r\n                contentEditable\r\n                  ? { pointerEvents: 'initial', cursor: 'pointer' }\r\n                  : undefined\r\n              }\r\n            >\r\n              <div className={'cardActionsButtons'}>\r\n                {buttons.map(c => {\r\n                  return (\r\n                    <span key={c.key} onClick={e => e.stopPropagation()}>\r\n                      <React.Fragment>{c.button}</React.Fragment>\r\n                    </span>\r\n                  );\r\n                })}\r\n              </div>\r\n              {status !== undefined && (\r\n                <div>\r\n                  <Icon\r\n                    icon={\r\n                      status === 'active'\r\n                        ? 'check'\r\n                        : status === 'success'\r\n                        ? 'check-double'\r\n                        : status === 'info'\r\n                        ? 'info'\r\n                        : status === 'warning'\r\n                        ? 'triangle-exclamation'\r\n                        : 'xmark'\r\n                    }\r\n                    color={\r\n                      status === 'active'\r\n                        ? 'primary'\r\n                        : status === 'success'\r\n                        ? 'success'\r\n                        : status === 'info'\r\n                        ? 'info'\r\n                        : status === 'warning'\r\n                        ? 'warning'\r\n                        : 'danger'\r\n                    }\r\n                    size=\"lg\"\r\n                  />\r\n                </div>\r\n              )}\r\n            </CardActions>\r\n          )}\r\n        </CardContent>\r\n      </CardActionArea>\r\n    </StyledCard>\r\n  );\r\n}\r\nexport const ImageContainer = styled('div')(({ theme }) => ({\r\n  '&.imgContainer': {\r\n    display: 'flex',\r\n    alignItems: 'flex-start',\r\n    gap: '10px',\r\n    alignSelf: 'stretch',\r\n    background: `${bookitColors.base.white}`,\r\n    borderRadius: '12px 12px 0px 0px',\r\n    '&.position_horizontal': {\r\n      borderRadius: '12px 0px 0px 12px',\r\n      '&.mobileSizeMedium, &.mobileSizeSmall': {\r\n        padding: '16px 0px 16px 16px',\r\n      },\r\n    },\r\n    '&.position_vertical': {\r\n      '&.cardSize_medium': {\r\n        height: '180px',\r\n      },\r\n      '&.cardSize_small': {\r\n        height: '150px',\r\n      },\r\n    },\r\n    '& .frame': {\r\n      display: 'flex',\r\n      alignItems: 'flex-start',\r\n      justifyContent: 'center',\r\n      gap: '10px',\r\n      flex: '1 0 0',\r\n      alignSelf: 'stretch',\r\n      borderRadius: '12px 12px 0px 0px',\r\n      background: `${bookitColors.grayscale.graySelection}`,\r\n      '&.position_horizontal': {\r\n        height: 'auto',\r\n        borderRadius: '12px 0px 0px 12px',\r\n        '&.mobileSizeMedium': {\r\n          alignItems: 'center',\r\n          //padding: '16px 0px',\r\n          borderRadius: '8px',\r\n          height: '80px',\r\n        },\r\n        '&.mobileSizeSmall': {\r\n          alignItems: 'center',\r\n          //padding: '16px 0px',\r\n          borderRadius: '8px',\r\n          height: '64px',\r\n        },\r\n      },\r\n      '& .mediaStyles': {\r\n        imageRendering: '-webkit-optimize-contrast',\r\n        backgroundSize: 'auto',\r\n        width: '100%',\r\n        backgroundBlendMode: 'multiply',\r\n        minWidth: 'unset',\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        justifyContent: 'center',\r\n        alignItems: 'center',\r\n        gap: 15,\r\n        // '&.position_vertical': {\r\n        //   height: '100%',\r\n        //   width: '100%',\r\n        // },\r\n        '& .checkTop': {\r\n          position: 'absolute',\r\n          top: 0,\r\n          left: 0,\r\n          padding: '5px',\r\n          borderRadius: '8px',\r\n        },\r\n        '&.position_horizontal': {\r\n          height: '100%',\r\n          minWidth: '64px',\r\n          '&.cardSize_small': {\r\n            width: '150px',\r\n            '&.mobileSizeMedium': {\r\n              width: '80px',\r\n              height: '80px',\r\n            },\r\n            '&.mobileSizeSmall': {\r\n              width: '64px',\r\n              height: '64px',\r\n            },\r\n          },\r\n          '&.cardSize_medium': {\r\n            width: '180px',\r\n            '&.mobileSizeMedium': {\r\n              width: '80px',\r\n              height: '80px',\r\n            },\r\n            '&.mobileSizeSmall': {\r\n              width: '64px',\r\n              height: '64px',\r\n            },\r\n          },\r\n        },\r\n        '&.position_vertical': {\r\n          '&.cardSize_small': {\r\n            height: 0,\r\n            paddingTop: 150,\r\n          },\r\n          '&.cardSize_medium': {\r\n            height: 0,\r\n            paddingTop: 180,\r\n          },\r\n        },\r\n      },\r\n    },\r\n  },\r\n}));\r\nexport const StyledCard = styled(\r\n  ({\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & CardProps) => <Card {...other}>{children}</Card>,\r\n)({\r\n  '&.card': {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    //justifyContent: 'flex-start',\r\n    justifyContent: 'center',\r\n    alignItems: 'flex-start',\r\n    borderRadius: '12px',\r\n    padding: 0,\r\n    flex: '1 0 0',\r\n    border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n    boxShadow: 'unset',\r\n    height: '100%',\r\n    '&.cardActive': {\r\n      boxShadow: bookitShadows.shadowS,\r\n      border: `1px solid ${bookitColors.primary.components}`,\r\n      background: bookitColors.primary.background,\r\n      '&.cardInfo': {\r\n        border: `1px solid ${bookitColors.primary.borders}`,\r\n        background: bookitColors.primary.bgLight,\r\n      },\r\n      '&.cardSuccess': {\r\n        border: `1px solid ${bookitColors.success.components}`,\r\n        background: bookitColors.success.background,\r\n      },\r\n      '&.cardWarning': {\r\n        border: `1px solid ${bookitColors.warning.components}`,\r\n        background: bookitColors.warning.background,\r\n      },\r\n      '&.cardError': {\r\n        border: `1px solid ${bookitColors.danger.components}`,\r\n        background: bookitColors.danger.background,\r\n      },\r\n      // boxShadow: `2px 1px 1px -2px ${bookitColors.primary.components}, 0px 0px 1px 2px ${bookitColors.primary.components}, 0px 1px 1px 0px ${bookitColors.primary.components}`,\r\n    },\r\n\r\n    '& .cardActionArea': {\r\n      display: 'flex',\r\n      alignItems: 'flex-start',\r\n      flexDirection: 'column',\r\n      alignSelf: 'stretch',\r\n      borderRadius: '12px',\r\n      height: '100%',\r\n      '&.position_horizontal': {\r\n        flexDirection: 'row',\r\n      },\r\n      //border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n      '&.disabled': {\r\n        backgroundColor: `${bookitColors.grayscale.grayBorders}`,\r\n      },\r\n      '&:hover': {\r\n        opacity: 1,\r\n        boxShadow: bookitShadows.shadowS,\r\n        // border: `1px solid ${bookitColors.primary.components}`,\r\n        background: bookitColors.primary.background,\r\n        '&.cardInfo': {\r\n          //border: `1px solid ${bookitColors.primary.borders}`,\r\n          background: bookitColors.primary.bgLight,\r\n        },\r\n        '&.cardSuccess': {\r\n          //border: `1px solid ${bookitColors.success.components}`,\r\n          background: bookitColors.success.background,\r\n        },\r\n        '&.cardWarning': {\r\n          //border: `1px solid ${bookitColors.warning.components}`,\r\n          background: bookitColors.warning.background,\r\n        },\r\n        '&.cardError': {\r\n          //border: `1px solid ${bookitColors.danger.components}`,\r\n          background: bookitColors.danger.background,\r\n        },\r\n      },\r\n      '& .cardContent': {\r\n        // height: props => props.cardHeight - props.imageHeight, //isMobile ? 'auto' : `${cardcurrentHeight - 84}px`,\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        width: '100%',\r\n        gap: 8,\r\n        alignSelf: 'stretch',\r\n        height: '100%',\r\n        justifyContent: 'space-between',\r\n        '&.cardSize_small': {\r\n          padding: '8px 12px 12px 12px',\r\n        },\r\n        '&.cardSize_medium': {\r\n          padding: '16',\r\n        },\r\n        '& .cardTitle': {\r\n          display: 'flex',\r\n          alignItems: 'center',\r\n          justifyContent: 'space-between',\r\n          height: '25px',\r\n          '& .title': {\r\n            display: 'flex',\r\n            alignItems: 'center',\r\n            justifyContent: 'flex-start',\r\n            gap: 8,\r\n            '& .titleOverRule': {\r\n              display: 'inline-block',\r\n              whiteSpace: 'nowrap',\r\n              overflow: 'hidden',\r\n              textOverflow: 'ellipsis',\r\n              maxWidth: '26ch',\r\n              // [theme.breakpoints.down('sm')]: {\r\n              //   maxWidth: '29ch',\r\n              // },\r\n            },\r\n          },\r\n          '& .checkWithAction': {\r\n            display: 'flex',\r\n            flexDirection: 'row',\r\n            gap: 8,\r\n            alignItems: 'center',\r\n            justifyContent: 'flex-start',\r\n          },\r\n        },\r\n        '& .content': {\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          padding: 0,\r\n          margin: 0,\r\n          gap: '8px',\r\n          flexGrow: 1,\r\n          overflowY: 'auto',\r\n          overflowX: 'clip',\r\n          '&::-webkit-scrollbar': {\r\n            width: '6px',\r\n          },\r\n          '&::-webkit-scrollbar-thumb': {\r\n            boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n            borderRadius: '6px',\r\n            backgroundColor: bookitColors.grayscale.grayBorders,\r\n          },\r\n        },\r\n        '& .cardContentRows': {\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          padding: 0,\r\n          margin: 0,\r\n          gap: '8px',\r\n          flexGrow: 2,\r\n          overflowY: 'clip',\r\n          overflowX: 'clip',\r\n          minHeight: '78px',\r\n          height: 'auto',\r\n          '&::-webkit-scrollbar': {\r\n            width: '6px',\r\n          },\r\n          '&::-webkit-scrollbar-thumb': {\r\n            boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n            borderRadius: '6px',\r\n            backgroundColor: bookitColors.grayscale.grayBorders,\r\n          },\r\n          '&.position_horizontal': {\r\n            '& .contentRow': {\r\n              '& .rowOverRule': {\r\n                '& .rowTitle': {\r\n                  maxWidth: '14ch',\r\n                },\r\n                // '& .rowText': {\r\n                //   maxWidth: '14ch',\r\n                // },\r\n              },\r\n            },\r\n            '&.mobileSizeMedium, &.mobileSizeSmall': {\r\n              '& .contentRow': {\r\n                '& .rowOverRule': {\r\n                  '& .rowTitle': {\r\n                    maxWidth: '12ch',\r\n                  },\r\n                  // '& .rowText': {\r\n                  //   maxWidth: '12ch',\r\n                  // },\r\n                },\r\n              },\r\n            },\r\n          },\r\n          '& .contentRow': {\r\n            display: 'flex',\r\n            flexDirection: 'row',\r\n            alignItems: 'flex-start',\r\n            padding: 0,\r\n            gap: 8,\r\n            height: 'auto',\r\n            //height: '20px',\r\n            // width: '100%',\r\n            '& .rowOverRule': {\r\n              display: 'flex',\r\n              width: '100%',\r\n              alignItems: 'flex-start',\r\n              // whiteSpace: 'pre',\r\n              // overflow: 'hidden',\r\n              // textOverflow: 'ellipsis',\r\n              // maxWidth: '36ch',\r\n              '& .rowTitle': {\r\n                color: bookitColors.grayscale.graySubtitles,\r\n                paddingRight: 8,\r\n                display: 'inline',\r\n                whiteSpace: 'pre',\r\n                overflow: 'hidden',\r\n                textOverflow: 'ellipsis',\r\n                maxWidth: '16ch',\r\n              },\r\n              '& .rowText': {\r\n                color: bookitColors.grayscale.blackRegular,\r\n                display: 'inline',\r\n                whiteSpace: 'pre',\r\n                overflow: 'hidden',\r\n                textOverflow: 'ellipsis',\r\n                //maxWidth: '18ch',\r\n                '& > *': {\r\n                  display: 'initial',\r\n                },\r\n              },\r\n            },\r\n          },\r\n        },\r\n        '& .cardActions': {\r\n          justifyContent: 'space-between',\r\n          padding: '0px',\r\n          gap: 8,\r\n          width: '100%',\r\n          '& .cardActionsButtons': {\r\n            display: 'flex',\r\n            flexDirection: 'row',\r\n            alignItems: 'center',\r\n            gap: 8,\r\n            justifyContent: 'flex-start',\r\n            width: '100%',\r\n          },\r\n        },\r\n      },\r\n    },\r\n  },\r\n});\r\n\r\nexport const BasicCardWithInfo = (props: BasicCardProps) => {\r\n  const { info, ...other } = props;\r\n  return info ? (\r\n    <Tooltip title={info} PopperProps={{ disablePortal: true }}>\r\n      <span>\r\n        <BasicCard {...other} />\r\n      </span>\r\n    </Tooltip>\r\n  ) : (\r\n    <BasicCard {...other} />\r\n  );\r\n};\r\n","import {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { IsEmptyArray, IsEntity } from '../BasicFilter/AppliedFilterComponent';\r\n\r\nimport { FilterValueType } from '../BasicFilter/FilterValueType';\r\n\r\nconst extractValuePart = function (\r\n  value: FilterValueType | undefined,\r\n): FilterValueType | undefined {\r\n  if (value === undefined) {\r\n    return undefined;\r\n  }\r\n  if (value === null) {\r\n    return undefined;\r\n  }\r\n  if (IsEntity(value)) {\r\n    return (value as Entity<number | string>).Id;\r\n  }\r\n\r\n  return value;\r\n};\r\n\r\nexport function TableFilterBuilder<TRow extends Record<string, any>>(\r\n  appliedFilters?: Array<IFilterSettings<TRow>>,\r\n  globalFilterValue?: string | undefined,\r\n  serviceGroups?: Entity<number>[],\r\n  searchColumns?: Array<keyof TRow>,\r\n  additionalFilters?: (string | Condition<TRow>)[],\r\n  multipleServiceGroups?: boolean,\r\n) {\r\n  return new ODataFilterBuilder<TRow>({\r\n    predicates: ((appliedFilters || [])\r\n      .map(filterSettingToCondition)\r\n      .filter(f => f !== null)\r\n      .filter(f => f !== undefined) as (string | Condition<TRow>)[]).concat(\r\n      additionalFilters ?? [],\r\n    ),\r\n    globalServiceGroupFilter:\r\n      serviceGroups === undefined || serviceGroups.length === 0\r\n        ? undefined\r\n        : [\r\n            new Condition<any>(\r\n              multipleServiceGroups ? 'ServiceGroups' : 'ServiceGroupId',\r\n              multipleServiceGroups\r\n                ? ODataOperators.AnyIn\r\n                : ODataOperators.Includes,\r\n              serviceGroups,\r\n              multipleServiceGroups ? 'Id' : undefined,\r\n            ),\r\n          ],\r\n    stringColumns: searchColumns || [],\r\n    stringSearch: globalFilterValue,\r\n  }).toString();\r\n}\r\n\r\nexport function filterSettingToCondition<TRow extends Record<string, any>>(\r\n  filter: IFilterSettings<TRow>,\r\n  index: number,\r\n  array: Array<IFilterSettings<TRow>>,\r\n) {\r\n  if (typeof filter === 'string') {\r\n    return filter;\r\n  }\r\n  if (\r\n    filter.value === undefined ||\r\n    filter.value === null ||\r\n    IsEmptyArray(filter.value)\r\n  ) {\r\n    return undefined;\r\n  }\r\n  if (filter.customFilter) {\r\n    return filter.customFilter(filter.value, filter, array);\r\n  }\r\n\r\n  var value = extractValuePart(filter.value);\r\n  if (value === undefined) {\r\n    return undefined;\r\n  }\r\n\r\n  return new Condition<TRow>(\r\n    filter.fieldName,\r\n    filter.operator,\r\n    value,\r\n    filter.fieldName1,\r\n    filter.isInversed,\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { call, put, select, takeLatest, takeLeading } from 'redux-saga/effects';\r\nimport { push } from 'connected-react-router';\r\nimport { internalIdLoginActions as actions } from '.';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { LoginTypes, Roles } from 'app/slice/types';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nconst SESSIONSTORAGE_KEY = 'internalIdLogin';\r\nfunction storeInternalIdLogin(item: IAuthenticatedUser | null): void {\r\n  if (item === null) {\r\n    sessionStorage.removeItem(SESSIONSTORAGE_KEY);\r\n  } else {\r\n    sessionStorage.setItem(SESSIONSTORAGE_KEY, JSON.stringify(item));\r\n  }\r\n}\r\nfunction loadInternalIdLogin(): IAuthenticatedUser | null {\r\n  const s = sessionStorage.getItem(SESSIONSTORAGE_KEY);\r\n  if (s === null) {\r\n    return null;\r\n  }\r\n  const d = JSON.parse(s);\r\n  const f = d as IAuthenticatedUser;\r\n  return f;\r\n}\r\nfunction* doInit(action: PayloadAction<{ isLargeAnimals: boolean }>) {\r\n  // /try get identity stored in sessionstorage (saved during internalid entry)\r\n  try {\r\n    const storedIdentity: IAuthenticatedUser | null = yield call(\r\n      loadInternalIdLogin,\r\n    );\r\n    if (storedIdentity !== null) {\r\n      yield put(actions.success(storedIdentity));\r\n      yield put(actions.init_success());\r\n      return;\r\n    }\r\n  } catch (error: unknown) {\r\n    console.error('ap init error', error);\r\n  }\r\n\r\n  // simulate internalid login for technicians so that they'll be able to enter the Kiosk cases list/details\r\n  const user = yield select(selectAuthenticatedUser);\r\n  if (!isNullOrUndefined(user)) {\r\n    if (\r\n      action.payload.isLargeAnimals &&\r\n      user.Roles.indexOf(Roles.LargeAnimalsOperatingRoomTechnician) >= 0\r\n    ) {\r\n      yield put(actions.success(user));\r\n      yield put(actions.init_success());\r\n      return;\r\n    }\r\n  }\r\n\r\n  yield put(actions.init_success());\r\n}\r\nfunction* doLogin(\r\n  action: PayloadAction<{ internalId: string; General: boolean }>,\r\n) {\r\n  const httpPayload = {\r\n    internalId: action.payload.internalId,\r\n    General: action.payload.General,\r\n  };\r\n  try {\r\n    // send authentication request\r\n    const requestURL = '/api/account/internalidlogin';\r\n    const result = yield call(httpClient.post, requestURL, httpPayload);\r\n    result.LoginType = LoginTypes.InternalId;\r\n    //store authentication result in session storage\r\n    yield call(storeInternalIdLogin, result);\r\n    yield put(actions.success(result));\r\n  } catch (err) {\r\n    yield put(actions.error(err));\r\n  }\r\n}\r\nfunction* doRedirectToLogin() {\r\n  yield call(storeInternalIdLogin, null);\r\n  yield put(push('/internalidlogin'));\r\n}\r\nexport function* internalIdLoginSaga() {\r\n  yield takeLatest(actions.login.type, doLogin);\r\n  yield takeLeading(actions.redirectToLogin, doRedirectToLogin);\r\n  yield takeLeading(actions.logout, doRedirectToLogin);\r\n  yield takeLatest(actions.init.type, doInit);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { internalIdLoginSaga } from './saga';\r\nimport { InternalIdLoginState } from './types';\r\n\r\nexport const initialState: InternalIdLoginState = {\r\n  processing: false,\r\n  error: false,\r\n  internalId: '',\r\n  initialized: false,\r\n  isLargeAnimals: true,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'internalIdLogin',\r\n  initialState,\r\n  reducers: {\r\n    init(\r\n      state,\r\n      action: PayloadAction<{ isLargeAnimals: boolean; returnUrl?: string }>,\r\n    ) {\r\n      state.isLargeAnimals = action.payload.isLargeAnimals;\r\n      state.initialized = false;\r\n      state.returnUrl = action.payload.returnUrl;\r\n    },\r\n    init_success(state, action: PayloadAction) {\r\n      state.initialized = true;\r\n    },\r\n    login(\r\n      state,\r\n      action: PayloadAction<{ internalId: string; General: boolean }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.error = false;\r\n    },\r\n    success(state, action: PayloadAction<IAuthenticatedUser>) {\r\n      state.processing = false;\r\n      state.identity = action.payload;\r\n      state.internalId = '';\r\n    },\r\n    error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n      state.identity = undefined;\r\n      state.error = true;\r\n      state.internalId = '';\r\n    },\r\n    clearError(state, action: PayloadAction) {\r\n      state.error = false;\r\n      state.processing = false;\r\n    },\r\n    redirectToLogin(state, action: PayloadAction) {},\r\n    logout(state, action: PayloadAction) {\r\n      state.identity = undefined;\r\n      state.internalId = '';\r\n      state.processing = false;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: internalIdLoginActions } = slice;\r\n\r\nexport const useInternalIdLoginSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: internalIdLoginSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useInternalIdLoginSlice();\r\n *E\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { UserMultiPicker } from '../pickers/AutocompletePickers/UserMultiPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport const FormUsersPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<string>[] | null> & {\r\n  selectArray?: Array<keyof IUserFilterDto>;\r\n} & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<string>[] | null>(props);\r\n  return (\r\n    <UserMultiPicker\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      predicates={props.predicates}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      disabled={props.disabled}\r\n      onBlur={field?.onBlur}\r\n      value={field.value as IUserFilterDto[]}\r\n      variant=\"filled\"\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      selectArray={props.selectArray}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * SubLocationListPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISubLocationListDto } from 'api/odata/generated/entities/ISubLocationListDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SubLocationListPickerProps\r\n  extends Omit<AutocompletePickerProps<ISubLocationListDto>, 'loadData'> {\r\n  withoutServiceGroups?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/SubLocationList';\r\nexport const initSubLocationListData = (\r\n  initval: string | undefined,\r\n): Promise<ISubLocationListDto[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<ISubLocationListDto[]>((resolve, reject) => {\r\n      resolve([] as ISubLocationListDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as ISubLocationListDto[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<ISubLocationListDto>)[] | undefined,\r\n  globalServiceGroupFilter?: Entity<number>[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<ISubLocationListDto>({\r\n    url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'LocationListId',\r\n      'LocationListLocationType',\r\n      'LocationListLocationType1Name',\r\n      'LocationListName',\r\n      'LocationType',\r\n      'LocationTypeId',\r\n      'RoomId',\r\n      'RoomName',\r\n      'ServiceGroups',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      globalServiceGroupFilter?.map(\r\n        serviceGroup =>\r\n          new Condition<ISubLocationListDto>(\r\n            'ServiceGroups',\r\n            ODataOperators.AnyIn,\r\n            serviceGroup.Id,\r\n            'Id',\r\n          ),\r\n      ) ?? [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n\r\nexport function SubLocationListPicker(props: SubLocationListPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    !props.withoutServiceGroups\r\n      ? globalServiceGroupFilter || undefined\r\n      : undefined,\r\n  );\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || 'sublocationlistId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ReservationDetailsProps } from '../../pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../../pages/ReservationDetails/Details/slice/types';\r\nimport ButtonLink, { ButtonLinkProps } from '../BasicLinks/ButtonLink';\r\n\r\nexport interface ReservationEditButtonProps extends ButtonProps {\r\n  reservationId: number;\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function ReservationEditButton({\r\n  variant = 'white',\r\n  size = 'small',\r\n  onClick,\r\n  startIcon,\r\n  reservationId,\r\n  useSidePanel,\r\n  ...props\r\n}: ReservationEditButtonProps) {\r\n  props.children = props.children ?? reservationId;\r\n  const p = useReservationEditBehavior({\r\n    onClick: onClick,\r\n    useSidePanel: useSidePanel,\r\n  });\r\n  return (\r\n    <Button\r\n      variant={variant}\r\n      size={size}\r\n      startIcon={startIcon}\r\n      {...p(reservationId)}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport interface ReservationEditButtonLinkProps extends ButtonLinkProps {\r\n  reservationId: number;\r\n}\r\nexport function ReservationEditButtonLink({\r\n  onClick,\r\n  reservationId,\r\n  ...props\r\n}: ReservationEditButtonLinkProps) {\r\n  props.children = props.children ?? reservationId;\r\n  const p = useReservationEditBehavior({\r\n    onClick: onClick,\r\n  });\r\n  return <ButtonLink onClick={p(reservationId).onClick} {...props} />;\r\n}\r\n\r\nexport interface ReservationEditBehaviorProps<TElement = HTMLElement> {\r\n  onClick?: React.MouseEventHandler<TElement>;\r\n  useSidePanel?: boolean;\r\n}\r\nexport function useReservationEditBehavior<TElement = HTMLElement>(\r\n  props: ReservationEditBehaviorProps<TElement>,\r\n) {\r\n  const { openPanel } = useSidePanelState();\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const EnableLegacyScheduler = useSelector(\r\n    selectGlobalDbSetting_EnableLegacyScheduler,\r\n  );\r\n  return (reservationId: number) => {\r\n    const params = {\r\n      id: String(reservationId),\r\n      un: User?.Id,\r\n    } as ReservationQueryStringParameters;\r\n    const handleClick = e => {\r\n      if (!EnableLegacyScheduler) {\r\n        openPanel({\r\n          renderPageType: RenderPageType.ReservationDetails,\r\n          renderPageProps: {\r\n            queryParams: params,\r\n            useSidePanel: true,\r\n          } as ReservationDetailsProps,\r\n          expanded: false,\r\n          useSidePanel: props.useSidePanel,\r\n          isCover: props.useSidePanel,\r\n        } as SidePanelOpenState);\r\n      }\r\n      props.onClick?.(e);\r\n    };\r\n    const legacyURL: IPathAndQuery = {\r\n      path: '/Reservation.aspx',\r\n      search: { Edit: reservationId },\r\n    };\r\n    const p = EnableLegacyScheduler\r\n      ? {\r\n          component: ExternalLink,\r\n          href: legacyURL,\r\n        }\r\n      : {\r\n          onClick: handleClick,\r\n        };\r\n    return p;\r\n  };\r\n}\r\n","/**\r\n *\r\n * MultiSelectBasicPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface BaseOptionsMultiPickerProps<T>\r\n  extends Omit<AutocompleteMultiPickerProps<T>, 'loadData'> {\r\n  getOptions: (searchTerm: string | null) => Entity<T>[];\r\n}\r\n\r\nexport function BaseOptionsMultiPicker<T>(\r\n  props: BaseOptionsMultiPickerProps<T>,\r\n) {\r\n  const { getOptions, ...other } = props;\r\n  const loadData = async (searchTerm: string | null): Promise<any> =>\r\n    new Promise<any>(resolve => {\r\n      const opts = getOptions(searchTerm);\r\n      resolve(opts);\r\n    });\r\n  return <AutocompleteMultiPicker loadData={loadData} {...other} />;\r\n}\r\n","import { RootState } from 'types';\r\nimport { createSelector } from '@reduxjs/toolkit';\r\n\r\nconst selectRouterSlice = (state: RootState) => {\r\n  return state.router;\r\n};\r\nexport const selectRouterLocation = createSelector(\r\n  [selectRouterSlice],\r\n  state => state?.location,\r\n);\r\nexport const selectRouterAction = createSelector(\r\n  [selectRouterSlice],\r\n  state => state?.action,\r\n);\r\nexport const selectRouterSearch = createSelector(\r\n  [selectRouterLocation],\r\n  state => state?.search,\r\n);\r\nexport const selectRouterSearchParams = createSelector(\r\n  [selectRouterSearch],\r\n  state => new URLSearchParams(state),\r\n);\r\nexport const selectRouterPathname = createSelector(\r\n  [selectRouterLocation],\r\n  state => state?.pathname,\r\n);\r\n","export enum BudgetExperimentStatuses {\r\n  Draft = 0,\r\n  Pending = 1,\r\n  Approved = 2,\r\n  Rejected = 3,\r\n}\r\n","/**\r\n *\r\n * SuperGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISuperGroupFilterDto } from 'api/odata/generated/entities/ISuperGroupDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport type DivisionsUrl = 'base' | 'full' | 'public';\r\nexport interface SuperGroupPickerProps\r\n  extends Omit<AutocompletePickerProps<ISuperGroupFilterDto>, 'loadData'> {\r\n  urlType?: DivisionsUrl;\r\n}\r\n\r\nconst url = '/api/odata/v4/SuperGroupFilter';\r\nconst publicUrl = '/api/odata/v4/SuperGroupFilter/GetPublicDivisions';\r\nconst baseUrl = '/api/odata/v4/SuperGroupFilter/GetDivisions';\r\nexport const initSuperGroupData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: DivisionsUrl,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<ISuperGroupFilterDto[]>((resolve, reject) => {\r\n      resolve([] as ISuperGroupFilterDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        sourceUrl !== undefined && sourceUrl !== 'full'\r\n          ? 'Id,Name,ServiceGroups'\r\n          : 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    let initUrl =\r\n      sourceUrl === 'public' ? publicUrl : sourceUrl === 'base' ? baseUrl : url;\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as ISuperGroupFilterDto[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<ISuperGroupFilterDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: DivisionsUrl,\r\n) => {\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicUrl\r\n      : urlType === 'base'\r\n      ? baseUrl\r\n      : url;\r\n\r\n  return getAutoCompleteLoadDataFn<ISuperGroupFilterDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select:\r\n      urlType !== undefined && urlType !== 'full'\r\n        ? ['Id', 'Name', 'ServiceGroups']\r\n        : ['Id', 'Name'],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter &&\r\n      globalServiceGroupFilter.length > 0 &&\r\n      urlType !== undefined &&\r\n      urlType !== 'full'\r\n        ? [\r\n            new Condition<ISuperGroupFilterDto>(\r\n              'ServiceGroups',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function SuperGroupPicker(props: SuperGroupPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    isAuth ? globalServiceGroupFilter || [] : [],\r\n    isAuth,\r\n    props.urlType,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || 'supergroupid'}\r\n      ariaLabel=\"Divisions search\"\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AllowedToRender, RenderTypes } from './renderTypes';\r\n\r\nexport function useAssetsPermissions() {\r\n  const user = useSelector(selectAuthenticatedUser);\r\n\r\n  const allowedToView = React.useCallback(\r\n    (rows: IAssetDto[], render: RenderTypes): boolean => {\r\n      if (!user) return false;\r\n      return rows.every(f => AllowedToRender(user, render, f));\r\n    },\r\n    [user],\r\n  );\r\n  return {\r\n    allowedToView,\r\n  };\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n  Box,\r\n  Divider,\r\n  Grid,\r\n  ListItemText,\r\n  MenuItem,\r\n  MenuList,\r\n  Popover,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n  AssetsFilterForWorkOrder,\r\n  AssetsPicker,\r\n} from 'app/components/pickers/MultiSelectPickers/AssetsPicker/index';\r\nimport { initWOTypeDataParams } from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface AddWorkOrderProps<TRow> {\r\n  rows: TRow[];\r\n  getAssets: (rows: TRow[]) => Promise<IAssetDto[]>;\r\n  downtime?: boolean;\r\n  buttonName?: string;\r\n  primary?: boolean;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n  onClick?: () => void;\r\n}\r\nconst WorkButton = props => {\r\n  return (\r\n    <Button\r\n      variant={props.primary ? 'main' : 'white'}\r\n      size=\"small\"\r\n      title={props.title}\r\n      startIcon={<Icon icon=\"plus\" />}\r\n      endIcon={<Icon icon=\"chevron-down\" />}\r\n      onClick={props.handleClick}\r\n      aria-controls={props.id}\r\n      aria-haspopup=\"true\"\r\n    >\r\n      {props.buttonName}\r\n    </Button>\r\n  );\r\n};\r\nexport function AddWorkOrder<TRow>({\r\n  rows,\r\n  getAssets,\r\n  downtime,\r\n  buttonName,\r\n  primary,\r\n  useSidePanel,\r\n  openPanelWithCover,\r\n  onClick,\r\n}: AddWorkOrderProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const location = useLocation();\r\n  const { openPanel } = useSidePanelState();\r\n  const [assets, setAssets] = React.useState<IAssetDto[] | undefined>([]);\r\n  const [workTypes, setWorkTypes] = React.useState<\r\n    IWorkOrderTypeDto[] | undefined\r\n  >(undefined);\r\n  const [workTypeLoading, setWorkTypeLoading] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [assetLoading, setAssetLoading] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [anchorEl, setAnchorEl] = React.useState(null);\r\n  const [open, setOpen] = React.useState(false);\r\n  const handleAssetChange = React.useCallback((value: IAssetDto[] | []) => {\r\n    setAssets(value);\r\n    setWorkTypeLoading(undefined);\r\n    // setWorkTypeLoading(true);\r\n    // initWOTypeDataParams(value, undefined, downtime).then(types => {\r\n    //   setWorkTypes(types);\r\n    //   setWorkTypeLoading(false);\r\n    // });\r\n  }, []);\r\n  const getParamFromUrl = (name: string): string | undefined => {\r\n    return GetRawValue(new URLSearchParams(location.search), name) ?? undefined;\r\n  };\r\n  const handleWorkTypeClick = (event: IWorkOrderTypeDto) => {\r\n    let params = {\r\n      queryParams: {\r\n        id: undefined,\r\n        aType: event.Id.toString(),\r\n        down: (downtime === true && event.AssetAlertType).toString(),\r\n        source: getParamFromUrl('source'),\r\n        Up: getParamFromUrl('Up'),\r\n        title: getParamFromUrl('title'),\r\n        eStart: getParamFromUrl('eStart'),\r\n        sympt: getParamFromUrl('sympt'),\r\n        aStatus: getParamFromUrl('aStatus'),\r\n        aStart: getParamFromUrl('aStart'),\r\n        desc: getParamFromUrl('desc'),\r\n        assetId: !!assets ? assets.map(a => a.Id).join(',') : undefined,\r\n        offH: (downtime === true && event.AssetAlertType).toString(),\r\n        offStart: getParamFromUrl('offStart'),\r\n        offEnd: getParamFromUrl('offStart'),\r\n        reason: getParamFromUrl('reason'),\r\n        eqid: getParamFromUrl('eqid'),\r\n        sid: getParamFromUrl('sid'),\r\n      } as WorkOrderQueryStringParameters,\r\n      useSidePanel: true,\r\n    } as WorkOrderDetailsProps;\r\n    const panelProps = {\r\n      renderPageType: RenderPageType.WorkOrderDetails,\r\n      renderPageProps: params,\r\n      expanded: false,\r\n      useSidePanel: useSidePanel,\r\n      isCover: useSidePanel,\r\n    } as SidePanelOpenState;\r\n\r\n    !!openPanelWithCover\r\n      ? openPanelWithCover(panelProps)\r\n      : openPanel(panelProps);\r\n    onClick?.();\r\n    setOpen(false);\r\n  };\r\n  React.useEffect(() => {\r\n    let active =\r\n      open && !assetLoading && (assets === undefined || assets?.length < 1);\r\n    if (active) {\r\n      setAssetLoading(true);\r\n      getAssets(rows).then(ass => {\r\n        setAssets(() => ass);\r\n        setAssetLoading(false);\r\n      });\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [assetLoading, assets, getAssets, open, rows]);\r\n  React.useEffect(() => {\r\n    let active =\r\n      open && !!assets && assets.length > 0 && workTypeLoading === undefined;\r\n    if (active) {\r\n      setWorkTypeLoading(true);\r\n      initWOTypeDataParams(assets, undefined, downtime).then(types => {\r\n        setWorkTypes(types);\r\n        setWorkTypeLoading(false);\r\n      });\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [assets, downtime, open, workTypeLoading]);\r\n  const handleClick = event => {\r\n    setAnchorEl(event.currentTarget);\r\n    setOpen(prev => !prev);\r\n  };\r\n  return (\r\n    <div>\r\n      <WorkButton\r\n        handleClick={handleClick}\r\n        id={`workOrderCreate-${downtime ? 'downtime' : 'new'}`}\r\n        title={t(translations.CreateAnAssetRelatedEvent) as string}\r\n        buttonName={buttonName || (t(translations.AddEvent) as string)}\r\n        primary={primary}\r\n      />\r\n      <Popover\r\n        onClose={handleClick}\r\n        id={`workOrderCreate-${downtime ? 'downtime' : 'new'}`}\r\n        open={open}\r\n        marginThreshold={1}\r\n        anchorEl={anchorEl}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'left',\r\n        }}\r\n        transformOrigin={{\r\n          vertical: 'top',\r\n          horizontal: 'left',\r\n        }}\r\n        getContentAnchorEl={null}\r\n        PaperProps={{ style: { width: '350px' } }}\r\n      >\r\n        <div style={{ padding: 16 }}>\r\n          <Grid container spacing={2} wrap=\"nowrap\" direction=\"column\">\r\n            <Grid item>\r\n              <Box display=\"row\" justifyContent=\"space-between\">\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.CreateAnAssetRelatedEvent)}\r\n                </Body>\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  aria-label=\"close\"\r\n                  size=\"xs\"\r\n                  style={{ position: 'absolute', right: 8, top: 8 }}\r\n                  onClick={() => {\r\n                    setOpen(false);\r\n                    setAssets([]);\r\n                    setWorkTypes([]);\r\n                  }}\r\n                >\r\n                  <Icon icon=\"times\" />\r\n                </IconButton>\r\n              </Box>\r\n            </Grid>\r\n            <Grid item>\r\n              <React.Fragment>\r\n                <AssetsPicker\r\n                  predicates={AssetsFilterForWorkOrder(undefined)}\r\n                  key=\"assetKey\"\r\n                  onChange={value => {\r\n                    handleAssetChange(value);\r\n                  }}\r\n                  placeholder={t(translations.QuickWorkOrderPleaseSelectAssets)}\r\n                  fullWidth={true}\r\n                  name=\"assets\"\r\n                  variant=\"filled\"\r\n                  id=\"asset-id\"\r\n                  restrictByAvType=\"serviceRelated\"\r\n                  label={t(translations.Asset)}\r\n                  value={assets || undefined}\r\n                />\r\n              </React.Fragment>\r\n            </Grid>\r\n            {assets && assets.length > 0 && (\r\n              <React.Fragment>\r\n                <Grid item>\r\n                  <Divider variant=\"fullWidth\" />\r\n                </Grid>\r\n                <Grid item>\r\n                  <MenuList\r\n                    variant=\"menu\"\r\n                    dense\r\n                    style={{ maxHeight: `${42 * 10}px` }}\r\n                  >\r\n                    <MenuItem key=\"selectEventType\">\r\n                      <Body size=\"small\" bold={true}>\r\n                        {t(translations.PleaseSelectAnEventType)}\r\n                      </Body>\r\n                      <Divider />\r\n                    </MenuItem>\r\n                    {workTypeLoading ? (\r\n                      <MenuItem key=\"skeleton-1\">\r\n                        <Box display=\"flex\" width=\"100%\" flexDirection=\"column\">\r\n                          <Skeleton width=\"100%\" variant=\"text\" />\r\n                          <Skeleton width=\"100%\" variant=\"text\" />\r\n                        </Box>\r\n                      </MenuItem>\r\n                    ) : workTypes && workTypes.length > 0 ? (\r\n                      workTypes.map(wt => (\r\n                        <MenuItem\r\n                          key={wt.Id}\r\n                          onClick={() => {\r\n                            handleWorkTypeClick(wt);\r\n                            setAssets([]);\r\n                            setWorkTypes([]);\r\n                          }}\r\n                        >\r\n                          <ListItemText>\r\n                            <Body size=\"small\">{wt.Name}</Body>\r\n                          </ListItemText>\r\n                        </MenuItem>\r\n                      ))\r\n                    ) : (\r\n                      <MenuItem key=\"notFoundType\">\r\n                        <ListItemText>\r\n                          {t(translations.NoAlertTypesFoundForSelectedAssets)}\r\n                        </ListItemText>\r\n                      </MenuItem>\r\n                    )}\r\n                  </MenuList>\r\n                </Grid>\r\n              </React.Fragment>\r\n            )}\r\n          </Grid>\r\n        </div>\r\n      </Popover>\r\n    </div>\r\n  );\r\n}\r\n","/**\r\n *\r\n * RegionFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsAuthenticated } from 'app/slice/selectors';\r\nimport { RegionPicker } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\n\r\nexport const RegionFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  return (\r\n    <RegionPicker\r\n      onChange={handleOnChange}\r\n      urlType={isAuth === true ? props.urlType ?? 'base' : 'public'}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      size=\"small\"\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\nexport default RegionFilter;\r\n","import { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\n\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface MyAssetAvailabilityTypeMultiPickerProps\r\n  extends Omit<AutocompleteMultiPickerExProps<Entity<number>>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  urlType?: 'allServices' | 'onlineServices';\r\n}\r\n\r\nconst url = '/api/odata/v4/AvailabilityTypesFilter/GetMyAsset';\r\nconst onlineUrl = '/api/odata/v4/AvailabilityTypesFilter/GetOnlineMyAsset';\r\nexport const initMyAssetAvailabilityTypeMultiData = (\r\n  initval: string | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const ids = initval.split('|').map(v => parseInt(v));\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Id asc', //Must be ordered by ID to prevent re-rendering as a result of reordering.\r\n      $filter: '(Id in (' + ids.join(',') + '))',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: ids.length,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport const initMyAssetAvailabilityTypeOnlineMultiData = (\r\n  initval: string | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const ids = initval.split('|').map(v => parseInt(v));\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Id asc', //Must be ordered by ID to prevent re-rendering as a result of reordering.\r\n      $filter: '(Id in (' + ids.join(',') + '))',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: ids.length,\r\n    };\r\n    return httpClient\r\n      .get(onlineUrl, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport function MyAssetAvailabilityTypeMultiPicker(\r\n  props: MyAssetAvailabilityTypeMultiPickerProps,\r\n) {\r\n  const { urlType, predicates } = props;\r\n  const loadData = getAutoCompleteLoadDataFn<Entity<number>>({\r\n    url: !!urlType && urlType === 'onlineServices' ? onlineUrl : url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name'],\r\n  });\r\n\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      ariaLabel=\"Availability Type search\"\r\n      id={props.id || 'AvailabilityId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import Badge from '@material-ui/core/Badge';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { IconButton } from '../IconButton';\r\n\r\nexport interface FilterIconButtonProps {\r\n  filterLength: number;\r\n  handleClick: React.MouseEventHandler<HTMLButtonElement>;\r\n  innerRef?: React.RefObject<HTMLButtonElement>;\r\n}\r\n\r\nexport function FilterIconButton({\r\n  filterLength: filterLengs,\r\n  handleClick: onClick,\r\n  ...props\r\n}: FilterIconButtonProps) {\r\n  return (\r\n    <Badge\r\n      key={0}\r\n      anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\r\n      badgeContent={filterLengs}\r\n      showZero={false}\r\n      color=\"primary\"\r\n    >\r\n      <IconButton\r\n        innerRef={props.innerRef}\r\n        variant=\"ghost\"\r\n        shape=\"square\"\r\n        size=\"small\"\r\n        onClick={onClick}\r\n      >\r\n        <Icon\r\n          icon=\"filter\"\r\n          size=\"sm\"\r\n          color={filterLengs > 0 ? 'primary' : 'default'}\r\n          colorExtend={filterLengs > 0 ? 'main' : 'dark'}\r\n        />\r\n      </IconButton>\r\n    </Badge>\r\n  );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { ReservationDetailsProps } from '../../pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../../pages/ReservationDetails/Details/slice/types';\r\n\r\nexport interface ReservationCreateButtonProps extends ButtonProps {\r\n  instruments: number[];\r\n  useSidePanel?: boolean;\r\n  openPanelOrCover?: (state: SidePanelOpenState) => void;\r\n}\r\nexport function ReservationCreateButton({\r\n  variant = 'white',\r\n  size = 'small',\r\n  onClick,\r\n  startIcon,\r\n  instruments,\r\n  useSidePanel,\r\n  openPanelOrCover,\r\n  ...props\r\n}: ReservationCreateButtonProps) {\r\n  const { openPanel } = useSidePanelState();\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const EnableLegacyScheduler = useSelector(\r\n    selectGlobalDbSetting_EnableLegacyScheduler,\r\n  );\r\n\r\n  const params = {\r\n    selectedIds: String(instruments.join(',')),\r\n    un: User?.Id,\r\n  } as ReservationQueryStringParameters;\r\n\r\n  const handleClick = e => {\r\n    if (!EnableLegacyScheduler) {\r\n      const openProps = {\r\n        renderPageType: RenderPageType.ReservationDetails,\r\n        renderPageProps: {\r\n          useSidePanel: true,\r\n          queryParams: params,\r\n        } as ReservationDetailsProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState;\r\n      !!openPanelOrCover ? openPanelOrCover(openProps) : openPanel(openProps);\r\n    }\r\n    onClick?.(e);\r\n  };\r\n  const legacyURL: IPathAndQuery = {\r\n    path: '/Reservation.aspx',\r\n    search: { id: instruments.join(',') },\r\n  };\r\n  const p = EnableLegacyScheduler\r\n    ? {\r\n        component: ExternalLink,\r\n        href: legacyURL,\r\n      }\r\n    : {};\r\n  return (\r\n    <Button\r\n      variant={variant}\r\n      size={size}\r\n      startIcon={startIcon ?? <Icon icon=\"plus\" />}\r\n      onClick={handleClick}\r\n      target={EnableLegacyScheduler ? '_blank' : undefined}\r\n      {...p}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\n\r\nexport const ReservationLink = (props: {\r\n  id: number;\r\n  children: React.ReactNode;\r\n  title?: string;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) => {\r\n  const { t } = useTranslation();\r\n  const openDetails = useOpenReservationPopUp();\r\n  const getLink = useReservationLinkUrl();\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const link = getLink({ id: String(props.id), un: User?.Id });\r\n  const open = React.useCallback(() => {\r\n    openDetails(\r\n      {\r\n        id: props.id,\r\n        useSidePanel: props.useSidePanel,\r\n      },\r\n      props.openPanelWithCover,\r\n    );\r\n  }, [openDetails, props.id, props.openPanelWithCover, props.useSidePanel]);\r\n  return (\r\n    <Tooltip\r\n      title={props.title ?? t(translations.ClickToSeeReservationDetails)}\r\n    >\r\n      <MuiLink\r\n        onClick={event => {\r\n          if (!!link) {\r\n            if (!event.ctrlKey) {\r\n              event.preventDefault();\r\n              open();\r\n            }\r\n          } else {\r\n            open();\r\n          }\r\n        }}\r\n        color=\"textPrimary\"\r\n        href={link}\r\n      >\r\n        {props.children}\r\n      </MuiLink>\r\n    </Tooltip>\r\n  );\r\n};\r\n\r\nexport const useOpenReservationPopUp = () => {\r\n  const { openPanel } = useSidePanelState();\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  return React.useCallback(\r\n    (\r\n      props: { id: number; useSidePanel?: boolean; useSwitchButtons?: boolean },\r\n      openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n    ) => {\r\n      const params = {\r\n        id: String(props.id),\r\n        un: User?.Id,\r\n      } as ReservationQueryStringParameters;\r\n      let resProps = {\r\n        queryParams: params,\r\n        useSidePanel: true,\r\n        useSwitchButtons: props.useSwitchButtons,\r\n      } as ReservationDetailsProps;\r\n\r\n      const panelState = {\r\n        renderPageType: RenderPageType.ReservationDetails,\r\n        renderPageProps: resProps,\r\n        expanded: false,\r\n        useSidePanel: props.useSidePanel,\r\n        isCover: props.useSidePanel,\r\n      } as SidePanelOpenState;\r\n      if (!!openPanelWithCover) {\r\n        openPanelWithCover(panelState);\r\n      } else {\r\n        openPanel({\r\n          renderPageType: RenderPageType.ReservationDetails,\r\n          renderPageProps: resProps,\r\n          expanded: false,\r\n          useSidePanel: false,\r\n          isCover: false,\r\n        } as SidePanelOpenState);\r\n      }\r\n    },\r\n    [User?.Id, openPanel],\r\n  );\r\n};\r\nexport const useReservationLinkUrl = () => {\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n\r\n  return React.useCallback(\r\n    (params: ReservationQueryStringParameters) => {\r\n      return buildURL(publicUrl + 'reservations/details', params);\r\n    },\r\n    [publicUrl],\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport Scheduler, { SchedulerProps } from './Scheduler';\r\nimport { useSchedulerSlice } from './Scheduler/slice';\r\nimport { IViewState, ViewLengths, ViewTypes } from './Scheduler/slice/types';\r\nimport {\r\n  IWithSavedHistoryComponentProps,\r\n  withSavedHistoryT,\r\n} from 'app/components/BasicTable/withSavedHistory';\r\n\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { presetPeriodToViewLength } from './Scheduler/utils/parseLength';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { CalendarHeader } from './Scheduler/components/CalendarHeader';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { CombinedSchedulerTRow, getFilters } from './Filter';\r\nimport { getDefaultFilter } from './getDefaultFilter';\r\nimport { getRequiredFilter } from './getRequiredFilter';\r\nimport { MyListFilter } from 'app/pages/ReservationHistoryPage/MyListFilter';\r\nimport { getPredicates } from 'api/odata/getPredicates';\r\nimport { ErrorBoundary } from 'app/components/ErrorBoundary';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport {\r\n  selectCustomDaysTimelineButtonEnabled,\r\n  selectDefaultCustomDaysTimelineValue,\r\n  selectSchedulerLoadingEvents,\r\n  selectSchedulerServicesLimit,\r\n  selectSchedulerServicesLimitReached,\r\n  selectTwoDaysTimelineButtonEnabled,\r\n} from './Scheduler/slice/selectors';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport {\r\n  TableRowsSkeleton,\r\n  TableSkeleton,\r\n} from 'app/components/BasicTable/components/TableSkeleton';\r\nimport {\r\n  getPeriodFromViewLength,\r\n  viewStateFromFilter,\r\n} from './Scheduler/utils';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useLocation } from 'react-router';\r\nimport { H1 } from 'app/components/Typography';\r\nimport {\r\n  groupByFilterFieldName,\r\n  periodFilterFieldName,\r\n} from './parseCalendarPageParams';\r\n\r\nexport type SchedulerWithFiltersProps = IWithSavedHistoryComponentProps<\r\n  CombinedSchedulerTRow\r\n> &\r\n  SchedulerProps;\r\nexport const SchedulerWithFilters = function ({\r\n  appliedFilters,\r\n  availableFilters,\r\n  getFilterValue,\r\n  setFilterValue,\r\n  ...props\r\n}: SchedulerWithFiltersProps) {\r\n  const dispatch = useDispatch();\r\n  const { t } = useTranslation();\r\n  const { actions } = useSchedulerSlice();\r\n  const location = useLocation();\r\n  const customDaysEnabled = useSelector(selectCustomDaysTimelineButtonEnabled);\r\n  const customDays = useSelector(selectDefaultCustomDaysTimelineValue);\r\n  const twoDaysEnabled = useSelector(selectTwoDaysTimelineButtonEnabled);\r\n  const isMobile = DetectIsMobile();\r\n  const loadingEvents = useSelector(selectSchedulerLoadingEvents);\r\n  // change scheduler period & date when \"Date Period\" is changed in the filter\r\n  React.useEffect(() => {\r\n    const periodValue: PresetDatesRange = getFilterValue?.(\r\n      periodFilterFieldName,\r\n    ) as PresetDatesRange;\r\n    const preset = (periodValue as PresetDatesRange)?.type?.Id;\r\n    const date = (periodValue as PresetDatesRange)?.start;\r\n    if (preset !== undefined && date !== undefined && date !== null) {\r\n      const new_state: Partial<IViewState> = {\r\n        viewLength: presetPeriodToViewLength(\r\n          preset as SchedulerDatePositionUnion,\r\n          props.viewType,\r\n        ),\r\n        date: dateUtils.formatISO(date),\r\n      };\r\n\r\n      dispatch(actions.changeViewModePartial(new_state));\r\n    }\r\n  }, [actions, dispatch, getFilterValue, props.viewType]);\r\n\r\n  // collapsed state of the filters\r\n  // reference to the show/hide filters button\r\n  const [\r\n    filtersButtonAnchorEl,\r\n    setFiltersButtonAnchorEl,\r\n  ] = React.useState<HTMLButtonElement | null>(null);\r\n  const filterRef = React.useRef(null);\r\n  // collapsed state of the filters\r\n  const [filterOpen, setFilterOpen] = React.useState<boolean>(false);\r\n  const handleFilterOpen = React.useCallback(() => {\r\n    setFiltersButtonAnchorEl(filterRef.current);\r\n    setFilterOpen(true);\r\n  }, []);\r\n  const handleFilterClose = React.useCallback(() => {\r\n    setFiltersButtonAnchorEl(null);\r\n    setFilterOpen(false);\r\n  }, []);\r\n\r\n  const fetchData = React.useCallback(() => {\r\n    const serviceFilterId = 'service';\r\n    const service = getFilterValue?.(serviceFilterId);\r\n    // wait for a services value where service name is already populated\r\n    // if the Name is empty then there the appliedFilters will immediately change after the population\r\n    if (Array.isArray(service) && service.some(f => f.Name === undefined)) {\r\n      return;\r\n    }\r\n    const foo = appliedFilters?.reduce((acc, current) => {\r\n      if (current.id !== undefined) {\r\n        let setValue: FilterValueType | undefined = undefined;\r\n        if (current.id === 'period') {\r\n          setValue = (current.value as PresetDatesRange)?.type?.Id;\r\n        } else {\r\n          setValue = current.value;\r\n        }\r\n        const predicate = {\r\n          value: setValue,\r\n          predicate: getPredicates<CombinedSchedulerTRow>(\r\n            [current],\r\n            // todo: deal with the customParams\r\n            () => void 0,\r\n            () => void 0,\r\n          ).join(' and '),\r\n        };\r\n        if (predicate.predicate !== '') {\r\n          acc[current.id] = predicate;\r\n        }\r\n      }\r\n      return acc;\r\n    }, {});\r\n    dispatch(actions.setFilters(foo));\r\n  }, [actions, appliedFilters, dispatch, getFilterValue]);\r\n\r\n  const handleRefresh = React.useCallback(() => {\r\n    fetchData();\r\n  }, [fetchData]);\r\n\r\n  React.useEffect(() => {\r\n    fetchData();\r\n  }, [fetchData]);\r\n\r\n  const handleFilterChange = (\r\n    value: IFilterSettings<CombinedSchedulerTRow>[],\r\n  ) => {\r\n    props.onFilterChange?.(value);\r\n  };\r\n  const handleSetPeriodFilter = React.useCallback(\r\n    (length: ViewLengths, value?: Date) => {\r\n      let changedValue = getPeriodFromViewLength(\r\n        length,\r\n        value ?? dateUtils.parseISO(props.date),\r\n        customDays,\r\n      );\r\n      !!setFilterValue && setFilterValue(periodFilterFieldName, changedValue);\r\n    },\r\n    [customDays, props.date, setFilterValue],\r\n  );\r\n  const updateSearchPeriod = (\r\n    preset: SchedulerDatePositionUnion | null,\r\n    search?: string,\r\n  ) => {\r\n    if (preset !== null) {\r\n      const params = new URLSearchParams(search ?? '');\r\n      if (params.has(periodFilterFieldName)) {\r\n        params.delete(periodFilterFieldName);\r\n      }\r\n      params.set(periodFilterFieldName, preset);\r\n      return params.toString();\r\n    }\r\n    return search;\r\n  };\r\n  const handleViewTypeLengthChange = (\r\n    type: ViewTypes,\r\n    length: ViewLengths,\r\n    value?: Date,\r\n    noChangeLocation?: boolean,\r\n  ) => {\r\n    let presetValue = getPeriodFromViewLength(\r\n      length,\r\n      value ?? dateUtils.parseISO(props.date),\r\n      customDays,\r\n    );\r\n    handleSetPeriodFilter(length, value);\r\n    let searchComp =\r\n      updateSearchPeriod(\r\n        viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n        location.search,\r\n      ) ?? location.search;\r\n    dispatch(\r\n      actions.changeViewMode({\r\n        current: {\r\n          viewType: type,\r\n          viewLength: length,\r\n          date: !!value ? dateUtils.formatISO(value) : props.date,\r\n          preset: isMobile\r\n            ? null\r\n            : viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n          search: searchComp,\r\n          customDays: customDays,\r\n          customStart: undefined,\r\n        },\r\n        withNoChangeLocation: noChangeLocation,\r\n      }),\r\n    );\r\n  };\r\n\r\n  const handleMultipleModeChange: ValueChangeHandler<boolean> = value => {\r\n    dispatch(actions.updateMultiMode(value));\r\n  };\r\n  const servicesLimit = useSelector(selectSchedulerServicesLimit);\r\n  const limitReached = useSelector(selectSchedulerServicesLimitReached);\r\n  React.useEffect(() => {\r\n    if (limitReached) {\r\n      const msg = t(translations.SchedulerServicesLimitReachedWarningMessage, {\r\n        servicesLimit: servicesLimit,\r\n      });\r\n      dispatch(\r\n        appSettingsActions.addNotification({\r\n          key: translations.SchedulerServicesLimitReachedWarningMessage,\r\n          variant: 'warning',\r\n          message: msg,\r\n        }),\r\n      );\r\n    }\r\n  }, [dispatch, limitReached, servicesLimit, t]);\r\n\r\n  if (appliedFilters === undefined) {\r\n    return null;\r\n  }\r\n\r\n  const showSkeleton =\r\n    props.services === undefined ||\r\n    props.viewType === undefined ||\r\n    props.viewLength === undefined;\r\n\r\n  if (showSkeleton) {\r\n    return <TableSkeleton />;\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <CalendarHeader\r\n        viewType={props.viewType}\r\n        viewLength={props.viewLength}\r\n        date={props.date}\r\n        appliedFilters={appliedFilters}\r\n        availableFilters={availableFilters}\r\n        onFilterChange={handleFilterChange}\r\n        onMultipleModeChange={handleMultipleModeChange}\r\n        filtersButtonAnchorEl={filtersButtonAnchorEl}\r\n        onFilterClose={handleFilterClose}\r\n        onFilterOpen={handleFilterOpen}\r\n        filterRef={filterRef}\r\n        setFilterValue={setFilterValue}\r\n        filterOpen={filterOpen}\r\n        customDays={customDays}\r\n        customDaysEnabled={customDaysEnabled}\r\n        twoDaysEnabled={twoDaysEnabled}\r\n        handleViewTypeLengthChange={handleViewTypeLengthChange}\r\n        handleSetPeriodFilter={handleSetPeriodFilter}\r\n        updateSearchPeriod={updateSearchPeriod}\r\n        getDefaultFilters={props.getDefaultFilters}\r\n        onRefresh={handleRefresh}\r\n        loading={!!loadingEvents}\r\n      />\r\n      {loadingEvents ? (\r\n        <TableRowsSkeleton isMobile={isMobile} isCards={false} />\r\n      ) : (\r\n        <ErrorBoundary fallBack={<H1>{t(translations.AnErrorOccurred)}</H1>}>\r\n          <Scheduler\r\n            services={props.services}\r\n            events={props.events}\r\n            defaultDuration={props.defaultDuration}\r\n            nonWorkingHours={props.nonWorkingHours}\r\n            date={props.date}\r\n            viewType={props.viewType}\r\n            viewLength={props.viewLength}\r\n            presetPosition={props.presetPosition}\r\n            search={props.search}\r\n            onDataUpdated={props.onDataUpdated}\r\n            onViewModeChange={props.onViewModeChange}\r\n            onFilterChange={handleFilterChange}\r\n            onEdit={props.onEdit}\r\n            appliedFilters={appliedFilters}\r\n            onCreate={props.onCreate}\r\n            setFilterValue={setFilterValue}\r\n            reservationEditEvents={props.reservationEditEvents}\r\n            customDays={customDays}\r\n            customDaysEnabled={customDaysEnabled}\r\n            twoDaysEnabled={twoDaysEnabled}\r\n            handleViewTypeLengthChange={handleViewTypeLengthChange}\r\n          />\r\n        </ErrorBoundary>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n\r\nexport const SchedulerConnectedWithFilters = withSavedHistoryT<\r\n  CombinedSchedulerTRow,\r\n  SchedulerWithFiltersProps\r\n>(\r\n  SchedulerWithFilters,\r\n  '/schedule',\r\n  getFilters,\r\n  getDefaultFilter,\r\n  [periodFilterFieldName, groupByFilterFieldName],\r\n  getRequiredFilter,\r\n  MyListFilter,\r\n  true,\r\n);\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\n/**\r\n * Gets the default filters for the calendar/timeline\r\n * @param user\r\n * @returns\r\n */\r\nexport const getDefaultFilter: (\r\n  user: IAuthenticatedUser,\r\n) => URLSearchParams = user => {\r\n  const result = new URLSearchParams();\r\n  return result;\r\n};\r\n","export function getRequiredFilter(\r\n  search: string,\r\n  appSettings,\r\n): string | undefined {\r\n  return undefined;\r\n}\r\n","import * as React from 'react';\r\nimport { Redirect } from 'react-router';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting/index';\r\nimport {\r\n  parseProfileUrl,\r\n  undefinedIfIsEmpty,\r\n} from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { CalendarPageProps, calendarPathUserProfileKey } from './index';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { ViewTypes } from './Scheduler/slice/types';\r\nimport { trimEnd } from 'lodash';\r\n\r\n/**\r\n * Redirects to the last visited calendar view.\r\n * e.g. /schedule -> /schedule/timeline?eid=12150&un=&BookedById=\r\n * @param param0\r\n * @returns\r\n */\r\nexport function CalendarPageDefaultRedir({\r\n  match,\r\n  ...props\r\n}: CalendarPageProps) {\r\n  const isMobile = DetectIsMobile();\r\n  const { savedValue } = useProfileSetting({\r\n    profileSettingKey: calendarPathUserProfileKey,\r\n  });\r\n  const defaultViewType: ViewTypes = isMobile ? 'calendar' : 'timeline';\r\n  const defaultPathName = `/schedule/${defaultViewType}`;\r\n  const { pathName: savedPathName, search: savedSearch } = parseProfileUrl(\r\n    savedValue,\r\n  );\r\n  // mobile clients should always land on calendar, regardless last visited mode\r\n  const pathName = trimEnd(\r\n    isMobile ? defaultPathName : savedPathName ?? defaultPathName,\r\n    '?',\r\n  );\r\n  // the saved search part will be applied anyway\r\n  // setting it here will save one redir/replace that will happen in the useFilters componenent on the scheduler page\r\n  const search = savedSearch;\r\n\r\n  return (\r\n    <Redirect\r\n      to={{\r\n        pathname: undefinedIfIsEmpty(pathName),\r\n        search: search,\r\n      }}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { SchedulerEventEditHandler, ViewModeChangeHandler } from './Scheduler';\r\nimport { useSchedulerSlice } from './Scheduler/slice';\r\nimport {\r\n  selectSchedulerParseEvents,\r\n  selectNonWorkingHours,\r\n  selectSchedulerServices,\r\n  selectSchedulerViewState,\r\n  selectSelectedReservationEvents,\r\n  selectLoadedServices,\r\n} from './Scheduler/slice/selectors';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { INewEvent, ViewTypes } from './Scheduler/slice/types';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { generatePath } from 'react-router';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\nimport { BasicTableProps } from 'app/components/BasicTable';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { SchedulerConnectedWithFilters } from './SchedulerWithFiltersProps';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting/index';\r\nimport { parseCalendarPageParams as parseViewState } from './parseCalendarPageParams';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { Messages } from 'app/components/Messages';\r\nexport { CalendarPageDefaultRedir } from './CalendarPageDefaultRedir';\r\n\r\nexport interface CalendarPageParams {\r\n  type: ViewTypes;\r\n  period: SchedulerDatePositionUnion;\r\n}\r\n\r\nexport const calendarPageDefaultPath = '/schedule';\r\nexport const calendarPageFullPath = '/schedule/:type';\r\nexport const CalendarPagePaths = [\r\n  calendarPageFullPath,\r\n  calendarPageDefaultPath,\r\n];\r\nexport interface CalendarPageProps\r\n  extends IBasePageProps<CalendarPageParams>,\r\n    Pick<\r\n      BasicTableProps<ICalendarReservationDto>,\r\n      'filterOpen' | 'onFilterChange' | 'appliedFilters' | 'availableFilters'\r\n    > {}\r\n\r\nexport const calendarPathUserProfileKey = calendarPageDefaultPath;\r\nexport function CalendarPage({ match, location, ...props }: CalendarPageProps) {\r\n  // show the global service groups filter on the page\r\n  useGlobalServiceGroupsFilter(true);\r\n  const isMobile = DetectIsMobile();\r\n  const dispatch = useDispatch();\r\n  const { updateValue: updateX } = useProfileSetting({\r\n    profileSettingKey: calendarPathUserProfileKey,\r\n  });\r\n  const { newDate } = useSystemDate();\r\n  const viewStateSearchParams = React.useMemo(() => {\r\n    return parseViewState(match, location.search, isMobile, newDate());\r\n  }, [match, location.search, isMobile, newDate]);\r\n\r\n  // search params that not affect the viewState\r\n  const searchParams = React.useMemo(() => {\r\n    const purlSearchParams = new URLSearchParamsCI(location.search);\r\n    return {\r\n      SampleRunId: tryParseInt(purlSearchParams.get('sampleRunId')),\r\n      duration: tryParseInt(purlSearchParams.get('duration')),\r\n      un: purlSearchParams.get('un'),\r\n      srid: tryParseInt(purlSearchParams.get('srid')),\r\n      srrid: tryParseInt(purlSearchParams.get('srrid')),\r\n      bid: tryParseInt(purlSearchParams.get('bid')),\r\n    };\r\n  }, [location.search]);\r\n\r\n  React.useEffect(() => {\r\n    if (isMobile) {\r\n      return;\r\n    }\r\n    const pathName = generatePath(calendarPageFullPath, {\r\n      type: viewStateSearchParams.viewType,\r\n    });\r\n    // the \"saved filter\" url setting have to have the search part in the URL\r\n    // as it's primarily used for it's query string value in the filters component\r\n    // see parseProfileURL.ts\r\n    const url = pathName + (undefinedIfIsEmpty(location.search) ?? '?');\r\n    updateX(url);\r\n  }, [location.search, viewStateSearchParams.viewType, updateX, isMobile]);\r\n\r\n  const { actions } = useSchedulerSlice();\r\n  const events = useSelector(selectSchedulerParseEvents);\r\n  const nonWorkingHours = useSelector(selectNonWorkingHours);\r\n  const schedulerServices = useSelector(selectSchedulerServices);\r\n\r\n  const viewState = useSelector(selectSchedulerViewState);\r\n  const selectedMultipleEvents = useSelector(selectSelectedReservationEvents);\r\n\r\n  useEffectOnMount(() => {\r\n    dispatch(actions.init(viewStateSearchParams));\r\n  });\r\n\r\n  const handleViewModeChange: ViewModeChangeHandler = p => {\r\n    dispatch(actions.changeViewMode(p));\r\n  };\r\n\r\n  const handleEdit: SchedulerEventEditHandler = React.useCallback(\r\n    event => {\r\n      dispatch(actions.edit(event));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const handleCreate = React.useCallback(\r\n    (event: INewEvent | undefined) => {\r\n      dispatch(\r\n        actions.create(\r\n          event === undefined\r\n            ? undefined\r\n            : {\r\n                ...event,\r\n                sample_run_id: searchParams.SampleRunId,\r\n                un: searchParams.un ?? undefined,\r\n                bid: searchParams.bid,\r\n                srid: searchParams.srid,\r\n                srrid: searchParams.srrid,\r\n                duration: searchParams.duration,\r\n              },\r\n        ),\r\n      );\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      searchParams.SampleRunId,\r\n      searchParams.bid,\r\n      searchParams.duration,\r\n      searchParams.srid,\r\n      searchParams.srrid,\r\n      searchParams.un,\r\n    ],\r\n  );\r\n  const selectedEquipment = useSelector(selectLoadedServices);\r\n\r\n  if (viewState === undefined) {\r\n    return <></>;\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Helmet>\r\n        <meta name=\"description\" content=\"Calendar\" />\r\n      </Helmet>\r\n\r\n      <SchedulerConnectedWithFilters\r\n        screenId={ScreensId.Schedule}\r\n        services={schedulerServices}\r\n        events={events}\r\n        defaultDuration={searchParams.duration}\r\n        nonWorkingHours={nonWorkingHours}\r\n        date={viewState.date}\r\n        viewType={viewState.viewType}\r\n        viewLength={viewState.viewLength}\r\n        presetPosition={viewState.preset}\r\n        search={viewState.search}\r\n        onDataUpdated={() => void 0}\r\n        onViewModeChange={handleViewModeChange}\r\n        onEdit={handleEdit}\r\n        onCreate={handleCreate}\r\n        reservationEditEvents={selectedMultipleEvents}\r\n        savedListSettings={{\r\n          enableSavedLists: true,\r\n          savedListRelatedPickerName: 'EquipmentId',\r\n          savedListSerializedKey: 'eid',\r\n        }}\r\n      />\r\n      {selectedEquipment !== undefined && (\r\n        <Messages pageName=\"calendar\" selectedEquipment={selectedEquipment} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * BooleanPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AutocompletePickerProps } from '../BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\nimport { TFunction } from 'i18next';\r\nimport { BaseOptionsPicker } from '../BasicPickers/BaseOptionsPicker';\r\n\r\nexport interface BooleanPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<boolean>>, 'loadData'> {\r\n  trueName?: string;\r\n  falseName?: string;\r\n}\r\nexport const GetBooleanFilterOptions = (\r\n  t: TFunction,\r\n  trueName?: string,\r\n  falseName?: string,\r\n) => {\r\n  return [\r\n    {\r\n      Id: true,\r\n      Name: !!trueName ? trueName : t(translations.Yes),\r\n    },\r\n    { Id: false, Name: !!falseName ? falseName : t(translations.No) },\r\n  ];\r\n};\r\nexport function BooleanPicker(props: BooleanPickerProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const getOptions = () =>\r\n    GetBooleanFilterOptions(t, props.trueName, props.falseName);\r\n  return (\r\n    <>\r\n      <BaseOptionsPicker getOptions={getOptions} {...props} />\r\n    </>\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer } from 'utils/redux-injectors';\r\nimport { DialogAlertState } from './types';\r\n\r\nexport const initialState: DialogAlertState = {\r\n  open: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'dialogAlert',\r\n  initialState,\r\n  reducers: {\r\n    showAlert(state, action: PayloadAction<string>) {\r\n      state.open = true;\r\n      state.content = action.payload;\r\n    },\r\n    hideAlert(state, action: PayloadAction) {\r\n      state.open = false;\r\n      state.content = undefined;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: dialogAlertActions } = slice;\r\n\r\nexport const useDialogAlertSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useAlertSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","/**\r\n *\r\n * ErrorBoundary\r\n *\r\n */\r\nimport { getLogger } from 'loglevel';\r\nimport * as React from 'react';\r\n\r\nexport class ErrorBoundary extends React.Component<\r\n  { fallBack?: React.ReactElement; onError?: (error) => void },\r\n  { hasError: boolean }\r\n> {\r\n  private _log = getLogger('ErrorBoundary');\r\n  private fallBack?: React.FC;\r\n  private onError?: (error) => void;\r\n\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = { hasError: false };\r\n    this.fallBack = props.fallback;\r\n    this.onError = props.onError;\r\n  }\r\n\r\n  static getDerivedStateFromError(error) {\r\n    // Update state so the next render will show the fallback UI.\r\n    return { hasError: true };\r\n  }\r\n  componentDidCatch(error, errorInfo) {\r\n    // You can also log the error to an error reporting service\r\n    this.onError?.(errorInfo);\r\n    this._log.error(error, errorInfo);\r\n  }\r\n  render() {\r\n    if (this.state.hasError) {\r\n      // You can render any custom fallback UI\r\n      return this.props.fallBack || <h1>Something went wrong.</h1>;\r\n    }\r\n    return this.props.children;\r\n  }\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport cliTruncate from 'cli-truncate';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Body, H3 } from 'app/components/Typography';\r\nimport { OpenMenuButton } from '../../TopBar/components/openMenuButton';\r\nimport { useAbsolute } from 'utils/url-utils';\r\nimport styled from 'styled-components';\r\n\r\nexport interface TitlePageProps {\r\n  // title of the current screen\r\n  title: string;\r\n  // link to open the details page as its own url on a new browser tab\r\n  pageLink?: string;\r\n  toPageLink?: string;\r\n  useSidePanel?: boolean;\r\n  buttonsLenth: number;\r\n  expandPanel?: () => void;\r\n  tooltip?: string;\r\n  isCover?: boolean;\r\n  toExpandPanel?: () => void;\r\n  useShortView?: boolean;\r\n  hideMenu?: boolean;\r\n}\r\nconst TitleSection = styled('div')`\r\n  display: flex;\r\n  gap: 4px;\r\n  align-items: center;\r\n`;\r\nconst ShortTitle = styled('span')`\r\n  cursor: pointer;\r\n  overflow: hidden;\r\n  text-overflow: ellipsis;\r\n  display: -webkit-box;\r\n  -webkit-line-clamp: 2;\r\n  -webkit-box-orient: vertical;\r\n  word-break: break-all;\r\n`;\r\nexport function TitlePage(props: TitlePageProps) {\r\n  const { t } = useTranslation();\r\n  const {\r\n    title,\r\n    pageLink,\r\n    toPageLink,\r\n    useSidePanel,\r\n    buttonsLenth,\r\n    expandPanel,\r\n    tooltip,\r\n    isCover,\r\n    toExpandPanel,\r\n    useShortView,\r\n    hideMenu,\r\n  } = props;\r\n  const [showCopy, setShowCopy] = React.useState<boolean>(false);\r\n  const [copied, setCopied] = React.useState<boolean>(false);\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const showShortView = React.useMemo(() => {\r\n    return (\r\n      isMobile ||\r\n      (useSidePanel && !sidePanelExpanded) ||\r\n      isCover ||\r\n      useShortView\r\n    );\r\n  }, [isCover, isMobile, sidePanelExpanded, useShortView, useSidePanel]);\r\n  const truncatedTitle = React.useMemo(() => {\r\n    return showCopy\r\n      ? cliTruncate(\r\n          title,\r\n          buttonsLenth === 1\r\n            ? isCover\r\n              ? 22\r\n              : 24\r\n            : buttonsLenth === 2\r\n            ? isCover\r\n              ? 18\r\n              : 18\r\n            : isCover\r\n            ? 14\r\n            : 16,\r\n          { position: 'middle' },\r\n        )\r\n      : cliTruncate(\r\n          title,\r\n          buttonsLenth === 1\r\n            ? isCover\r\n              ? 28\r\n              : 30\r\n            : buttonsLenth === 2\r\n            ? isCover\r\n              ? 22\r\n              : 24\r\n            : isCover\r\n            ? 18\r\n            : 20,\r\n          { position: 'end' },\r\n        );\r\n  }, [buttonsLenth, isCover, showCopy, title]);\r\n  const absolutePageLink = useAbsolute(pageLink, toPageLink);\r\n  return pageLink || toPageLink ? (\r\n    <TitleSection\r\n      onMouseEnter={() => setShowCopy(true)}\r\n      onMouseLeave={() => setShowCopy(false)}\r\n    >\r\n      {isMobile && !useSidePanel && !hideMenu && (\r\n        <OpenMenuButton iconSize=\"small\" />\r\n      )}\r\n      {expandPanel && (\r\n        <IconButton\r\n          variant=\"ghost\"\r\n          aria-label=\"minimize\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          onClick={expandPanel}\r\n        >\r\n          <Icon\r\n            icon={['fas', 'arrow-left']}\r\n            color=\"default\"\r\n            colorExtend=\"textHover\"\r\n          />\r\n        </IconButton>\r\n      )}\r\n      {isMobile ? (\r\n        <Body bold={true}>\r\n          <Tooltip title={tooltip ?? title}>\r\n            {<ShortTitle>{title.replace(/-/g, '‑')}</ShortTitle>}\r\n          </Tooltip>\r\n        </Body>\r\n      ) : (\r\n        <ExternalLink\r\n          href={pageLink !== undefined ? pageLink : ''}\r\n          to={toPageLink}\r\n          onClick={expandPanel ? expandPanel : toExpandPanel}\r\n        >\r\n          {showShortView ? (\r\n            <Body bold={true}>\r\n              <Tooltip title={tooltip ?? title}>\r\n                {<ShortTitle>{title.replace(/-/g, '‑')}</ShortTitle>}\r\n              </Tooltip>\r\n            </Body>\r\n          ) : (\r\n            <H3>{title}</H3>\r\n          )}\r\n        </ExternalLink>\r\n      )}\r\n\r\n      {showCopy && absolutePageLink !== undefined && !isMobile && (\r\n        <IconButton\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          style={{\r\n            position: 'relative',\r\n            display: 'inline',\r\n            alignSelf: 'flex-start',\r\n          }}\r\n          onClick={() => {\r\n            navigator.clipboard.writeText(absolutePageLink);\r\n            setCopied(true);\r\n          }}\r\n        >\r\n          <Tooltip\r\n            title={\r\n              copied\r\n                ? (t(translations.URLCopied) as string)\r\n                : (t(translations.CopyURL) as string)\r\n            }\r\n            arrow\r\n          >\r\n            <span>\r\n              <Icon icon=\"chain\" />\r\n            </span>\r\n          </Tooltip>\r\n        </IconButton>\r\n      )}\r\n    </TitleSection>\r\n  ) : (\r\n    <React.Fragment>\r\n      {showShortView ? (\r\n        <Body bold={true}>\r\n          <Tooltip title={tooltip ?? title}>\r\n            {<span>{truncatedTitle}</span>}\r\n          </Tooltip>\r\n        </Body>\r\n      ) : (\r\n        <H3>{title}</H3>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import htmlParse from 'html-react-parser';\r\nimport { Mention } from '../RichTextEditor/RichEditor';\r\n\r\nexport const parse = (text: string) => {\r\n  const options = {\r\n    replace: (domNode: any) => {\r\n      if (domNode.attribs?.class === 'MENTION') {\r\n        const attribs = domNode.attribs;\r\n        return (\r\n          <Mention\r\n            element={{\r\n              user: {\r\n                Id: attribs.id,\r\n                Name: attribs.name.split('|').join(' '),\r\n              },\r\n            }}\r\n            children=\"\"\r\n            attributes={{}}\r\n          />\r\n        );\r\n      }\r\n    },\r\n  };\r\n  return htmlParse(text, options);\r\n};\r\n","import { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { groupBy, values } from 'lodash';\r\nimport {\r\n  IEquipmentOfflineServiceTypeDto,\r\n  IReservationEquipmentDto,\r\n} from './types';\r\n\r\n/**\r\n * Combines offline services from multiple instrument into a single list.\r\n * E.g. on multi instrument reservations, offline services section is shared across all instruments\r\n * @param equipments online services\r\n * @returns list of offline service types applicable to selected services\r\n */\r\nexport function combineOfflineServiceTypes(\r\n  equipments: IReservationEquipmentDto[] | undefined,\r\n): IEquipmentOfflineServiceTypeDto[] | undefined {\r\n  if (equipments === undefined) {\r\n    return undefined;\r\n  }\r\n  let haidProject = equipments.every(f => f.HideProjects === true);\r\n  return (\r\n    values(\r\n      groupBy(\r\n        equipments\r\n          //ignore equipments without offline services enabled\r\n          .filter(f => f.ReservationOfflineServicesEnabled)\r\n          .flatMap(f => f.OfflineServices),\r\n        f => f.Id,\r\n      ),\r\n    )\r\n      // offline service must be enabled on each instrument\r\n      .filter(group => group.length === equipments.length)\r\n      // offline service is mandatory if it's mandatory on one of the instruments\r\n      .map(f => {\r\n        return {\r\n          ...f[0],\r\n          Mandatory: f.some(g => g.Mandatory),\r\n        };\r\n      })\r\n      .filter(o => o.HideProject === haidProject)\r\n  );\r\n}\r\nexport function combineMandatoryOfflineServices(\r\n  services: IOtherServices[] | undefined,\r\n): IOtherServices[] | undefined {\r\n  if (services === undefined) {\r\n    return undefined;\r\n  }\r\n  return values(groupBy(services, f => f.ServiceTypeID)).map(f => {\r\n    return f[0];\r\n  });\r\n}\r\n","import { ServiceType } from 'enums/ServiceTypes';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { IReservationEquipmentDto } from './types';\r\n\r\n/**\r\n * This function determines if the budgets are enabled and should be visible for particular online services selection\r\n * @param globalSettings global settings\r\n * @param equipments related online services\r\n * @returns\r\n */\r\n\r\nexport function getBudgetVisible(\r\n  globalSettings: GlobalSettingsType,\r\n  equipments: Array<\r\n    Pick<\r\n      IReservationEquipmentDto,\r\n      'HideProjects' | 'BudgetsTurnedOn' | 'Billable'\r\n    > & { ServiceTypeId: number }\r\n  >,\r\n): boolean {\r\n  return (\r\n    globalSettings.budgetModuleEnabled &&\r\n    !equipments.every(f => f.HideProjects) &&\r\n    equipments.every(f => f.BudgetsTurnedOn === true) &&\r\n    // Billable is only shown on the instrument details when the PriceSheetPricing is on. Otherwise the instruments will with Billable = false, which should be ignored since they are in fact billable\r\n    (globalSettings.priceSheetPricing === true ||\r\n      equipments.every(f => f.ServiceTypeId !== ServiceType.Online) ||\r\n      equipments.some(f => f.Billable === true))\r\n  );\r\n}\r\n","/**\r\n *\r\n * TrainingSessionPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport i18next from 'i18next';\r\n\r\nexport type UserUrl = 'restricted' | 'full' | 'admin';\r\nexport interface TrainingSessionPickerProps\r\n  extends Omit<AutocompletePickerProps<ITrainingSessionDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  selectArray?: Array<keyof ITrainingSessionDto>;\r\n}\r\n\r\nconst url = '/api/odata/v4/TrainingSessions';\r\nexport const generateTrainingSessionName = (\r\n  dto: ITrainingSessionDto,\r\n): ITrainingSessionDto => {\r\n  let name = `${dateUtils.format(\r\n    dto.StartDate,\r\n    dateUtils.DateIOFormats.fullDateTime,\r\n  )} ${dto.Duration}(h) ${dto.Trainer} ${\r\n    dto.RemainedSlots === null\r\n      ? i18next.t(translations.MaxAttendees_NA)\r\n      : dto.RemainedSlots\r\n  }`;\r\n  return Object.assign({}, dto, { Name: name });\r\n};\r\nexport const initSessionsData = (id: string) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'StartDate asc',\r\n    $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(\r\n      response =>\r\n        (response.value as ITrainingSessionDto[]).map(f =>\r\n          generateTrainingSessionName(f),\r\n        ) as Entity<number>[],\r\n    );\r\n};\r\n\r\nexport function TrainingSessionPicker(props: TrainingSessionPickerProps) {\r\n  const { t } = useTranslation();\r\n  const loadData = getAutoCompleteLoadDataFn<ITrainingSessionDto>({\r\n    url: url,\r\n    predicates: props.predicates,\r\n    select: props.selectArray ?? [\r\n      'Id',\r\n      'Name',\r\n      'StartDate',\r\n      'EndDate',\r\n      'RemainedSlots',\r\n      'TrainingState',\r\n      'Trainer',\r\n      'Duration',\r\n    ],\r\n    transformModel: generateTrainingSessionName,\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'sessionId'}\r\n      placeholder={\r\n        props.placeholder ?? t(translations.PleaseSelectATRainingSession)\r\n      }\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function ReservRelatedFilter(\r\n  EquipmentId?: number,\r\n): (string | Condition<ITrainingSessionDto>)[] {\r\n  const predicates: (string | Condition<ITrainingSessionDto>)[] = [];\r\n  if (EquipmentId !== undefined) {\r\n    predicates.push(\r\n      new Condition<ITrainingSessionDto>(\r\n        'ServiceId',\r\n        ODataOperators.Equals,\r\n        EquipmentId,\r\n      ),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n","/**\r\n *\r\n * RemindBeforPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { RemindBefore } from 'enums/RemindBefore';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface RemindBeforePickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\nexport const getSingleReminder = (val: number): Entity<number> => {\r\n  return enumToEntityArray(RemindBefore).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\nexport const initRemindBeforeData = (\r\n  initval: number | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([getSingleReminder(initval)]);\r\n    });\r\n  }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(RemindBefore);\r\n\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\nexport function RemindBeforePicker(props: RemindBeforePickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      id={props.id || 'RemindBeforeId'}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * WorkflowBookingPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWorkflowBookingDto } from 'api/odata/generated/entities/IWorkflowBookingDto';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface WorkflowBookingPickerProps\r\n  extends Omit<AutocompletePickerProps<IWorkflowBookingDto>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/WorkflowBooking';\r\nexport const initWorkflowBookingData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,UserName',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport function WorkflowBookingPicker(props: WorkflowBookingPickerProps) {\r\n  const loadData = getAutoCompleteLoadDataFn<IWorkflowBookingDto>({\r\n    url,\r\n    predicates: props.predicates,\r\n    select: ['Id', 'Name', 'UserName'],\r\n  });\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      id={props.id || 'usergroupId'}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","export enum UserGroupsProviderTypes {\r\n  /// <summary>\r\n  /// user groups are sourced internally\r\n  /// </summary>\r\n  SQL,\r\n  /// <summary>\r\n  /// user groups are taken externally from AD\r\n  /// </summary>\r\n  AD,\r\n  /// <summary>\r\n  /// Same as AD, except:\r\n  /// User will keep his (SQL) group after his (AD) group was removed\r\n  /// </summary>\r\n  Combo,\r\n}\r\n\r\nexport enum AutoMode {\r\n  /// <summary>\r\n  /// Usage enabled on equipment\r\n  /// </summary>\r\n  LocalAppEnabled = 1,\r\n  /// <summary>\r\n  /// Usage disabled on equipment\r\n  /// </summary>\r\n  LocalAppDisabled = 2,\r\n}\r\n","import { makeStyles, Theme } from '@material-ui/core/styles';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) => ({\r\n  tableRoot: {\r\n    // paddingInline: theme.spacing(2),\r\n  },\r\n  filterPanel: {\r\n    padding: theme.spacing(1),\r\n  },\r\n  tableScrolling: {\r\n    width: '100%',\r\n    height: '100%',\r\n    overflow: 'auto',\r\n    '&::-webkit-scrollbar': {\r\n      width: '6px',\r\n      height: '6px',\r\n    },\r\n    '&::-webkit-scrollbar-thumb': {\r\n      boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n      borderRadius: '6px',\r\n      backgroundColor: theme.palette.common.grayBorders,\r\n    },\r\n  },\r\n  tableContent: {\r\n    padding: theme.spacing(0, 2, 0, 4),\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    /* will cause table footer to be at the bottom of the screen */\r\n    //height: '100%',\r\n    justifyContent: 'space-between',\r\n    overflowY: 'hidden',\r\n    '&.tablePaddingDense': {\r\n      padding: '0',\r\n    },\r\n  },\r\n  tableContentShort: {\r\n    padding: theme.spacing(0, 1, 0, 2),\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    height: '100%',\r\n    justifyContent: 'space-between',\r\n    overflowY: 'hidden',\r\n    width: '100%',\r\n    '&.tablePaddingDense': {\r\n      padding: '0',\r\n    },\r\n  },\r\n  table: {\r\n    backgroundColor: theme.palette.background.paper,\r\n    whiteSpace: 'pre',\r\n    '&.withFooter': {\r\n      borderRadius: '8px 8px 0px 0px',\r\n    },\r\n  },\r\n  tableButtonsRoot: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    justifyContent: 'space-between',\r\n    alignItems: 'center',\r\n    padding: '8px 32px 16px',\r\n    gap: theme.spacing(1.5),\r\n    flexWrap: 'wrap',\r\n    '&.tablePaddingDense': {\r\n      padding: '8px 0px 16px',\r\n    },\r\n  },\r\n  tableButtonsRootShort: {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    justifyContent: 'space-between',\r\n    alignItems: 'normal',\r\n    padding: '8px 16px 16px',\r\n    gap: theme.spacing(1.5),\r\n    '&.tablePaddingDense': {\r\n      padding: '8px 0px 16px',\r\n    },\r\n  },\r\n  filterDisplayRoot: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    justifyContent: 'flex-start',\r\n    padding: '0px 32px 16px',\r\n    gap: theme.spacing(2),\r\n    flexWrap: 'wrap',\r\n  },\r\n  filterDisplayRootShort: {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'normal',\r\n    justifyContent: 'flex-start',\r\n    padding: '0px 32px 16px',\r\n    gap: theme.spacing(2),\r\n    flexWrap: 'wrap',\r\n  },\r\n  tableButtonsLeft: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: theme.spacing(1.5),\r\n    flexWrap: 'wrap',\r\n  },\r\n  tableButtonsLeftShort: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: theme.spacing(1.5),\r\n    flexWrap: 'wrap',\r\n    justifyContent: 'space-between',\r\n    maxWidth: '90%',\r\n  },\r\n  tableButtonWrap: {\r\n    flexWrap: 'wrap',\r\n  },\r\n  tableButtonNoWrap: {\r\n    flexWrap: 'nowrap',\r\n  },\r\n  tableButtonsRight: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: theme.spacing(1),\r\n    marginLeft: 'auto',\r\n  },\r\n  tableButtonsRightShort: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'center',\r\n    padding: 0,\r\n    gap: theme.spacing(1),\r\n    justifyContent: 'space-between',\r\n  },\r\n  menuPaper: {\r\n    width: '160px',\r\n  },\r\n  subHeader: {\r\n    // same padding as in all child elements of the table container\r\n    padding: '0px 32px 16px',\r\n  },\r\n  isAggregated: {\r\n    fontWeight: 'bold',\r\n  },\r\n  tableFooter: {\r\n    width: '100%',\r\n    backgroundColor: bookitColors.base.white,\r\n    minHeight: '42px',\r\n    overflowX: 'auto',\r\n    '&::-webkit-scrollbar': {\r\n      height: '6px',\r\n    },\r\n    '&::-webkit-scrollbar-thumb': {\r\n      boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n      borderRadius: '6px',\r\n      backgroundColor: theme.palette.common.grayBorders,\r\n    },\r\n    // '&.tableFooterShortView': {\r\n    //   minHeight: '56px',\r\n    // },\r\n  },\r\n  tableFooterWithBorder: {\r\n    border: '1px solid ' + theme.palette.divider,\r\n    borderTop: `1px solid ${theme.palette.common.grayBorders}`,\r\n    borderRadius: '5px',\r\n    borderTopLeftRadius: '0px',\r\n    borderTopRightRadius: '0px',\r\n  },\r\n}));\r\n","import * as React from 'react';\r\nimport { IFilterSettings } from './BasicFilter/IFilterSettings';\r\nimport { filterKey } from './BasicFilter/utils';\r\nimport { EntityType } from 'types/common';\r\n\r\n/**\r\n * Memoes the array of filter to be used in the fetch data functions. Tracks the current state of the filters by the filter key (fieldName,fieldName1/etc) + filter value without the display name in case of Entity<T> value\r\n * @param props\r\n * @returns\r\n */\r\nexport const useMemoFilters = <TRow>(props: {\r\n  appliedFilters?: IFilterSettings<TRow>[];\r\n}) => {\r\n  const nonEmpty = props.appliedFilters?.filter(\r\n    f => f.value !== null && f.value !== undefined,\r\n  );\r\n  const singleValueToId = value => {\r\n    return (value as EntityType)?.Id !== undefined\r\n      ? (value as EntityType)?.Id\r\n      : value;\r\n  };\r\n\r\n  const singleValue = value => {\r\n    return Array.isArray(value)\r\n      ? value.map(singleValueToId)\r\n      : singleValueToId(value);\r\n  };\r\n  const mapped = nonEmpty?.map(f => ({\r\n    key: filterKey(f),\r\n    value: singleValue(f.value),\r\n    operator: f.operator,\r\n    isInversed: f.isInversed,\r\n    initCompleted: f.initCompleted ?? false,\r\n  }));\r\n\r\n  const customFilter = React.useMemo(() => {\r\n    const result = nonEmpty;\r\n    return result;\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [JSON.stringify(mapped)]);\r\n  return customFilter;\r\n};\r\n","/**\r\n *\r\n * ValueLabel\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface ValueLabelProps {\r\n  value: string | number | undefined | null;\r\n}\r\n\r\nexport function ValueLabel({ value }: ValueLabelProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const isEmpty =\r\n    value === undefined ||\r\n    value === null ||\r\n    (typeof value === 'string' && value.trim() === '');\r\n  const displayValue = isEmpty ? t(translations.NA) : value;\r\n  return <>{displayValue}</>;\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { TabPanelWrapper } from '../TabsWrapper';\r\nimport clsx from 'clsx';\r\n\r\nexport interface TabPanelProps {\r\n  children?: React.ReactNode;\r\n  index: any;\r\n  value: any;\r\n  styles?: React.CSSProperties;\r\n  tabsId: string;\r\n  tabsPanelId: string;\r\n  scrollableContent?: boolean;\r\n}\r\n\r\nexport function TabPanel(props: TabPanelProps) {\r\n  const {\r\n    tabsPanelId,\r\n    tabsId,\r\n    children,\r\n    value,\r\n    index,\r\n    styles,\r\n    scrollableContent,\r\n    ...other\r\n  } = props;\r\n  const theme = useTheme();\r\n  return (\r\n    <TabPanelWrapper\r\n      theme={theme}\r\n      style={styles}\r\n      className={clsx('tabPanel', {\r\n        scrollablePanel: scrollableContent === true,\r\n      })}\r\n      role=\"tabpanel\"\r\n      hidden={value !== index}\r\n      id={`${tabsPanelId}-${index}`}\r\n      aria-labelledby={`${tabsId}-${index}`}\r\n      {...other}\r\n    >\r\n      {value === index && <React.Fragment>{children}</React.Fragment>}\r\n    </TabPanelWrapper>\r\n  );\r\n}\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport * as React from 'react';\r\nimport { EntityType } from 'types/common';\r\nimport { AutocompletePicker } from '../BasicPickers/AutocompletePicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormAutocompleteProps<T extends EntityType> {\r\n  loadData: (searchTerm: string | null) => Promise<T[]>;\r\n  initValue?: T | null;\r\n  size?: 'medium' | 'small';\r\n  mini?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n}\r\nexport function FormAutocomplete<T extends EntityType>({\r\n  label,\r\n  loadData,\r\n  id,\r\n  initValue,\r\n  variant,\r\n  ...props\r\n}: FieldHookConfig<T | null> & FormAutocompleteProps<T> & IFieldProps) {\r\n  const [field, meta, helpers] = useField<T | null>(props);\r\n  const handleChange = (e: T | null) => {\r\n    helpers.setValue(e, true);\r\n    if (props.onChange !== undefined) {\r\n      props.onChange(e);\r\n    }\r\n    //field.onChange(e);\r\n  };\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      defaultValue={initValue}\r\n      disabled={props.disabled}\r\n      fullWidth={props.fullWidth}\r\n      label={label}\r\n      placeholder={props.placeholder}\r\n      name={props.name}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant={variant}\r\n      helperText={meta.error || props.helperText}\r\n      info={props.info}\r\n      id={id}\r\n      size={props.size}\r\n      required={props.required}\r\n    />\r\n  );\r\n}\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { AutocompleteMultiPicker } from '../BasicPickers/AutocompleteMultiPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport interface FormAutocompleteMultiProps<T> {\r\n  loadData: (searchTerm: string | null) => Promise<Entity<T>[]>;\r\n  initValue?: Entity<T>[];\r\n  size?: 'medium' | 'small';\r\n  mini?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n}\r\n\r\nexport function FormAutocompleteMulti<T>({\r\n  label,\r\n  loadData,\r\n  id,\r\n  initValue,\r\n  variant,\r\n  ...props\r\n}: FormAutocompleteMultiProps<T> &\r\n  FieldHookConfig<Entity<T>[] | null> &\r\n  IFieldProps) {\r\n  const [field, meta, helpers] = useField<Entity<T>[] | null>(props);\r\n  const handleChange = (e: Entity<T>[] | null) => {\r\n    helpers.setValue(e, true);\r\n    if (props.onChange !== undefined) {\r\n      props.onChange(e);\r\n    }\r\n    //field.onChange(e);\r\n  };\r\n  return (\r\n    <AutocompleteMultiPicker\r\n      loadData={loadData}\r\n      defaultValue={initValue}\r\n      disabled={props.disabled}\r\n      fullWidth={props.fullWidth}\r\n      label={label}\r\n      placeholder={props.placeholder}\r\n      required={props.required}\r\n      name={props.name}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error || props.helperText}\r\n      variant={variant}\r\n      id={id}\r\n      info={props.info}\r\n      size={props.size}\r\n    ></AutocompleteMultiPicker>\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { FormAutocompleteMulti } from 'app/components/Forms/FormAutocompleteMulti';\r\nimport { FormAutocomplete } from 'app/components/Forms/FormAutocomplete';\r\n\r\nconst url = '/api/odata/v4/UserFilter/GetUserSelections';\r\nexport const initUserData = (\r\n  id: string,\r\n  formField: IFormFieldDto | undefined,\r\n) => {\r\n  let filter: string | undefined = '';\r\n  const initids = id.split(',').map(item => {\r\n    return { Id: item };\r\n  }) as Identifiable<string>[];\r\n  if (formField) {\r\n    if (\r\n      formField.UserSelectionType === 'FixedRoles' &&\r\n      formField.FixedRoles !== null &&\r\n      formField.FixedRoles !== ''\r\n    ) {\r\n      let ids = formField.FixedRoles.split(',').map(item => {\r\n        return { Id: item };\r\n      }) as Identifiable<string>[];\r\n      filter = new Condition(\r\n        'UserRoles',\r\n        ODataOperators.AnyIn,\r\n        ids,\r\n        'Name',\r\n      ).toString();\r\n    }\r\n    if (\r\n      formField.UserSelectionType === 'CustomRoles' &&\r\n      formField.CustomRoles !== null &&\r\n      formField.CustomRoles !== ''\r\n    ) {\r\n      let ids = formField.CustomRoles.split(',')\r\n        .map(item => {\r\n          let id = item.split('#');\r\n          return { Id: parseInt(id[0]) };\r\n        })\r\n        .filter(item => !isNaN(item.Id)) as Identifiable<number>[];\r\n      filter = new Condition(\r\n        'CustomRoles',\r\n        ODataOperators.AnyIn,\r\n        ids,\r\n        'Id',\r\n      ).toString();\r\n    }\r\n  }\r\n  if (filter !== '') {\r\n    filter += ` and ${new Condition(\r\n      'Id',\r\n      ODataOperators.Includes,\r\n      initids,\r\n    ).toString()}`;\r\n  } else {\r\n    filter = new Condition('Id', ODataOperators.Includes, initids).toString();\r\n  }\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: filter,\r\n    $select: 'Id,Name,UserRoles,CustomRoles',\r\n    $skip: 0,\r\n    $top: initids.length,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\nexport const getGetUserSelectionsAutocompleteFn = (\r\n  formField: Pick<\r\n    IFormFieldDto,\r\n    'UserSelectionType' | 'FixedRoles' | 'CustomRoles'\r\n  >,\r\n) => (searchTerm: string | null) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $top: number;\r\n    $filter?: string;\r\n    $select?: string;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $select: 'Id,Name,UserRoles,CustomRoles',\r\n    $top: 100,\r\n  };\r\n  const predicates: Condition<IUserFilterDto>[] = [];\r\n  if (\r\n    formField.UserSelectionType === 'FixedRoles' &&\r\n    formField.FixedRoles !== null &&\r\n    formField.FixedRoles !== ''\r\n  ) {\r\n    let ids = formField.FixedRoles.split(',').map(item => {\r\n      return { Id: item };\r\n    }) as Identifiable<string>[];\r\n    predicates.push(\r\n      new Condition('UserRoles', ODataOperators.AnyIn, ids, 'Name'),\r\n    );\r\n  }\r\n  if (\r\n    formField.UserSelectionType === 'CustomRoles' &&\r\n    formField.CustomRoles !== null &&\r\n    formField.CustomRoles !== ''\r\n  ) {\r\n    let ids = formField.CustomRoles.split(',')\r\n      .map(item => {\r\n        let id = item.split('#');\r\n        return { Id: parseInt(id[0]) };\r\n      })\r\n      .filter(item => !isNaN(item.Id)) as Identifiable<number>[];\r\n    predicates.push(\r\n      new Condition('CustomRoles', ODataOperators.AnyIn, ids, 'Id'),\r\n    );\r\n  }\r\n  if (searchTerm !== null || predicates.length > 0) {\r\n    params.$filter = new ODataFilterBuilder<IUserFilterDto>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm ?? undefined,\r\n    }).toString();\r\n  }\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\nexport function CustomFormUserSelection({\r\n  formField,\r\n  readonly,\r\n  parentValue,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  const loadData = getGetUserSelectionsAutocompleteFn(formField);\r\n  return (\r\n    <React.Fragment>\r\n      {formField.IsMultiple ? (\r\n        <FormAutocompleteMulti\r\n          key={formField.Id}\r\n          disabled={readonly || disabled}\r\n          loadData={loadData}\r\n          label={formField.Label}\r\n          info={formField.Description ?? undefined}\r\n          variant=\"filled\"\r\n          fullWidth\r\n          {...props}\r\n        />\r\n      ) : (\r\n        <FormAutocomplete\r\n          key={formField.Id}\r\n          disabled={readonly || disabled}\r\n          info={formField.Description ?? undefined}\r\n          loadData={loadData}\r\n          label={formField.Label}\r\n          variant=\"filled\"\r\n          fullWidth\r\n          {...props}\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.repetitive || initialState;\r\n\r\nexport const selectRepetitive = createSelector([selectSlice], state => state);\r\n\r\nexport const selectRepetitiveProcessing = createSelector(\r\n  [selectRepetitive],\r\n  state => state.processing,\r\n);\r\n\r\nexport const selectRepetitiveError = createSelector(\r\n  [selectRepetitive],\r\n  state => state.error,\r\n);\r\n\r\nexport const selectRepetitiveData = createSelector(\r\n  [selectRepetitive],\r\n  state => state.data,\r\n);\r\nexport const selectRepetitiveFieldHandler = createSelector(\r\n  [selectRepetitive],\r\n  state => state.repetitiveValueHandler,\r\n);\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nconst url = '/api/odata/v4/OfflineServiceFilter';\r\nconst filter = 'ServiceTypeId eq 3 and Active eq true';\r\nexport interface SampleTypePickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url'> {}\r\n\r\nexport const initSampleTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: new ODataFilterBuilder<Entity<number>>({\r\n        predicates: [filter, new Condition('Id', ODataOperators.Equals, id)],\r\n        stringColumns: [],\r\n      }).toString(),\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport const SampleTypePicker = (props: SampleTypePickerProps) => {\r\n  const { queryfilter, ...other } = props;\r\n  const predicate =\r\n    queryfilter && queryfilter !== ''\r\n      ? [queryfilter, filter].join(' and ')\r\n      : filter;\r\n  return (\r\n    <BaseURLPicker\r\n      url={url}\r\n      queryfilter={predicate}\r\n      {...other}\r\n      id={props.id || 'sampletypeId'}\r\n    />\r\n  );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport {\r\n  OfflineServiceTypePicker,\r\n  OfflineServiceTypePickerProps,\r\n} from '../pickers/AutocompletePickers/OfflineServiceTypePicker';\r\n\r\nexport const FormOfflineServiceTypePicker = (\r\n  props: FieldHookConfig<IOfflineServiceFilterDto | null> &\r\n    Omit<OfflineServiceTypePickerProps, 'onChange'>,\r\n) => {\r\n  const [field, meta, helpers] = useField<IOfflineServiceFilterDto | null>(\r\n    props,\r\n  );\r\n  const handleChange = val => {\r\n    props.onChange?.(val);\r\n    helpers.setValue(val, true);\r\n  };\r\n  return (\r\n    <OfflineServiceTypePicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      disabled={props.disabled}\r\n      label={props.label}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      variant=\"filled\"\r\n      urlType={props.urlType}\r\n    />\r\n  );\r\n};\r\n","import useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport React from 'react';\r\nimport { RegionDetailsProps } from './RegionsDetailsPage/Details';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport { IRegionDto } from './IRegionDto';\r\n\r\nexport interface RegionLinkProps {\r\n  id: number;\r\n  children: React.ReactNode;\r\n  title?: string;\r\n  useSidePanel?: boolean;\r\n  initialModel?: IRegionDto;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}\r\n\r\nexport const RegionLink = (props: RegionLinkProps) => {\r\n  const { t } = useTranslation();\r\n  const openRegion = useOpenRegionPopUp();\r\n\r\n  const open = () => {\r\n    openRegion(\r\n      {\r\n        id: props.id,\r\n        useSidePanel: props.useSidePanel,\r\n        initialModel: props.initialModel,\r\n      },\r\n      props.openPanelWithCover,\r\n    );\r\n  };\r\n  return (\r\n    <Tooltip title={props.title ?? t(translations.RegionDetails)}>\r\n      <MuiLink onClick={() => open()} color=\"textPrimary\">\r\n        {props.children}\r\n      </MuiLink>\r\n    </Tooltip>\r\n  );\r\n};\r\n\r\nexport const useOpenRegionPopUp = () => {\r\n  const { openPanel } = useSidePanelState();\r\n\r\n  return React.useCallback(\r\n    (\r\n      props: { id: number; useSidePanel?: boolean; initialModel?: IRegionDto },\r\n      openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n    ) => {\r\n      const identifier = props.id;\r\n      if (identifier !== undefined) {\r\n        const popupProps: RegionDetailsProps = {\r\n          id: '' + props.id,\r\n          initialModel: props.initialModel,\r\n          useSidePanel: props.useSidePanel ?? false,\r\n        };\r\n        if (!!openPanelWithCover) {\r\n          openPanelWithCover({\r\n            renderPageType: RenderPageType.RegionDetails,\r\n            renderPageProps: popupProps,\r\n            expanded: false,\r\n            useSidePanel: props.useSidePanel,\r\n            isCover: props.useSidePanel,\r\n          });\r\n        } else {\r\n          openPanel({\r\n            renderPageType: RenderPageType.RegionDetails,\r\n            renderPageProps: popupProps,\r\n            expanded: false,\r\n            useSidePanel: false,\r\n            isCover: false,\r\n          } as SidePanelOpenState);\r\n        }\r\n      }\r\n    },\r\n    [openPanel],\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField, useFormikContext } from 'formik';\r\nimport { RadioGroup, RadioGroupProps } from '../RadioGroup';\r\nimport FormControl from '@material-ui/core/FormControl';\r\nimport { FormHelperText, FormLabel, styled } from '@material-ui/core';\r\nimport { useIsRequired } from './ValidationSchemaProvider';\r\nimport { buttonM, buttonS } from 'styles/typography/bookitTypography';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\n\r\nexport type FormRadioGroupProps = FieldHookConfig<string> & RadioGroupProps;\r\nexport const FormRadioGroup = ({\r\n  id,\r\n  label,\r\n  onChange,\r\n  value,\r\n  name,\r\n  error,\r\n  title,\r\n  helperText,\r\n  info,\r\n  required,\r\n  ...props\r\n}: FieldHookConfig<string> & RadioGroupProps) => {\r\n  const [field, meta] = useField<string>({ name, ...props });\r\n  const handleChange = (value, event) => {\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n    field.onChange(event);\r\n  };\r\n  const { submitCount } = useFormikContext();\r\n  const isRequired = useIsRequired(name);\r\n  const hasError = meta?.error !== undefined;\r\n  const showError = hasError && (meta.touched || submitCount > 0);\r\n  return (\r\n    <StyledFormControl required={isRequired || required} error={showError}>\r\n      <StyledFormLabel\r\n        style={title ? { marginBottom: '8px' } : { marginBottom: '24px' }}\r\n        required={isRequired || required}\r\n      >\r\n        {label} {info && <InfoIcon title={info} />}\r\n      </StyledFormLabel>\r\n      {title && <StyledFormTitle>{title}</StyledFormTitle>}\r\n      <RadioGroup\r\n        id={id}\r\n        name={name}\r\n        label={label}\r\n        onChange={handleChange}\r\n        value={field.value ?? ''}\r\n        disabled={props.disabled}\r\n        {...props}\r\n      />\r\n      <StyledFormHelperText required={isRequired || required} error={showError}>\r\n        <span>{showError ? meta.error : helperText}</span>\r\n      </StyledFormHelperText>\r\n    </StyledFormControl>\r\n  );\r\n};\r\n\r\n// spacing is needed in the quizzes\r\nconst StyledFormControl = styled(FormControl)(props => ({\r\n  marginBottom: props.theme.spacing(0),\r\n}));\r\n\r\n// the label needs to be stronger in quizzes\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n  color: theme.palette.common.blackRegular,\r\n  ...buttonM,\r\n  '&[class*=\"Mui-focused\"]': {\r\n    color: theme.palette.common.blackRegular,\r\n  },\r\n}));\r\n// the label needs to be stronger in quizzes\r\nconst StyledFormTitle = styled('label')(({ theme }) => ({\r\n  color: theme.palette.common.blackRegular,\r\n  ...buttonS,\r\n  fontStyle: 'italic',\r\n  marginBottom: theme.spacing(3),\r\n}));\r\nconst StyledFormHelperText = styled(FormHelperText)(props => ({\r\n  // empty helperText results in zero element height. So when field is validated the appearance of the\r\n  // error message in the helperText causes the form element to increase in height and forces a redraw\r\n  // empty char \\00a0 causes the FormHelperText to always occupy one line height and prevents reflows\r\n  '&::before': {\r\n    content: '\"\\\\00a0\"',\r\n  },\r\n}));\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nimport { FormRadioGroup } from 'app/components/Forms/FromRadioGroup';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Entity } from 'types/common';\r\n\r\nexport function CustomFormAnswerQuestions({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  const { t } = useTranslation();\r\n  const options = getOptions(formField);\r\n  const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n  return (\r\n    <FormRadioGroup\r\n      options={options}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      info={formField.Description ?? undefined}\r\n      title={title}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nconst indexToAlpha = (index: number): string => {\r\n  return (index + 10).toString(36);\r\n};\r\n\r\nconst getOptions = (formField: IFormFieldDto): Entity<string>[] => {\r\n  switch (formField.OptionsSourceType) {\r\n    case 'SimpleList':\r\n      return (\r\n        formField.Options?.split(';').map((s, index) => ({\r\n          Id: s,\r\n          Name: `${indexToAlpha(index)}. ${s}`,\r\n        })) ?? []\r\n      );\r\n    default:\r\n      console.error(\r\n        `OptionsSourceType ${formField.OptionsSourceType} is not implemented`,\r\n      );\r\n      return [];\r\n  }\r\n};\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\n\r\nexport function CustomFormCheckBox({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  //const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n  return (\r\n    <FormCheckbox\r\n      key={formField.Id}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      info={formField.Description ?? undefined}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport function CustomFormDate({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  //const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n  return (\r\n    <FormBookitDatePicker\r\n      {...props}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      fullWidth\r\n      info={formField.Description ?? undefined}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\n\r\nexport function CustomFormDisclimer({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  required,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  //const title = `${formField.QuizScore} ${t(translations.Points) as string}`;\r\n  return (\r\n    <FormCheckbox\r\n      key={formField.Id}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      info={formField.Description ?? undefined}\r\n      required={true}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormEmail({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormTextField\r\n      {...props}\r\n      disabled={disabled || readonly}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      info={formField.Description ?? undefined}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormNumberText({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormTextField\r\n      {...props}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      info={formField.Description ?? undefined}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormParagraph } from 'app/components/Forms/FormParagraph';\r\nimport parse from 'html-react-parser';\r\nexport function CustomFormParagraph({\r\n  formField,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormParagraph\r\n      {...props}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      fullWidth\r\n      html={\r\n        formField.Description !== null ? parse(formField.Description) : <></>\r\n      }\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormPositiveNumberText({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormTextField\r\n      {...props}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      info={formField.Description ?? undefined}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormRadioGroup\r\n *\r\n */\r\nimport React from 'react';\r\n\r\nimport { FormRadioGroup } from 'app/components/Forms/FromRadioGroup';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Entity } from 'types/common';\r\n\r\nexport function CustomFormRadioGroup({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  const options = getOptions(formField);\r\n\r\n  //const title = formField.Description ?? undefined;\r\n  return (\r\n    <FormRadioGroup\r\n      {...props}\r\n      key={formField.Id}\r\n      options={options}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      info={formField.Description ?? undefined}\r\n      // title={title}\r\n    />\r\n  );\r\n}\r\n\r\nconst getOptions = (formField: IFormFieldDto): Entity<string>[] => {\r\n  if (formField) {\r\n    return createOptions(formField);\r\n  } else {\r\n    return [] as Entity<string>[];\r\n  }\r\n};\r\nconst createOptions = (field: IFormFieldDto): Entity<string>[] => {\r\n  if (field.Options && field.Options !== null) {\r\n    switch (field.OptionsSourceType) {\r\n      case 'Internal':\r\n        return deserializeOptions(field.Options);\r\n\r\n      case 'SimpleList':\r\n        return deserializeOptions(field.Options.split(','));\r\n      case 'External':\r\n        return [] as Entity<string>[];\r\n    }\r\n  } else {\r\n    return [] as Entity<string>[];\r\n  }\r\n};\r\nconst deserializeOptions = (options: any): Entity<string>[] => {\r\n  let optsArray = [] as Entity<string>[];\r\n  if (Array.isArray(options)) {\r\n    optsArray = options.map(opt => {\r\n      return { Id: opt, Name: opt } as Entity<string>;\r\n    });\r\n  } else {\r\n    try {\r\n      let items = JSON.parse(options);\r\n      if (Array.isArray(items)) {\r\n        let arr = items.map(o => {\r\n          if (typeof o == 'string') {\r\n            return { Id: o, Name: o, Parent: null } as Entity<string>;\r\n          } else if (o.hasOwnProperty('id') && o.hasOwnProperty('text')) {\r\n            return {\r\n              Id: o.id,\r\n              Name: o.text,\r\n            } as Entity<string>;\r\n          } else {\r\n            return undefined;\r\n          }\r\n        });\r\n        optsArray =\r\n          (arr.filter(o => o !== undefined) as Entity<string>[]) ||\r\n          ([] as Entity<string>[]);\r\n      }\r\n      return optsArray;\r\n    } catch {\r\n      return optsArray;\r\n    }\r\n  }\r\n\r\n  return optsArray;\r\n};\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\n\r\nexport function CustomFormRichText({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormRichTextField\r\n      {...props}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      info={formField.Description ?? undefined}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomFormField\r\n *\r\n */\r\nimport React from 'react';\r\nimport { CustomFormFieldProps } from 'app/components/CustomForm/CustomFormFields';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\n\r\nexport function CustomFormShortText({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormTextField\r\n      {...props}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      info={formField.Description ?? undefined}\r\n      key={formField.Id}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { FieldTypesUnion } from 'api/odata/generated/enums/FieldTypes';\r\nimport { Entity } from 'types/common';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { CustomFormAnswerQuestions } from './CustomFormFields/CustomFormAnswerQuestions';\r\nimport { CustomFormCheckBox } from './CustomFormFields/CustomFormCheckBox';\r\nimport { CustomFormDate } from './CustomFormFields/CustomFormDate';\r\nimport { CustomFormDisclimer as CustomFormDisclaimer } from './CustomFormFields/CustomFormDisclimer';\r\nimport { CustomFormDropDown } from './CustomFormFields/CustomFormDropDown';\r\nimport { CustomFormEmail } from './CustomFormFields/CustomFormEmail';\r\nimport { CustomFormFileUpload } from './CustomFormFields/CustomFormFileUpload';\r\nimport { CustomFormNumberText } from './CustomFormFields/CustomFormNumberText';\r\nimport { CustomFormParagraph } from './CustomFormFields/CustomFormParagraph';\r\nimport { CustomFormPositiveNumberText } from './CustomFormFields/CustomFormPositiveNumber';\r\nimport { CustomFormRadioGroup } from './CustomFormFields/CustomFormRadioGroup';\r\nimport { CustomFormRichText } from './CustomFormFields/CustomFormRichText';\r\nimport { CustomFormShortText } from './CustomFormFields/CustomFormShortText';\r\nimport { CustomFormUserSelection } from './CustomFormFields/CustomFormUserSelection';\r\n\r\nexport interface CustomFormFieldProps {\r\n  name: string;\r\n  id: string;\r\n  formField: IFormFieldDto;\r\n  readonly?: boolean;\r\n  parentValue?: Entity<string>[];\r\n  disabled?: boolean;\r\n  onChange?: (value: any) => void;\r\n  autoFocus?: boolean;\r\n  required?: boolean;\r\n}\r\nexport function CustomFormField({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  onChange,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  const requireComponent = (\r\n    type: FieldTypesUnion,\r\n  ): React.FC<CustomFormFieldProps> => {\r\n    switch (type) {\r\n      case 'MultipleAnswersQuestion':\r\n        return CustomFormAnswerQuestions;\r\n      case 'RadioButtons':\r\n        return CustomFormRadioGroup;\r\n      case 'CheckBox':\r\n        return CustomFormCheckBox;\r\n      case 'Disclaimer':\r\n        return CustomFormDisclaimer;\r\n      case 'Date':\r\n        return CustomFormDate;\r\n      case 'DropDownList':\r\n        return CustomFormDropDown;\r\n      case 'Email':\r\n        return CustomFormEmail;\r\n      case 'Number':\r\n        return CustomFormNumberText;\r\n      case 'PositiveNumber':\r\n        return CustomFormPositiveNumberText;\r\n      case 'Paragraph':\r\n        return CustomFormParagraph;\r\n      case 'RichText':\r\n        return CustomFormRichText;\r\n      case 'ShortText':\r\n        return CustomFormShortText;\r\n      case 'UserSelection':\r\n        return CustomFormUserSelection;\r\n      case 'File':\r\n        return CustomFormFileUpload;\r\n      case 'AlphanumericWithDashes':\r\n        return CustomFormShortText;\r\n      case 'FormSection':\r\n        return CustomFormParagraph;\r\n      default:\r\n        assertExhaustive(type);\r\n    }\r\n  };\r\n  const Component = requireComponent(formField.Type);\r\n  return (\r\n    <Component\r\n      {...props}\r\n      formField={formField}\r\n      readonly={readonly}\r\n      disabled={disabled}\r\n      onChange={onChange}\r\n    />\r\n  );\r\n}\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n  bookitlab: () => _t(translations.BookitLab),\r\n};\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ISchedulerState } from '../types/ISchedulerState';\r\nimport { ISchedulerParseEvent } from '../types/ISchedulerParseEvent';\r\nimport { ISchedulerEvent } from '../types/ISchedulerEvent';\r\nimport { EventType } from '../slice/types';\r\nimport { omit } from 'lodash';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\n\r\n/**\r\n * Syncs the event provided from outside of the scheduler (props,state,etc.) into the scheduler instance\r\n * @param scheduler Scheduler instance\r\n * @param type event type\r\n * @param items events array\r\n * @param mapfn mapping from event to the type parsable by the scheduler\r\n * @returns nothing\r\n */\r\nexport function syncSchedulerEvents(\r\n  scheduler: DHTMLX.SchedulerStatic | undefined,\r\n  items: Array<ISchedulerParseEvent> | undefined,\r\n) {\r\n  if (scheduler === undefined) {\r\n    return;\r\n  }\r\n\r\n  // events internally stored on the scheduler instance (not a part of a public API)\r\n  const _events = (scheduler as any)['_events'] as Record<string | number, any>;\r\n  const mappedEvents = items ?? [];\r\n\r\n  //cleanup events\r\n  const mappedEventIds = new Set(mappedEvents.map(f => f.id));\r\n  // clear currently displayed items on the current period\r\n  // and replace these with the fresh data from the store\r\n  // events need to be deleted in case and new filter has been applied\r\n  const state: ISchedulerState = scheduler.getState();\r\n  scheduler\r\n    .getEvents(state.min_date, state.max_date)\r\n    .filter(\r\n      (f: ISchedulerEvent) =>\r\n        typeof f.id === 'number' || !mappedEventIds.has(f.id),\r\n    )\r\n    .filter(event => event.type !== undefined)\r\n    .forEach(event => delete _events[event.id]);\r\n  if (items !== undefined && items.length > 0) {\r\n    //push items into the the scheduler\r\n    scheduler.parse(mappedEvents);\r\n  }\r\n}\r\n\r\nexport function mapEvents<\r\n  TIn extends object =\r\n    | ITrainingSessionSlotDto\r\n    | IWorkingHoursDto\r\n    | ICalendarReservationDto\r\n>(\r\n  type: EventType,\r\n  items: Array<TIn> | undefined,\r\n  mapfn: (\r\n    item: TIn,\r\n  ) => Omit<ISchedulerParseEvent, 'original' | 'readonly' | 'notClickable'>,\r\n) {\r\n  const mappedEvents =\r\n    items?.map(item => {\r\n      const original: Omit<TIn, 'Id'> = omit<TIn>(item, 'Id') as Omit<\r\n        TIn,\r\n        'Id'\r\n      >;\r\n      const result = {\r\n        type: type,\r\n        ...mapfn(item),\r\n\r\n        original: original,\r\n      };\r\n      return result;\r\n    }) ?? [];\r\n  return mappedEvents;\r\n}\r\n","import { httpClient } from './HttpClient';\r\nimport { UpdateFilesModel } from 'utils/fileStoreHelper';\r\n\r\nexport const FileStoreApi = {\r\n  saveFormFiles: (payload: UpdateFilesModel[]) => {\r\n    const url = `/api/odata/v4/files/InsertFormFile`;\r\n    const form = new FormData();\r\n    form.append('TypeId', payload[0].typeId as any);\r\n    form.append('ReferenceId', payload[0].referenceId as any);\r\n    form.append('FormTypeId', payload[0].formType as any);\r\n    form.append('UpdateOption', payload[0].updateOption as any);\r\n    form.append('AlertTypeId', payload[0].alertTypeId as any);\r\n    let added = payload.filter(f => f.operation === 'added')[0];\r\n    if (!!added && added.files.length > 0) {\r\n      added.files.forEach((file, ind) => {\r\n        form.append(\r\n          `FormField_${file.Id}_${ind}`,\r\n          file.PostedFile ?? file.Id.toString(),\r\n          file.PostedFile === null ? undefined : file.PostedFile.name,\r\n        );\r\n      });\r\n    }\r\n    return httpClient.post(url, form);\r\n  },\r\n  updateFormFiles: (payload: UpdateFilesModel[]) => {\r\n    const url = `/api/odata/v4/files/UpdateFormFile`;\r\n    const form = new FormData();\r\n    form.append('TypeId', payload[0].typeId as any);\r\n    form.append('ReferenceId', payload[0].referenceId as any);\r\n    form.append('FormTypeId', payload[0].formType as any);\r\n    form.append('UpdateOption', payload[0].updateOption as any);\r\n    form.append('AlertTypeId', payload[0].alertTypeId as any);\r\n    let deleted = payload.filter(f => f.operation === 'removed')[0];\r\n    let added = payload.filter(f => f.operation === 'added')[0];\r\n    if (!!deleted) {\r\n      deleted.files.forEach((f, ind) => {\r\n        form.append(`deleted_${ind}`, `FormField_${f.Id}_${f.Value}`);\r\n      });\r\n    }\r\n    if (!!added && added.files.length > 0) {\r\n      added.files.forEach((file, ind) => {\r\n        form.append(\r\n          `FormField_${file.Id}_${ind}`,\r\n          file.PostedFile ?? file.Id.toString(),\r\n          file.PostedFile === null ? undefined : file.PostedFile.name,\r\n        );\r\n      });\r\n    }\r\n    return httpClient.post(url, form);\r\n  },\r\n};\r\n","import { useEffect, useRef } from 'react';\r\n\r\nexport function usePrevious<T>(value: T): T | undefined {\r\n  const ref = useRef<T>();\r\n  useEffect(() => {\r\n    ref.current = value;\r\n  }, [value]);\r\n  return ref.current;\r\n}\r\n","import { Roles } from 'app/slice/types';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IFixedRoleDto } from './IFixedRolesDto';\r\nimport { IServiceTypeFilterDto } from './IServiceTypeFilterDto';\r\nimport { IUserGroupDto } from './IUserGroupDto';\r\n\r\n/**\r\n *\r\n * auto generated interface for bkt_webApp.Api.OData.V4.Dto.UserFilterDto\r\n *\r\n */\r\nexport interface IUserFilterDto extends Identifiable<string> {\r\n  Id: string;\r\n  Name: string;\r\n  UserGroupId: string | null;\r\n  UserGroupName: string | null;\r\n  UserGroups: IUserGroupDto[];\r\n  Budgets: number[];\r\n  UserRoles: IFixedRoleDto[];\r\n  CustomRoles: Entity<number>[];\r\n  Services: IServiceTypeFilterDto[];\r\n  ServiceGroupIds: number[];\r\n  IsAdminPanel: boolean;\r\n  IsGroupAdmin: boolean;\r\n  IsEquipmentAdmin: boolean;\r\n  IsLabTech: boolean;\r\n  AssetIds: number[];\r\n  InstituteId: number | null;\r\n  StaffEquipmentId: number | null;\r\n  DefaultBudgetId: number | null;\r\n}\r\nexport const convertAuthToIUserFilterDto = (\r\n  user: AuthenticatedUser,\r\n): IUserFilterDto => {\r\n  return {\r\n    Id: user.Id,\r\n    Name: user.Name,\r\n    UserGroupId: user.ActiveUserGroup?.Id,\r\n    UserGroupName: user.ActiveUserGroup?.Name,\r\n    Services: user.AdminEquipments.map(f => {\r\n      return {\r\n        Id: f.Id,\r\n        Name: f.Name,\r\n        ServiceTypeId: f.ServiceTypeId,\r\n      } as IServiceTypeFilterDto;\r\n    }),\r\n    ServiceGroupIds: user.AdminServiceGroups.map(f => f.Id),\r\n    IsAdminPanel: user.Roles.includes(Roles.Administrators),\r\n  } as IUserFilterDto;\r\n};\r\n","export enum SamplePlatePositionNamingTypes {\r\n  Alpha = 0,\r\n  Numeric = 1,\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const CustomFormApi = {\r\n  getAll: (key: number) => {\r\n    const url = `/api/odata/v4/CustomForm(${key})`;\r\n    return httpClient.get(url);\r\n  },\r\n  getSingle: (key: number, customFormId: number) => {\r\n    const url = `/api/odata/v4/CustomForm(${key})`;\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      //$select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Id asc',\r\n      $filter: `(Id eq ${customFormId})`,\r\n      //$select: 'Id,Name,FormFields,ServiceGroups,Active,Type',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n};\r\n","import * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport * as Yup from 'yup';\r\nimport { FormikProps } from 'formik';\r\nimport { CustomFormField } from '../CustomFormFields';\r\nimport { getFieldsVisibilities } from '../CustomFormUtils';\r\nimport { ValidationSchemaProvider } from 'app/components/Forms/ValidationSchemaProvider';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { sortBy } from 'lodash';\r\n\r\nexport interface CustomFormContentProps {\r\n  title?: string;\r\n  formik: FormikProps<Record<string, unknown>>;\r\n  schema: Yup.SchemaOf<object>;\r\n  formFields: IFormFieldDto[];\r\n  validationEnabled?: boolean;\r\n  isAdmin?: boolean;\r\n  readonly?: boolean;\r\n  disabled?: boolean;\r\n  sectionStyles?: React.CSSProperties;\r\n  withTopSeparator?: boolean;\r\n  withBottomSeparator?: boolean;\r\n}\r\nexport function CustomFormContent({\r\n  title,\r\n  formik,\r\n  schema,\r\n  formFields,\r\n  validationEnabled,\r\n  isAdmin,\r\n  readonly,\r\n  disabled,\r\n  sectionStyles,\r\n  withTopSeparator,\r\n  withBottomSeparator,\r\n}: CustomFormContentProps) {\r\n  const isVisibleField = (\r\n    field: IFormFieldDto,\r\n    isAdmin: boolean,\r\n    values: Record<string, any> | undefined,\r\n    visibleOnCompletion?: () => boolean,\r\n  ): boolean => {\r\n    let visibilities = getFieldsVisibilities(\r\n      formFields,\r\n      isAdmin,\r\n      values,\r\n      visibleOnCompletion,\r\n    );\r\n    if (visibilities) {\r\n      return visibilities[field.Id];\r\n    }\r\n    return true;\r\n  };\r\n  const sortedActiveFormFields = React.useMemo(\r\n    () =>\r\n      sortBy(\r\n        formFields.filter(f => f.Active === true),\r\n        f => f.Index,\r\n      ),\r\n    [formFields],\r\n  );\r\n  return (\r\n    <ValidationSchemaProvider\r\n      schema={schema}\r\n      skipValidation={!validationEnabled}\r\n    >\r\n      <FormFieldsSection\r\n        titleSection={title}\r\n        styleSection={sectionStyles}\r\n        withTopSeparator={withTopSeparator}\r\n        withBottomSeparator={withBottomSeparator}\r\n      >\r\n        {sortedActiveFormFields.map((formField, index) => {\r\n          // paragraphs & form sections deserve to start from the new line in 2 column layout (full screen)\r\n          const fullRow =\r\n            formField.Type !== null &&\r\n            ['Paragraph', 'FormSection'].includes(formField.Type);\r\n          return (\r\n            <FormRow\r\n              key={formField.Id}\r\n              hide={\r\n                isVisibleField(\r\n                  formField,\r\n                  isAdmin || false,\r\n                  formik.values,\r\n                  undefined,\r\n                ) === false\r\n              }\r\n              fullRow={fullRow}\r\n            >\r\n              <CustomFormField\r\n                name={String(formField.Id)}\r\n                id={String(formField.Id)}\r\n                key={index}\r\n                formField={formField}\r\n                readonly={readonly}\r\n                disabled={readonly || formik.isSubmitting || disabled}\r\n              />\r\n            </FormRow>\r\n          );\r\n        })}\r\n      </FormFieldsSection>\r\n    </ValidationSchemaProvider>\r\n  );\r\n}\r\n","/**\r\n *\r\n * CustomForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport * as Yup from 'yup';\r\nimport { Formik } from 'formik';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport {\r\n  serializeValues,\r\n  IFormFileValue,\r\n  useCustomFormSchema,\r\n} from '../../CustomFormUtils';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { CustomFormContent } from '../../CustomFormContent';\r\n\r\nexport interface CustomFormProps {\r\n  formFields: IFormFieldDto[];\r\n  formType: CustomFormTypeEnum;\r\n  formValues?: Record<string, any>;\r\n  readonly?: boolean;\r\n  onSubmit: (\r\n    values: Record<number, string | null>,\r\n    files: IFormFileValue[],\r\n  ) => void;\r\n  bindSubmitForm?: any;\r\n  isAdmin?: boolean;\r\n  CustomFormId?: number;\r\n  formName?: string;\r\n  formIsValid?: (isValid: boolean) => void;\r\n  disabled?: boolean;\r\n  validationEnabled?: boolean;\r\n  withTopSeparator?: boolean;\r\n  withBottomSeparator?: boolean;\r\n}\r\n\r\nexport interface CustomFormValue extends Record<number, any> {}\r\n\r\nexport const CustomForm = React.memo(function CustomForm({\r\n  formFields,\r\n  formValues,\r\n  onSubmit,\r\n  readonly,\r\n  bindSubmitForm,\r\n  formName,\r\n  isAdmin,\r\n  disabled,\r\n  formIsValid,\r\n  validationEnabled,\r\n  withTopSeparator,\r\n  withBottomSeparator,\r\n}: CustomFormProps) {\r\n  const schema: Yup.SchemaOf<object> = useCustomFormSchema(\r\n    formFields,\r\n    isAdmin || false,\r\n  );\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      const { serialized, files } = serializeValues(formFields, value);\r\n      onSubmit(serialized, files);\r\n    }\r\n  };\r\n\r\n  const [initialValues, setInitialValues] = React.useState<\r\n    Record<string, any> | undefined\r\n  >(undefined);\r\n  useEffectOnMount(() => {\r\n    setInitialValues(formValues);\r\n    return () => {};\r\n  });\r\n\r\n  return initialValues ? (\r\n    <Formik\r\n      validationSchema={schema}\r\n      initialValues={initialValues}\r\n      validateOnMount={true}\r\n      validateOnChange={true}\r\n      validateOnBlur={true}\r\n      onSubmit={async (values, formikHelpers) => {\r\n        // call setSubmit to finish submit cycle\r\n        console.debug('submitting', values);\r\n        formikHelpers.setSubmitting(true);\r\n        handleSubmit(values);\r\n      }}\r\n    >\r\n      {formik => {\r\n        bindSubmitForm?.(formik.submitForm);\r\n        // if (!formik.isValid) {\r\n        //   console.log('Custom form errors', formik.errors);\r\n        // }\r\n        if (!!formIsValid) {\r\n          formIsValid(formik.isValid);\r\n        }\r\n        return (\r\n          <form id=\"customForm\" onSubmit={formik.handleSubmit}>\r\n            <CustomFormContent\r\n              title={formName}\r\n              formik={formik}\r\n              schema={schema}\r\n              formFields={formFields}\r\n              validationEnabled={validationEnabled}\r\n              isAdmin={isAdmin}\r\n              readonly={readonly}\r\n              disabled={disabled}\r\n              withBottomSeparator={withBottomSeparator}\r\n              withTopSeparator={withTopSeparator}\r\n            />\r\n          </form>\r\n        );\r\n      }}\r\n    </Formik>\r\n  ) : (\r\n    <></>\r\n  );\r\n});\r\n","import { Portal } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { CustomFormApi } from 'api/CustomFormApi';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { CustomForm } from 'app/components/CustomForm/CusomFormControl/Form';\r\nimport { initUserData } from 'app/components/CustomForm/CustomFormFields/CustomFormUserSelection';\r\nimport {\r\n  DeserializeValue,\r\n  IFormFileValue,\r\n  orderFields,\r\n  ParseFormFieldEnums,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport React from 'react';\r\nimport { MutableRefObject } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { isEmptyOrWhitespace, isNullOrUndefined } from 'utils/typeUtils';\r\nimport { InitFormFiles } from '../CustomFormFields/CustomFormFileUpload';\r\n\r\nexport interface CustomFormControlProps {\r\n  CustomFormId: number;\r\n  FormType: CustomFormTypeEnum;\r\n  values?: IFormValueDto[];\r\n  submitFormRef: MutableRefObject<any>;\r\n  saveFormValues: (\r\n    values: IFormValueDto[],\r\n    files: IFormFileValue[],\r\n    originalFiles: IFormFileValue[],\r\n  ) => void;\r\n  isAdmin?: boolean;\r\n  formIsValid?: (isValid: boolean) => void;\r\n  readonly?: boolean;\r\n  formName?: string;\r\n  disabled?: boolean;\r\n  onLoadCompleted?: () => void;\r\n  onLoadStarted?: () => void;\r\n  validationEnabled?: boolean;\r\n  withTopSeparator?: boolean;\r\n  withBottomSeparator?: boolean;\r\n}\r\n\r\nexport function CustomFormControl(props: CustomFormControlProps) {\r\n  const {\r\n    CustomFormId,\r\n    values,\r\n    submitFormRef,\r\n    saveFormValues,\r\n    FormType,\r\n    isAdmin,\r\n    formIsValid,\r\n    readonly,\r\n    formName,\r\n    disabled,\r\n    onLoadCompleted,\r\n    onLoadStarted,\r\n    validationEnabled,\r\n    withTopSeparator,\r\n    withBottomSeparator,\r\n  } = props;\r\n\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const [originalFiles, setOriginalFiles] = React.useState<IFormFileValue[]>(\r\n    [],\r\n  );\r\n  // const [currentFormId, setCurrentFormId] = React.useState<number | undefined>(\r\n  //   CustomFormId,\r\n  // );\r\n  const fetchCustomForm = async (formType: number, customFormId: number) =>\r\n    CustomFormApi.getSingle(formType, customFormId).then(response => {\r\n      let item = response.value[0] as ICustomFormDto;\r\n      ParseFormFieldEnums(item.FormFields);\r\n      return item;\r\n    });\r\n  const loadValue = async (\r\n    field: IFormFieldDto,\r\n    value: IFormValueDto | null,\r\n  ): Promise<ValueResults> => {\r\n    if (field.Type === 'UserSelection') {\r\n      if (isNullOrUndefined(value?.Value)) {\r\n        return new Promise<ValueResults>(resolve => {\r\n          resolve({\r\n            fieldId: field.Id,\r\n            value: field.IsMultiple ? [] : null,\r\n          } as ValueResults);\r\n        });\r\n      } else {\r\n        try {\r\n          let data = await initUserData(value?.Value ?? '', field);\r\n          return {\r\n            fieldId: field.Id,\r\n            value: field.IsMultiple ? data : data[0],\r\n          } as ValueResults;\r\n        } catch (ex) {\r\n          return {\r\n            fieldId: field.Id,\r\n            value: null,\r\n          } as ValueResults;\r\n        }\r\n      }\r\n    } else if (field.Type === 'File') {\r\n      if (isNullOrUndefined(value?.Value)) {\r\n        return new Promise<ValueResults>(resolve => {\r\n          resolve({\r\n            fieldId: field.Id,\r\n            value: [],\r\n          } as ValueResults);\r\n        });\r\n      } else {\r\n        try {\r\n          let results = await InitFormFiles(value?.Value ?? '', field);\r\n          const files =\r\n            results.length > 0\r\n              ? results.map(r => {\r\n                  return {\r\n                    Id: field.Id,\r\n                    Value: r.Id,\r\n                    DisplayValue: r.Name,\r\n                    Size: r.Size,\r\n                    PostedFile: null,\r\n                  } as IFormFileValue;\r\n                })\r\n              : [];\r\n          setOriginalFiles(prev => [...prev, ...files]);\r\n          return {\r\n            fieldId: field.Id,\r\n            value: files,\r\n          } as ValueResults;\r\n        } catch (ex) {\r\n          return {\r\n            fieldId: field.Id,\r\n            value: [],\r\n          } as ValueResults;\r\n        }\r\n      }\r\n    } else {\r\n      return new Promise<ValueResults>(resolve => {\r\n        const opts = DeserializeValue(field, value);\r\n        resolve({\r\n          fieldId: field.Id,\r\n          value: opts,\r\n        } as ValueResults);\r\n      });\r\n    }\r\n  };\r\n  interface ValueResults {\r\n    fieldId: number;\r\n    value: any;\r\n  }\r\n  const [fetchFormValues, getFormValues] = usePromise(\r\n    async (\r\n      formFields: IFormFieldDto[],\r\n      formValues: IFormValueDto[] | undefined,\r\n    ) => {\r\n      return Promise.all(\r\n        formFields\r\n          .filter(f => f.Active === true)\r\n          .map(async field => {\r\n            try {\r\n              const resvalue = await loadValue(\r\n                field,\r\n                formValues?.find(v => v.FormFieldId === field.Id) || null,\r\n              );\r\n              return resvalue;\r\n            } catch {\r\n              return {\r\n                fieldId: field.Id,\r\n                value: null,\r\n              } as ValueResults;\r\n            }\r\n          }),\r\n      );\r\n    },\r\n  );\r\n  const [fetchFormState, fetchFormPromise] = usePromise(fetchCustomForm);\r\n  const [customForm, setState] = useAsyncExtendedState<\r\n    ICustomFormDto | undefined\r\n  >(undefined);\r\n  const [loadedValues, setValues] = useAsyncExtendedState<\r\n    Record<string, any> | undefined\r\n  >(undefined);\r\n  // useEffectOnMount(() => {\r\n  //   setState(fetchFormPromise(FormType as number, currentFormId));\r\n  //   return () => {};\r\n  // });\r\n  React.useEffect(() => {\r\n    if (CustomFormId) {\r\n      !!onLoadStarted && onLoadStarted();\r\n      setState(fetchFormPromise(FormType as number, CustomFormId));\r\n    }\r\n    return () => {\r\n      setState(undefined);\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [CustomFormId]);\r\n  React.useEffect(() => {\r\n    if (customForm) {\r\n      const serializedvalues: Record<string, any> = {};\r\n      setValues(\r\n        getFormValues(customForm.FormFields, values).then(vals => {\r\n          vals.forEach(\r\n            item => (serializedvalues[item.fieldId.toString()] = item.value),\r\n          );\r\n          return serializedvalues;\r\n        }),\r\n      );\r\n    }\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [customForm]);\r\n  React.useEffect(() => {\r\n    const messageKey = 'formLoad';\r\n    let active = !!fetchFormState && !!fetchFormState.status;\r\n    if (active) {\r\n      if (fetchFormState.error) {\r\n        let msg = fetchFormState.error.message;\r\n        !!onLoadCompleted && onLoadCompleted();\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'error',\r\n            message: 'Something went wrong. ' + msg,\r\n            key: messageKey,\r\n          }),\r\n        );\r\n      }\r\n      if (\r\n        fetchFormState.status === 'resolved' &&\r\n        fetchFormValues?.status === 'resolved' &&\r\n        !!customForm &&\r\n        !!loadedValues\r\n      ) {\r\n        !!onLoadCompleted && onLoadCompleted();\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    fetchFormValues,\r\n    onLoadCompleted,\r\n    customForm,\r\n    loadedValues,\r\n    fetchFormState,\r\n  ]);\r\n\r\n  const portalRef = React.useRef(null);\r\n  const bindSubmitForm = React.useCallback(\r\n    submitForm => {\r\n      submitFormRef.current = submitForm;\r\n    },\r\n    [submitFormRef],\r\n  );\r\n  const handleSubmit = React.useCallback(\r\n    (values: Record<number, string | null>, files: IFormFileValue[]) => {\r\n      const formValues: IFormValueDto[] = Object.entries(values).map(\r\n        ([formFieldId, value]) => ({\r\n          Id: -1,\r\n          FormFieldId: +formFieldId,\r\n          Value: isEmptyOrWhitespace(value) ? null : value,\r\n          DisplayValue: null,\r\n          SourceValueId: null,\r\n          AlertId: null,\r\n          AlertTypeId: null,\r\n          Readonly: false,\r\n          CustomFormId: customForm?.Id || CustomFormId,\r\n          CustomFormName: customForm?.Name || null,\r\n          BudgetExperimentId: null,\r\n          ExperimentItemId: null,\r\n          RequestId: null,\r\n          ReservationId: null,\r\n          ServiceGroupId: null,\r\n          ServiceGroupUserId: null,\r\n        }),\r\n      );\r\n      saveFormValues(formValues, files, originalFiles);\r\n    },\r\n    [\r\n      CustomFormId,\r\n      customForm?.Id,\r\n      customForm?.Name,\r\n      originalFiles,\r\n      saveFormValues,\r\n    ],\r\n  );\r\n  const formFields = React.useMemo(() => {\r\n    return customForm !== undefined\r\n      ? validationEnabled\r\n        ? customForm.FormFields.sort(orderFields)\r\n        : customForm.FormFields.sort(orderFields).map(field =>\r\n            Object.assign(field, { Required: 0 }),\r\n          )\r\n      : [];\r\n  }, [customForm, validationEnabled]);\r\n  return (\r\n    <React.Fragment>\r\n      <div ref={portalRef} id=\"custFormPort\" style={{ width: '100%' }} />\r\n      {fetchFormState.status === 'resolved' &&\r\n      customForm !== undefined &&\r\n      !!loadedValues &&\r\n      fetchFormValues.status === 'resolved' ? (\r\n        <Portal container={portalRef.current}>\r\n          <CustomForm\r\n            bindSubmitForm={bindSubmitForm}\r\n            formFields={formFields}\r\n            formValues={loadedValues}\r\n            formName={formName || customForm.Name}\r\n            onSubmit={handleSubmit}\r\n            formType={FormType}\r\n            isAdmin={isAdmin}\r\n            CustomFormId={CustomFormId}\r\n            formIsValid={formIsValid}\r\n            readonly={readonly}\r\n            disabled={disabled}\r\n            validationEnabled={validationEnabled}\r\n            withBottomSeparator={withBottomSeparator}\r\n            withTopSeparator={withTopSeparator}\r\n          />\r\n        </Portal>\r\n      ) : (\r\n        <React.Fragment>\r\n          <Skeleton variant=\"rect\" width=\"100%\" height=\"auto\" />\r\n        </React.Fragment>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\n\r\nconst url = '/api/odata/v4/ServiceRequestStatusFilter';\r\n\r\nexport interface ServiceRequestStatusMultiPickerProps\r\n  extends Omit<\r\n    AutocompleteMultiPickerProps<number, IServiceRequestStatusDto>,\r\n    'loadData'\r\n  > {\r\n  exclude?: InternalServiceRequestStatusesUnion[];\r\n}\r\n\r\nexport const initServiceRequestStatusMultiData = (\r\n  initialValue: string | undefined,\r\n) => {\r\n  if (initialValue === undefined) {\r\n    return new Promise<IServiceRequestStatusDto[]>((resolve, reject) => {\r\n      resolve([] as IServiceRequestStatusDto[]);\r\n    });\r\n  } else {\r\n    const ids = initialValue.split('|').map(v => parseInt(v));\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id in (' + ids.join(',') + '))',\r\n      $select: 'Id,Name,InternalStatusId',\r\n      $skip: 0,\r\n      $top: ids.length,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as IServiceRequestStatusDto[]);\r\n  }\r\n};\r\n\r\nconst getLoadDataFn = (exclude?: InternalServiceRequestStatusesUnion[]) => (\r\n  searchTerm: string | null,\r\n) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  const predicates: Array<Condition<IServiceRequestStatusDto>> = [];\r\n  if (exclude !== undefined && exclude.length > 0) {\r\n    predicates.push(\r\n      new Condition<IServiceRequestStatusDto>(\r\n        'InternalStatusId',\r\n        ODataOperators.Excludes,\r\n        exclude,\r\n      ),\r\n    );\r\n  }\r\n  params.$filter = new ODataFilterBuilder<IServiceRequestStatusDto>({\r\n    predicates: predicates,\r\n    stringColumns: ['Name'],\r\n    stringSearch: searchTerm,\r\n  }).toString();\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as IServiceRequestStatusDto[]);\r\n};\r\n\r\nexport function ServiceRequestStatusMultiPicker(\r\n  props: ServiceRequestStatusMultiPickerProps,\r\n) {\r\n  const loadData = React.useMemo(() => getLoadDataFn(props.exclude), [\r\n    props.exclude,\r\n  ]);\r\n  return (\r\n    <AutocompleteMultiPicker\r\n      mini={!!props.mini}\r\n      size={props.size}\r\n      id={props.id || 'serviceRequestStatusId'}\r\n      ariaLabel=\"Service Request Status\"\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RadioGroup\r\n *\r\n */\r\nimport { RadioGroup as MuiRadioGroup } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport Radio from '../BasicInputs/Radio';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\n\r\nexport interface RadioGroupProps {\r\n  options: Array<Entity<string>>;\r\n  value?: string;\r\n  className?: string;\r\n  onChange?: (\r\n    value: string,\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => void;\r\n  id: string;\r\n  //formik\r\n  name?: string;\r\n  error?: boolean;\r\n  label?: string;\r\n  disabled?: boolean;\r\n  helperText?: string;\r\n  row?: boolean;\r\n  info?: string;\r\n}\r\n\r\nexport function RadioGroup({\r\n  name,\r\n  id,\r\n  value,\r\n  options,\r\n  onChange,\r\n  error,\r\n  row,\r\n  helperText,\r\n  ...props\r\n}: RadioGroupProps) {\r\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value as string;\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n  };\r\n  return (\r\n    <MuiRadioGroup\r\n      key={id}\r\n      aria-label={id}\r\n      name={name}\r\n      value={value || ''}\r\n      onChange={handleChange}\r\n      row={row}\r\n    >\r\n      {options.map((option, index) => (\r\n        <span key={option.Id}>\r\n          <FormControlLabel\r\n            key={option.Id}\r\n            value={option.Id}\r\n            control={<Radio key={option.Id} />}\r\n            label={option.Name}\r\n            disabled={props.disabled}\r\n          />\r\n          {(option as any).Name.length > 28 && (\r\n            <Tooltip key={option.Id + index} title={(option as any).Name}>\r\n              <span>\r\n                <Icon\r\n                  key={option.Id}\r\n                  icon=\"info-circle\"\r\n                  color=\"default\"\r\n                  colorExtend=\"textHover\"\r\n                />\r\n              </span>\r\n            </Tooltip>\r\n          )}\r\n        </span>\r\n      ))}\r\n    </MuiRadioGroup>\r\n  );\r\n}\r\n","import { BillingActionsDetailsQStringParameters } from 'app/pages/BillingActions/BillingActionsDetailsPage/Details/slice/types';\r\nimport { httpClient } from './HttpClient';\r\nimport { IBillingActionsDto } from '../app/pages/BillingActions/BillingActionsPage/IBillingActionsDto';\r\nimport { IResponseType } from '../types/ResponseType';\r\nimport { IBillingDto } from 'app/pages/InvoiceBillingPage/IBillingDto';\r\nimport { IInvoiceBatchesDto } from 'app/pages/InvoiceBatches/IInvoiceBatchesDto';\r\nimport { IBillingActionInvoice } from 'app/pages/InvoiceBillingPage/SelectedRowActions/BillingActionsPopup/BillingActionsPopupTable/IBillingActionInvoice';\r\n\r\nexport const BillingActionsApi = {\r\n  initCreateData: (payload: BillingActionsDetailsQStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = '/api/odata/v4/BillingActions/InitBillingActions';\r\n    return httpClient.post(url, data);\r\n  },\r\n  initUpdateData: (payload: BillingActionsDetailsQStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = '/api/odata/v4/BillingActions/InitBillingActions';\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertBillingActionsDetails: (payload: IBillingActionsDto) => {\r\n    const url = '/api/odata/v4/BillingActions'; //POST action in Controller\r\n    return httpClient.post(url, payload);\r\n  },\r\n  updateBillingActionsDetails: (payload: IBillingActionsDto) => {\r\n    const url = `/api/odata/v4/BillingActions(${payload.Id})`; //PUT action in Controller\r\n    return httpClient.put(url, payload);\r\n  },\r\n  deleteBillingActionsDetails: (\r\n    rows: IBillingActionsDto[],\r\n  ): Promise<IResponseType> => {\r\n    const billingActionIds: number[] = rows.map(item => item.Id);\r\n    const data = { billingActionIds };\r\n    const url = '/api/odata/v4/BillingActions/DeleteBillingActions';\r\n    return httpClient.post(url, data);\r\n  },\r\n  getBillingActions: (screen: number) => {\r\n    const url = `/api/odata/v4/BillingActions(${screen})`;\r\n    return httpClient.get(url, {\r\n      $expand: ['EmailAttachmentTypes', 'EmailRecipientTypes'].join(','),\r\n    });\r\n  },\r\n  getBillingActionById: (screen: number, billingActionId: number) => {\r\n    const url = `/api/odata/v4/BillingActions(${screen})`;\r\n    const params: {\r\n      $filter?: string;\r\n      $expand?: string;\r\n    } = {\r\n      $filter: '(Id eq ' + billingActionId + ')',\r\n      $expand: ['EmailAttachmentTypes', 'EmailRecipientTypes'].join(','),\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n  getBillingActionInvoices: (\r\n    batchInvoiceIds: IBillingDto[] | IInvoiceBatchesDto[],\r\n    screen: number,\r\n  ) => {\r\n    const ids: string = batchInvoiceIds.map(item => item.Id).join(',');\r\n    const data = { ids, screen };\r\n    const url = '/api/odata/v4/BillingActions/GetBillingActionInvoices';\r\n    return httpClient.post(url, data);\r\n  },\r\n  processEmailAction: (\r\n    billingActionsParams: IBillingActionsDto,\r\n    rows: IBillingDto[] | IInvoiceBatchesDto[],\r\n  ) => {\r\n    const billingActionId: number = billingActionsParams.Id;\r\n    const invoiceIds: string = rows.map(item => item.Id).join(',');\r\n    const data = { billingActionId, invoiceIds };\r\n    const url = '/api/odata/v4/BillingActions/ProcessEmailAction';\r\n    return httpClient.post(url, data);\r\n  },\r\n  ProcessSftpUploadAction: (\r\n    billingActionsParams: IBillingActionsDto,\r\n    rows: IBillingDto[] | IInvoiceBatchesDto[],\r\n  ) => {\r\n    const billingActionId: number = billingActionsParams.Id;\r\n    const invoiceIds: string = rows.map(item => item.Id).join(',');\r\n    const data = { billingActionId, invoiceIds };\r\n    const url = '/api/odata/v4/BillingActions/ProcessSftpUploadAction';\r\n    return httpClient.post(url, data);\r\n  },\r\n  processStatusAction: (\r\n    billingActionsParams: IBillingActionsDto,\r\n    rows: IBillingActionInvoice[],\r\n  ) => {\r\n    const billingActionId: number = billingActionsParams.Id;\r\n    const invoiceIds: string = rows.map(item => item.Id).join(',');\r\n    const data = { billingActionId, invoiceIds };\r\n    const url = '/api/odata/v4/BillingActions/ProcessStatusAction';\r\n    return httpClient.post(url, data);\r\n  },\r\n  getRecipientsEmailAddresses: (\r\n    rows: IBillingDto[] | IInvoiceBatchesDto[],\r\n    billingActionsRow: IBillingActionsDto,\r\n  ) => {\r\n    const invoiceIds: number[] = rows.map(item => item.Id);\r\n    const emailTypes: number[] = billingActionsRow.EmailRecipientTypes.map(\r\n      item => item.Id,\r\n    );\r\n    const screen: number = billingActionsRow.ShowOn;\r\n    const specEmailAddresses: string | null =\r\n      billingActionsRow.SpecificEmailAddresses;\r\n    const data = { invoiceIds, emailTypes, screen, specEmailAddresses };\r\n    const url = '/api/odata/v4/BillingActions/GetRecipientsEmailAddresses';\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { intersection } from 'lodash';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  AuthenticatedUser,\r\n  IIsAdminOrOwnerOfParams,\r\n} from 'types/AuthenticatedUser';\r\n\r\nexport function useReservationPermissions() {\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const roles: number[] | undefined = user?.Roles;\r\n\r\n  const allowedToView = React.useCallback(\r\n    (row: IReservationHistoryDto): boolean => {\r\n      return canEditReservation(user, {\r\n        ServiceGroupId: row.ServiceGroupId,\r\n        ServiceId: row.EquipmentId,\r\n        ServiceTypeId: ServiceType.Online,\r\n        UserId: row.BookedById,\r\n      });\r\n    },\r\n    [user],\r\n  );\r\n  const allowedroles = [\r\n    Roles.Administrators,\r\n    Roles.EquipmentAdministrator,\r\n    Roles.GroupAdministrators,\r\n    Roles.LabTech,\r\n  ];\r\n  const hasRolePermissions: boolean =\r\n    intersection(roles, allowedroles).length > 0;\r\n  return {\r\n    hasRolePermissions,\r\n    allowedToView,\r\n  };\r\n}\r\n/**\r\n * Determines if current user has permissions to edit reservation\r\n * @param user authenticated user\r\n * @param row reservation like DTO\r\n * @returns true if current user is allowed to edit the reservation\r\n */\r\nexport function canEditReservation(\r\n  user: AuthenticatedUser | undefined,\r\n  row: IIsAdminOrOwnerOfParams,\r\n) {\r\n  return user?.IsAdminOrOwnerOf(row) ?? false;\r\n}\r\n","import { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { AsyncDataState, AsyncProgressState } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport interface IChargeOnlineBudgetState\r\n  extends AsyncProgressState<Array<IInvoiceBudgetBalanceDto>> {\r\n  currentRecord?: IInvoiceBudgetBalanceDto;\r\n  errors?: string[];\r\n}\r\n\r\n/* --- STATE --- */\r\nexport interface OnlineBudgetsStatusState {\r\n  endDate: string | null;\r\n  needTableRefresh: boolean;\r\n  tableState: AsyncDataState<Array<IInvoiceBudgetBalanceDto>>;\r\n  selected: IInvoiceBudgetBalanceDto[];\r\n  generateInvoicesState: AsyncDataState<any>;\r\n  charge: IChargeOnlineBudgetState;\r\n  pay: IPayState;\r\n  generateInvoicesAndSendToSap: IGenerateInvoicesAndSendToSapState;\r\n}\r\n\r\nexport interface IPayState {\r\n  currentRecord?: IInvoiceBudgetBalanceDto;\r\n  selected?: IInvoiceBudgetBalanceDto[];\r\n  progress?: number;\r\n  status?: PromiseStatus;\r\n  dialogOpen?: boolean;\r\n  data?: IPayActionPayload;\r\n  messages?: IResponseType[];\r\n}\r\nexport type PromiseStatus = `pending` | `resolved` | `rejected`;\r\n\r\nexport enum PaymentMethods {\r\n  BudgetTransfer = 1,\r\n  CreditCard = 2,\r\n  Wire = 3,\r\n  Cash = 4,\r\n  Check = 5,\r\n  Other = 6,\r\n}\r\n\r\nexport interface IPayActionPayload {\r\n  PaymentMethod: PaymentMethods;\r\n  EndDate: Date;\r\n  Rows: Array<IInvoiceBudgetBalanceDto>;\r\n}\r\n\r\nexport interface IProgressAction<T> {\r\n  selected: T[];\r\n  progress?: number;\r\n  status?: PromiseStatus;\r\n}\r\n\r\nexport interface ChargeOnlineBudgetResponse {\r\n  Messages: string[];\r\n  SuccessTransactionsCount: number;\r\n  TransactionsCount: number;\r\n  FailedTransactionsCount: number;\r\n}\r\n\r\nexport interface IGenerateInvoicesAndSendToSapState {\r\n  processing?: boolean;\r\n  dialogOpen?: boolean;\r\n  progress?: number;\r\n  selected?: IInvoiceBudgetBalanceDto[];\r\n  endDate?: Date;\r\n  currentRecord?: IInvoiceBudgetBalanceDto;\r\n}\r\n","/**\r\n *\r\n * DateLabel\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface DateLabelProps {\r\n  value: Date | string | null;\r\n}\r\n\r\nexport function DateLabel(props: DateLabelProps) {\r\n  return <>{dateUtils.shortDateFormat(props.value)}</>;\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IPayment } from 'app/pages/AddPaymentPage/IPayment';\r\n//import { IResponseType } from 'types/ResponseType';\r\nconst url = '/api/odata/v4/Payment';\r\nexport interface IPaymentPayload extends IPayment {\r\n  ShouldCloseInvoice?: boolean;\r\n}\r\nexport const PaymentApi = {\r\n  AddPayment: (payment: IPaymentPayload) => {\r\n    const data = {\r\n      InvoiceId: payment.InvoiceId,\r\n      MethodId: payment.Method?.Id,\r\n      Amount: payment.Amount,\r\n      Date: payment.Date,\r\n      Remarks: payment.Remarks,\r\n      Reference: payment.Reference,\r\n      BudgetId: payment.Budget?.Id,\r\n      ServiceGroupId: payment.ServiceGroup?.Id,\r\n      ShouldCloseInvoice: payment.ShouldCloseInvoice,\r\n    };\r\n    return httpClient.post<any>(url, data);\r\n  },\r\n  UpdatePayment: (paymentId: number, payment: IPaymentPayload) => {\r\n    const data = {\r\n      InvoiceId: payment.InvoiceId,\r\n      MethodId: payment.Method?.Id,\r\n      Amount: payment.Amount,\r\n      Date: payment.Date,\r\n      Remarks: payment.Remarks,\r\n      Reference: payment.Reference,\r\n      BudgetId: payment.Budget?.Id,\r\n      ServiceGroupId: payment.ServiceGroup?.Id,\r\n      ShouldCloseInvoice: payment.ShouldCloseInvoice,\r\n    };\r\n    return httpClient.put(url + '(' + paymentId + ')', data);\r\n  },\r\n};\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport clsx from 'clsx';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { RowSection } from '../wrappers';\r\n\r\nexport interface FormRowProps {\r\n  children: React.ReactNode;\r\n  fullRow?: boolean;\r\n  minRow?: boolean;\r\n  hide?: boolean;\r\n  wrapOnMobile?: boolean;\r\n  isCover?: boolean;\r\n  shrink?: '1' | '2' | '3';\r\n}\r\nexport const FormRow = (props: FormRowProps) => {\r\n  const { children, fullRow, hide, minRow, wrapOnMobile, isCover, shrink } =\r\n    props;\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView =\r\n    isMobile || (sidePanelOpen && !sidePanelExpanded) || isCover;\r\n  const shrinkClass = shrink ? `shrink-${shrink}` : '';\r\n  const theme = useTheme();\r\n  return (\r\n    <RowSection\r\n      theme={theme}\r\n      className={clsx('row', shrinkClass, {\r\n        shortView: showShortView,\r\n        fullRow: fullRow,\r\n        hideRow: hide,\r\n        minRow: minRow && !showShortView && !fullRow,\r\n        wrap: wrapOnMobile,\r\n      })}\r\n    >\r\n      {children}\r\n    </RowSection>\r\n  );\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.samplePlates || initialState;\r\n\r\nexport const selectSamplePlates = createSelector([selectSlice], state => state);\r\n\r\nexport const selectSamplePlatesData = createSelector(\r\n  [selectSamplePlates],\r\n  state => state.data,\r\n);\r\nexport const selectSamplePlatesTableState = createSelector(\r\n  [selectSamplePlates],\r\n  state => state.tableState,\r\n);\r\nexport const selectSamplePlatesCreate = createSelector(\r\n  [selectSamplePlates],\r\n  state => state.create,\r\n);\r\n\r\nexport const selectBulkSamplePlatesCreate = createSelector(\r\n  [selectSamplePlates],\r\n  state => state.bulckCreate,\r\n);\r\n\r\nexport const selectSamplePlatesUpdate = createSelector(\r\n  [selectSamplePlates],\r\n  state => state.update,\r\n);\r\n","/**\r\n *\r\n * FilterBox\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FilterBoxCoreProps {\r\n  direction: Directions;\r\n}\r\nexport interface FilterBoxProps\r\n  extends React.PropsWithChildren<\r\n    FilterBoxCoreProps & React.HTMLAttributes<HTMLElement>\r\n  > {}\r\n\r\nexport const FilterBox = React.forwardRef(function FilterBox(\r\n  props: FilterBoxProps,\r\n  ref: any,\r\n) {\r\n  const isMobile = DetectIsMobile();\r\n  const classes = useStyles({\r\n    isMobile: isMobile,\r\n    direction: props.direction,\r\n  });\r\n  return (\r\n    <div\r\n      className={clsx(classes.root, {\r\n        isMobile: isMobile,\r\n        horizontal: props.direction === 'horizontal',\r\n      })}\r\n      ref={ref}\r\n      {...props}\r\n    >\r\n      {props.children}\r\n    </div>\r\n  );\r\n});\r\n\r\nexport type Directions = 'vertical' | 'horizontal';\r\n\r\nconst useStyles = makeStyles<Theme>((theme: Theme) => {\r\n  return createStyles({\r\n    root: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      flexWrap: 'nowrap',\r\n      flexDirection: 'row',\r\n      gap: 8,\r\n      position: 'relative',\r\n      '&.isMobile': {\r\n        display: 'inline-flex',\r\n        flexWrap: 'wrap',\r\n        width: 'inherit',\r\n        marginTop: '12px',\r\n        marginBottom: '-4px',\r\n        gap: 'unset',\r\n      },\r\n      '&.horizontal': {\r\n        display: 'inline-flex',\r\n        flexWrap: 'wrap',\r\n        marginLeft: '-8px',\r\n      },\r\n    },\r\n  });\r\n});\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { downloadFile } from 'utils/url-utils';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\ninterface DownloadFileButonProps {\r\n  id: string;\r\n  name?: React.ReactNode;\r\n}\r\n\r\nexport function DownloadFileButon(props: DownloadFileButonProps) {\r\n  const { t } = useTranslation();\r\n  const url = `/file.ashx?id=${props.id}&ap=true`;\r\n  const [busy, setBusy] = React.useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const handleClick = React.useCallback(\r\n    async event => {\r\n      event.preventDefault();\r\n      if (busy) {\r\n        return;\r\n      }\r\n      setBusy(true);\r\n      try {\r\n        await downloadFile({ path: url });\r\n        setBusy(false);\r\n      } catch (error) {\r\n        setBusy(false);\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'error',\r\n            message: t(translations.Error_FileNotAvailable),\r\n          }),\r\n        );\r\n      }\r\n\r\n      return false;\r\n    },\r\n    [actions, busy, dispatch, t, url],\r\n  );\r\n  return (\r\n    <Button\r\n      component={'a'}\r\n      href={url}\r\n      size=\"small\"\r\n      variant=\"text\"\r\n      onClick={handleClick}\r\n      processing={busy}\r\n      disabled={busy}\r\n    >\r\n      {props.name ?? t(translations.Download)}\r\n    </Button>\r\n  );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\nexport interface ActivateButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: () => void;\r\n  ServiceGroupId?: number;\r\n  Active: boolean;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: SaveFormButtonProps) {\r\n  const { t } = useTranslation();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const [showConfirm, setShowConfirm] = React.useState<boolean>(false);\r\n\r\n  return edit &&\r\n    settings.GetBooleanByKey(\r\n      AllowedSettings.TrainingActivationAllowedBySGAOnly,\r\n    ) ? (\r\n    <React.Fragment>\r\n      <Button {...props} onClick={() => setShowConfirm(true)}>\r\n        {text}\r\n      </Button>\r\n      <DialogConfirm\r\n        isOpen={showConfirm}\r\n        title={t(translations.UpdateActiveTrainingWarningTitle)}\r\n        body={t(translations.DeactivateTrainingMessage)}\r\n        confirmButtonLabel={t(translations.Update)}\r\n        cancelButtonLabel={t(translations.Cancel)}\r\n        onConfirm={onClick}\r\n        onCancel={() => setShowConfirm(false)}\r\n      />\r\n    </React.Fragment>\r\n  ) : (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function ActivateButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ServiceGroupId,\r\n  Active,\r\n  ...props\r\n}: ActivateButtonProps) {\r\n  const { t } = useTranslation();\r\n  const [showConfirm, setShowConfirm] = React.useState<boolean>(false);\r\n\r\n  return (\r\n    <React.Fragment>\r\n      {Active ? (\r\n        <React.Fragment>\r\n          <Button size=\"small\" onClick={() => setShowConfirm(true)} {...props}>\r\n            {text}\r\n          </Button>\r\n          <DialogConfirm\r\n            isOpen={showConfirm}\r\n            title={t(translations.DeactivateTraining)}\r\n            body={t(translations.DeactivateTrainingMessage)}\r\n            confirmButtonLabel={t(translations.Deactivate)}\r\n            cancelButtonLabel={t(translations.Cancel)}\r\n            onConfirm={onClick}\r\n            onCancel={() => setShowConfirm(false)}\r\n          />\r\n        </React.Fragment>\r\n      ) : (\r\n        <Button size=\"small\" onClick={onClick} {...props}>\r\n          {text}\r\n        </Button>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField, useFormikContext } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { useIsRequired } from './ValidationSchemaProvider';\r\nimport { FileInputProps } from '../BasicInputs/FileUpload/FileInput';\r\nimport { IFormFileValue } from '../CustomForm/CustomFormUtils';\r\nimport { FileUpload } from '../BasicInputs/FileUpload/FileUpload';\r\n\r\nexport const FormInputFile = ({\r\n  id,\r\n  label,\r\n  onChange,\r\n  value,\r\n  name,\r\n  title,\r\n  required,\r\n  ...props\r\n}: FieldHookConfig<IFormFileValue[]> & IFieldProps & FileInputProps) => {\r\n  const [field, meta, helper] = useField<IFormFileValue[]>({\r\n    name,\r\n    ...props,\r\n  });\r\n  const handleChange = (files: IFormFileValue[]) => {\r\n    helper.setValue(files);\r\n    //const files = event.target.files;\r\n    //console.log('value', event.target);\r\n    console.debug('files', files);\r\n    onChange?.(files);\r\n    // if (onChange !== undefined) {\r\n    //   onChange(files, event);\r\n    // }\r\n    // field.onChange(event);\r\n  };\r\n  const { submitCount } = useFormikContext();\r\n  const isRequired = useIsRequired(name);\r\n  const hasError = meta?.error !== undefined;\r\n  const showError = hasError || submitCount > 0;\r\n  return (\r\n    <FileUpload\r\n      fileInputProps={{\r\n        id: id,\r\n        label: label,\r\n        name: name,\r\n        onBlur: field?.onBlur,\r\n        error: showError,\r\n        required: isRequired || required,\r\n        errorMesage: meta?.error,\r\n        ...props,\r\n      }}\r\n      values={field.value}\r\n      multiple={props.multiple}\r\n      showPreview={props.showPreview}\r\n      saveFiles={handleChange}\r\n    />\r\n  );\r\n};\r\n","import { dateUtils } from 'utils/date-utils';\r\n\r\nexport const TransformDate = (value, original, ctx) => {\r\n  if (ctx.isType(value)) return value;\r\n  return dateUtils.format(original, dateUtils.DateIOFormats.keyboardDate);\r\n};\r\n","/**\r\n *\r\n * WorkOrderPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface WorkOrderPickerProps\r\n  extends Omit<AutocompletePickerProps<IWorkOrderDetailsDto>, 'loadData'> {\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  useSearchOrPredicate?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/WorkOrders';\r\nexport const initWorkOrdersData = (\r\n  initval: string | undefined,\r\n  select?: (keyof IWorkOrderDetailsDto)[],\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n      $select: string;\r\n      $expand?: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n      $select: !!select\r\n        ? select.join(',')\r\n        : [\r\n            'Id',\r\n            'Name',\r\n            'AssetName',\r\n            'AssetId',\r\n            'ServiceGroup',\r\n            'ServiceGroupId',\r\n            'ServiceId',\r\n            'ServiceTypeId',\r\n            'AssetCatId',\r\n            'AssetCatGroupId',\r\n            'AssetCatName',\r\n            'AssetCatGroupName',\r\n            'AlertTypeId',\r\n            'AlertTitle',\r\n            'AlertDescription',\r\n            'StatusName',\r\n            'AlertType',\r\n            'EventStart',\r\n            'ReportedBy',\r\n            'ReportedByDisplayName',\r\n            'LastUpdated',\r\n            'Reservation',\r\n            'AlertOfflineTime',\r\n            'OfflineEventEnd',\r\n            'OfflineEventStart',\r\n            'OfflineRemarks',\r\n            'ReasonTypeId',\r\n            'ReasonTypeName',\r\n            'StatusId',\r\n            'IsClosed',\r\n            'UserTicket',\r\n            'InstrumentWasDown',\r\n            'IsAutoCreatedType',\r\n            'AlertStart',\r\n            'CreateDate',\r\n            'DoneDate',\r\n            'RecurringGroupId',\r\n            'RecurringAssetId',\r\n            'WorkOrderType',\r\n            'StaffOnly',\r\n            'WorkingHoursId',\r\n            'ShowOnCalibrationHistory',\r\n            'NotEditable',\r\n          ].join(','),\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IWorkOrderDetailsDto>)[] | undefined,\r\n  queryUrl?: string,\r\n  useSearchOrPredicate?: boolean,\r\n) =>\r\n  getAutoCompleteLoadDataFn<IWorkOrderDetailsDto>({\r\n    url: url ?? queryUrl,\r\n    predicates: predicates,\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'AssetName',\r\n      'AssetId',\r\n      'ServiceGroup',\r\n      'ServiceGroupId',\r\n      'ServiceId',\r\n      'ServiceTypeId',\r\n      'AssetCatId',\r\n      'AssetCatGroupId',\r\n      'AssetCatName',\r\n      'AssetCatGroupName',\r\n      'AlertTypeId',\r\n      'AlertTitle',\r\n      'AlertDescription',\r\n      'StatusName',\r\n      'AlertType',\r\n      'EventStart',\r\n      'ReportedBy',\r\n      'ReportedByDisplayName',\r\n      'LastUpdated',\r\n      'Reservation',\r\n      'AlertOfflineTime',\r\n      'OfflineEventEnd',\r\n      'OfflineEventStart',\r\n      'OfflineRemarks',\r\n      'ReasonTypeId',\r\n      'ReasonTypeName',\r\n      'StatusId',\r\n      'IsClosed',\r\n      'UserTicket',\r\n      'InstrumentWasDown',\r\n      'IsAutoCreatedType',\r\n      'AlertStart',\r\n      'CreateDate',\r\n      'DoneDate',\r\n      'RecurringGroupId',\r\n      'RecurringAssetId',\r\n      'WorkOrderType',\r\n      'StaffOnly',\r\n      'WorkingHoursId',\r\n      'ShowOnCalibrationHistory',\r\n      'NotEditable',\r\n    ],\r\n    useSearchOrPredicate: useSearchOrPredicate,\r\n  });\r\nexport function WorkOrderPicker(props: WorkOrderPickerProps) {\r\n  const innerLoadData = (predicates, queryUrl) =>\r\n    loadData(props.predicates, queryUrl, props.useSearchOrPredicate);\r\n  const queryUrl = '/api/odata/v4/WorkOrders';\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData(props.predicates, queryUrl)}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'WorkOrdersId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const WorkOrdersCalibrationFilter = (\r\n  assetId?: number,\r\n  woTypeId?: number,\r\n  excludeIds?: number[],\r\n) => {\r\n  const predicates: (string | Condition<IWorkOrderDetailsDto>)[] = [];\r\n  if (!!assetId) {\r\n    predicates.push(\r\n      new Condition<IWorkOrderDetailsDto>(\r\n        'AssetId',\r\n        ODataOperators.Equals,\r\n        assetId,\r\n      ),\r\n    );\r\n  }\r\n  if (!!woTypeId) {\r\n    predicates.push(\r\n      new Condition<IWorkOrderDetailsDto>(\r\n        'AlertTypeId',\r\n        ODataOperators.Equals,\r\n        woTypeId,\r\n      ),\r\n    );\r\n  }\r\n  if (!!excludeIds && excludeIds?.length > 0) {\r\n    predicates.push(\r\n      new Condition<IWorkOrderDetailsDto>(\r\n        'Id',\r\n        ODataOperators.Excludes,\r\n        excludeIds,\r\n      ),\r\n    );\r\n  }\r\n  predicates.push(\r\n    new Condition<IWorkOrderDetailsDto>(\r\n      'IsClosed',\r\n      ODataOperators.NotEquals,\r\n      true,\r\n    ),\r\n  );\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n};\r\nexport const loadWorkOrders = loadData;\r\n","/**\r\n *\r\n * FormRestrictedUserGroupPicker\r\n *\r\n */\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { RestrictedUserGroupPicker } from '../pickers/AutocompletePickers/UserGroupPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormRestrictedUserGroupPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IUserGroupDto | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<IUserGroupDto | null>(props);\r\n  return (\r\n    <RestrictedUserGroupPicker\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      predicates={props.predicates}\r\n      disabled={props.disabled}\r\n    />\r\n  );\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IServiceRequestDto } from 'api/odata/generated/entities/IServiceRequestDto';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport {\r\n  URLSearchParamsCI,\r\n  arrayToQueryString,\r\n  getNumberEntityArray,\r\n  initMultiPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport {\r\n  ServiceRequestStatusMultiPicker,\r\n  initServiceRequestStatusMultiData,\r\n} from 'app/components/pickers/AutocompletePickers/ServiceRequestStatusMultiPicker';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport const StatusFilterId = 'Status';\r\nexport const GetFilters: GetPageFilters<IServiceRequestDto> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParamsCI(search);\r\n  const result: IFilterSettings<IServiceRequestDto>[] = [\r\n    {\r\n      id: StatusFilterId,\r\n      fieldName: 'Status',\r\n      queryStringSerializer: arrayToQueryString('RequestStatusInclude'),\r\n      displayName: t(translations.IncludeStatus) as string,\r\n      operator: ODataOperators.Includes,\r\n      value: getNumberEntityArray(params, 'RequestStatusInclude'),\r\n      component: ServiceRequestStatusMultiPicker,\r\n      initData: initMultiPickerValue(initServiceRequestStatusMultiData),\r\n      urlKey: 'RequestStatusInclude',\r\n    },\r\n  ];\r\n  return result;\r\n};\r\n","import React from 'react';\r\n\r\nimport FirstPageIcon from '@material-ui/icons/FirstPage';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft';\r\nimport KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight';\r\nimport LastPageIcon from '@material-ui/icons/LastPage';\r\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n  root: {\r\n    flexShrink: 0,\r\n    marginLeft: theme.spacing(2.5),\r\n  },\r\n}));\r\n\r\nconst TablePaginationActions = props => {\r\n  const classes = useStyles();\r\n  const theme = useTheme();\r\n  const { count, page, rowsPerPage, onChangePage } = props;\r\n\r\n  const handleFirstPageButtonClick = event => {\r\n    onChangePage(event, 0);\r\n  };\r\n\r\n  const handleBackButtonClick = event => {\r\n    onChangePage(event, page - 1);\r\n  };\r\n\r\n  const handleNextButtonClick = event => {\r\n    onChangePage(event, page + 1);\r\n  };\r\n\r\n  const handleLastPageButtonClick = event => {\r\n    onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\r\n  };\r\n\r\n  return (\r\n    <div className={classes.root}>\r\n      <IconButton\r\n        onClick={handleFirstPageButtonClick}\r\n        disabled={page === 0}\r\n        aria-label=\"first page\"\r\n      >\r\n        {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}\r\n      </IconButton>\r\n      <IconButton\r\n        onClick={handleBackButtonClick}\r\n        disabled={page === 0}\r\n        aria-label=\"previous page\"\r\n      >\r\n        {theme.direction === 'rtl' ? (\r\n          <KeyboardArrowRight />\r\n        ) : (\r\n          <KeyboardArrowLeft />\r\n        )}\r\n      </IconButton>\r\n      <IconButton\r\n        onClick={handleNextButtonClick}\r\n        disabled={page >= Math.ceil(count / rowsPerPage) - 1}\r\n        aria-label=\"next page\"\r\n      >\r\n        {theme.direction === 'rtl' ? (\r\n          <KeyboardArrowLeft />\r\n        ) : (\r\n          <KeyboardArrowRight />\r\n        )}\r\n      </IconButton>\r\n      <IconButton\r\n        onClick={handleLastPageButtonClick}\r\n        disabled={page >= Math.ceil(count / rowsPerPage) - 1}\r\n        aria-label=\"last page\"\r\n      >\r\n        {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}\r\n      </IconButton>\r\n    </div>\r\n  );\r\n};\r\n\r\nTablePaginationActions.propTypes = {\r\n  count: PropTypes.number.isRequired,\r\n  onChangePage: PropTypes.func.isRequired,\r\n  page: PropTypes.number.isRequired,\r\n  rowsPerPage: PropTypes.number.isRequired,\r\n};\r\n\r\nexport default TablePaginationActions;\r\n","import * as React from 'react';\r\nimport {\r\n  Table as MuiTable,\r\n  TableBody,\r\n  TableHead,\r\n  TableRow,\r\n  TableCell,\r\n  TableFooter,\r\n  TableContainer,\r\n  Table,\r\n} from '@material-ui/core/index';\r\nimport TablePagination from '@material-ui/core/TablePagination';\r\nimport { Checkbox } from '@material-ui/core/index';\r\nimport {\r\n  Column,\r\n  useTable,\r\n  useRowSelect,\r\n  usePagination,\r\n  PluginHook,\r\n  useGlobalFilter,\r\n  Row,\r\n} from 'react-table';\r\n\r\nimport TablePaginationActions from './TablePaginationActions';\r\nimport { GlobalFilter } from 'app/components/BasicTable/GlobalFilter';\r\nimport { useStyles } from 'app/components/BasicTable/styles';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { SelectedActions } from 'app/components/BasicTable/SelectedActions';\r\nimport { BasicTableProps } from 'app/components/BasicTable';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { useRowActionsColumn } from 'app/components/BasicTable/RowActions';\r\nimport { ConfigureColumnsButton } from 'app/components/BasicTable/components/ConfigureColumnsButton';\r\nimport { ExportButton } from 'app/components/BasicTable/ExportButton';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface EditableTableProps<TRow extends object>\r\n  extends Pick<\r\n    BasicTableProps<TRow>,\r\n    'columns' | 'selectedRowsActions' | 'pageActions' | 'rowActions'\r\n  > {\r\n  columns: Column<TRow>[];\r\n  // defaultColumn: any;\r\n  //   skipPageReset: boolean;\r\n  updateMyData?: any;\r\n  data: TRow[];\r\n  toolbar?: (selectedRows: TRow[]) => JSX.Element;\r\n  // controlledPageCount: number;\r\n  // fetchData: (state: ITableState) => void;\r\n  toggleHideColumn?: (columnId: String, value: Boolean) => void;\r\n  useRowSelect: boolean;\r\n  onSelectedRowsChange?: (selectedRows: TRow[]) => void;\r\n  useGlobalFilter: boolean;\r\n  subHeader?: React.ReactNode;\r\n  screenName: string | React.ReactNode;\r\n  handleConfigurableColumns: () => void;\r\n  handleExport: () => Promise<void>;\r\n  useImportLink?: boolean;\r\n  importLink?: string;\r\n  importHandler?: () => void;\r\n  onExportForImport?: (rows: Row<TRow>[]) => void;\r\n  onDownloadTemplate?: () => void;\r\n}\r\n\r\nexport function EditableTable<TRow extends Record<string, unknown>>({\r\n  selectedRowsActions,\r\n  onSelectedRowsChange,\r\n  screenName,\r\n  ...props\r\n}: EditableTableProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const {\r\n    columns,\r\n    data,\r\n    // fetchData,\r\n    // controlledPageCount,\r\n    // skipPageReset,\r\n    updateMyData,\r\n  } = props;\r\n  const tablePlugins: PluginHook<TRow>[] = [useGlobalFilter, usePagination];\r\n\r\n  if (props.useRowSelect) {\r\n    tablePlugins.push(useRowSelect);\r\n    tablePlugins.push(hooks => {\r\n      hooks.visibleColumns.push(columns => [\r\n        // Let's make a column for selection\r\n        {\r\n          id: 'selection',\r\n          // The header can use the table's getToggleAllRowsSelectedProps method\r\n          // to render a checkbox\r\n          Header: ({ getToggleAllRowsSelectedProps }) => (\r\n            <div>\r\n              <Checkbox {...getToggleAllRowsSelectedProps()} />\r\n            </div>\r\n          ),\r\n          // The cell can use the individual row's getToggleRowSelectedProps method\r\n          // to the render a checkbox\r\n          Cell: ({ row }) => (\r\n            <div>\r\n              <Checkbox {...row.getToggleRowSelectedProps()} />\r\n            </div>\r\n          ),\r\n        },\r\n        ...columns,\r\n      ]);\r\n    });\r\n  }\r\n\r\n  useRowActionsColumn<TRow>(props.rowActions, tablePlugins);\r\n  const tableInstance = useTable(\r\n    {\r\n      columns,\r\n      data,\r\n\r\n      // use the skipPageReset option to disable page resetting temporarily\r\n      //   autoResetPage: !skipPageReset,\r\n      // updateMyData isn't part of the API, but\r\n      // anything we put into these options will\r\n      // automatically be available on the instance.\r\n      // That way we can call this function from our\r\n      // cell renderer!\r\n      updateMyData,\r\n      autoResetPage: false,\r\n      // initialState: {  pageSize: 10 },\r\n      // manualPagination: true, // Tell the usePagination\r\n      // pageCount: controlledPageCount,\r\n    },\r\n    ...tablePlugins,\r\n  );\r\n\r\n  const {\r\n    getTableProps,\r\n    getTableBodyProps,\r\n    headerGroups,\r\n    page, // Instead of using 'rows', we'll use page,\r\n    prepareRow,\r\n    //pagination\r\n    gotoPage,\r\n    setPageSize,\r\n    state: { pageIndex, pageSize, globalFilter, selectedRowIds },\r\n    selectedFlatRows,\r\n    toggleAllRowsSelected,\r\n    setGlobalFilter,\r\n  } = tableInstance;\r\n\r\n  const isSomeselected = Object.keys(selectedRowIds || {}).length > 0;\r\n  const [selected, setSelected] = React.useState<Record<any, TRow>>({});\r\n  React.useEffect(\r\n    () =>\r\n      onSelectedRowsChange?.(Object.entries(selected).map(value => value[1])),\r\n    [onSelectedRowsChange, selected],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    setSelected(state =>\r\n      Object.keys(selectedRowIds || {}).reduce((accumulator, key) => {\r\n        accumulator[key] =\r\n          state[key] ?? selectedFlatRows.find(row => row.id === key)?.original;\r\n        return accumulator;\r\n      }, {}),\r\n    );\r\n  }, [selectedRowIds, selectedFlatRows]);\r\n  const selectedArray = Object.entries(selected).map(value => value[1]);\r\n\r\n  const handleChangePage = (event, newPage) => {\r\n    gotoPage(newPage);\r\n  };\r\n\r\n  const handleChangeRowsPerPage = event => {\r\n    setPageSize(Number(event.target.value));\r\n  };\r\n  return (\r\n    <>\r\n      <TableContainer key=\"table-container\">\r\n        <TableToolbar\r\n          screenName={screenName}\r\n          children={\r\n            props.pageActions?.map((item, index) => (\r\n              <span key={index}>{item(0, () => void 0)}</span>\r\n            )) ?? []\r\n          }\r\n        />\r\n        {props.subHeader !== undefined && <Box>{props.subHeader}</Box>}\r\n        <Box component=\"div\" className={classes.tableButtonsRoot}>\r\n          <Box className={classes.tableButtonsLeft}>\r\n            <>\r\n              {isSomeselected && selectedRowsActions !== undefined ? (\r\n                <SelectedActions\r\n                  actions={selectedRowsActions || []}\r\n                  selectedArray={selectedArray}\r\n                  toggleAllRowsSelected={toggleAllRowsSelected}\r\n                  totalRows={data.length}\r\n                />\r\n              ) : (\r\n                <>\r\n                  {/* {screenId && AuthenticatedUser && (\r\n                    <Button\r\n                      title={t(translations.ConfigurableColumnsLink) as string}\r\n                      variant=\"main\"\r\n                      color=\"filters\"\r\n                      size=\"small\"\r\n                      startIcon={<Icon icon=\"table\" size=\"sm\" />}\r\n                      onClick={handleConfigurableColumns}\r\n                    >\r\n                      {t(translations.Columns)}\r\n                    </Button>\r\n                  )} */}\r\n                  {/* {useExport && (\r\n                    <ExportButton\r\n                      onClick={handleExportClick}\r\n                      enableExportForImport={onExportForImport !== undefined}\r\n                      selectedRows={selectedFlatRows}\r\n                      onExportForImportClick={onExportForImport}\r\n                    />\r\n                  )} */}\r\n                  {/* {useImportLink && importLink && (\r\n                    <Button\r\n                      variant=\"main\"\r\n                      color=\"filters\"\r\n                      size=\"small\"\r\n                      startIcon={<Icon icon=\"file-import\" size=\"sm\" />}\r\n                      onClick={() =>\r\n                        window.open(toRootedURL(importLink), '_self')\r\n                      }\r\n                    >\r\n                      {t(translations.Import)}\r\n                    </Button>\r\n                  )} */}\r\n\r\n                  <GlobalFilter\r\n                    globalFilter={globalFilter}\r\n                    setGlobalFilter={setGlobalFilter}\r\n                  />\r\n                </>\r\n              )}\r\n            </>\r\n          </Box>\r\n          <Box className={classes.tableButtonsRight}>\r\n            <ConfigureColumnsButton onClick={props.handleConfigurableColumns} />\r\n            <ExportButton onClick={props.handleExport} />\r\n            {props.useImportLink && (props.importLink || props.importHandler) && (\r\n              <Button\r\n                variant=\"white\"\r\n                size=\"small\"\r\n                startIcon={<Icon icon=\"file-import\" />}\r\n                onClick={() => {\r\n                  if (props.importHandler) {\r\n                    props.importHandler();\r\n                  } else {\r\n                    if (props.importLink) {\r\n                      window.open(toRootedURL(props.importLink), '_self');\r\n                    }\r\n                  }\r\n                }}\r\n              >\r\n                {t(translations.Import)}\r\n              </Button>\r\n            )}\r\n          </Box>\r\n        </Box>\r\n\r\n        <div className={classes.tableScrolling}>\r\n          <Table {...getTableProps()} className={classes.table}>\r\n            <TableHead>\r\n              {\r\n                // Loop over the header rows\r\n                headerGroups.map(headerGroup => (\r\n                  // Apply the header row props\r\n                  <TableRow {...headerGroup.getHeaderGroupProps()}>\r\n                    {\r\n                      // Loop over the headers in each row\r\n                      headerGroup.headers.map(column => (\r\n                        // Apply the header cell props\r\n                        <TableCell {...column.getHeaderProps()}>\r\n                          {\r\n                            // Render the header\r\n                            column.render('Header')\r\n                          }\r\n                        </TableCell>\r\n                      ))\r\n                    }\r\n                  </TableRow>\r\n                ))\r\n              }\r\n            </TableHead>\r\n            {/* Apply the table body props */}\r\n            <TableBody {...getTableBodyProps()}>\r\n              {\r\n                // Loop over the table rows\r\n                page.map(row => {\r\n                  // Prepare the row for display\r\n\r\n                  prepareRow(row);\r\n                  return (\r\n                    // Apply the row props\r\n                    <TableRow {...row.getRowProps()}>\r\n                      {\r\n                        // Loop over the rows cells\r\n                        row.cells.map(cell => {\r\n                          // Apply the cell props\r\n                          return (\r\n                            <TableCell {...cell.getCellProps()}>\r\n                              {\r\n                                // Render the cell contents\r\n                                cell.render('Cell')\r\n                              }\r\n                            </TableCell>\r\n                          );\r\n                        })\r\n                      }\r\n                    </TableRow>\r\n                  );\r\n                })\r\n              }\r\n            </TableBody>\r\n          </Table>\r\n        </div>\r\n        <MuiTable {...getTableProps()}>\r\n          <TableFooter>\r\n            <TableRow>\r\n              <TablePagination\r\n                component=\"div\"\r\n                rowsPerPageOptions={[5, 10, 25]}\r\n                colSpan={columns.length + (props.useRowSelect ? 1 : 0)}\r\n                count={data.length}\r\n                rowsPerPage={pageSize}\r\n                page={pageIndex}\r\n                SelectProps={{\r\n                  inputProps: { 'aria-label': 'rows per page' },\r\n                  native: true,\r\n                }}\r\n                onChangePage={handleChangePage}\r\n                onChangeRowsPerPage={handleChangeRowsPerPage}\r\n                ActionsComponent={TablePaginationActions}\r\n              />\r\n            </TableRow>\r\n          </TableFooter>\r\n        </MuiTable>\r\n      </TableContainer>\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * SamplePlatePositionsPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { SamplePlatePositionNamingTypes } from 'api/odata/generated/enums/SamplePlatePositionNamingTypes';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport {\r\n  ISample,\r\n  ISampleRun,\r\n} from 'app/pages/Samples/SamplesListPage/slice/types';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlatePositionsPickerProps\r\n  extends Omit<\r\n    AutocompleteMultiPickerProps<string>,\r\n    'loadData' | 'onChange' | 'value' | 'label' | 'multiple' | 'fullWidth'\r\n  > {\r\n  serviceGroupId?: number;\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  values?: ISample;\r\n  value: string | null;\r\n  onChange: (value: string | null) => void;\r\n}\r\n\r\nexport interface ConnectedSamplePlatePositionsPickerProps\r\n  extends SamplePlatePositionsPickerProps {\r\n  samplePlateId: string | null;\r\n}\r\nfunction range(x) {\r\n  return Array.apply(null, Array(x)).map(function (x, i) {\r\n    return i;\r\n  });\r\n}\r\nconst loadData = (plateId?: string | null) => async (\r\n  searchTerm: string | null,\r\n): Promise<Entity<string>[]> => {\r\n  const plate = await httpClient.get<ISamplePlateDto>(\r\n    `/api/odata/v4/sampleplates('${plateId}')`,\r\n  );\r\n\r\n  const rowsCount = plate.SamplePlateTypeRows;\r\n  const columnsCount = plate.SamplePlateTypeColumns;\r\n  const rows = range(columnsCount)\r\n    .map(i =>\r\n      plate.SamplePlateTypeColumnsNaming ===\r\n      SamplePlatePositionNamingTypes.Alpha\r\n        ? String.fromCharCode(65 + i)\r\n        : i + 1,\r\n    )\r\n    .flatMap(column =>\r\n      range(rowsCount)\r\n        .map(i =>\r\n          plate.SamplePlateTypeRowsNaming ===\r\n          SamplePlatePositionNamingTypes.Alpha\r\n            ? String.fromCharCode(65 + i)\r\n            : i + 1,\r\n        )\r\n        .map(row => `${column}${row}`),\r\n    );\r\n  const options = rows.map(a => ({ Id: a, Name: a }));\r\n  return options;\r\n};\r\nexport function SamplePlatePositionsPicker({\r\n  serviceGroupId,\r\n  samplePlateId,\r\n  value,\r\n  values,\r\n  onChange,\r\n  ...props\r\n}: ConnectedSamplePlatePositionsPickerProps) {\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  const loadDatax = React.useCallback(loadData(samplePlateId), [\r\n    serviceGroupId,\r\n    samplePlateId,\r\n  ]);\r\n  const S2Value =\r\n    value === null\r\n      ? []\r\n      : value\r\n          .split(';')\r\n          .filter(value => value !== '')\r\n          .map(value => ({ Id: value, Name: value }));\r\n  return (\r\n    <AutocompleteMultiPicker\r\n      label=\"\"\r\n      fullWidth={false}\r\n      id={props.id || 'samplepositionId'}\r\n      loadData={loadDatax}\r\n      getOptionLabel={item => item.Name}\r\n      size={props.size}\r\n      onChange={value =>\r\n        onChange(value?.map(item => item.Id)?.join(';') ?? null)\r\n      }\r\n      value={S2Value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nexport function TargetSamplePlatePositionsPicker({\r\n  values,\r\n\r\n  ...props\r\n}: SamplePlatePositionsPickerProps) {\r\n  const samplePlateId = (values as ISampleRun)?.TargetPlateId ?? null;\r\n  return (\r\n    <SamplePlatePositionsPicker samplePlateId={samplePlateId} {...props} />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from '../BasicPickers/AutocompletePicker';\r\nimport { httpClient } from 'api/HttpClient';\r\n\r\nexport interface FormGradientPickerProps\r\n  extends Omit<\r\n    AutocompletePickerProps<IGradientDto>,\r\n    'onBlur' | 'value' | 'error' | 'loadData' | 'onChange'\r\n  > {\r\n  serviceGroupId?: number;\r\n}\r\nexport interface IGradientDto extends Entity<number> {\r\n  EstimatedRuntimeMinutes: number;\r\n}\r\nexport const FormGradientPicker = ({\r\n  serviceGroupId,\r\n  onChange,\r\n  onBlur,\r\n  ...props\r\n}: FieldHookConfig<IGradientDto | null> & FormGradientPickerProps) => {\r\n  const [field, meta, helpers] = useField<IGradientDto | null>(props);\r\n  const handleChange: (value: IGradientDto | null) => void = (\r\n    value: IGradientDto | null,\r\n  ) => helpers.setValue(value, true);\r\n  const loadData = React.useCallback(\r\n    async (searchTerm: string | null): Promise<any> => {\r\n      const data = await httpClient.get(`/odata.svc/Gradients`, {\r\n        $filter:\r\n          serviceGroupId === undefined\r\n            ? undefined\r\n            : `ServiceGroupId eq ${serviceGroupId}`,\r\n        $orderby: 'Name',\r\n      });\r\n      const result: IGradientDto[] = data.d.map(item => ({\r\n        Id: item.Id,\r\n        Name: item.Name,\r\n        EstimatedRuntimeMinutes: item.EstimatedRuntimeMinutes,\r\n      }));\r\n      return result;\r\n    },\r\n    [serviceGroupId],\r\n  );\r\n  return (\r\n    <>\r\n      <AutocompletePicker\r\n        fullWidth\r\n        loadData={loadData}\r\n        onChange={handleChange}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import {\r\n  Dialog,\r\n  DialogActions,\r\n  DialogContent,\r\n  DialogTitle,\r\n  Grid,\r\n} from '@material-ui/core';\r\nimport { useRef, useState } from 'react';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IRunDetails, ISample } from '../../SamplesListPage/slice/types';\r\nimport * as Yup from 'yup';\r\nimport { Form, Formik, FormikProps, FormikValues } from 'formik';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n  FormGradientPicker,\r\n  IGradientDto,\r\n} from 'app/components/Forms/FormGradientPicker';\r\nimport { FormOnlineServicesSinglePicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { ServiceGroupFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { useSamplesListSlice } from '../../SamplesListPage/slice';\r\nimport { useDispatch } from 'react-redux';\r\nimport { push } from 'connected-react-router';\r\nimport { GetSchedulerPagePath } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\n\r\nexport interface CreateReservationComponentProps {\r\n  runDetails?: IRunDetails;\r\n  sampleRunId?: number;\r\n  rows: ISample[];\r\n}\r\ninterface ICreateReservationOptions {\r\n  Gradient?: IGradientDto | null;\r\n  SampleOverhead?: number | null;\r\n  TotalOverhead?: number | null;\r\n  Equipment?: Entity<number> | null;\r\n  SecondaryEquipment?: Entity<number> | null;\r\n  ACQUISITION_TYPE?: string | null;\r\n}\r\nconst schema: Yup.SchemaOf<ICreateReservationOptions> = Yup.object({\r\n  Gradient: Yup.mixed().nullable(),\r\n  SampleOverhead: Yup.number().positive().nullable(),\r\n  TotalOverhead: Yup.number().positive().nullable(),\r\n  Equipment: Yup.mixed().required().nullable(),\r\n  SecondaryEquipment: Yup.mixed().notRequired().nullable(),\r\n  ACQUISITION_TYPE: Yup.string().notRequired().nullable(),\r\n});\r\n\r\nexport const CreateSampleRunReservation = ({\r\n  runDetails,\r\n  sampleRunId,\r\n  rows,\r\n}: CreateReservationComponentProps) => {\r\n  const { t } = useTranslation();\r\n  const [open, setOpen] = useState(false);\r\n  const [save, setSave] = useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useSamplesListSlice();\r\n  const formikRef = useRef<FormikProps<FormikValues>>(null);\r\n\r\n  const serviceRequestId = rows?.map(item => item.ServiceRequestId)[0];\r\n  const serviceGroupId = rows?.map(item => item.ServiceGroupId)[0];\r\n  const handleCreateReservationButtonClick = (\r\n    values: ICreateReservationOptions,\r\n  ) => {\r\n    if (save) {\r\n      setSave(false);\r\n      dispatch(\r\n        actions.updateRun({\r\n          SampleRunId: sampleRunId,\r\n          InstrumentId:\r\n            values.Equipment !== undefined && values.Equipment !== null\r\n              ? values.Equipment.Id\r\n              : undefined,\r\n          SecondaryInstrumentId:\r\n            values.SecondaryEquipment !== undefined &&\r\n            values.SecondaryEquipment !== null\r\n              ? values.SecondaryEquipment.Id\r\n              : undefined,\r\n          GradientId:\r\n            values.Gradient !== undefined && values.Gradient !== null\r\n              ? values.Gradient.Id\r\n              : undefined,\r\n          ACQUISITION_TYPE:\r\n            values.ACQUISITION_TYPE !== null ? values.ACQUISITION_TYPE : null,\r\n        }),\r\n      );\r\n      setOpen(false);\r\n    } else {\r\n      var p: Record<string, any> = {\r\n        srid: serviceRequestId,\r\n        sampleRunId: sampleRunId,\r\n        eid: [values.Equipment?.Id, values.SecondaryEquipment?.Id],\r\n        srsid:\r\n          sampleRunId === undefined\r\n            ? rows?.map(r => r.Id).join(',')\r\n            : undefined,\r\n        duration: getReservationDuration(values, rows),\r\n      };\r\n      dispatch(\r\n        push({\r\n          pathname: GetSchedulerPagePath('calendar'),\r\n          search: toQueryString(p).toString(),\r\n        }),\r\n      );\r\n      setOpen(false);\r\n    }\r\n  };\r\n  const initialValues: ICreateReservationOptions = {\r\n    Gradient: runDetails?.Gradient as IGradientDto,\r\n    //SampleOverhead: 0,\r\n    //TotalOverhead: 0,\r\n    Equipment: runDetails?.Instrument,\r\n    SecondaryEquipment: runDetails?.SecondaryInstrument,\r\n    ACQUISITION_TYPE: runDetails?.ACQUISITION_TYPE,\r\n  };\r\n  return (\r\n    <>\r\n      <Button onClick={e => setOpen(true)}>\r\n        {t(translations.CreateReservation)}\r\n      </Button>\r\n      <Dialog open={open} onClose={() => setOpen(false)}>\r\n        <Formik\r\n          innerRef={formikRef}\r\n          initialValues={initialValues}\r\n          validationSchema={schema}\r\n          onSubmit={(values, { setSubmitting }) => {\r\n            handleCreateReservationButtonClick(values);\r\n          }}\r\n        >\r\n          {formik => (\r\n            <Form>\r\n              <DialogTitle>\r\n                {t(translations.RunDetailsCreateReservation)} {'  '}\r\n                <InfoIcon title={t(translations.SaveGradient_info) as string} />\r\n              </DialogTitle>\r\n              <DialogContent>\r\n                <Grid container spacing={1}>\r\n                  <Grid item xs={12}>\r\n                    <FormGradientPicker\r\n                      fullWidth\r\n                      name=\"Gradient\"\r\n                      label=\"Gradient\"\r\n                      placeholder={t(translations.SampleRunGradient)}\r\n                    />\r\n                  </Grid>\r\n                  <Grid item xs={12}>\r\n                    <FormNumberField\r\n                      name=\"SampleOverhead\"\r\n                      fullWidth\r\n                      label=\"Sample overhead time (minutes)\"\r\n                      type=\"number\"\r\n                    />\r\n                  </Grid>\r\n                  <Grid item xs={12}>\r\n                    <FormNumberField\r\n                      name=\"TotalOverhead\"\r\n                      fullWidth\r\n                      label=\"Total overhead time (minutes)\"\r\n                      type=\"number\"\r\n                    />\r\n                  </Grid>\r\n                  <Grid item xs={12}>\r\n                    <FormOnlineServicesSinglePicker\r\n                      name=\"Equipment\"\r\n                      fullWidth\r\n                      predicates={ServiceGroupFilter(serviceGroupId)}\r\n                      placeholder={t(translations.Equipment)}\r\n                      label=\"Equipment\"\r\n                    />\r\n                  </Grid>\r\n                  <Grid item xs={12}>\r\n                    <FormOnlineServicesSinglePicker\r\n                      name=\"SecondaryEquipment\"\r\n                      fullWidth\r\n                      predicates={ServiceGroupFilter(serviceGroupId)}\r\n                      placeholder={t(translations.Equipment)}\r\n                      label=\"Secondary equipment\"\r\n                    />\r\n                  </Grid>\r\n                  <Grid item xs={12}>\r\n                    <FormTextField\r\n                      name=\"ACQUISITION_TYPE\"\r\n                      fullWidth\r\n                      placeholder={t(translations.ACQUISITION_TYPE)}\r\n                      label=\"Acquisition type\"\r\n                    />\r\n                  </Grid>\r\n                </Grid>\r\n              </DialogContent>\r\n              <DialogActions>\r\n                <Button\r\n                  autoFocus\r\n                  variant=\"white\"\r\n                  onClick={() => setOpen(false)}\r\n                >\r\n                  {t(translations.Cancel)}\r\n                </Button>\r\n                <Button\r\n                  variant=\"main\"\r\n                  onClick={() => {\r\n                    setSave(true);\r\n                    formikRef.current?.handleSubmit();\r\n                  }}\r\n                >\r\n                  {t(translations.Save)}\r\n                </Button>\r\n                <Button\r\n                  variant=\"main\"\r\n                  onClick={() => {\r\n                    setSave(false);\r\n                    formikRef.current?.handleSubmit();\r\n                  }}\r\n                >\r\n                  {t(translations.CreateReservation)}\r\n                </Button>\r\n              </DialogActions>\r\n            </Form>\r\n          )}\r\n        </Formik>\r\n      </Dialog>\r\n    </>\r\n  );\r\n};\r\nfunction getReservationDuration(\r\n  values: ICreateReservationOptions,\r\n  rows: ISample[],\r\n) {\r\n  var timePerSample =\r\n    (values.Gradient?.EstimatedRuntimeMinutes ?? 0) +\r\n    (values.SampleOverhead ?? 0);\r\n  var totalMinutes = timePerSample * rows.length + (values?.TotalOverhead ?? 0);\r\n  const duration = totalMinutes > 0 ? totalMinutes : undefined;\r\n  return duration;\r\n}\r\n","import {\r\n  Dialog,\r\n  DialogActions,\r\n  DialogContent,\r\n  DialogTitle,\r\n} from '@material-ui/core';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\nimport { FormLocationPicker } from 'app/components/Forms/FormLocationPicker';\r\nimport { FormRoomPicker } from 'app/components/Forms/FormRoomPicker';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormSamplePlateTypePicker } from 'app/components/Forms/FromSamplePlateTypePicker';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as Yup from 'yup';\r\nimport { ISampleCreateBase } from '../../SamplePlatesPage/slice/types';\r\nimport { ImportComponent, ImportProps } from './ImportComponent';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\n\r\nexport interface ImportSamplePlateProps extends ImportProps {\r\n  onSubmit: (item: ISampleCreateBase | null, file: File) => void;\r\n  onClose: () => void;\r\n  initialValues: ISampleCreateBase;\r\n}\r\nfunction GetSchema(f: boolean): Yup.SchemaOf<ISampleCreateBase> {\r\n  if (f) {\r\n    const schema: Yup.SchemaOf<ISampleCreateBase> = Yup.object({\r\n      Room: Yup.mixed(),\r\n      Location: Yup.mixed(),\r\n      ServiceGroup: Yup.mixed().required(),\r\n      SamplePlateType: Yup.mixed().required(),\r\n      Active: Yup.boolean(),\r\n      IsRack: Yup.boolean(),\r\n    });\r\n    return schema;\r\n  } else {\r\n    const schema: Yup.SchemaOf<ISampleCreateBase> = Yup.object({\r\n      Room: Yup.mixed(),\r\n      Location: Yup.mixed(),\r\n      ServiceGroup: Yup.mixed(),\r\n      SamplePlateType: Yup.mixed(),\r\n      Active: Yup.boolean(),\r\n      IsRack: Yup.boolean(),\r\n    });\r\n    return schema;\r\n  }\r\n}\r\nexport function ImportSamplePlateForm({\r\n  onSubmit,\r\n  onClose,\r\n  processing,\r\n  initialValues,\r\n  ...props\r\n}: ImportSamplePlateProps) {\r\n  const { t } = useTranslation();\r\n  const [file, setFile] = React.useState<File>();\r\n  const [generatePlatesonImport, setGeneratePlatesonImport] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const handleFileChange = (file: File) => {\r\n    setFile(file);\r\n  };\r\n  const handleCheckboxChange = event => {\r\n    setGeneratePlatesonImport(event.target.checked);\r\n  };\r\n  const handleSubmit = value => {\r\n    if (file !== undefined) {\r\n      if (generatePlatesonImport) {\r\n        onSubmit(value, file);\r\n      } else {\r\n        onSubmit(null, file);\r\n      }\r\n    }\r\n  };\r\n  const handleClose = () => {\r\n    onClose();\r\n  };\r\n  return (\r\n    <Dialog open={true} onClose={handleClose}>\r\n      <Formik\r\n        validationSchema={GetSchema(generatePlatesonImport)}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnChange={true}\r\n        validateOnBlur={true}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => (\r\n          <>\r\n            <form onSubmit={formik.handleSubmit}>\r\n              <DialogTitle></DialogTitle>\r\n              <DialogContent>\r\n                <H4>\r\n                  <b>{props.title ?? t(translations.ImportRecords)}</b>\r\n                </H4>\r\n                <Box style={{ paddingBottom: '8px' }}>\r\n                  <ImportComponent\r\n                    processing={false}\r\n                    accept=\".csv\"\r\n                    handleFileChange={handleFileChange}\r\n                    hideMessage={false}\r\n                    onDownloadTemplateButtonClick={\r\n                      props.onDownloadTemplateButtonClick\r\n                    }\r\n                  />\r\n                </Box>\r\n                <Box style={{ paddingBottom: '8px' }}>\r\n                  <Check\r\n                    name={'GeneratePlatesonImport'}\r\n                    id={'GeneratePlatesonImportId'}\r\n                    color={'primary'}\r\n                    checked={generatePlatesonImport}\r\n                    onChange={handleCheckboxChange}\r\n                    label={t(translations.GeneratePlatesOnImport)}\r\n                    size=\"small\"\r\n                  />\r\n                  {t(translations.GeneratePlatesOnImport)}\r\n                </Box>\r\n                {generatePlatesonImport && (\r\n                  <>\r\n                    <Box style={{ paddingBottom: '8px' }}>\r\n                      <FormServiceGroupPicker\r\n                        placeholder=\"ServiceGroup\"\r\n                        fullWidth={true}\r\n                        label=\"ServiceGroup\"\r\n                        name=\"ServiceGroup\"\r\n                        urlType=\"base\"\r\n                      />\r\n                    </Box>\r\n                    <Box style={{ paddingBottom: '8px' }}>\r\n                      <FormRoomPicker\r\n                        name=\"Room\"\r\n                        fullWidth={true}\r\n                        label=\"Room\"\r\n                        placeholder=\"Room\"\r\n                        variant=\"filled\"\r\n                      />\r\n                    </Box>\r\n                    <Box style={{ paddingBottom: '8px' }}>\r\n                      <FormLocationPicker\r\n                        name=\"Location\"\r\n                        fullWidth={true}\r\n                        label=\"Location\"\r\n                        placeholder=\"Location\"\r\n                        variant=\"filled\"\r\n                      />\r\n                    </Box>\r\n                    <FormSamplePlateTypePicker\r\n                      name=\"SamplePlateType\"\r\n                      fullWidth={true}\r\n                      label=\"SamplePlateType\"\r\n                      placeholder=\"SamplePlateType\"\r\n                      variant=\"filled\"\r\n                    />\r\n                    <FormCheckbox name=\"IsRack\" label=\"Rack\" />\r\n                    <FormCheckbox name=\"Active\" label=\"Active\" />\r\n                  </>\r\n                )}\r\n              </DialogContent>\r\n              <DialogActions>\r\n                <Button type=\"submit\" processing={processing}>\r\n                  {t(translations.Import)}\r\n                </Button>\r\n                <Button type=\"reset\" onClick={handleClose} variant=\"ghost\">\r\n                  {t(translations.Cancel)}\r\n                </Button>\r\n              </DialogActions>\r\n            </form>\r\n          </>\r\n        )}\r\n      </Formik>\r\n    </Dialog>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useSamplesListSlice } from '../SamplesListPage/slice';\r\nimport { ImportSamplePlateForm } from './ImportComponents/PopupImport';\r\nimport { ISampleCreateBase } from '../SamplePlatesPage/slice/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n  selectImportingRunDetails,\r\n  selectImportingRunDetailsFinished,\r\n} from '../SamplesListPage/slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface ImportButtonProps {\r\n  onDownloadTemplateButtonClick: React.MouseEventHandler<HTMLButtonElement>;\r\n}\r\n\r\nexport function ImportButton({\r\n  onDownloadTemplateButtonClick,\r\n}: ImportButtonProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useSamplesListSlice();\r\n  const [open, setOpen] = React.useState(false);\r\n  const importStarted = useSelector(selectImportingRunDetails);\r\n  const importFinished = useSelector(selectImportingRunDetailsFinished);\r\n\r\n  const onImportButtonClick = () => {\r\n    dispatch(actions.setShowImportDialog(false));\r\n    setOpen(true);\r\n  };\r\n  const handleConfirm = (item: ISampleCreateBase | null, file: any) => {\r\n    if (file !== undefined) {\r\n      dispatch(actions.setShowImportDialog(true));\r\n      dispatch(actions.readImportFile({ file: file, plate: item }));\r\n    }\r\n  };\r\n\r\n  return (\r\n    <>\r\n      <Button onClick={onImportButtonClick}>\r\n        {t(translations.ImportTargetSamples)}\r\n      </Button>\r\n      {open && importFinished === false && (\r\n        <ImportSamplePlateForm\r\n          onSubmit={handleConfirm}\r\n          processing={importStarted}\r\n          accept=\".csv\"\r\n          onClose={() => setOpen(false)}\r\n          initialValues={{\r\n            IsRack: false,\r\n            ServiceGroup: undefined,\r\n            SamplePlateType: undefined,\r\n            Active: true,\r\n          }}\r\n        />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import { IRow } from 'app/components/BasicTable/IRow';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { ISampleRun } from '../../SamplesListPage/slice/types';\r\nimport { openExportLink } from 'utils/url-utils';\r\n\r\nexport const ExportRunDetailsSamples = <TRow extends IRow>(\r\n  id: number,\r\n  exportConfigurableColumns: Array<keyof TRow> | undefined,\r\n): Promise<void> => {\r\n  if (exportConfigurableColumns !== undefined) {\r\n    try {\r\n      const params = {\r\n        $format: 'application/xlsx',\r\n        $select: exportConfigurableColumns.join(','),\r\n      };\r\n      const samples_url = `/api/odata/v4/sampleruns(${id})/Samples`;\r\n      const exportUrl = toRootedURL(samples_url, params);\r\n      return openExportLink(exportUrl);\r\n    } catch (error) {\r\n      console.error('doRunDetailsExport failed', error);\r\n      return new Promise<void>((resolve, reject) => {\r\n        resolve();\r\n      });\r\n    }\r\n  } else\r\n    return new Promise<void>((resolve, reject) => {\r\n      resolve();\r\n    });\r\n};\r\nexport const ExportForImportRunDetailsSamples = <TRow extends IRow>(\r\n  id: number,\r\n  rows: ISampleRun[],\r\n  exportConfigurableColumns: Array<keyof TRow> | undefined,\r\n): Promise<void> => {\r\n  if (rows?.length === 0)\r\n    return new Promise<void>((resolve, reject) => {\r\n      resolve();\r\n    });\r\n  if (exportConfigurableColumns !== undefined) {\r\n    const params = {\r\n      $format: 'application/xlsx',\r\n      $filter: `Id in (${rows.map(f => f.Id).join(',')})`,\r\n      $select: exportConfigurableColumns.join(','),\r\n    };\r\n    const samples_url = `/api/odata/v4/sampleruns(${id})/Samples`;\r\n    const exportUrl = toRootedURL(samples_url, params);\r\n    return openExportLink(exportUrl);\r\n  } else\r\n    return new Promise<void>((resolve, reject) => {\r\n      resolve();\r\n    });\r\n};\r\nexport const DownloadTemplateRunDetailsSamples = <TRow extends IRow>(\r\n  id: number,\r\n  exportConfigurableColumns: Array<keyof TRow> | undefined,\r\n): Promise<void> | undefined => {\r\n  if (exportConfigurableColumns !== undefined) {\r\n    try {\r\n      const params = {\r\n        $format: 'application/xlsx',\r\n        $top: 0,\r\n        $select: exportConfigurableColumns.join(','),\r\n      };\r\n      const samples_url = `/api/odata/v4/sampleruns(${id})/Samples`;\r\n      const exportUrl = toRootedURL(samples_url, params);\r\n      return openExportLink(exportUrl);\r\n    } catch (error) {\r\n      console.error('doRunDetailsExport failed', error);\r\n    }\r\n  }\r\n};\r\n","import { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { ISampleRun } from '../../SamplesListPage/slice/types';\r\nimport { ExportForImportRunDetailsSamples } from '../Actions';\r\n\r\nexport interface GetSelectedActionsProps {}\r\nexport function GetSelectedActions(\r\n  t: TFunction,\r\n  id: number,\r\n  exportConfigurableColumns: Array<keyof ISampleRun> | undefined,\r\n  props: GetSelectedActionsProps,\r\n): SelectedRowsActionRenderer<ISampleRun>[] {\r\n  const [validUpdate] = React.useState<boolean | undefined>(false);\r\n  const SelectedActions: SelectedRowsActionRenderer<\r\n    ISampleRun\r\n  >[] = React.useMemo(\r\n    () => [\r\n      (rows, onRefresh, toggleAllRowsSelected) => (\r\n        <SelectedRowsActionIconButton\r\n          key=\"export-forimport-budgets\"\r\n          title={t(translations.ExportForImport)}\r\n          text={t(translations.ExportForImport)}\r\n          confirm={false}\r\n          validConfirm={validUpdate}\r\n          rows={rows}\r\n          onRefresh={() => {\r\n            toggleAllRowsSelected(false);\r\n          }}\r\n          variantButton=\"button\"\r\n          action={() =>\r\n            new Promise<IResponseType>(async (resolve, reject) => {\r\n              await ExportForImportRunDetailsSamples(\r\n                id,\r\n                rows,\r\n                exportConfigurableColumns,\r\n              );\r\n              let messages: IResponseType = {\r\n                SuccessMessages: [],\r\n                ErrorMessages: [],\r\n                WarningMessages: [],\r\n              };\r\n              resolve(messages);\r\n            })\r\n          }\r\n        />\r\n      ),\r\n    ],\r\n    [exportConfigurableColumns, id, t, validUpdate],\r\n  );\r\n  return SelectedActions;\r\n}\r\n","import {\r\n  Dialog,\r\n  DialogActions,\r\n  DialogContent,\r\n  DialogTitle,\r\n  Grid,\r\n} from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useMemo } from 'react';\r\nimport { Form, Formik } from 'formik';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport * as Yup from 'yup';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\n\r\nexport interface PopupSuffixComponentProps {\r\n  onSubmit: (value: string) => void;\r\n  close: () => void;\r\n}\r\ninterface ISuffixOptions {\r\n  Suffix: string;\r\n}\r\nconst schema: Yup.SchemaOf<ISuffixOptions> = Yup.object({\r\n  Suffix: Yup.string().required(),\r\n});\r\nexport function PopupSuffixComponent(props: PopupSuffixComponentProps) {\r\n  const { t } = useTranslation();\r\n  const initialValues: ISuffixOptions = useMemo(() => {\r\n    return {\r\n      Suffix: '',\r\n    };\r\n  }, []);\r\n  const handleSubmitk = useCallback(\r\n    values => {\r\n      props.onSubmit(values.Suffix);\r\n    },\r\n    [props],\r\n  );\r\n  const content = useMemo(() => {\r\n    return (\r\n      <Formik\r\n        initialValues={initialValues}\r\n        validationSchema={schema}\r\n        validateOnMount={true}\r\n        validateOnChange={true}\r\n        onSubmit={(values, { setSubmitting }) => {\r\n          handleSubmitk(values);\r\n        }}\r\n      >\r\n        <Form>\r\n          <DialogTitle>\r\n            {t(translations.AnalyticalSampleIDSuffix)} {'  '}\r\n            <InfoIcon\r\n              title={t(translations.AnalyticalSampleIDSuffix_info) as string}\r\n            />\r\n          </DialogTitle>\r\n          <DialogContent>\r\n            <Grid container spacing={1}>\r\n              <Grid item xs={12}>\r\n                <FormTextField name=\"Suffix\" fullWidth label=\"Suffix\" />\r\n              </Grid>\r\n            </Grid>\r\n          </DialogContent>\r\n          <DialogActions>\r\n            <Button variant=\"white\" onClick={props.close}>\r\n              {t(translations.Cancel)}\r\n            </Button>\r\n            <Button variant=\"main\" type=\"submit\">\r\n              {t(translations.Continue)}\r\n            </Button>\r\n          </DialogActions>\r\n        </Form>\r\n      </Formik>\r\n    );\r\n  }, [handleSubmitk, initialValues, props.close, t]);\r\n  return <>{content}</>;\r\n}\r\nexport interface AnalyticalSampleIDSuffixPopupProps {\r\n  show: boolean;\r\n  onClose: () => void;\r\n  onSubmit: (value: string) => void;\r\n}\r\nexport function AnalyticalSampleIDSuffixPopup({\r\n  show,\r\n  onClose,\r\n  onSubmit,\r\n}: AnalyticalSampleIDSuffixPopupProps) {\r\n  return (\r\n    <>\r\n      <SuffixDialog\r\n        open={show}\r\n        fullWidth={false}\r\n        content={<PopupSuffixComponent close={onClose} onSubmit={onSubmit} />}\r\n      />\r\n    </>\r\n  );\r\n}\r\nexport interface SuffixDialogProps {\r\n  open: boolean;\r\n  content: React.ReactNode;\r\n  fullWidth: boolean;\r\n}\r\nexport function SuffixDialog(props: SuffixDialogProps) {\r\n  return (\r\n    <Dialog\r\n      disableBackdropClick\r\n      disableEscapeKeyDown\r\n      open={props.open}\r\n      aria-labelledby={'Suffix-dialog-popup'}\r\n      fullScreen={false}\r\n      fullWidth={props.fullWidth}\r\n    >\r\n      {props.content}\r\n    </Dialog>\r\n  );\r\n}\r\n","export const CellPositionToNumber = (value: string, columns: number) => {\r\n  let res = 0;\r\n  if (value !== null) {\r\n    const s = value.match(/[a-zA-Z]+|[0-9]+/g);\r\n    if (s !== null) {\r\n      if (s.length === 1) {\r\n        const c1 = s[0][0].charCodeAt(0) - 64;\r\n        const r1 = s[0][1].charCodeAt(0) - 64;\r\n        res = (r1 - 1) * columns + c1;\r\n      } else {\r\n        const c = parseInt(s[0]);\r\n        const r = parseInt(s[1]);\r\n        if (!isNaN(c) && !isNaN(r)) {\r\n          res = (r - 1) * columns + c;\r\n        } else {\r\n          if (isNaN(c) && !isNaN(r)) {\r\n            const c1 = s[0].charCodeAt(0) - 64;\r\n            res = (r - 1) * columns + c1;\r\n          } else {\r\n            if (!isNaN(c) && isNaN(r)) {\r\n              const r1 = s[1].charCodeAt(0) - 64;\r\n              res = (r1 - 1) * columns + c;\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  return res;\r\n};\r\n","/**\r\n *\r\n * RunPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { EditableCell } from '../EditableTable/EditableCell';\r\nimport { NumberField } from 'app/pages/Samples/EditableTable/Fields/NumberField';\r\nimport { TextField } from 'app/pages/Samples/EditableTable/Fields/TextField';\r\nimport { EditableTable } from '../EditableTable';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectRunDetails,\r\n  selectRunDetailsGradient,\r\n  selectRunDetailsInstrument,\r\n  selectRunDetailsSecondaryInstrument,\r\n  selectRunDetailsCreatedDate,\r\n  selectRunDetailsAcquision_type,\r\n} from '../SamplesListPage/slice/selectors';\r\nimport {\r\n  ISample,\r\n  ISampleRun,\r\n  ISampleTarget,\r\n} from '../SamplesListPage/slice/types';\r\nimport { useSamplesListSlice } from '../SamplesListPage/slice';\r\nimport { Box, Card, CardContent, Grid } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Link } from 'react-router-dom';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { SamplePlatePicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePicker';\r\nimport { getRunTypeValue } from '../components/RunTypePicker';\r\nimport { TargetSamplePlatePositionPicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePositionPicker';\r\nimport { TargetSamplePlatePositionsPicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePositionsPicker';\r\nimport { CreateSampleRunReservation } from '../components/CreateSampleRunReservation';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ImportButton } from './ImportButton';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { ReservationEditButton } from 'app/components/ReservationEditButton';\r\nimport { GetServiceRequestDetailsPath } from '../RequestSamplesPage/slice/path';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { Column } from 'react-table';\r\nimport { GetSelectedActions } from 'app/pages/Samples/RunDetailsPage/SelectedRowActions/GetSelectaedRowActions';\r\nimport {\r\n  DownloadTemplateRunDetailsSamples,\r\n  ExportRunDetailsSamples,\r\n} from './Actions';\r\nimport { useConfigurableColumnsAdvanced } from 'app/components/BasicTable/useConfigurableColumnsAdvanced';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { ImportButton as SamplesImportButton } from '../SamplesListPage/ImportButton';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { useRequestSamplesSlice } from '../RequestSamplesPage/slice';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { AnalyticalSampleIDSuffixPopup } from './AnalyticalSampleIDSuffix';\r\nimport { CellPositionToNumber } from './CellPositionToNumber';\r\n\r\nexport const RUN_DETAILS_PAGE_PATH = '/samples/runs/details/:id';\r\nexport interface RunPageProps extends RouteComponentProps<{ id: string }> {}\r\nexport function RunDetailsPage(props: RunPageProps) {\r\n  const id = +props.match.params.id;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const { actions } = useSamplesListSlice();\r\n  const { actions: requestactions } = useRequestSamplesSlice();\r\n  const runDetails = useSelector(selectRunDetails);\r\n  const instrument = useSelector(selectRunDetailsInstrument);\r\n  const secondaryInstrument = useSelector(selectRunDetailsSecondaryInstrument);\r\n  const gradient = useSelector(selectRunDetailsGradient);\r\n  const createdDate = useSelector(selectRunDetailsCreatedDate);\r\n  const acquision_type = useSelector(selectRunDetailsAcquision_type);\r\n  const [showSuffixDialog, setShowSuffixDialog] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const runType = runDetails?.RunType;\r\n\r\n  const updateMyData = item => {\r\n    // We also turn on the flag to not reset the page\r\n\r\n    // setSkipPageReset(true);\r\n    const foo: Omit<ISampleTarget, 'Id'> = item as Omit<ISampleTarget, 'Id'>;\r\n    console.log('updateMyData', foo);\r\n    dispatch(actions.updateRunSampleValue(item));\r\n  };\r\n  const samples = runDetails?.Samples;\r\n  const handleCompleteButtonClick = React.useCallback(\r\n    (suffix?: string) => {\r\n      const data = samples;\r\n      if (data === undefined) {\r\n        return;\r\n      }\r\n      if (runType === undefined) {\r\n        return;\r\n      }\r\n\r\n      dispatch(\r\n        actions.completeRun({\r\n          Id: id,\r\n          RunType: runType,\r\n          Samples: data,\r\n          AnalyticalSampleIDSuffix: suffix,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch, id, samples, runType],\r\n  );\r\n  const submitSuffixDialog = React.useCallback(\r\n    (value: string) => {\r\n      setShowSuffixDialog(false);\r\n      handleCompleteButtonClick(value);\r\n    },\r\n    [handleCompleteButtonClick],\r\n  );\r\n  const showCompleteDialog = React.useCallback(() => {\r\n    if (runDetails?.RunType === 'Fractioning') {\r\n      setShowSuffixDialog(true);\r\n    } else {\r\n      handleCompleteButtonClick();\r\n    }\r\n  }, [handleCompleteButtonClick, runDetails?.RunType]);\r\n  const runId = runDetails?.Id;\r\n\r\n  const handleExportButtonClick = React.useCallback(() => {\r\n    dispatch(actions.exportRun(samples || []));\r\n  }, [actions, dispatch, samples]);\r\n  const handleDownloadTemplateButtonClick = React.useCallback(() => {\r\n    dispatch(actions.exportRun([]));\r\n  }, [actions, dispatch]);\r\n  const columns: Array<Column<ISampleRun>> = [\r\n    /*{\r\n        Header: ' ',\r\n        columns: [*/\r\n    {\r\n      Header: t(translations.SampleId) as string,\r\n      accessor: 'Id', // accessor is the \"key\" in the data\r\n    },\r\n    {\r\n      Header: 'Request ID',\r\n      accessor: 'ServiceRequestId',\r\n      Cell: ({ value }) => (\r\n        <Link to={GetServiceRequestDetailsPath(value)}>{value}</Link>\r\n      ),\r\n    },\r\n    {\r\n      Header: 'Status',\r\n      accessor: 'StatusName',\r\n      Cell: ({ row, value }) => {\r\n        /*switch (value) {\r\n          case 0:\r\n            return 'New';\r\n          case 1:\r\n            return 'In Work';\r\n          case 2:\r\n            return 'Done';\r\n          default:\r\n            return 'N/A';\r\n        }*/\r\n        return row.original.StatusName;\r\n      },\r\n    },\r\n    { Header: 'Project ID', accessor: 'BudgetId' },\r\n    //],\r\n    //},\r\n    /*{\r\n        Header: 'Source sample attributes',\r\n        columns: [*/\r\n    {\r\n      Header: 'Analytical Sample ID',\r\n      accessor: 'AnalyticalSampleId',\r\n    },\r\n    {\r\n      Header: 'BiologicalSampleId',\r\n      accessor: 'BiologicalSampleId',\r\n    },\r\n    { Header: t(translations.TMT_Type) as string, accessor: 'TMT_Type' },\r\n    {\r\n      Header: t(translations.TMT_Label) as string,\r\n      accessor: 'TMT_Label',\r\n    },\r\n    {\r\n      id: 'TMT_RunSet',\r\n      Header: t(translations.TMT_Set) as string,\r\n      accessor: 'TMT_Set',\r\n      Cell: ({ row, value }) => {\r\n        if (row.ServiceRequestId !== undefined && row.TMT_Set !== undefined) {\r\n          return `${row.ServiceRequestId}-${row.TMT_Set}`;\r\n        } else {\r\n          return <></>;\r\n        }\r\n      },\r\n    },\r\n    //],\r\n    //},\r\n    /*{\r\n        Header: 'Standard attributes',\r\n        columns: [*/\r\n    {\r\n      Header: 'Tube Label',\r\n      accessor: 'TubeLabel',\r\n    },\r\n    {\r\n      Header: t(translations.SamplePlateId) as string,\r\n      accessor: 'SamplePlateId',\r\n    },\r\n    {\r\n      Header: t(translations.UniquePlateNumber) as string,\r\n      accessor: 'UniquePlateNumber',\r\n    },\r\n    {\r\n      Header: t(translations.PlatePosition) as string,\r\n      accessor: 'Position',\r\n    },\r\n    {\r\n      Header: t(translations.NumericalPlatePosition) as string,\r\n      accessor: 'NumericalPlatePosition',\r\n      Cell: ({ row, value }) => {\r\n        if (value !== null) {\r\n          const res = CellPositionToNumber(\r\n            value,\r\n            row.original.SamplePlateTypeColumns,\r\n          );\r\n          return res;\r\n        } else {\r\n          return value;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: 'Volume (ul)',\r\n      accessor: 'Volume',\r\n    },\r\n    {\r\n      Header: 'Concentration (mg/mL)',\r\n      accessor: 'Concentration',\r\n    },\r\n    {\r\n      Header: t(translations.SampleType) as string,\r\n      accessor: 'SampleType',\r\n    },\r\n    //],\r\n    //},\r\n\r\n    /*{\r\n        Header: 'Target attributes',\r\n        columns: [*/\r\n    {\r\n      Header: 'Target Tube Label',\r\n      accessor: 'TargetTubeLabel',\r\n      Cell: React.memo(EditableCell(TextField)),\r\n    },\r\n    {\r\n      Header: 'Target Plate ID',\r\n      accessor: 'TargetPlateId',\r\n      Cell:\r\n        runType === undefined || ['MassSpec'].includes(runType)\r\n          ? 'N/A'\r\n          : React.memo(EditableCell(SamplePlatePicker)),\r\n    },\r\n    {\r\n      Header: 'Target Plate Position',\r\n      accessor: 'TargetPosition',\r\n      Cell:\r\n        runType === undefined || ['MassSpec'].includes(runType)\r\n          ? 'N/A'\r\n          : ['Fractioning'].includes(runType)\r\n          ? React.memo(EditableCell(TargetSamplePlatePositionsPicker))\r\n          : React.memo(EditableCell(TargetSamplePlatePositionPicker)),\r\n    },\r\n    {\r\n      Header: 'Target Volume (ul)',\r\n      accessor: 'TargetVolume',\r\n      Cell:\r\n        runType === undefined || ['MassSpec'].includes(runType)\r\n          ? 'N/A'\r\n          : React.memo(EditableCell(NumberField)),\r\n    },\r\n    {\r\n      Header: 'Target Concentration (mg/mL)',\r\n      accessor: 'TargetConcentration',\r\n      Cell:\r\n        runType === undefined || ['MassSpec'].includes(runType)\r\n          ? 'N/A'\r\n          : React.memo(EditableCell(NumberField)),\r\n    },\r\n    {\r\n      Header: 'Target Sample Type',\r\n      accessor: 'TargetSampleType',\r\n      Cell: React.memo(EditableCell(TextField)),\r\n    },\r\n    //],\r\n    //},\r\n  ];\r\n\r\n  const pageActions = React.useMemo(() => {\r\n    const actions: PageActionRenderer[] = [\r\n      () => <Button onClick={showCompleteDialog}>Complete</Button>,\r\n    ];\r\n    actions.push(() => (\r\n      <CreateSampleRunReservation\r\n        runDetails={runDetails}\r\n        sampleRunId={runId}\r\n        rows={samples as ISample[]}\r\n      />\r\n    ));\r\n    //if (runType !== 'MassSpec') {\r\n    actions.push(() => (\r\n      <ImportButton\r\n        onDownloadTemplateButtonClick={handleDownloadTemplateButtonClick}\r\n      />\r\n    ));\r\n    //}\r\n    actions.push(() => (\r\n      <Button onClick={handleExportButtonClick}>\r\n        {t(translations.ExportForRobot)}\r\n      </Button>\r\n    ));\r\n\r\n    return actions;\r\n  }, [\r\n    handleDownloadTemplateButtonClick,\r\n    handleExportButtonClick,\r\n    runDetails,\r\n    runId,\r\n    samples,\r\n    showCompleteDialog,\r\n    t,\r\n  ]);\r\n  const {\r\n    configurableColumns,\r\n    columnAccessors,\r\n    exportConfigurableColumns,\r\n    handleConfigurableColumns,\r\n  } = useConfigurableColumnsAdvanced(ScreensId.SampleRunsDetails, columns, [\r\n    'TargetTubeLabel',\r\n    'TargetPlateId',\r\n    'TargetPosition',\r\n    'TargetVolume',\r\n    'TargetConcentration',\r\n    'TargetSampleType',\r\n  ]);\r\n  React.useEffect(() => {\r\n    dispatch(actions.loadRunDetqails({ id: id, columns: columnAccessors }));\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, []);\r\n  const handleExport = (): Promise<void> => {\r\n    return ExportRunDetailsSamples(id, exportConfigurableColumns);\r\n  };\r\n  const handleDownloadTemplateClick = (): Promise<void> => {\r\n    const res = DownloadTemplateRunDetailsSamples(\r\n      id,\r\n      exportConfigurableColumns,\r\n    );\r\n    if (res !== undefined) {\r\n      return res;\r\n    } else\r\n      return new Promise<void>((resolve, reject) => {\r\n        resolve();\r\n      });\r\n  };\r\n  const importHandler = () => {\r\n    dispatch(requestactions.toggleImport(true));\r\n  };\r\n  return (\r\n    <>\r\n      <SamplesImportButton\r\n        onDownloadTemplateButtonClick={\r\n          IsModuleEnabled(appSettings, KnownModules.SamplesAutomation)\r\n            ? handleDownloadTemplateClick\r\n            : undefined\r\n        }\r\n        hideImportButton={true}\r\n      />\r\n      <EditableTable\r\n        screenName={\r\n          <>\r\n            {t(translations.RunDetails)} {'  '}\r\n            <InfoIcon\r\n              title={t(translations.RunDetailsPageInstructions) as string}\r\n            />\r\n            {'  #'} {id}\r\n          </>\r\n        }\r\n        columns={configurableColumns !== undefined ? configurableColumns : []}\r\n        data={runDetails?.Samples || []}\r\n        useRowSelect={true}\r\n        useGlobalFilter={true}\r\n        // fetchData={fetchData}\r\n        // skipPageReset={skipPageReset}\r\n        updateMyData={updateMyData}\r\n        pageActions={pageActions}\r\n        handleConfigurableColumns={handleConfigurableColumns}\r\n        handleExport={handleExport}\r\n        useImportLink={true}\r\n        importHandler={importHandler}\r\n        onDownloadTemplate={handleDownloadTemplateClick}\r\n        selectedRowsActions={GetSelectedActions(\r\n          t,\r\n          id,\r\n          exportConfigurableColumns,\r\n          {},\r\n        )}\r\n        subHeader={\r\n          <Box id=\"box\" marginBottom={3} paddingX={2}>\r\n            <Card>\r\n              <CardContent>\r\n                <Grid container spacing={3}>\r\n                  <Grid item xs={4}>\r\n                    <dl>\r\n                      <dt>Run Id:</dt>\r\n                      <dd>{id}</dd>\r\n                      <dt>Run Type:</dt>\r\n                      <dd>{getRunTypeValue(t, runDetails?.RunType)}</dd>\r\n                      <dt>Reservations:</dt>\r\n                      <dd>\r\n                        {(runDetails?.ReservationIds ?? []).length > 0\r\n                          ? runDetails?.ReservationIds?.map(reservationId => (\r\n                              <>\r\n                                <ReservationEditButton\r\n                                  variant=\"text\"\r\n                                  key={`reservation-details-link-${reservationId}`}\r\n                                  reservationId={reservationId}\r\n                                />\r\n                                &emsp;\r\n                              </>\r\n                            ))\r\n                          : 'N/A'}\r\n                      </dd>\r\n                    </dl>\r\n                  </Grid>\r\n                  <Grid item xs={4}>\r\n                    <dl>\r\n                      <dt>Instrument:</dt>\r\n                      <dd>{instrument}</dd>\r\n                      <dt>SecondaryInstrument:</dt>\r\n                      <dd>{secondaryInstrument}</dd>\r\n                      <dt>Gradient:</dt>\r\n                      <dd>{gradient}</dd>\r\n                      <dt>Created date:</dt>\r\n                      <dd>\r\n                        <DateTimeLabel value={createdDate as Date} />\r\n                      </dd>\r\n                      <dt>Acquision type</dt>\r\n                      <dd>{acquision_type}</dd>\r\n                    </dl>\r\n                  </Grid>\r\n                </Grid>\r\n                {/*<BasicTypography>\r\n                      {t(translations.RunDetailsPageInstructions)}\r\n                                  </BasicTypography>*/}\r\n              </CardContent>\r\n            </Card>\r\n          </Box>\r\n        }\r\n      />\r\n      <AnalyticalSampleIDSuffixPopup\r\n        show={showSuffixDialog}\r\n        onClose={() => setShowSuffixDialog(false)}\r\n        onSubmit={submitSuffixDialog}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const EmailNotificationsApi = {\r\n  deleteSelectedRows: (payload: number[]) => {\r\n    const url = `/api/odata/v4/emailnotifications/DeleteSelected`;\r\n    const data = { keys: payload };\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Column } from 'react-table';\r\nimport { IBasePageProps, IListPageProps } from '../IBasePageProps';\r\nimport { IEmailNotificationsRow } from './IEmailNotificationsRow';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport { GetSelectedActions } from './SelectedRowActions/GetSelectedRowActions';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { withSavedHistoryT } from '../../components/BasicTable/withSavedHistory';\r\nimport { withGlobalServiceGroupFilter } from 'app/components/BasicTable/withGlobalServiceGroupFilter';\r\nimport { GetFilters as getFilters } from './Filter';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { AlertContentType } from 'app/components/BasicAlert';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\n\r\nexport const NOTIFICATIONS_LOG_PAGE_PATH = '/emailnotifications';\r\ntype RowType = IEmailNotificationsRow;\r\nexport interface EmailNotificationsPageProps\r\n  extends IBasePageProps,\r\n    IListPageProps<RowType> {}\r\n\r\nfunction EmailNotifications(props: EmailNotificationsPageProps) {\r\n  const { t } = useTranslation();\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const scopeOfMonth = settings.GetString(\r\n    AllowedSettings.DeleteEmailNotficationsMonth,\r\n  );\r\n  const topMessage = {\r\n    type: 'info',\r\n    message: t(translations.EmailNotficationsScreenWarning).replace(\r\n      '{0}',\r\n      scopeOfMonth,\r\n    ),\r\n    closable: true,\r\n  } as AlertContentType;\r\n  const isMainAdmin =\r\n    user !== undefined && user.Roles.includes(Roles.Administrators);\r\n  const columns: Column<RowType>[] = React.useMemo(\r\n    () => [\r\n      {\r\n        Header: t(translations.Timestamp) as string,\r\n        accessor: 'Timestamp',\r\n        Cell: ({ value }) => <DateTimeLabel value={value as Date} />,\r\n      },\r\n      {\r\n        Header: t(translations.Recipient) as string,\r\n        accessor: 'RecipientName',\r\n        Cell: ({ value, row }) =>\r\n          row.original.Recipient !== null &&\r\n          row.original.Recipient !== undefined ? (\r\n            <>\r\n              <UserProfileLink\r\n                UserId={`${row.original.Recipient}`}\r\n                DisplayName={`${row.original.RecipientName}`}\r\n              />\r\n            </>\r\n          ) : (\r\n            <>{t(translations.NA)}</>\r\n          ),\r\n      },\r\n      {\r\n        Header: t(translations.EmailTo) as string,\r\n        accessor: 'EmailTo',\r\n      },\r\n      {\r\n        Header: t(translations.EmailCc) as string,\r\n        accessor: 'EmailCc',\r\n      },\r\n      {\r\n        Header: t(translations.EmailBcc) as string,\r\n        accessor: 'EmailBcc',\r\n      },\r\n      {\r\n        Header: t(translations.CreatedBy) as string,\r\n        accessor: 'CreatedByName',\r\n      },\r\n      {\r\n        Header: t(translations.Subject) as string,\r\n        accessor: 'Subject',\r\n      },\r\n      {\r\n        Header: t(translations.EmailMessage) as string,\r\n        accessor: 'Message',\r\n        Cell: DescriptionCell({ width: 'medium' }),\r\n      },\r\n      {\r\n        Header: t(translations.Asset) as string,\r\n        accessor: 'AssetName',\r\n        Cell: AssetRenderer,\r\n      },\r\n      {\r\n        Header: t(translations.Attachment) as string,\r\n        accessor: 'HasAttachment',\r\n      },\r\n    ],\r\n    [t],\r\n  );\r\n  // const k = keys<RowType>())\r\n  const initialState: IBasicTableState<RowType> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Timestamp', desc: true }],\r\n    }),\r\n    [],\r\n  );\r\n  const selectedRowActions: SelectedRowsActionRenderer<\r\n    IEmailNotificationsRow\r\n  >[] = isMainAdmin ? GetSelectedActions({}) : [];\r\n\r\n  const url = '/api/odata/v4/emailnotifications';\r\n  return (\r\n    <>\r\n      <TTable\r\n        screenId={ScreensId.Email}\r\n        api={url}\r\n        columns={columns}\r\n        initialState={initialState}\r\n        selectedRowsActions={selectedRowActions}\r\n        useRowSelect={isMainAdmin}\r\n        additionalColumns={[\r\n          'Id',\r\n          'Recipient',\r\n          'CreatedBy',\r\n          'NotificationTypeId',\r\n          'AssetId',\r\n          'ServiceTypeId',\r\n          'EquipmentId',\r\n          'OfflineServiceTypeId',\r\n          'InvoiceId',\r\n          'ReferenceId',\r\n          //'SubReferenceId',\r\n          'ServiceGroupId',\r\n        ]}\r\n        searchColumns={[\r\n          'AssetName',\r\n          'Recipient',\r\n          'RecipientName',\r\n          'CreatedBy',\r\n          'CreatedByName',\r\n          'Subject',\r\n          'Message',\r\n          'EmailTo',\r\n          'EmailBcc',\r\n          'EmailCc',\r\n        ]}\r\n        screenName={t(translations.menu_EmailNotifications)}\r\n        serviceGroups={props.serviceGroups}\r\n        topAlertMessage={topMessage}\r\n      />\r\n    </>\r\n  );\r\n}\r\nconst TTable = withSavedHistoryT<RowType>(\r\n  BasicTable,\r\n  '~/EmailNotifications',\r\n  getFilters,\r\n);\r\n\r\nexport const EmailNotificationsPage = withGlobalServiceGroupFilter(\r\n  EmailNotifications,\r\n  false,\r\n);\r\n","import { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IEmailNotificationsRow } from '../IEmailNotificationsRow';\r\nimport * as React from 'react';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { EmailNotificationsApi } from 'api/EmailNotificationsApi';\r\n\r\nexport interface GetSelectedActionsProps {}\r\n\r\nexport function GetSelectedActions(\r\n  props: GetSelectedActionsProps,\r\n): SelectedRowsActionRenderer<IEmailNotificationsRow>[] {\r\n  const { t } = useTranslation();\r\n  const SelectedActions: SelectedRowsActionRenderer<\r\n    IEmailNotificationsRow\r\n  >[] = React.useMemo(\r\n    () => [\r\n      (rows, onRefresh) => (\r\n        <SelectedRowsActionIconButton\r\n          icon=\"trash\"\r\n          title={t(translations.DeleteEmailNotificationsRows_info)}\r\n          text={t(translations.DeleteRows)}\r\n          confirm={true}\r\n          confirmTitle={t(translations.ConfirmDeleteEmailNotif_title)}\r\n          confirmBody={\r\n            <Body bold={true}>\r\n              {t(translations.ConfirmDeleteEmailNotif_message)}\r\n            </Body>\r\n          }\r\n          confirmButtonLabel={t(translations.OK)}\r\n          cancelButtonLabel={t(translations.Cancel)}\r\n          rows={rows}\r\n          onRefresh={onRefresh}\r\n          variantButton=\"button\"\r\n          validConfirm={true}\r\n          action={() =>\r\n            new Promise<IResponseType>((resolve, reject) => {\r\n              const postData = rows.map(item => item.Id);\r\n              // do some work on the selected rows\r\n\r\n              return EmailNotificationsApi.deleteSelectedRows(postData)\r\n                .then(response => {\r\n                  let success = t(\r\n                    translations.DeleteNotifications_success,\r\n                  ) as string;\r\n                  resolve({\r\n                    SuccessMessages: [success],\r\n                    ErrorMessages: [],\r\n                    WarningMessages: [],\r\n                  } as IResponseType);\r\n                })\r\n                .catch(error => {\r\n                  let err = t(translations.DeleteNotifications_error) as string;\r\n                  reject(err);\r\n                });\r\n            })\r\n          }\r\n        />\r\n      ),\r\n    ],\r\n    [t],\r\n  );\r\n  return SelectedActions;\r\n}\r\n","import { makeStyles } from '@material-ui/core/styles';\r\n\r\nexport const styles = makeStyles(theme => ({\r\n  /* Styles applied to the root element. */\r\n  root: {\r\n    position: 'relative',\r\n    height: 32,\r\n    backgroundColor: theme.palette.common.white,\r\n    border: `1px solid ${theme.palette.common.grayBorders}`,\r\n    gap: 4,\r\n    borderRadius: 8,\r\n    '&.inputSizeSmall': {\r\n      gap: 0,\r\n      paddingRight: 8,\r\n    },\r\n    'label + &': {\r\n      marginTop: '21px',\r\n    },\r\n    '&:hover': {\r\n      backgroundColor: 'rgba(255, 255, 255, 0.80)',\r\n      // Reset on touch devices, it doesn't add specificity\r\n      '@media (hover: none)': {\r\n        backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n      },\r\n    },\r\n    '&$focused': {\r\n      backgroundColor: 'rgba(255, 255, 255, 0.90)',\r\n    },\r\n    '&$disabled': {\r\n      backgroundColor: theme.palette.common.backgroundHover,\r\n    },\r\n  },\r\n  /* Styles applied to the root element if the component is a descendant of `FormControl`. */\r\n  formControl: {\r\n    'label + &': {\r\n      marginTop: '21px',\r\n    },\r\n  },\r\n  /* Styles applied to the root element if the component is focused. */\r\n  focused: {\r\n    border: `1px solid ${theme.palette.primary.textHover}`,\r\n  },\r\n  /* Styles applied to the root element if `disabled={true}`. */\r\n  disabled: {\r\n    backgroundColor: theme.palette.common.backgroundHover,\r\n  },\r\n  /* Styles applied to the root element if color secondary. */\r\n  colorSecondary: {\r\n    '&$underline:after': {\r\n      borderBottomColor: theme.palette.secondary.main,\r\n    },\r\n  },\r\n  /* Styles applied to the root element if `disableUnderline={false}`. */\r\n  underline: {\r\n    // '&:after': {\r\n    //   borderBottom: `2px solid ${theme.palette.primary.main}`,\r\n    //   left: 0,\r\n    //   bottom: 0,\r\n    //   // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n    //   content: '\"\"',\r\n    //   position: 'absolute',\r\n    //   right: 0,\r\n    //   transform: 'scaleX(0)',\r\n    //   transition: theme.transitions.create('transform', {\r\n    //     duration: theme.transitions.duration.shorter,\r\n    //     easing: theme.transitions.easing.easeOut,\r\n    //   }),\r\n    //   pointerEvents: 'none', // Transparent to the hover style.\r\n    // },\r\n    // '&$focused:after': {\r\n    //   transform: 'scaleX(1)',\r\n    // },\r\n    // '&$error:after': {\r\n    //   borderBottomColor: theme.palette.error.main,\r\n    //   transform: 'scaleX(1)', // error is always underlined in red\r\n    // },\r\n    // '&:before': {\r\n    //   borderBottom: `1px solid ${theme.palette.primary.textHover}`,\r\n    //   left: 0,\r\n    //   bottom: 0,\r\n    //   // Doing the other way around crash on IE 11 \"''\" https://github.com/cssinjs/jss/issues/242\r\n    //   content: '\"\\\\00a0\"',\r\n    //   position: 'absolute',\r\n    //   right: 0,\r\n    //   transition: theme.transitions.create('border-bottom-color', {\r\n    //     duration: theme.transitions.duration.shorter,\r\n    //   }),\r\n    //   pointerEvents: 'none', // Transparent to the hover style.\r\n    // },\r\n    // '&:hover:not($disabled):before': {\r\n    //   borderBottom: `2px solid ${theme.palette.text.primary}`,\r\n    //   // Reset on touch devices, it doesn't add specificity\r\n    //   '@media (hover: none)': {\r\n    //     borderBottom: `1px solid ${theme.palette.primary.textHover}`,\r\n    //   },\r\n    // },\r\n    // '&$disabled:before': {\r\n    //   borderBottomStyle: 'dotted',\r\n    // },\r\n  },\r\n  /* Pseudo-class applied to the root element if `error={true}`. */\r\n  error: {\r\n    border: `1px solid ${theme.palette.error.main}`,\r\n  },\r\n  /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n  marginDense: {\r\n    borderRadius: 8,\r\n    height: 24,\r\n  },\r\n  /* Styles applied to the root element if `multiline={true}`. */\r\n  multiline: {\r\n    padding: '6px 12px',\r\n    '&$marginDense': {\r\n      paddingTop: 1,\r\n      paddingBottom: 1,\r\n    },\r\n  },\r\n  /* Styles applied to the root element if `fullWidth={true}`. */\r\n  fullWidth: {},\r\n  /* Styles applied to the `input` element. */\r\n  input: {\r\n    minWidth: theme.spacing(6),\r\n    padding: '6px 12px',\r\n    borderRadius: 8,\r\n    '&:-webkit-autofill': {\r\n      WebkitBoxShadow:\r\n        theme.palette.type === 'light' ? null : '0 0 0 100px #266798 inset',\r\n      WebkitTextFillColor: theme.palette.type === 'light' ? null : '#fff',\r\n      caretColor: theme.palette.type === 'light' ? null : '#fff',\r\n    },\r\n    '&&.inputSizeSmall &': {\r\n      padding: '6px 8px',\r\n    },\r\n  },\r\n  /* Styles applied to the `input` element if `margin=\"dense\"`. */\r\n  inputMarginDense: {\r\n    paddingTop: 1,\r\n    paddingBottom: 1,\r\n  },\r\n  /* Styles applied to the `input` element if `multiline={true}`. */\r\n  inputMultiline: {\r\n    padding: 0,\r\n  },\r\n  /* Styles applied to the `input` element if `type=\"search\"`. */\r\n  inputTypeSearch: {},\r\n  // inputAdornedEnd: {\r\n  //   padding: '6px 8px',\r\n  // },\r\n}));\r\n","import {\r\n  Input,\r\n  InputBaseProps,\r\n  InputClassKey,\r\n  StandardProps,\r\n} from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { styles } from './styles';\r\n\r\nexport interface StandardInputProps\r\n  extends StandardProps<InputBaseProps, InputClassKey> {\r\n  disableUnderline?: boolean;\r\n  className?: string;\r\n  fullWidth?: boolean;\r\n  multiline?: boolean;\r\n  noBorder?: boolean;\r\n  info?: string;\r\n}\r\n// export function StandardInput(\r\n//   {\r\n//     classes,\r\n//     className,\r\n//     fullWidth,\r\n//     inputComponent,\r\n//     multiline,\r\n//     noBorder,\r\n//     type,\r\n//     ...rest\r\n//   }: StandardInputProps,\r\n//   ref: React.Ref<unknown>,\r\n// ) {\r\n//   const innerClasses = styles();\r\n//   fullWidth = false;\r\n//   inputComponent = 'input';\r\n//   multiline = false;\r\n//   noBorder = false;\r\n//   type = 'text';\r\n\r\n//   return (\r\n//     <InputBase\r\n//       classes={{\r\n//         ...classes,\r\n//         root: clsx(innerClasses.root, {\r\n//           [innerClasses.inputBorder]: !noBorder,\r\n//         }),\r\n//       }}\r\n//       fullWidth={fullWidth}\r\n//       inputComponent={inputComponent}\r\n//       className={className}\r\n//       multiline={multiline}\r\n//       ref={ref}\r\n//       type={type}\r\n//       {...rest}\r\n//     />\r\n//   );\r\n// }\r\nexport const StandardInput = React.forwardRef<\r\n  React.HTMLAttributes<HTMLDivElement>,\r\n  StandardInputProps\r\n>(function StandardInput(props, ref) {\r\n  const {\r\n    disableUnderline = true,\r\n    classes = styles(),\r\n    className,\r\n    fullWidth = false,\r\n    inputComponent = 'input',\r\n    multiline = false,\r\n    type = 'text',\r\n    ...rest\r\n  } = props;\r\n  return (\r\n    <Input\r\n      classes={{\r\n        ...classes,\r\n        root: clsx(classes.root, !disableUnderline && classes.underline),\r\n        underline: undefined,\r\n      }}\r\n      fullWidth={fullWidth}\r\n      inputComponent={inputComponent}\r\n      className={className}\r\n      multiline={multiline}\r\n      disableUnderline={disableUnderline}\r\n      ref={ref}\r\n      type={type}\r\n      {...rest}\r\n    />\r\n  );\r\n});\r\nexport default StandardInput;\r\n","import * as React from 'react';\r\nimport { IBasePageProps } from '../../pages/IBasePageProps';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\n\r\n/**\r\n * Connects the saved selected global service groups filter with the <IBasePageProps> element:\r\n * 1. Sets the state to show/hide the top service groups filter UI element\r\n * 2. Connects the saved selection to the prop of the wrapped element\r\n * example: export const FooPage = withGlobalServiceGroupFilter(FooPageComponent, true)\r\n * @param Component Page component that extends the IBasePageProps params interface\r\n * @param applyGlobalServiceGroupsFilter enable/disable the global service groups filter on a page\r\n * @returns component that can be passed to the router\r\n */\r\nexport function withGlobalServiceGroupFilter<P extends object>(\r\n  Component: React.ComponentType<P>,\r\n  applyGlobalServiceGroupsFilter: boolean,\r\n): React.FC<P & IBasePageProps> {\r\n  return ({ ...props }: IBasePageProps) => {\r\n    const { serviceGroups } = useGlobalServiceGroupsFilter(\r\n      applyGlobalServiceGroupsFilter,\r\n    );\r\n\r\n    if (serviceGroups === undefined && applyGlobalServiceGroupsFilter) {\r\n      return <></>;\r\n    }\r\n    return <Component serviceGroups={serviceGroups} {...(props as P)} />;\r\n  };\r\n}\r\n","/**\r\n *\r\n * UserGroupFilter\r\n *\r\n */\r\nimport { UserGroupPicker } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const UserGroupFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<string> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <UserGroupPicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      size=\"small\"\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default UserGroupFilter;\r\n","import { IconProp } from 'app/AllIcons';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectSiteMapProvider,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AssetsSubTabUnionArray, MainTabsUnion } from 'types/SiteMapSettings';\r\nimport * as React from 'react';\r\nimport {\r\n  RowActionsMenu,\r\n  RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface AdminActionsProps {\r\n  menuTab: MainTabsUnion;\r\n  icon?: IconProp;\r\n  id?: string;\r\n  title?: string;\r\n  action?: RowActionsProps;\r\n  subTab?: any;\r\n}\r\nexport function AdminActions(props: AdminActionsProps) {\r\n  const { menuTab, icon, id, title, action, subTab } = props;\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const siteMapProvider = useSelector(selectSiteMapProvider);\r\n  const admin =\r\n    authenticatedUser !== undefined &&\r\n    (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n      authenticatedUser.Roles.includes(Roles.GroupAdministrators) ||\r\n      authenticatedUser.Roles.includes(Roles.CustomRole));\r\n  // const handleSettingClick = React.useCallback(\r\n  //   (link: string) => {\r\n  //     dispatch(\r\n  //       actions.openAdminPanel({\r\n  //         url: link,\r\n  //       }),\r\n  //     );\r\n  //   },\r\n  //   [actions, dispatch],\r\n  // );\r\n  const adminSettings = React.useMemo(() => {\r\n    let actions: RowActionsProps[] = [];\r\n    if (admin) {\r\n      if (menuTab === 'Assets' && !subTab) {\r\n        AssetsSubTabUnionArray.forEach(ar => {\r\n          actions = [\r\n            ...actions,\r\n            ...siteMapProvider.adminSettingsActions(\r\n              menuTab,\r\n              authenticatedUser,\r\n              ar,\r\n              undefined, // handleSettingClick,\r\n            ),\r\n          ];\r\n        });\r\n      } else {\r\n        if (menuTab === 'Budgets' && !subTab) {\r\n          return siteMapProvider.adminSettingsActions(\r\n            menuTab,\r\n            authenticatedUser,\r\n            'BudgetTabSetting',\r\n            undefined, // handleSettingClick,\r\n          );\r\n        }\r\n        return siteMapProvider.adminSettingsActions(\r\n          menuTab,\r\n          authenticatedUser,\r\n          subTab,\r\n          undefined, // handleSettingClick,\r\n        );\r\n      }\r\n    }\r\n    if (!!action) {\r\n      actions.push(action);\r\n    }\r\n    return actions;\r\n  }, [admin, action, menuTab, subTab, siteMapProvider, authenticatedUser]);\r\n\r\n  return adminSettings.length > 0 ? (\r\n    <RowActionsMenu\r\n      id={id ?? `myAssets_settings`}\r\n      variant=\"textGray\"\r\n      items={adminSettings}\r\n      tooltip={title ?? t(translations.AssetsRelatedSetting)}\r\n      icon={icon ?? 'cog'}\r\n    />\r\n  ) : null;\r\n}\r\n","/**\r\n *\r\n * ButtonLink\r\n *\r\n */\r\nimport React from 'react';\r\nimport { Link, styled } from '@material-ui/core';\r\n\r\nexport interface ButtonLinkProps {\r\n  children: React.ReactNode;\r\n  onClick?: React.MouseEventHandler<HTMLAnchorElement> &\r\n    React.MouseEventHandler<HTMLSpanElement> &\r\n    React.MouseEventHandler<HTMLButtonElement>;\r\n  className?: string;\r\n  id?: string;\r\n  href?: string;\r\n  color?:\r\n    | 'inherit'\r\n    | 'initial'\r\n    | 'primary'\r\n    | 'secondary'\r\n    | 'textPrimary'\r\n    | 'textSecondary'\r\n    | 'error';\r\n}\r\n\r\n/**\r\n * Button styles as a Link\r\n * @param param0\r\n * @returns\r\n */\r\nexport default function ButtonLink(props: ButtonLinkProps) {\r\n  return (\r\n    <StyledLink\r\n      color={props.color}\r\n      href={props.href !== undefined ? props.href : '#'}\r\n      id={props.id}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nconst StyledLink = styled(Link)(({ theme }) => ({\r\n  cursor: 'pointer',\r\n}));\r\n","/**\r\n *\r\n * AssetCatGroupFilter\r\n *\r\n */\r\nimport { AssetCatGroupPicker } from 'app/components/pickers/AutocompletePickers/AssetCatGroupPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { IAssetCatGroupDto } from 'api/odata/generated/entities/IAssetCatGroupDto';\r\n\r\nexport const AssetCatGroupFilter = (props: IFilterComponentProps) => {\r\n  const { t } = useTranslation();\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  if (props.readonly === true) {\r\n    return <>{props.value?.Name}</>;\r\n  }\r\n  return (\r\n    <AssetCatGroupPicker\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      value={props.value as IAssetCatGroupDto}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      predicates={props.predicates}\r\n      size=\"small\"\r\n      onPickerOpen={props.onOpen}\r\n      noGlobalServiceGroupFilter={props.withoutServiceGroups ?? false}\r\n      urlType={props.urlType}\r\n    />\r\n  );\r\n};\r\n\r\nexport default AssetCatGroupFilter;\r\n","/**\r\n *\r\n * CampusPickerFilter\r\n *\r\n */\r\nimport { InstitutePicker } from 'app/components/pickers/AutocompletePickers/InstitutePicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const InstituteFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <InstitutePicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default InstituteFilter;\r\n","export interface IResponseType {\r\n  SuccessMessages: string[];\r\n  ErrorMessages: string[];\r\n  WarningMessages: string[];\r\n}\r\nexport interface IResponseTypeWithId extends IResponseType {\r\n  Id?: number;\r\n}\r\nexport interface IResponseTypeWithLink extends IResponseTypeWithId {\r\n  link?: string;\r\n}\r\n\r\nexport const GetResponseMessages = (\r\n  response,\r\n  infoText: string,\r\n): IResponseType => {\r\n  let messages: IResponseType = {\r\n    SuccessMessages: [],\r\n    ErrorMessages: [],\r\n    WarningMessages: [],\r\n  };\r\n  if (typeof response.value === 'string') {\r\n    if ((response.value = 'Ok')) {\r\n      messages.SuccessMessages.push(infoText);\r\n    } else {\r\n      messages.ErrorMessages.push(infoText + ': ' + response.value);\r\n    }\r\n  } else {\r\n    if (response.SuccessMessages && response.SuccessMessages.length > 0) {\r\n      response.SuccessMessages.forEach(element => {\r\n        messages.SuccessMessages.push(element);\r\n      });\r\n    }\r\n    if (response.ErrorMessages && response.ErrorMessages.length > 0) {\r\n      response.ErrorMessages.forEach(element => {\r\n        messages.ErrorMessages.push(element);\r\n      });\r\n    }\r\n    if (response.WarningMessages && response.WarningMessages.length > 0) {\r\n      response.WarningMessages.forEach(element => {\r\n        messages.WarningMessages.push(element);\r\n      });\r\n    }\r\n    if (\r\n      messages.SuccessMessages.length === 0 &&\r\n      response.ErrorMessages.length === 0 &&\r\n      response.WarningMessages.length === 0\r\n    ) {\r\n      messages.SuccessMessages = [infoText];\r\n    }\r\n  }\r\n  return messages;\r\n};\r\n","/**\r\n *\r\n * AssetCatFilter\r\n *\r\n */\r\nimport { AssetCatPicker } from 'app/components/pickers/AutocompletePickers/AssetCatPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const AssetCatFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      <AssetCatPicker\r\n        ariaLabel={props.label}\r\n        id={props.id}\r\n        value={props.value}\r\n        onChange={handleOnChange}\r\n        isOpen={props.open}\r\n        placeholder={t(translations.AllValues)}\r\n        predicates={props.predicates}\r\n        onPickerOpen={props.onOpen}\r\n        size=\"small\"\r\n        urlType={props.urlType}\r\n      />\r\n    </>\r\n  );\r\n};\r\nexport default AssetCatFilter;\r\n","/**\r\n *\r\n * ServiceGroupFilter\r\n *\r\n */\r\n\r\nimport { ServiceGroupPicker } from 'app/components/pickers/ServiceGroupPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsAuthenticated } from 'app/slice/selectors';\r\n\r\nexport const ServiceGroupFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  return (\r\n    <ServiceGroupPicker\r\n      onChange={handleOnChange}\r\n      urlType={isAuth === true ? 'base' : 'public'}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      size=\"small\"\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\nexport default ServiceGroupFilter;\r\n","/**\r\n *\r\n * DepartmentFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DepartmentPicker } from 'app/components/pickers/AutocompletePickers/DepartmentPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const DepartmentFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <DepartmentPicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default DepartmentFilter;\r\n","/**\r\n *\r\n * AssetCatPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ProjectPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ProjectFilter';\r\nexport const initProjectData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function ProjectPicker(props: ProjectPickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'projectId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetPickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { BudgetPicker } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\n\r\nexport const ProjectFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <BudgetPicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllBudgets)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      allActiveBudgets={true}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\nexport default ProjectFilter;\r\n","/**\r\n *\r\n * UserDisciplinePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface UserDisciplinePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/DisciplineFilter';\r\nconst publicUrl = '/api/odata/v4/DisciplineFilter/PublicDisciplines';\r\nexport const initUserDisciplineData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function UserDisciplinePicker(props: UserDisciplinePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'userdisciplineId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nconst loadPublicData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(publicUrl, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function UserDisciplinePublicPicker(props: UserDisciplinePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadPublicData}\r\n      id={props.id || 'userdisciplineId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * ServiceTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { IApplyGlobalServiceGroupFilter } from 'types/IApplyGlobalServiceGroupFilter';\r\nimport { IServiceGroupRelated } from 'types/IServiceGroupRelated';\r\n\r\ninterface IServiceDto extends Entity<number>, IServiceGroupRelated {}\r\n\r\nexport interface ServiceTypePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'>,\r\n    IApplyGlobalServiceGroupFilter {}\r\n\r\nconst url = '/api/odata/v4/ServiceTypeFilter';\r\n\r\nexport function withServiceGroupFilter(\r\n  globalServiceGroupFilter: Entity<number>[],\r\n) {\r\n  return (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n    };\r\n\r\n    params.$filter = new ODataFilterBuilder<IServiceDto>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm === null ? undefined : searchTerm,\r\n      globalServiceGroupFilter:\r\n        !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n          ? [\r\n              new Condition<IServiceDto>(\r\n                'ServiceGroupId',\r\n                ODataOperators.Includes,\r\n                globalServiceGroupFilter.map(f => f.Id),\r\n              ),\r\n            ]\r\n          : [],\r\n    }).toString();\r\n\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  };\r\n}\r\nexport const initServiceTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,ServiceGroupId',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport function ServiceTypePicker(props: ServiceTypePickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const loadData = withServiceGroupFilter(globalServiceGroupFilter || []);\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'servicetypepickerId'}\r\n      additionalItem={props.additionalItem}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * BookitlabLogo\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { messages } from './messages';\r\n\r\nexport interface BookitlabLogoProps {\r\n  width?: number | string;\r\n  height?: number | string;\r\n  vectorSmallOverlapColor?: string;\r\n  vaectorBigCircleColor?: string;\r\n  vectorSmallCircleColor?: string;\r\n  vectorBigOverlapColor?: string;\r\n  vectorBackColor?: string;\r\n  size?: '123x34' | '80x24';\r\n}\r\n\r\nexport const BookitlabLogo = React.memo(function BookitlabLogo(\r\n  props: BookitlabLogoProps,\r\n) {\r\n  const { width, height, size } = props;\r\n  const { t } = useTranslation();\r\n\r\n  return size === '80x24' ? (\r\n    <svg\r\n      width={width || '80'}\r\n      height={height || '24'}\r\n      viewBox={`0 0 ${width || '80'} ${height || '24'}`}\r\n      fill=\"none\"\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n    >\r\n      <title>{t(messages.bookitlab())}</title>\r\n      <path\r\n        d=\"M11.2799 13.3902C11.2799 16.5531 9.21565 18.856 6.50371 18.856C5.95745 18.8692 5.41555 18.748 4.91864 18.5015C4.42174 18.255 3.98274 17.8896 3.63459 17.4328V18.5899H0.975586V4.14782H3.72228V9.20865C4.07547 8.79246 4.50599 8.46231 4.98543 8.23987C5.46487 8.01743 5.98235 7.90784 6.50371 7.91825C9.21565 7.92436 11.2799 10.2589 11.2799 13.3902ZM8.48069 13.3714C8.49461 13.0174 8.4418 12.664 8.32544 12.3329C8.20908 12.0019 8.03165 11.7 7.80401 11.446C7.57637 11.1919 7.30333 10.9909 7.0016 10.8553C6.69981 10.7197 6.37576 10.6523 6.04918 10.6573C5.72202 10.6532 5.3975 10.721 5.09518 10.8567C4.79286 10.9925 4.519 11.1931 4.29012 11.4468C4.06124 11.7004 3.88208 12.0016 3.76345 12.3324C3.64482 12.6632 3.58917 13.0166 3.59986 13.3714C3.59986 14.8897 4.59704 16.1231 6.04918 16.1231C7.50085 16.1231 8.48069 14.8892 8.48069 13.3714ZM36.5012 14.2855L35.9586 14.8355V18.5937H33.2128V4.15064H35.9595V11.5144L39.1785 8.1933H42.5725L38.3736 12.4252L42.852 18.5932H39.5284L36.5012 14.2855ZM42.8577 5.36569C42.8547 5.1314 42.8955 4.89887 42.9773 4.68202C43.0591 4.46517 43.1804 4.26845 43.3339 4.10362C43.4874 3.93879 43.67 3.80925 43.8707 3.72273C44.0715 3.63622 44.2862 3.59451 44.5022 3.60011C44.7168 3.59622 44.9299 3.63921 45.1289 3.72651C45.3279 3.81381 45.5087 3.94364 45.6605 4.10828C45.8123 4.27291 45.932 4.46899 46.0125 4.68484C46.093 4.9007 46.1327 5.13192 46.1292 5.36475C46.134 5.59797 46.0953 5.82984 46.0151 6.04635C45.9351 6.26286 45.8154 6.45952 45.6634 6.62448C45.5113 6.78944 45.33 6.91926 45.1304 7.00612C44.9308 7.09298 44.7171 7.13508 44.5022 7.12987C44.2858 7.1372 44.0704 7.0967 43.869 7.01084C43.6676 6.92497 43.4843 6.79553 43.3305 6.6304C43.1766 6.46528 43.0554 6.26791 42.9741 6.05032C42.8929 5.83274 42.8532 5.59948 42.8577 5.36475V5.36569ZM43.1025 18.5932V8.1933H45.8523V18.5932H43.1025ZM53.9435 4.15064H56.6901V18.5932H53.9435V4.15064ZM67.892 8.1933V18.5932H65.3031V17.5308C64.9203 17.9597 64.4604 18.2989 63.9518 18.5274C63.4434 18.7558 62.8971 18.8686 62.3468 18.8589C59.5823 18.8589 57.6231 16.4297 57.6231 13.3365C57.6231 10.2429 59.6348 7.92768 62.3463 7.92768C62.8993 7.92189 63.4475 8.04026 63.9562 8.27538C64.465 8.51051 64.9234 8.85724 65.3027 9.29386V8.1933H67.892ZM65.3031 13.3742C65.3102 13.0164 65.251 12.6607 65.129 12.3281C65.0071 11.9956 64.825 11.6929 64.5933 11.4381C64.3616 11.1833 64.0852 10.9815 63.7804 10.8446C63.4756 10.7078 63.1485 10.6386 62.8186 10.6412C62.4906 10.6394 62.1656 10.7094 61.8631 10.8471C61.5606 10.9847 61.2868 11.1873 61.0581 11.4424C60.8294 11.6976 60.6506 12.0002 60.5323 12.3322C60.4141 12.6641 60.3587 13.0185 60.3697 13.3742C60.3568 13.7322 60.4105 14.0894 60.5276 14.4245C60.6448 14.7595 60.823 15.0654 61.0516 15.3241C61.2801 15.5828 61.5544 15.7887 61.8581 15.9298C62.1617 16.071 62.4884 16.1442 62.8186 16.1452C63.151 16.145 63.4799 16.0724 63.786 15.9319C64.092 15.7914 64.369 15.5858 64.6006 15.3272C64.8322 15.0687 65.0137 14.7623 65.1343 14.4264C65.255 14.0905 65.3124 13.7318 65.3031 13.3714V13.3742ZM79.6748 13.3902C79.6748 16.5531 77.6104 18.856 74.8988 18.856C74.3525 18.8693 73.8107 18.7481 73.3138 18.5016C72.8169 18.2551 72.3779 17.8897 72.0292 17.4328V18.5899H69.3704V4.14782H72.117V9.20865C72.4702 8.79239 72.9008 8.46218 73.3808 8.23974C73.8601 8.0173 74.3779 7.90771 74.8988 7.91825C77.6045 7.92436 79.6748 10.2589 79.6748 13.3902ZM76.8754 13.3714C76.8897 13.0174 76.8364 12.664 76.72 12.3329C76.6042 12.0019 76.4266 11.7 76.199 11.446C75.9714 11.1919 75.6982 10.9909 75.3964 10.8553C75.0946 10.7197 74.7707 10.6523 74.4442 10.6573C74.1171 10.6532 73.7925 10.721 73.4901 10.8567C73.1876 10.9925 72.9138 11.1931 72.6849 11.4468C72.4559 11.7004 72.277 12.0016 72.158 12.3324C72.0396 12.6632 71.9837 13.0166 71.9948 13.3714C71.9948 14.8897 72.9918 16.1231 74.4442 16.1231C75.8959 16.1231 76.8702 14.8892 76.8702 13.3714H76.8754Z\"\r\n        fill=\"#1565C0\"\r\n      />\r\n      <path\r\n        d=\"M21.0009 9.29747C20.5059 8.75945 19.9178 8.33278 19.2704 8.04179C18.6231 7.75087 17.9291 7.60147 17.2283 7.60205C16.5275 7.60134 15.8334 7.75067 15.1859 8.04166C14.5383 8.33259 13.9501 8.75932 13.455 9.29747C12.959 9.83457 12.5656 10.4726 12.2974 11.175C12.0293 11.8774 11.8915 12.6303 11.8922 13.3905C11.8915 14.1507 12.0293 14.9036 12.2974 15.606C12.5656 16.3084 12.959 16.9464 13.455 17.4835C13.95 18.0216 14.5382 18.4484 15.1857 18.7393C15.8331 19.0302 16.5271 19.1796 17.228 19.179C17.9288 19.1796 18.6228 19.0302 19.2702 18.7393C19.9177 18.4484 20.5058 18.0216 21.0009 17.4835C21.4969 16.9464 21.8903 16.3084 22.1585 15.606C22.4267 14.9036 22.5644 14.1507 22.5638 13.3905C22.5644 12.6303 22.4267 11.8774 22.1585 11.175C21.8903 10.4726 21.4969 9.83457 21.0009 9.29747ZM19.059 15.3769C18.819 15.6385 18.5336 15.8458 18.2194 15.9869C17.9051 16.128 17.5681 16.2002 17.228 16.1993C16.8878 16.2002 16.5508 16.128 16.2365 15.9869C15.9222 15.8458 15.6368 15.6385 15.3968 15.3769C15.1558 15.1166 14.9647 14.807 14.8345 14.4661C14.7044 14.125 14.6379 13.7595 14.6388 13.3905C14.6379 13.0215 14.7044 12.6559 14.8345 12.315C14.9647 11.974 15.1558 11.6644 15.3968 11.404C15.6368 11.1425 15.9222 10.9352 16.2365 10.7941C16.5508 10.6529 16.8878 10.5808 17.228 10.5818C17.5681 10.5808 17.9051 10.6529 18.2194 10.7941C18.5336 10.9352 18.819 11.1425 19.059 11.404C19.3002 11.6644 19.4912 11.974 19.6213 12.315C19.7514 12.6559 19.8179 13.0215 19.817 13.3905C19.8179 13.7595 19.7514 14.125 19.6213 14.4661C19.4912 14.807 19.3002 15.1166 19.059 15.3769Z\"\r\n        fill=\"#5EE01A\"\r\n      />\r\n      <path\r\n        d=\"M18.6011 13.3903C18.6002 12.6769 18.7226 11.97 18.9632 11.3059C18.4846 10.8346 17.8599 10.576 17.2136 10.5816C16.8661 10.5808 16.5221 10.656 16.2021 10.803C15.9611 11.6405 15.8391 12.513 15.84 13.3903C15.8389 14.2677 15.9608 15.1402 16.2017 15.9778C16.5217 16.1247 16.8657 16.2 17.2132 16.1991C17.8596 16.2051 18.4843 15.9464 18.9627 15.4748C18.7226 14.8108 18.5996 14.1037 18.6011 13.3903Z\"\r\n        fill=\"#3BBCF6\"\r\n      />\r\n      <path\r\n        d=\"M30.0199 7.31923C29.2252 6.53339 28.2817 5.91036 27.2433 5.48583C26.205 5.0613 25.0922 4.84361 23.9687 4.84523C22.7578 4.84304 21.5604 5.09557 20.4556 5.58609C19.3509 6.07659 18.3642 6.79387 17.561 7.69038C18.6416 7.81661 19.6632 8.24591 20.5054 8.9276C21.4916 8.16 22.7106 7.74373 23.9654 7.74609C25.4546 7.74373 26.8833 8.32902 27.935 9.37287C28.4573 9.88795 28.8714 10.5001 29.1536 11.1742C29.4357 11.8483 29.5803 12.5709 29.5792 13.3005C29.5815 14.7739 28.99 16.1875 27.935 17.2281C27.4144 17.7448 26.7956 18.1544 26.1144 18.4335C25.4331 18.7127 24.7028 18.8557 23.9654 18.8544C22.7106 18.8569 21.4917 18.4408 20.5054 17.6734C19.6632 18.3549 18.6415 18.784 17.561 18.9101C18.3638 19.8065 19.3498 20.5237 20.454 21.0142C21.5581 21.5048 22.7551 21.7576 23.9654 21.7558C25.0895 21.7577 26.2029 21.5401 27.2417 21.1155C28.2806 20.6908 29.2245 20.0673 30.0193 19.2809C30.8141 18.4944 31.4441 17.5604 31.8734 16.5326C32.3025 15.5046 32.5224 14.403 32.5203 13.2908C32.5197 11.0511 31.6203 8.90318 30.0199 7.31923Z\"\r\n        fill=\"#3BBCF6\"\r\n      />\r\n      <path\r\n        d=\"M20.1261 17.4108C20.2763 17.5737 20.4348 17.7263 20.6015 17.869C19.8158 18.5662 18.8629 19.0053 17.8548 19.1345C17.1057 18.2185 16.5443 17.1404 16.2077 15.9716C16.5277 16.1186 16.8718 16.1938 17.2192 16.1929C17.8657 16.1989 18.4904 15.9402 18.9687 15.4686C19.228 16.195 19.6219 16.8561 20.1261 17.4108ZM18.9601 11.3092C19.3012 10.3668 19.8678 9.54015 20.6015 8.91439C19.8158 8.21735 18.8628 7.77845 17.8548 7.64941C17.1057 8.56545 16.5443 9.6435 16.2077 10.8123C16.5277 10.6654 16.8718 10.5901 17.2192 10.5909C17.8618 10.5863 18.4825 10.842 18.9601 11.3092Z\"\r\n        fill=\"#49AF13\"\r\n      />\r\n      <path\r\n        d=\"M52.2228 15.5004L51.9952 15.6332C51.5182 15.9443 50.9768 16.1205 50.4207 16.1456C49.5633 16.1456 49.1435 15.5762 49.1435 14.3804V10.6609H52.2228V8.19313H49.1435V4.51221L46.4064 5.85582V14.6654C46.4064 17.4553 47.5724 18.8597 49.8264 18.8597C50.6512 18.855 51.4661 18.6699 52.2228 18.3153V15.5004Z\"\r\n        fill=\"#1565C0\"\r\n      />\r\n    </svg>\r\n  ) : (\r\n    <svg\r\n      width={width || '123'}\r\n      height={height || '34'}\r\n      viewBox={`0 0 ${width || '123'} ${height || '34'}`}\r\n      fill=\"none\"\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n    >\r\n      <title>{t(messages.bookitlab())}</title>\r\n      <path\r\n        d=\"M17.3429 19.138C17.3429 24.001 14.1691 27.5417 9.99949 27.5417C9.15962 27.562 8.32644 27.3756 7.56245 26.9967C6.79846 26.6177 6.1235 26.0559 5.58822 25.3536V27.1326H1.5V4.92787H5.72304V12.7089C6.26607 12.069 6.92799 11.5614 7.66514 11.2194C8.40228 10.8774 9.1979 10.7089 9.99949 10.7249C14.1691 10.7343 17.3429 14.3236 17.3429 19.138ZM13.0391 19.1091C13.0605 18.5648 12.9793 18.0215 12.8004 17.5125C12.6215 17.0035 12.3487 16.5394 11.9987 16.1488C11.6487 15.7581 11.2289 15.4491 10.765 15.2406C10.301 15.0321 9.80277 14.9285 9.30065 14.9362C8.79765 14.9299 8.2987 15.0342 7.83388 15.2428C7.36906 15.4515 6.948 15.76 6.5961 16.15C6.24419 16.5399 5.96874 17.0031 5.78634 17.5117C5.60394 18.0203 5.51838 18.5636 5.53482 19.1091C5.53482 21.4435 7.06798 23.3399 9.30065 23.3399C11.5326 23.3399 13.0391 21.4428 13.0391 19.1091ZM55.1207 20.5145L54.2864 21.3602V27.1384H50.0647V4.93221H54.2877V16.254L59.237 11.1478H64.4552L57.9995 17.6544L64.885 27.1377H59.7749L55.1207 20.5145ZM64.8937 6.80035C64.8892 6.44012 64.9518 6.08261 65.0776 5.7492C65.2034 5.41579 65.3899 5.11333 65.6259 4.85991C65.8619 4.60649 66.1426 4.40731 66.4513 4.2743C66.7599 4.14128 67.0901 4.07715 67.4221 4.08576C67.7521 4.07978 68.0798 4.14588 68.3857 4.2801C68.6917 4.41433 68.9696 4.61394 69.203 4.86707C69.4364 5.1202 69.6205 5.42167 69.7443 5.75354C69.8681 6.08542 69.9291 6.44092 69.9237 6.7989C69.9311 7.15748 69.8715 7.51397 69.7483 7.84686C69.6252 8.17974 69.4412 8.48211 69.2075 8.73573C68.9737 8.98936 68.6949 9.18896 68.3881 9.32251C68.0812 9.45606 67.7526 9.52078 67.4221 9.51277C67.0895 9.52404 66.7583 9.46178 66.4486 9.32976C66.1389 9.19774 65.8572 8.99873 65.6207 8.74484C65.3841 8.49096 65.1977 8.18751 65.0727 7.85297C64.9478 7.51843 64.8869 7.15979 64.8937 6.7989V6.80035ZM65.2702 27.1377V11.1478H69.4979V27.1377H65.2695H65.2702ZM81.9381 4.93221H86.1611V27.1377H81.9381V4.93221ZM103.384 11.1478V27.1377H99.4036V25.5042C98.815 26.1637 98.1079 26.6851 97.326 27.0364C96.5442 27.3876 95.7043 27.5611 94.8582 27.5461C90.6078 27.5461 87.5955 23.8113 87.5955 19.0555C87.5955 14.299 90.6885 10.7394 94.8575 10.7394C95.7077 10.7305 96.5505 10.9125 97.3327 11.274C98.115 11.6355 98.8198 12.1686 99.4029 12.8399V11.1478H103.384ZM99.4036 19.1134C99.4144 18.5633 99.3234 18.0164 99.1359 17.5051C98.9485 16.9938 98.6684 16.5285 98.3122 16.1367C97.956 15.7449 97.5311 15.4347 97.0624 15.2242C96.5937 15.0138 96.0909 14.9074 95.5837 14.9115C95.0793 14.9087 94.5796 15.0163 94.1145 15.228C93.6494 15.4396 93.2285 15.751 92.8769 16.1433C92.5253 16.5356 92.2504 17.0009 92.0685 17.5113C91.8867 18.0216 91.8016 18.5665 91.8185 19.1134C91.7986 19.6639 91.8812 20.2131 92.0613 20.7282C92.2414 21.2433 92.5154 21.7137 92.8668 22.1114C93.2182 22.5091 93.64 22.8258 94.1068 23.0427C94.5736 23.2597 95.0759 23.3723 95.5837 23.3739C96.0947 23.3735 96.6004 23.2619 97.071 23.0459C97.5415 22.8299 97.9674 22.5138 98.3235 22.1162C98.6796 21.7187 98.9586 21.2477 99.1441 20.7312C99.3296 20.2147 99.4179 19.6632 99.4036 19.1091V19.1134ZM121.5 19.138C121.5 24.001 118.326 27.5417 114.157 27.5417C113.317 27.5621 112.484 27.3758 111.72 26.9968C110.956 26.6178 110.281 26.056 109.745 25.3536V27.1326H105.657V4.92787H109.88V12.7089C110.423 12.0689 111.085 11.5612 111.823 11.2192C112.56 10.8772 113.356 10.7087 114.157 10.7249C118.317 10.7343 121.5 14.3236 121.5 19.138ZM117.196 19.1091C117.218 18.5648 117.136 18.0215 116.957 17.5125C116.779 17.0035 116.506 16.5394 116.156 16.1488C115.806 15.7581 115.386 15.4491 114.922 15.2406C114.458 15.0321 113.96 14.9285 113.458 14.9362C112.955 14.9299 112.456 15.0342 111.991 15.2428C111.526 15.4515 111.105 15.76 110.753 16.15C110.401 16.5399 110.126 17.0031 109.943 17.5117C109.761 18.0203 109.675 18.5636 109.692 19.1091C109.692 21.4435 111.225 23.3399 113.458 23.3399C115.69 23.3399 117.188 21.4428 117.188 19.1091H117.196Z\"\r\n        fill=\"#1565c0\"\r\n      />\r\n      <path\r\n        d=\"M32.2889 12.845C31.5278 12.0178 30.6236 11.3618 29.6283 10.9144C28.633 10.4671 27.566 10.2374 26.4886 10.2383C25.4111 10.2372 24.3439 10.4668 23.3483 10.9142C22.3527 11.3615 21.4483 12.0176 20.6871 12.845C19.9245 13.6708 19.3196 14.6518 18.9073 15.7317C18.495 16.8116 18.2832 17.9692 18.2842 19.138C18.2832 20.3069 18.495 21.4645 18.9073 22.5444C19.3196 23.6243 19.9245 24.6053 20.6871 25.4311C21.4482 26.2583 22.3525 26.9145 23.348 27.3618C24.3434 27.8091 25.4105 28.0388 26.488 28.0378C27.5655 28.0388 28.6325 27.8091 29.628 27.3618C30.6235 26.9145 31.5277 26.2583 32.2889 25.4311C33.0515 24.6053 33.6563 23.6243 34.0687 22.5444C34.481 21.4645 34.6928 20.3069 34.6918 19.138C34.6928 17.9692 34.481 16.8116 34.0687 15.7317C33.6563 14.6518 33.0515 13.6708 32.2889 12.845ZM29.3033 22.1922C28.9343 22.5943 28.4955 22.913 28.0123 23.13C27.5291 23.347 27.011 23.458 26.488 23.4565C25.965 23.458 25.4469 23.347 24.9637 23.13C24.4804 22.913 24.0416 22.5943 23.6726 22.1922C23.302 21.7919 23.0082 21.3159 22.8081 20.7917C22.6081 20.2674 22.5058 19.7054 22.5072 19.138C22.5058 18.5707 22.6081 18.0086 22.8081 17.4844C23.0082 16.9602 23.302 16.4842 23.6726 16.0838C24.0416 15.6818 24.4804 15.363 24.9637 15.146C25.4469 14.929 25.965 14.8181 26.488 14.8196C27.011 14.8181 27.5291 14.929 28.0123 15.146C28.4955 15.363 28.9343 15.6818 29.3033 16.0838C29.674 16.4842 29.9678 16.9602 30.1678 17.4844C30.3678 18.0086 30.4701 18.5707 30.4687 19.138C30.4701 19.7054 30.3678 20.2674 30.1678 20.7917C29.9678 21.3159 29.674 21.7919 29.3033 22.1922Z\"\r\n        fill=\"#5EE01A\"\r\n      />\r\n      <path\r\n        d=\"M28.5991 19.138C28.5978 18.041 28.786 16.9542 29.1558 15.9332C28.42 15.2085 27.4596 14.8109 26.4659 14.8196C25.9316 14.8183 25.4027 14.934 24.9107 15.1599C24.5402 16.4476 24.3525 17.789 24.354 19.138C24.3523 20.487 24.5397 21.8284 24.91 23.1162C25.402 23.3421 25.931 23.4579 26.4652 23.4565C27.4591 23.4657 28.4196 23.068 29.1551 22.3428C28.7859 21.322 28.5975 20.2347 28.5998 19.138H28.5991Z\"\r\n        fill=\"#3BBCF6\"\r\n      />\r\n      <path\r\n        d=\"M45.3342 9.72274C44.1945 8.48696 42.8412 7.50721 41.3519 6.83962C39.8626 6.17202 38.2666 5.8297 36.6552 5.83224C34.9185 5.8288 33.201 6.22592 31.6165 6.99728C30.0321 7.76863 28.6169 8.89659 27.4648 10.3064C29.0147 10.5049 30.48 11.18 31.6879 12.252C33.1024 11.0449 34.8508 10.3903 36.6505 10.394C38.7864 10.3903 40.8355 11.3107 42.344 12.9522C43.093 13.7622 43.687 14.7249 44.0917 15.7849C44.4964 16.8449 44.7038 17.9813 44.7021 19.1286C44.7054 21.4457 43.8571 23.6686 42.344 25.305C41.5972 26.1175 40.7098 26.7617 39.7327 27.2006C38.7555 27.6396 37.7081 27.8645 36.6505 27.8625C34.8508 27.8664 33.1025 27.2121 31.6879 26.0052C30.4799 27.077 29.0146 27.7518 27.4648 27.9501C28.6162 29.3596 30.0305 30.4875 31.6142 31.2589C33.1978 32.0304 34.9145 32.4279 36.6505 32.425C38.2627 32.4281 39.8596 32.0859 41.3496 31.4181C42.8396 30.7502 44.1934 29.7698 45.3334 28.5331C46.4733 27.2963 47.377 25.8276 47.9926 24.2112C48.6081 22.5947 48.9235 20.8623 48.9205 19.1134C48.9196 15.5913 47.6297 12.2136 45.3342 9.72274Z\"\r\n        fill=\"#3BBCF6\"\r\n      />\r\n      <path\r\n        d=\"M30.944 25.3195C31.1749 25.57 31.4185 25.8046 31.6748 26.024C30.4669 27.096 29.0017 27.7711 27.4518 27.9697C26.3 26.5613 25.4369 24.9038 24.9194 23.1067C25.4114 23.3327 25.9404 23.4484 26.4746 23.447C27.4685 23.4562 28.429 23.0585 29.1645 22.3334C29.5631 23.4503 30.1687 24.4667 30.944 25.3195ZM29.1512 15.9383C29.6757 14.4894 30.5468 13.2184 31.6748 12.2563C30.4668 11.1846 29.0016 10.5098 27.4518 10.3114C26.3 11.7198 25.4369 13.3773 24.9194 15.1744C25.4114 14.9485 25.9404 14.8327 26.4746 14.834C27.4625 14.8268 28.4169 15.22 29.1512 15.9383Z\"\r\n        fill=\"#49AF13\"\r\n      />\r\n      <path\r\n        d=\"M64.4542 11.1477L57.9985 17.6544L64.4542 11.1477ZM80.2925 22.3819L79.9427 22.5861C79.2093 23.0644 78.3769 23.3353 77.5219 23.3739C76.2036 23.3739 75.5582 22.4985 75.5582 20.66V14.9412H80.2925V11.147H75.5582V5.48758L71.3498 7.55339V21.0981C71.3498 25.3876 73.1426 27.5468 76.6081 27.5468C77.8763 27.5396 79.1291 27.255 80.2925 26.7098V22.3826V22.3819Z\"\r\n        fill=\"#1565c0\"\r\n      />\r\n    </svg>\r\n  );\r\n});\r\n\r\nexport const BookitlabLoginLogo = React.memo(function BookitlabLoginLogo(\r\n  props: BookitlabLogoProps,\r\n) {\r\n  const { width, height } = props;\r\n  const { t } = useTranslation();\r\n  return (\r\n    <svg\r\n      width={width || '180'}\r\n      height={height || '39'}\r\n      viewBox={`0 0 ${width || '180'} ${height || '39'}`}\r\n      fill=\"none\"\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n    >\r\n      <title>{t(messages.bookitlab())}</title>\r\n      <path\r\n        d=\"M23.7644 20.7152C23.7644 27.4073 19.0037 32.2799 12.7492 32.2799C11.4894 32.3078 10.2397 32.0513 9.09367 31.5298C7.94768 31.0083 6.93525 30.2352 6.13233 29.2687V31.7169H0V1.15992H6.33457V11.8677C7.14911 10.9872 8.14199 10.2886 9.24771 9.81796C10.3534 9.34733 11.5468 9.1154 12.7492 9.13747C19.0037 9.15042 23.7644 14.0898 23.7644 20.7152ZM17.3087 20.6753C17.3408 19.9263 17.2189 19.1787 16.9506 18.4782C16.6822 17.7777 16.273 17.1391 15.748 16.6015C15.2231 16.0639 14.5933 15.6386 13.8975 15.3517C13.2016 15.0648 12.4541 14.9222 11.701 14.9328C10.9465 14.9242 10.198 15.0678 9.50082 15.3548C8.80359 15.6419 8.172 16.0666 7.64414 16.6032C7.11629 17.1398 6.70311 17.7773 6.42951 18.4771C6.15591 19.177 6.02757 19.9248 6.05223 20.6753C6.05223 23.8879 8.35198 26.4976 11.701 26.4976C15.049 26.4976 17.3087 23.8869 17.3087 20.6753ZM80.4311 22.6094L79.1796 23.7733V31.7249H72.847V1.1659H79.1816V16.7463L86.6054 9.71939H94.4328L84.7492 18.6735L95.0776 31.7239H87.4124L80.4311 22.6094ZM95.0906 3.73673C95.0838 3.241 95.1776 2.74902 95.3663 2.2902C95.555 1.83137 95.8348 1.41514 96.1888 1.0664C96.5429 0.717655 96.964 0.443561 97.4269 0.26051C97.8898 0.0774601 98.3851 -0.0107856 98.8831 0.00105103C99.3781 -0.00716679 99.8697 0.0837864 100.329 0.268499C100.788 0.453213 101.204 0.727911 101.555 1.07625C101.905 1.42459 102.181 1.83946 102.366 2.29617C102.552 2.75288 102.644 3.24211 102.636 3.73474C102.647 4.2282 102.557 4.71878 102.373 5.17688C102.188 5.63497 101.912 6.05109 101.561 6.40011C101.211 6.74912 100.792 7.02381 100.332 7.2076C99.8718 7.39138 99.3789 7.48044 98.8831 7.46942C98.3842 7.48494 97.8874 7.39925 97.4229 7.21757C96.9583 7.03589 96.5358 6.76203 96.181 6.41264C95.8262 6.06326 95.5466 5.64567 95.3591 5.18529C95.1716 4.72491 95.0803 4.23138 95.0906 3.73474V3.73673ZM95.6553 31.7239V9.71939H101.997V31.7239H95.6543H95.6553ZM120.657 1.1659H126.992V31.7239H120.657V1.1659ZM152.827 9.71939V31.7239H146.855V29.4759C145.972 30.3835 144.912 31.1011 143.739 31.5844C142.566 32.0678 141.306 32.3065 140.037 32.2859C133.662 32.2859 129.143 27.1462 129.143 20.6016C129.143 14.0559 133.783 9.1574 140.036 9.1574C141.312 9.14516 142.576 9.39565 143.749 9.89312C144.922 10.3906 145.98 11.1243 146.854 12.0481V9.71939H152.827ZM146.855 20.6813C146.872 19.9242 146.735 19.1716 146.454 18.468C146.173 17.7644 145.753 17.1241 145.218 16.585C144.684 16.0458 144.047 15.6188 143.344 15.3292C142.641 15.0396 141.886 14.8933 141.126 14.8989C140.369 14.895 139.619 15.0431 138.922 15.3344C138.224 15.6257 137.593 16.0541 137.065 16.594C136.538 17.1339 136.126 17.7742 135.853 18.4765C135.58 19.1789 135.452 19.9288 135.478 20.6813C135.448 21.4388 135.572 22.1946 135.842 22.9035C136.112 23.6123 136.523 24.2597 137.05 24.807C137.577 25.3542 138.21 25.7901 138.91 26.0886C139.61 26.3872 140.364 26.5422 141.126 26.5444C141.892 26.5438 142.651 26.3903 143.356 26.093C144.062 25.7957 144.701 25.3607 145.235 24.8136C145.769 24.2665 146.188 23.6184 146.466 22.9077C146.744 22.1969 146.877 21.4378 146.855 20.6753V20.6813ZM180 20.7152C180 27.4073 175.239 32.2799 168.986 32.2799C167.726 32.3079 166.476 32.0516 165.33 31.53C164.184 31.0085 163.171 30.2354 162.368 29.2687V31.7169H156.236V1.15992H162.57V11.8677C163.385 10.9871 164.378 10.2884 165.484 9.81775C166.59 9.34712 167.783 9.11526 168.986 9.13747C175.225 9.15042 180 14.0898 180 20.7152ZM173.544 20.6753C173.576 19.9263 173.455 19.1787 173.186 18.4782C172.918 17.7777 172.509 17.1391 171.984 16.6015C171.459 16.0639 170.829 15.6386 170.133 15.3517C169.437 15.0648 168.69 14.9222 167.937 14.9328C167.182 14.9242 166.434 15.0678 165.736 15.3548C165.039 15.6419 164.408 16.0666 163.88 16.6032C163.352 17.1398 162.939 17.7773 162.665 18.4771C162.392 19.177 162.263 19.9248 162.288 20.6753C162.288 23.8879 164.588 26.4976 167.937 26.4976C171.286 26.4976 173.531 23.8869 173.531 20.6753H173.544Z\"\r\n        fill=\"white\"\r\n      />\r\n      <path\r\n        d=\"M46.1829 12.055C45.0412 10.9166 43.685 10.0138 42.192 9.39822C40.699 8.78265 39.0985 8.46646 37.4825 8.46778C35.8661 8.46619 34.2653 8.78226 32.7719 9.39784C31.2786 10.0134 29.922 10.9164 28.7801 12.055C27.6362 13.1914 26.729 14.5413 26.1105 16.0274C25.492 17.5135 25.1743 19.1065 25.1758 20.7151C25.1743 22.3237 25.492 23.9167 26.1105 25.4028C26.729 26.8889 27.6362 28.2388 28.7801 29.3752C29.9219 30.5137 31.2783 31.4166 32.7715 32.0322C34.2647 32.6478 35.8653 32.9639 37.4815 32.9624C39.0977 32.9639 40.6983 32.6478 42.1915 32.0322C43.6847 31.4166 45.0411 30.5137 46.1829 29.3752C47.3268 28.2388 48.234 26.8889 48.8525 25.4028C49.471 23.9167 49.7886 22.3237 49.7872 20.7151C49.7886 19.1065 49.471 17.5135 48.8525 16.0274C48.234 14.5413 47.3268 13.1914 46.1829 12.055ZM41.7045 24.9181C41.151 25.4714 40.4928 25.91 39.768 26.2087C39.0431 26.5073 38.266 26.66 37.4815 26.6579C36.697 26.66 35.9199 26.5073 35.195 26.2087C34.4702 25.91 33.812 25.4714 33.2584 24.9181C32.7025 24.3672 32.2618 23.7121 31.9617 22.9907C31.6617 22.2693 31.5083 21.4959 31.5104 20.7151C31.5083 19.9343 31.6617 19.1609 31.9617 18.4395C32.2618 17.7181 32.7025 17.063 33.2584 16.5121C33.812 15.9588 34.4702 15.5202 35.195 15.2215C35.9199 14.9229 36.697 14.7702 37.4815 14.7723C38.266 14.7702 39.0431 14.9229 39.768 15.2215C40.4928 15.5202 41.151 15.9588 41.7045 16.5121C42.2605 17.063 42.7012 17.7181 43.0012 18.4395C43.3013 19.1609 43.4547 19.9343 43.4526 20.7151C43.4547 21.4959 43.3013 22.2693 43.0012 22.9907C42.7012 23.7121 42.2605 24.3672 41.7045 24.9181Z\"\r\n        fill=\"#8BC34A\"\r\n      />\r\n      <path\r\n        d=\"M40.6489 20.715C40.6469 19.2054 40.9292 17.7097 41.4839 16.3047C40.3802 15.3074 38.9397 14.7602 37.449 14.7722C36.6477 14.7704 35.8542 14.9297 35.1163 15.2405C34.5605 17.0126 34.279 18.8586 34.2813 20.715C34.2786 22.5713 34.5598 24.4173 35.1153 26.1894C35.8532 26.5004 36.6467 26.6597 37.448 26.6578C38.9388 26.6704 40.3796 26.1232 41.4829 25.1252C40.929 23.7204 40.6464 22.2241 40.6499 20.715H40.6489Z\"\r\n        fill=\"#026AA2\"\r\n      />\r\n      <path\r\n        d=\"M65.7513 7.75823C64.0417 6.05761 62.0118 4.70934 59.7779 3.79063C57.5439 2.87193 55.1499 2.40083 52.7327 2.40433C50.1277 2.3996 47.5515 2.9461 45.1748 4.0076C42.7981 5.06909 40.6754 6.62133 38.9473 8.56137C41.2721 8.83462 43.4699 9.7636 45.2818 11.2388C47.4036 9.57767 50.0261 8.67687 52.7257 8.68194C55.9295 8.67696 59.0032 9.94344 61.2659 12.2024C62.3895 13.3171 63.2805 14.6419 63.8875 16.1006C64.4946 17.5593 64.8058 19.1232 64.8031 20.7021C64.8082 23.8907 63.5356 26.9498 61.2659 29.2018C60.1459 30.3198 58.8147 31.2064 57.349 31.8104C55.8833 32.4144 54.3121 32.7239 52.7257 32.7212C50.0262 32.7266 47.4038 31.8261 45.2818 30.1653C43.4698 31.6402 41.272 32.5688 38.9473 32.8418C40.6743 34.7814 42.7958 36.3335 45.1712 37.3952C47.5467 38.4569 50.1218 39.0038 52.7257 38.9998C55.144 39.0042 57.5394 38.5333 59.7744 37.6142C62.0094 36.6951 64.0401 35.3459 65.7501 33.644C67.46 31.9421 68.8155 29.9209 69.7389 27.6964C70.6622 25.472 71.1352 23.088 71.1307 20.6811C71.1294 15.8342 69.1945 11.186 65.7513 7.75823Z\"\r\n        fill=\"#026AA2\"\r\n      />\r\n      <path\r\n        d=\"M44.1657 29.2217C44.5121 29.5665 44.8775 29.8893 45.262 30.1912C43.4501 31.6665 41.2522 32.5954 38.9274 32.8687C37.1998 30.9306 35.9051 28.6496 35.1289 26.1766C35.8669 26.4875 36.6603 26.6468 37.4617 26.6449C38.9525 26.6575 40.3932 26.1103 41.4965 25.1124C42.0944 26.6495 43.0029 28.0481 44.1657 29.2217ZM41.4765 16.3117C42.2632 14.3178 43.57 12.5688 45.262 11.2448C43.45 9.76995 41.2521 8.84132 38.9274 8.56836C37.1998 10.5065 35.9051 12.7874 35.1289 15.2605C35.8669 14.9497 36.6603 14.7904 37.4617 14.7922C38.9435 14.7822 40.3752 15.3233 41.4765 16.3117Z\"\r\n        fill=\"#2B9548\"\r\n      />\r\n      <path\r\n        d=\"M94.4316 9.7194L84.748 18.6735L94.4316 9.7194ZM118.189 25.1793L117.664 25.4603C116.564 26.1185 115.316 26.4913 114.033 26.5444C112.056 26.5444 111.088 25.3397 111.088 22.8097V14.9398H118.189V9.7184H111.088V1.93018L104.775 4.77304V23.4126C104.775 29.3155 107.464 32.2869 112.662 32.2869C114.565 32.277 116.444 31.8853 118.189 31.135V25.1803V25.1793Z\"\r\n        fill=\"white\"\r\n      />\r\n    </svg>\r\n  );\r\n});\r\n","/**\r\n *\r\n * InstituteTypeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { InstituteTypePicker } from 'app/components/pickers/AutocompletePickers/InstituteTypePicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const InstituteTypeFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <InstituteTypePicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default InstituteTypeFilter;\r\n","/**\r\n *\r\n * InvoiceIdMultiPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface InvoiceIdProps\r\n  extends Omit<AutocompleteMultiPickerProps<number>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/InvoiceIdFilter';\r\nexport const initInvoiceIdData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const ids = initval.split('|').map(v => parseInt(v));\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Id asc',\r\n      $filter: '(Id in (' + ids.join(',') + '))',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: ids.length,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null): Promise<Entity<number>[]> => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Id asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function InvoiceIdMultiPicker(props: InvoiceIdProps) {\r\n  return (\r\n    <AutocompleteMultiPicker\r\n      mini={!!props.mini}\r\n      size={props.size}\r\n      id={props.id || 'invoiceId'}\r\n      loadData={loadData}\r\n      ariaLabel=\"Invoice Id Filter\"\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { LabelTypes } from '../slice/types';\r\nimport Handlebars from 'handlebars';\r\n\r\n/**\r\n * Produces a URL used to print QR barcodes\r\n * @param item data record e.g. assetDetails, LocationListDto, etc.\r\n * @param type The type of the URL Template: Asset/LocationList/etc.\r\n * @param urlTemplate The URL template as configured in system settings\r\n * @returns\r\n */\r\nexport function getQrUrl(item: any, type: LabelTypes, urlTemplate: string) {\r\n  if (\r\n    type === 'Asset' &&\r\n    (item as IGetQrURLAssetDetails).InternalCode !== undefined\r\n  ) {\r\n    return getAssetQrUrl(item, urlTemplate);\r\n  } else {\r\n    return getQrUrlH(item, urlTemplate);\r\n  }\r\n}\r\n\r\ninterface IGetQrURLAssetDetails {\r\n  InternalCode: string | null;\r\n}\r\n\r\nfunction getAssetQrUrl(\r\n  assetDetails: IGetQrURLAssetDetails,\r\n  AssetBarcodeUrlTemplate,\r\n) {\r\n  if (assetDetails.InternalCode === null) {\r\n    throw new Error('Asset QR: Internal code is empty');\r\n  }\r\n  return AssetBarcodeUrlTemplate.replace(\r\n    /:internalCode/g,\r\n    assetDetails.InternalCode,\r\n  );\r\n}\r\n\r\n/**\r\n * Produces a URL through Handlebars engine\r\n * @param item data record\r\n * @param urlTemplate url template string\r\n * @returns URL for QR label print\r\n */\r\nfunction getQrUrlH(item: any, urlTemplate) {\r\n  const template = Handlebars.compile(urlTemplate);\r\n  const url = template(item);\r\n  return url;\r\n}\r\n","import { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { IFileResult, ILabelPrinter } from '.';\r\nimport { LabelPrinter } from '../slice/types';\r\nimport { getQrUrl } from './getQrUrl';\r\n\r\nconst generateLabel = (labelXml, assetData, AssetBarcodeUrlTemplate) => {\r\n  var label = globalThis.dymo.label.framework.openLabelXml(labelXml);\r\n  var objectMapping = getObjectMapping(label, AssetBarcodeUrlTemplate);\r\n  Object.keys(objectMapping).forEach(function (objectName) {\r\n    var writeData = objectMapping[objectName](assetData);\r\n    if (objectName === 'Name') {\r\n      var splittedData = writeData.split('-');\r\n      writeData = splittedData[0];\r\n      if (splittedData.length > 1) {\r\n        writeData += '-' + splittedData[1];\r\n      }\r\n    }\r\n    if (objectName === 'Room') {\r\n      if (assetData.LocationName) writeData += ', ' + assetData.LocationName;\r\n      if (assetData.SubLocationName)\r\n        writeData += ', ' + assetData.SubLocationName;\r\n    }\r\n    console.log('writeData', writeData);\r\n    label.setObjectText(objectName, writeData);\r\n  });\r\n  return label;\r\n};\r\nconst getObjectMapping = (label, AssetBarcodeUrlTemplate) => {\r\n  var staticObjectNames = ['CompanyLogo', 'StaticText'];\r\n  return label.getObjectNames().reduce(function (previousValue, currentValue) {\r\n    var nameParts = currentValue.split('_');\r\n    var assetPropertyName = nameParts[0];\r\n    if (staticObjectNames.indexOf(assetPropertyName) >= 0) {\r\n      return previousValue;\r\n    }\r\n    if (assetPropertyName.toLowerCase() === 'qr') {\r\n      if (nameParts.length > 1 && nameParts[1].toLowerCase() === 'text') {\r\n        previousValue[currentValue] = function (assetData) {\r\n          return getQrUrl(assetData, 'Asset', AssetBarcodeUrlTemplate);\r\n        };\r\n      }\r\n    } else {\r\n      previousValue[currentValue] = function (assetData) {\r\n        var value = getValue(assetData, currentValue);\r\n        if (value === null || value === undefined) {\r\n          return 'N/A';\r\n        } else {\r\n          return value.toString();\r\n        }\r\n      };\r\n    }\r\n    return previousValue;\r\n  }, {});\r\n};\r\nfunction getValue(obj, path) {\r\n  var properties = path.split(/[.[\\]]+/);\r\n  while (properties.length) {\r\n    var property = properties.shift();\r\n    obj = obj[property];\r\n    if (obj === null || obj === undefined) {\r\n      return null;\r\n    }\r\n  }\r\n  return obj;\r\n}\r\n\r\nexport const Dymo: ILabelPrinter = {\r\n  getPrinters: () => {\r\n    const dymoLabelPrinterOption = printer => ({\r\n      Id: printer.name,\r\n      Name: `Dymo - ${printer.name}`,\r\n      Type: 'Dymo',\r\n      Device: printer,\r\n    });\r\n    return initDymoFramework()\r\n      .then(p => {\r\n        return globalThis.dymo.label.framework.getLabelWriterPrintersAsync();\r\n      })\r\n      .then(dymoPrinters => {\r\n        const result = dymoPrinters.map(dymoLabelPrinterOption);\r\n        return result;\r\n      });\r\n  },\r\n\r\n  preview: (\r\n    printer: LabelPrinter,\r\n    labelType: ILabelTypeDto,\r\n    data: any[],\r\n    options,\r\n  ) => {\r\n    return new Promise((resolve, reject) => {\r\n      const result: IFileResult[] = [];\r\n      try {\r\n        for (const assetData of data) {\r\n          var label = generateLabel(\r\n            labelType.Xml,\r\n            assetData,\r\n            options.AssetBarcodeUrlTemplate,\r\n          );\r\n          var labelPreview = 'data:image/png;base64,' + label.render();\r\n          var blob = dataURItoBlob(labelPreview);\r\n          result.push({\r\n            fileName: `${assetData.Name}.png`,\r\n            content: blob,\r\n          });\r\n        }\r\n        resolve(result);\r\n      } catch (error) {\r\n        reject(error);\r\n      }\r\n    });\r\n  },\r\n  download: (\r\n    printer: LabelPrinter,\r\n    labelType: ILabelTypeDto,\r\n    data: any[],\r\n    options,\r\n  ) => {\r\n    return new Promise((resolve, reject) => {\r\n      try {\r\n        const result: any[] = [];\r\n        for (const assetData of data) {\r\n          var label = generateLabel(\r\n            labelType.Xml,\r\n            assetData,\r\n            options.AssetBarcodeUrlTemplate,\r\n          );\r\n          var blob = new Blob([label.getLabelXml()], { type: 'text/xml' });\r\n\r\n          result.push({\r\n            fileName: `${assetData.Name}.label`,\r\n            content: blob,\r\n          });\r\n        }\r\n        resolve(result);\r\n      } catch (error) {\r\n        reject(error);\r\n      }\r\n    });\r\n  },\r\n  print: (\r\n    printer: LabelPrinter,\r\n    labelType: ILabelTypeDto,\r\n    data: any[],\r\n    options,\r\n  ) => {\r\n    return new Promise((resolve, reject) => {\r\n      try {\r\n        var printParams = globalThis.dymo.label.framework.createLabelWriterPrintParamsXml(\r\n          {\r\n            twinTurboRoll:\r\n              globalThis.dymo.label.framework.TwinTurboRoll[\r\n                labelType.twinTurboRoll ?? 'Left'\r\n              ],\r\n          },\r\n        );\r\n\r\n        for (var index = 0; index < data.length; index++) {\r\n          var assetData = data[index];\r\n          var label = generateLabel(\r\n            labelType.Xml,\r\n            assetData,\r\n            options.AssetBarcodeUrlTemplate,\r\n          );\r\n          label.print(printer.Id, printParams);\r\n        }\r\n        resolve(null);\r\n      } catch (err) {\r\n        reject(err);\r\n      }\r\n    });\r\n  },\r\n};\r\nconst initDymoFramework: () => Promise<any> = () => {\r\n  return new Promise((resolve, reject) => {\r\n    const framework = globalThis.dymo.label.framework;\r\n\r\n    framework.init(p => {\r\n      if (!!p.errorDetails) {\r\n        reject(p.errorDetails);\r\n      } else {\r\n        resolve(framework);\r\n      }\r\n    });\r\n  });\r\n};\r\n\r\nfunction dataURItoBlob(dataURI) {\r\n  // convert base64 to raw binary data held in a string\r\n  // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\r\n  var byteString = atob(dataURI.split(',')[1]);\r\n\r\n  // separate out the mime component\r\n  var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\r\n\r\n  // write the bytes of the string to an ArrayBuffer\r\n  var ab = new ArrayBuffer(byteString.length);\r\n\r\n  // create a view into the buffer\r\n  var ia = new Uint8Array(ab);\r\n\r\n  // set the bytes of the buffer to the correct values\r\n  for (var i = 0; i < byteString.length; i++) {\r\n    ia[i] = byteString.charCodeAt(i);\r\n  }\r\n\r\n  // write the ArrayBuffer to a blob, and you're done\r\n  var blob = new Blob([ab], { type: mimeString });\r\n  return blob;\r\n}\r\n","import { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport Handlebars from 'handlebars';\r\nimport { ILabelPrinter } from '.';\r\nimport { LabelPrinter } from '../slice/types';\r\n\r\nHandlebars.registerHelper('padStart', (context, maxLength, fillString) => {\r\n  return String(context).padStart(maxLength, fillString);\r\n});\r\nHandlebars.registerHelper('padEnd', (context, maxLength, fillString) => {\r\n  return String(context).padEnd(maxLength, fillString);\r\n});\r\n\r\nexport const zebra: ILabelPrinter = {\r\n  getPrinters: () => {\r\n    return new Promise((resolve, reject) => {\r\n      globalThis.BrowserPrint.getLocalDevices(\r\n        device_list => {\r\n          resolve(\r\n            device_list.printer.map(p => {\r\n              var r: LabelPrinter = {\r\n                Id: p.uid,\r\n                Type: 'Zebra',\r\n                Name: `Zebra - ${p.name}`,\r\n                Device: p,\r\n              };\r\n              return r;\r\n            }),\r\n          );\r\n        },\r\n        reason => {\r\n          const res =\r\n            reason.trim() !== ''\r\n              ? reason\r\n              : 'Zebra Label Framework Plugin is not installed';\r\n          reject(res);\r\n        },\r\n      );\r\n    });\r\n  },\r\n  print: (printer, labelType, data, options) => {\r\n    // noEscape: true to prevent the escapeExpression function from being called in handlebars\\utils module,\r\n    // which replaces some characters with HTML codes.\r\n    const t = Handlebars.compile(labelType.Xml, { noEscape: true });\r\n    const labels = data.map(item => t(item));\r\n    const zebra = new globalThis.Zebra.Printer(printer.Device);\r\n    globalThis.Zebra.stopWatching(printer.Device);\r\n    return Promise.all(\r\n      labels.map(\r\n        item =>\r\n          new Promise((resolve, reject) => {\r\n            console.debug('Zebra Printer - printing', item, zebra);\r\n\r\n            zebra.send(\r\n              item,\r\n              function (success) {\r\n                resolve(success);\r\n              },\r\n              function (error) {\r\n                console.error('Error:' + error);\r\n                reject(error);\r\n              },\r\n            );\r\n          }),\r\n      ),\r\n    );\r\n  },\r\n  preview: function (\r\n    printer: LabelPrinter,\r\n    labelType: ILabelTypeDto,\r\n    data: any[],\r\n    options: {\r\n      AssetBarcodeUrlTemplate: string;\r\n      RoomBarcodeUrlTemplate: string;\r\n      LocationBarcodeUrlTemplate: string;\r\n      SubLocationBarcodeUrlTemplate: string;\r\n      ConsumableTypeBarcodeUrlTemplate: string;\r\n    },\r\n  ): Promise<any> {\r\n    throw new Error('Function not implemented.');\r\n  },\r\n  download: function (\r\n    printer: LabelPrinter,\r\n    labelType: ILabelTypeDto,\r\n    data: any[],\r\n    options: {\r\n      RoomBarcodeUrlTemplate: string;\r\n      AssetBarcodeUrlTemplate: string;\r\n      LocationBarcodeUrlTemplate: string;\r\n      SubLocationBarcodeUrlTemplate: string;\r\n      ConsumableTypeBarcodeUrlTemplate: string;\r\n    },\r\n  ): Promise<any> {\r\n    throw new Error('Function not implemented.');\r\n  },\r\n};\r\n","import { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { LabelPrinter } from '../slice/types';\r\nimport { Dymo as DymoPrinter } from './Dymo';\r\nimport { zebra as ZebraPrinter } from './Zebra';\r\n\r\nexport type TGetPrinter = () => Promise<Array<LabelPrinter>>;\r\n\r\nexport type TPrint<TResult = any> = (\r\n  printer: LabelPrinter,\r\n  labelType: ILabelTypeDto,\r\n  data: Array<any>,\r\n  options: {\r\n    AssetBarcodeUrlTemplate: string;\r\n    RoomBarcodeUrlTemplate: string;\r\n    LocationBarcodeUrlTemplate: string;\r\n    SubLocationBarcodeUrlTemplate: string;\r\n    SamplePlateBarcodeUrlTemplate: string;\r\n    ConsumableTypeBarcodeUrlTemplate: string;\r\n  },\r\n) => Promise<TResult>;\r\nexport interface IFileResult {\r\n  fileName: string;\r\n  content: any;\r\n}\r\nexport type ILabelPrinter = {\r\n  getPrinters: TGetPrinter;\r\n  print: TPrint;\r\n  preview: TPrint<IFileResult[]>;\r\n  download: TPrint<IFileResult[]>;\r\n};\r\n\r\nexport const Dymo = DymoPrinter;\r\nexport const Zebra = ZebraPrinter;\r\nexport const getPrinterInterface = (printer: LabelPrinter) => {\r\n  switch (printer.Type) {\r\n    case 'Dymo':\r\n      return Dymo;\r\n    case 'Zebra':\r\n      return Zebra;\r\n  }\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLeading, takeLatest } from 'redux-saga/effects';\r\nimport { labelPrintActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\n\r\nimport { selectLabelPrint } from './selectors';\r\nimport {\r\n  IPrintAssetLabelArgs,\r\n  LabelPrinter,\r\n  LabelPrintState,\r\n  OpenPrintDialogPayload,\r\n} from './types';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Dymo, getPrinterInterface, TPrint, Zebra } from '../Printers';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { getQrUrl } from '../Printers/getQrUrl';\r\nimport fileDownload from 'js-file-download';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nfunction* doGetPrinters(action: PayloadAction) {\r\n  let printers: Array<LabelPrinter> = [];\r\n  const systemSettings = yield select(selectglobalSettings);\r\n  if (systemSettings.GetBooleanByKey(AllowedSettings.DymoPrinterSupported)) {\r\n    try {\r\n      const dymo_printers = yield call(Dymo.getPrinters);\r\n      printers = [...printers, ...dymo_printers];\r\n    } catch (error: unknown) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          message: String(error),\r\n          variant: 'error',\r\n        }),\r\n      );\r\n      yield put(actions.getPrinters_Error(Error));\r\n    }\r\n  }\r\n  if (systemSettings.GetBooleanByKey(AllowedSettings.ZebraPrinterSupported)) {\r\n    try {\r\n      const zebra_printers = yield call(Zebra.getPrinters);\r\n      printers = [...printers, ...zebra_printers];\r\n    } catch (error: unknown) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          message: String(error),\r\n          variant: 'error',\r\n        }),\r\n      );\r\n      yield put(actions.getPrinters_Error(Error));\r\n    }\r\n  }\r\n\r\n  const serializablePayload = JSON.parse(JSON.stringify(printers));\r\n  yield put(actions.getPrinters_Success(serializablePayload));\r\n}\r\nfunction* doGetLabelTypes(action: PayloadAction<OpenPrintDialogPayload>) {\r\n  try {\r\n    var filter = new Condition<ILabelTypeDto>(\r\n      'Type',\r\n      ODataOperators.Equals,\r\n      action.payload.type,\r\n    );\r\n\r\n    const labelTypes = yield call(httpClient.get, '/api/odata/v4/labeltypes', {\r\n      $filter: filter.toString(),\r\n    });\r\n    yield put(actions.getLabelTypes_Success(labelTypes.value));\r\n  } catch (error) {\r\n    yield put(actions.getLabelTypes_Error(error));\r\n  }\r\n}\r\nasync function loadObjects(action: PayloadAction<OpenPrintDialogPayload>) {\r\n  switch (action.payload.type) {\r\n    case 'Asset':\r\n      const assetResponse = await httpClient.get(`/api/odata/v4/AssetDetails`, {\r\n        $filter: `Id in (${action.payload.ids.join(',')})`,\r\n      });\r\n      return assetResponse.value;\r\n    /* const assets = await Promise.allSettled(\r\n          action.payload.ids.map(assetId =>\r\n            httpClient.get(\r\n              `/api/odata/v4/AssetDetails(${assetId})?serviceId=0`,\r\n            ),\r\n          ),\r\n        );\r\n        return assets; */\r\n    case 'Room':\r\n      const roomResponse = await httpClient.get(\r\n        `/api/odata/v4/LocationsBuilding`,\r\n        {\r\n          $filter: `Id in (${action.payload.ids.join(',')})`,\r\n        },\r\n      );\r\n      return roomResponse.value;\r\n    case 'LocationList':\r\n      const locationlistsResponse = await httpClient.get(\r\n        `/api/odata/v4/LocationList`,\r\n        {\r\n          $filter: `Id in (${action.payload.ids.join(',')})`,\r\n        },\r\n      );\r\n      return locationlistsResponse.value;\r\n    case 'SubLocationList':\r\n      const sublocationlistsResponse = await httpClient.get(\r\n        `/api/odata/v4/SubLocationList`,\r\n        {\r\n          $filter: `Id in (${action.payload.ids.join(',')})`,\r\n        },\r\n      );\r\n      return sublocationlistsResponse.value;\r\n    case 'SamplePlate':\r\n      const Ids = action.payload.ids.map(id => \"'\" + id + \"'\");\r\n      const samplePlatesResponse = await httpClient.get(\r\n        `/api/odata/v4/SamplePlates`,\r\n        {\r\n          $filter: `Id in (${Ids.join(',')})`,\r\n        },\r\n      );\r\n      return samplePlatesResponse.value;\r\n    case 'Consumable':\r\n      const consumableTypesResponse = await httpClient.get(\r\n        `/api/odata/v4/AssetDetails`,\r\n        {\r\n          $filter: `Id in (${action.payload.ids.join(',')})`,\r\n        },\r\n      );\r\n      return consumableTypesResponse.value;\r\n    default:\r\n      throw new Error('loadObjects NotImplemented');\r\n  }\r\n}\r\nfunction* doGetObjects(action: PayloadAction<OpenPrintDialogPayload>) {\r\n  try {\r\n    const responses = yield call(loadObjects, action);\r\n    const assetDetails = responses.map(response => response);\r\n    yield put(actions.getAssetDetails_Success(assetDetails));\r\n  } catch (error) {\r\n    yield put(actions.getAssetDetails_Failure(error));\r\n  }\r\n}\r\nfunction* doOpen(action: PayloadAction<OpenPrintDialogPayload>) {\r\n  const state: LabelPrintState = yield select(selectLabelPrint);\r\n  if (state.printers.value === undefined) {\r\n    yield put(actions.getPrinters());\r\n  }\r\n  if (state.data.value === undefined) {\r\n    yield put(actions.getAssetDetails(action.payload));\r\n  }\r\n  if (state.labelTypes.value === undefined) {\r\n    yield put(actions.getLabelTypes(action.payload));\r\n  }\r\n}\r\n\r\nfunction* doPrint(action: PayloadAction<IPrintAssetLabelArgs>) {\r\n  if (!action.payload.printer) {\r\n    yield put(actions.getAssetDetails_Failure(`Printer not selected.`));\r\n    return;\r\n  }\r\n\r\n  const systemSettings = yield select(selectglobalSettings);\r\n\r\n  switch (action.payload.printer.Type) {\r\n    case 'Dymo':\r\n      if (\r\n        !systemSettings.GetBooleanByKey(AllowedSettings.DymoPrinterSupported)\r\n      ) {\r\n        const msg = i18next.t(translations.DymoPrinterIsNotSupported);\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            message: msg,\r\n          }),\r\n        );\r\n        yield put(actions.print_Error(msg));\r\n        return;\r\n      }\r\n      break;\r\n    case 'Zebra':\r\n      if (\r\n        !systemSettings.GetBooleanByKey(AllowedSettings.ZebraPrinterSupported)\r\n      ) {\r\n        const msg = i18next.t(translations.ZebraPrinterIsNotSupported);\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            message: msg,\r\n          }),\r\n        );\r\n        yield put(actions.print_Error(msg));\r\n        return;\r\n      }\r\n      break;\r\n  }\r\n\r\n  const printerInterface = getPrinterInterface(action.payload.printer);\r\n  if (printerInterface === undefined) {\r\n    yield put(\r\n      actions.getAssetDetails_Failure(\r\n        `Printer ${action.payload.printer.Type} not supported.`,\r\n      ),\r\n    );\r\n    return;\r\n  }\r\n  const settings: AppSettings = yield select(selectAppSettings);\r\n  const state: LabelPrintState = yield select(selectLabelPrint);\r\n  const type = state.type;\r\n  const AssetBarcodeUrlTemplate =\r\n    type === 'Asset'\r\n      ? settings.AssetBarcodeUrlTemplate\r\n      : type === 'Room'\r\n      ? settings.RoomBarcodeUrlTemplate\r\n      : type === 'LocationList'\r\n      ? settings.LocationBarcodeUrlTemplate\r\n      : type === 'SubLocationList'\r\n      ? settings.SubLocationBarcodeUrlTemplate\r\n      : type === 'SamplePlate'\r\n      ? settings.SamplePlateBarcodeUrlTemplate\r\n      : type === 'Consumable'\r\n      ? settings.ConsumableTypeBarcodeUrlTemplate\r\n      : null;\r\n  try {\r\n    if (type === undefined) {\r\n      throw new Error('Label type is undefined');\r\n    }\r\n    if (AssetBarcodeUrlTemplate === null) {\r\n      throw new Error(`Unsupported label type \"${type}\"`);\r\n    }\r\n    const data = action.payload.assetDetails.map(assetDetails => ({\r\n      ...assetDetails,\r\n      ...{ QR: getQrUrl(assetDetails, type, AssetBarcodeUrlTemplate) },\r\n    }));\r\n    const printAction: TPrint = printerInterface[action.payload.action];\r\n    const result = yield call(\r\n      printAction,\r\n      action.payload.printer,\r\n      action.payload.template,\r\n      data,\r\n      {\r\n        AssetBarcodeUrlTemplate: settings.AssetBarcodeUrlTemplate,\r\n        RoomBarcodeUrlTemplate: settings.RoomBarcodeUrlTemplate,\r\n        LocationBarcodeUrlTemplate: settings.LocationBarcodeUrlTemplate,\r\n        SubLocationBarcodeUrlTemplate: settings.SubLocationBarcodeUrlTemplate,\r\n        SamplePlateBarcodeUrlTemplate: settings.SamplePlateBarcodeUrlTemplate,\r\n        ConsumableTypeBarcodeUrlTemplate:\r\n          settings.ConsumableTypeBarcodeUrlTemplate,\r\n      },\r\n    );\r\n    switch (action.payload.action) {\r\n      case 'print':\r\n        break;\r\n      case 'download':\r\n      case 'preview':\r\n        for (const item of result) {\r\n          yield call(fileDownload, item, 'import-result.xlsx');\r\n        }\r\n    }\r\n    yield put(actions.print_Success(null));\r\n  } catch (error) {\r\n    yield put(actions.print_Error(error));\r\n  }\r\n}\r\n\r\nexport function* labelPrintSaga() {\r\n  yield takeLeading(actions.getPrinters.type, doGetPrinters);\r\n  yield takeLeading(actions.getLabelTypes.type, doGetLabelTypes);\r\n  yield takeLatest(actions.getAssetDetails.type, doGetObjects);\r\n  yield takeLeading(actions.open.type, doOpen);\r\n  yield takeLeading(actions.print.type, doPrint);\r\n  //yield takeLeading(actions.preview.type, doPrint);\r\n  //yield takeLeading(actions.download.type, doPrint);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IAssetDetailsDto } from 'api/odata/generated/entities/IAssetDetailsDto';\r\nimport { ILabelTypeDto } from 'api/odata/generated/entities/ILabelTypeDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { labelPrintSaga } from './saga';\r\nimport {\r\n  LabelPrintState,\r\n  LabelPrinter,\r\n  IPrintAssetLabelArgs,\r\n  AsyncState,\r\n  OpenPrintDialogPayload,\r\n} from './types';\r\n\r\nexport const initialState: LabelPrintState = {\r\n  ids: [],\r\n  labelTypes: {},\r\n  printers: {},\r\n  printState: {},\r\n  data: {},\r\n  open: false,\r\n};\r\n\r\nfunction init<T>(state: AsyncState<T>) {\r\n  state.status = 'pending';\r\n  state.error = undefined;\r\n  state.value = undefined;\r\n}\r\nfunction resolve<T>(state: AsyncState<T>, value: T) {\r\n  state.status = 'resolved';\r\n  state.error = undefined;\r\n  state.value = value;\r\n}\r\nfunction reject<T>(state: AsyncState<T>, error: unknown) {\r\n  state.status = 'rejected';\r\n  state.value = undefined;\r\n  state.error = String(error);\r\n}\r\n\r\nconst slice = createSlice({\r\n  name: 'labelPrint',\r\n  initialState,\r\n  reducers: {\r\n    getPrinters(state, action: PayloadAction) {\r\n      init(state.printers);\r\n    },\r\n    getPrinters_Success(state, action: PayloadAction<Array<LabelPrinter>>) {\r\n      resolve(state.printers, action.payload);\r\n    },\r\n    getPrinters_Error(state, action: PayloadAction<any>) {\r\n      reject(state.printers, action.payload);\r\n    },\r\n\r\n    getLabelTypes(state, action: PayloadAction<OpenPrintDialogPayload>) {\r\n      init(state.labelTypes);\r\n    },\r\n    getLabelTypes_Success(state, action: PayloadAction<Array<ILabelTypeDto>>) {\r\n      resolve(state.labelTypes, action.payload);\r\n    },\r\n    getLabelTypes_Error(state, action: PayloadAction<any>) {\r\n      reject(state.labelTypes, action.payload);\r\n    },\r\n\r\n    getAssetDetails(state, action: PayloadAction<OpenPrintDialogPayload>) {\r\n      init(state.data);\r\n    },\r\n    getAssetDetails_Success(\r\n      state,\r\n      action: PayloadAction<Array<IAssetDetailsDto>>,\r\n    ) {\r\n      resolve(state.data, action.payload);\r\n    },\r\n    getAssetDetails_Failure(state, action: PayloadAction<any>) {\r\n      reject(state.data, action.payload);\r\n    },\r\n\r\n    open(state, action: PayloadAction<OpenPrintDialogPayload>) {\r\n      state.open = true;\r\n      state.ids = action.payload.ids;\r\n      state.type = action.payload.type;\r\n      state.data = {};\r\n    },\r\n    closeAssetLabelPrintDialog(state, action: PayloadAction) {\r\n      state.open = false;\r\n      state.ids = [];\r\n      state.data = {};\r\n      state.printState = {};\r\n    },\r\n\r\n    print(state, action: PayloadAction<IPrintAssetLabelArgs>) {\r\n      init(state.printState);\r\n      state.selectedPrinter = action.payload.printer ?? null;\r\n      state.selectedTemplate = action.payload.template ?? null;\r\n    },\r\n    print_Success(state, action: PayloadAction<any>) {\r\n      state.data = {};\r\n      state.open = false;\r\n      resolve(state.printState, null);\r\n    },\r\n    print_Error(state, action: PayloadAction<any>) {\r\n      reject(state.printState, action.payload);\r\n    },\r\n\r\n    download(state, action: PayloadAction<IPrintAssetLabelArgs>) {\r\n      init(state.printState);\r\n      state.selectedPrinter = action.payload.printer ?? null;\r\n      state.selectedTemplate = action.payload.template ?? null;\r\n    },\r\n    download_Success(state, action: PayloadAction<any>) {\r\n      state.data = {};\r\n      state.open = false;\r\n      resolve(state.printState, null);\r\n    },\r\n    download_Error(state, action: PayloadAction<any>) {\r\n      reject(state.printState, action.payload);\r\n    },\r\n\r\n    preview(state, action: PayloadAction<IPrintAssetLabelArgs>) {\r\n      init(state.printState);\r\n      state.selectedPrinter = action.payload.printer ?? null;\r\n      state.selectedTemplate = action.payload.template ?? null;\r\n    },\r\n    preview_Success(state, action: PayloadAction<any>) {\r\n      state.data = {};\r\n      state.open = false;\r\n      resolve(state.printState, null);\r\n    },\r\n    preview_Error(state, action: PayloadAction<any>) {\r\n      reject(state.printState, action.payload);\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: labelPrintActions } = slice;\r\n\r\nexport const useLabelPrintSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: labelPrintSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useLabelPrintSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { ITrainingLevelFilterDto } from 'api/odata/generated/entities/ITrainingLevelFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataOperators,\r\n  quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface TrainingLevelPickerProps\r\n  extends Omit<AutocompletePickerProps<ITrainingLevelFilterDto>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/TrainingLevelFilter';\r\nexport const initTrainingLevelData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<ITrainingLevelFilterDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<ITrainingLevelFilterDto>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'ServiceGroupId',\r\n      'ExpiredDays',\r\n      'MustOrderEveryDays',\r\n      'MustUseEveryDays',\r\n      'LevelEquipments',\r\n      'UPGroups',\r\n      'UPEquipments',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<ITrainingLevelFilterDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\nexport const loadTrainingLevels = loadData;\r\nexport function TrainingLevelPicker(props: TrainingLevelPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    globalServiceGroupFilter || [],\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'TrainingLevelPicker'}\r\n      loadData={innerLoadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function TrainingLevelFilter(\r\n  equipments: IServiceFilterDto[],\r\n  trainingLevelPermissionsEnabled,\r\n  userPermissionsEnabled,\r\n): (string | Condition<ITrainingLevelFilterDto>)[] {\r\n  const predicates: (string | Condition<ITrainingLevelFilterDto>)[] = [];\r\n  if (!!equipments && equipments.length > 0) {\r\n    if (trainingLevelPermissionsEnabled) {\r\n      predicates.push(\r\n        equipments\r\n          .map(eq => {\r\n            if (eq.UseServiceGroupTrainingLevels) {\r\n              return `(ServiceGroupId eq null or ServiceGroupId eq ${quoteODataValue(\r\n                eq.ServiceGroupId,\r\n              )})`;\r\n            } else {\r\n              return `LevelEquipments/any(g: g eq ${quoteODataValue(eq.Id)})`;\r\n            }\r\n          })\r\n          .join(' or '),\r\n      );\r\n    } else if (userPermissionsEnabled) {\r\n      // noop - clients could not select training level that was not part of user or group permissions on selected equipment they needed on uchicago\r\n      // should be properly resolved in https://prog4biz.atlassian.net/browse/BKT-8190\r\n    }\r\n    if (predicates.length > 0) {\r\n      return predicates;\r\n    }\r\n    return [];\r\n  } else {\r\n    return [];\r\n  }\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AutocompleteMultiPickerExProps } from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { AssetsPicker } from '../../MultiSelectPickers/AssetsPicker';\r\n\r\nexport interface AssetMultiPickerProps\r\n  extends AutocompleteMultiPickerExProps<IAssetDto> {}\r\n\r\nconst url = '/api/odata/v4/AssetNames';\r\n\r\nexport const initAssetMultiData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return Promise.resolve([] as IAssetDto[]);\r\n  }\r\n  const ids = initval.split('|').map(v => parseInt(v));\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $top: number;\r\n  } = {\r\n    $orderby: 'Id asc',\r\n    $filter: '(Id in (' + ids.join(',') + '))',\r\n    $top: ids.length,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as IAssetDto[]);\r\n};\r\n\r\nexport const AssetMultiPicker = (props: AssetMultiPickerProps) => {\r\n  return <AssetsPicker {...props} />;\r\n};\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AssetsPicker } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const AssetMultiFilter = (props: IFilterComponentProps) => {\r\n  const {\r\n    onChange,\r\n    value,\r\n    additionalItem,\r\n    customData,\r\n    withoutServiceGroups,\r\n    urlType,\r\n    dateTimeClear,\r\n    label,\r\n    labelFunc,\r\n    onOpen,\r\n    onClose,\r\n    open,\r\n    fullWidth,\r\n    ...other\r\n  } = props;\r\n  const handleChange = (value: Entity<Number>[]) => {\r\n    onChange(value);\r\n  };\r\n  return (\r\n    <AssetsPicker\r\n      onChange={handleChange}\r\n      value={value as IAssetDto[]}\r\n      restrictByAvType=\"serviceRelated\"\r\n      size=\"small\"\r\n      {...other}\r\n    />\r\n  );\r\n};\r\nexport const AssetWorkOrderMultiFilter = (props: IFilterComponentProps) => {\r\n  const {\r\n    onChange,\r\n    value,\r\n    additionalItem,\r\n    customData,\r\n    withoutServiceGroups,\r\n    urlType,\r\n    dateTimeClear,\r\n    label,\r\n    labelFunc,\r\n    onOpen,\r\n    onClose,\r\n    open,\r\n    ...other\r\n  } = props;\r\n  const handleChange = (value: Entity<Number>[]) => {\r\n    onChange(value);\r\n  };\r\n  return (\r\n    <AssetsPicker\r\n      onChange={handleChange}\r\n      value={value as IAssetDto[]}\r\n      restrictByAvType=\"workOrderRelated\"\r\n      variant=\"standard\"\r\n      size=\"small\"\r\n      {...other}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * RoomPickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { LocationPicker } from 'app/components/pickers/AutocompletePickers/LocationPicker';\r\n\r\nexport const LocationPickerFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <LocationPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default LocationPickerFilter;\r\n","import { Avatar, makeStyles } from '@material-ui/core';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { selectAppSettings, selectLoading } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface CustomerLogoProps {\r\n  height?: string | number;\r\n  width?: string | number;\r\n}\r\nconst useStyles = makeStyles(theme => ({\r\n  root: {\r\n    '&>img': {\r\n      objectFit: 'contain',\r\n    },\r\n  },\r\n}));\r\nexport const CustomerLogo = React.memo(function CustomerLogo(\r\n  props: CustomerLogoProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const appSettings: AppSettings | null = useSelector(selectAppSettings);\r\n  const isLoading = useSelector(selectLoading);\r\n  const { height, width } = props;\r\n  const classes = useStyles();\r\n  const [customerLink, setCustomerLink] = React.useState<string | undefined>(\r\n    undefined,\r\n  );\r\n  const [customerImg, setCustomerImg] = React.useState<string | undefined>(\r\n    undefined,\r\n  );\r\n  React.useEffect(() => {\r\n    let active = !isLoading;\r\n    if (active) {\r\n      let link = appSettings?.TopCustomerLogoLink;\r\n      let img = appSettings?.TopCustomerLogo;\r\n      if (link !== undefined && link !== '') {\r\n        setCustomerLink(link);\r\n      }\r\n      if (img !== undefined && img !== '') {\r\n        setCustomerImg(img);\r\n        console.log(toRootedURL(img));\r\n      }\r\n    } else {\r\n      setCustomerLink(undefined);\r\n      setCustomerImg(undefined);\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [appSettings, isLoading]);\r\n  return (\r\n    <Link\r\n      href={customerLink || 'https://bookit-lab.com'}\r\n      aria-label=\"customer logo\"\r\n    >\r\n      <Avatar\r\n        className={classes.root}\r\n        variant=\"square\"\r\n        alt={t(translations.CompanyLogo)}\r\n        src={toRootedURL(customerImg || '/ctl/DS/Default/logo.png')}\r\n        style={{\r\n          height: `${height || 36}px`,\r\n          width: !!width ? `${width}px` : 'auto',\r\n        }}\r\n      />\r\n    </Link>\r\n  );\r\n});\r\n","/**\r\n *\r\n * CampusPickerFilter\r\n *\r\n */\r\nimport { CampusPicker } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const CampusPickerFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <CampusPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n      urlType={props.urlType}\r\n    />\r\n  );\r\n};\r\nexport default CampusPickerFilter;\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { downloadFile } from 'utils/url-utils';\r\nimport { SelectedRowsActionIconButton } from '../BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface ExportQRCodesButtonProps {\r\n  url: string;\r\n  rows: Array<Identifiable<number>>;\r\n  toggleAllRowsSelected?: (value?: boolean) => void;\r\n}\r\n\r\nexport function ExportQRCodesButton({\r\n  url,\r\n  rows,\r\n  toggleAllRowsSelected,\r\n}: ExportQRCodesButtonProps) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <SelectedRowsActionIconButton\r\n      key=\"downloadQR\"\r\n      text={t(translations.ExportQR)}\r\n      title={t(translations.ExportQR)}\r\n      confirm={false}\r\n      validConfirm={true}\r\n      confirmTitle={t(translations.ExportQR) as string}\r\n      rows={rows}\r\n      toggleAllRowsSelected={toggleAllRowsSelected}\r\n      variantButton=\"button\"\r\n      action={() =>\r\n        new Promise(async resolve => {\r\n          let ids = rows.map(row => row.Id).join(',');\r\n          let path = url + `?id=${ids}`;\r\n          try {\r\n            await downloadFile({ path: path });\r\n            resolve({\r\n              ErrorMessages: [],\r\n              SuccessMessages: [],\r\n              WarningMessages: [],\r\n            });\r\n          } catch (err) {\r\n            console.debug(err);\r\n            resolve({\r\n              ErrorMessages: [\r\n                'Some thing went wrong, please check the Name or Qr Code of the Asset!',\r\n              ],\r\n              SuccessMessages: [],\r\n              WarningMessages: [],\r\n            });\r\n          }\r\n        })\r\n      }\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AreasPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface AreasPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/AreasFilter';\r\nexport const initAreasData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  searchTerm: string | null,\r\n  predicates?: (string | Condition<any>)[],\r\n) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null || predicates !== undefined) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: predicates !== undefined ? predicates : [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\n\r\nexport function AreasPicker(props: AreasPickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n      id={props.id || 'AreasId'}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Default.EmailType\r\n *\r\n */\r\n\r\nexport enum EmailType {\r\n  Invoice = 0,\r\n  Request = 1,\r\n  Reservation = 2,\r\n  User = 3,\r\n  PaymentLetter = 4,\r\n  Budget = 5,\r\n  BudgetComment = 6,\r\n  OfflineService = 7,\r\n  Eln = 8,\r\n  Alert = 9,\r\n  DataStore = 10,\r\n  SAP = 11,\r\n  Equipment = 12,\r\n  Asset = 13,\r\n  TrainingSession = 14,\r\n  ServiceGroup = 15,\r\n  BudgetExpirement = 16,\r\n  InstrumentNotifications = 17,\r\n  WorkFlowBooking = 18,\r\n  Cage = 19,\r\n  InquiryAlert = 20,\r\n  UserGroup = 21,\r\n  LoanDesk = 22,\r\n  Training = 23,\r\n  RequestComment = 24,\r\n  DownTime = 25,\r\n  ExternalBillingError = 26,\r\n  GenerateInvoice = 27,\r\n  InstituteQuarter = 28,\r\n  RequestMilestones = 29,\r\n  Custom = 30,\r\n  Subscription = 31,\r\n  Article = 31,\r\n}\r\nexport type EmailTypeUnion = keyof typeof EmailType;\r\nexport const EmailTypeUnionArray: Array<EmailTypeUnion> = [\r\n  'Invoice',\r\n  'Request',\r\n  'Reservation',\r\n  'User',\r\n  'PaymentLetter',\r\n  'Budget',\r\n  'BudgetComment',\r\n  'OfflineService',\r\n  'Eln',\r\n  'Alert',\r\n  'DataStore',\r\n  'SAP',\r\n  'Equipment',\r\n  'Asset',\r\n  'TrainingSession',\r\n  'ServiceGroup',\r\n  'BudgetExpirement',\r\n  'InstrumentNotifications',\r\n  'WorkFlowBooking',\r\n  'Cage',\r\n  'InquiryAlert',\r\n  'UserGroup',\r\n  'LoanDesk',\r\n  'Training',\r\n  'RequestComment',\r\n  'DownTime',\r\n  'ExternalBillingError',\r\n  'GenerateInvoice',\r\n  'InstituteQuarter',\r\n  'RequestMilestones',\r\n  'Custom',\r\n  'Subscription',\r\n  'Article',\r\n];\r\n","/**\r\n *\r\n * BasicDialogTitle\r\n *\r\n */\r\nimport {\r\n  Box,\r\n  createStyles,\r\n  DialogTitle as MuiDialogTitle,\r\n  makeStyles,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { Body } from '../Typography';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { H3 } from '../Typography';\r\nconst titleStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      margin: 0,\r\n      padding: theme.spacing(3, 3, 1, 4),\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      width: '100%',\r\n      background: theme.palette.background.default,\r\n      //borderRadius: '12px 12px 0px 0px',\r\n    },\r\n    titleContainer: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n    },\r\n    titleBody: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'space-between',\r\n      alignItems: 'center',\r\n      padding: '0px',\r\n    },\r\n    titleSubtitle: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'space-between',\r\n      alignItems: 'center',\r\n      padding: '0px',\r\n    },\r\n    closeButton: {\r\n      position: 'absolute',\r\n      right: theme.spacing(1),\r\n      top: theme.spacing(1),\r\n      color: theme.palette.grey[500],\r\n    },\r\n    title: {\r\n      margin: 0,\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n    },\r\n    subtitle: {},\r\n  }),\r\n);\r\nexport interface BasicDialogTitleProps {\r\n  id?: string;\r\n  children: React.ReactNode;\r\n  subtitle?: React.ReactNode;\r\n  onClose?: () => void;\r\n}\r\nexport function BasicDialogTitle(props: BasicDialogTitleProps) {\r\n  const { id, children, subtitle, onClose, ...other } = props;\r\n  const classes = titleStyles();\r\n  return (\r\n    <MuiDialogTitle disableTypography className={classes.root} {...other}>\r\n      <Box className={classes.titleContainer}>\r\n        <Box className={classes.titleBody}>\r\n          <H3 className={classes.title}>{children}</H3>\r\n        </Box>\r\n        {subtitle && (\r\n          <Box className={classes.titleSubtitle}>\r\n            <Body className={classes.subtitle}>{subtitle}</Body>\r\n          </Box>\r\n        )}\r\n\r\n        {onClose ? (\r\n          <IconButton\r\n            variant=\"ghost\"\r\n            aria-label=\"close\"\r\n            size=\"small\"\r\n            className={classes.closeButton}\r\n            shape=\"square\"\r\n            onClick={onClose}\r\n          >\r\n            <Icon icon=\"xmark\" />\r\n          </IconButton>\r\n        ) : null}\r\n      </Box>\r\n    </MuiDialogTitle>\r\n  );\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { ToggleButton, ToggleButtonProps } from '@material-ui/lab';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ButtonsVariant } from '../Button';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface BaseToggleButtonProps\r\n  extends Omit<ToggleButtonProps, 'variant'> {\r\n  disabled?: boolean;\r\n  children?: React.ReactNode;\r\n  processing?: boolean;\r\n  variant?: ButtonsVariant;\r\n  fullWidth?: boolean;\r\n  component?: any;\r\n  to?: string;\r\n  target?: string;\r\n  mainIcon?: IconProp;\r\n  startIcon?: IconProp;\r\n  endIcon?: IconProp;\r\n  separated?: boolean;\r\n}\r\n\r\nexport const BaseToggleButton = React.forwardRef<\r\n  HTMLButtonElement,\r\n  BaseToggleButtonProps\r\n>(function BaseToggleButton(\r\n  {\r\n    children,\r\n    disabled,\r\n    processing,\r\n    size,\r\n    variant,\r\n    component,\r\n    title,\r\n    to,\r\n    mainIcon,\r\n    fullWidth,\r\n    separated,\r\n    startIcon,\r\n    endIcon,\r\n    ...props\r\n  },\r\n  ref,\r\n) {\r\n  const handleClick = (e: any) => {\r\n    if (props.onClick) {\r\n      props.onClick(e);\r\n    }\r\n  };\r\n  const WithTitle = React.forwardRef(\r\n    (\r\n      {\r\n        children,\r\n        title,\r\n      }: { children: React.ReactNode; title: React.ReactChild },\r\n      ref,\r\n    ) => (\r\n      <Tooltip title={title} ref={ref}>\r\n        <span className={'withTitle'}>{children}</span>\r\n      </Tooltip>\r\n    ),\r\n  );\r\n  const startIconComponent = startIcon && (\r\n    <span className={clsx('startIcon', `iconSize${capitalize(size)}`)}>\r\n      <Icon icon={startIcon} />\r\n    </span>\r\n  );\r\n  const endIconComponent = endIcon && (\r\n    <span className={clsx('endIcon', `iconSize${capitalize(size)}`)}>\r\n      <Icon icon={endIcon} />\r\n    </span>\r\n  );\r\n  return title ? (\r\n    <WithTitle title={title}>\r\n      <ToggleButton\r\n        variant={\r\n          variant === 'text' || variant === 'textGray' ? 'text' : undefined\r\n        }\r\n        size={size}\r\n        disabled={(processing || disabled) ?? false}\r\n        ref={ref}\r\n        component={component}\r\n        disableFocusRipple\r\n        onClick={event => {\r\n          handleClick(event);\r\n        }}\r\n        className={props.className}\r\n        {...props}\r\n      >\r\n        {mainIcon !== undefined ? (\r\n          <span className={clsx('mainIcon', `iconSize${capitalize(size)}`)}>\r\n            <Icon icon={mainIcon as IconProp} />\r\n          </span>\r\n        ) : !!startIcon || !!endIcon ? (\r\n          <React.Fragment>\r\n            {!!startIconComponent && startIconComponent}\r\n            <span className={'buttonLabel'}>{children}</span>\r\n            {!!endIconComponent && endIconComponent}\r\n          </React.Fragment>\r\n        ) : (\r\n          <span className={'buttonLabel'}>{children}</span>\r\n        )}\r\n      </ToggleButton>\r\n    </WithTitle>\r\n  ) : (\r\n    <ToggleButton\r\n      variant={\r\n        variant === 'text' || variant === 'textGray' ? 'text' : undefined\r\n      }\r\n      size={size}\r\n      disabled={(processing || disabled) ?? false}\r\n      ref={ref}\r\n      component={component}\r\n      onClick={event => {\r\n        handleClick(event);\r\n      }}\r\n      className={props.className}\r\n      {...props}\r\n    >\r\n      {mainIcon !== undefined ? (\r\n        <span className={clsx('mainIcon', `iconSize${capitalize(size)}`)}>\r\n          <Icon icon={mainIcon as IconProp} />\r\n        </span>\r\n      ) : !!startIcon || !!endIcon ? (\r\n        <React.Fragment>\r\n          {!!startIconComponent && startIconComponent}\r\n          <span className={'buttonLabel'}>{children}</span>\r\n          {!!endIconComponent && endIconComponent}\r\n        </React.Fragment>\r\n      ) : (\r\n        <span className={'buttonLabel'}>{children}</span>\r\n      )}\r\n    </ToggleButton>\r\n  );\r\n});\r\n","import { ToggleButtonGroup, ToggleButtonGroupProps } from '@material-ui/lab';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { EntityType } from 'types/common';\r\nimport clsx from 'clsx';\r\nimport { FormHelperText } from '@material-ui/core';\r\nimport { BaseOptionsPicker } from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { IsEntityType } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { ButtonsVariant } from '../Button';\r\nimport { BaseToggleButton } from '../BaseToggleButton';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface ToggleEntityType extends EntityType {\r\n  icon?: IconProp;\r\n  title?: string;\r\n  disabled?: boolean;\r\n  startIcon?: IconProp;\r\n  endIcon?: IconProp;\r\n}\r\nexport interface BaseToggleButtonGroupProps<T extends ToggleEntityType>\r\n  extends Omit<ToggleButtonGroupProps, 'onChange'> {\r\n  variant?: ButtonsVariant;\r\n  options: Array<T>;\r\n  otherOptions?: Array<T>;\r\n  value: T | null;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  label?: string;\r\n  onChange: (value: T | null) => void;\r\n  fullWidth?: boolean;\r\n  compact?: boolean;\r\n  separated?: boolean;\r\n  name?: string;\r\n  disabled?: boolean;\r\n}\r\n\r\nfunction BaseToggleButtonGroupInner<T extends ToggleEntityType>(\r\n  props: BaseToggleButtonGroupProps<T>,\r\n  ref: React.ForwardedRef<HTMLDivElement>,\r\n) {\r\n  const {\r\n    variant = 'ghost',\r\n    size = 'medium',\r\n    options,\r\n    otherOptions,\r\n    value,\r\n    orientation = 'horizontal',\r\n    error,\r\n    helperText,\r\n    onChange,\r\n    fullWidth,\r\n    compact,\r\n    separated = true,\r\n    exclusive,\r\n    name,\r\n    label,\r\n    disabled,\r\n    ...other\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const [toggleValue, setToggleValue] = React.useState(value);\r\n  React.useEffect(() => {\r\n    setToggleValue(value);\r\n  }, [value]);\r\n  const handleOtherChange = React.useCallback(\r\n    (newValue: T | null) => {\r\n      if (newValue?.Id !== toggleValue?.Id) {\r\n        setToggleValue(newValue);\r\n        onChange(newValue);\r\n      }\r\n    },\r\n    [onChange, toggleValue?.Id],\r\n  );\r\n\r\n  const handleToggleValue = React.useCallback(\r\n    (event, newViewType: T) => {\r\n      if (IsEntityType(event)) {\r\n        handleOtherChange(event as T);\r\n      } else {\r\n        if (newViewType.Id !== toggleValue?.Id) {\r\n          setToggleValue(newViewType);\r\n          onChange(newViewType);\r\n        }\r\n      }\r\n    },\r\n    [handleOtherChange, onChange, toggleValue?.Id],\r\n  );\r\n\r\n  // const isMobile = DetectIsMobile();\r\n  // const settings = React.useMemo(\r\n  //   () => ({\r\n  //     size: size,\r\n  //     variant: variant,\r\n  //     orientation: orientation,\r\n  //     separated: separated,\r\n  //   }),\r\n  //   [orientation, separated, size, variant],\r\n  // );\r\n  // const classes = toggleButtonGroupStyle(settings);\r\n  return (\r\n    <ToggleButtonGroup\r\n      ref={ref}\r\n      value={toggleValue}\r\n      exclusive={exclusive || true}\r\n      onChange={handleToggleValue}\r\n      aria-label={label || 'group buttons'}\r\n      className={clsx(`variant${capitalize(variant)} size${capitalize(size)}`, {\r\n        errorBorder: error,\r\n        fullWidth: fullWidth,\r\n        separated: separated,\r\n      })}\r\n      // classes={{\r\n      //   root: classes.root,\r\n      //   groupedHorizontal: classes.groupedHorizontal,\r\n      //   groupedVertical: classes.groupedVertical,\r\n      // }}\r\n      size={size}\r\n      orientation={orientation}\r\n      {...other}\r\n    >\r\n      {options.map((option, index) => (\r\n        <BaseToggleButton\r\n          size={size}\r\n          key={`option_${index}_${option.Id}`}\r\n          value={option}\r\n          title={option.title}\r\n          selected={option.Id === value?.Id}\r\n          fullWidth={fullWidth}\r\n          disabled={disabled || option.disabled}\r\n          className={clsx(\r\n            `variant${capitalize(variant)} size${capitalize(size)}`,\r\n            {\r\n              fullWidthButton: fullWidth,\r\n              separated: separated,\r\n              hasStartIcon: option.startIcon !== undefined,\r\n              hasEndIcon: option.endIcon !== undefined,\r\n              hasMainIcon: option.icon !== undefined,\r\n              fullWidth: fullWidth,\r\n              withTitle: option.title !== undefined,\r\n            },\r\n          )}\r\n          mainIcon={option.icon}\r\n          startIcon={option.startIcon}\r\n          endIcon={option.endIcon}\r\n          variant={variant}\r\n        >\r\n          {(compact !== true || option.icon === undefined) && (\r\n            <span>{option.Name}</span>\r\n          )}\r\n        </BaseToggleButton>\r\n      ))}\r\n      {otherOptions !== undefined && otherOptions.length > 0 && (\r\n        <BaseOptionsPicker\r\n          disabled={disabled}\r\n          variant=\"filled\"\r\n          getOptions={() => otherOptions || []}\r\n          onChange={handleOtherChange}\r\n          placeholder={t(translations.Other)}\r\n          value={value}\r\n          size={size === 'large' ? 'medium' : size}\r\n        />\r\n      )}\r\n      {helperText !== undefined && (\r\n        <FormHelperText error={error}>{helperText}</FormHelperText>\r\n      )}\r\n    </ToggleButtonGroup>\r\n  );\r\n}\r\nexport const BaseToggleButtonGroup = React.forwardRef(\r\n  BaseToggleButtonGroupInner,\r\n);\r\n","/**\r\n *\r\n * FilterContainer\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  Box,\r\n  createStyles,\r\n  Dialog,\r\n  DialogContent,\r\n  DialogTitle,\r\n  makeStyles,\r\n  Paper,\r\n  styled,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Popper } from 'app/components/Popper';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterSettings } from '../BasicFilter/IFilterSettings';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport useGlobalDOMEvents from 'app/hooks/useGlobalDomEvents';\r\nimport clsx from 'clsx';\r\nimport { IsEmptyArray } from '../BasicFilter/AppliedFilterComponent';\r\n\r\ninterface FilterContainerProps<TRow> {\r\n  open: boolean;\r\n  onClose: () => void;\r\n  children: React.ReactNode;\r\n  anchorEl: any;\r\n  appliedFilters: IFilterSettings<TRow>[];\r\n  onChange: (items: IFilterSettings<TRow>[]) => void;\r\n  compact?: boolean;\r\n}\r\nconst useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    filterRoot: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n      gap: 16,\r\n      height: '100%',\r\n      overflow: 'hidden',\r\n      maxWidth: 700,\r\n    },\r\n    scrollPaperCompact: {\r\n      alignItems: 'flex-start',\r\n      justifyContent: 'flex-end',\r\n    },\r\n    scrollPaper: {\r\n      paddingTop: 40,\r\n    },\r\n  }),\r\n);\r\n\r\nexport function FilterContainer<TRow>({\r\n  anchorEl,\r\n  onClose,\r\n  onChange,\r\n  open,\r\n  children,\r\n  compact,\r\n  ...props\r\n}: FilterContainerProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const handleClose = () => {\r\n    onClose();\r\n  };\r\n  // save provided applied filters to be used in change callbacks\r\n  const [, setVisibleFilters] = React.useState<IFilterSettings<TRow>[]>(\r\n    props.appliedFilters,\r\n  );\r\n\r\n  // refresh applied filters if they were changed from outside\r\n  React.useEffect(() => {\r\n    setVisibleFilters(props.appliedFilters);\r\n  }, [props.appliedFilters]);\r\n\r\n  // const handleClearClick = () => {\r\n  //   setVisibleFilters(currentState => {\r\n  //     const newState = currentState.map(f => ({ ...f, ...{ value: null } }));\r\n  //     onChange(newState);\r\n  //     return newState;\r\n  //   });\r\n  //   if (isMobile || compact) {\r\n  //     onClose();\r\n  //   }\r\n  // };\r\n  const elementRef = React.useRef<HTMLDivElement>(null);\r\n  // manually trigger rerender using a useless usState hook\r\n  // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n  const countState = React.useState(0);\r\n  React.useEffect(() => {\r\n    countState[1](c => c + 1);\r\n    // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [elementRef.current]);\r\n  const classes = useStyles();\r\n  const appliedFitltersCount = props.appliedFilters.filter(\r\n    f =>\r\n      f.value !== null &&\r\n      f.value !== undefined &&\r\n      f.value !== '' &&\r\n      !IsEmptyArray(f.value),\r\n  ).length;\r\n\r\n  useGlobalDOMEvents({\r\n    keyup(ev) {\r\n      if ((ev as KeyboardEvent).key === 'Escape') {\r\n        onClose();\r\n      }\r\n    },\r\n  });\r\n\r\n  const title = `${t(translations.Filters)} (${appliedFitltersCount})`;\r\n  if (isMobile || compact) {\r\n    return (\r\n      <Dialog\r\n        fullScreen={isMobile}\r\n        open={open}\r\n        onClose={handleClose}\r\n        PaperComponent={StyledDialogPaper}\r\n        BackdropProps={{\r\n          invisible: true,\r\n        }}\r\n        className={clsx({\r\n          [classes.scrollPaperCompact]: compact,\r\n          [classes.scrollPaper]: !compact,\r\n        })}\r\n      >\r\n        {/* <Box className={classes.filterPanel}>\r\n          <Box component=\"div\" className={classes.filterRoot}>\r\n            \r\n          </Box>\r\n        </Box> */}\r\n        <DialogTitle>\r\n          {title}\r\n          <IconButton\r\n            aria-label=\"close\"\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            shape=\"square\"\r\n            onClick={() => {\r\n              onClose();\r\n            }}\r\n            style={{ position: 'absolute', right: 4, top: 4 }}\r\n          >\r\n            <Icon icon=\"times\" />\r\n          </IconButton>\r\n        </DialogTitle>\r\n        <DialogContent\r\n          style={\r\n            isMobile ? { overflow: 'hidden', padding: '8px 16px' } : undefined\r\n          }\r\n        >\r\n          {\r\n            <Box\r\n              style={{\r\n                display: 'flex',\r\n                flexDirection: 'column',\r\n                gap: 8,\r\n                height: '100%',\r\n                width: '100%',\r\n              }}\r\n            >\r\n              {children}\r\n            </Box>\r\n          }\r\n        </DialogContent>\r\n        {/* <DialogActions>\r\n          <Button\r\n            size=\"small\"\r\n            color=\"primary\"\r\n            onClick={() => onClose()}\r\n            aria-label={t(translations.apply)}\r\n          >\r\n            {t(translations.apply)}\r\n          </Button>\r\n          <Button\r\n            size=\"small\"\r\n            color=\"primary\"\r\n            onClick={handleClearClick}\r\n            aria-label={t(translations.ClearAll)}\r\n          >\r\n            {t(translations.ClearAll)}\r\n          </Button>\r\n        </DialogActions> */}\r\n      </Dialog>\r\n    );\r\n  } else {\r\n    return (\r\n      <>\r\n        <Popper\r\n          id=\"basic-filter-group-popover\"\r\n          open={open}\r\n          anchorEl={anchorEl}\r\n          title={title}\r\n          onClose={() => onClose()}\r\n          clickAway={true}\r\n          clickAwayFunc={e => {\r\n            onClose();\r\n          }}\r\n          maxWidth={'fit-content'}\r\n        >\r\n          <div\r\n            className={classes.filterRoot}\r\n            ref={elementRef}\r\n            role=\"presentation\"\r\n          >\r\n            <>{children}</>\r\n          </div>\r\n        </Popper>\r\n      </>\r\n    );\r\n  }\r\n}\r\n// const StyledDialog = styled(Dialog)(({ theme }) => ({\r\n//   paddingTop: theme.spacing(5),\r\n// }));\r\nconst StyledDialogPaper = styled(Paper)(({ theme }) => ({\r\n  borderTopLeftRadius: theme.shape.borderRadius,\r\n  borderTopRightRadius: theme.shape.borderRadius,\r\n  margin: 0,\r\n}));\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n  GetRawValue,\r\n  splitFilterValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\n\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { PageTopActionsProps } from '../type';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { ReservationCreateButton } from 'app/components/ReservationCreateButton';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport function AddReservation({\r\n  size,\r\n  text,\r\n  variant,\r\n  icon,\r\n  isIconButton,\r\n  useSidePanel,\r\n  isExpanded,\r\n  compact = true,\r\n  ...props\r\n}: PageTopActionsProps) {\r\n  const location = useLocation();\r\n  const { openPanel } = useSidePanelState();\r\n  const isMobile = DetectIsMobile();\r\n  const { t } = useTranslation();\r\n\r\n  const EnableLegacyScheduler = useSelector(\r\n    selectGlobalDbSetting_EnableLegacyScheduler,\r\n  );\r\n\r\n  const serviceIdsRawValue = GetRawValue(\r\n    new URLSearchParams(location.search),\r\n    'selectedIds',\r\n  );\r\n  const serviceIds =\r\n    serviceIdsRawValue === undefined || serviceIdsRawValue === null\r\n      ? []\r\n      : (splitFilterValue(serviceIdsRawValue)\r\n          .map(tryParseInt)\r\n          .filter(f => f !== undefined) as number[]);\r\n\r\n  if (EnableLegacyScheduler && serviceIds.length > 0) {\r\n    return <ReservationCreateButton instruments={serviceIds} />;\r\n  }\r\n  return (\r\n    <TopActionButton\r\n      text={text || (t(translations.AddReservation) as string)}\r\n      icon={icon || 'plus'}\r\n      startIcon={icon || 'plus'}\r\n      variant={\r\n        isMobile && compact && !isIconButton ? 'ghost' : variant || 'ghost'\r\n      }\r\n      size={size || 'small'}\r\n      noChangeOnMobile={!compact}\r\n      isIconButton={isIconButton}\r\n      onClick={() => {\r\n        let selParams = {\r\n          useSidePanel: !isMobile && !useSidePanel,\r\n          actionType: 'Reservation',\r\n          serviceIds: GetRawValue(\r\n            new URLSearchParams(location.search),\r\n            'selectedIds',\r\n          ),\r\n        } as AssetsSelectionProps;\r\n        openPanel({\r\n          renderPageType: RenderPageType.AssetsSelection,\r\n          renderPageProps: selParams,\r\n          expanded: isExpanded,\r\n          useSidePanel: useSidePanel,\r\n          isCover: useSidePanel,\r\n        } as SidePanelOpenState);\r\n      }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * ServiceGroupsFilter\r\n *\r\n */\r\nimport { ServiceGroupsPicker } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '..';\r\n\r\nexport const ServiceGroupsFilter = (props: IFilterComponentProps) => {\r\n  const handleChange = (value: Entity<number>[] | undefined) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <ServiceGroupsPicker\r\n      value={props.value ?? []}\r\n      placeholder={t(translations.AllValues)}\r\n      isOpen={props.open}\r\n      onChange={handleChange}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      size=\"small\"\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\n","import { SuperGroupPicker } from 'app/components/pickers/AutocompletePickers/SuperGroupPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const SuperGroupFilter = (props: IFilterComponentProps) => {\r\n  const handleChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <SuperGroupPicker\r\n      onChange={handleChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      size=\"small\"\r\n      predicates={props.predicates}\r\n      urlType={props.urlType}\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * TagsPicker\r\n *\r\n */\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ITagsFilterDto } from 'api/odata/generated/entities/ITagsFilterDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { isNumericPositive } from 'utils/string-utils';\r\n\r\nexport type TagsUrl = 'base' | 'assetBase' | 'public';\r\nexport interface TagsPickerProps\r\n  extends Omit<AutocompleteMultiPickerExProps<ITagsFilterDto>, 'loadData'> {\r\n  inputProps?: InputBaseComponentProps;\r\n  urlType?: TagsUrl;\r\n  separator?: string;\r\n}\r\n\r\nconst url = '/api/odata/v4/TagsFilter';\r\nconst assetTagsUrl = '/api/odata/v4/TagsFilter/AssetTagsFilter';\r\nconst publicAssetTagsUrl = '/api/odata/v4/TagsFilter/PublicAssetTagsFilter';\r\nexport const initTagsData = (\r\n  initval: string | undefined,\r\n  sourceUrl?: TagsUrl,\r\n  separator?: string,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    let ids =\r\n      initval.indexOf(separator || '|') !== -1\r\n        ? initval.split(separator || '|')\r\n        : [initval];\r\n    let intIds: Identifiable<number>[] = [];\r\n\r\n    if (\r\n      ids.filter(f => {\r\n        let test = isNumericPositive(f);\r\n        return test === true;\r\n      }).length === ids.length\r\n    ) {\r\n      intIds = ids.map(item => {\r\n        return { Id: parseInt(item) };\r\n      }) as Identifiable<number>[];\r\n    }\r\n    let strIds =\r\n      intIds.length > 0\r\n        ? []\r\n        : (ids.map(item => {\r\n            return { Id: item };\r\n          }) as Identifiable<string>[]);\r\n    let filters: string | undefined = undefined;\r\n    if (intIds.length > 0) {\r\n      const predicates: (string | Condition<ITagsFilterDto>)[] = [];\r\n      predicates.push(new Condition('Id', ODataOperators.Includes, intIds));\r\n      filters = predicates.map(f => f.toString()).join(' and ');\r\n    } else if (strIds.length > 0) {\r\n      const predicates: (string | Condition<ITagsFilterDto>)[] = [];\r\n      predicates.push(new Condition('Name', ODataOperators.ContainsM, strIds));\r\n      filters = predicates.map(f => f.toString()).join(' and ');\r\n    }\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: filters,\r\n      $select: 'Id,Name,ServiceGroups',\r\n    };\r\n\r\n    let initUrl =\r\n      sourceUrl === 'public'\r\n        ? publicAssetTagsUrl\r\n        : sourceUrl === 'assetBase'\r\n        ? assetTagsUrl\r\n        : url;\r\n\r\n    return httpClient\r\n      .get(initUrl, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<ITagsFilterDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  isAuthenticated?: boolean,\r\n  urlType?: TagsUrl,\r\n) => {\r\n  const sourceUrl =\r\n    urlType === 'public' || !isAuthenticated\r\n      ? publicAssetTagsUrl\r\n      : urlType === 'assetBase'\r\n      ? assetTagsUrl\r\n      : url;\r\n\r\n  return getAutoCompleteLoadDataFn<ITagsFilterDto>({\r\n    url: sourceUrl,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'ServiceGroups'],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<ITagsFilterDto>(\r\n              'ServiceGroups',\r\n              ODataOperators.AnyIn,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\n};\r\n\r\nexport function TagsPicker(props: TagsPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const isAuth = useSelector(selectIsAuthenticated);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    isAuth ? globalServiceGroupFilter || [] : [],\r\n    isAuth,\r\n    props.urlType,\r\n  );\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      id={props.id || 'tagspickerId'}\r\n      freeSolo={props.freeSolo}\r\n      ariaLabel=\"Tags search\"\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * LoanablePicker\r\n *\r\n */\r\nimport { AutocompletePickerProps } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { BaseOptionsPicker } from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport const LoanTypeOptions = [\r\n  {\r\n    Id: 1,\r\n    Name: 'Yes',\r\n  },\r\n  {\r\n    Id: 2,\r\n    Name: 'No',\r\n  },\r\n];\r\n\r\nexport interface LoanablePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nexport const getSingleLoanableType = (val: number): Entity<number> => {\r\n  return LoanTypeOptions.filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const initLoanableData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        LoanTypeOptions.filter(item => {\r\n          return item.Id.toString() === initval;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = LoanTypeOptions;\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function LoanablePicker(props: LoanablePickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * StatusPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface StatusPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/StatusFilter';\r\nexport const initStatusData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function StatusPicker(props: StatusPickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'statuspickerId'}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * LockersPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface LockersPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/LockersFilter';\r\nexport const initLockersData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function LockersPicker(props: LockersPickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'lockerId'}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * SubLocationFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { SubLocationListPicker } from 'app/components/pickers/AutocompletePickers/SubLocationListPicker';\r\n\r\nexport const SubLocationFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <SubLocationListPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default SubLocationFilter;\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    printtopdf: {\r\n      '@media print': {\r\n        '& button': { display: 'none' },\r\n      },\r\n    },\r\n  }),\r\n);\r\n","import { useCallback, useEffect, useRef } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useReactToPrint } from 'react-to-print';\r\nimport { PrintToPDFPopup } from './Components/PrintToPDFPopup';\r\nimport { usePrintPDFSlice } from './slice';\r\nimport styled from 'styled-components';\r\nimport { useStyles } from './Components/PrintStyles';\r\nimport React from 'react';\r\nimport {\r\n  selectPrintPDFisLoading,\r\n  selectPrintPDFSections,\r\n} from './slice/selectors';\r\nimport { H3 } from '../Typography';\r\n\r\nexport interface Printing {\r\n  id: string;\r\n  onLoading?: (id: string, loading: boolean) => void;\r\n  printing: boolean;\r\n}\r\nexport interface PrintToPDFProps {\r\n  title: string;\r\n  children: React.ReactNode;\r\n  print: boolean;\r\n  printTitle: string;\r\n  useSections?: boolean;\r\n  saveMarkedSections?: boolean;\r\n  close: () => void;\r\n}\r\nexport function PrintToPDF(props: PrintToPDFProps) {\r\n  const dispatch = useDispatch();\r\n  const { actions } = usePrintPDFSlice();\r\n  const printPDFSections = useSelector(selectPrintPDFSections);\r\n  const printPDFFisLoading = useSelector(selectPrintPDFisLoading);\r\n  const [startPrinting, setStartPrinting] = React.useState(false);\r\n  const [printing, setPrinting] = React.useState(false);\r\n  const componentRef = useRef(null);\r\n  const promiseResolveRef = useRef<() => void>();\r\n  const handlePrint = useReactToPrint({\r\n    content: () =>\r\n      componentRef.current !== undefined ? componentRef.current : null,\r\n    documentTitle: props.printTitle,\r\n    onAfterPrint: () => {\r\n      setPrinting(false);\r\n      setStartPrinting(false);\r\n      dispatch(actions.setPrinting(false));\r\n      props.close();\r\n    },\r\n    onBeforeGetContent: () => {\r\n      dispatch(actions.setPrinting(true));\r\n      return new Promise<void>(resolve => {\r\n        dispatch(actions.clearLoading());\r\n        setStartPrinting(true);\r\n        promiseResolveRef.current = resolve;\r\n      });\r\n    },\r\n  });\r\n  useEffect(() => {\r\n    if (startPrinting && !printPDFFisLoading) {\r\n      setStartPrinting(false);\r\n      setPrinting(true);\r\n    }\r\n  }, [startPrinting, printPDFFisLoading]);\r\n  useEffect(() => {\r\n    if (printing && promiseResolveRef.current) {\r\n      //setPrinting(false);\r\n      promiseResolveRef.current();\r\n    }\r\n  }, [printing]);\r\n\r\n  const handleSubmit = useCallback(() => {\r\n    if (\r\n      props.saveMarkedSections !== undefined &&\r\n      props.saveMarkedSections === true\r\n    ) {\r\n      dispatch(actions.saveSections());\r\n    }\r\n    handlePrint?.();\r\n  }, [actions, dispatch, handlePrint, props.saveMarkedSections]);\r\n  const classes = useStyles();\r\n  return (\r\n    <>\r\n      {props.print ? (\r\n        <StyledDiv ref={componentRef} className={classes.printtopdf}>\r\n          {!!props.title && (\r\n            <TitleSection>\r\n              <H3>{props.title}</H3>\r\n            </TitleSection>\r\n          )}\r\n          {props.children}\r\n        </StyledDiv>\r\n      ) : (\r\n        <>{props.children}</>\r\n      )}\r\n\r\n      {props.print && (\r\n        <PrintToPDFPopup\r\n          title={props.title}\r\n          show={props.print}\r\n          processing={startPrinting}\r\n          preparing={printPDFFisLoading}\r\n          disabled={printPDFFisLoading}\r\n          items={\r\n            !!props.useSections && printPDFSections !== undefined\r\n              ? printPDFSections\r\n              : []\r\n          }\r\n          onClose={() => {\r\n            props.close();\r\n          }}\r\n          onSubmit={handleSubmit}\r\n          fullWidth={\r\n            !!props.useSections &&\r\n            printPDFSections !== undefined &&\r\n            printPDFSections.length > 0\r\n          }\r\n        />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n/**\r\n * without width: 100% the layout of the PageWrapper breaks by overflowing the PageWrapper (service request details)\r\n */\r\nconst StyledDiv = styled('div')`\r\n  width: 100%;\r\n  height: 100%;\r\n  padding: 16px 32px;\r\n`;\r\nconst TitleSection = styled('div')`\r\n  display: flex;\r\n  align-items: center;\r\n  paddin: 16px;\r\n`;\r\n","export enum AssemblyTypes {\r\n  Normal = 0,\r\n  AssembliesAndNormal = 1,\r\n  AssemblyParts = 2,\r\n  AllEquipments = 3,\r\n}\r\n","/**\r\n *\r\n * FundingTypePicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { AssemblyTypes } from 'enums/InstrumentListAssemblyTypes';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface AssemblyTypePickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSingleAssemblyType = (val: number): Entity<number> => {\r\n  return enumToEntityArray(AssemblyTypes).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const initAssemblyTypeData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        enumToEntityArray(AssemblyTypes).filter(item => {\r\n          return item.Id.toString() === initval;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(AssemblyTypes);\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function AssemblyTypePicker(props: AssemblyTypePickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { StyledFormProps } from '../StyledForm';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport clsx from 'clsx';\r\nimport { Section } from '../wrappers';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\n\r\nexport const StyledFormFieldsContainer = (\r\n  props: Omit<StyledFormProps, 'onSubmit'>,\r\n) => {\r\n  const {\r\n    avoidStyles,\r\n    children,\r\n    sectionStyle,\r\n    isCover,\r\n    noPadding,\r\n    skipShortView,\r\n    ...other\r\n  } = props;\r\n  const { checkIsMobile, isLandscape } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const showShortView =\r\n    (isMobile && !isLandscape) ||\r\n    (sidePanelOpen && !sidePanelExpanded && !skipShortView) ||\r\n    isCover;\r\n  const theme = useTheme();\r\n  return (\r\n    <Section\r\n      theme={theme}\r\n      sidePanelWidth={SIDE_PANEL_WIDTH}\r\n      className={\r\n        avoidStyles\r\n          ? undefined\r\n          : clsx('formsection', {\r\n              shortView: showShortView,\r\n              noPadding: noPadding,\r\n            })\r\n      }\r\n      {...other}\r\n      style={sectionStyle}\r\n    >\r\n      {children}\r\n    </Section>\r\n  );\r\n};\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { FilterValueType } from './BasicFilter/FilterValueType';\r\n\r\n/**\r\n * Returns current value of the filter based on filter's id\r\n * @param allFilters all filters\r\n * @param id filter id\r\n * @returns filter value\r\n */\r\nexport const getFilterValue = function <T>(\r\n  allFilters: Array<IFilterSettings<T>> | undefined,\r\n  id: string,\r\n): FilterValueType | undefined {\r\n  if (allFilters === undefined) {\r\n    return undefined;\r\n  }\r\n  var filter = allFilters.find(f => f.id === id);\r\n  if (filter === undefined) {\r\n    return undefined;\r\n  }\r\n  const value = filter.value;\r\n  return value ?? undefined;\r\n};\r\n","import { Skeleton } from '@material-ui/lab';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nconst SceletonBox = styled('div')`\r\n  display: flex;\r\n  padding-inline: 16px;\r\n`;\r\nexport const SkeletonIfLoading = ({\r\n  loading,\r\n  children,\r\n}: React.PropsWithChildren<{ loading: boolean }>) => {\r\n  if (loading) {\r\n    return (\r\n      <SceletonBox>\r\n        <Skeleton>{children}</Skeleton>\r\n      </SceletonBox>\r\n    );\r\n  }\r\n  return <>{children}</>;\r\n};\r\n","import {\r\n  FormGroupProps as MuiFormGroupProps,\r\n  FormGroup as MuiFormGroup,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FormGroupProps extends MuiFormGroupProps {\r\n  withInfo?: boolean;\r\n  boxed?: boolean;\r\n  boxedChecked?: boolean;\r\n  boxedError?: boolean;\r\n}\r\nconst FormGroup = (props: FormGroupProps) => {\r\n  const {\r\n    withInfo,\r\n    boxed,\r\n    boxedChecked,\r\n    boxedError,\r\n    className,\r\n    ...other\r\n  } = props;\r\n  return (\r\n    <MuiFormGroup\r\n      className={clsx(className, {\r\n        withInfo: withInfo,\r\n        boxed: boxed,\r\n        boxedChecked: boxedChecked,\r\n        boxedError: boxedError,\r\n      })}\r\n      {...other}\r\n    />\r\n  );\r\n};\r\n\r\nexport default FormGroup;\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FilterIconButton } from 'app/components/BasicButtons/FilterIconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface FiltersButtonProps {\r\n  onClick: React.MouseEventHandler<HTMLButtonElement>;\r\n  appliedFiltersLength?: number;\r\n  allFiltersLength?: number;\r\n  innerRef?: React.RefObject<HTMLButtonElement>;\r\n}\r\n\r\nexport function FiltersButton({\r\n  onClick,\r\n  appliedFiltersLength,\r\n  allFiltersLength,\r\n  ...props\r\n}: FiltersButtonProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  if (isMobile) {\r\n    return (\r\n      <FilterIconButton\r\n        filterLength={allFiltersLength ?? 0}\r\n        handleClick={onClick}\r\n      />\r\n    );\r\n  }\r\n  return (\r\n    <Button\r\n      aria-label={t(translations.Filters)}\r\n      variant=\"white\"\r\n      role=\"button\"\r\n      size=\"small\"\r\n      innerRef={props.innerRef}\r\n      onClick={onClick}\r\n      startIcon={<Icon icon=\"filter\" aria-label=\"Filter\" role=\"button\" />}\r\n      endIcon={\r\n        !!appliedFiltersLength && (\r\n          <span className=\"fa-layers fa-fw fa-lg\">\r\n            <Icon icon={['fas', 'circle']} color=\"primary\" colorExtend=\"main\" />\r\n            <span\r\n              className=\"fa-layers-text fa-inverse\"\r\n              style={{\r\n                fontSize: '9px',\r\n                color: bookitColors.primary.bgLight,\r\n              }}\r\n            >\r\n              {appliedFiltersLength}\r\n            </span>\r\n          </span>\r\n        )\r\n      }\r\n    >\r\n      {t(translations.Filters)}\r\n    </Button>\r\n  );\r\n}\r\n","import { initProjectData } from 'app/components/pickers/AutocompletePickers/ProjectPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  initPickerValue,\r\n} from '../../types/FilterParam';\r\nimport { TFunction } from 'i18next';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ProjectFilter } from './index';\r\n\r\n/**\r\n * Produces standard budgets filter settings\r\n * Returns undefined if the budgets are disabled in system settings\r\n * @param params URL search params to fetch the value form\r\n * @param fieldName aka accessor\r\n * @param t TFunction for localization\r\n * @param appSettings AppSettings used to determine if the budgets are enabled\r\n * @returns configured budgets filter\r\n */\r\nexport function getBudgetsFilterSettings<T>(\r\n  params: URLSearchParams,\r\n  fieldName: keyof T,\r\n  t: TFunction,\r\n  appSettings: AppSettings | null,\r\n): IFilterSettings<T> | undefined {\r\n  const id = 'BudgetId';\r\n  if (!IsModuleEnabled(appSettings, KnownModules.Budgets)) {\r\n    return undefined;\r\n  }\r\n  return {\r\n    id: id,\r\n    fieldName: fieldName,\r\n    displayName: t(translations.BudgetNumber),\r\n    operator: ODataOperators.Equals,\r\n    // value: getDefaultFilterValue('bid', params),\r\n    queryStringSerializer: 'bid',\r\n    initData: initPickerValue(initProjectData),\r\n    value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'bid'))),\r\n    component: ProjectFilter,\r\n    urlKey: 'bid',\r\n  };\r\n}\r\n","/**\r\n *\r\n * AvailabilityTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface AvailabilityTypePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/AvailabilityTypesFilter';\r\nexport const initAvailabilityTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n    predicates: [],\r\n    stringColumns: ['Name'],\r\n    stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n  }).toString();\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nconst loadBookableData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  const predicates: (string | Condition<Entity<number>>)[] = [];\r\n  const bookable: number[] = [\r\n    //AvailabilityTypes.ApprovalRequiredBillable as number,\r\n    //AvailabilityTypes.BookableWApproval as number,\r\n    AvailabilityTypes.FreelyBookable as number,\r\n    //AvailabilityTypes.FreelyBookableBillable as number,\r\n    AvailabilityTypes.LectureRoom as number,\r\n    AvailabilityTypes.LoanableEquipment as number,\r\n    AvailabilityTypes.TrainingProgram as number,\r\n  ];\r\n  let filter = `(${bookable\r\n    .map(item =>\r\n      new Condition<Entity<number>>(\r\n        'Id',\r\n        ODataOperators.Equals,\r\n        item,\r\n      ).toString(),\r\n    )\r\n    .join(' or ')})`;\r\n  predicates.push(filter);\r\n\r\n  params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n    predicates: predicates,\r\n    stringColumns: ['Name'],\r\n    stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n  }).toString();\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\n\r\nexport function AvailabilityTypePicker(props: AvailabilityTypePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'AvailabilityTypeId'}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function AvailabilityTypeBookablePicker(\r\n  props: AvailabilityTypePickerProps,\r\n) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'AvailabilityTypeBId'}\r\n      loadData={loadBookableData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import React from 'react';\r\nimport { useAsyncDebounce } from 'react-table';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { TextControlField } from '../BasicInputs/TextControlField';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\n\r\nexport interface IGlobalFilterProps {\r\n  globalFilter?: string;\r\n  setGlobalFilter: (value: string) => void;\r\n  info?: string;\r\n  useRemoveSearch?: boolean;\r\n  placeholder?: string;\r\n}\r\nexport function GlobalFilter({\r\n  globalFilter,\r\n  setGlobalFilter,\r\n  info,\r\n  placeholder,\r\n  useRemoveSearch,\r\n}: IGlobalFilterProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const [value, setValue] = React.useState(globalFilter);\r\n  const onChange = useAsyncDebounce(value => {\r\n    setGlobalFilter(value || undefined);\r\n  }, 200);\r\n\r\n  return (\r\n    <TextControlField\r\n      fullWidth={true}\r\n      style={isMobile ? { width: '100%' } : { width: '290px' }}\r\n      value={value || ''}\r\n      size=\"small\"\r\n      placeholder={placeholder || t(translations.Search)}\r\n      endIcon={\r\n        useRemoveSearch && value !== undefined && value !== '' ? (\r\n          <IconButton\r\n            variant=\"text\"\r\n            size=\"xs\"\r\n            style={{ cursor: 'pointer' }}\r\n            onClick={() => {\r\n              setValue('');\r\n              onChange('');\r\n            }}\r\n          >\r\n            {' '}\r\n            <Icon icon=\"times\" />\r\n          </IconButton>\r\n        ) : !!info ? (\r\n          <Icon icon=\"info-circle\" />\r\n        ) : (\r\n          <Icon icon=\"search\" />\r\n        )\r\n      }\r\n      inputProps={{ 'aria-label': 'table search' }}\r\n      info={info}\r\n      onChange={e => {\r\n        setValue(e.target.value);\r\n        onChange(e.target.value);\r\n      }}\r\n    />\r\n  );\r\n}\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n  bindPopover,\r\n  bindTrigger,\r\n  usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport {\r\n  Box,\r\n  Divider,\r\n  Grid,\r\n  LinearProgress,\r\n  ListItemText,\r\n  MenuItem,\r\n  MenuList,\r\n  Popover,\r\n} from '@material-ui/core';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n  AssetsFilterForWorkOrder,\r\n  AssetsPicker,\r\n  initAssetsData,\r\n} from 'app/components/pickers/MultiSelectPickers/AssetsPicker/index';\r\nimport { initWOTypeDataParams } from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { useLocationChange } from 'app/hooks/useLocationChange';\r\nimport { ButtonsVariant } from 'app/components/BasicButtons/Button';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface NewWorkOrderButtonProps {\r\n  assetIds?: string;\r\n  downtime?: boolean;\r\n  text?: string;\r\n  noChangeOnMobile?: boolean;\r\n  fullWidth?: boolean;\r\n  isIconButton?: boolean;\r\n  variant?: ButtonsVariant;\r\n  initAsset?: IAssetDto;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n  id?: string;\r\n}\r\n\r\nexport const NewWorkOrderButton = (props: NewWorkOrderButtonProps) => {\r\n  const { t } = useTranslation();\r\n  const location = useLocation();\r\n  const { openPanel } = useSidePanelState();\r\n  const {\r\n    assetIds,\r\n    downtime,\r\n    text,\r\n    noChangeOnMobile,\r\n    fullWidth,\r\n    isIconButton,\r\n    variant,\r\n    useSidePanel,\r\n    openPanelWithCover,\r\n    id,\r\n  } = props;\r\n  const popupState = usePopupState({\r\n    variant: 'popover',\r\n    popupId: 'workOrderTypeSelection',\r\n  });\r\n  //const [open, setOpen] = useState<boolean>(false);\r\n  const [assets, setAssets] = React.useState<IAssetDto[] | undefined>(\r\n    undefined,\r\n  );\r\n  const [workTypes, setWorkTypes] = React.useState<\r\n    IWorkOrderTypeDto[] | undefined\r\n  >(undefined);\r\n  const [loadingAsset, setLoadingAssets] = React.useState<boolean | undefined>(\r\n    !!assetIds && !!assets && assets.length < 1,\r\n  );\r\n  const handleAssetChange = React.useCallback(\r\n    (value: IAssetDto[] | []) => {\r\n      setAssets(value);\r\n      setLoadingAssets(true);\r\n      initWOTypeDataParams(value, undefined, downtime).then(types => {\r\n        setWorkTypes(types);\r\n        setLoadingAssets(false);\r\n      });\r\n    },\r\n    [downtime],\r\n  );\r\n  const getParamFromUrl = (name: string): string | undefined => {\r\n    return GetRawValue(new URLSearchParams(location.search), name) ?? undefined;\r\n  };\r\n  const handleWorkTypeClick = (event: IWorkOrderTypeDto) => {\r\n    let params = {\r\n      queryParams: {\r\n        id: undefined,\r\n        aType: event.Id.toString(),\r\n        down: (downtime || getParamFromUrl('down')) && event.AssetAlertType,\r\n        source: getParamFromUrl('source'),\r\n        Up: getParamFromUrl('Up'),\r\n        title: getParamFromUrl('title'),\r\n        eStart: getParamFromUrl('eStart'),\r\n        sympt: getParamFromUrl('sympt'),\r\n        aStatus: getParamFromUrl('aStatus'),\r\n        aStart: getParamFromUrl('aStart'),\r\n        desc: getParamFromUrl('desc'),\r\n        assetId: !!assets ? assets.map(a => a.Id).join(',') : undefined,\r\n        offH:\r\n          (downtime || getParamFromUrl('down')) && event.AssetAlertType\r\n            ? getParamFromUrl('offH')\r\n            : undefined,\r\n        offStart: getParamFromUrl('offStart'),\r\n        offEnd: getParamFromUrl('offStart'),\r\n        reason: getParamFromUrl('reason'),\r\n        eqid: getParamFromUrl('eqid'),\r\n        sid: getParamFromUrl('sid'),\r\n      } as WorkOrderQueryStringParameters,\r\n      useSidePanel: true,\r\n    } as WorkOrderDetailsProps;\r\n    const panelProps = {\r\n      renderPageType: RenderPageType.WorkOrderDetails,\r\n      renderPageProps: params,\r\n      expanded: false,\r\n      useSidePanel: useSidePanel,\r\n      isCover: useSidePanel,\r\n    } as SidePanelOpenState;\r\n\r\n    !!openPanelWithCover\r\n      ? openPanelWithCover(panelProps)\r\n      : openPanel(panelProps);\r\n  };\r\n\r\n  useLocationChange((current: Location, previus: Location) => {\r\n    let ids = getParamFromUrl('aid');\r\n    if ((!!ids && ids !== '') || !!assetIds) {\r\n      setLoadingAssets(true);\r\n      initAssetsData(ids || assetIds).then(response => {\r\n        setAssets(response);\r\n        initWOTypeDataParams(response, undefined, downtime).then(types => {\r\n          setLoadingAssets(false);\r\n          setWorkTypes(types);\r\n        });\r\n      });\r\n    } else {\r\n      setWorkTypes(undefined);\r\n      setAssets(undefined);\r\n      setLoadingAssets(false);\r\n    }\r\n  });\r\n  return (\r\n    <div style={fullWidth ? { width: '100%' } : undefined}>\r\n      <TopActionButton\r\n        text={text ?? (t(translations.AddEvent) as string)}\r\n        id={id}\r\n        title={t(translations.CreateAnAssetRelatedEvent) as string}\r\n        icon=\"plus\"\r\n        startIcon=\"plus\"\r\n        endIcon=\"chevron-down\"\r\n        css={{ marginLeft: '8px' }}\r\n        noChangeOnMobile={noChangeOnMobile}\r\n        isIconButton={isIconButton}\r\n        fullWidth={fullWidth}\r\n        variant={variant}\r\n        {...bindTrigger(popupState)}\r\n      />\r\n      <Popover\r\n        {...bindPopover(popupState)}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'center',\r\n        }}\r\n        transformOrigin={{\r\n          vertical: 'top',\r\n          horizontal: 'center',\r\n        }}\r\n        disableAutoFocus\r\n        PaperProps={{ style: { width: '350px' } }}\r\n      >\r\n        <div style={{ padding: 16 }}>\r\n          <Grid container spacing={2} wrap=\"nowrap\" direction=\"column\">\r\n            <Grid item>\r\n              <Box display=\"row\" justifyContent=\"space-between\">\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.CreateAnAssetRelatedEvent)}\r\n                </Body>\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  aria-label=\"close\"\r\n                  size=\"xs\"\r\n                  style={{ position: 'absolute', right: 8, top: 8 }}\r\n                  onClick={() => {\r\n                    popupState.close();\r\n                    setAssets([]);\r\n                    setWorkTypes([]);\r\n                  }}\r\n                >\r\n                  <Icon icon=\"times\" />\r\n                </IconButton>\r\n              </Box>\r\n            </Grid>\r\n            <Grid item>\r\n              <AssetsPicker\r\n                predicates={AssetsFilterForWorkOrder(undefined)}\r\n                key=\"assetKey\"\r\n                restrictByAvType=\"serviceRelated\"\r\n                onChange={value => {\r\n                  handleAssetChange(value);\r\n                }}\r\n                placeholder={t(translations.QuickWorkOrderPleaseSelectAssets)}\r\n                fullWidth={true}\r\n                name=\"assets\"\r\n                variant=\"filled\"\r\n                id=\"asset-id\"\r\n                label={t(translations.Asset)}\r\n                value={\r\n                  props.initAsset !== undefined\r\n                    ? [props.initAsset]\r\n                    : assets || undefined\r\n                }\r\n                disabled={props.initAsset !== undefined}\r\n              />\r\n            </Grid>\r\n            {loadingAsset && (\r\n              <div style={{ width: '100%' }}>\r\n                <LinearProgress variant=\"query\" color=\"primary\" />\r\n              </div>\r\n            )}\r\n            {assets && assets.length > 0 && (\r\n              <React.Fragment>\r\n                <Grid item>\r\n                  <Divider variant=\"fullWidth\" />\r\n                </Grid>\r\n                <Grid item>\r\n                  <MenuList\r\n                    variant=\"menu\"\r\n                    dense\r\n                    style={{ maxHeight: `${42 * 10}px` }}\r\n                  >\r\n                    <MenuItem>\r\n                      <Body size=\"small\" bold={true}>\r\n                        {t(translations.PleaseSelectAnEventType)}\r\n                      </Body>\r\n                      <Divider />\r\n                    </MenuItem>\r\n                    {workTypes && workTypes.length > 0 ? (\r\n                      workTypes.map(wt => (\r\n                        <MenuItem\r\n                          key={wt.Id}\r\n                          onClick={() => {\r\n                            handleWorkTypeClick(wt);\r\n                            popupState.close();\r\n                            setAssets([]);\r\n                            setWorkTypes([]);\r\n                          }}\r\n                        >\r\n                          <ListItemText>\r\n                            <Body size=\"small\">{wt.Name}</Body>\r\n                          </ListItemText>\r\n                        </MenuItem>\r\n                      ))\r\n                    ) : (\r\n                      <MenuItem>\r\n                        <ListItemText>\r\n                          {t(translations.NoAlertTypesFoundForSelectedAssets)}\r\n                        </ListItemText>\r\n                      </MenuItem>\r\n                    )}\r\n                  </MenuList>\r\n                </Grid>\r\n              </React.Fragment>\r\n            )}\r\n          </Grid>\r\n        </div>\r\n      </Popover>\r\n    </div>\r\n  );\r\n};\r\n","import { MenuItem } from '@material-ui/core';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { WorkOrderApi } from 'api/WorkOrderApi';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useCalendarLink } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { OpenWorkOrderButton } from './OpenWorkOrder';\r\n\r\nexport interface BringBackUpProps<TRow> {\r\n  rows: TRow[];\r\n  getAssetIds: (rows: TRow[]) => number[];\r\n  getEquipmentIds: (rows: TRow[]) => number[];\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function BringBackUp<TRow>({\r\n  rows,\r\n  getAssetIds,\r\n  getEquipmentIds,\r\n  useSidePanel,\r\n}: BringBackUpProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const fetchDownOrders = async (\r\n    ids: number[],\r\n  ): Promise<IWorkOrderDetailsDto[]> => {\r\n    return WorkOrderApi.DowntimeOrders(ids).then(data => {\r\n      return data;\r\n    });\r\n  };\r\n  const [downOrders, setDownOrders] = useAsyncExtendedState<\r\n    IWorkOrderDetailsDto[]\r\n  >([]);\r\n  const [fetchOrdersState, fetchOrdersPromise] = usePromise(fetchDownOrders);\r\n\r\n  React.useEffect(() => {\r\n    if (\r\n      !fetchOrdersState.status ||\r\n      (fetchOrdersState.status !== 'pending' &&\r\n        fetchOrdersState.status !== 'resolved')\r\n    ) {\r\n      setDownOrders(fetchOrdersPromise(getAssetIds(rows)));\r\n    }\r\n  }, [\r\n    fetchOrdersPromise,\r\n    fetchOrdersState.status,\r\n    getAssetIds,\r\n    rows,\r\n    setDownOrders,\r\n  ]);\r\n\r\n  const calendarLinkParams = React.useMemo(() => {\r\n    if (fetchOrdersState.status === 'resolved' && downOrders.length > 0) {\r\n      let date =\r\n        downOrders.filter(f => f.OfflineEventStart !== null)[0]\r\n          .OfflineEventStart ?? newDate();\r\n\r\n      return {\r\n        equipments: getEquipmentIds(rows),\r\n        Start: dateUtils.formatQueryStringDate(dateUtils.parseISO(date)),\r\n      };\r\n    } else {\r\n      return undefined;\r\n    }\r\n  }, [downOrders, fetchOrdersState.status, getEquipmentIds, newDate, rows]);\r\n  const calendarLink = useCalendarLink({\r\n    ...calendarLinkParams,\r\n    ...{ viewType: 'calendar' },\r\n  });\r\n  const alertslink = React.useMemo(() => {\r\n    if (fetchOrdersState.status === 'resolved' && downOrders.length > 0) {\r\n      return `/workorders?${toQueryString({\r\n        aid: getAssetIds(rows)\r\n          .map(r => r)\r\n          .join('|'),\r\n        downTime: 'true',\r\n      })}`;\r\n    } else {\r\n      return undefined;\r\n    }\r\n  }, [downOrders.length, fetchOrdersState.status, getAssetIds, rows]);\r\n\r\n  return fetchOrdersState.status === 'resolved' && downOrders.length > 0 ? (\r\n    <React.Fragment>\r\n      {downOrders.length === 1 ? (\r\n        <OpenWorkOrderButton\r\n          buttonName={t(translations.BringBackUp)}\r\n          orderId={downOrders[0].Id}\r\n          bringBackUp={true}\r\n          useSidePanel={useSidePanel}\r\n        />\r\n      ) : (\r\n        <DropDown\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          menuChildren={onClose => [\r\n            <MenuItem\r\n              key=\"workOrders_link\"\r\n              component=\"a\"\r\n              href={toRootedURL(alertslink || '/workorders')}\r\n            >\r\n              {t(translations.BringBackUpOnWorkOrders)}\r\n            </MenuItem>,\r\n            <MenuItem\r\n              key=\"calendar_link\"\r\n              component=\"a\"\r\n              href={toRootedURL(calendarLink)}\r\n            >\r\n              {t(translations.BringBackUpOnCalendar)}\r\n            </MenuItem>,\r\n          ]}\r\n          menuProps={{\r\n            anchorOrigin: {\r\n              vertical: 'bottom',\r\n              horizontal: 'left',\r\n            },\r\n            transformOrigin: {\r\n              vertical: 'top',\r\n              horizontal: 'left',\r\n            },\r\n            getContentAnchorEl: null,\r\n          }}\r\n          addChevron\r\n        >\r\n          {t(translations.BringBackUp)}\r\n        </DropDown>\r\n      )}\r\n    </React.Fragment>\r\n  ) : (\r\n    <React.Fragment></React.Fragment>\r\n  );\r\n}\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { AddWorkOrder } from './AddWorkOrder';\r\n\r\nexport interface DownWorkOrderProps<TRow> {\r\n  rows: TRow[];\r\n  getAssets: (rows: TRow[]) => Promise<IAssetDto[]>;\r\n  buttonName?: string;\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function DownWorkOrder<TRow>({\r\n  rows,\r\n  getAssets,\r\n  buttonName,\r\n  useSidePanel,\r\n}: DownWorkOrderProps<TRow>) {\r\n  return (\r\n    <AddWorkOrder\r\n      rows={rows}\r\n      getAssets={getAssets}\r\n      buttonName={buttonName}\r\n      useSidePanel={useSidePanel}\r\n      downtime={true}\r\n    />\r\n  );\r\n}\r\n","import {\r\n  CalendarButton,\r\n  CalendarButtonProps,\r\n} from 'app/components/CalendarButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface OpenCalendarProps<TRow>\r\n  extends Omit<\r\n    CalendarButtonProps,\r\n    | 'variant'\r\n    | 'size'\r\n    | 'equipments'\r\n    | 'openToBook'\r\n    | 'viewType'\r\n    | 'target'\r\n    | 'children'\r\n  > {\r\n  rows: TRow[];\r\n  getEquipmentIds: (rows: TRow[]) => number[];\r\n  bookMultiple?: boolean;\r\n  primary?: boolean;\r\n}\r\n\r\nexport function OpenCalendar<TRow>({\r\n  rows,\r\n  getEquipmentIds,\r\n  bookMultiple,\r\n  primary,\r\n  ...props\r\n}: OpenCalendarProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <CalendarButton\r\n      variant={primary ? 'main' : 'white'}\r\n      size=\"small\"\r\n      equipments={getEquipmentIds(rows)}\r\n      openToBook={true}\r\n      viewType=\"calendar\"\r\n      target=\"_blank\"\r\n      defaultMulti={bookMultiple}\r\n      {...props}\r\n    >\r\n      {t(translations.Reservation)}\r\n    </CalendarButton>\r\n  );\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport interface OpenWorkOrdersProps<TRow> {\r\n  rows: TRow[];\r\n  getAssetIds: (rows: TRow[]) => number[];\r\n}\r\n\r\nexport function OpenWorkOrders<TRow>({\r\n  rows,\r\n  getAssetIds,\r\n}: OpenWorkOrdersProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const alertslink = React.useMemo(() => {\r\n    return `/workorders?${toQueryString({\r\n      aid: getAssetIds(rows).join('|'),\r\n    })}`;\r\n  }, [getAssetIds, rows]);\r\n\r\n  return (\r\n    <Button variant=\"white\" size=\"small\" href={alertslink}>\r\n      {t(translations.menu_WorkOrders)}\r\n    </Button>\r\n  );\r\n}\r\n","import { IRow } from 'app/components/BasicTable/IRow';\r\nimport { useConfigurableColumns } from 'app/components/BasicTable/useConfigurableColumns';\r\nimport React from 'react';\r\nimport { Column } from 'react-table';\r\n\r\nconst GetTargetColumns = <TRow extends IRow>(\r\n  configurableColumns: Column<TRow>[] | undefined,\r\n  target: Column<TRow>[] | undefined,\r\n): Column<TRow>[] | undefined => {\r\n  if (configurableColumns !== undefined && target !== undefined) {\r\n    const res = configurableColumns.map(c => {\r\n      const r = target.find(t => t.accessor === c.accessor);\r\n      return r !== undefined ? r : c;\r\n    });\r\n    return res;\r\n  } else return undefined;\r\n};\r\nconst ExcludeColumns = <TRow extends IRow>(\r\n  configurableColumns: Array<keyof TRow> | undefined,\r\n  columnsToRemove: string[] | undefined,\r\n): Array<keyof TRow> | undefined => {\r\n  if (configurableColumns !== undefined) {\r\n    if (columnsToRemove !== undefined) {\r\n      const res = configurableColumns.filter(\r\n        c => columnsToRemove.find(r => r === c) === undefined,\r\n      );\r\n      return res;\r\n    } else {\r\n      return configurableColumns;\r\n    }\r\n  } else {\r\n    return undefined;\r\n  }\r\n};\r\nexport const useConfigurableColumnsAdvanced = <TRow extends IRow>(\r\n  screenId: number,\r\n  columns: Array<Column<TRow>>,\r\n  excludeFroExport: string[],\r\n) => {\r\n  const {\r\n    configurableColumns,\r\n    configurableColumnsExport: exportConfigurableColumns,\r\n    handleConfigurableColumns,\r\n    configCompleted,\r\n  } = useConfigurableColumns<TRow>({\r\n    screenId: screenId,\r\n    columns: columns,\r\n    // setGlobalMessage: setGlobalMessage,\r\n  });\r\n  const getColumnAccessors = React.useCallback(\r\n    (columns: Column<TRow>[] | undefined) =>\r\n      columns\r\n        ?.filter(c => typeof c.accessor === 'string')\r\n        ?.filter(c => c.accessor !== undefined)\r\n        ?.map(c => c.accessor as keyof TRow),\r\n    [],\r\n  );\r\n\r\n  const getDisplayColumns = React.useCallback(\r\n    ({\r\n      screenId,\r\n      configurableColumns,\r\n      configCompleted,\r\n      columns,\r\n    }): Column<TRow>[] | undefined => {\r\n      if (screenId === undefined) {\r\n        return columns;\r\n      } else if (configCompleted) {\r\n        return configurableColumns;\r\n      } else {\r\n        return undefined;\r\n      }\r\n    },\r\n    [],\r\n  );\r\n  const columnAccessors = React.useMemo(() => {\r\n    const result = getColumnAccessors(\r\n      getDisplayColumns({\r\n        screenId,\r\n        configurableColumns,\r\n        configCompleted,\r\n        columns,\r\n      }),\r\n    );\r\n    return result;\r\n  }, [\r\n    getColumnAccessors,\r\n    getDisplayColumns,\r\n    screenId,\r\n    configurableColumns,\r\n    configCompleted,\r\n    columns,\r\n  ]);\r\n  const targetColumns = React.useMemo(() => {\r\n    return GetTargetColumns(configurableColumns, columns);\r\n  }, [columns, configurableColumns]);\r\n  const exportColumns = React.useMemo(() => {\r\n    return ExcludeColumns(exportConfigurableColumns, excludeFroExport);\r\n  }, [excludeFroExport, exportConfigurableColumns]);\r\n  return {\r\n    configurableColumns: targetColumns,\r\n    columnAccessors,\r\n    exportConfigurableColumns: exportColumns,\r\n    handleConfigurableColumns,\r\n    configCompleted,\r\n  };\r\n};\r\n","/**\r\n *\r\n * Popover\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Paper, Theme } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Popover as MuiPopover } from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport clsx from 'clsx';\r\nimport { PopperTitle } from '../Popper/PopperTitle';\r\n\r\nexport interface PopperProps {\r\n  id?: string;\r\n  title: React.ReactNode;\r\n  open: boolean;\r\n  anchorEl?: EventTarget & HTMLDivElement;\r\n  children: React.ReactNode;\r\n  onClose: React.MouseEventHandler<HTMLButtonElement | Document>;\r\n  className?: string;\r\n  closeTitle?: string;\r\n}\r\n\r\nexport function Popover(props: PopperProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const classes = useStyles({ isMobile: isMobile });\r\n\r\n  return (\r\n    <MuiPopover\r\n      id={props.id}\r\n      open={props.open}\r\n      onClose={props.onClose}\r\n      anchorEl={props.anchorEl}\r\n      container={document.fullscreenElement ?? document.body}\r\n      className={clsx(classes.root, props.className, {\r\n        [classes.rootMobile]: isMobile,\r\n      })}\r\n    >\r\n      <Paper className={classes.selectPaper} elevation={1}>\r\n        <PopperTitle\r\n          title={props.title}\r\n          closeButtonTitle={props.closeTitle}\r\n          onClose={props.onClose}\r\n        />\r\n        <Box className={classes.selectRoot}>{props.children}</Box>\r\n      </Paper>\r\n    </MuiPopover>\r\n  );\r\n}\r\n\r\nconst useStyles = makeStyles<Theme, { isMobile: boolean }>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      // https://github.com/mui/material-ui/issues/18905\r\n      zIndex: 1300,\r\n    },\r\n    rootMobile: {\r\n      width: `100vw`,\r\n      height: 'calc(100% - 90px)',\r\n      // long content of the Popover overflows Popover box on mobile\r\n      overflow: 'auto',\r\n    },\r\n    selectPaper: {\r\n      height: '100%',\r\n    },\r\n    selectRoot: {\r\n      padding: theme.spacing(2),\r\n    },\r\n    selectTitle: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '8px 8px',\r\n      justifyContent: 'space-between',\r\n      width: '100%',\r\n      '&>label': {\r\n        width: '100%',\r\n        textAlign: 'center',\r\n      },\r\n    },\r\n    selectContent: {\r\n      marginTop: theme.spacing(2),\r\n      boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n    },\r\n  }),\r\n);\r\n","/**\r\n *\r\n * BasicDialogContentWithTitle\r\n *\r\n */\r\nimport {\r\n  Box,\r\n  DialogContent as MuiDialogContent,\r\n  DialogContentProps as MuiDialogContentProps,\r\n  LinearProgress,\r\n  Theme,\r\n  withStyles,\r\n} from '@material-ui/core';\r\nimport { createStyles, makeStyles } from '@material-ui/styles';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { H4 } from '../Typography';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\n\r\nconst useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      margin: 0,\r\n      padding: theme.spacing(3, 6, 2, 3),\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      borderRadius: '12px 12px 0px 0px',\r\n    },\r\n    titleContainer: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n      gap: '8px',\r\n    },\r\n    titleSubtitle: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n    },\r\n    closeButton: {\r\n      position: 'absolute',\r\n      right: theme.spacing(2),\r\n      top: theme.spacing(2),\r\n      color: theme.palette.grey[500],\r\n    },\r\n    title: {\r\n      margin: 0,\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n    },\r\n    subtitle: {},\r\n  }),\r\n);\r\nexport interface TitleProps {\r\n  titles: React.ReactNode;\r\n  subtitle?: React.ReactNode;\r\n  onClose?: () => void;\r\n  processing?: boolean;\r\n  disabled?: boolean;\r\n}\r\nexport interface BasicDialogContentWithTitleProps\r\n  extends MuiDialogContentProps {\r\n  children: React.ReactNode;\r\n}\r\nexport function BasicDialogContentWithTitle({\r\n  titles,\r\n  subtitle,\r\n  onClose,\r\n  children,\r\n  processing,\r\n  disabled,\r\n}: BasicDialogContentWithTitleProps & TitleProps) {\r\n  const classes = useStyles();\r\n\r\n  return (\r\n    <DialogContent>\r\n      <Box className={classes.titleContainer}>\r\n        {!!onClose ? (\r\n          <IconButton\r\n            style={{\r\n              position: 'absolute',\r\n              right: 12,\r\n              top: 12,\r\n              color: bookitColors.grayscale.graySubtitles,\r\n            }}\r\n            variant=\"ghost\"\r\n            aria-label=\"close\"\r\n            onClick={onClose}\r\n            shape=\"square\"\r\n            disabled={disabled}\r\n            size=\"small\"\r\n            icon=\"times\"\r\n          />\r\n        ) : null}\r\n        <H4 className={classes.title}>{titles}</H4>\r\n        {subtitle && (\r\n          <BasicTypography variant=\"bodyS\">{subtitle}</BasicTypography>\r\n        )}\r\n        {processing && (\r\n          <Box style={{ width: '100%' }}>\r\n            <LinearProgress variant=\"query\" color=\"primary\" />\r\n          </Box>\r\n        )}\r\n      </Box>\r\n      <Box className={classes.formContainer}>{children}</Box>\r\n    </DialogContent>\r\n  );\r\n}\r\nconst DialogContent = withStyles((theme: Theme) => ({\r\n  root: {\r\n    padding: theme.spacing(4),\r\n    borderTop: 'unset',\r\n    '&:first-child': {\r\n      paddingTop: theme.spacing(4),\r\n    },\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    gap: '24px',\r\n  },\r\n}))(MuiDialogContent);\r\n","/**\r\n *\r\n * BasicDialog\r\n *\r\n */\r\nimport {\r\n  createStyles,\r\n  Dialog,\r\n  DialogProps,\r\n  makeStyles,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { BasicDialogActions } from './BasicDialogActions';\r\nimport { BasicDialogContentWithTitle } from './BasicDialogContentWithTitle';\r\nimport { DialogActionsRenderer } from './DialogActionsRender';\r\n\r\nexport interface BasicDialogProps extends Omit<DialogProps, 'open' | 'title'> {\r\n  id: string;\r\n  title: React.ReactNode;\r\n  subtitle?: React.ReactNode;\r\n  body: React.ReactNode;\r\n  processing?: boolean;\r\n  isopen: boolean;\r\n  leftActions: DialogActionsRenderer[];\r\n  rightActions: DialogActionsRenderer[];\r\n  onClose?: () => void;\r\n  onCancel?: () => void;\r\n  maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;\r\n  disabled?: boolean;\r\n  dialogRootClassName?: string;\r\n}\r\n\r\nexport function BasicDialog({\r\n  id,\r\n  title,\r\n  body,\r\n  isopen,\r\n  leftActions,\r\n  rightActions,\r\n  maxWidth,\r\n  subtitle,\r\n  processing,\r\n  disabled,\r\n  dialogRootClassName,\r\n  ...props\r\n}: BasicDialogProps) {\r\n  const [open, setOpen] = React.useState(isopen);\r\n  React.useEffect(() => {\r\n    setOpen(isopen);\r\n  }, [isopen]);\r\n  const classes = dialogStyles();\r\n  // const handleClose = () => {\r\n  //   setOpen(false);\r\n  //   if (onClose) {\r\n  //     onClose();\r\n  //   }\r\n  // };\r\n  // const defaultActions: DialogActionsRenderer[] = [\r\n  //   () => (\r\n  //     <ActionButton\r\n  //       text=\"Cancel\"\r\n  //       variant=\"main\"\r\n  //       title=\"Cancel\"\r\n  //       onClick={handleClose}\r\n  //     />\r\n  //   ),\r\n  // ];\r\n  // actions.forEach(element => {\r\n  //   defaultActions.push(element);\r\n  // });\r\n\r\n  return (\r\n    <Dialog\r\n      maxWidth={maxWidth || 'xs'}\r\n      open={open}\r\n      classes={{\r\n        paperWidthXs: classes.paperWidthXs,\r\n        root: dialogRootClassName || 'basic-dialog-root',\r\n      }}\r\n      aria-labelledby={id}\r\n      {...props}\r\n    >\r\n      {/* <BasicDialogTitle id={id} subtitle={subtitle} onClose={onClose}>\r\n        {title}\r\n      </BasicDialogTitle>\r\n      <BasicDialogContent dividers>{body}</BasicDialogContent> */}\r\n      <BasicDialogContentWithTitle\r\n        subtitle={subtitle}\r\n        onClose={props.onClose}\r\n        titles={title}\r\n        processing={processing}\r\n        disabled={disabled}\r\n      >\r\n        {body}\r\n      </BasicDialogContentWithTitle>\r\n      <BasicDialogActions\r\n        leftActions={leftActions.map(element => element)}\r\n        rightActions={rightActions.map(element => element)}\r\n      />\r\n    </Dialog>\r\n  );\r\n}\r\nconst dialogStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    paperWidthXs: {\r\n      width: '360px',\r\n    },\r\n  }),\r\n);\r\n","import { Check, CheckProps } from '../BasicInputs/Check';\r\nimport * as React from 'react';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport FormControl from '../Forms/FormControls/FormControl';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\nimport FormHelperText from '../Forms/FormControls/FormHelperText';\r\nimport clsx from 'clsx';\r\nimport FormGroup from '../Forms/FormControls/FormGroup';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { FormLabel } from '@material-ui/core';\r\n\r\nexport interface BasicCheckBoxProps\r\n  extends Omit<CheckProps, 'onChange' | 'danger'> {\r\n  label?: string;\r\n  error?: string;\r\n  helperText?: string;\r\n  info?: React.ReactNode;\r\n  fullWidth?: boolean;\r\n  name?: string;\r\n  boxed?: boolean;\r\n  maxLabelWidth?: string | number;\r\n  onChange?: (\r\n    value: boolean,\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => void;\r\n}\r\n\r\nexport function BasicCheckBox(props: BasicCheckBoxProps) {\r\n  // const StyledInfo = styled(InfoIcon)(({ theme }) => ({\r\n  //   marginLeft: theme.spacing(1),\r\n  // }));\r\n  const {\r\n    label,\r\n    error,\r\n    helperText,\r\n    info,\r\n    name,\r\n    onChange,\r\n    boxed,\r\n    fullWidth,\r\n    maxLabelWidth = 25,\r\n    required,\r\n    ...other\r\n  } = props;\r\n  // const LabelWithInfo = () => {\r\n  //   return (\r\n  //     <React.Fragment>\r\n  //       {label}\r\n  //       {info && <StyledInfo title={info} />}\r\n  //     </React.Fragment>\r\n  //   );\r\n  // };\r\n  const [isChecked, setIsChecked] = React.useState<boolean>(\r\n    props.checked ?? false,\r\n  );\r\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.checked as boolean;\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n    setIsChecked(value);\r\n  };\r\n  const withInfoLabel = React.useMemo(() => {\r\n    return !!label && label.length > maxLabelWidth;\r\n  }, [label, maxLabelWidth]);\r\n  const Label = withInfoLabel ? (\r\n    <Tooltip title={<>{label}</>}>\r\n      <span>\r\n        <FormLabel required={required}>{label}</FormLabel>\r\n      </span>\r\n    </Tooltip>\r\n  ) : (\r\n    <FormLabel required={required}>{label}</FormLabel>\r\n  );\r\n  const baseLabelStyle: React.CSSProperties = React.useMemo(() => {\r\n    return withInfoLabel\r\n      ? { maxWidth: `${maxLabelWidth}ch`, gap: 12 }\r\n      : { gap: 12 };\r\n  }, [maxLabelWidth, withInfoLabel]);\r\n  return (\r\n    <FormControl\r\n      error={error !== undefined}\r\n      fullWidth={fullWidth}\r\n      required={required}\r\n      className={clsx({\r\n        boxed: boxed,\r\n      })}\r\n    >\r\n      <FormGroup\r\n        row={true}\r\n        className={clsx({\r\n          withInfo: info !== undefined,\r\n          boxed: boxed,\r\n          boxedChecked: isChecked,\r\n          boxedError: error !== undefined,\r\n        })}\r\n      >\r\n        <FormControlLabel\r\n          label={Label}\r\n          style={baseLabelStyle}\r\n          className={clsx({\r\n            withInfo: info !== undefined,\r\n            boxed: boxed,\r\n            boxedChecked: isChecked,\r\n            boxedError: error !== undefined,\r\n          })}\r\n          control={\r\n            <Check\r\n              name={name}\r\n              color={props.color || 'primary'}\r\n              withPadding={false}\r\n              danger={error !== undefined}\r\n              onChange={handleChange}\r\n              checked={isChecked}\r\n              {...other}\r\n            />\r\n          }\r\n        />\r\n        {info && <InfoIcon title={info} />}\r\n      </FormGroup>\r\n      {((!!error && error !== '') || (!!helperText && helperText !== '')) && (\r\n        <FormHelperText\r\n          error={error !== undefined}\r\n          className={clsx({\r\n            boxed: boxed,\r\n          })}\r\n          required={required}\r\n        >\r\n          {error || helperText}\r\n        </FormHelperText>\r\n      )}\r\n    </FormControl>\r\n  );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { CardPosition } from 'app/components/BasicCards';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface TableCardGridProps {\r\n  id?: string;\r\n  children: React.ReactNodeArray;\r\n  isMobile?: boolean;\r\n  style?: React.CSSProperties;\r\n  cardPosition?: CardPosition;\r\n  compact?: boolean;\r\n  minCardHeight?: number;\r\n}\r\n\r\nexport const TableCardGrid = ({\r\n  id,\r\n  children,\r\n  isMobile,\r\n  style,\r\n  cardPosition,\r\n  compact,\r\n  minCardHeight,\r\n}: TableCardGridProps) => {\r\n  const theme = useTheme();\r\n  return (\r\n    <CardGrid\r\n      theme={theme}\r\n      id={id}\r\n      className={clsx('gridContainer', {\r\n        isMobile: isMobile || compact,\r\n        cardVertical: cardPosition === 'vertical',\r\n      })}\r\n      style={style}\r\n    >\r\n      {children\r\n        .filter(f => !!f)\r\n        .map((c, ind) => (\r\n          <div\r\n            key={`content-key-${ind}`}\r\n            style={!!minCardHeight ? { minHeight: minCardHeight } : undefined}\r\n            className={clsx('cardItem', {\r\n              isMobile: isMobile || compact,\r\n              cardHorizontal: cardPosition === 'horizontal',\r\n              cardVertical: cardPosition === 'vertical',\r\n            })}\r\n          >\r\n            {c}\r\n          </div>\r\n        ))}\r\n      {(isMobile || compact) && children.length > 3 && (\r\n        <div style={{ height: 120 }}></div>\r\n      )}\r\n    </CardGrid>\r\n  );\r\n};\r\nconst CardGrid = styled('div')(({ theme }) => ({\r\n  '&.gridContainer': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    flexWrap: 'wrap',\r\n    width: '100%',\r\n    height: 'auto',\r\n    gap: 32,\r\n    overflowY: 'auto',\r\n    padding: '8px 2px',\r\n    '&::-webkit-scrollbar': {\r\n      width: '6px',\r\n    },\r\n    '&::-webkit-scrollbar-thumb': {\r\n      boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n      borderRadius: '6px',\r\n      backgroundColor: theme.palette.common.grayBorders,\r\n    },\r\n    '&.isMobile': {\r\n      gap: '16px',\r\n    },\r\n    '&.cardVertical': {\r\n      // gap: 16,\r\n      padding: 0,\r\n    },\r\n    '& .cardItem': {\r\n      //flexBasis: isMobile ? '100%' : '20%',\r\n      flex: '1 1 20%',\r\n      borderRadius: 8,\r\n      width: 0,\r\n      //width: 256,\r\n      minWidth: '256px',\r\n      maxWidth: '360px',\r\n      '&.cardHorizontal': {\r\n        flex: '1 1 25%',\r\n        minWidth: '400px',\r\n        maxWidth: '460px',\r\n      },\r\n      '&.cardVertical': {\r\n        flex: '1 1 16%',\r\n      },\r\n      '&.isMobile': {\r\n        flex: '1 1 100%',\r\n        maxWidth: '100%',\r\n        minWidth: 'unset',\r\n      },\r\n    },\r\n  },\r\n}));\r\n","import styled from 'styled-components';\r\nimport { Theme, Toolbar, ToolbarProps } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n// margin: ${props =>\r\n//   props.variant === 'dense' ? props.theme.spacing(1, 1, 0) : '0px'};\r\nexport const StyledToolbar = styled(\r\n  ({\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & ToolbarProps) => <Toolbar {...other}>{children}</Toolbar>,\r\n)`\r\n  box-shadow: unset;\r\n  display: flex;\r\n  flex-direction: row;\r\n  justify-content: space-between;\r\n  align-items: center;\r\n  align-self: stretch;\r\n  width: 100%;\r\n  padding: ${props =>\r\n    props.variant === 'dense' ? '0px' : props.theme.spacing(3, 4, 2)};\r\n  margin: 0;\r\n\r\n  &.shortview {\r\n    box-shadow: inset 0px -1px 0px #e0e5ec;\r\n    gap: ${props => props.theme.spacing(1)}px;\r\n    padding: ${props =>\r\n      props.variant === 'dense' ? '0px' : props.theme.spacing(0, 2)};\r\n    & .actionsContainer {\r\n      gap: ${props => props.theme.spacing(1)}px;\r\n    }\r\n    & .titleSection {\r\n      & .title {\r\n        & .titleText {\r\n          max-width: 16ch;\r\n          white-space: pre;\r\n          overflow: hidden;\r\n          text-overflow: ellipsis;\r\n          display: inline;\r\n        }\r\n      }\r\n    }\r\n  }\r\n  &.toptoolbar {\r\n    background: ${bookitColors.base.white};\r\n    margin: 0px;\r\n    padding: 12px 32px;\r\n    &.isExpanded {\r\n      padding: 12px 32px 12px 24px;\r\n    }\r\n  }\r\n  & .titleSection {\r\n    display: flex;\r\n    flex-direction: row;\r\n    align-items: center;\r\n    padding: 0px;\r\n    gap: ${props => props.theme.spacing(1)}px;\r\n    &.titleAndIconMobile {\r\n      flex-grow: 1;\r\n    }\r\n    &.titleAsColumn {\r\n      flex-direction: column;\r\n      align-items: flex-start;\r\n    }\r\n    & .title {\r\n      display: flex;\r\n      flex-direction: row;\r\n      align-items: center;\r\n      padding: 0px;\r\n      gap: ${props => props.theme.spacing(1)}px;\r\n      & .titleText {\r\n        white-space: pre;\r\n        overflow: hidden;\r\n        text-overflow: ellipsis;\r\n        max-width: 30ch;\r\n        display: inherit;\r\n      }\r\n      & .longTitleText {\r\n        white-space: nowrap;\r\n        overflow: hidden;\r\n        text-overflow: ellipsis;\r\n        max-width: 45ch;\r\n        display: initial;\r\n      }\r\n    }\r\n  }\r\n  & .messageContainer {\r\n    margin-inline: ${props => props.theme.spacing(6)}px;\r\n    flex-grow: 1;\r\n  }\r\n  & .actionsContainer {\r\n    display: flex;\r\n    flex-direction: row;\r\n    align-items: center;\r\n    justify-content: start;\r\n    gap: ${props => props.theme.spacing(2)}px;\r\n    padding: 0px;\r\n    & span > a {\r\n      & > svg {\r\n        font-size: 20px;\r\n      }\r\n    }\r\n  }\r\n`;\r\n","import { IRow } from 'app/components/BasicTable';\r\nimport {\r\n  IsEntity,\r\n  IsEntityString,\r\n} from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Entity } from 'types/common';\r\nimport { Condition } from './ODataFilter';\r\n\r\n/**\r\n * Gets the predicates that can be used in ODAta filter from the \"filters\"\r\n * @param filters Applied filters\r\n * @param customParams ???\r\n * @param cp ???\r\n * @returns Odata filter predicate conditions\r\n */\r\nexport function getPredicates<TRow extends IRow>(\r\n  filters: IFilterSettings<TRow>[],\r\n  customParams:\r\n    | ((fieldName: string, Id: number, fn: (p: {}) => void) => void)\r\n    | undefined,\r\n  cp: (p: {}) => void,\r\n): (string | Condition<TRow>)[] {\r\n  return filters\r\n    .filter(f => f.value !== null)\r\n    .map(f =>\r\n      f.value === undefined || (Array.isArray(f.value) && f.value.length === 0)\r\n        ? undefined\r\n        : f.customFilter !== undefined\r\n        ? f.customFilter(f.value, f, filters)\r\n        : IsEntityString(f.value)\r\n        ? (f.value as Entity<string>).Id !== ''\r\n          ? new Condition<TRow>(\r\n              f.fieldName,\r\n              f.operator,\r\n              (f.value as Entity<string>).Id,\r\n              f.fieldName1,\r\n              f.isInversed,\r\n            )\r\n          : undefined\r\n        : IsEntity(f.value)\r\n        ? (f.value as Entity<number>).Id >= 0\r\n          ? new Condition<TRow>(\r\n              f.fieldName,\r\n              f.operator,\r\n              (f.value as Entity<number>).Id,\r\n              f.fieldName1,\r\n              f.isInversed,\r\n            )\r\n          : customParams !== undefined\r\n          ? customParams(\r\n              f.fieldName as string,\r\n              (f.value as Entity<number>).Id,\r\n              cp,\r\n            )\r\n          : undefined\r\n        : new Condition<TRow>(\r\n            f.fieldName,\r\n            f.operator,\r\n            f.value,\r\n            f.fieldName1,\r\n            f.isInversed,\r\n          ),\r\n    )\r\n    .filter(f => f !== undefined) as Condition<TRow>[];\r\n}\r\n","/**\r\n *\r\n * Link\r\n *\r\n */\r\nimport styled from 'styled-components/macro';\r\nimport { Link } from 'react-router-dom';\r\n\r\nexport const RouterLink = styled(Link)`\r\n  color: ${p => p.theme.primary};\r\n  text-decoration: none;\r\n\r\n  &:hover {\r\n    text-decoration: underline;\r\n    opacity: 0.8;\r\n  }\r\n\r\n  &:active {\r\n    opacity: 0.4;\r\n  }\r\n`;\r\n","/**\r\n *\r\n * ArticlLink\r\n *\r\n */\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { ValueLabel } from 'app/components/ValueLabel';\r\nimport { ArticleSource } from '../ArticlesSourcePicker';\r\n\r\nexport interface ArticleLinkProps {\r\n  doi: string | undefined | null;\r\n  externalId?: string | null;\r\n  externalIdSource?: string | null;\r\n}\r\n\r\nexport function ArticleDoiLink({\r\n  doi,\r\n  externalIdSource,\r\n  externalId,\r\n}: ArticleLinkProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const doiId = tryGetDoiFromUrl(doi) ?? doi;\r\n  const doiURL = `https://doi.org/${doiId}`;\r\n  const externalIdSourceType = externalIdSource as ArticleSource;\r\n  const linkURL =\r\n    // use pubmed link for pubmed articles\r\n    externalIdSourceType === 'PubMed'\r\n      ? `https://pubmed.ncbi.nlm.nih.gov/${externalId}/`\r\n      : // use dtu findit link for dtu orbit sourced articles\r\n      externalIdSourceType === 'DTUOrbit'\r\n      ? `https://findit.dtu.dk/en/catalog?q=doi:${doiId}`\r\n      : // by default shows the doi url\r\n        doiURL;\r\n  if (doi === undefined) {\r\n    return <ValueLabel value={doi} />;\r\n  } else {\r\n    return (\r\n      <>\r\n        <ExternalLink showIcon href={linkURL}>\r\n          {doi}\r\n        </ExternalLink>\r\n      </>\r\n    );\r\n  }\r\n}\r\n\r\nconst tryGetDoiFromUrl = (s: string | null | undefined) => {\r\n  try {\r\n    if (s === null) {\r\n      return undefined;\r\n    }\r\n    if (s === undefined) {\r\n      return undefined;\r\n    }\r\n    const url = new URL(s);\r\n    const result = url.pathname.substr(1);\r\n    return result;\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n};\r\n","/**\r\n *\r\n * PaymentMethodEnumPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { PaymentMethods } from 'app/pages/OnlineBudgetsStatusPage/slice/types';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface PaymentMethodEnumPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSinglePaymentMethod = (val: number): Entity<number> => {\r\n  return enumToEntityArray(PaymentMethods).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const initPaymentMethodData = (\r\n  initval: number | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([getSinglePaymentMethod(initval)]);\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(PaymentMethods);\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function PaymentMethodEnumPicker(props: PaymentMethodEnumPickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * SamplePlatePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { EditorProps } from 'app/pages/Samples/EditableTable/EditableCell';\r\nimport { ISample } from 'app/pages/Samples/SamplesListPage/slice/types';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlatePickerProps\r\n  extends Omit<\r\n      AutocompletePickerProps<Entity<string | null>>,\r\n      'loadData' | 'onChange' | 'onBlur' | 'value' | 'name' | 'error'\r\n    >,\r\n    EditorProps<string | null> {\r\n  serviceGroupId?: number;\r\n  placeholder?: string;\r\n  helperText?: string;\r\n  values?: ISample;\r\n}\r\n\r\nconst url = '/api/odata/v4/SamplePlates';\r\nexport const initSamplePlateData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (serviceGroupId?: number) => (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string; $select: string } = {\r\n    $orderby: 'Id asc',\r\n    $select: 'Id',\r\n  };\r\n  const predicates: Condition<ISamplePlateDto>[] = [\r\n    new Condition('Active', ODataOperators.Equals, true),\r\n  ];\r\n  if (serviceGroupId !== undefined) {\r\n    predicates.push(\r\n      new Condition('ServiceGroupId', ODataOperators.Equals, serviceGroupId),\r\n    );\r\n  }\r\n  params.$filter = new ODataFilterBuilder<ISamplePlateDto>({\r\n    predicates,\r\n    stringColumns: ['Id'],\r\n    stringSearch: searchTerm ?? undefined,\r\n  }).toString();\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response =>\r\n      response.value.map(item => ({ Id: item.Id, Name: item.Id })),\r\n    );\r\n};\r\nexport function SamplePlatePicker({\r\n  parentValue,\r\n  serviceGroupId,\r\n  value,\r\n  values,\r\n  onChange,\r\n  ...props\r\n}: SamplePlatePickerProps) {\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  const loadDatax = React.useCallback(loadData(values?.ServiceGroupId), [\r\n    values?.serviceGroupId,\r\n  ]);\r\n  const S2Value = value === null ? null : { Id: value, Name: value };\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadDatax}\r\n      id={props.id || 'samplePlateId'}\r\n      size={props.size}\r\n      onChange={value => onChange(value?.Id ?? null)}\r\n      value={S2Value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * SamplePlatePositionPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { SamplePlatePositionNamingTypes } from 'api/odata/generated/enums/SamplePlatePositionNamingTypes';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { EditorProps } from 'app/pages/Samples/EditableTable/EditableCell';\r\nimport {\r\n  ISample,\r\n  ISampleRun,\r\n} from 'app/pages/Samples/SamplesListPage/slice/types';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlatePositionPickerProps\r\n  extends Omit<\r\n      AutocompletePickerProps<Entity<string | null>>,\r\n      'loadData' | 'onChange' | 'onBlur' | 'value' | 'name' | 'error'\r\n    >,\r\n    EditorProps<string | null> {\r\n  serviceGroupId?: number;\r\n  placeholder?: string;\r\n  helperText?: string;\r\n  values?: ISample | ISampleRun;\r\n}\r\n\r\nfunction range(x) {\r\n  return Array.apply(null, Array(x)).map(function (x, i) {\r\n    return i;\r\n  });\r\n}\r\nconst loadData = (plateId?: string | null) => async (\r\n  searchTerm: string | null,\r\n): Promise<Entity<string>[]> => {\r\n  const plate = await httpClient.get<ISamplePlateDto>(\r\n    `/api/odata/v4/sampleplates('${plateId}')`,\r\n  );\r\n\r\n  const rowsCount = plate.SamplePlateTypeRows;\r\n  const columnsCount = plate.SamplePlateTypeColumns;\r\n  const rows = range(columnsCount)\r\n    .map(i =>\r\n      plate.SamplePlateTypeColumnsNaming ===\r\n      SamplePlatePositionNamingTypes.Alpha\r\n        ? String.fromCharCode(65 + i)\r\n        : i + 1,\r\n    )\r\n    .flatMap(column =>\r\n      range(rowsCount)\r\n        .map(i =>\r\n          plate.SamplePlateTypeRowsNaming ===\r\n          SamplePlatePositionNamingTypes.Alpha\r\n            ? String.fromCharCode(65 + i)\r\n            : i + 1,\r\n        )\r\n        .map(row => `${column}${row}`),\r\n    );\r\n  const options = rows.map(a => ({ Id: a, Name: a }));\r\n  return options;\r\n};\r\n\r\nexport interface ConnectedSamplePlatePositionPickerProps\r\n  extends SamplePlatePositionPickerProps {\r\n  samplePlateId: string | null;\r\n}\r\nexport function SamplePlatePositionPicker({\r\n  serviceGroupId,\r\n  samplePlateId,\r\n  value,\r\n  values,\r\n  onChange,\r\n  ...props\r\n}: ConnectedSamplePlatePositionPickerProps) {\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  const loadDatax = React.useCallback(loadData(samplePlateId), [\r\n    samplePlateId,\r\n    serviceGroupId,\r\n  ]);\r\n  const S2Value = value === null ? null : { Id: value, Name: value };\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadDatax}\r\n      size={props.size}\r\n      id={props.id || 'sampleplateposId'}\r\n      onChange={value => onChange(value?.Id ?? null)}\r\n      value={S2Value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function TargetSamplePlatePositionPicker({\r\n  values,\r\n  ...props\r\n}: SamplePlatePositionPickerProps) {\r\n  const samplePlateId = (values as ISampleRun)?.TargetPlateId ?? null;\r\n  return <SamplePlatePositionPicker samplePlateId={samplePlateId} {...props} />;\r\n}\r\n\r\nexport function SourceSamplePlatePositionPicker({\r\n  values,\r\n  ...props\r\n}: SamplePlatePositionPickerProps) {\r\n  const samplePlateId = (values as ISample)?.SamplePlateId ?? null;\r\n  // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  return <SamplePlatePositionPicker samplePlateId={samplePlateId} {...props} />;\r\n}\r\n","import { PopupImport } from 'app/components/PopupImport';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../RequestSamplesPage/slice';\r\nimport { selectImportState } from '../RequestSamplesPage/slice/selectors';\r\n\r\nexport interface ImportButtonProps {\r\n  onDownloadTemplateButtonClick?: () => Promise<void>;\r\n  disabled?: boolean;\r\n  hideImportButton?: boolean;\r\n  serviceRequestId?: number;\r\n}\r\n\r\nexport function ImportButton({\r\n  onDownloadTemplateButtonClick,\r\n  disabled,\r\n  hideImportButton,\r\n  serviceRequestId,\r\n}: ImportButtonProps) {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const state = useSelector(selectImportState);\r\n\r\n  const handleConfirm = (_: React.MouseEvent<HTMLButtonElement>, file: any) => {\r\n    if (file !== undefined) {\r\n      dispatch(\r\n        actions.import({\r\n          file: file,\r\n          serviceRequestId:\r\n            serviceRequestId === undefined ? 0 : serviceRequestId,\r\n        }),\r\n      );\r\n    }\r\n  };\r\n\r\n  return (\r\n    <>\r\n      <PopupImport\r\n        disabled={disabled}\r\n        onImportButtonClick={() => dispatch(actions.toggleImport(true))}\r\n        onConfirm={handleConfirm}\r\n        onCancel={() => dispatch(actions.toggleImport(false))}\r\n        open={state.open}\r\n        processing={state.processing}\r\n        accept=\".xlsx\"\r\n        hideImportButton={hideImportButton}\r\n        variant=\"white\"\r\n        onDownloadTemplateButtonClick={onDownloadTemplateButtonClick}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * PriceSheetMethodPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { PriceSheetBy } from 'enums/enums';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface PriceSheetMethodPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSinglePriceSheetMethod = (val: number): Entity<number> => {\r\n  return enumToEntityArray(PriceSheetBy).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const PriceSheetMethodData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        enumToEntityArray(PriceSheetBy).filter(item => {\r\n          return item.Id.toString() === initval;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(PriceSheetBy);\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function PriceSheetMethodPicker(props: PriceSheetMethodPickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst SourceUrl = '/api/odata/v4/ServiceRequestList';\r\nexport const ServiceRequestsApi = {\r\n  UpdateStatuses: (status: Entity<number> | null, ids: number[]) => {\r\n    const data = {\r\n      status: status?.Name,\r\n      ids,\r\n    };\r\n    //console.log(data);\r\n    const url = SourceUrl + '/UpdateStatuses';\r\n    return httpClient.post(url, data);\r\n  },\r\n  DeleteRequests: (ids: number[]) => {\r\n    const data = { ids };\r\n    const url = SourceUrl + '/DeleteRequests';\r\n    return httpClient.post(url, data);\r\n  },\r\n  AddRequest: (\r\n    osid: number,\r\n    budgetId: number,\r\n    userName: string,\r\n    userGroupId: string | undefined,\r\n    fundingTypeId: number | null,\r\n    purchaseOrder: string | null,\r\n  ): Promise<IResponseType> => {\r\n    const data = {\r\n      osid,\r\n      budgetId,\r\n      userName,\r\n      userGroupId,\r\n      fundingTypeId,\r\n      purchaseOrder,\r\n    };\r\n    const url = SourceUrl + '/AddRequest';\r\n    return httpClient.post(url, data);\r\n  },\r\n  updateAdminOnComment: async (id: number) => {\r\n    const url = SourceUrl + '/UpdateAdminOnComment';\r\n    try {\r\n      await httpClient.post(url, { id });\r\n    } catch {}\r\n  },\r\n};\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nexport function DefaultFilter(user: IAuthenticatedUser) {\r\n  const result = new URLSearchParams();\r\n\r\n  result.set('active', true.toString());\r\n\r\n  return result;\r\n}\r\nexport function getRequiredFilter(search: string) {\r\n  const result = isEmptyOrWhitespace(search)\r\n    ? new URLSearchParams()\r\n    : new URLSearchParams(search);\r\n  if (\r\n    result.has('active') === false ||\r\n    result.get('active') === null ||\r\n    result.get('active') === ''\r\n  ) {\r\n    result.set('active', true.toString());\r\n  }\r\n  const res = result.toString();\r\n  return isEmptyOrWhitespace(res) ? undefined : res;\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { AlignRight } from '../AlignRight';\r\n\r\ntype RecordType = Record<string, any>;\r\nconst DecimalRenderer: Renderer<CellProps<RecordType>> = ({ value, row }) => (\r\n  <AlignRight>{value == null ? null : value.toFixed(2)}</AlignRight>\r\n);\r\nexport default DecimalRenderer;\r\n","/**\r\n *\r\n * ServiceTypeEnumPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { useSelector } from 'react-redux';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface ServiceTypeEnumPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSingleServiceTypeEnum = (val: number): Entity<number> => {\r\n  return enumToEntityArray(ServiceType, undefined, 'ServiceType_').filter(\r\n    item => {\r\n      return item.Id === val;\r\n    },\r\n  )[0];\r\n};\r\n\r\nexport const initServiceTypeEnumData = (\r\n  initval: string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  const val = parseInt(initval ?? '');\r\n  if (initval === undefined || isNaN(val)) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([getSingleServiceTypeEnum(val)]);\r\n    });\r\n  }\r\n};\r\nexport const GetAvailableServiceTypes = (\r\n  items: Entity<number>[],\r\n  appSettings: AppSettings | null,\r\n) => {\r\n  return items.filter(f => {\r\n    if (f.Id === ServiceType.Offline) {\r\n      return IsModuleEnabled(appSettings, KnownModules.OfflineServices);\r\n    }\r\n    if (f.Id === ServiceType.Sample) {\r\n      return IsModuleEnabled(appSettings, KnownModules.ServiceRequests);\r\n    }\r\n    if (f.Id === ServiceType.Workflow) {\r\n      return IsModuleEnabled(appSettings, KnownModules.Workflows);\r\n    }\r\n    if (f.Id === ServiceType.Online) {\r\n      return IsModuleEnabled(appSettings, KnownModules.Instruments);\r\n    }\r\n    return false;\r\n  });\r\n};\r\nexport function ServiceTypeEnumPicker(props: ServiceTypeEnumPickerProps) {\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const getOptions = (searchTerm: string | null) => {\r\n    let items = GetAvailableServiceTypes(\r\n      enumToEntityArray(ServiceType, undefined, 'ServiceType_'),\r\n      appSettings,\r\n    );\r\n\r\n    if (searchTerm !== null && searchTerm !== '') {\r\n      return items.filter(\r\n        f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n      );\r\n    }\r\n    return items;\r\n  };\r\n\r\n  return (\r\n    <BaseOptionsPicker\r\n      id={'servicetypeenum'}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { EditorProps } from '../../EditableCell';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { omit } from 'lodash';\r\nimport { TextField } from 'app/components/TextField';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\n\r\n/* Date */\r\n// 'Date':\r\nexport function DateField({\r\n  value,\r\n  onBlur,\r\n  parentValue,\r\n  onChange,\r\n  info,\r\n  autoFocus,\r\n  ...props\r\n}: EditorProps<Timestamp | null>) {\r\n  const handleChange = value => {\r\n    onChange?.(\r\n      dateUtils.formatISO(value, { format: 'basic', representation: 'date' }),\r\n    );\r\n  };\r\n  return (\r\n    <>\r\n      <BookitDatePicker\r\n        TextFieldComponent={TextField}\r\n        inputVariant={'standard'}\r\n        value={dateUtils.tryParse(value) ?? null}\r\n        onChange={handleChange}\r\n        helperText={undefined}\r\n        info={info}\r\n        variant=\"date\"\r\n        autoFocus={autoFocus}\r\n        endIcon={\r\n          props.error && props.helperText ? (\r\n            <InfoIcon title={props.helperText || ''} error={props.error} />\r\n          ) : undefined\r\n        }\r\n        error={props.error}\r\n        fullWidth\r\n        {...omit(props, 'helperText')}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\n\r\nconst url = '/api/odata/v4/ServiceRequestStatusFilter';\r\n\r\nexport interface ServiceRequestStatusPickerProps\r\n  extends Omit<AutocompletePickerProps<IServiceRequestStatusDto>, 'loadData'> {\r\n  predicates?: (string | Condition<IServiceRequestStatusDto>)[];\r\n}\r\n\r\nexport const initServiceRequestStatusData = (\r\n  initialValue: string | undefined,\r\n) => {\r\n  if (initialValue === undefined) {\r\n    return new Promise<IServiceRequestStatusDto[]>((resolve, reject) => {\r\n      resolve([] as IServiceRequestStatusDto[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initialValue);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as IServiceRequestStatusDto[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates?: (string | Condition<IServiceRequestStatusDto>)[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<IServiceRequestStatusDto>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'InternalStatusId'],\r\n  });\r\n\r\nexport function ServiceRequestStatusPicker(\r\n  props: ServiceRequestStatusPickerProps,\r\n) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={!!props.mini}\r\n      size={props.size}\r\n      id={props.id || 'serviceRequestStatusId'}\r\n      loadData={loadData(props.predicates)}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * DialogForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Form, Formik, FormikConfig, FormikProps, FormikValues } from 'formik';\r\nimport { BasicDialogContent } from 'app/components/BasicDialog/BasicDialogContent';\r\nimport { BasicDialogTitle } from 'app/components/BasicDialog/BasicDialogTitle';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Dialog, DialogActions, DialogProps } from '@material-ui/core';\r\nimport { FormRowProps } from '../Forms/FormsLayout/FormRow';\r\n\r\nexport interface DialogFormProps<T extends FormikValues>\r\n  extends Pick<\r\n      FormikConfig<T>,\r\n      'onSubmit' | 'initialValues' | 'validationSchema'\r\n    >,\r\n    Pick<DialogProps, 'open'> {\r\n  /**\r\n   * overrides Dialog's onClose to simplify the function signature since the event target & close reason is not in use currently\r\n   * @returns\r\n   */\r\n  onClose: () => void;\r\n  title: string;\r\n  subTitle?: string;\r\n  /**\r\n   * Children have to be of type <FormRow .../> due to layout constraints\r\n   */\r\n  children:\r\n    | Array<React.ReactElement<FormRowProps>>\r\n    | React.ReactElement<FormRowProps>;\r\n}\r\n\r\n/**\r\n * Dialog with a form inside the DialogContent. Useful in cases where a confirmation is needed alongside another input from the user.\r\n * For example, quote rejection that requires a confirmation dialog with a reason for rejection, or an entity is added/updated through a dialog UI.\r\n * Props largely composed from a minimum viable props set from Formik & Dialog.\r\n * Children are expected to \r\n * @example\r\n * <DialogForm\r\n      validationSchema={Yup.object({Name:Yup.string().required()}}\r\n      initialValues={{}}\r\n      title={t(translations.SomeTitle)}\r\n    >\r\n      <FormRow fullRow>\r\n        <FormRichTextField\r\n          name=\"Name\"\r\n          label={t(translations.label)}\r\n          placeholder={t(translations.placeholder)}\r\n        />\r\n      </FormRow>\r\n    </DialogForm>\r\n * @param props\r\n * @returns\r\n */\r\nexport function DialogForm<T extends FormikValues>(props: DialogFormProps<T>) {\r\n  return (\r\n    <Dialog open={props.open} onClose={props.onClose}>\r\n      <Formik\r\n        validationSchema={props.validationSchema}\r\n        initialValues={props.initialValues}\r\n        onSubmit={props.onSubmit}\r\n      >\r\n        {formik => <FormContent {...props} {...formik} />}\r\n      </Formik>\r\n    </Dialog>\r\n  );\r\n}\r\nfunction FormContent<T extends FormikValues>(\r\n  props: DialogFormProps<T> & FormikProps<T>,\r\n) {\r\n  const { t } = useTranslation();\r\n\r\n  return (\r\n    <Form onSubmit={props.handleSubmit}>\r\n      <BasicDialogTitle subtitle={props.subTitle}>\r\n        {props.title}\r\n      </BasicDialogTitle>\r\n      <BasicDialogContent>\r\n        <FormLeftSection>\r\n          <FormFieldsSection>{props.children}</FormFieldsSection>\r\n        </FormLeftSection>\r\n      </BasicDialogContent>\r\n      <DialogActions>\r\n        <Button variant=\"white\" size=\"small\" onClick={props.onClose}>\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n        <Button\r\n          size=\"small\"\r\n          type=\"submit\"\r\n          variant=\"main\"\r\n          disabled={!props.isValid}\r\n        >\r\n          {t(translations.Submit)}\r\n        </Button>\r\n      </DialogActions>\r\n    </Form>\r\n  );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunctionResult } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport React, { ReactNode } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { ChargeProps } from './index';\r\n\r\nexport const AddChargeButton = ({\r\n  children,\r\n  tooltip,\r\n  ...props\r\n}: ChargeProps & {\r\n  children?: ReactNode;\r\n  tooltip?: React.ReactNode | TFunctionResult;\r\n}) => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const singleAdminServiceGroup =\r\n    authenticatedUser?.Roles?.includes(Roles.ServiceGroupBudgetsAdmin) &&\r\n    authenticatedUser.AdminServiceGroups.length === 1\r\n      ? authenticatedUser.AdminServiceGroups[0]\r\n      : null;\r\n  props.serviceGroup = props.serviceGroup ?? singleAdminServiceGroup ?? null;\r\n  // const budgetF = useAsyncGetWthEffect(\r\n  //   () =>\r\n  //     initBudgetData(\r\n  //       !!props.budget && props.budget !== null\r\n  //         ? props.budget.Id.toString()\r\n  //         : undefined,\r\n  //     ).then(resp => resp[0] ?? null),\r\n  //   props.budget,\r\n  //   [props.budget],\r\n  // );\r\n  const chargesProps: ChargeProps = React.useMemo(() => {\r\n    return {\r\n      budget: props.budget,\r\n      serviceGroup: props.serviceGroup,\r\n      invoiceId: props.invoiceId,\r\n      rowId: props.rowId,\r\n      serviceGroupPredicate: props.serviceGroupPredicate,\r\n      closeCover: props.closeCover,\r\n      coverClosed: props.coverClosed,\r\n      isCover: props.isCover,\r\n    };\r\n  }, [\r\n    props.budget,\r\n    props.closeCover,\r\n    props.coverClosed,\r\n    props.invoiceId,\r\n    props.isCover,\r\n    props.rowId,\r\n    props.serviceGroup,\r\n    props.serviceGroupPredicate,\r\n  ]);\r\n\r\n  return (\r\n    <Tooltip title={tooltip ?? t(translations.AddCharge)} arrow>\r\n      <Link\r\n        onClick={() => {\r\n          dispatch(actions.toggleSidePanel(true));\r\n          dispatch(actions.setPageType(RenderPageType.AddCharge));\r\n          dispatch(actions.setPageProps(chargesProps));\r\n        }}\r\n      >\r\n        {children ?? t(translations.AddManualInvoiceLine)}\r\n      </Link>\r\n    </Tooltip>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\n/**\r\n * Hides the global service group filter on a page.\r\n * Example of usage on the page componet:\r\n * ```\r\n * export const SomePage = withoutGlobalServiceGroupFilter(SomePageContent);\r\n * ```\r\n * Usage on loadable:\r\n * ```\r\n * export const SomePage = lazyLoad(\r\n * () => import('./index'),\r\n * module => withoutGlobalServiceGroupFilter(module.SomePage));\r\n * ```\r\n * @param Component Page component\r\n * @returns page component\r\n */\r\nexport function withoutGlobalServiceGroupFilter<P extends object>(\r\n  Component: React.ComponentType<P>,\r\n): React.FC<P> {\r\n  return ({ ...props }: P) => {\r\n    const dispatch = useDispatch();\r\n\r\n    const { actions } = useAppSettingsSlice();\r\n    useEffectOnMount(() => {\r\n      dispatch(actions.showGlobalServiceGroupFilter(false));\r\n    });\r\n\r\n    return <Component {...(props as P)} />;\r\n  };\r\n}\r\n","/**\r\n *\r\n * EquipmentReservationPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { IReservationEquipmentDto } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nexport interface ReservationEquipmentsPickerProps\r\n  extends Omit<\r\n    AutocompleteMultiPickerExProps<IReservationEquipmentDto>,\r\n    'loadData'\r\n  > {\r\n  inputProps?: InputBaseComponentProps;\r\n}\r\nconst url = '/api/odata/v4/ReservationEquipments';\r\nexport const initEquipmentsData = (\r\n  initval: string | undefined,\r\n  expand: string | undefined,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    let ids = (initval.indexOf(',') !== -1\r\n      ? initval.split(',')\r\n      : [initval]\r\n    ).map(item => {\r\n      return { Id: parseInt(item) };\r\n    }) as Identifiable<number>[];\r\n    let foo: string | undefined = undefined;\r\n    if (ids.length > 0) {\r\n      const predicates: string | Condition<IReservationEquipmentDto>[] = [];\r\n\r\n      predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n\r\n      foo = predicates.map(f => f.toString()).join(' and ');\r\n    }\r\n\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n      $expand?: string;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: foo,\r\n      $skip: 0,\r\n      $top: 10,\r\n      $expand: expand,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IReservationEquipmentDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n  expandedColumns?: string,\r\n) =>\r\n  getAutoCompleteLoadDataFn<IReservationEquipmentDto>({\r\n    url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'AccServices',\r\n      'AllowOneAccSerOnly',\r\n      'AllowPartialProjectCharges',\r\n      'AllowPartialSingleProjectCharges',\r\n      'AllowReservationCollaborators',\r\n      'ForceFullDayReservations',\r\n      'AssemblyId',\r\n      'HasAssemblyParts',\r\n      'AssetId',\r\n      'Billable',\r\n      'BudgetsTurnedOn',\r\n      'Color',\r\n      'DefaultAccServiceId',\r\n      'DefaultReservationDuration',\r\n      'FirstCustomFormId',\r\n      'ForceTutoring',\r\n      'HasAttendance',\r\n      'HideProjects',\r\n      'HideTrainingSession',\r\n      'IsEquipmentTutoring',\r\n      'MandatoriesEquipments',\r\n      'OfflineServices',\r\n      'MinOrderHours',\r\n      'NotAllowReservations',\r\n      'OptionalsEquipments',\r\n      'ReservationOfflineServicesEnabled',\r\n      'RestrictReservationToTimeSlots',\r\n      'TrainingSignUpApproval',\r\n      'ServiceGroupId',\r\n      'ServiceGroupName',\r\n      'CustomFormId',\r\n      'FirstCustomFormId',\r\n      'CustomForms',\r\n      'AllowModification',\r\n      'AllowExtendReservation',\r\n      'AllowUsersToShortenReservations',\r\n      'AllowedToTransfer',\r\n      'AllowedToTransferAll',\r\n      'EnforceReservationRestrictions',\r\n      'LimitlessReservationAllowed',\r\n      'MaxOrderHours',\r\n      'MinOrderGap',\r\n      'LoanTypeId',\r\n      'StaffUserSelection',\r\n      'StaffUserSelectionRequired',\r\n      'StaffUserSelectionVisible',\r\n      'RequireUserGroupCoordApproval',\r\n      'DraftReservationsTypeId',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IReservationEquipmentDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n\r\n    expand: expandedColumns,\r\n  });\r\nexport function ReservationEquipmentsPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  expandedColumns,\r\n  ...props\r\n}: ReservationEquipmentsPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    globalServiceGroupFilter || [],\r\n    expandedColumns,\r\n  );\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      variant={variant}\r\n      loadData={innerLoadData}\r\n      onChange={onChange}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'reservation-equip-multi-picker'}\r\n      helperText={helperText}\r\n      required={required}\r\n      fullWidth={props.fullWidth}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={defaultValue ?? []}\r\n      label={label}\r\n      value={value ?? []}\r\n      ariaLabel={'Equipment search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\nexport function ReservationSingleEquipmentPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  expandedColumns,\r\n  ...props\r\n}: ReservationEquipmentsPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    predicates,\r\n    globalServiceGroupFilter || [],\r\n    expandedColumns,\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      variant={variant}\r\n      onChange={value => {\r\n        if (!!onChange) {\r\n          if (value !== null) {\r\n            return onChange([value]);\r\n          } else {\r\n            return onChange([]);\r\n          }\r\n        }\r\n      }}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'reservation-equip-single-picker'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={\r\n        !!defaultValue\r\n          ? defaultValue.length > 0\r\n            ? (defaultValue[0] as IReservationEquipmentDto | undefined | null)\r\n            : undefined\r\n          : undefined\r\n      }\r\n      label={label}\r\n      value={\r\n        !!value\r\n          ? value.length > 0\r\n            ? (value[0] as IReservationEquipmentDto | undefined | null)\r\n            : undefined\r\n          : undefined\r\n      }\r\n      ariaLabel={'Equipment search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\nexport function ReservationsEquipmentFilter(\r\n  firstInitEquipments: number[],\r\n  mandatoryIds: number[],\r\n): (string | Condition<IReservationEquipmentDto>)[] {\r\n  const predicates: (string | Condition<IReservationEquipmentDto>)[] = [\r\n    // assembly parts should not appear in the equipment picker on the reservation side panel\r\n    // only regular equipments and those that are at the top of the assembly are bookable directly\r\n    new Condition<IReservationEquipmentDto>(\r\n      'AssemblyId',\r\n      ODataOperators.Equals,\r\n      null,\r\n    ),\r\n  ];\r\n  if (firstInitEquipments.length > 0) {\r\n    let ids = firstInitEquipments.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IReservationEquipmentDto>(\r\n        'Id',\r\n        ODataOperators.Includes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (mandatoryIds.length > 0) {\r\n    let ids = mandatoryIds.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IReservationEquipmentDto>(\r\n        'Id',\r\n        ODataOperators.Excludes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport const loadEquipments = loadData;\r\n","/**\r\n *\r\n * FormReservationEquipmentsPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  ReservationEquipmentsPicker,\r\n  ReservationSingleEquipmentPicker,\r\n} from '../pickers/MultiSelectPickers/EquipmentReservationPicker';\r\nimport { IReservationEquipmentDto } from 'app/pages/ReservationDetails/Details/slice/types';\r\n\r\nexport const FormReservationEquipmentsPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IReservationEquipmentDto[] | null> &\r\n  IFieldProps & { multiple: boolean; autoExpand?: string }) => {\r\n  const [field, meta, helpers] = useField<IReservationEquipmentDto[] | null>(\r\n    props,\r\n  );\r\n  if (props.multiple) {\r\n    return (\r\n      <ReservationEquipmentsPicker\r\n        predicates={props.predicates}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onChipClick={props.onChipClick}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        error={meta?.error !== undefined}\r\n        variant=\"filled\"\r\n        disabled={props.disabled}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        expandedColumns={props.autoExpand}\r\n      />\r\n    );\r\n  } else {\r\n    return (\r\n      <ReservationSingleEquipmentPicker\r\n        predicates={props.predicates}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onChipClick={props.onChipClick}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        error={meta?.error !== undefined}\r\n        variant=\"filled\"\r\n        disabled={props.disabled}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        expandedColumns={props.autoExpand}\r\n      />\r\n    );\r\n  }\r\n};\r\n","/**\r\n *\r\n * FormReservationStatusPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ReservationStatusPicker } from '../pickers/AutocompletePickers/ReservationStatusPicker';\r\n\r\nexport const FormReservationStatusPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <ReservationStatusPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        disableClearable\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { CustomFormControl } from 'app/components/CustomForm/CusomFormControl';\r\nimport * as React from 'react';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useReservationSlice } from '../slice';\r\nimport { selectAsyncChangeLoading } from '../slice/selectors';\r\n\r\nexport interface ReservationCustomFormProps {\r\n  multiple?: boolean;\r\n  customForms: ICustomFormDto[];\r\n  readonly?: boolean;\r\n  isAdmin?: boolean;\r\n  customFormRef: React.MutableRefObject<any>;\r\n  formIsValid?: (isValid: boolean) => void;\r\n  formValues: IFormValueDto[];\r\n  disabled?: boolean;\r\n  validationEnabled?: boolean;\r\n  saveFormValues: (\r\n    values: IFormValueDto[],\r\n    files: IFormFileValue[],\r\n    originalFiles: IFormFileValue[],\r\n  ) => void;\r\n}\r\n\r\nexport function ReservationCustomForm(props: ReservationCustomFormProps) {\r\n  const {\r\n    multiple,\r\n    customForms,\r\n    readonly,\r\n    isAdmin,\r\n    customFormRef,\r\n    formIsValid,\r\n    formValues,\r\n    saveFormValues,\r\n    disabled,\r\n    validationEnabled = true,\r\n  } = props;\r\n  const dispatch = useDispatch();\r\n  const { actions } = useReservationSlice();\r\n  const mandatoryForms = React.useMemo(() => {\r\n    return customForms.filter(f => f.Mandatory === true);\r\n  }, [customForms]);\r\n  const optionalForms = React.useMemo(() => {\r\n    return customForms.filter(f => !f.Mandatory);\r\n  }, [customForms]);\r\n  const isAsyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n  const selectedForms = React.useMemo(() => {\r\n    return customForms.filter(f =>\r\n      formValues.some(c => c.CustomFormId === f.Id),\r\n    );\r\n  }, [customForms, formValues]);\r\n  const formValuesForms = React.useMemo(() => {\r\n    return formValues.length > 0\r\n      ? [\r\n          ...new Set(\r\n            formValues.map(f => f.CustomFormId || 0).filter(f => f > 0),\r\n          ),\r\n        ]\r\n      : [];\r\n  }, [formValues]);\r\n  const onLoadCompleted = () => {\r\n    if (isAsyncChangeLoading) {\r\n      dispatch(actions.setAsyncChangeLoading(false));\r\n    }\r\n  };\r\n  const onLoadStarted = () => {\r\n    dispatch(actions.setAsyncChangeLoading(true));\r\n  };\r\n  const formId = React.useMemo(() => {\r\n    return selectedForms.length > 0\r\n      ? selectedForms[0].Id\r\n      : formValuesForms.length > 0\r\n      ? formValuesForms[0]\r\n      : mandatoryForms.length > 0\r\n      ? mandatoryForms[0].Id\r\n      : optionalForms.length > 0\r\n      ? optionalForms[0].Id\r\n      : 0;\r\n  }, [formValuesForms, mandatoryForms, optionalForms, selectedForms]);\r\n  return customForms.length > 0 || formId > 0 ? (\r\n    <React.Fragment>\r\n      {multiple ? (\r\n        <CustomFormControl\r\n          CustomFormId={formId}\r\n          readonly={readonly}\r\n          isAdmin={isAdmin}\r\n          values={formValues}\r\n          FormType={CustomFormTypeEnum.Reservation}\r\n          submitFormRef={customFormRef}\r\n          formIsValid={formIsValid}\r\n          saveFormValues={saveFormValues}\r\n          disabled={disabled}\r\n          onLoadCompleted={onLoadCompleted}\r\n          onLoadStarted={onLoadStarted}\r\n          validationEnabled={validationEnabled}\r\n        />\r\n      ) : (\r\n        <CustomFormControl\r\n          CustomFormId={formId}\r\n          readonly={readonly}\r\n          isAdmin={isAdmin}\r\n          values={formValues}\r\n          FormType={CustomFormTypeEnum.Reservation}\r\n          submitFormRef={customFormRef}\r\n          formIsValid={formIsValid}\r\n          saveFormValues={saveFormValues}\r\n          disabled={disabled}\r\n          onLoadCompleted={onLoadCompleted}\r\n          onLoadStarted={onLoadStarted}\r\n          validationEnabled={validationEnabled}\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  ) : (\r\n    <React.Fragment>{''}</React.Fragment>\r\n  );\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\n\r\nexport interface BudgetListenerProps<T> {\r\n  budget: Entity<number> | null;\r\n  ReservationUserGroupGroupByBudgetUserGroup: boolean;\r\n  values?: T;\r\n  setUserGroup: (value: Entity<string> | null) => void;\r\n}\r\n\r\nexport function BudgetListener<T>(props: BudgetListenerProps<T>) {\r\n  const {\r\n    budget,\r\n    ReservationUserGroupGroupByBudgetUserGroup,\r\n    setUserGroup,\r\n  } = props;\r\n  const [initilized, setInitilized] = React.useState(true);\r\n  React.useEffect(() => {\r\n    if (!initilized) {\r\n      if (!!budget?.Id) {\r\n        if (ReservationUserGroupGroupByBudgetUserGroup) {\r\n          if (!!(budget as IBudgetFilterDto).UserGroupId) {\r\n            setUserGroup({\r\n              Id: (budget as IBudgetFilterDto).UserGroupId,\r\n              Name: (budget as IBudgetFilterDto).UserGroupName,\r\n            } as IUserGroupDto);\r\n          }\r\n        }\r\n      } else {\r\n        if (ReservationUserGroupGroupByBudgetUserGroup) {\r\n          setUserGroup(null);\r\n        }\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [budget]);\r\n\r\n  return null;\r\n}\r\n","import { useFormikContext } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectEquipmentsSettings } from '../../slice/selectors';\r\n\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { getWorkFlowName } from '../utils';\r\nimport { ReservationDetailsState } from '../../slice/types';\r\nimport { isMember } from './isMember';\r\n\r\nexport interface UserNameListenerProps<T extends ReservationDetailsState> {\r\n  userName: Entity<string> | null;\r\n  equipments: Entity<number>[];\r\n  globalSettings: GlobalSettingsType;\r\n  user: AuthenticatedUser | undefined;\r\n  isEdit: boolean;\r\n  changeHandler: (values: T, changeStatus?: boolean | undefined) => void;\r\n  values: T;\r\n}\r\nexport function UserNameListener<T extends ReservationDetailsState>(\r\n  props: UserNameListenerProps<T>,\r\n) {\r\n  const { userName, equipments, globalSettings } = props;\r\n\r\n  const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n  const [initilized, setInitilized] = React.useState(true);\r\n  const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n    return !!equipmentSettings\r\n      ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n          !equipmentSettings.HasHideProjects &&\r\n          !equipmentSettings.HasConflictProjects &&\r\n          equipmentSettings.BudgetsTurnedOn\r\n      : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n  }, [\r\n    equipmentSettings,\r\n    globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n  ]);\r\n\r\n  const { setFieldValue } = useFormikContext<T>();\r\n\r\n  React.useEffect(() => {\r\n    if (!initilized) {\r\n      if (equipments.length > 0) {\r\n        //&& !isEdit\r\n        if (userName !== null) {\r\n          if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n            if (!isMember(userName, props.values.ADGroup))\r\n              setFieldValue('ADGroup', {\r\n                Id: (userName as IUserFilterDto).UserGroupId,\r\n                Name: (userName as IUserFilterDto).UserGroupName,\r\n              });\r\n          }\r\n          if (globalSettings.AllowWorkflowBooking) {\r\n            setFieldValue('WorkflowBooking', getWorkFlowName(userName.Id));\r\n          }\r\n        }\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [userName]);\r\n\r\n  return null;\r\n}\r\n","import { useFormikContext } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectEquipmentsSettings } from '../../slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { IReservationEquipmentDto } from '../../slice/types';\r\nimport { getBudgetVisible } from '../../slice/getBudgetVisible';\r\nimport { isMember } from './isMember';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\n\r\nexport interface UserGroupListenerProps<T> {\r\n  userName: Entity<string> | null;\r\n  equipments: Entity<number>[];\r\n  userGroup: Entity<string> | null | undefined;\r\n  startTime: Date | string;\r\n  endTime: Date | string;\r\n  globalSettings: GlobalSettingsType;\r\n  user: AuthenticatedUser | undefined;\r\n  isEdit: boolean;\r\n  values?: T;\r\n}\r\nexport function UserGroupListener<T>(props: UserGroupListenerProps<T>) {\r\n  const { userName, equipments, userGroup, globalSettings, isEdit } = props;\r\n  const [initilized, setInitilized] = React.useState(true);\r\n  const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n  const budgetVisible = React.useMemo(() => {\r\n    return getBudgetVisible(\r\n      globalSettings,\r\n      (equipments as IReservationEquipmentDto[]).map(service => ({\r\n        Billable: service.Billable,\r\n        BudgetsTurnedOn: service.BudgetsTurnedOn,\r\n        HideProjects: service.HideProjects,\r\n        ServiceTypeId: ServiceType.Online,\r\n      })),\r\n    );\r\n  }, [equipments, globalSettings]);\r\n\r\n  const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n    return !!equipmentSettings\r\n      ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n          !equipmentSettings.HasHideProjects &&\r\n          !equipmentSettings.HasConflictProjects &&\r\n          equipmentSettings.BudgetsTurnedOn\r\n      : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n  }, [\r\n    equipmentSettings,\r\n    globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n  ]);\r\n  const { setFieldValue } = useFormikContext<T>();\r\n  React.useEffect(() => {\r\n    if (!initilized) {\r\n      if (userGroup !== null) {\r\n        if (\r\n          budgetVisible &&\r\n          !isEdit &&\r\n          equipments.length > 0 &&\r\n          userName !== null\r\n        ) {\r\n          if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n            setFieldValue('Budget', null);\r\n          }\r\n        } else {\r\n          if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n            if (!isMember(userName, userGroup)) {\r\n              setFieldValue('BookedBy', null);\r\n            }\r\n\r\n            if (budgetVisible && !isEdit) {\r\n              setFieldValue('Budget', null);\r\n            }\r\n          }\r\n        }\r\n      } else {\r\n        if (!ReservationUserGroupGroupByBudgetUserGroup) {\r\n          setFieldValue('BookedBy', null);\r\n          if (budgetVisible && !isEdit) {\r\n            setFieldValue('Budget', null);\r\n          }\r\n        }\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [userGroup]);\r\n\r\n  return null;\r\n}\r\n","import { useFormikContext } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { useDispatch } from 'react-redux';\r\nimport { newDate } from '../utils';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceSettingsState } from '../../slice/types';\r\nimport { useRepetitiveSlice } from 'app/components/Forms/FormRepetitive/slice';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { CustomDate } from 'types/CustomDate';\r\n\r\nexport interface StartTimeListenerProps<T> {\r\n  userName: Entity<string> | null;\r\n  equipments: Entity<number>[];\r\n  globalSettings: GlobalSettingsType;\r\n  user: AuthenticatedUser | undefined;\r\n  startTime: Date | string;\r\n  endTime: Date | string;\r\n  initialStart: Date | string;\r\n  initialEnd: Date | string;\r\n  changeHandler: (values: T, changeStatus?: boolean | undefined) => void;\r\n  equipmentSettings: ServiceSettingsState | undefined;\r\n  isEdit: boolean;\r\n  values: T;\r\n}\r\nexport function StartTimeListener<T>(props: StartTimeListenerProps<T>) {\r\n  const {\r\n    userName,\r\n    equipments,\r\n    startTime,\r\n    endTime,\r\n    initialStart,\r\n    initialEnd,\r\n    values,\r\n    equipmentSettings,\r\n    changeHandler,\r\n  } = props;\r\n  const [prevStartTime, setPrevStartTime] = React.useState<\r\n    Date | string | undefined\r\n  >(initialStart);\r\n  const [prevEndTime, setPrevEndTime] = React.useState<\r\n    Date | string | undefined\r\n  >(initialEnd);\r\n  const isStartChanged = React.useRef<boolean | undefined>(undefined);\r\n  const isEndChanged = React.useRef<boolean | undefined>(undefined);\r\n  // const [isStartChanged, setIsStartChanged] = React.useState<\r\n  //   boolean | undefined\r\n  // >(undefined);\r\n  // const [isEndChanged, setIsEndChanged] = React.useState<boolean | undefined>(\r\n  //   undefined,\r\n  // );\r\n  const dispatch = useDispatch();\r\n  const { actions: repetitiveActions } = useRepetitiveSlice();\r\n  const [initilized, setInitilized] = React.useState(true);\r\n  const { setFieldValue } = useFormikContext<T>();\r\n  const { setFieldTouched, validateForm } = useFormikContext<T>();\r\n  React.useEffect(() => {\r\n    if (!initilized) {\r\n      let start = newDate(startTime);\r\n      let end =\r\n        endTime === null\r\n          ? newDate(\r\n              dateUtils.set(start, {\r\n                hours:\r\n                  start.getHours() +\r\n                  (equipmentSettings?.DefaultReservationDuration || 1),\r\n                minutes: start.getMinutes(),\r\n              }),\r\n            )\r\n          : newDate(endTime);\r\n      //Start Time Changed\r\n      if (!!prevStartTime) {\r\n        let prev = newDate(prevStartTime);\r\n        if (start.getTime() !== prev.getTime()) {\r\n          if (end === null) {\r\n            end = newDate(\r\n              dateUtils.addHours(\r\n                start,\r\n                equipmentSettings?.DefaultReservationDuration || 1,\r\n              ),\r\n            );\r\n          }\r\n          dateUtils.addMilliseconds(end, start.getTime() - prev.getTime());\r\n          setTimeout(() => setFieldTouched('EndTime', true, false));\r\n\r\n          setTimeout(() =>\r\n            validateForm({\r\n              ...values,\r\n              EndTime: dateUtils.formatISO(dateUtils.dateOrStringToDate(end), {\r\n                format: 'basic',\r\n                representation: 'complete',\r\n              }),\r\n            }),\r\n          );\r\n          setPrevStartTime(start);\r\n          isStartChanged.current = true;\r\n          isEndChanged.current =\r\n            end.getTime() !== newDate(prevEndTime).getTime();\r\n          //setIsEndChanged(end.getTime() !== newDate(prevEndTime).getTime());\r\n          setPrevEndTime(end);\r\n          dispatch(\r\n            repetitiveActions.setRepetitiveValue({\r\n              fieldKey: 'RecurringEndDate',\r\n              fieldValue: dateUtils.formatISO(\r\n                new CustomDate(dateUtils.addDays(start, 7), 'date'),\r\n              ),\r\n            }),\r\n          );\r\n        } else {\r\n          let prevEnd = newDate(prevEndTime);\r\n          if (end.getTime() !== prevEnd.getTime()) {\r\n            //setIsEndChanged(true);\r\n            isEndChanged.current = true;\r\n          }\r\n          setPrevEndTime(end);\r\n        }\r\n      }\r\n      if (\r\n        equipments.length > 0 &&\r\n        userName != null &&\r\n        (isStartChanged.current === true || isEndChanged.current === true)\r\n      ) {\r\n        changeHandler({ ...values, EndTime: end }, false);\r\n        if (isEndChanged.current === true) {\r\n          setFieldValue(\r\n            'EndTime',\r\n            dateUtils.formatISO(dateUtils.dateOrStringToDate(end), {\r\n              format: 'basic',\r\n              representation: 'complete',\r\n            }),\r\n          );\r\n        }\r\n        console.log('StartTime Changed');\r\n        isEndChanged.current = undefined;\r\n        isStartChanged.current = undefined;\r\n        // setIsStartChanged(undefined);\r\n        // setIsEndChanged(undefined);\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [startTime, endTime]);\r\n\r\n  return null;\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { GlobalSettingsType } from '../useGlobalSettingsHook';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAsyncChangeLoading } from '../../slice/selectors';\r\nimport { newDate } from '../utils';\r\n\r\nexport interface EndTimeListenerProps<T> {\r\n  userName: Entity<string> | null;\r\n  equipments: Entity<number>[];\r\n  globalSettings: GlobalSettingsType;\r\n  user: AuthenticatedUser | undefined;\r\n  endTime: Date | string;\r\n  initialEnd: Date | string;\r\n  isEdit: boolean;\r\n  changeHandler: (values: T, changeStatus?: boolean | undefined) => void;\r\n  values: T;\r\n}\r\nexport function EndTimeListener<T>(props: EndTimeListenerProps<T>) {\r\n  const {\r\n    userName,\r\n    equipments,\r\n    endTime,\r\n    isEdit,\r\n    changeHandler,\r\n    values,\r\n    initialEnd,\r\n  } = props;\r\n  const [initialized, setInitialized] = React.useState(true);\r\n  const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n  const [prevEndTime, setPrevEndTime] = React.useState<\r\n    Date | string | undefined\r\n  >(initialEnd);\r\n  React.useEffect(() => {\r\n    if (!initialized) {\r\n      let newEnd = newDate(endTime);\r\n      let prevEnd = newDate(prevEndTime);\r\n      if (\r\n        equipments.length > 0 &&\r\n        userName != null &&\r\n        !isEdit &&\r\n        !asyncChangeLoading &&\r\n        prevEnd.getTime() !== newEnd.getTime()\r\n      ) {\r\n        changeHandler(values);\r\n      }\r\n      setPrevEndTime(newEnd);\r\n    }\r\n    setInitialized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [endTime]);\r\n\r\n  return null;\r\n}\r\n","/**\r\n *\r\n * ChipCheckBoxGroup\r\n *\r\n */\r\nimport {\r\n  FormControl,\r\n  FormGroup,\r\n  FormHelperText,\r\n  FormLabel,\r\n  styled,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { inputLabelXS } from 'styles/typography/bookitTypography';\r\nimport { BookitChipWithCheck } from '.';\r\nimport { CheckEntity } from '../CheckBoxGroup';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\n\r\nexport interface ChipCheckBoxGroupProps {\r\n  options: CheckEntity[];\r\n  value?: CheckEntity[];\r\n  className?: string;\r\n  onChange?: (\r\n    value: CheckEntity,\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => void;\r\n  id: string;\r\n  //formik\r\n  name?: string;\r\n  error?: boolean;\r\n  label?: string;\r\n  disabled?: boolean;\r\n  required?: boolean;\r\n  helperText?: string;\r\n  info?: string;\r\n  fullWidth?: boolean;\r\n  size?: 'small' | 'medium';\r\n  margin?: 'none' | 'dense' | 'normal';\r\n  isRow?: boolean;\r\n  style?: React.CSSProperties;\r\n}\r\n\r\nexport function ChipCheckBoxGroup({\r\n  name,\r\n  id,\r\n  value,\r\n  options,\r\n  onChange,\r\n  label,\r\n  required,\r\n  helperText,\r\n  disabled,\r\n  fullWidth,\r\n  margin,\r\n  error,\r\n  size,\r\n  isRow,\r\n  style,\r\n  ...props\r\n}: ChipCheckBoxGroupProps) {\r\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = {\r\n      Id: parseInt(event.target.id),\r\n      Name: event.target.name,\r\n      checked: event.target.checked,\r\n      disabled: event.target.disabled,\r\n    } as CheckEntity;\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n  };\r\n  return (\r\n    <FormControl\r\n      required={required}\r\n      error={error}\r\n      component=\"fieldset\"\r\n      name={name}\r\n      margin={margin}\r\n      id={id}\r\n      fullWidth={fullWidth}\r\n      style={{\r\n        border: '1px solid #CDD5DF',\r\n        borderRadius: '6px',\r\n        minHeight: '48px',\r\n        backgroundColor: '#ffffffcc',\r\n        paddingBlock: '8px',\r\n        paddingInline: '6px',\r\n        ...style,\r\n      }}\r\n    >\r\n      <StyledFormLabel>{label}</StyledFormLabel>\r\n      <FormGroup\r\n        row={isRow}\r\n        style={{\r\n          display: 'flex',\r\n          flexDirection: 'row',\r\n          alignItems: 'flex-start',\r\n          flexWrap: 'wrap',\r\n          justifyContent: 'flex-start',\r\n          gap: '6px',\r\n          //maxWidth: '260px',\r\n        }}\r\n      >\r\n        {options.map((item, index) => (\r\n          <FormControlLabel\r\n            value={item}\r\n            // key={`control_${item.Id}`}\r\n            disabled={disabled || item.disabled}\r\n            style={{ width: '260px', margin: 0 }}\r\n            label=\"\"\r\n            control={\r\n              <BookitChipWithCheck\r\n                key={`chip_${item.Id}`}\r\n                checkid={item.Id.toString()}\r\n                label={item.Name}\r\n                checked={item.checked}\r\n                checkname={item.Name}\r\n                disabled={item.disabled}\r\n                info={item.Name.length > 24 ? item.Name : undefined}\r\n                onChange={handleChange}\r\n                size=\"medium\"\r\n                color=\"primary\"\r\n              />\r\n            }\r\n          />\r\n        ))}\r\n      </FormGroup>\r\n      <FormHelperText>{helperText}</FormHelperText>\r\n    </FormControl>\r\n  );\r\n}\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n  color: theme.palette.common.graySubtitle,\r\n  inputLabelXS,\r\n  '.Mui-focused &': {\r\n    color: theme.palette.common.graySubtitle,\r\n  },\r\n}));\r\n","/**\r\n *\r\n * ChipLabelGroup\r\n *\r\n */\r\nimport {\r\n  FormControl,\r\n  FormHelperText,\r\n  FormLabel,\r\n  styled,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { inputLabelXS } from 'styles/typography/bookitTypography';\r\nimport { BookitChipWithInfo } from '.';\r\nimport { CheckEntity, ChipEntity } from '../CheckBoxGroup';\r\n\r\nexport interface ChipLabelGroupProps {\r\n  options: ChipEntity[];\r\n  value?: ChipEntity[];\r\n  className?: string;\r\n  onChipClick?: (chip: ChipEntity) => void;\r\n  onChange?: (\r\n    value: CheckEntity,\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => void;\r\n  id: string;\r\n  //formik\r\n  name?: string;\r\n  error?: boolean;\r\n  label?: string;\r\n  disabled?: boolean;\r\n  required?: boolean;\r\n  helperText?: string;\r\n  info?: string;\r\n  fullWidth?: boolean;\r\n  size?: 'small' | 'medium';\r\n  margin?: 'none' | 'dense' | 'normal';\r\n  isRow?: boolean;\r\n  style?: React.CSSProperties;\r\n}\r\n\r\nexport function ChipLabelGroup({\r\n  name,\r\n  id,\r\n  value,\r\n  options,\r\n  onChange,\r\n  label,\r\n  onChipClick,\r\n  required,\r\n  helperText,\r\n  disabled,\r\n  fullWidth,\r\n  margin,\r\n  error,\r\n  size,\r\n  isRow,\r\n  style,\r\n  ...props\r\n}: ChipLabelGroupProps) {\r\n  //   const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n  //     const value = {\r\n  //       Id: parseInt(event.target.id),\r\n  //       Name: event.target.name,\r\n  //       checked: event.target.checked,\r\n  //     } as CheckEntity;\r\n  //     if (onChange !== undefined) {\r\n  //       onChange(value, event);\r\n  //     }\r\n  //   };\r\n  return (\r\n    <FormControl\r\n      required={required}\r\n      error={error}\r\n      component=\"fieldset\"\r\n      name={name}\r\n      margin={margin}\r\n      id={id}\r\n      variant=\"filled\"\r\n      fullWidth={fullWidth}\r\n      style={{\r\n        border: '1px solid #CDD5DF',\r\n        borderRadius: '6px',\r\n        minHeight: '48px',\r\n        backgroundColor: '#ffffffcc',\r\n        paddingBlock: '8px',\r\n        paddingInline: '6px',\r\n        ...style,\r\n      }}\r\n    >\r\n      <StyledFormLabel>{label}</StyledFormLabel>\r\n      <div\r\n        style={{\r\n          display: 'flex',\r\n          flexDirection: 'row',\r\n          alignItems: 'flex-start',\r\n          flexWrap: 'wrap',\r\n          justifyContent: 'flex-start',\r\n          gap: '6px',\r\n        }}\r\n      >\r\n        {options.map((item, index) => (\r\n          <div\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'row',\r\n              alignItems: 'center',\r\n              gap: '8px',\r\n              width: '260px',\r\n            }}\r\n            key={`wrap-${item.Id}`}\r\n          >\r\n            <BookitChipWithInfo\r\n              onClick={() => !!onChipClick && onChipClick(item)}\r\n              //fullwidth={fullWidth}\r\n              variant=\"default\"\r\n              size={size || 'small'}\r\n              label={item.Name}\r\n              key={`chip-${item.Id}`}\r\n              customwidth={260}\r\n              info={item.info}\r\n            />\r\n          </div>\r\n        ))}\r\n      </div>\r\n      {helperText && <FormHelperText>{helperText}</FormHelperText>}\r\n    </FormControl>\r\n  );\r\n}\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n  color: theme.palette.common.graySubtitle,\r\n  ...inputLabelXS,\r\n  '.Mui-focused &': {\r\n    color: theme.palette.common.graySubtitle,\r\n  },\r\n}));\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { ChangeEvent } from 'react';\r\nimport {\r\n  ChipCheckBoxGroup,\r\n  ChipCheckBoxGroupProps,\r\n} from '../BasicChip/ChipChekBoxGroup';\r\nimport {\r\n  ChipLabelGroup,\r\n  ChipLabelGroupProps,\r\n} from '../BasicChip/ChipLabelGroup';\r\nimport { CheckEntity, ChipEntity } from '../CheckBoxGroup';\r\n\r\n//export type FormCheckBoxGroupProps = FieldHookConfig<CheckEntity[]> & CheckBoxGroupProps;\r\n\r\nexport const FormChipCheckBoxGroup = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<CheckEntity[]> &\r\n  ChipCheckBoxGroupProps & { setOnChanged: () => void }) => {\r\n  const [field, meta, helpers] = useField<CheckEntity[]>(props);\r\n  const handleChange = (\r\n    value: CheckEntity,\r\n    event: ChangeEvent<HTMLInputElement>,\r\n  ) => {\r\n    const val = value as CheckEntity;\r\n    helpers.setValue(\r\n      field.value.map(f => {\r\n        if (f.Id === val.Id) {\r\n          return { ...f, checked: val.checked };\r\n        }\r\n        return f;\r\n      }),\r\n      true,\r\n    );\r\n    field.onChange(event);\r\n    if (props.onChange !== undefined) {\r\n      props.onChange(value, event);\r\n    }\r\n    props.setOnChanged();\r\n  };\r\n  return (\r\n    <ChipCheckBoxGroup\r\n      label={label}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      info={props.info}\r\n      onChange={handleChange}\r\n      disabled={props.disabled}\r\n      required={props.required}\r\n      isRow={true}\r\n      margin=\"none\"\r\n      size={props.size}\r\n      {...props}\r\n    />\r\n  );\r\n};\r\nexport const FormChipLabelGroup = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<ChipEntity[]> &\r\n  ChipLabelGroupProps & { onChipClick?: (value: ChipEntity) => void }) => {\r\n  const [field, meta] = useField<ChipEntity[]>(props);\r\n  const handleChipClick = (value: ChipEntity) => {\r\n    !!props.onChipClick && props.onChipClick(value);\r\n  };\r\n  //   const handleChange = (value, event) => {\r\n  //     const val = value as CheckEntity;\r\n  //     helpers.setValue(\r\n  //       field.value.map(f => {\r\n  //         if (f.Id === val.Id) {\r\n  //           f.checked = val.checked;\r\n  //         }\r\n  //         return f;\r\n  //       }),\r\n  //       true,\r\n  //     );\r\n  //     if (props.onChange !== undefined) {\r\n  //       props.onChange(value, event);\r\n  //     }\r\n  //     field.onChange(event);\r\n  // };\r\n  return (\r\n    <ChipLabelGroup\r\n      label={label}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      info={props.info}\r\n      onChipClick={handleChipClick}\r\n      disabled={props.disabled}\r\n      required={props.required}\r\n      isRow={true}\r\n      margin=\"none\"\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n","import { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { OtherServicesApi } from 'api/OtherServicesApi';\r\nimport { FormFieldsSection } from 'app/components/Forms/FormsLayout';\r\nimport {\r\n  loadOfflineServiceData,\r\n  ReservationsRelatedFilter,\r\n} from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { BookQuickServices } from 'app/pages/OtherServiceDetails/Details/components/BookQuickServices';\r\nimport { useOfflineServiceStateSlice } from 'app/pages/OtherServiceDetails/Details/slice';\r\nimport { selectSavedReservationService } from 'app/pages/OtherServiceDetails/Details/slice/selectors';\r\nimport {\r\n  ErrorServices,\r\n  OfflineServicesResponse,\r\n} from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useReservationSlice } from '../slice';\r\nimport { combineMandatoryOfflineServices } from '../slice/combineOfflineServiceTypes';\r\nimport {\r\n  selectCloneReservations,\r\n  selectSavedOfflineServices,\r\n} from '../slice/selectors';\r\nimport {\r\n  ReservationDetailsState,\r\n  ReservationSettingsState,\r\n  ServiceSettingsState,\r\n} from '../slice/types';\r\nimport { GlobalSettingsType } from './useGlobalSettingsHook';\r\n\r\nexport interface ReservationOfflineServicesProps {\r\n  values: ReservationDetailsState;\r\n  reservationSettings?: ReservationSettingsState;\r\n  equipmentSettings: ServiceSettingsState | undefined;\r\n  globalSettings: GlobalSettingsType;\r\n  isEdit: boolean;\r\n  title?: React.ReactNode;\r\n  hanleUpdateLocalServices: (\r\n    services: IOtherServices[],\r\n    operation: 'add' | 'remove' | 'update',\r\n  ) => void;\r\n  onServiceClick?: (item: IOtherServices) => void;\r\n  disabled?: boolean;\r\n  onAddBatchClick: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n  setError?: (error: ErrorServices) => void;\r\n}\r\n\r\nexport const ReservationOfflineServices = React.memo(\r\n  function ReservationOfflineServices(props: ReservationOfflineServicesProps) {\r\n    const { t } = useTranslation();\r\n    const dispatch = useDispatch();\r\n    const isCloned = useSelector(selectCloneReservations);\r\n    const savedServices = useSelector(selectSavedOfflineServices);\r\n    const savedServiceEditable = useSelector(selectSavedReservationService);\r\n    const { actions: notifyActions } = useAppSettingsSlice();\r\n    const { actions: offActions } = useOfflineServiceStateSlice();\r\n    const { actions } = useReservationSlice();\r\n    const { newDate, getOffsetDate } = useSystemDate();\r\n\r\n    const {\r\n      isEdit,\r\n      values,\r\n      equipmentSettings,\r\n      reservationSettings,\r\n      hanleUpdateLocalServices,\r\n      onServiceClick,\r\n      title,\r\n      disabled,\r\n      onAddBatchClick,\r\n      setError,\r\n    } = props;\r\n\r\n    const optionalServiceTypes = React.useMemo(() => {\r\n      const MandatoryOfflineServicesOnTrainingSignUps =\r\n        props.globalSettings.MandatoryOfflineServicesOnTrainingSignUps &&\r\n        values.TrainingSignUp;\r\n\r\n      const result = [\r\n        ...(reservationSettings?.OfflineOptional?.map(f => ({\r\n          Id: f.Id,\r\n          Mandatory: f.Mandatory,\r\n          HideProject: f.HideProjects,\r\n        })) ?? []),\r\n        ...(equipmentSettings?.OfflineServiceTypes?.map(f => ({\r\n          Id: f.Id,\r\n          Mandatory: f.Mandatory,\r\n          HideProject: f.HideProject,\r\n        })) ?? []),\r\n      ].filter(f =>\r\n        MandatoryOfflineServicesOnTrainingSignUps\r\n          ? f.Mandatory === true\r\n          : !MandatoryOfflineServicesOnTrainingSignUps,\r\n      );\r\n      return result;\r\n    }, [\r\n      equipmentSettings?.OfflineServiceTypes,\r\n      props.globalSettings.MandatoryOfflineServicesOnTrainingSignUps,\r\n      reservationSettings?.OfflineOptional,\r\n      values.TrainingSignUp,\r\n    ]);\r\n    const budgetServiceGroupServicesAllowed = React.useMemo(() => {\r\n      return values.Budget === null || values.Budget === undefined\r\n        ? undefined\r\n        : (values.Budget as IBudgetFilterDto).ServiceGroupServicesAllowed;\r\n    }, [values.Budget]);\r\n    const fetchServiceType = async (\r\n      searchTerm: string | null,\r\n      predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n    ) => {\r\n      try {\r\n        const data = await loadOfflineServiceData(\r\n          [\r\n            ...ReservationsRelatedFilter(\r\n              equipmentSettings?.Groups || [],\r\n              optionalServiceTypes,\r\n              equipmentSettings?.HasHideProjects,\r\n              equipmentSettings?.AllOffServicesAllowed ?? undefined,\r\n              values.Budget?.Id,\r\n              budgetServiceGroupServicesAllowed,\r\n            ),\r\n            ...(predicates ?? []),\r\n          ],\r\n          'public',\r\n          [],\r\n          undefined,\r\n          'InventoryBatches',\r\n        )(searchTerm, undefined);\r\n        return data.value;\r\n      } catch {\r\n        return [];\r\n      }\r\n    };\r\n    const sortFunc = (a: IInventoryBatchDto, b: IInventoryBatchDto) => {\r\n      return b.Id - a.Id;\r\n    };\r\n    const prepareService = (\r\n      serviceType: IOfflineServiceFilterDto,\r\n      reservation: ReservationDetailsState,\r\n    ) => {\r\n      let batch = serviceType.InventoryBatchesEnabled\r\n        ? !!serviceType.InventoryBatches &&\r\n          serviceType.InventoryBatches.length > 0\r\n          ? serviceType.InventoryBatches.filter(\r\n              f =>\r\n                (f.ExpirationDate === null ||\r\n                  getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n                (serviceType.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n                f.StokRenewed === true,\r\n            ).sort(sortFunc)[0]\r\n          : null\r\n        : null;\r\n      let data = {\r\n        Id: 0,\r\n        BookedBy: reservation.BookedBy?.Id,\r\n        UserDisplayName: reservation.BookedBy?.Name,\r\n        BudgetID: reservation.Budget?.Id,\r\n        Budget: reservation.Budget?.Name,\r\n        BudgetExperimentId: reservation.BudgetExperiment?.Id,\r\n        BudgetExperimentName: reservation.BudgetExperiment?.Name,\r\n        Quantity: serviceType.DefaultQuantity,\r\n        DefaultQuantity: serviceType.DefaultQuantity,\r\n        ExternalCustomerId: reservation.ExternalCustomer?.Id,\r\n        ExternalCustomerName: reservation.ExternalCustomer?.Name,\r\n        FundingType: reservation.FundingType?.Id,\r\n        IntQuantityOnly: serviceType.IntQuantityOnly,\r\n        DiscountFactor: 1,\r\n        InstituteProjectId: reservation.InstituteProject?.Id,\r\n        InstituteProjectName: reservation.InstituteProject?.Name,\r\n        PurchaseOrder: reservation.PurchaseOrder,\r\n        Reference: reservation.Reference,\r\n        Mandatory: false,\r\n        Remarks:\r\n          reservation.Id > 0\r\n            ? (t(\r\n                translations.ReservationOfflineServiceDefaultRemarks,\r\n              ) as string)\r\n                .replace('{0}', reservation.Id.toString())\r\n                .replace('{1}', reservationSettings?.BaseEquipment?.Name || '')\r\n            : null,\r\n        ReservationId: reservation.Id,\r\n        ServiceDate: dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(reservation.StartTime),\r\n        ),\r\n        ServiceTypeID: serviceType.Id,\r\n        ServiceType: serviceType.Name,\r\n        ServiceGroupId: serviceType.ServiceGroupId,\r\n        Units: serviceType.UnitTypeName,\r\n        UserGroup: reservation.ADGroup?.Id,\r\n        UserGroupName: reservation.ADGroup?.Name,\r\n        AllowToUser: serviceType.AllowToUser,\r\n        BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n        StaffOnly: serviceType.StaffOnly,\r\n        TrackInventory: serviceType.TrackInventory,\r\n        NotLessThanZero: serviceType.NotLessThanZero,\r\n        InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n        InventoryBatchId: batch === null ? null : batch.Id,\r\n        InventoryBatchName: batch === null ? null : batch.Name,\r\n        InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n      } as IOtherServices;\r\n      return data;\r\n    };\r\n    const createService = async (\r\n      serviceType: IOfflineServiceFilterDto,\r\n    ): Promise<IOtherServices | undefined> => {\r\n      return new Promise(async (resolve, reject) => {\r\n        let staticService = prepareService(serviceType, values);\r\n        hanleUpdateLocalServices([staticService], 'add');\r\n        resolve(staticService);\r\n      });\r\n    };\r\n    const initServices = async (): Promise<IOtherServices[]> => {\r\n      return new Promise(async resolve => {\r\n        if (savedServices.length < 1) {\r\n          if (isEdit) {\r\n            try {\r\n              const result = await OtherServicesApi.getReservationOfflineServices(\r\n                values.Id,\r\n                false,\r\n                //reservationSettings?.Repeat,\r\n              );\r\n              resolve(result.value);\r\n              hanleUpdateLocalServices(result.value as IOtherServices[], 'add');\r\n            } catch {\r\n              resolve([]);\r\n            }\r\n          } else if (isCloned) {\r\n            try {\r\n              const result = await OtherServicesApi.getReservationOfflineServices(\r\n                values.Id,\r\n                reservationSettings?.Repeat,\r\n              );\r\n              resolve(result.value);\r\n              hanleUpdateLocalServices(result.value as IOtherServices[], 'add');\r\n            } catch {\r\n              resolve([]);\r\n            }\r\n          } else {\r\n            //reduce an offline services to select only distinct services in case when several equipments have the same offline services.\r\n            let servicesFiltered = !!reservationSettings?.OfflineMandatory\r\n              ? combineMandatoryOfflineServices(\r\n                  reservationSettings?.OfflineMandatory,\r\n                ) || []\r\n              : [];\r\n            resolve(servicesFiltered);\r\n            hanleUpdateLocalServices(servicesFiltered, 'add');\r\n          }\r\n        } else {\r\n          resolve(savedServices);\r\n        }\r\n      });\r\n    };\r\n    const onRemoveService = async (service: IOtherServices) => {\r\n      return new Promise(async (resolve, reject) => {\r\n        if (isEdit) {\r\n          if (service.Id > 0) {\r\n            try {\r\n              const responseDel = await OtherServicesApi.deleteService(\r\n                service.Id,\r\n              );\r\n              let response = responseDel as OfflineServicesResponse;\r\n              if (response.ErrorMessages.length > 0) {\r\n                dispatch(\r\n                  notifyActions.addNotifications(\r\n                    response.ErrorMessages.map(item => {\r\n                      return {\r\n                        key: 'offlineServiceDeleteError',\r\n                        message: item,\r\n                        variant: 'error',\r\n                      };\r\n                    }),\r\n                  ),\r\n                );\r\n                reject(response.ErrorMessages[0]);\r\n              } else {\r\n                dispatch(\r\n                  notifyActions.addNotification({\r\n                    key: 'offlineServiceDeleteSuccess',\r\n                    message: response.SuccessMessages[0],\r\n                    variant: 'success',\r\n                  }),\r\n                );\r\n                hanleUpdateLocalServices([service], 'remove');\r\n                resolve(response.SuccessMessages[0]);\r\n              }\r\n            } catch (error: unknown) {\r\n              const message =\r\n                (error as AxiosError)?.response?.data?.error?.innererror\r\n                  ?.message ??\r\n                ((error as AxiosError)?.response?.status === 403\r\n                  ? t(translations.Forbidden)\r\n                  : undefined) ??\r\n                t(translations.errormessage);\r\n              dispatch(\r\n                notifyActions.addNotification({\r\n                  key: 'offlineServiceDeleteError',\r\n                  message: message,\r\n                  variant: 'error',\r\n                }),\r\n              );\r\n              reject(message);\r\n            }\r\n          } else {\r\n            hanleUpdateLocalServices([service], 'remove');\r\n            resolve(service);\r\n          }\r\n        } else {\r\n          hanleUpdateLocalServices([service], 'remove');\r\n          resolve(service);\r\n        }\r\n      });\r\n    };\r\n    const onUpdateService = (service: IOtherServices) => {\r\n      return new Promise(async (resolve, reject) => {\r\n        if (isEdit) {\r\n          hanleUpdateLocalServices([service], 'update');\r\n          // if (\r\n          //   service.Id > 0 &&\r\n          //   service.Quantity !== null &&\r\n          //   service.Quantity > 0\r\n          // ) {\r\n          //   try {\r\n          //     const responseUp = await OtherServicesApi.updateOtherService(\r\n          //       service,\r\n          //       service.Id,\r\n          //     );\r\n          //     let response = responseUp as OfflineServicesResponse;\r\n          //     if (response.ErrorMessages.length > 0) {\r\n          //       dispatch(\r\n          //         notifyActions.addNotifications(\r\n          //           response.ErrorMessages.map(item => {\r\n          //             return {\r\n          //               key: 'offlineServiceUpdateError',\r\n          //               message: item,\r\n          //               variant: 'error',\r\n          //             };\r\n          //           }),\r\n          //         ),\r\n          //       );\r\n          //       reject(response.ErrorMessages[0]);\r\n          //     } else {\r\n          //       dispatch(\r\n          //         notifyActions.addNotification({\r\n          //           key: 'offlineServiceUpdateSuccess',\r\n          //           message: response.SuccessMessages[0],\r\n          //           variant: 'success',\r\n          //         }),\r\n          //       );\r\n          //       resolve(service);\r\n          //     }\r\n          //   } catch (error: unknown) {\r\n          //     const message =\r\n          //       (error as AxiosError)?.response?.data?.error?.innererror\r\n          //         ?.message ??\r\n          //       ((error as AxiosError)?.response?.status === 403\r\n          //         ? t(translations.Forbidden)\r\n          //         : undefined) ??\r\n          //       t(translations.errormessage);\r\n          //     dispatch(\r\n          //       notifyActions.addNotification({\r\n          //         key: 'offlineServiceUpdateError',\r\n          //         message: message,\r\n          //         variant: 'error',\r\n          //       }),\r\n          //     );\r\n          //     reject(message);\r\n          //   }\r\n          // }\r\n          resolve(service);\r\n        } else {\r\n          hanleUpdateLocalServices([service], 'update');\r\n          resolve(service);\r\n        }\r\n      });\r\n    };\r\n\r\n    //check for any services exist to decide if show offline services component\r\n    const fetchAnyServices = async (): Promise<number> => {\r\n      return new Promise(async resolve => {\r\n        try {\r\n          let data = await initServices();\r\n          if (data.length > 0) {\r\n            resolve(data.length);\r\n          } else {\r\n            let potentialData = await fetchServiceType(null, undefined);\r\n            if (potentialData.length > 0) {\r\n              resolve(potentialData.length);\r\n            } else {\r\n              resolve(0);\r\n            }\r\n          }\r\n        } catch {\r\n          resolve(0);\r\n        }\r\n      });\r\n    };\r\n    const [hasAnyServices, setHasAnyServices] = useAsyncExtendedState<number>(\r\n      0,\r\n    );\r\n    const [fetchAnyServicesState, fetchAnyServicesPromise] = usePromise(\r\n      fetchAnyServices,\r\n    );\r\n    React.useEffect(() => {\r\n      if (\r\n        !fetchAnyServicesState.status ||\r\n        (fetchAnyServicesState.status !== 'pending' &&\r\n          fetchAnyServicesState.status !== 'resolved')\r\n      ) {\r\n        setHasAnyServices(fetchAnyServicesPromise());\r\n      }\r\n      return () => {};\r\n    }, [\r\n      fetchAnyServicesPromise,\r\n      fetchAnyServicesState.status,\r\n      setHasAnyServices,\r\n    ]);\r\n    React.useEffect(() => {\r\n      if (\r\n        !!savedServiceEditable &&\r\n        savedServices.some(\r\n          f => f.ServiceTypeID === savedServiceEditable.ServiceTypeID,\r\n        )\r\n      ) {\r\n        hanleUpdateLocalServices([savedServiceEditable], 'update');\r\n        dispatch(offActions.setReservationService(undefined));\r\n        dispatch(actions.setRefreshOfflineServices(true));\r\n      }\r\n    }, [\r\n      actions,\r\n      dispatch,\r\n      hanleUpdateLocalServices,\r\n      offActions,\r\n      savedServiceEditable,\r\n      savedServices,\r\n    ]);\r\n    return hasAnyServices > 0 ? (\r\n      <FormFieldsSection titleSection={title}>\r\n        <BookQuickServices\r\n          loadSeviceTypes={fetchServiceType}\r\n          createServiceFromServiceType={createService}\r\n          initServicesFunc={initServices}\r\n          onServiceRemove={onRemoveService}\r\n          onServiceUpdate={onUpdateService}\r\n          onServiceClick={onServiceClick}\r\n          isEditMode={isEdit}\r\n          disabled={disabled}\r\n          onAddBatchClick={onAddBatchClick}\r\n          setError={setError}\r\n        />\r\n      </FormFieldsSection>\r\n    ) : (\r\n      <React.Fragment></React.Fragment>\r\n    );\r\n  },\r\n);\r\n","/**\r\n *\r\n * AccompaniedServicesPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { InputBaseComponentProps } from '@material-ui/core';\r\nimport {\r\n  AutocompleteMultiPickerEx,\r\n  AutocompleteMultiPickerExProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPickerEx';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nexport interface AccompaniedServicesPickerProps\r\n  extends Omit<\r\n    AutocompleteMultiPickerExProps<IEquipmentAccServiceDto>,\r\n    'loadData'\r\n  > {\r\n  inputProps?: InputBaseComponentProps;\r\n}\r\nconst url = '/api/odata/v4/AccompaniedServices';\r\nexport const initAccompaniedData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    let ids = (initval.indexOf(',') !== -1\r\n      ? initval.split(',')\r\n      : [initval]\r\n    ).map(item => {\r\n      return { Id: parseInt(item) };\r\n    }) as Identifiable<number>[];\r\n    let foo: string | undefined = undefined;\r\n    if (ids.length > 0) {\r\n      const predicates: string | Condition<IEquipmentAccServiceDto>[] = [];\r\n\r\n      predicates.push(new Condition('Id', ODataOperators.Includes, ids));\r\n\r\n      foo = predicates.map(f => f.toString()).join(' and ');\r\n    }\r\n\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: foo,\r\n      $skip: 0,\r\n      $top: 10,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IEquipmentAccServiceDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<IEquipmentAccServiceDto>({\r\n    url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'Active',\r\n      'CustomFormId',\r\n      'EquipmentId',\r\n      'EquipmentName',\r\n      'OverrideTraining',\r\n      'StaffOnly',\r\n      'ServiceGroupId',\r\n      'Color',\r\n      'InstrumentCatId',\r\n      'InstrumentCatName',\r\n      'MaxOrderDuration',\r\n      'MinOrderDuration',\r\n      'MinOrderGap',\r\n      'Inventory',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IEquipmentAccServiceDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n  });\r\nexport function AccompaniedServicesPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  ...props\r\n}: AccompaniedServicesPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(predicates, globalServiceGroupFilter || []);\r\n  return (\r\n    <AutocompleteMultiPickerEx\r\n      variant={variant}\r\n      loadData={innerLoadData}\r\n      onChange={onChange}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'acc-services-multi-picker'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={defaultValue ?? []}\r\n      label={label}\r\n      value={value ?? []}\r\n      ariaLabel={'Equipment search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\nexport function SingleAccompaniedServicesPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  predicates,\r\n  disabled,\r\n  inputProps,\r\n  ...props\r\n}: AccompaniedServicesPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(predicates, globalServiceGroupFilter || []);\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      variant={variant}\r\n      onChange={value => {\r\n        if (!!onChange) {\r\n          if (value !== null) {\r\n            return onChange([value]);\r\n          } else {\r\n            return onChange([]);\r\n          }\r\n        }\r\n      }}\r\n      disabled={disabled}\r\n      info={info}\r\n      id={id || 'acc-service-single-picker'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={\r\n        !!defaultValue\r\n          ? defaultValue.length > 0\r\n            ? (defaultValue[0] as IEquipmentAccServiceDto | undefined | null)\r\n            : undefined\r\n          : undefined\r\n      }\r\n      label={label}\r\n      value={\r\n        !!value\r\n          ? value.length > 0\r\n            ? (value[0] as IEquipmentAccServiceDto | undefined | null)\r\n            : undefined\r\n          : undefined\r\n      }\r\n      ariaLabel={'Equipment search'}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\nexport function ReservationsAccServicesFilter(\r\n  Equipments: number[],\r\n): (string | Condition<IEquipmentAccServiceDto>)[] {\r\n  const predicates: (string | Condition<IEquipmentAccServiceDto>)[] = [];\r\n  if (Equipments.length > 0) {\r\n    let ids = Equipments.map(f => {\r\n      return { Id: f } as Identifiable<number>;\r\n    });\r\n    predicates.push(\r\n      new Condition<IEquipmentAccServiceDto>(\r\n        'EquipmentId',\r\n        ODataOperators.Includes,\r\n        ids,\r\n      ),\r\n    );\r\n  }\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport const loadEquipments = loadData;\r\n","/**\r\n *\r\n * FormAccompaniedServicesPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport {\r\n  AccompaniedServicesPicker,\r\n  SingleAccompaniedServicesPicker,\r\n} from '../pickers/MultiSelectPickers/AccompaniedServicesPicker';\r\n\r\nexport const FormAccompaniedServicesPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IEquipmentAccServiceDto[] | null> &\r\n  IFieldProps & { multiple: boolean }) => {\r\n  const [field, meta, helpers] = useField<IEquipmentAccServiceDto[] | null>(\r\n    props,\r\n  );\r\n  if (props.multiple) {\r\n    return (\r\n      <AccompaniedServicesPicker\r\n        predicates={props.predicates}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onChipClick={props.onChipClick}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        error={meta?.error !== undefined}\r\n        variant=\"filled\"\r\n        disabled={props.disabled}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n      />\r\n    );\r\n  } else {\r\n    return (\r\n      <SingleAccompaniedServicesPicker\r\n        predicates={props.predicates}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onChipClick={props.onChipClick}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        error={meta?.error !== undefined}\r\n        variant=\"filled\"\r\n        disabled={props.disabled}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n      />\r\n    );\r\n  }\r\n};\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport React from 'react';\r\n\r\nexport interface ReservationFormButtonProps extends ButtonProps {\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function CancelReservationButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function ApproveReservationButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function SaveForLaterButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function TransferButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function TerminateReservationButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function ModificationButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function CreateTrainingButton({\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: ReservationFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\n","import { useDispatch, useSelector } from 'react-redux';\r\nimport { TerminateReservationButton } from './ReservationActions';\r\nimport * as React from 'react';\r\nimport {\r\n  selectTerminateCompleted,\r\n  selectTerminateProcessing,\r\n} from '../slice/selectors';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { EndUsageConfirm, EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { HasUsageEndRresult } from '../slice/types';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\n\r\nexport interface TerminateReservationProps {\r\n  text: string;\r\n  reservationId: number;\r\n  serviceId: number;\r\n  isLoaanDesc: boolean;\r\n  title?: string;\r\n  onTerminate: () => void;\r\n}\r\n\r\nexport function TerminateReservation(props: TerminateReservationProps) {\r\n  const {\r\n    text,\r\n    reservationId,\r\n    isLoaanDesc,\r\n    title,\r\n    onTerminate,\r\n    serviceId,\r\n  } = props;\r\n  const dispatch = useDispatch();\r\n  const { actions: settingActions } = useAppSettingsSlice();\r\n  const { t } = useTranslation();\r\n  const terminateProcessing = useSelector(selectTerminateProcessing);\r\n  const terminateCompleted = useSelector(selectTerminateCompleted);\r\n  const [\r\n    endUsageOfflineServiceIds,\r\n    setEndUsageOfflineServiceIds,\r\n  ] = React.useState<number[]>([]);\r\n  const [showConfirmEndUsage, setShowConfirmEndUsage] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [showEndUsage, setShowEndUsage] = React.useState<boolean>(false);\r\n  const [usageEndProcessing, setUsageEndProcessing] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [hasUsageProcessing, setHasUsageProcessing] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const handleTerminateClick = () => {\r\n    (async () => {\r\n      setHasUsageProcessing(true);\r\n      ReservationsApi.hasUsage({ resId: reservationId, eqId: serviceId })\r\n        .then(result => {\r\n          let data = result as HasUsageEndRresult;\r\n          if (data.HasUsage === true && !isLoaanDesc) {\r\n            setShowConfirmEndUsage(true);\r\n            setEndUsageOfflineServiceIds(data.OfflineServiceTypeIds);\r\n          } else {\r\n            onTerminate();\r\n          }\r\n          setHasUsageProcessing(false);\r\n        })\r\n        .catch(reason => {\r\n          setHasUsageProcessing(false);\r\n        });\r\n    })();\r\n\r\n    //check if has usage\r\n    //then\r\n    //if yes - show confirm to end usage\r\n\r\n    //if confirmed - show usage end popup\r\n    //else - cancel termination\r\n    // if no - terminate;\r\n  };\r\n\r\n  const handleEndUsage = (usageData: EndUsageData) => {\r\n    setUsageEndProcessing(true);\r\n    (async () => {\r\n      ReservationsApi.endUsage(reservationId, usageData)\r\n        .then(response => {\r\n          setUsageEndProcessing(false);\r\n          if (response.ErrorMessages.length > 0) {\r\n            response.ErrorMessages.forEach(errmsg =>\r\n              dispatch(\r\n                settingActions.addNotification({\r\n                  variant: 'error',\r\n                  message: errmsg,\r\n                }),\r\n              ),\r\n            );\r\n          } else {\r\n            setShowEndUsage(false);\r\n            onTerminate();\r\n            if (response.SuccessMessages.length > 0) {\r\n              response.SuccessMessages.forEach(msg =>\r\n                dispatch(\r\n                  settingActions.addNotification({\r\n                    variant: 'success',\r\n                    message: msg,\r\n                  }),\r\n                ),\r\n              );\r\n            }\r\n            if (response.WarningMessages.length > 0) {\r\n              response.WarningMessages.forEach(wrnmsg =>\r\n                dispatch(\r\n                  settingActions.addNotification({\r\n                    variant: 'warning',\r\n                    message: wrnmsg,\r\n                  }),\r\n                ),\r\n              );\r\n            }\r\n          }\r\n        })\r\n        .catch(e => {\r\n          console.error(e);\r\n        })\r\n        .finally(() => setUsageEndProcessing(false));\r\n    })();\r\n  };\r\n  return (\r\n    <React.Fragment>\r\n      <TerminateReservationButton\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"clock\" />}\r\n        onClick={e => handleTerminateClick()}\r\n        disabled={\r\n          terminateProcessing || usageEndProcessing || hasUsageProcessing\r\n        }\r\n        variant=\"white\"\r\n        processing={\r\n          (terminateProcessing || usageEndProcessing || hasUsageProcessing) &&\r\n          !terminateCompleted\r\n        }\r\n        title={title}\r\n        text={text}\r\n      />\r\n      <DialogConfirm\r\n        isOpen={showConfirmEndUsage}\r\n        title={t(translations.TerminateReservation)}\r\n        confirmButtonLabel={t(translations.TerminateReservationMobile)}\r\n        body={t(translations.TerminateReservationWithUsage) as string}\r\n        onConfirm={() => {\r\n          setShowEndUsage(true);\r\n          setShowConfirmEndUsage(false);\r\n        }}\r\n        onCancel={() => setShowConfirmEndUsage(false)}\r\n        onClose={() => setShowConfirmEndUsage(false)}\r\n        maxWidth=\"sm\"\r\n      />\r\n      <EndUsageConfirm\r\n        ids={endUsageOfflineServiceIds}\r\n        isopen={showEndUsage}\r\n        usageId={reservationId}\r\n        usageProcessing={usageEndProcessing}\r\n        onClose={() => {\r\n          setShowEndUsage(false);\r\n        }}\r\n        onConfirm={handleEndUsage}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * FormTrainingSessionPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { TrainingSessionPicker } from '../pickers/AutocompletePickers/TrainingSessionPicker';\r\n\r\nexport const FormTrainingSessionPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<ITrainingSessionDto | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<ITrainingSessionDto | null>(props);\r\n\r\n  return (\r\n    <TrainingSessionPicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      disabled={props.disabled}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n    />\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { IBudgetDto } from 'api/odata/generated/entities/IBudgetDto';\r\nimport {\r\n  Condition,\r\n  ODataOperators,\r\n  quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePickerProps,\r\n  AutocompletePicker,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { BudgetExperimentStatuses } from 'enums/BudgetExperimentStatuses';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport function budgetExperimentsFilter(\r\n  serviceTypes: number[],\r\n  serviceGroups: number[],\r\n  serviceType: ServiceType | undefined,\r\n  budgetId: number | undefined,\r\n  resStart: Date | string | null | undefined,\r\n  resEnd: Date | string | null | undefined,\r\n): (string | Condition<IBudgetExperimentsFilterDto>)[] {\r\n  const predicates: (string | Condition<IBudgetExperimentsFilterDto>)[] = [];\r\n\r\n  predicates.push(\r\n    new Condition<IBudgetExperimentsFilterDto>(\r\n      'Active',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n\r\n  predicates.push(\r\n    new Condition<IBudgetExperimentsFilterDto>(\r\n      'StatusId',\r\n      ODataOperators.Equals,\r\n      BudgetExperimentStatuses.Approved,\r\n    ),\r\n  );\r\n\r\n  predicates.push(\r\n    new Condition<IBudgetExperimentsFilterDto>(\r\n      'BudgetTaskActive',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n\r\n  if (!isNullOrUndefined(budgetId)) {\r\n    predicates.push(\r\n      new Condition<IBudgetExperimentsFilterDto>(\r\n        'BudgetTaskBudgetId',\r\n        ODataOperators.Equals,\r\n        budgetId,\r\n      ),\r\n    );\r\n  }\r\n\r\n  if (serviceGroups.length > 0) {\r\n    let ids = serviceGroups.filter(f => f !== null);\r\n    if (ids.length > 0) {\r\n      predicates.push(\r\n        `(${new Condition<IBudgetExperimentsFilterDto>(\r\n          'BudgetTaskAllCoresAllowed',\r\n          ODataOperators.Equals,\r\n          true,\r\n        )} or ${new Condition<IBudgetExperimentsFilterDto>(\r\n          'BudgetTaskServiceGroupIds',\r\n          ODataOperators.AnyIn,\r\n          ids,\r\n        )})`,\r\n      );\r\n      predicates.push(\r\n        `(BudgetExperimentServiceGroups/any(s: s/ServiceGroupId in ${quoteODataValue(\r\n          ids,\r\n        )} and s/StatusId eq ${quoteODataValue(\r\n          BudgetExperimentStatuses.Approved,\r\n        )}))`,\r\n      );\r\n    }\r\n  }\r\n\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\nexport interface ReservationBudgetExperimentParams {\r\n  serviceId: Array<Identifiable<number>>;\r\n  userId: string | null;\r\n  budgetId: number | null;\r\n  start: Timestamp | Date;\r\n  end: Timestamp | Date;\r\n  selectedExpirementId?: number;\r\n}\r\nexport interface ReservationBudgetExperimentPickerProps\r\n  extends ReservationBudgetExperimentParams,\r\n    Omit<AutocompletePickerProps<IBudgetExperimentsFilterDto>, 'loadData'> {\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n}\r\n\r\nconst budgetDtoFields: Array<keyof IBudgetDto> = [\r\n  'Id',\r\n  'Name',\r\n  'UserGroupId',\r\n  'UserGroupName',\r\n  'Active',\r\n  'IsDefault',\r\n  'HideExperiments',\r\n  'ServiceGroupServicesAllowed',\r\n  'StartDate',\r\n  'EndDate',\r\n  'Type',\r\n];\r\nconst budgetExperimentDtoFields: Array<keyof IBudgetExperimentsFilterDto> = [\r\n  'Id',\r\n  'Name',\r\n  'Active',\r\n  'StatusId',\r\n  'BudgetTaskBudgetId',\r\n];\r\nexport const getLoadData = (p: ReservationBudgetExperimentParams) => {\r\n  const { path, search } = getBudgetExperimentsValidForReservationPathInfo(p);\r\n  return getAutoCompleteLoadDataFn<IBudgetExperimentsFilterDto>({\r\n    url: path,\r\n    queryString: search,\r\n    select: budgetExperimentDtoFields,\r\n    // expand is needed here for the use on reservation details to auto select the related budget\r\n    // otherwise, when the budget is already preselected, expand will just slow things down\r\n    expand: getBudgetExpandClause(p),\r\n  });\r\n};\r\n\r\nfunction getBudgetExpandClause(\r\n  p: ReservationBudgetExperimentParams,\r\n): string | undefined {\r\n  return p.budgetId === null\r\n    ? `Budget($select=${budgetDtoFields.join(',')})`\r\n    : undefined;\r\n}\r\n\r\n/**\r\n * Prepares parameters to fetch budget experiments usable to book something (e.g. reservation, offline service, etc.)\r\n * @param p dependencies used to determine relevant budget experiments\r\n * @returns path/search to fetch the budget experiments\r\n */\r\nexport function getBudgetExperimentsValidForReservationPathInfo(\r\n  p: ReservationBudgetExperimentParams,\r\n): IPathAndQuery {\r\n  const pp: Record<\r\n    keyof Omit<ReservationBudgetExperimentParams, 'selectedExpirementId'>,\r\n    string | null\r\n  > = {\r\n    serviceId: JSON.stringify(p.serviceId.map(f => f.Id)),\r\n    userId: \"'\" + p.userId?.replaceAll(\"'\", \"''\") + \"'\",\r\n    budgetId: JSON.stringify(p.budgetId),\r\n    start: '@start',\r\n    end: '@end',\r\n  };\r\n  const BudgetExperimentsValidForReservationURL = `/api/odata/v4/BudgetExperimentsFilter/BudgetExperimentsValidForReservation(serviceId=${pp.serviceId}, budgetId=${pp.budgetId}, userId=${pp.userId}, start=${pp.start}, end=${pp.end})`;\r\n\r\n  // start/end parameters are extracted into QueryString to avoid triggering \"A potentially dangerous Request.Path value (:)...\" issue with .net path validation\r\n  const params = {\r\n    '@start': dateUtils.formatISO(dateUtils.parseISO(p.start), {\r\n      representation: 'complete',\r\n    }),\r\n    '@end': dateUtils.formatISO(dateUtils.parseISO(p.end), {\r\n      representation: 'complete',\r\n    }),\r\n    $select: budgetExperimentDtoFields.join(','),\r\n    $expand: getBudgetExpandClause(p),\r\n  };\r\n  return { path: BudgetExperimentsValidForReservationURL, search: params };\r\n}\r\n\r\nexport function ReservationBudgetExperimentPicker({\r\n  serviceId,\r\n  budgetId,\r\n  userId,\r\n  start,\r\n  end,\r\n  ...props\r\n}: ReservationBudgetExperimentPickerProps) {\r\n  const innerLoadData = React.useMemo(\r\n    () =>\r\n      getLoadData({\r\n        serviceId,\r\n        budgetId,\r\n        userId,\r\n        start,\r\n        end,\r\n      }),\r\n    [budgetId, end, serviceId, start, userId],\r\n  );\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'budgetExperiment'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const loadBudgetExperiments = getLoadData;\r\n","import * as React from 'react';\r\nimport { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { FieldHookConfig, useField, useFormikContext } from 'formik';\r\nimport {\r\n  ReservationBudgetExperimentParams,\r\n  ReservationBudgetExperimentPicker,\r\n  getBudgetExperimentsValidForReservationPathInfo,\r\n} from '../pickers/AutocompletePickers/ReservationBudgetExperimentPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWithBudget } from 'app/pages/ReservationDetails/Details/slice/types';\r\n\r\n/**\r\n * Fetches the default budget experiment matching the dependencies\r\n * @see {@link ReservationBudgetExperimentParams}\r\n * @param p relevant dependencies\r\n * @returns default budget experiment if exists, undefined - otherwise\r\n */\r\nconst getDefaultBudgetExperiment = async (\r\n  p: ReservationBudgetExperimentParams,\r\n) => {\r\n  const { path, search } = getBudgetExperimentsValidForReservationPathInfo(p);\r\n  const result = await httpClient.get<\r\n    IODataQueryResponse<IBudgetExperimentsFilterDto>\r\n  >(path, { ...search, ...{ $top: 10 } });\r\n  if (result.value.length === 1) {\r\n    return result.value[0];\r\n  } else if (\r\n    !!p.selectedExpirementId &&\r\n    result.value.length > 0 &&\r\n    result.value.some(f => f.Id === p.selectedExpirementId)\r\n  ) {\r\n    return result.value.filter(f => f.Id === p.selectedExpirementId)[0];\r\n  } else {\r\n    return undefined;\r\n  }\r\n};\r\n\r\nexport const FormReservationBudgetExperimentPicker = ({\r\n  label,\r\n  isEdit,\r\n  serviceId,\r\n  budgetId,\r\n  userId,\r\n  start,\r\n  end,\r\n  onChange,\r\n  ...props\r\n}: FieldHookConfig<IBudgetExperimentsFilterDto | null> &\r\n  IFieldProps &\r\n  ReservationBudgetExperimentParams & { isEdit: boolean }) => {\r\n  const formik = useFormikContext<IWithBudget>();\r\n  const [\r\n    field,\r\n    meta,\r\n    { setValue },\r\n  ] = useField<IBudgetExperimentsFilterDto | null>(props);\r\n  const [\r\n    fetchDefaultBudgetExperimentState,\r\n    fetchDefaultBudgetExperiment,\r\n  ] = usePromise(getDefaultBudgetExperiment);\r\n\r\n  // setValue goes nuts inside the Reservation Form and spams if used in useEffect directly\r\n  const setValueRef = React.useRef(setValue);\r\n  React.useEffect(() => {\r\n    setValueRef.current = setValue;\r\n  }, [setValue]);\r\n\r\n  /**\r\n   * Handles the user selected budget experiment.\r\n   * The budget can be auto populated when the budget experiment is selected first.\r\n   * Formik values - budget experiment & optionally budget (if not yet selected) are updated in one go to prevent unnecessary re renders.\r\n   */\r\n  const handleChange = React.useCallback(\r\n    value => {\r\n      const v: Record<string, any> = {\r\n        BudgetExperiment: value,\r\n      };\r\n      if (formik.values.Budget === null && value.Budget !== undefined) {\r\n        v.Budget = value.Budget;\r\n      }\r\n      formik.setValues(values => ({ ...values, ...v }));\r\n\r\n      onChange?.(value);\r\n    },\r\n    [formik, onChange],\r\n  );\r\n\r\n  /**\r\n   * Services array might go wild with array mutations (e.g. when clearing large number of services selected in the reservation service picker)\r\n   * Serialize & then deserializing the service ids is intended to guard the useEffect below from drowning in these mutations\r\n   */\r\n  const serializedServices = React.useMemo(\r\n    () => JSON.stringify(serviceId.map(f => ({ Id: f.Id }))),\r\n    [serviceId],\r\n  );\r\n  const deserializedServices = React.useMemo(\r\n    () => JSON.parse(serializedServices),\r\n    [serializedServices],\r\n  );\r\n\r\n  /**\r\n   * Ref is used to skip the first effect below\r\n   */\r\n  const componentDidMount = React.useRef(false);\r\n\r\n  // set default budget experiment for the given parent deps (service, budget, start/end, service & user)\r\n  // budget experiment is considered to be default if it's the only matching one between relevant active experiments (given the deps)\r\n  // if there's no default budget experiment - the value is cleared to prevent conflicts and force user to select one\r\n  React.useEffect(() => {\r\n    // first effect needs to be skipped for showing reservation details, in which case the budget/experiment should be shown as is without fetching the default budget experiment\r\n    // here an additional condition might be needed to distinguish between the \"reservation create\" and \"reservation details\" cases\r\n    if (componentDidMount.current === false && isEdit) {\r\n      componentDidMount.current = true;\r\n      return;\r\n    }\r\n\r\n    /**\r\n     * Skips default budget experiment fetching if:\r\n     * * budget experiment (either default or non-default) has been selected by the user with the empty budget\r\n     * * budget/budget experiment changed but their connection is valid (e.g. budget is present, budget experiment is changed to another experiment within the same budget)\r\n     */\r\n    if (\r\n      field.value?.BudgetTaskBudgetId === budgetId ||\r\n      field.value?.Budget?.Id === budgetId\r\n    ) {\r\n      return;\r\n    }\r\n\r\n    // nothing to do if the services weren't selected yet\r\n    if (deserializedServices.length === 0) {\r\n      return;\r\n    }\r\n\r\n    // budget has to be selected before the budget experiment\r\n    // if the budget was not yet populated - also nothing to see here\r\n    if (budgetId === null) {\r\n      return;\r\n    }\r\n\r\n    /**\r\n     * BudgetId ->\r\n     */\r\n    fetchDefaultBudgetExperiment({\r\n      budgetId: budgetId,\r\n      serviceId: deserializedServices,\r\n      start: start,\r\n      end: end,\r\n      userId: userId,\r\n      selectedExpirementId: field.value?.Id,\r\n    }).then(value => {\r\n      setValueRef.current?.(value ?? null);\r\n      if (!!value) {\r\n        onChange?.(value);\r\n      }\r\n    });\r\n\r\n    // field.value is exluded from the deps in order to allow clearing the current value\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [\r\n    fetchDefaultBudgetExperiment,\r\n    budgetId,\r\n    end,\r\n    deserializedServices,\r\n    start,\r\n    userId,\r\n    onChange,\r\n    isEdit,\r\n    // field.value\r\n  ]);\r\n\r\n  return (\r\n    <ReservationBudgetExperimentPicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      disabled={\r\n        fetchDefaultBudgetExperimentState.status === 'pending' || props.disabled\r\n      }\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      serviceId={serviceId}\r\n      budgetId={budgetId}\r\n      userId={userId}\r\n      start={start}\r\n      end={end}\r\n    />\r\n  );\r\n};\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { PeriodTypes } from 'app/components/DatePeriods';\r\n\r\n/**\r\n * Filter parameters must match the reservations filter settings\r\n * {@see app/pages/ReservationHistoryPage/Filter}\r\n */\r\ntype getReservationsLinkProps = {\r\n  period?: PeriodTypes;\r\n  startDate?: string | Date;\r\n  endDate?: string | Date;\r\n  serviceId?: number | null;\r\n  trainingSignUp?: boolean;\r\n  TrainingSessionId?: number;\r\n};\r\n\r\n/**\r\n * Helper function to get a link to reservations list page\r\n * @param session\r\n * @param newDate\r\n * @returns\r\n */\r\nexport function getReservationsLink(\r\n  props: getReservationsLinkProps,\r\n): IPathAndQuery {\r\n  return {\r\n    path: '/reservations',\r\n    search: {\r\n      period: props.period,\r\n      st:\r\n        props.startDate === undefined\r\n          ? undefined\r\n          : dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(props.startDate),\r\n            ),\r\n      et:\r\n        props.endDate === undefined\r\n          ? undefined\r\n          : dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(props.endDate),\r\n            ),\r\n      eid: props.serviceId,\r\n      trainingSignUp: props.trainingSignUp,\r\n      TrainingSessionId: props.TrainingSessionId,\r\n    },\r\n  };\r\n}\r\n","import { ExternalLink } from 'app/components/ExternalLink';\r\n\r\n/**\r\n * Link to edit a training session details (admin)\r\n * @param param0\r\n * @returns\r\n */\r\nexport function EditTrainingSessionLink({\r\n  trainingSessionId: assetId,\r\n  ...props\r\n}: React.PropsWithChildren<{ trainingSessionId: number }>) {\r\n  return (\r\n    <ExternalLink\r\n      href={{\r\n        path: '/TrainingSession/Edit.aspx',\r\n        search: { id: assetId },\r\n      }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { Link } from 'app/components/BasicLinks/Link';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getReservationsLink } from '../../ReservationForm/getReservationsLink';\r\nimport { EditTrainingSessionLink } from 'app/pages/TrainingSessionsPage/components/EditTrainingSessionsLink';\r\nimport { translations } from 'locales/translations';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { Body } from 'app/components/Typography';\r\nimport { CircularProgress } from '@material-ui/core';\r\n\r\nexport interface TrainingSignUpAdminAlertContentProps {\r\n  trainingSessionId: number;\r\n}\r\nexport function TrainingSignUpAdminAlertContent(\r\n  props: TrainingSignUpAdminAlertContentProps,\r\n) {\r\n  const { trainingSessionId } = props;\r\n  const { t } = useTranslation();\r\n  const [loading, setLoading] = React.useState(false);\r\n  const attendees = useAsyncGetWthEffect<TrainingSessionInfo>(\r\n    () => getSessionSlots(trainingSessionId),\r\n    {\r\n      Attendees: 0,\r\n    },\r\n    [trainingSessionId],\r\n    setLoading,\r\n  );\r\n\r\n  // const [state, setState] = useAsyncExtendedState<\r\n  //   TrainingSessionInfo | undefined\r\n  // >(undefined);\r\n  // const [fetchState, fetch] = usePromise(getSessionSlots);\r\n  // const show = React.useMemo(() => {\r\n  //   return (\r\n  //     isAdmin && trainingSessionId !== undefined && trainingSessionId !== null\r\n  //   );\r\n  // }, [isAdmin, trainingSessionId]);\r\n\r\n  // const bar = React.useMemo(() => {\r\n  //   if (trainingSessionId === null) {\r\n  //     return null;\r\n  //   }\r\n  //   if (trainingSessionId === undefined) {\r\n  //     return null;\r\n  //   }\r\n  //   if (!show) {\r\n  //     return null;\r\n  //   }\r\n  //   return trainingSessionId;\r\n  // }, [show, trainingSessionId]);\r\n  // React.useEffect(() => {\r\n  //   if (trainingSessionId !== undefined && show) {\r\n  //     setState(fetch(trainingSessionId));\r\n  //   }\r\n  // });\r\n\r\n  // if (bar === undefined) {\r\n  //   return null;\r\n  // }\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <div\r\n        style={{\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          gap: 8,\r\n        }}\r\n      >\r\n        <Body size=\"small\" bold={true}>\r\n          {t(translations.TrainingSessionsCountMessage, {\r\n            count: attendees.Attendees,\r\n          })}\r\n        </Body>\r\n\r\n        {/* <Caption>{t(translations.NotUsingThisReservation)}</Caption> */}\r\n        <div style={{ display: 'flex', gap: 8 }}>\r\n          {loading === true && <CircularProgress size={14} />}\r\n          {attendees.Attendees > 0 && (\r\n            <Link\r\n              to={getReservationsLink({\r\n                TrainingSessionId: trainingSessionId,\r\n              })}\r\n            >\r\n              {t(translations.ManageSignUps)}\r\n            </Link>\r\n          )}\r\n\r\n          <EditTrainingSessionLink trainingSessionId={trainingSessionId}>\r\n            {t(translations.EditTrainingSession)}\r\n          </EditTrainingSessionLink>\r\n        </div>\r\n      </div>\r\n    </React.Fragment>\r\n  );\r\n}\r\n\r\ntype TrainingSessionInfo = Pick<ITrainingSessionSlotDto, 'Attendees'>;\r\nasync function getSessionSlots(trainingSesisonId: number) {\r\n  const url = `/api/odata/v4/TrainingSessionSlots`;\r\n  //const select: Array<keyof ITrainingSessionSlotDto> = ['Attendees'];\r\n  try {\r\n    const x = await httpClient.get(url, {\r\n      $filter: `Id eq ${trainingSesisonId}`,\r\n    });\r\n    return { Attendees: x.value[0].Attendees } as TrainingSessionInfo;\r\n  } catch (err) {\r\n    return { Attendees: 0 } as TrainingSessionInfo;\r\n  }\r\n}\r\n","import * as React from 'react';\r\nimport { useField, useFormikContext } from 'formik';\r\nimport { DatePickerVariants } from 'app/components/DatePicker';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout/FormRow';\r\nimport { ReservationDetailsState } from '../../slice/types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport produce from '@reduxjs/toolkit/node_modules/immer';\r\nimport { DatePickerProps } from '@material-ui/pickers';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\nimport { BookitDateTimePicker } from 'app/components/BookitDatePicker/BookitDateTimePicker';\r\n\r\nexport interface ReservationTimePeriodPickerProps {\r\n  /**\r\n   * Full Day / Regular reservation indicator\r\n   */\r\n  FullDayReservation: boolean;\r\n  /**\r\n   * Start time property name of the formik values object\r\n   */\r\n  StartTimePropertyName: string;\r\n  /**\r\n   * End time property name of the formik values object\r\n   */\r\n  EndTimePropertyName: string;\r\n  /**\r\n   * Disables the start time picker\r\n   */\r\n  startTimeDisabled: boolean;\r\n  /**\r\n   * Disables the end time picker\r\n   */\r\n  endTimeDisabled: boolean;\r\n  /**\r\n   * Start time change handler\r\n   */\r\n  onStartTimeChange: DatePickerProps['onChange'];\r\n  /**\r\n   * End time change handler\r\n   */\r\n  onEndTimeChange: DatePickerProps['onChange'];\r\n  /**\r\n   * Start time label & placeholder\r\n   */\r\n  startTimeLabel: string;\r\n  /**\r\n   * End time label & placeholder\r\n   */\r\n  endTimeLabel: string;\r\n}\r\n/**\r\n * Component that handles start/end time period UI on the reservation form.\r\n * Must be inside the formik context as the rest of the FormXXX components.\r\n * FullDayReservation might checkbox might need to also be handled here.\r\n * @param param0\r\n * @returns\r\n */\r\nexport function FormReservationTimePeriodPicker({\r\n  FullDayReservation,\r\n  ...props\r\n}: React.PropsWithChildren<ReservationTimePeriodPickerProps>) {\r\n  const formik = useFormikContext<ReservationDetailsState>();\r\n  const [startField, startMeta] = useField<Date | string | null>({\r\n    name: props.StartTimePropertyName,\r\n  });\r\n  const [endField, endMeta, endHelpers] = useField<Date | string | null>({\r\n    name: props.EndTimePropertyName,\r\n  });\r\n  /**\r\n   * For legacy reasons the reservation start/end is expected to be stored as string without tz info. for example:\r\n   * \"2023-08-09T01:05:00\" = good\r\n   * \"2023-08-09T01:05:00z\" = bad (not sure for what reason, but it's not the format being used in other places on reservation side panel)\r\n   * @param value <date\r\n   * @returns\r\n   */\r\n  const getStoreValue = (value: Date) => {\r\n    // return dateUtils.formatQueryStringDate(value, {\r\n    //   representation: 'complete',\r\n    // });\r\n    return dateUtils.formatISO(dateUtils.dateOrStringToDate(value), {\r\n      format: 'basic',\r\n      representation: 'complete',\r\n    });\r\n  };\r\n\r\n  /**\r\n   * Handles start time change (triggered by date selection on date picker UI).\r\n   * @param value user selected date/time\r\n   */\r\n  const handleStartTimeChange: DatePickerProps['onChange'] = value => {\r\n    // start time value is generally not clearable and should not be empty\r\n    if (value !== null) {\r\n      formik.setValues(\r\n        produce((values: ReservationDetailsState) => {\r\n          // set the current start time value\r\n          values.StartTime = getStoreValue(value);\r\n          // optionally adjust the end time to keep the reservation/period the same length\r\n          // for example, changing the start time effectively moves current period to another date/time\r\n          if (formik.values.EndTime !== null) {\r\n            const endTime = adjustEndByStart(\r\n              value,\r\n              formik.values.StartTime,\r\n              formik.values.EndTime,\r\n            );\r\n            values.EndTime = getStoreValue(endTime);\r\n          }\r\n        }),\r\n      );\r\n    }\r\n    // raise the start time change event\r\n    props.onStartTimeChange?.(value);\r\n  };\r\n\r\n  /**\r\n   * Handles the end time change (triggered by date selection on date picker UI)\r\n   * @param value new user selected end time\r\n   */\r\n  const handleEndTimeChange: DatePickerProps['onChange'] = value => {\r\n    var formattedValue = value === null ? null : getStoreValue(value);\r\n    // set the current end\r\n    endHelpers.setValue(formattedValue);\r\n    // rase the end time change event\r\n    props.onEndTimeChange?.(value);\r\n  };\r\n\r\n  const datePickerVariant: DatePickerVariants = FullDayReservation\r\n    ? 'date'\r\n    : 'separated';\r\n\r\n  return (\r\n    <>\r\n      <FormRow>\r\n        {datePickerVariant === 'separated' ? (\r\n          <BookitDateTimePicker\r\n            id=\"StartTime\"\r\n            name={startField.name}\r\n            label={props.startTimeLabel}\r\n            dateId=\"startTimeDateId\"\r\n            dateName={startField.name}\r\n            // dateLabel={props.startTimeLabel}\r\n            timeId=\"startTimeTimeId\"\r\n            timeName={startField.name}\r\n            // timeLabel={props.startTimeLabel}\r\n            inputVariant=\"filled\"\r\n            onChange={handleStartTimeChange}\r\n            onBlur={startField?.onBlur}\r\n            value={startField.value}\r\n            error={startMeta?.error !== undefined}\r\n            fullWidth={true}\r\n            helperText={startMeta.error}\r\n            disabled={props.startTimeDisabled}\r\n            placeholder={props.startTimeLabel}\r\n            // strictCompareDates={true}\r\n            minutesStep={15}\r\n            truncateTime\r\n          />\r\n        ) : (\r\n          <BookitDatePicker\r\n            variant={datePickerVariant}\r\n            id=\"StartTime\"\r\n            name={startField.name}\r\n            label={props.startTimeLabel}\r\n            inputVariant=\"filled\"\r\n            onChange={handleStartTimeChange}\r\n            onBlur={startField?.onBlur}\r\n            value={startField.value}\r\n            error={startMeta?.error !== undefined}\r\n            fullWidth={true}\r\n            helperText={startMeta.error}\r\n            disabled={props.startTimeDisabled}\r\n            placeholder={props.startTimeLabel}\r\n            truncateTime\r\n          />\r\n        )}\r\n      </FormRow>\r\n\r\n      <FormRow>\r\n        {datePickerVariant === 'separated' ? (\r\n          <BookitDateTimePicker\r\n            id=\"EndTime\"\r\n            name={endField.name}\r\n            label={props.endTimeLabel}\r\n            inputVariant=\"filled\"\r\n            onChange={handleEndTimeChange}\r\n            onBlur={endField?.onBlur}\r\n            value={endField.value}\r\n            error={endMeta?.error !== undefined}\r\n            fullWidth={true}\r\n            helperText={endMeta.error}\r\n            disabled={props.endTimeDisabled}\r\n            // strictCompareDates={true}\r\n            minDate={\r\n              formik.values.StartTime === undefined\r\n                ? undefined\r\n                : formik.values.StartTime === null\r\n                ? undefined\r\n                : dateUtils.dateOrStringToDate(formik.values.StartTime)\r\n            }\r\n            placeholder={props.endTimeLabel}\r\n            truncateTime\r\n            endTime\r\n            dateId=\"endTimeDateId\"\r\n            dateName={endField.name}\r\n            // dateLabel={props.endTimeLabel}\r\n            timeId=\"endTimeTimeId\"\r\n            timeName={endField.name}\r\n            minutesStep={15}\r\n            // timeLabel={props.endTimeLabel}\r\n          />\r\n        ) : (\r\n          <BookitDatePicker\r\n            variant={datePickerVariant}\r\n            id=\"EndTime\"\r\n            name={endField.name}\r\n            label={props.endTimeLabel}\r\n            inputVariant=\"filled\"\r\n            onChange={handleEndTimeChange}\r\n            onBlur={endField?.onBlur}\r\n            value={endField.value}\r\n            error={endMeta?.error !== undefined}\r\n            fullWidth={true}\r\n            helperText={endMeta.error}\r\n            disabled={props.endTimeDisabled}\r\n            minDate={\r\n              formik.values.StartTime === undefined\r\n                ? undefined\r\n                : formik.values.StartTime === null\r\n                ? undefined\r\n                : dateUtils.dateOrStringToDate(formik.values.StartTime)\r\n            }\r\n            placeholder={props.endTimeLabel}\r\n            truncateTime\r\n            endTime\r\n          />\r\n        )}\r\n      </FormRow>\r\n    </>\r\n  );\r\n}\r\nfunction adjustEndByStart(\r\n  value: Date,\r\n  originalStartTime: Date | string,\r\n  originalEndTime: Date | string,\r\n) {\r\n  const diff = dateUtils.differenceInMinutes(\r\n    value,\r\n    dateUtils.dateOrStringToDate(originalStartTime),\r\n  );\r\n  const endTime = dateUtils.addMinutes(\r\n    dateUtils.dateOrStringToDate(originalEndTime),\r\n    diff,\r\n  );\r\n  return endTime;\r\n}\r\n","import * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IAssemblyPartDto } from 'api/odata/generated/entities/IAssemblyPartDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Popover } from 'app/components/Popover';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { PromiseStatus, usePromise } from 'app/hooks/usePromise';\r\nimport { translations } from 'locales/translations';\r\nimport { orderBy } from 'lodash';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Identifiable } from 'types/common';\r\nimport { IReservationEquipmentDto } from '../../slice/types';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IReservationAssemblyPartDto } from 'api/odata/generated/entities/IReservationAssemblyPartDto';\r\n\r\n/**\r\n * Pick minimum required props from the EquipmentsData\r\n */\r\nexport interface EquipmentsDataAssembliesProps {\r\n  equipmentsData: Array<\r\n    Pick<IReservationEquipmentDto, 'Id' | 'HasAssemblyParts'>\r\n  >;\r\n  reservedAssemblyParts: IReservationAssemblyPartDto[] | null;\r\n}\r\n\r\ninterface IAssembly {\r\n  /**\r\n   * Top assembly instrument\r\n   */\r\n  assembly: IAssemblyPartDto;\r\n  /**\r\n   * All of the parts in a flat array\r\n   */\r\n  parts: IAssemblyPartDto[];\r\n}\r\n\r\n/**\r\n * Intenal React.useState interface used by the component\r\n */\r\ninterface IState {\r\n  open: boolean;\r\n  assemblyParts?: IAssembly[];\r\n  reservedAssemblyParts?: IReservationAssemblyPartDto[];\r\n  popperAnchor?: unknown;\r\n}\r\n\r\nconst fetchAssemblies = async (services: Array<Identifiable<number>>) => {\r\n  // send batch containing one request per each equipment\r\n  const batchResponse = await httpClient.batch(\r\n    services.map(service => ({\r\n      method: 'GET',\r\n      pathName: `/api/odata/v4/servicefilter/${service.Id}/AssemblyParts`,\r\n    })),\r\n  );\r\n\r\n  // server returns selected instrument along it's assembly parts in a flat array\r\n  // transform flat array into assembly all assembly parts in a flat array to match the structure displayed to the user\r\n  const parts = batchResponse.responses.map(response => {\r\n    const data = (response.body as IODataQueryResponse<IAssemblyPartDto>).value;\r\n    const sorted = orderBy(data, f => f.Path);\r\n    return {\r\n      assembly: sorted[0],\r\n      parts: sorted.slice(1),\r\n    };\r\n  });\r\n  // return partial<IState> plug able into extendState\r\n  const result: Partial<IState> = { assemblyParts: parts };\r\n  return result;\r\n};\r\n\r\n/**\r\n * Enables assembly info processing only for cases where assemblies have been selected.\r\n * Otherwise abort the whole ordeal\r\n * @param props\r\n * @returns\r\n */\r\nexport function EquipmentsDataAssembliesContainer(\r\n  props: EquipmentsDataAssembliesProps,\r\n) {\r\n  const isAssembly = React.useMemo(\r\n    () =>\r\n      props.equipmentsData.some(service => service.HasAssemblyParts === true),\r\n    [props.equipmentsData],\r\n  );\r\n  if (isAssembly === false) {\r\n    return null;\r\n  } else {\r\n    return <EquipmentsDataAssemblies {...props} />;\r\n  }\r\n}\r\n\r\nexport function EquipmentsDataAssemblies(props: EquipmentsDataAssembliesProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const [state, , extendState] = useAsyncExtendedState<IState>({\r\n    open: false,\r\n    reservedAssemblyParts: props.reservedAssemblyParts ?? undefined,\r\n  });\r\n  const [fetchAssembliesPromiseState, fetchAssembliesPromise] = usePromise(\r\n    fetchAssemblies,\r\n  );\r\n  const handleClick = React.useCallback(\r\n    (e: React.MouseEvent<HTMLButtonElement>) => {\r\n      // open popover\r\n      extendState(state => ({\r\n        open: !state.open,\r\n        popperAnchor: e.currentTarget,\r\n      }));\r\n      // we're showing already reserved parts for existing reservations as reserved parts can differ from current assembly configuration\r\n      if (state.reservedAssemblyParts === undefined) {\r\n        // start fetching data\r\n        extendState(fetchAssembliesPromise(props.equipmentsData));\r\n      }\r\n    },\r\n    [\r\n      extendState,\r\n      fetchAssembliesPromise,\r\n      props.equipmentsData,\r\n      state.reservedAssemblyParts,\r\n    ],\r\n  );\r\n  if (props.equipmentsData.length === 0) {\r\n    return null;\r\n  }\r\n  return (\r\n    <>\r\n      <Button\r\n        variant=\"ghost\"\r\n        onClick={handleClick}\r\n        title={t(translations.AssemblyParts)}\r\n      >\r\n        <Icon icon=\"list\" />\r\n      </Button>\r\n\r\n      {state.popperAnchor !== null && (\r\n        <Popover\r\n          open={state.open}\r\n          anchorEl={state.popperAnchor as EventTarget & HTMLDivElement}\r\n          title={t(translations.AssemblyParts)}\r\n          onClose={() => extendState({ open: false })}\r\n        >\r\n          <div style={{ width: '360px' }}>\r\n            {props.reservedAssemblyParts !== undefined && (\r\n              <ul>\r\n                {props.reservedAssemblyParts?.map(reservedAssemblyPart => (\r\n                  <li>{reservedAssemblyPart.Name}</li>\r\n                ))}\r\n              </ul>\r\n            )}\r\n            {fetchAssembliesPromiseState.status !== undefined && (\r\n              <RenderAssemblyParts status={fetchAssembliesPromiseState.status}>\r\n                {state.assemblyParts === undefined ? (\r\n                  <>{t(translations.NoDataFound)}</>\r\n                ) : (\r\n                  <>\r\n                    {state.assemblyParts?.map((item, index) => (\r\n                      <span key={index}>\r\n                        {t(translations.PartsIncludedWithin)}{' '}\r\n                        {item.assembly.Name}\r\n                        <ul>\r\n                          {item.parts.map(service => (\r\n                            <li key={service.Id}>{service.Name}</li>\r\n                          ))}\r\n                        </ul>\r\n                      </span>\r\n                    ))}\r\n                  </>\r\n                )}\r\n              </RenderAssemblyParts>\r\n            )}\r\n          </div>\r\n        </Popover>\r\n      )}\r\n    </>\r\n  );\r\n}\r\n\r\ninterface RenderAssemblyPartsProps {\r\n  status?: PromiseStatus;\r\n}\r\n/**\r\n * Renders the current state of assemblies fetch result: e.g. processing/error/data\r\n * @param param0\r\n * @returns\r\n */\r\nfunction RenderAssemblyParts({\r\n  status = 'pending',\r\n  ...props\r\n}: React.PropsWithChildren<RenderAssemblyPartsProps>): JSX.Element {\r\n  const { t } = useTranslation();\r\n\r\n  switch (status) {\r\n    case 'pending':\r\n      return (\r\n        <>\r\n          <Skeleton width=\"25ch\" />\r\n          <ul>\r\n            <li>\r\n              <Skeleton width=\"25ch\" style={{ lineHeight: 1.43 }} />\r\n            </li>\r\n            <li>\r\n              <Skeleton width=\"25ch\" style={{ lineHeight: 1.43 }} />\r\n            </li>\r\n            <li>\r\n              <Skeleton width=\"25ch\" style={{ lineHeight: 1.43 }} />\r\n            </li>\r\n            <li>\r\n              <Skeleton width=\"25ch\" style={{ lineHeight: 1.43 }} />\r\n            </li>\r\n            <li>\r\n              <Skeleton width=\"25ch\" style={{ lineHeight: 1.43 }} />\r\n            </li>\r\n          </ul>\r\n        </>\r\n      );\r\n\r\n    case 'resolved':\r\n      return <>{props.children}</>;\r\n    case 'rejected':\r\n      return <>{t(translations.err_ErrorOccured)}</>;\r\n    default:\r\n      assertExhaustive(status);\r\n  }\r\n}\r\n","import { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport {\r\n  filteredWorkOrderTypes,\r\n  WorkOrderTypePicker,\r\n} from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IReservationEquipmentDto } from '../../slice/types';\r\nimport * as React from 'react';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { loadWorkOrders } from 'app/components/pickers/AutocompletePickers/WorkOrdersPicker';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tips } from 'app/components/Typography';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectRefreshWorkOrderLink } from '../../slice/selectors';\r\n\r\nexport interface ReservationWorkOrdersProps {\r\n  reservationId: number;\r\n  equipments: IReservationEquipmentDto[];\r\n  onWorkTypeClick: (\r\n    event: IWorkOrderTypeDto,\r\n    equipmentIds: number[],\r\n    reservationId: number,\r\n  ) => void;\r\n}\r\n\r\nexport function ReservationWorkOrders(props: ReservationWorkOrdersProps) {\r\n  const { equipments, reservationId, onWorkTypeClick } = props;\r\n  const refreshWorkOrders = useSelector(selectRefreshWorkOrderLink);\r\n  const equipmentIds = React.useMemo(() => {\r\n    return equipments.map(f => f.Id);\r\n  }, [equipments]);\r\n  const { t } = useTranslation();\r\n  const handleWorkTypeClick = (event: IWorkOrderTypeDto) => {\r\n    onWorkTypeClick(event, equipmentIds, reservationId);\r\n  };\r\n  const relatedAssets = useAsyncGetWthEffect<IAssetDto[]>(\r\n    async () =>\r\n      initAssetsData(equipmentIds.join(',')).then(res => res as IAssetDto[]),\r\n    [],\r\n    [equipmentIds],\r\n  );\r\n  const relatedWorkOrders = useAsyncGetWthEffect<IWorkOrderDetailsDto[]>(\r\n    async () =>\r\n      loadWorkOrders([`Reservation eq ${quoteODataValue(reservationId)}`])(\r\n        null,\r\n        undefined,\r\n      ).then(res => res.value),\r\n    [],\r\n    [reservationId, refreshWorkOrders],\r\n  );\r\n  const workOrdersLink = React.useMemo(() => {\r\n    return `/workorders?${toQueryString({\r\n      reservationId: reservationId,\r\n    })}`;\r\n  }, [reservationId]);\r\n  const workOrdersLinkTitle = React.useMemo(() => {\r\n    return relatedWorkOrders.length > 0\r\n      ? (t(translations.ReservationAlertsLink) as string).replace(\r\n          '{0}',\r\n          relatedWorkOrders.length.toString(),\r\n        )\r\n      : undefined;\r\n  }, [relatedWorkOrders.length, t]);\r\n  return (\r\n    <FormFieldsSection\r\n      titleSection={t(translations.Alert)}\r\n      titleLink={\r\n        relatedWorkOrders.length > 0 ? (\r\n          <Button variant=\"text\" size=\"small\" href={workOrdersLink}>\r\n            {workOrdersLinkTitle}\r\n          </Button>\r\n        ) : (\r\n          <span\r\n            style={{ display: 'inline-flex', alignItems: 'center', gap: 8 }}\r\n          >\r\n            <Tooltip title={t(translations.StaffOnly_Icon) as string}>\r\n              <span>\r\n                <Icon\r\n                  icon=\"info-circle\"\r\n                  color=\"default\"\r\n                  colorExtend=\"textHover\"\r\n                />\r\n              </span>\r\n            </Tooltip>\r\n            <Tips color=\"secondary\">\r\n              {t(translations.NoReservationAlerts) as string}\r\n            </Tips>\r\n          </span>\r\n        )\r\n      }\r\n    >\r\n      <FormRow>\r\n        <WorkOrderTypePicker\r\n          predicates={filteredWorkOrderTypes(\r\n            relatedAssets,\r\n            undefined,\r\n            undefined,\r\n          )}\r\n          name={'workOrderTypeFilter'}\r\n          variant=\"filled\"\r\n          placeholder={t(translations.PleaseSelectAnAlertType)}\r\n          label={t(translations.AlertType)}\r\n          onChange={value => {\r\n            handleWorkTypeClick(value as IWorkOrderTypeDto);\r\n          }}\r\n          fullWidth={true}\r\n          id=\"wotype-id\"\r\n        />\r\n      </FormRow>\r\n    </FormFieldsSection>\r\n  );\r\n}\r\n","/**\r\n *\r\n * WokFlowBooking\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { WorkflowBookingPicker } from 'app/components/pickers/AutocompletePickers/WorkflowBookingPicker';\r\nimport { IWorkflowBookingDto } from 'api/odata/generated/entities/IWorkflowBookingDto';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\nimport React from 'react';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\n\r\nexport const FormWorkFlowBooking = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  Omit<TextFieldProps, 'helperText'> & { useWorkFlowPicker?: boolean }) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  const { t } = useTranslation();\r\n  return props.useWorkFlowPicker ? (\r\n    <WorkflowBookingPicker\r\n      name={props.name}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      placeholder={props.placeholder}\r\n      onBlur={field?.onBlur}\r\n      value={field.value as IWorkflowBookingDto}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      disabled={props.disabled}\r\n    />\r\n  ) : (\r\n    <BaseTextField\r\n      name={props.name}\r\n      label={label ?? t(translations[props.name])}\r\n      fullWidth={props.fullWidth}\r\n      variant=\"filled\"\r\n      onChange={e => {\r\n        let val = e.currentTarget.value;\r\n        let entityVal =\r\n          val === undefined || val === ''\r\n            ? null\r\n            : ({ Id: -1, Name: val } as Entity<number>);\r\n        helpers.setValue(entityVal, true);\r\n        if (props.onChange) {\r\n          props.onChange(entityVal);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field?.value?.Name ?? ''}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error || props.helperText}\r\n      id={props.id || 'workflowtextfieldId'}\r\n      inputProps={{\r\n        ...props.inputProps,\r\n        'aria-label': `${label ? undefined : 'text input'}`,\r\n      }}\r\n      color=\"primary\"\r\n      InputProps={{\r\n        ...props.InputProps,\r\n        endAdornment: (\r\n          <React.Fragment>\r\n            {props.info ? <InfoIcon title={props.info} /> : null}\r\n            {props.InputProps?.endAdornment}\r\n          </React.Fragment>\r\n        ),\r\n      }}\r\n    />\r\n  );\r\n};\r\n","import { Body } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport styled from 'styled-components';\r\nimport { ReservationSettingsState } from '../../slice/types';\r\n\r\nexport interface ReadOnlyDetailsProps {\r\n  details: ReservationSettingsState;\r\n}\r\n\r\nexport function ReadOnlyDetails(props: ReadOnlyDetailsProps) {\r\n  const { details } = props;\r\n  const { t } = useTranslation();\r\n  return (\r\n    <React.Fragment>\r\n      <DetailsWrapper className={'readonly-root'}>\r\n        <Body bold={true}>{t(translations.ReservationAdvancedDetails)}</Body>\r\n        <div className={'readonly-content'}>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.RecordDate)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {dateUtils.longDateTimeFormat(details.RecordDate)}\r\n            </Body>\r\n          </div>\r\n          {details.LastUpdateDate !== null && !!details.LastUpdateDate && (\r\n            <div className={'readonly-row'}>\r\n              <Body size=\"small\">{t(translations.LastUpdated)}</Body>\r\n              <Body size=\"small\" bold={true}>\r\n                {dateUtils.longDateTimeFormat(details.LastUpdateDate)}\r\n              </Body>\r\n            </div>\r\n          )}\r\n          {details.LastUpdateAdmin !== null && !!details.LastUpdateAdmin.Id && (\r\n            <div className={'readonly-row'}>\r\n              <Body size=\"small\">{t(translations.LastUpdatedBy)}</Body>\r\n              <Body size=\"small\" bold={true}>\r\n                {details.LastUpdateAdmin?.Name}\r\n              </Body>\r\n            </div>\r\n          )}\r\n        </div>\r\n      </DetailsWrapper>\r\n    </React.Fragment>\r\n  );\r\n}\r\nconst DetailsWrapper = styled.div`\r\n  &.readonly-root {\r\n    display: flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    grid-gap: 4px;\r\n    padding: 0;\r\n    width: 100%;\r\n  }\r\n  & .readonly-content {\r\n    display: flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    grid-gap: 16px;\r\n    padding: 16px 0px;\r\n    width: 100%;\r\n  }\r\n  & .readonly-row {\r\n    display: flex;\r\n    flex-direction: row;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    padding: 0;\r\n    width: inherit;\r\n  }\r\n`;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { GetServiceRequestDetailsPath } from 'app/pages/Samples/RequestSamplesPage/slice/path';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { RequestReservations } from '../../slice/types';\r\n\r\nexport interface ReservationRequestDetailsProps {\r\n  reservationId: number;\r\n}\r\n\r\nexport function ReservationRequestDetails(\r\n  props: ReservationRequestDetailsProps,\r\n) {\r\n  const { reservationId } = props;\r\n  const { t } = useTranslation();\r\n  const url = `api/odata/v4/Reservations/ReservationRequestData`;\r\n  const relatedReservation = useAsyncGetWthEffect<\r\n    RequestReservations | undefined\r\n  >(\r\n    async () => httpClient.post(url, { id: reservationId }).then(res => res),\r\n    undefined,\r\n    [reservationId],\r\n  );\r\n  return !!relatedReservation ? (\r\n    <FormFieldsSection\r\n      titleSection={t(translations.AssociatedServiceRequestDetails) as string}\r\n    >\r\n      <FormRow>\r\n        <RequestWrapper>\r\n          {relatedReservation.RequestId !== null &&\r\n            relatedReservation.RequestId !== undefined && (\r\n              <div className=\"req-row\">\r\n                <BasicTypography variant=\"bodyS\" component=\"span\">\r\n                  {t(translations.ServiceRequestId)}\r\n                </BasicTypography>\r\n                <Link\r\n                  href={GetServiceRequestDetailsPath(\r\n                    relatedReservation.RequestId,\r\n                  )}\r\n                  target=\"_blank\"\r\n                >\r\n                  {`# ${relatedReservation.RequestId}`}\r\n                </Link>\r\n              </div>\r\n            )}\r\n\r\n          {!!relatedReservation.TotalRowsCount &&\r\n            relatedReservation.TotalRowsCount !== null && (\r\n              <div className=\"req-row\">\r\n                <BasicTypography variant=\"bodyS\" component=\"span\">\r\n                  {t(translations.TotalSamples)}\r\n                </BasicTypography>\r\n                <BasicTypography variant=\"boldS\" component=\"span\">\r\n                  {relatedReservation.TotalRowsCount}\r\n                </BasicTypography>\r\n              </div>\r\n            )}\r\n          {!!relatedReservation.AssociatedRowsCount &&\r\n            relatedReservation.AssociatedRowsCount !== null && (\r\n              <div className=\"req-row\">\r\n                <BasicTypography variant=\"bodyS\" component=\"span\">\r\n                  {t(translations.SamplesAssociatedWithThisReservation)}\r\n                </BasicTypography>\r\n                <BasicTypography variant=\"boldS\" component=\"span\">\r\n                  {relatedReservation.AssociatedRowsCount}\r\n                </BasicTypography>\r\n              </div>\r\n            )}\r\n        </RequestWrapper>\r\n      </FormRow>\r\n    </FormFieldsSection>\r\n  ) : null;\r\n}\r\n\r\nconst RequestWrapper = styled.div`\r\n  display: flex;\r\n  flex-direction: column;\r\n  gap: 8px;\r\n  width: 100%;\r\n  & .req-row {\r\n    display: flex;\r\n    flex-direction: row;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    padding: 0;\r\n    width: inherit;\r\n  }\r\n`;\r\n","import { Formik, FormikHelpers, FormikProps } from 'formik';\r\nimport * as React from 'react';\r\nimport {\r\n  EquipmentsChangeStateParameters,\r\n  getSingleReservationStatus,\r\n  IMandatoryEquipmentsDto,\r\n  IReservationEquipmentDto,\r\n  PrerequisitsResult,\r\n  ReservationDetailsState,\r\n  ReservationQueryStringParameters,\r\n  ReservationSettingsState,\r\n  ReservationStatus,\r\n  ReservationValidationResult,\r\n  TrainingSessionResult,\r\n  UserTrainingReservationData,\r\n} from '../slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAsyncChangeLoading,\r\n  selectCloneReservations,\r\n  selectEquipmentChangeCompleted,\r\n  selectEquipmentChangeState,\r\n  selectEquipmentsSettings,\r\n  selectFieldHandler,\r\n  selectIsCreditSubmited,\r\n  selectIsEdit,\r\n  selectRequestedValueFor,\r\n  selectReservationCompleted,\r\n  selectReservationHasError,\r\n  selectReservationSettings,\r\n  selectSavedForLater,\r\n  selectSavedOfflineServices,\r\n} from '../slice/selectors';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { IndexNode } from 'app/components/Forms/FormsLayout/StyledForm';\r\nimport {\r\n  FieldHandler,\r\n  FieldValue,\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { FormReservationEquipmentsPicker } from 'app/components/Forms/FormReservationEquipmentsPicker';\r\nimport { FormReservationStatusPicker } from 'app/components/Forms/FormReservationStatusPicker';\r\nimport { FormUserPicker } from 'app/components/Forms/FormUserPicker';\r\nimport { FormBudgetPicker } from 'app/components/Forms/FormBudgetPicker';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { ServicesFilter } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { RepetitiveControl } from 'app/components/Forms/FormRepetitive/RepetitiveControl';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormRestrictedUserGroupPicker } from 'app/components/Forms/FormRestrictedUserGroupPicker';\r\nimport { GlobalSettingsType } from '../components/useGlobalSettingsHook';\r\nimport { RestrictedFilter } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { restrictedBudgetFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { Box } from '@material-ui/core';\r\nimport { ReservationCustomForm } from '../components/ReservationCustomForm';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport {\r\n  formValueSchema,\r\n  IFormFileValue,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport { RepetitiveFor } from 'app/components/Forms/FormRepetitive/slice/types';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  CheckEntityShema,\r\n  EntityNumberSchema,\r\n  EntityStringSchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  updateFormValues,\r\n  validateAccServices,\r\n  validateReservation,\r\n} from '../components/utils';\r\nimport { useReservationSlice } from '../slice';\r\nimport {\r\n  initEquipmentsData,\r\n  ReservationsEquipmentFilter,\r\n} from 'app/components/pickers/MultiSelectPickers/EquipmentReservationPicker';\r\nimport { Caption } from 'app/components/Typography';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { Body } from 'app/components/Typography';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BudgetListener } from '../components/FormFieldListeners/BudgetListener';\r\nimport { UserNameListener } from '../components/FormFieldListeners/UserNameListener';\r\nimport { isMember } from '../components/FormFieldListeners/isMember';\r\nimport { UserGroupListener } from '../components/FormFieldListeners/UserGroupListener';\r\nimport { StartTimeListener } from '../components/FormFieldListeners/StartTimeListener';\r\nimport { EndTimeListener } from '../components/FormFieldListeners/EndTimeListener';\r\n\r\nimport {\r\n  FormChipCheckBoxGroup,\r\n  FormChipLabelGroup,\r\n} from 'app/components/Forms/FormChipsGroup';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { ReservationOfflineServices } from '../components/ReservationOfflineServices';\r\nimport { FormAccompaniedServicesPicker } from 'app/components/Forms/FormAccompaniedServicesPicker';\r\nimport { ReservationsAccServicesFilter } from 'app/components/pickers/MultiSelectPickers/AccompaniedServicesPicker';\r\nimport { IEquipmentAccServiceDto } from 'api/odata/generated/entities/IAccServiceDto';\r\nimport { TerminateReservation } from '../components/TerminateReservation';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport {\r\n  customFormErrorsHandler,\r\n  durationErrorsHandler,\r\n  otheMessagesHandler,\r\n  permissionsErrorsHandler,\r\n  prerquisitErrorsHandler,\r\n  staffUserChangeHandler,\r\n  trainingSessionChangeHandler,\r\n} from './handlers';\r\nimport { FormTrainingSessionPicker } from 'app/components/Forms/FormTrainingSessionPicker';\r\nimport { ReservRelatedFilter } from 'app/components/pickers/AutocompletePickers/TrainingSessionPicker';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { generatePath } from 'react-router-dom';\r\nimport { RUN_DETAILS_PAGE_PATH } from 'app/pages/Samples/RunDetailsPage';\r\nimport { combineOfflineServiceTypes } from '../slice/combineOfflineServiceTypes';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { FormUsersPicker } from 'app/components/Forms/FormUsersPicker';\r\nimport { getReservationCollaboratorsFilter } from './getReservationCollaboratorsFilter';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport produce from 'immer';\r\nimport { FormReservationBudgetExperimentPicker } from 'app/components/Forms/ReservationBudgetExperimentPicker';\r\nimport { TrainingSignUpAdminAlertContent } from '../components/TrainingSignUpAdminAlertContent';\r\nimport { FormReservationTimePeriodPicker } from '../components/ReservationTimePicker';\r\nimport { adjustSchedulerEventTimes } from 'app/pages/CalendarPage/Scheduler/utils/adjustSchedulerEventTimes';\r\nimport { EquipmentsDataAssemblies } from '../components/EquipmentsDataAssemblies';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport {\r\n  ListMessagesProps,\r\n  SingleMessagesProps,\r\n} from 'app/Layout/FrontendLayout/components/Snackbar/Actions';\r\nimport { ErrorServices } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { ReservationWorkOrders } from '../components/ReservationWorkOrders';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { FormWorkFlowBooking } from 'app/components/Forms/FormWorkFlowBooking';\r\nimport { PrintPDFSection } from 'app/components/PrintToPDF/PrintPDFSection';\r\nimport { selectPrintPDFSections } from 'app/components/PrintToPDF/slice/selectors';\r\nimport { ReadOnlyDetails } from '../components/ReadOnlyDetails';\r\nimport { ReservationRequestDetails } from '../components/RequestDetails';\r\nimport { formChangeHandler } from 'app/components/Forms/FormRender/IFormFieldSetting';\r\n\r\nexport interface ReservationFormProps {\r\n  onSubmit: (\r\n    item: ReservationDetailsState,\r\n    customFormFiles: IFormFileValue[],\r\n    originalFormFiles: IFormFileValue[],\r\n  ) => void;\r\n  initialValues: ReservationDetailsState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  isUserGroupCoordinator?: boolean;\r\n  repetitiveFormRef: React.MutableRefObject<any>;\r\n  globalSettings: GlobalSettingsType;\r\n  customFormRef: React.MutableRefObject<any>;\r\n  formRef: React.MutableRefObject<FormikProps<ReservationDetailsState> | null>;\r\n  onEquipmentClicked?: (equipment: Entity<number>) => void;\r\n  onRestrictionsClick?: (equipment: Entity<number>) => void;\r\n  onOtherSrviceClick?: (service: IOtherServices) => void;\r\n  onStatusChange?: (event: any, status: ReservationStatus) => void;\r\n  onOfflineServiceClick?: (service: IOtherServices) => void;\r\n  onAddBatchClick: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n  onWorkTypeClick: (\r\n    event: IWorkOrderTypeDto,\r\n    equipmentIds: number[],\r\n    reservationId: number,\r\n  ) => void;\r\n  trainingSignUp?: boolean;\r\n  trainingSessionEnabled?: boolean;\r\n  editable?: boolean;\r\n  timeEnabled?: boolean;\r\n  cancelTransfer?: () => void;\r\n  waitingTransferApproval?: boolean;\r\n  transferToUser?: Entity<string> | null;\r\n  transferForId?: number;\r\n  terminationEnabled?: boolean;\r\n  handleTerminate: () => void;\r\n  allowEditMultipleEquipments: boolean;\r\n  useSidePanel: boolean;\r\n  offlineServicesErrors: ErrorServices[];\r\n  setError?: (error: ErrorServices) => void;\r\n  assistedTrainingData: UserTrainingReservationData | null;\r\n  allowOngoingModifications?: boolean;\r\n  isCover?: boolean;\r\n  print?: boolean;\r\n}\r\n\r\nexport const ReservationForm = React.memo(function ReservationForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isAdmin,\r\n  user,\r\n  isUserGroupCoordinator,\r\n  repetitiveFormRef,\r\n  globalSettings,\r\n  customFormRef,\r\n  formRef,\r\n  onEquipmentClicked,\r\n  onRestrictionsClick,\r\n  onStatusChange,\r\n  onOfflineServiceClick,\r\n  onWorkTypeClick,\r\n  trainingSessionEnabled,\r\n  editable,\r\n  timeEnabled,\r\n  trainingSignUp,\r\n  cancelTransfer,\r\n  waitingTransferApproval,\r\n  transferToUser,\r\n  transferForId,\r\n  terminationEnabled,\r\n  handleTerminate,\r\n  allowEditMultipleEquipments,\r\n  useSidePanel,\r\n  onAddBatchClick,\r\n  offlineServicesErrors,\r\n  setError,\r\n  assistedTrainingData,\r\n  allowOngoingModifications,\r\n  isCover,\r\n  print,\r\n}: ReservationFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useReservationSlice();\r\n  const { actions: appActions } = useAppSettingsSlice();\r\n\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const reservationSettings = useSelector(selectReservationSettings);\r\n  const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n  const fieldHandler = useSelector(selectFieldHandler);\r\n  const requestedFor = useSelector(selectRequestedValueFor);\r\n  const equipmentChangeState = useSelector(selectEquipmentChangeState);\r\n  const equipmentChangeCompleted = useSelector(selectEquipmentChangeCompleted);\r\n  const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n  const savedOfflineServices = useSelector(selectSavedOfflineServices);\r\n  const hasError = useSelector(selectReservationHasError);\r\n  const isCloned = useSelector(selectCloneReservations);\r\n  const insertUpdateCompleted = useSelector(selectReservationCompleted);\r\n  const isEdit = useSelector(selectIsEdit);\r\n  const savedForLater = useSelector(selectSavedForLater);\r\n  const isCreditSubmited = useSelector(selectIsCreditSubmited);\r\n  const printPDFSections = useSelector(selectPrintPDFSections);\r\n\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const { newDate } = useSystemDate();\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const [durationErrors, setDurationErrors] = React.useState<IndexNode[]>([]);\r\n  const [permissionErrors, setPermissionErrors] = React.useState<IndexNode[]>(\r\n    [],\r\n  );\r\n  const [prerequisitErrors, setPrerequisitErrors] = React.useState<IndexNode[]>(\r\n    [],\r\n  );\r\n  const [customFormErrors, setCustomFormErrors] = React.useState<IndexNode[]>(\r\n    [],\r\n  );\r\n  const [otherErrors, setOtherErrors] = React.useState<IndexNode[]>([]);\r\n  const [otherWarnings, setOtherWarnings] = React.useState<IndexNode[]>([]);\r\n  const [otherInfo, setOtherInfo] = React.useState<IndexNode[]>([]);\r\n  const [otherSuccess, setOtherSuccess] = React.useState<IndexNode[]>([]);\r\n  const errorMessages = React.useMemo(() => {\r\n    return [\r\n      ...otherErrors,\r\n      ...customFormErrors,\r\n      ...prerequisitErrors,\r\n      ...permissionErrors,\r\n      ...durationErrors,\r\n    ];\r\n  }, [\r\n    customFormErrors,\r\n    durationErrors,\r\n    otherErrors,\r\n    permissionErrors,\r\n    prerequisitErrors,\r\n  ]);\r\n  const customFormOnlyPrinted = React.useMemo(() => {\r\n    return (\r\n      printPDFSections?.some(f => f.id === 'CustomFormDetails' && f.checked) &&\r\n      printPDFSections?.some(f => f.id === 'ReservationDetails' && !f.checked)\r\n    );\r\n  }, [printPDFSections]);\r\n  const mandatoryServices = React.useMemo(() => {\r\n    if (\r\n      !!reservationSettings?.MandatoriesEquipments &&\r\n      !isEdit &&\r\n      reservationSettings.MandatoriesEquipments.length > 0\r\n    ) {\r\n      return reservationSettings.MandatoriesEquipments.map(f => {\r\n        return {\r\n          Id: f.Id,\r\n          Name: f.Name,\r\n          info: `Mandatory instrument for ${f.ParentName}`,\r\n        };\r\n      });\r\n    } else return [];\r\n  }, [isEdit, reservationSettings?.MandatoriesEquipments]);\r\n  const resetAllErrors = () => {\r\n    setDurationErrors([]);\r\n    setPermissionErrors([]);\r\n    setPrerequisitErrors([]);\r\n    setOtherErrors([]);\r\n    setCustomFormErrors([]);\r\n    setOtherWarnings([]);\r\n    setOtherInfo([]);\r\n    setOtherSuccess([]);\r\n  };\r\n  const handleSubmit = (values: ReservationDetailsState) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values, currentFormFiles, originalFormFiles);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(actions.resetValueHandler());\r\n  };\r\n  const reserValueKey = () => {\r\n    dispatch(actions.resetRequestedFor());\r\n  };\r\n  const saveRequestedValue = (value: any) => {\r\n    dispatch(actions.getAnyValueSuccess(value));\r\n  };\r\n  /// func Help ///\r\n  const addPrerquisitErrors = React.useCallback(\r\n    (data: PrerequisitsResult, equipments: Entity<number>[]) => {\r\n      if (!data.IsValid) {\r\n        prerquisitErrorsHandler(\r\n          data,\r\n          equipments,\r\n          (nodes: IndexNode[]) => setPrerequisitErrors(nodes),\r\n          onEquipmentClicked,\r\n          onRestrictionsClick,\r\n        );\r\n      }\r\n    },\r\n    [onEquipmentClicked, onRestrictionsClick],\r\n  );\r\n  const addDurationErrors = React.useCallback(\r\n    (data: string[], equipments: Entity<number>[]) => {\r\n      if (data.length > 0) {\r\n        durationErrorsHandler(\r\n          data,\r\n          equipments,\r\n          (nodes: IndexNode[]) => setDurationErrors(nodes),\r\n          onRestrictionsClick,\r\n        );\r\n      }\r\n    },\r\n    [onRestrictionsClick],\r\n  );\r\n  const addOtheMessages = React.useCallback(\r\n    (data: string[], type: 'warning' | 'error' | 'info' | 'success') => {\r\n      if (data.length > 0) {\r\n        otheMessagesHandler(data, type, (nodes: IndexNode[]) => {\r\n          switch (type) {\r\n            case 'error':\r\n              setOtherErrors(() => nodes);\r\n              break;\r\n            case 'warning':\r\n              setOtherWarnings(() => nodes);\r\n              break;\r\n            case 'info':\r\n              setOtherInfo(() => nodes);\r\n              break;\r\n            case 'success':\r\n              setOtherSuccess(() => nodes);\r\n              break;\r\n          }\r\n        });\r\n      }\r\n    },\r\n    [],\r\n  );\r\n  const addCustomFormErrors = React.useCallback((data: string[]) => {\r\n    if (data.length > 0) {\r\n      customFormErrorsHandler(data, (nodes: IndexNode[]) =>\r\n        setCustomFormErrors(nodes),\r\n      );\r\n    }\r\n  }, []);\r\n  const addPermissionsErrors = React.useCallback(\r\n    (data: string[], equipments: Entity<number>[]) => {\r\n      permissionsErrorsHandler(\r\n        data,\r\n        equipments,\r\n        (nodes: IndexNode[]) => setPermissionErrors(nodes),\r\n        onRestrictionsClick,\r\n      );\r\n    },\r\n    [onRestrictionsClick],\r\n  );\r\n\r\n  /// Local State ///\r\n  const [userGroupChanged, setUserGroupChanged] = React.useState(false);\r\n  const [bookedbyChanged, setBookedByChanged] = React.useState(false);\r\n  const [staffChanged, setStaffChanged] = React.useState(false);\r\n  const [serviceChanged, setServiceChanged] = React.useState(false);\r\n  const [accServiceChanged, setAccServiceChanged] = React.useState(false);\r\n  const [budgetChanged, setBudgetChanged] = React.useState(false);\r\n  const [statusChanged, setStatusChanged] = React.useState(false);\r\n  const [startTimeChanged, setStartTimeChanged] = React.useState(false);\r\n  const [endTimeChanged, setEndTimeChanged] = React.useState(false);\r\n  const [tutoringChanged, setTutoringChanged] = React.useState(false);\r\n  const [optionalChanged, setOptionalChanged] = React.useState(false);\r\n\r\n  const [allIsValid, setAllIsValid] = React.useState<boolean>(true);\r\n  const [trainingSessionChanged, setTrainingSessionChanged] = React.useState(\r\n    false,\r\n  );\r\n  const [originalFormFiles, setOriginalFormFiles] = React.useState<\r\n    IFormFileValue[]\r\n  >([]);\r\n  const [currentFormFiles, setCurrentFormFiles] = React.useState<\r\n    IFormFileValue[]\r\n  >([]);\r\n\r\n  const [firstInitEquipments, setFirstInitEquipments] = React.useState<\r\n    number[]\r\n  >(reservationSettings?.FirstInitEquipments || []);\r\n  const [currentStatus, setCurrentStatus] = React.useState<number>(\r\n    initialValues.Status?.Id || 1,\r\n  );\r\n  const [isTrainingSignUp, setIsTrainingSignUp] = React.useState<\r\n    boolean | undefined\r\n  >(trainingSignUp);\r\n  const changeOfflineServices = React.useCallback(\r\n    (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n      if (operation === 'add') {\r\n        let addedServ = services.filter(\r\n          f =>\r\n            !savedOfflineServices.some(\r\n              s => s.ServiceTypeID === f.ServiceTypeID,\r\n            ),\r\n        );\r\n        dispatch(\r\n          actions.setSavedOfflineServices([\r\n            ...savedOfflineServices,\r\n            ...addedServ,\r\n          ]),\r\n        );\r\n      }\r\n      if (operation === 'remove') {\r\n        dispatch(\r\n          actions.setSavedOfflineServices(\r\n            savedOfflineServices.filter(f => {\r\n              return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (operation === 'update') {\r\n        dispatch(\r\n          actions.setSavedOfflineServices(\r\n            savedOfflineServices.map(f => {\r\n              let service = services.find(\r\n                s => s.ServiceTypeID === f.ServiceTypeID,\r\n              );\r\n              if (!!service && service !== null) {\r\n                return Object.assign({}, f, service);\r\n              } else {\r\n                return f;\r\n              }\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n    },\r\n    [actions, dispatch, savedOfflineServices],\r\n  );\r\n  /// memo ///\r\n  const isServiceAdmin = React.useMemo(() => {\r\n    return equipmentSettings?.IsAllAdmin;\r\n  }, [equipmentSettings?.IsAllAdmin]);\r\n\r\n  const readonly = React.useMemo(() => {\r\n    return (\r\n      equipmentChangeCompleted === false ||\r\n      asyncChangeLoading === true ||\r\n      waitingTransferApproval === true\r\n    );\r\n  }, [asyncChangeLoading, equipmentChangeCompleted, waitingTransferApproval]);\r\n  const fundingTypeVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      globalSettings.fundingTypeBudgetEnabled\r\n    );\r\n  }, [globalSettings]);\r\n  const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n    return !!equipmentSettings\r\n      ? globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n          !equipmentSettings.HasHideProjects &&\r\n          !equipmentSettings.HasConflictProjects &&\r\n          equipmentSettings.BudgetsTurnedOn\r\n      : globalSettings.reservationUserGroupGroupByBudgetUserGroup;\r\n  }, [\r\n    equipmentSettings,\r\n    globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n  ]);\r\n\r\n  const userGroupVisible = React.useMemo(() => {\r\n    return (\r\n      isServiceAdmin &&\r\n      (!isEdit ||\r\n        (isEdit && !globalSettings.DoNotAllowReservationUserChangeByStaff)) &&\r\n      !ReservationUserGroupGroupByBudgetUserGroup\r\n    );\r\n  }, [\r\n    isServiceAdmin,\r\n    isEdit,\r\n    globalSettings.DoNotAllowReservationUserChangeByStaff,\r\n    ReservationUserGroupGroupByBudgetUserGroup,\r\n  ]);\r\n  const userVisible = React.useMemo(() => {\r\n    return (\r\n      (isServiceAdmin || isUserGroupCoordinator) &&\r\n      (!isEdit ||\r\n        (isEdit && !globalSettings.DoNotAllowReservationUserChangeByStaff))\r\n    );\r\n  }, [\r\n    isServiceAdmin,\r\n    isUserGroupCoordinator,\r\n    isEdit,\r\n    globalSettings.DoNotAllowReservationUserChangeByStaff,\r\n  ]);\r\n  const userProfileVisible = React.useMemo(() => {\r\n    return (\r\n      (isServiceAdmin || isUserGroupCoordinator) &&\r\n      isEdit &&\r\n      globalSettings.DoNotAllowReservationUserChangeByStaff\r\n    );\r\n  }, [\r\n    isServiceAdmin,\r\n    isUserGroupCoordinator,\r\n    isEdit,\r\n    globalSettings.DoNotAllowReservationUserChangeByStaff,\r\n  ]);\r\n  const tutoringVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.assistedReservationsEnabled &&\r\n      globalSettings.tutoringModulesEnabled &&\r\n      equipmentSettings?.IsEquipmentTutoring &&\r\n      !isTrainingSignUp\r\n    );\r\n  }, [\r\n    equipmentSettings?.IsEquipmentTutoring,\r\n    globalSettings.assistedReservationsEnabled,\r\n    globalSettings.tutoringModulesEnabled,\r\n    isTrainingSignUp,\r\n  ]);\r\n  const tutoringEnabled = React.useMemo(() => {\r\n    let tutoringAllowed =\r\n      globalSettings.assistedReservationsEnabled &&\r\n      globalSettings.tutoringModulesEnabled &&\r\n      equipmentSettings?.IsEquipmentTutoring &&\r\n      !isTrainingSignUp;\r\n    let forceTutoring =\r\n      equipmentSettings?.ForceTutoring || reservationSettings?.IsForceTutoring;\r\n    let hasValidTraining =\r\n      assistedTrainingData === null\r\n        ? false\r\n        : assistedTrainingData.Equipments.some(f => f.RequiresAdminApproval)\r\n        ? false\r\n        : isEdit\r\n        ? editable\r\n        : true;\r\n    if (!isEdit) {\r\n      return (\r\n        (tutoringAllowed && (isServiceAdmin || hasValidTraining)) ||\r\n        !forceTutoring\r\n      );\r\n    } else {\r\n      return tutoringAllowed && forceTutoring\r\n        ? isServiceAdmin || hasValidTraining\r\n        : editable;\r\n    }\r\n  }, [\r\n    globalSettings.assistedReservationsEnabled,\r\n    globalSettings.tutoringModulesEnabled,\r\n    equipmentSettings?.IsEquipmentTutoring,\r\n    equipmentSettings?.ForceTutoring,\r\n    isTrainingSignUp,\r\n    reservationSettings?.IsForceTutoring,\r\n    assistedTrainingData,\r\n    isEdit,\r\n    editable,\r\n    isServiceAdmin,\r\n  ]);\r\n  const trainingSessionVisible = React.useMemo(() => {\r\n    return (\r\n      trainingSessionEnabled &&\r\n      (reservationSettings?.TrainingSessionOnly || isTrainingSignUp)\r\n    );\r\n  }, [\r\n    reservationSettings?.TrainingSessionOnly,\r\n    trainingSessionEnabled,\r\n    isTrainingSignUp,\r\n  ]);\r\n  const workflowBookingVisible = React.useMemo(() => {\r\n    return globalSettings.AllowWorkflowBooking;\r\n  }, [globalSettings.AllowWorkflowBooking]);\r\n  const workflowBookingEnabled = React.useMemo(() => {\r\n    return (\r\n      workflowBookingVisible &&\r\n      (globalSettings.ModifyReservationNameForUsers || isAdmin)\r\n    );\r\n  }, [\r\n    globalSettings.ModifyReservationNameForUsers,\r\n    isAdmin,\r\n    workflowBookingVisible,\r\n  ]);\r\n  const trainingSignUpVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.trainingSessionEnabled &&\r\n      !equipmentSettings?.HideTrainingSession &&\r\n      reservationSettings?.HasTrainingSession\r\n    );\r\n  }, [\r\n    globalSettings.trainingSessionEnabled,\r\n    equipmentSettings?.HideTrainingSession,\r\n    reservationSettings?.HasTrainingSession,\r\n  ]);\r\n  const staffVisible = React.useMemo(() => {\r\n    return (\r\n      equipmentSettings?.StaffUserVisibleAllways ||\r\n      (equipmentSettings?.StaffUserVisibleOnPending &&\r\n        currentStatus === ReservationStatus.Pending)\r\n    );\r\n  }, [\r\n    equipmentSettings?.StaffUserVisibleAllways,\r\n    equipmentSettings?.StaffUserVisibleOnPending,\r\n    currentStatus,\r\n  ]);\r\n  const reservationCollaboratorsVisible = React.useMemo(() => {\r\n    return equipmentSettings?.AllowReservationCollaborators;\r\n  }, [equipmentSettings?.AllowReservationCollaborators]);\r\n  const ForceFullDayReservations = React.useMemo(\r\n    () => equipmentSettings?.ForceFullDayReservations,\r\n    [equipmentSettings?.ForceFullDayReservations],\r\n  );\r\n  const budgetExperimentVisible = React.useMemo(\r\n    () => equipmentSettings?.budgetExperimentVisible,\r\n    [equipmentSettings?.budgetExperimentVisible],\r\n  );\r\n  const staffRequired = React.useMemo(() => {\r\n    return (\r\n      equipmentSettings?.StaffUserRequiredAlwais ||\r\n      (equipmentSettings?.StaffUserRequiredOnPending &&\r\n        currentStatus === ReservationStatus.Pending)\r\n    );\r\n  }, [\r\n    equipmentSettings?.StaffUserRequiredAlwais,\r\n    equipmentSettings?.StaffUserRequiredOnPending,\r\n    currentStatus,\r\n  ]);\r\n  const warningMessages: IndexNode[] = React.useMemo(() => {\r\n    let nodes: IndexNode[] = [];\r\n    if (firstInitEquipments.length > 0) {\r\n      nodes.push({\r\n        index: 'notMoreThenOneIndex',\r\n        node: (\r\n          <Caption>\r\n            {t(translations.AvailableInstrumentsMessage) as string}\r\n          </Caption>\r\n        ),\r\n      });\r\n    }\r\n    if (isEdit) {\r\n      if (\r\n        currentStatus !== ReservationStatus.Cancelled &&\r\n        currentStatus !== ReservationStatus.CancelledByAdmin\r\n      ) {\r\n        if (\r\n          initialValues.Tutoring &&\r\n          currentStatus === ReservationStatus.Pending\r\n        ) {\r\n          nodes.push({\r\n            index: 'pendingApproval',\r\n            node: (\r\n              <Box\r\n                style={{\r\n                  display: 'flex',\r\n                  flexDirection: 'column',\r\n                  gap: 8,\r\n                }}\r\n              >\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.ReservationPendingApproval) as string}\r\n                </Body>\r\n                {isServiceAdmin && (\r\n                  <Button\r\n                    variant=\"main\"\r\n                    size=\"small\"\r\n                    onClick={e =>\r\n                      !!onStatusChange &&\r\n                      onStatusChange(e, ReservationStatus.Approved)\r\n                    }\r\n                  >\r\n                    {t(translations.Approve) as string}\r\n                  </Button>\r\n                )}\r\n                <Caption>\r\n                  {t(translations.res_wrn_NewPendingReservation) as string}\r\n                </Caption>\r\n              </Box>\r\n            ),\r\n            variant: 'outlined',\r\n          });\r\n        } else if (currentStatus === ReservationStatus.PendingCoord) {\r\n          nodes.push({\r\n            index: 'pendingCoordApproval',\r\n            node: (\r\n              <Box\r\n                style={{\r\n                  display: 'flex',\r\n                  flexDirection: 'column',\r\n                  gap: 8,\r\n                }}\r\n              >\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.RequireGroupCoordApprovalMessage) as string}\r\n                </Body>\r\n                <Caption>\r\n                  {t(translations.res_wrn_NewPendingCoordReservation) as string}\r\n                </Caption>\r\n                {isUserGroupCoordinator && (\r\n                  <Button\r\n                    variant=\"main\"\r\n                    size=\"small\"\r\n                    onClick={e =>\r\n                      !!onStatusChange &&\r\n                      onStatusChange(e, ReservationStatus.Approved)\r\n                    }\r\n                  >\r\n                    {t(translations.Approve) as string}\r\n                  </Button>\r\n                )}\r\n              </Box>\r\n            ),\r\n            variant: 'outlined',\r\n          });\r\n        }\r\n        if (\r\n          equipmentSettings?.DraftSaveForLater &&\r\n          currentStatus === ReservationStatus.Draft\r\n        ) {\r\n          nodes.push({\r\n            index: 'draftReservation',\r\n            node: (\r\n              <Box\r\n                style={{\r\n                  display: 'flex',\r\n                  flexDirection: 'column',\r\n                  gap: 8,\r\n                }}\r\n              >\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.res_wrn_DraftReservation) as string}\r\n                </Body>\r\n                {(isServiceAdmin ||\r\n                  initialValues.BookedBy?.Id === user?.Id) && (\r\n                  <Button\r\n                    variant=\"main\"\r\n                    size=\"small\"\r\n                    onClick={e =>\r\n                      !!onStatusChange &&\r\n                      onStatusChange(e, ReservationStatus.Approved)\r\n                    }\r\n                  >\r\n                    {t(translations.MakeFirm) as string}\r\n                  </Button>\r\n                )}\r\n              </Box>\r\n            ),\r\n            variant: 'outlined',\r\n          });\r\n        }\r\n      }\r\n    }\r\n    if (\r\n      !isEdit &&\r\n      initialValues.TransferFromId !== null &&\r\n      initialValues.TransferFromId !== undefined\r\n    ) {\r\n      nodes.push({\r\n        index: 'transferWarning',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {t(translations.Transfer) as string}\r\n            </Body>\r\n            <Caption>\r\n              {t(translations.ReservationTransferMessage) as string}\r\n            </Caption>\r\n          </Box>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    if (\r\n      !isEdit &&\r\n      (equipmentSettings?.RequireUserGroupCoordApproval ||\r\n        user?.RequireUserGroupCoordApproval)\r\n    ) {\r\n      nodes.push({\r\n        index: 'pendingCoordApproval',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {t(translations.RequireGroupCoordApprovalMessage) as string}\r\n            </Body>\r\n            <Caption>\r\n              {t(translations.res_wrn_NewPendingCoordReservation) as string}\r\n            </Caption>\r\n          </Box>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    if (\r\n      reservationSettings?.TrainingSessionOnly === true &&\r\n      reservationSettings?.HasTrainingSession !== true\r\n    ) {\r\n      nodes.push({\r\n        index: 'trainingSessionMissingWarning',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {t(translations.TrainingSession) as string}\r\n            </Body>\r\n            <Caption>\r\n              {t(translations.TrainingSessionsRes_warning) as string}\r\n            </Caption>\r\n          </Box>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    return [...nodes, ...otherWarnings];\r\n  }, [\r\n    currentStatus,\r\n    equipmentSettings?.DraftSaveForLater,\r\n    equipmentSettings?.RequireUserGroupCoordApproval,\r\n    firstInitEquipments.length,\r\n    initialValues.BookedBy?.Id,\r\n    initialValues.TransferFromId,\r\n    initialValues.Tutoring,\r\n    isEdit,\r\n    isServiceAdmin,\r\n    isUserGroupCoordinator,\r\n    onStatusChange,\r\n    otherWarnings,\r\n    reservationSettings?.HasTrainingSession,\r\n    reservationSettings?.TrainingSessionOnly,\r\n    t,\r\n    user?.Id,\r\n    user?.RequireUserGroupCoordApproval,\r\n  ]);\r\n  const infoMessages = React.useMemo(() => {\r\n    let nodes: IndexNode[] = [];\r\n    if (\r\n      globalSettings.assistedReservationsEnabled &&\r\n      !equipmentSettings?.IsAllAdmin &&\r\n      equipmentSettings?.ForceTutoring &&\r\n      !isEdit &&\r\n      currentStatus === ReservationStatus.Pending\r\n    ) {\r\n      nodes.push({\r\n        index: 'asiistedTutorInfo',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>{`${\r\n              t(translations.TutoringAssistedReservation) as string\r\n            } - ${getSingleReservationStatus(currentStatus).Name}`}</Body>\r\n            <Caption>\r\n              {\r\n                t(\r\n                  translations.AssistedReservationsPendingApprovalInfo,\r\n                ) as string\r\n              }\r\n            </Caption>\r\n          </Box>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    if (\r\n      isEdit &&\r\n      transferToUser !== null &&\r\n      transferToUser !== undefined &&\r\n      waitingTransferApproval === true\r\n    ) {\r\n      nodes.push({\r\n        index: 'waitingTraferInfo',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {t(translations.TransferReservation) as string}\r\n            </Body>\r\n            <Caption>\r\n              {(t(translations.TransferredToDetailsMessage) as string).replace(\r\n                '{0}',\r\n                transferToUser?.Name || '',\r\n              )}\r\n            </Caption>\r\n            <Box style={{ display: 'flex', gap: 8 }}>\r\n              {editable && (\r\n                <Button\r\n                  variant=\"white\"\r\n                  size=\"small\"\r\n                  onClick={e => {\r\n                    !!cancelTransfer && cancelTransfer();\r\n                  }}\r\n                >\r\n                  {t(translations.CancelTransfer) as string}\r\n                </Button>\r\n              )}\r\n\r\n              {(isServiceAdmin ||\r\n                initialValues.TransferredTo?.Id === user?.Id) && (\r\n                <Button\r\n                  variant=\"white\"\r\n                  size=\"small\"\r\n                  href={{\r\n                    path: 'reservations/details',\r\n                    search: {\r\n                      selectedIds: reservationSettings?.BaseEquipment?.Id,\r\n                      Start: dateUtils.formatISO(\r\n                        dateUtils.dateOrStringToDate(initialValues.StartTime),\r\n                        { format: 'basic', representation: 'complete' },\r\n                      ),\r\n                      End: dateUtils.formatISO(\r\n                        dateUtils.dateOrStringToDate(initialValues.EndTime),\r\n                        { format: 'basic', representation: 'complete' },\r\n                      ),\r\n                      resIdTransferredFrom: initialValues.Id,\r\n                      un: transferToUser?.Id,\r\n                    },\r\n                  }}\r\n                >\r\n                  {t(translations.TakeOverTransfer) as string}\r\n                </Button>\r\n              )}\r\n            </Box>\r\n          </Box>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    if (isEdit && terminationEnabled) {\r\n      nodes.push({\r\n        index: 'terminationInfo',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {t(translations.NotUsingThisReservation)}\r\n            </Body>\r\n            {/* <Caption>{t(translations.NotUsingThisReservation)}</Caption> */}\r\n            <Box style={{ display: 'flex', gap: 8 }}>\r\n              <TerminateReservation\r\n                onTerminate={handleTerminate}\r\n                isLoaanDesc={equipmentSettings?.IsLoanDesc || false}\r\n                reservationId={initialValues.Id}\r\n                serviceId={reservationSettings?.BaseEquipment?.Id || 0}\r\n                title={t(translations.TerminateReservationInfo)}\r\n                text={t(translations.ReleaseUnusedTimeButton)}\r\n              />\r\n            </Box>\r\n          </Box>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    if (trainingSessionVisible && isServiceAdmin) {\r\n      let reservation = formRef.current?.values || initialValues;\r\n      let session =\r\n        reservation.TrainingSession !== null\r\n          ? (reservation.TrainingSession as ITrainingSessionDto)\r\n          : null;\r\n      if (session !== null && trainingSignUp) {\r\n        nodes.push({\r\n          index: 'trainingSignUps',\r\n          showMore: false,\r\n          node: (\r\n            <div>\r\n              <TrainingSignUpAdminAlertContent trainingSessionId={session.Id} />\r\n            </div>\r\n          ),\r\n          variant: 'outlined',\r\n        });\r\n      }\r\n    }\r\n    if (!isEdit) {\r\n      const assemblyPartsSelected = formRef.current?.values.EquipmentsData.some(\r\n        service => (service as IReservationEquipmentDto)?.AssemblyId !== null,\r\n      );\r\n      if (assemblyPartsSelected) {\r\n        nodes.push({\r\n          index: 'index',\r\n          showMore: false,\r\n          node: (\r\n            <>{t(translations.ReservationSidePanelAssemblyPart_ErrorMessage)}</>\r\n          ),\r\n        });\r\n      }\r\n    }\r\n\r\n    return [...nodes, ...otherInfo];\r\n  }, [\r\n    cancelTransfer,\r\n    currentStatus,\r\n    editable,\r\n    equipmentSettings?.ForceTutoring,\r\n    equipmentSettings?.IsAllAdmin,\r\n    equipmentSettings?.IsLoanDesc,\r\n    formRef,\r\n    globalSettings.assistedReservationsEnabled,\r\n    handleTerminate,\r\n    initialValues,\r\n    isEdit,\r\n    isServiceAdmin,\r\n    otherInfo,\r\n    reservationSettings?.BaseEquipment?.Id,\r\n    t,\r\n    terminationEnabled,\r\n    trainingSessionVisible,\r\n    trainingSignUp,\r\n    transferToUser,\r\n    user?.Id,\r\n    waitingTransferApproval,\r\n  ]);\r\n  const successMessages = React.useMemo(() => {\r\n    let nodes: IndexNode[] = [];\r\n    if (\r\n      globalSettings.assistedReservationsEnabled &&\r\n      equipmentSettings?.ForceTutoring &&\r\n      isEdit &&\r\n      currentStatus === ReservationStatus.Approved\r\n    ) {\r\n      nodes.push({\r\n        index: 'asiistedTutorApproved',\r\n        node: (\r\n          <Body size=\"small\" bold={true}>\r\n            {t(translations.ReservationAssistedApproved) as string}\r\n          </Body>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    return [...nodes, ...otherSuccess];\r\n  }, [\r\n    currentStatus,\r\n    equipmentSettings?.ForceTutoring,\r\n    globalSettings.assistedReservationsEnabled,\r\n    isEdit,\r\n    otherSuccess,\r\n    t,\r\n  ]);\r\n  const equipmentsChangeHandler = React.useCallback(\r\n    (\r\n      values: ReservationDetailsState,\r\n      changeStatus?: boolean,\r\n      selectedEqs?: IReservationEquipmentDto[],\r\n    ) => {\r\n      let allEquipments = !!selectedEqs\r\n        ? selectedEqs\r\n        : [\r\n            ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n            ...(((reservationSettings?.MandatoriesEquipments || []) as Entity<\r\n              number\r\n            >[]) as IReservationEquipmentDto[]),\r\n            ...((values.OptionalsEquipments.filter(\r\n              f => f.checked === true,\r\n            ) as Entity<number>[]) as IReservationEquipmentDto[]),\r\n          ];\r\n      dispatch(\r\n        actions.extendEquipmentSettingsState({\r\n          equipments: allEquipments,\r\n          mandatories: [],\r\n          accServices: values.AccServices as IEquipmentAccServiceDto[],\r\n          globalSettings: globalSettings,\r\n          settings: equipmentSettings,\r\n        }),\r\n      );\r\n      const payload: EquipmentsChangeStateParameters = {\r\n        AccServices: values.AccServices.map(f => f.Id),\r\n        Equipments: allEquipments.map(f => f.Id),\r\n        ReservationId: (values.Id ?? 0) > 0 ? values.Id : null,\r\n        Start: dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(values.StartTime),\r\n          { representation: 'complete' },\r\n        ),\r\n        End: dateUtils.formatISO(dateUtils.dateOrStringToDate(values.EndTime), {\r\n          representation: 'complete',\r\n        }),\r\n        BookedBy: values.BookedBy?.Id || null,\r\n        Status: values.Status?.Id || 1,\r\n        TrainingSignUp: values.TrainingSignUp,\r\n        Tutoring: values.Tutoring,\r\n        ADGroup: values.ADGroup?.Id || user?.ActiveUserGroup?.Id || null,\r\n        FundingTypeId: values.FundingType?.Id || 0,\r\n        CheckStatus: changeStatus || false,\r\n        TrainingSessionId: values.TrainingSession?.Id || null,\r\n        Remarks: values.Remarks || null,\r\n        BudgetId: values.Budget?.Id || null,\r\n        CheckSession: !equipmentSettings?.HideTrainingSession,\r\n        FullDayReservation: values.FullDayReservation,\r\n      };\r\n      resetAllErrors();\r\n      dispatch(\r\n        actions.initValidationData({\r\n          parameters: payload,\r\n          warnings: [],\r\n          errors: [],\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      equipmentSettings,\r\n      globalSettings,\r\n      reservationSettings?.MandatoriesEquipments,\r\n      user?.ActiveUserGroup?.Id,\r\n    ],\r\n  );\r\n  const extendStaffMandatoryEquipment = React.useCallback(\r\n    (staff: IReservationEquipmentDto | null) => {\r\n      dispatch(\r\n        actions.extendReservationSettings({\r\n          StaffMandatoryEquipment: staff,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const extendMandatoryEquipments = React.useCallback(\r\n    (mandatories: IMandatoryEquipmentsDto[]) => {\r\n      dispatch(\r\n        actions.extendReservationSettings({\r\n          MandatoriesEquipments: mandatories,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const initStaffReservation = React.useCallback(\r\n    (staffEquipmentId: number, values: ReservationDetailsState) => {\r\n      resetAllErrors();\r\n      dispatch(\r\n        actions.initReservation({\r\n          query: {\r\n            id: undefined,\r\n            selectedIds: values.EquipmentsData.map(f => f.Id).join(','),\r\n            Start: dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(values.StartTime),\r\n            ),\r\n            End: dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(values.EndTime),\r\n            ),\r\n            tsid:\r\n              values.TrainingSession === null\r\n                ? undefined\r\n                : values.TrainingSession.Id.toString(),\r\n            remarks: values.Remarks,\r\n            accid: values.AccServices.map(f => f.Id).join(','),\r\n            singleClick: undefined,\r\n            duration: undefined,\r\n            ug: values.ADGroup?.Id,\r\n            un: values.BookedBy?.Id,\r\n            ft:\r\n              values.FundingType === null || values.FundingType === undefined\r\n                ? undefined\r\n                : values.FundingType.Id.toString(),\r\n            srid: String(reservationSettings?.AssignToServiceRequestId),\r\n            srrid: String(reservationSettings?.AssignToServiceRequestRowIds),\r\n            srsid: String(reservationSettings?.AssignToServiceRequestSampleIds),\r\n            sampleRunId: undefined,\r\n            defaultMulti: undefined,\r\n            resIdTransferredFrom: values.TransferFromId?.toString(),\r\n            source: undefined,\r\n            UpdateToNow: undefined,\r\n            terminated: undefined,\r\n            resourceChanged: true.toString(),\r\n            staffEquipmentId: staffEquipmentId.toString(),\r\n            staffUser: values.StaffUser?.Id,\r\n          } as ReservationQueryStringParameters,\r\n          globalSettings: globalSettings,\r\n          prevState: values,\r\n        }),\r\n      );\r\n      setFirstInitEquipments([]);\r\n      setServiceChanged(false);\r\n      setAccServiceChanged(false);\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      globalSettings,\r\n      reservationSettings?.AssignToServiceRequestId,\r\n      reservationSettings?.AssignToServiceRequestRowIds,\r\n      reservationSettings?.AssignToServiceRequestSampleIds,\r\n    ],\r\n  );\r\n  const initTrainingSession = React.useCallback(\r\n    (\r\n      trainingSessionData: TrainingSessionResult,\r\n      values: ReservationDetailsState,\r\n    ) => {\r\n      resetAllErrors();\r\n      dispatch(\r\n        actions.initReservation({\r\n          query: {\r\n            id: undefined,\r\n            selectedIds: values.EquipmentsData.map(f => f.Id).join(','),\r\n            Start: dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(trainingSessionData.Start),\r\n            ),\r\n            End: dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(trainingSessionData.End),\r\n            ),\r\n            tsid:\r\n              trainingSessionData.TrainingSessionId === null\r\n                ? undefined\r\n                : trainingSessionData.TrainingSessionId.toString(),\r\n            remarks: values.Remarks,\r\n            accid: undefined,\r\n            singleClick: undefined,\r\n            duration: undefined,\r\n            ug: values.ADGroup?.Id,\r\n            un: values.BookedBy?.Id,\r\n            ft:\r\n              values.FundingType === null || values.FundingType === undefined\r\n                ? undefined\r\n                : values.FundingType.Id.toString(),\r\n            srid: undefined,\r\n            srrid: undefined,\r\n            srsid: undefined,\r\n            sampleRunId: undefined,\r\n            defaultMulti: undefined,\r\n            resIdTransferredFrom: undefined,\r\n            source: undefined,\r\n            UpdateToNow: undefined,\r\n            terminated: undefined,\r\n            resourceChanged: true.toString(),\r\n            staffEquipmentId: undefined,\r\n            staffUser: trainingSessionData.StaffUser,\r\n          } as ReservationQueryStringParameters,\r\n          globalSettings: globalSettings,\r\n          prevState: values,\r\n        }),\r\n      );\r\n      setFirstInitEquipments([]);\r\n      setServiceChanged(false);\r\n      setAccServiceChanged(false);\r\n    },\r\n    [actions, dispatch, globalSettings],\r\n  );\r\n  const setStaffEquipmentRestricted = React.useCallback(\r\n    (staffUserName: string) => {\r\n      setOtherErrors(() => [\r\n        {\r\n          index: 3,\r\n          node: (\r\n            <Box\r\n              style={{\r\n                display: 'flex',\r\n                flexDirection: 'column',\r\n                gap: 8,\r\n              }}\r\n            >\r\n              <Caption key=\"ind_staff\">\r\n                {(t(\r\n                  translations.err_res_StaffUserEquipmentRestricted,\r\n                ) as string).replace('{0}', staffUserName)}\r\n              </Caption>\r\n            </Box>\r\n          ),\r\n        },\r\n      ]);\r\n    },\r\n    [t],\r\n  );\r\n  const staffChangeHandler = React.useCallback(\r\n    (\r\n      values: ReservationDetailsState,\r\n      setFieldValue: FormikHelpers<ReservationDetailsState>['setFieldValue'],\r\n    ) => {\r\n      return staffUserChangeHandler(\r\n        values,\r\n        isEdit,\r\n        setFieldValue,\r\n        equipmentsChangeHandler,\r\n        extendStaffMandatoryEquipment,\r\n        extendMandatoryEquipments,\r\n        initStaffReservation,\r\n        setStaffEquipmentRestricted,\r\n        reservationSettings,\r\n      );\r\n    },\r\n    [\r\n      equipmentsChangeHandler,\r\n      extendMandatoryEquipments,\r\n      extendStaffMandatoryEquipment,\r\n      initStaffReservation,\r\n      isEdit,\r\n      reservationSettings,\r\n      setStaffEquipmentRestricted,\r\n    ],\r\n  );\r\n  const multipleEquipmentsChangeHandler = React.useCallback(\r\n    (\r\n      values: ReservationDetailsState,\r\n      setValue: (\r\n        field: string,\r\n        value: any,\r\n        shouldValidate?: boolean | undefined,\r\n      ) => void,\r\n    ) => {\r\n      let equipments = values.EquipmentsData as IReservationEquipmentDto[];\r\n      let mandatories = (equipments.length > 0 &&\r\n      equipments.some(\r\n        f => !!f.MandatoriesEquipments && f.MandatoriesEquipments.length > 0,\r\n      )\r\n        ? equipments.reduce((acc, next) => {\r\n            return acc;\r\n          }, equipments.filter(f => !!f.MandatoriesEquipments && f.MandatoriesEquipments.length > 0)[0].MandatoriesEquipments)\r\n        : []\r\n      ).filter(f => !equipments.some(s => f.Id === s.Id));\r\n      /**\r\n       * Gets the mandatory offline service types attached to reservation services.\r\n       * @param services services selected for the reservation\r\n       * @returns array of mandatory offline service type details\r\n       */\r\n      const getMandatoryOfflineServices = (\r\n        services: IReservationEquipmentDto[],\r\n      ) => {\r\n        const MandatoryOfflineServicesOnTrainingSignUps =\r\n          globalSettings.MandatoryOfflineServicesOnTrainingSignUps ||\r\n          !values.TrainingSignUp;\r\n        /**\r\n         * If the MandatoryOfflineServicesOnTrainingSignUps system setting is turned off, then no offline service types should be mandatory for training signups\r\n         */\r\n\r\n        const initialValue: Pick<\r\n          ReservationSettingsState,\r\n          'OfflineMandatory' | 'OfflineOptional'\r\n        > = {\r\n          OfflineMandatory: [],\r\n          OfflineOptional: [],\r\n        };\r\n        const result = combineOfflineServiceTypes(services)?.reduce(\r\n          (previousValue, currentValue) => {\r\n            const mandatory =\r\n              MandatoryOfflineServicesOnTrainingSignUps && currentValue;\r\n\r\n            (mandatory\r\n              ? previousValue.OfflineMandatory\r\n              : previousValue.OfflineOptional\r\n            ).push((currentValue as unknown) as IOtherServices);\r\n            return previousValue;\r\n          },\r\n          initialValue,\r\n        );\r\n        return result;\r\n      };\r\n      if (mandatories.length > 0) {\r\n        (async () => {\r\n          try {\r\n            const data = (await initEquipmentsData(\r\n              mandatories.map(f => f.Id).join(','),\r\n              'AccServices,OfflineServices,StaffUserSelection,MandatoriesEquipments,OptionalsEquipments',\r\n            )) as IMandatoryEquipmentsDto[];\r\n\r\n            const allEquipments = [\r\n              ...values.EquipmentsData,\r\n              ...data,\r\n            ] as IReservationEquipmentDto[];\r\n            dispatch(\r\n              actions.extendReservationSettings({\r\n                MandatoriesEquipments: data,\r\n                ...getMandatoryOfflineServices(allEquipments),\r\n              }),\r\n            );\r\n\r\n            setValue('EquipmentsData', allEquipments);\r\n            equipmentsChangeHandler(\r\n              Object.assign({}, values, {\r\n                EquipmentsData: allEquipments,\r\n              }),\r\n              true,\r\n            );\r\n          } catch {}\r\n        })();\r\n      } else {\r\n        dispatch(\r\n          actions.extendReservationSettings({\r\n            MandatoriesEquipments: mandatories,\r\n            ...getMandatoryOfflineServices(equipments),\r\n          }),\r\n        );\r\n        equipmentsChangeHandler(\r\n          Object.assign({}, values, {\r\n            EquipmentsData: equipments,\r\n          }),\r\n          true,\r\n        );\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      equipmentsChangeHandler,\r\n      globalSettings.MandatoryOfflineServicesOnTrainingSignUps,\r\n    ],\r\n  );\r\n  const warnOnTrainingSession = React.useCallback(\r\n    (data: TrainingSessionResult | null, values: ReservationDetailsState) => {\r\n      trainingSessionChangeHandler(\r\n        data,\r\n        (nodes: IndexNode[]) => setOtherWarnings(nodes),\r\n        (data, values) => {\r\n          initTrainingSession(data, values);\r\n          setIsTrainingSignUp(true);\r\n        },\r\n        values,\r\n      );\r\n    },\r\n    [initTrainingSession],\r\n  );\r\n  const handleFormChange = React.useCallback<\r\n    formChangeHandler<ReservationDetailsState>\r\n  >(\r\n    (\r\n      values,\r\n      isValid,\r\n      dirty,\r\n      setFieldValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (staffChanged) {\r\n        staffChangeHandler(values, setFieldValue);\r\n        setStaffChanged(false);\r\n      }\r\n      if ((serviceChanged || accServiceChanged) && !isEdit) {\r\n        resetAllErrors();\r\n        dispatch(\r\n          actions.initReservation({\r\n            query: {\r\n              id: undefined,\r\n              selectedIds: values.EquipmentsData.map(f => f.Id).join(','),\r\n              Start: dateUtils.formatQueryStringDate(\r\n                dateUtils.dateOrStringToDate(values.StartTime),\r\n              ),\r\n              End: dateUtils.formatQueryStringDate(\r\n                dateUtils.dateOrStringToDate(values.EndTime),\r\n              ),\r\n              tsid:\r\n                values.TrainingSession === null\r\n                  ? undefined\r\n                  : values.TrainingSession.Id.toString(),\r\n              remarks: values.Remarks,\r\n              accid: values.AccServices.map(f => f.Id).join(','),\r\n              singleClick: undefined,\r\n              duration: undefined,\r\n              ug: values.ADGroup?.Id,\r\n              un: values.BookedBy?.Id,\r\n              ft:\r\n                values.FundingType === null || values.FundingType === undefined\r\n                  ? undefined\r\n                  : values.FundingType.Id.toString(),\r\n              srid: String(reservationSettings?.AssignToServiceRequestId),\r\n              srrid: String(reservationSettings?.AssignToServiceRequestRowIds),\r\n              srsid: String(\r\n                reservationSettings?.AssignToServiceRequestSampleIds,\r\n              ),\r\n              sampleRunId: values.SampleRunId?.toString(),\r\n              defaultMulti: undefined,\r\n              resIdTransferredFrom: values.TransferFromId?.toString(),\r\n              source: undefined,\r\n              UpdateToNow: undefined,\r\n              terminated: undefined,\r\n              resourceChanged: true.toString(),\r\n              staffEquipmentId: (\r\n                (values.StaffUser as IUserFilterDto)?.StaffEquipmentId ??\r\n                undefined\r\n              )?.toString(),\r\n              staffUser: values.StaffUser?.Id,\r\n            } as ReservationQueryStringParameters,\r\n            globalSettings: globalSettings,\r\n            prevState: values,\r\n          }),\r\n        );\r\n        setFirstInitEquipments([]);\r\n        setServiceChanged(false);\r\n        setAccServiceChanged(false);\r\n        setStaffChanged(false);\r\n      }\r\n      if (serviceChanged && isEdit && allowEditMultipleEquipments) {\r\n        multipleEquipmentsChangeHandler(values, setFieldValue);\r\n        setServiceChanged(false);\r\n      }\r\n      if (userGroupChanged) {\r\n        console.log('User Group Changed', values.ADGroup);\r\n        if (!isMember(values.BookedBy, values.ADGroup)) {\r\n          setFieldValue('BookedBy', null);\r\n        }\r\n        setDurationErrors([]);\r\n        setPermissionErrors([]);\r\n        setPrerequisitErrors([]);\r\n        setUserGroupChanged(false);\r\n      }\r\n      if (bookedbyChanged) {\r\n        console.log('BookedBy Changed', values.BookedBy);\r\n        if (values.BookedBy !== null) {\r\n          equipmentsChangeHandler(values, true);\r\n        }\r\n        resetAllErrors();\r\n        setBookedByChanged(false);\r\n      }\r\n      if (budgetChanged) {\r\n        console.log('Budget Changed', values.Budget);\r\n        setBudgetChanged(false);\r\n      }\r\n      if (statusChanged) {\r\n        setCurrentStatus(values.Status?.Id || 1);\r\n        console.log('Status Changed', values.Status);\r\n        setStatusChanged(false);\r\n      }\r\n      if (startTimeChanged) {\r\n        resetAllErrors();\r\n        console.log('Start Time Changed', values.StartTime);\r\n        setStartTimeChanged(false);\r\n      }\r\n      if (endTimeChanged) {\r\n        resetAllErrors();\r\n        console.log('End Time Changed', values.EndTime);\r\n        setEndTimeChanged(false);\r\n      }\r\n      if (tutoringChanged) {\r\n        console.log('Tutoring Changed', values.Tutoring);\r\n        if (values.Tutoring === true) {\r\n          setFieldValue(\r\n            'Status',\r\n            getSingleReservationStatus(ReservationStatus.Pending),\r\n          );\r\n          setCurrentStatus(\r\n            getSingleReservationStatus(ReservationStatus.Pending).Id,\r\n          );\r\n        } else {\r\n          setFieldValue(\r\n            'Status',\r\n            getSingleReservationStatus(ReservationStatus.Approved),\r\n          );\r\n          setCurrentStatus(\r\n            getSingleReservationStatus(ReservationStatus.Approved).Id,\r\n          );\r\n          if (equipmentSettings?.StaffUserVisibleOnPending) {\r\n            setFieldValue('StaffUser', null);\r\n          }\r\n        }\r\n        setTutoringChanged(false);\r\n      }\r\n      if (optionalChanged) {\r\n        setOtherErrors([]);\r\n        equipmentsChangeHandler(values);\r\n        console.log('Optional Changed');\r\n        setOptionalChanged(false);\r\n      }\r\n      if (trainingSessionChanged) {\r\n        if (!!values.TrainingSession && values.TrainingSession !== null) {\r\n          setFieldValue(\r\n            'StartTime',\r\n            (values.TrainingSession as ITrainingSessionDto).StartDate,\r\n          );\r\n          setFieldValue(\r\n            'EndTime',\r\n            (values.TrainingSession as ITrainingSessionDto).EndDate,\r\n          );\r\n          setFieldValue('StaffUser', {\r\n            Id: (values.TrainingSession as ITrainingSessionDto).Trainer,\r\n            Name: (values.TrainingSession as ITrainingSessionDto).TrainerName,\r\n          });\r\n        }\r\n        setTrainingSessionChanged(false);\r\n      }\r\n    },\r\n    [\r\n      staffChanged,\r\n      serviceChanged,\r\n      accServiceChanged,\r\n      isEdit,\r\n      allowEditMultipleEquipments,\r\n      userGroupChanged,\r\n      bookedbyChanged,\r\n      budgetChanged,\r\n      statusChanged,\r\n      startTimeChanged,\r\n      endTimeChanged,\r\n      tutoringChanged,\r\n      optionalChanged,\r\n      trainingSessionChanged,\r\n      staffChangeHandler,\r\n      dispatch,\r\n      actions,\r\n      reservationSettings?.AssignToServiceRequestId,\r\n      reservationSettings?.AssignToServiceRequestRowIds,\r\n      reservationSettings?.AssignToServiceRequestSampleIds,\r\n      globalSettings,\r\n      multipleEquipmentsChangeHandler,\r\n      equipmentsChangeHandler,\r\n      equipmentSettings?.StaffUserVisibleOnPending,\r\n    ],\r\n  );\r\n  const validateForms = React.useCallback((isValid: boolean) => {\r\n    setAllIsValid(isValid);\r\n  }, []);\r\n\r\n  /// useEffects\r\n  React.useEffect(() => {\r\n    if (formRef.current) {\r\n      formRef.current.validateForm();\r\n    }\r\n  }, [formRef]);\r\n  React.useEffect(() => {\r\n    if (!!equipmentChangeState) {\r\n      console.log('equipment settings: ', equipmentSettings);\r\n      if (\r\n        !!equipmentChangeState.CustomForms &&\r\n        equipmentChangeState.CustomForms.ErrorMessages.length > 0\r\n      ) {\r\n        addCustomFormErrors(equipmentChangeState.CustomForms.ErrorMessages);\r\n      }\r\n\r\n      if (equipmentChangeState.ErrorMessages.length > 0) {\r\n        addOtheMessages(equipmentChangeState.ErrorMessages, 'error');\r\n      }\r\n      if (equipmentChangeState.WarningMessages.length > 0) {\r\n        addOtheMessages(equipmentChangeState.ErrorMessages, 'warning');\r\n      }\r\n      if (equipmentChangeState.TrainingSessionData !== null) {\r\n        if (equipmentChangeState.TrainingSessionData.HasTrainingSession) {\r\n          setOtherErrors([]);\r\n          warnOnTrainingSession(\r\n            equipmentChangeState.TrainingSessionData,\r\n            formRef.current?.values || initialValues,\r\n          );\r\n        }\r\n      }\r\n      let budget: IBudgetFilterDto | null = null;\r\n      let userGroup: Entity<string> | null = null;\r\n      if (equipmentSettings?.BudgetVisible && !isEdit) {\r\n        dispatch(\r\n          actions.setAnyValue({\r\n            fieldKey: 'Budget',\r\n            fieldValue: equipmentChangeState.DefaultBudget,\r\n          }),\r\n        );\r\n        if (\r\n          fundingTypeVisible &&\r\n          equipmentChangeState.DefaultBudget?.FundingTypeId !== undefined &&\r\n          equipmentChangeState.DefaultBudget?.FundingTypeId !== null\r\n        ) {\r\n          dispatch(\r\n            actions.setAnyValue({\r\n              fieldKey: 'FundingType',\r\n              fieldValue: getSingleInvoiceFundingType(\r\n                equipmentChangeState.DefaultBudget?.FundingTypeId,\r\n              ),\r\n            }),\r\n          );\r\n        }\r\n        budget = equipmentChangeState.DefaultBudget;\r\n        if (\r\n          ReservationUserGroupGroupByBudgetUserGroup &&\r\n          equipmentChangeState.DefaultBudget !== null\r\n        ) {\r\n          dispatch(\r\n            actions.setAnyValue({\r\n              fieldKey: 'ADGroup',\r\n              fieldValue: {\r\n                Id: equipmentChangeState.DefaultBudget.UserGroupId,\r\n                Name: equipmentChangeState.DefaultBudget.UserGroupName,\r\n              },\r\n            }),\r\n          );\r\n          userGroup = {\r\n            Id: equipmentChangeState?.DefaultBudget?.UserGroupId ?? '',\r\n            Name: equipmentChangeState?.DefaultBudget?.UserGroupName ?? '',\r\n          };\r\n        }\r\n      }\r\n      if (equipmentChangeState.StatusChange !== null) {\r\n        dispatch(\r\n          actions.setAnyValue({\r\n            fieldKey: 'Status',\r\n            fieldValue: getSingleReservationStatus(\r\n              equipmentChangeState.StatusChange.Status,\r\n            ),\r\n          }),\r\n        );\r\n        dispatch(\r\n          actions.setAnyValue({\r\n            fieldKey: 'Tutoring',\r\n            fieldValue: equipmentChangeState.StatusChange.Tutoring,\r\n          }),\r\n        );\r\n        setCurrentStatus(equipmentChangeState.StatusChange.Status);\r\n      }\r\n      let values = formRef.current?.values || initialValues;\r\n      if (!!values) {\r\n        let allEquipments = [\r\n          ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n          ...(((reservationSettings?.MandatoriesEquipments || []) as Entity<\r\n            number\r\n          >[]) as IReservationEquipmentDto[]),\r\n          ...((values.OptionalsEquipments.filter(\r\n            f => f.checked === true,\r\n          ) as Entity<number>[]) as IReservationEquipmentDto[]),\r\n        ];\r\n        const payload = {\r\n          AccServices: values.AccServices.map(f => f.Id),\r\n          Equipments: allEquipments.map(f => f.Id),\r\n          ReservationId: (values.Id ?? 0) > 0 ? values.Id : null,\r\n          Start: dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(values.StartTime),\r\n          ),\r\n          End: dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(values.EndTime),\r\n          ),\r\n          BookedBy: values.BookedBy?.Id || null,\r\n          Status: values.Status?.Id || 1,\r\n          TrainingSignUp: values.TrainingSignUp,\r\n          Tutoring: values.Tutoring,\r\n          ADGroup: values.ADGroup?.Id || userGroup?.Id || null,\r\n          FundingTypeId: fundingTypeVisible ? 0 : values.FundingType?.Id || 0,\r\n          CheckStatus: false,\r\n          TrainingSessionId: values.TrainingSession?.Id || null,\r\n          Remarks: values.Remarks || null,\r\n          BudgetId: values.Budget?.Id || budget?.Id || null,\r\n          CheckSession: false,\r\n        } as EquipmentsChangeStateParameters;\r\n        (async () => {\r\n          var validations = await validateReservation(payload);\r\n          let resultValidation = validations as ReservationValidationResult;\r\n          if (!!resultValidation) {\r\n            if (!!resultValidation.PrerequisiteTrainings) {\r\n              if (!resultValidation.PrerequisiteTrainings.IsValid) {\r\n                addPrerquisitErrors(\r\n                  resultValidation.PrerequisiteTrainings,\r\n                  values.EquipmentsData,\r\n                );\r\n              }\r\n            }\r\n            if (resultValidation.PermissionErrors.length > 0) {\r\n              addPermissionsErrors(\r\n                resultValidation.PermissionErrors,\r\n                values.EquipmentsData,\r\n              );\r\n              if (\r\n                !reservationSettings?.UserRequestedByApproval &&\r\n                resultValidation.UserCanRequestApproval\r\n              ) {\r\n                dispatch(actions.setUserCanRequestApproval(true));\r\n                dispatch(\r\n                  actions.setByApprovalErrors(\r\n                    resultValidation.PermissionErrors,\r\n                  ),\r\n                );\r\n              }\r\n            }\r\n            if (\r\n              resultValidation.ErrorMessages.length > 0 &&\r\n              !equipmentChangeState.TrainingSessionData === null\r\n            ) {\r\n              addOtheMessages(resultValidation.ErrorMessages, 'error');\r\n            }\r\n            if (resultValidation.WarningMessages.length > 0) {\r\n              addOtheMessages(resultValidation.WarningMessages, 'error');\r\n            }\r\n          }\r\n          if (\r\n            allEquipments.some(\r\n              f => !!f.AccServices && f.AccServices.length > 0,\r\n            ) &&\r\n            !isTrainingSignUp\r\n          ) {\r\n            let res = validateAccServices(allEquipments);\r\n            if (res.length > 0) {\r\n              let error = (t(\r\n                translations.err_MultipleEquipmentsWithAndWithoutAccServices,\r\n              ) as string).replace('{0}', res.join(', '));\r\n              addOtheMessages([error], 'error');\r\n            }\r\n          }\r\n        })();\r\n      }\r\n\r\n      dispatch(actions.resetEquipmentChangeState());\r\n    }\r\n    if (reservationSettings?.UserRequestedByApproval) {\r\n      setPermissionErrors([]);\r\n    }\r\n  }, [\r\n    ReservationUserGroupGroupByBudgetUserGroup,\r\n    actions,\r\n    addCustomFormErrors,\r\n    addDurationErrors,\r\n    addOtheMessages,\r\n    addPermissionsErrors,\r\n    addPrerquisitErrors,\r\n    dispatch,\r\n    equipmentChangeState,\r\n    equipmentSettings,\r\n    formRef,\r\n    fundingTypeVisible,\r\n    initialValues,\r\n    isEdit,\r\n    isTrainingSignUp,\r\n    reservationSettings?.MandatoriesEquipments,\r\n    reservationSettings?.UserRequestedByApproval,\r\n    t,\r\n    warnOnTrainingSession,\r\n  ]);\r\n  const computedSchema = React.useMemo(() => {\r\n    const reservationSchema: Yup.SchemaOf<ReservationDetailsState> = Yup.object(\r\n      {\r\n        Id: Yup.number().notRequired().default(-1),\r\n        FatherId: Yup.number().optional().nullable(),\r\n        EquipmentsData: Yup.array()\r\n          .of(Yup.mixed() as Yup.SchemaOf<IReservationEquipmentDto>)\r\n          .min(1)\r\n          .label(t(translations.OnlineService) as string)\r\n          .required(t(translations.err_OnlineServiceFieldRequired) as string)\r\n          .test(\r\n            'assembly',\r\n            t(\r\n              translations.AssemblyPartReservationCanNotBeUpdatedDirectly,\r\n            ) as string,\r\n\r\n            (value, context) => {\r\n              const isValid = (value as IReservationEquipmentDto[]).every(\r\n                service => service.AssemblyId === null,\r\n              );\r\n              return isValid;\r\n            },\r\n          ),\r\n        Budget: Yup.mixed()\r\n          .label(t(translations.BudgetNumber) as string)\r\n          .nullable(true),\r\n        BudgetExperiment: Yup.mixed()\r\n          .label(t(translations.BudgetExperiment) as string)\r\n          .nullable(true)\r\n          .when('Budget', {\r\n            is: (Budget: IBudgetFilterDto | null) =>\r\n              equipmentSettings?.BudgetVisible !== false &&\r\n              equipmentSettings?.budgetExperimentVisible &&\r\n              Budget !== null &&\r\n              Budget.HideExperiments !== true,\r\n            then: schema =>\r\n              schema.required(\r\n                t(translations.res_err_BudgetExperimentRequired) as string,\r\n              ),\r\n            otherwise: schema => schema,\r\n          }),\r\n\r\n        TrainingSession: Yup.mixed().label(\r\n          t(translations.TrainingSession) as string,\r\n        ),\r\n        StaffUser: Yup.mixed()\r\n          .label(t(translations.StaffUser) as string)\r\n          .nullable(true),\r\n        BookedBy: Yup.mixed()\r\n          .label(t(translations.User) as string)\r\n          .required(() => t(translations.err_UserFieldRequired) as string),\r\n        Remarks: Yup.string()\r\n          .nullable()\r\n          .label(t(translations.Remarks) as string),\r\n        FullDayReservation: Yup.boolean().required(),\r\n        StartTime: Yup.date()\r\n          .default(newDate())\r\n          .label(t(translations.StartTime) as string)\r\n          .required(t(translations._errStartTimeRequired) as string),\r\n        EndTime: Yup.date()\r\n          .label(t(translations.EndTime) as string)\r\n          .required(t(translations._errEndTimeRequired) as string)\r\n          .test(\r\n            'min',\r\n            t(translations.err_EndTimeLowerThanStartTime) as string,\r\n            (value, context) => {\r\n              let start = (context as any).from[0].value.StartTime;\r\n              let end = (context as any).from[0].value.EndTime;\r\n              if (\r\n                start === null ||\r\n                start === undefined ||\r\n                value === null ||\r\n                value === undefined\r\n              ) {\r\n                return true;\r\n              }\r\n              let s = dateUtils.dateOrStringToDate(start);\r\n              let e = dateUtils.dateOrStringToDate(end);\r\n              if (e.valueOf() < s.valueOf()) {\r\n                return false;\r\n              }\r\n\r\n              return true;\r\n            },\r\n          ),\r\n        Tutoring: Yup.boolean()\r\n          .label(t(translations.TutoringAssistedReservation) as string)\r\n          .default(false),\r\n        TutorName: Yup.string()\r\n          .label(t(translations.TutorName) as string)\r\n          .nullable(true),\r\n        Status: Yup.mixed()\r\n          .label(t(translations.OrderStatus) as string)\r\n          .required(),\r\n        TrainingSignUp: Yup.boolean()\r\n          .default(false)\r\n          .label(t(translations.TrainingSignUp) as string),\r\n        ADGroup: Yup.mixed()\r\n          .label(t(translations.UserGroup) as string)\r\n          .nullable(true),\r\n        DisplayName: Yup.string()\r\n          .label(t(translations.Name) as string)\r\n          .nullable(),\r\n        InstituteProject: Yup.mixed()\r\n          .label(t(translations.InstituteProject) as string)\r\n          .nullable(true),\r\n        ExperimentEln: Yup.mixed()\r\n          .label(t(translations.Experiment) as string)\r\n          .nullable(true),\r\n        WorkflowBooking: Yup.mixed()\r\n          .label(t(translations.WorkflowBooking) as string)\r\n          .nullable(true),\r\n        ExternalCustomer: Yup.mixed()\r\n          .label(t(translations.ExternalCustomer) as string)\r\n          .nullable(true),\r\n        FundingType: Yup.mixed().label(t(translations.FundingType) as string),\r\n        PurchaseOrder: Yup.string()\r\n          .label(t(translations.PurchaseOrder) as string)\r\n          .nullable(true)\r\n          .min(globalSettings.purchaseOrderLengthSetting ?? 0)\r\n          .when('Budget', {\r\n            is: budget => {\r\n              const result =\r\n                globalSettings.purchaseOrderBudgetEnabled &&\r\n                (budget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n                  PurchaseOrderOptions.Mandatory;\r\n              return result;\r\n            },\r\n            then: schema => schema.required(),\r\n          }),\r\n\r\n        Reference: Yup.string()\r\n          .label(t(translations.Reference) as string)\r\n          .nullable(true),\r\n        PartialAttendance: Yup.boolean()\r\n          .default(false)\r\n          .label(t(translations.Attendance) as string),\r\n        PartialAttendanceStart: Yup.number()\r\n          .label(t(translations.PartialAttendanceStartDuration) as string)\r\n          .nullable(true),\r\n        PartialAttendanceEnd: Yup.number()\r\n          .label(t(translations.PartialAttendanceEndDuration) as string)\r\n          .nullable(true),\r\n        TransferredTo: Yup.mixed()\r\n          .label(t(translations.TransferReservation) as string)\r\n          .nullable(true),\r\n        SampleRunId: Yup.number()\r\n          .label(t(translations.SampleRunId) as string)\r\n          .nullable(true),\r\n        AccServices: Yup.array()\r\n          .of(EntityNumberSchema)\r\n          .label(t(translations.AccompaniedService) as string),\r\n        FormValues: Yup.array().of(formValueSchema),\r\n        CollaboratedUsers: Yup.array()\r\n          .of(EntityStringSchema)\r\n          .label(t(translations.CollaboratorUsers) as string),\r\n        SampleIds: Yup.array()\r\n          .of(Yup.number().required())\r\n          .label(t(translations.SampleIds) as string),\r\n        OptionalsEquipments: Yup.array().of(CheckEntityShema),\r\n        WaitingTransferApproval: Yup.boolean().default(false),\r\n        TransferFromId: Yup.number().nullable(true).default(null),\r\n        // not really needed on the form\r\n        AssemblyParts: Yup.mixed().nullable().optional(),\r\n      },\r\n    );\r\n    if (equipmentSettings?.BudgetVisible === true) {\r\n      reservationSchema.fields.Budget.withMutation(schema =>\r\n        schema.required(t(translations.BudgetIsRequired) as string),\r\n      );\r\n    }\r\n    if (\r\n      globalSettings.accServicesEnabled &&\r\n      equipmentSettings?.HasAccServices &&\r\n      !isTrainingSignUp\r\n    ) {\r\n      reservationSchema.fields.AccServices.withMutation(schema =>\r\n        schema\r\n          .min(1, t(translations.err_AccompaniedService_required) as string)\r\n          .required(t(translations.err_AccompaniedService_required) as string),\r\n      );\r\n    }\r\n    if (staffRequired) {\r\n      reservationSchema.fields.StaffUser.withMutation(schema =>\r\n        schema.required(t(translations.StaffUserRequired) as string),\r\n      );\r\n    }\r\n    if (workflowBookingVisible) {\r\n      reservationSchema.fields.WorkflowBooking.withMutation(schema =>\r\n        schema.required(t(translations.err_WorkflowBookingRequired) as string),\r\n      );\r\n    }\r\n    return reservationSchema;\r\n  }, [\r\n    equipmentSettings?.BudgetVisible,\r\n    equipmentSettings?.HasAccServices,\r\n    equipmentSettings?.budgetExperimentVisible,\r\n    globalSettings.accServicesEnabled,\r\n    globalSettings.purchaseOrderBudgetEnabled,\r\n    globalSettings.purchaseOrderLengthSetting,\r\n    isTrainingSignUp,\r\n    newDate,\r\n    staffRequired,\r\n    t,\r\n    workflowBookingVisible,\r\n  ]);\r\n  const handleFullDayReservationChange = (\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => {\r\n    // todo: move this to a callback with the formik.values accessible there instead of this mess\r\n    const startTime = formRef.current?.values.StartTime;\r\n    const endTime = formRef.current?.values.EndTime;\r\n    if (\r\n      startTime !== null &&\r\n      endTime !== null &&\r\n      startTime !== undefined &&\r\n      endTime !== undefined\r\n    ) {\r\n      const fullDayReservation = event.target.checked === true;\r\n      if (fullDayReservation) {\r\n        const currentPeriod = {\r\n          start_date: dateUtils.dateOrStringToDate(startTime),\r\n          end_date: dateUtils.dateOrStringToDate(endTime),\r\n        };\r\n        /**\r\n         * When full day reservation is being checked, the end time needs to be moved to the end of the day, start - to the start of the day\r\n         */\r\n        const adjusted = adjustSchedulerEventTimes(\r\n          currentPeriod,\r\n          fullDayReservation,\r\n        );\r\n        const partialReservationDetailsState: Pick<\r\n          ReservationDetailsState,\r\n          'StartTime' | 'EndTime'\r\n        > = {\r\n          /**\r\n           * TODO: adjust the starttime of the reservation. Currently setting the startTime messes up the end time also\r\n           * e.g.\r\n           * {start:'2023-08-02T11:05:00', end:'2023-08-02T12:05:00'} -> (original)\r\n           * {start:'2023-08-02T00:00:00', end:'2023-08-03T00:00:00'} -> (in setValues)\r\n           * {start:'2023-08-02T00:00:00', end:'2023-08-03T22:27:12Z'} -> (final formik Values)\r\n           */\r\n          StartTime: dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(adjusted.start_date),\r\n            {\r\n              format: 'basic',\r\n              representation: 'complete',\r\n            },\r\n          ),\r\n          EndTime: dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(adjusted.end_date),\r\n            {\r\n              format: 'basic',\r\n              representation: 'complete',\r\n            },\r\n          ),\r\n        };\r\n        formRef.current?.setValues(values => ({\r\n          ...values,\r\n          ...partialReservationDetailsState,\r\n        }));\r\n      }\r\n    }\r\n  };\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={computedSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        validateOnChange={true}\r\n        enableReinitialize\r\n        innerRef={formRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          if (allIsValid) {\r\n            console.log(reservationSettings);\r\n            formikHelpers.validateForm(values).then(responseErrors => {\r\n              if (!isEmpty(responseErrors)) {\r\n                formikHelpers.setSubmitting(false);\r\n                console.debug('errors', responseErrors);\r\n              } else if (errorMessages.length > 0) {\r\n                console.debug('errors', errorMessages);\r\n                formikHelpers.setSubmitting(false);\r\n              } else if (offlineServicesErrors.length > 0) {\r\n                formikHelpers.setSubmitting(false);\r\n                dispatch(\r\n                  appActions.addNotification({\r\n                    variant: 'error',\r\n                    message: '',\r\n                    messageType: SnackBarMessageType.messageList,\r\n                    messageTypeProps: {\r\n                      messages: offlineServicesErrors.map(f => {\r\n                        return {\r\n                          Id: f.id.toString(),\r\n                          message: f.error,\r\n                        } as SingleMessagesProps;\r\n                      }),\r\n                    } as ListMessagesProps,\r\n                  }),\r\n                );\r\n                if (isCreditSubmited) {\r\n                  dispatch(actions.setSubmitCredit(false));\r\n                }\r\n              } else {\r\n                if (isCreditSubmited) {\r\n                  handleSubmit(values);\r\n                } else {\r\n                  console.debug('submitting', values);\r\n                  formikHelpers.setSubmitting(true);\r\n                  dispatch(actions.resetOperateState());\r\n                  if (submitting) {\r\n                    setSubmitting(undefined);\r\n                  }\r\n                  handleSubmit(values);\r\n                }\r\n              }\r\n            });\r\n          } else {\r\n            formikHelpers.setSubmitting(false);\r\n          }\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Reservation errors', formik.errors);\r\n          }\r\n          console.log('Reservation submitting', formik.isSubmitting);\r\n          const reservationCollaboratorsFilter = getReservationCollaboratorsFilter(\r\n            equipmentSettings,\r\n            formik,\r\n          );\r\n          const staffUserPickerPredicates =\r\n            (equipmentSettings?.StaffUserSelection?.length || 0) > 0\r\n              ? [\r\n                  `(Id in ${quoteODataValue(\r\n                    equipmentSettings?.StaffUserSelection.filter(f =>\r\n                      (formik.values\r\n                        .EquipmentsData as IReservationEquipmentDto[]).some(c =>\r\n                        c.StaffUserSelection.some(u => u.Id === f.Id),\r\n                      ),\r\n                    ) || [],\r\n                  )})`,\r\n                ]\r\n              : [\r\n                  `(IsLabTech or isEquipmentAdmin or isGroupAdmin) and ${(formik\r\n                    .values.EquipmentsData as IReservationEquipmentDto[])\r\n                    ?.map(\r\n                      equipment =>\r\n                        `(Services/any(s:s/Id eq ${equipment.Id}) or (${equipment.ServiceGroupId} in ServiceGroupIds)`,\r\n                    )\r\n                    .join(' and ')})`,\r\n                ];\r\n\r\n          return (\r\n            <React.Fragment>\r\n              <PrintPDFSection\r\n                print={print || false}\r\n                id=\"ReservationDetails\"\r\n                forceChecked={true}\r\n                sectionClass=\"print-reservation\"\r\n              >\r\n                <StyledForm onSubmit={formik.handleSubmit} isCover={isCover}>\r\n                  <>\r\n                    <FormListener\r\n                      onFormChange={handleFormChange}\r\n                      fields={[\r\n                        'ADGroup',\r\n                        'BookedBy',\r\n                        'EquipmentsData',\r\n                        'Status',\r\n                        'StartTime',\r\n                        'EndTime',\r\n                        'OptionalsEquipments',\r\n                        'AccServices',\r\n                        'StaffUser',\r\n                        'Tutoring',\r\n                      ]}\r\n                    />\r\n                    <FieldHandler\r\n                      {...fieldHandler}\r\n                      resetFieldState={resetFieldHandler}\r\n                    />\r\n                    <FieldValue\r\n                      setValue={saveRequestedValue}\r\n                      resetValueKey={reserValueKey}\r\n                      fieldKey={requestedFor}\r\n                    />\r\n                    <SubmittingHandler\r\n                      value={\r\n                        (hasError === true || isCloned === true) &&\r\n                        insertUpdateCompleted === true &&\r\n                        formik.isSubmitting &&\r\n                        submitting === undefined\r\n                      }\r\n                      resetSubmitting={resetSubmitting}\r\n                    />\r\n                    <BudgetListener\r\n                      budget={formik.values.Budget}\r\n                      ReservationUserGroupGroupByBudgetUserGroup={\r\n                        ReservationUserGroupGroupByBudgetUserGroup\r\n                      }\r\n                      setUserGroup={value =>\r\n                        formik.setFieldValue('ADGroup', value)\r\n                      }\r\n                    />\r\n                    <UserGroupListener\r\n                      userName={formik.values.BookedBy}\r\n                      equipments={formik.values.EquipmentsData}\r\n                      userGroup={formik.values.ADGroup}\r\n                      endTime={formik.values.EndTime}\r\n                      startTime={formik.values.StartTime}\r\n                      globalSettings={globalSettings}\r\n                      user={user}\r\n                      isEdit={isEdit}\r\n                    />\r\n                    <UserNameListener\r\n                      userName={formik.values.BookedBy}\r\n                      equipments={formik.values.EquipmentsData}\r\n                      globalSettings={globalSettings}\r\n                      user={user}\r\n                      isEdit={isEdit}\r\n                      changeHandler={equipmentsChangeHandler}\r\n                      values={formik.values}\r\n                    />\r\n                    <StartTimeListener\r\n                      userName={formik.values.BookedBy}\r\n                      equipments={formik.values.EquipmentsData}\r\n                      equipmentSettings={equipmentSettings}\r\n                      endTime={formik.values.EndTime}\r\n                      startTime={formik.values.StartTime}\r\n                      initialStart={initialValues.StartTime}\r\n                      initialEnd={initialValues.EndTime}\r\n                      globalSettings={globalSettings}\r\n                      user={user}\r\n                      changeHandler={equipmentsChangeHandler}\r\n                      isEdit={isEdit}\r\n                      values={formik.values}\r\n                    />\r\n                    <EndTimeListener\r\n                      userName={formik.values.BookedBy}\r\n                      equipments={formik.values.EquipmentsData}\r\n                      globalSettings={globalSettings}\r\n                      user={user}\r\n                      endTime={formik.values.EndTime}\r\n                      initialEnd={initialValues.EndTime}\r\n                      isEdit={isEdit}\r\n                      changeHandler={equipmentsChangeHandler}\r\n                      values={formik.values}\r\n                    />\r\n                  </>\r\n                  <FormLeftSection\r\n                    warningNodes={warningMessages}\r\n                    infoNodes={infoMessages}\r\n                    errors={errorMessages}\r\n                    successNodes={successMessages}\r\n                    isCover={isCover}\r\n                  >\r\n                    {/* <ErrorsSummury errors={formik.errors} /> */}\r\n                    {(!print || (!customFormOnlyPrinted && print)) && (\r\n                      <FormFieldsSection\r\n                        titleSection={\r\n                          t(translations.ReservationDetails) as string\r\n                        }\r\n                      >\r\n                        <FormRow fullRow={true} minRow>\r\n                          <FormReservationEquipmentsPicker\r\n                            predicates={ReservationsEquipmentFilter(\r\n                              firstInitEquipments,\r\n                              !!reservationSettings &&\r\n                                !!reservationSettings.MandatoriesEquipments\r\n                                ? reservationSettings.MandatoriesEquipments.map(\r\n                                    f => f.Id,\r\n                                  )\r\n                                : [],\r\n                            )}\r\n                            name=\"EquipmentsData\"\r\n                            label={t(translations.OnlineService)}\r\n                            placeholder={t(translations.PleaseSelectServices)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              (isEdit &&\r\n                                !(editable && allowEditMultipleEquipments)) ||\r\n                              readonly\r\n                            }\r\n                            onChange={() => setServiceChanged(true)}\r\n                            onChipClick={onEquipmentClicked}\r\n                            multiple={\r\n                              globalSettings.multipleInstrumentsEnabled &&\r\n                              !trainingSessionVisible\r\n                            }\r\n                            autoExpand={\r\n                              'MandatoriesEquipments,OptionalsEquipments,AccServices,OfflineServices,StaffUserSelection'\r\n                            }\r\n                            fullWidth\r\n                          />\r\n                          {globalSettings.AssemblyPartsEnabled && (\r\n                            <EquipmentsDataAssemblies\r\n                              equipmentsData={\r\n                                formik.values\r\n                                  .EquipmentsData as IReservationEquipmentDto[]\r\n                              }\r\n                              reservedAssemblyParts={\r\n                                formik.values.AssemblyParts ?? null\r\n                              }\r\n                            />\r\n                          )}\r\n                        </FormRow>\r\n                        {globalSettings.accServicesEnabled &&\r\n                          equipmentSettings?.HasAccServices &&\r\n                          !isTrainingSignUp && (\r\n                            <FormRow fullRow={true}>\r\n                              <FormAccompaniedServicesPicker\r\n                                predicates={ReservationsAccServicesFilter(\r\n                                  formik.values.EquipmentsData.map(f => f.Id),\r\n                                )}\r\n                                name=\"AccServices\"\r\n                                label={t(translations.AccompaniedService)}\r\n                                placeholder={t(\r\n                                  translations.PleaseSelectAnAccompaniedService,\r\n                                )}\r\n                                disabled={\r\n                                  formik.isSubmitting ||\r\n                                  (isEdit && !editable) ||\r\n                                  readonly\r\n                                }\r\n                                onChange={() => setAccServiceChanged(true)}\r\n                                multiple={\r\n                                  equipmentSettings.HasAccServices &&\r\n                                  !equipmentSettings.AllowOneAccSerOnly\r\n                                }\r\n                                fullWidth\r\n                              />\r\n                            </FormRow>\r\n                          )}\r\n                        {mandatoryServices.length > 0 && (\r\n                          <React.Fragment>\r\n                            <FormRow fullRow={true}>\r\n                              <Icon\r\n                                icon=\"level-up-alt\"\r\n                                transform={{ rotate: 90 }}\r\n                              />\r\n                              <FormChipLabelGroup\r\n                                options={mandatoryServices}\r\n                                name=\"MandatoriesEquipments\"\r\n                                id=\"MandatoriesEquipmentsId\"\r\n                                label={t(\r\n                                  translations.AddingsMandatoryEquipments,\r\n                                )}\r\n                                style={\r\n                                  useSidePanel && sidePanelExpanded\r\n                                    ? { width: '98%' }\r\n                                    : { width: '92%' }\r\n                                }\r\n                              />\r\n                            </FormRow>\r\n                          </React.Fragment>\r\n                        )}\r\n                        {!!reservationSettings?.OptionalsEquipments &&\r\n                          !isEdit &&\r\n                          reservationSettings.OptionalsEquipments.length >\r\n                            0 && (\r\n                            <FormRow fullRow={true}>\r\n                              <Icon\r\n                                icon=\"level-up-alt\"\r\n                                transform={{ rotate: 90 }}\r\n                              />\r\n                              <FormChipCheckBoxGroup\r\n                                style={\r\n                                  useSidePanel && sidePanelExpanded\r\n                                    ? { width: '98%' }\r\n                                    : { width: '92%' }\r\n                                }\r\n                                options={formik.values.OptionalsEquipments}\r\n                                name=\"OptionalsEquipments\"\r\n                                id=\"OptionalsEquipmentsId\"\r\n                                setOnChanged={() => {\r\n                                  setOptionalChanged(() => true);\r\n                                }}\r\n                                disabled={formik.isSubmitting || readonly}\r\n                                label={t(\r\n                                  translations.AddingsOptionalEquipments,\r\n                                )}\r\n                                size=\"small\"\r\n                              />\r\n                            </FormRow>\r\n                          )}\r\n                        {trainingSessionVisible && (\r\n                          <FormRow>\r\n                            <FormTrainingSessionPicker\r\n                              name=\"TrainingSession\"\r\n                              id=\"trainingSession\"\r\n                              label={t(translations.TrainingSession)}\r\n                              disabled={formik.isSubmitting || readonly}\r\n                              onChange={() => setTrainingSessionChanged(true)}\r\n                              predicates={ReservRelatedFilter(\r\n                                formik.values.EquipmentsData[0].Id,\r\n                              )}\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {workflowBookingVisible && (\r\n                          <FormRow fullRow={true}>\r\n                            <FormWorkFlowBooking\r\n                              name=\"WorkflowBooking\"\r\n                              label={t(translations.WorkflowBooking)}\r\n                              info={t(translations.ReservationName_Desc)}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                !workflowBookingEnabled\r\n                              }\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {!trainingSessionVisible && (\r\n                          <React.Fragment>\r\n                            <FormRow fullRow={true}>\r\n                              <FormSwitch\r\n                                boldLebel\r\n                                name=\"FullDayReservation\"\r\n                                info={t(\r\n                                  translations.FullDayReservation_Description,\r\n                                )}\r\n                                label={t(translations.FullDayReservation)}\r\n                                disabled={\r\n                                  ForceFullDayReservations ||\r\n                                  formik.isSubmitting ||\r\n                                  readonly ||\r\n                                  !tutoringEnabled\r\n                                }\r\n                                onChange={handleFullDayReservationChange}\r\n                                id={'fullDaySwitchId'}\r\n                              />\r\n                            </FormRow>\r\n                            <FormReservationTimePeriodPicker\r\n                              StartTimePropertyName=\"StartTime\"\r\n                              EndTimePropertyName=\"EndTime\"\r\n                              FullDayReservation={\r\n                                ForceFullDayReservations ||\r\n                                formik.values.FullDayReservation\r\n                              }\r\n                              startTimeDisabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                formik.values.TrainingSignUp ||\r\n                                (isEdit && !editable)\r\n                              }\r\n                              endTimeDisabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                formik.values.TrainingSignUp ||\r\n                                (isEdit && !timeEnabled)\r\n                              }\r\n                              onStartTimeChange={() =>\r\n                                setStartTimeChanged(true)\r\n                              }\r\n                              onEndTimeChange={() => setEndTimeChanged(true)}\r\n                              startTimeLabel={t(translations.From)}\r\n                              endTimeLabel={t(translations.To)}\r\n                            />\r\n                          </React.Fragment>\r\n                        )}\r\n\r\n                        {userGroupVisible ? (\r\n                          <FormRow>\r\n                            <FormRestrictedUserGroupPicker\r\n                              name=\"ADGroup\"\r\n                              label={t(translations.UserGroup)}\r\n                              predicates={RestrictedFilter(\r\n                                undefined,\r\n                                undefined,\r\n                                undefined,\r\n                                globalSettings.onlyOwnUserGroupsAllowed,\r\n                              )}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                (isEdit && !editable)\r\n                              }\r\n                              onChange={() => setUserGroupChanged(true)}\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        ) : (\r\n                          <FormRow>\r\n                            <FormLabelText\r\n                              id=\"UserGroupId\"\r\n                              name=\"ADGroup\"\r\n                              label={t(translations.UserGroup)}\r\n                              info={\r\n                                ReservationUserGroupGroupByBudgetUserGroup\r\n                                  ? t(translations.SponsorDepartment_Desc)\r\n                                  : undefined\r\n                              }\r\n                              html={\r\n                                <Box\r\n                                  width=\"100%\"\r\n                                  display=\"flex\"\r\n                                  flexDirection=\"row\"\r\n                                  alignItems=\"center\"\r\n                                  justifyContent=\"flex-start\"\r\n                                >\r\n                                  {formik.values.ADGroup !== undefined &&\r\n                                  formik.values.ADGroup !== null\r\n                                    ? formik.values.ADGroup.Name\r\n                                    : (t(translations.NA) as string)}\r\n                                </Box>\r\n                              }\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {userVisible ? (\r\n                          <FormRow>\r\n                            <FormUserPicker\r\n                              name=\"BookedBy\"\r\n                              info={t(translations.ReservationUser_Desc)}\r\n                              selectArray={[\r\n                                'Id',\r\n                                'Name',\r\n                                'UserGroupId',\r\n                                'UserGroupName',\r\n                                'UserGroups',\r\n                                'Budgets',\r\n                                'DefaultBudgetId',\r\n                              ]}\r\n                              predicates={ServicesFilter(\r\n                                (formik.values\r\n                                  .EquipmentsData as IReservationEquipmentDto[]).map(\r\n                                  f => {\r\n                                    return {\r\n                                      Id: f.Id,\r\n                                      Name: f.Name,\r\n                                      ServiceTypeId: 1,\r\n                                      ServiceGroupId: f.ServiceGroupId,\r\n                                      HideProject: f.HideProjects,\r\n                                    } as IServiceTypeFilterDto;\r\n                                  },\r\n                                ),\r\n                                globalSettings.budgetExperimentModuleEnabled,\r\n                                formik.values.ADGroup?.Id,\r\n                                formik.values.Budget?.Id,\r\n                                globalSettings.defaultBudgetEnabled,\r\n                                (formik.values.Budget as IBudgetFilterDto)\r\n                                  ?.IsDefault,\r\n                              )}\r\n                              label={t(translations.User)}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                (isEdit && !editable)\r\n                              }\r\n                              onChange={value => {\r\n                                setBookedByChanged(true);\r\n                              }}\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        ) : (\r\n                          <FormRow hide={!isServiceAdmin}>\r\n                            <FormLabelText\r\n                              id=\"bookedById\"\r\n                              name=\"Bookedby\"\r\n                              label={t(translations.User) as string}\r\n                              info={\r\n                                t(translations.ReservationUser_Desc) as string\r\n                              }\r\n                              html={\r\n                                <Box\r\n                                  width=\"100%\"\r\n                                  display=\"flex\"\r\n                                  flexDirection=\"row\"\r\n                                  alignItems=\"center\"\r\n                                  justifyContent=\"flex-start\"\r\n                                >\r\n                                  {userProfileVisible &&\r\n                                    formik.values.BookedBy !== null && (\r\n                                      <UserProfileLink\r\n                                        UserId={formik.values.BookedBy.Id}\r\n                                        DisplayName={\r\n                                          formik.values.BookedBy.Name\r\n                                        }\r\n                                        twoRows={false}\r\n                                        isAdmin={isServiceAdmin}\r\n                                      />\r\n                                    )}\r\n                                  {/* {formik.values.BookedBy !== null\r\n                                  ? formik.values.BookedBy.Name\r\n                                  : (t(translations.NA) as string)} */}\r\n                                </Box>\r\n                              }\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {staffVisible && (\r\n                          <FormRow>\r\n                            <FormUserPicker\r\n                              name=\"StaffUser\"\r\n                              info={t(translations.StaffUser_Info)}\r\n                              placeholder={t(\r\n                                translations.PleaseSelectStaffUser,\r\n                              )}\r\n                              selectArray={['Id', 'Name', 'StaffEquipmentId']}\r\n                              urlType={\r\n                                (equipmentSettings?.StaffUserSelection\r\n                                  ?.length || 0) > 0\r\n                                  ? 'full'\r\n                                  : 'admin'\r\n                              }\r\n                              predicates={staffUserPickerPredicates}\r\n                              label={t(translations.StaffUser)}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                (isEdit && !editable)\r\n                              }\r\n                              onChange={() => setStaffChanged(true)}\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {equipmentSettings?.BudgetVisible &&\r\n                          fundingTypeVisible && (\r\n                            <FormRow>\r\n                              <FormFundingTypePicker\r\n                                name=\"FundingType\"\r\n                                label={t(translations.FundingType)}\r\n                                disabled={\r\n                                  formik.isSubmitting ||\r\n                                  (isEdit && !editable) ||\r\n                                  readonly\r\n                                }\r\n                                onChange={value => {\r\n                                  formik.setValues(\r\n                                    produce(values => {\r\n                                      // clear budget selection when funding type is changed to an incompatible value\r\n                                      // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n                                      if (\r\n                                        (value as Entity<number>).Id !==\r\n                                        (values.Budget as IBudgetFilterDto)\r\n                                          ?.FundingTypeId\r\n                                      ) {\r\n                                        values.Budget = null;\r\n                                      }\r\n                                      values.FundingType = value;\r\n                                    }),\r\n                                  );\r\n                                }}\r\n                                fullWidth\r\n                              />\r\n                            </FormRow>\r\n                          )}\r\n                        {equipmentSettings?.BudgetVisible && (\r\n                          <>\r\n                            <FormRow>\r\n                              <FormBudgetPicker\r\n                                name=\"Budget\"\r\n                                predicates={restrictedBudgetFilter({\r\n                                  budgetLimitedByUsers:\r\n                                    globalSettings.budgetLimitedByUsers,\r\n                                  isBudgetsWithoutUserGroup:\r\n                                    globalSettings.isBudgetsWithoutUserGroup,\r\n                                  userGroupId: ReservationUserGroupGroupByBudgetUserGroup\r\n                                    ? undefined\r\n                                    : formik.values.ADGroup?.Id,\r\n                                  serviceGroupId: undefined,\r\n                                  services: (formik.values\r\n                                    .EquipmentsData as IReservationEquipmentDto[]).map(\r\n                                    f => {\r\n                                      return {\r\n                                        Id: f.Id,\r\n                                        Name: f.Name,\r\n                                        ServiceTypeId: 1,\r\n                                        ServiceGroupId: f.ServiceGroupId,\r\n                                        HideProject: f.HideProjects,\r\n                                      } as IServiceTypeFilterDto;\r\n                                    },\r\n                                  ),\r\n                                  startTime: dateUtils.dateOrStringToDate(\r\n                                    formik.values.StartTime,\r\n                                  ),\r\n                                  endTime: dateUtils.dateOrStringToDate(\r\n                                    formik.values.EndTime,\r\n                                  ),\r\n                                  user: isServiceAdmin\r\n                                    ? formik.values.BookedBy === null\r\n                                      ? undefined\r\n                                      : formik.values.BookedBy.Id\r\n                                    : user?.Id,\r\n                                  defaultBudgetEnabled:\r\n                                    globalSettings.defaultBudgetEnabled,\r\n                                  userDefaultBudgetEnabled:\r\n                                    globalSettings.userDefaultBudgetEnabled,\r\n                                  hideNonDefaultBudgets:\r\n                                    globalSettings.hideNonDefaultBudgets,\r\n                                  // funding type is set to Internal by default even if it's not in use\r\n                                  fundingType: fundingTypeVisible\r\n                                    ? formik.values.FundingType\r\n                                    : null,\r\n                                })}\r\n                                label={t(translations.BudgetNumber)}\r\n                                onChange={() => {\r\n                                  setBudgetChanged(true);\r\n                                  formik.setFieldValue('CollaboratedUsers', []);\r\n                                }}\r\n                                disabled={\r\n                                  formik.isSubmitting ||\r\n                                  readonly ||\r\n                                  (isEdit && !editable)\r\n                                }\r\n                                useSearchOrPredicate={\r\n                                  globalSettings.hideNonDefaultBudgets\r\n                                }\r\n                                fullWidth\r\n                              />\r\n                            </FormRow>\r\n                            {budgetExperimentVisible &&\r\n                              !(\r\n                                (formik.values.Budget as IBudgetFilterDto)\r\n                                  ?.HideExperiments ?? true\r\n                              ) && (\r\n                                <FormRow>\r\n                                  <FormReservationBudgetExperimentPicker\r\n                                    fullWidth\r\n                                    name=\"BudgetExperiment\"\r\n                                    isEdit={isEdit}\r\n                                    placeholder={t(\r\n                                      translations.BudgetExperiment,\r\n                                    )}\r\n                                    label={t(translations.BudgetExperiment)}\r\n                                    disabled={\r\n                                      formik.isSubmitting ||\r\n                                      readonly ||\r\n                                      (isEdit && !editable)\r\n                                    }\r\n                                    serviceId={formik.values.EquipmentsData}\r\n                                    budgetId={formik.values.Budget?.Id ?? null}\r\n                                    userId={formik.values.BookedBy?.Id ?? null}\r\n                                    start={formik.values.StartTime}\r\n                                    end={formik.values.EndTime}\r\n                                  />\r\n                                </FormRow>\r\n                              )}\r\n                          </>\r\n                        )}\r\n                        {reservationCollaboratorsVisible && (\r\n                          <FormRow>\r\n                            <FormUsersPicker\r\n                              name=\"CollaboratedUsers\"\r\n                              label={t(translations.CollaboratorUsers)}\r\n                              info={t(translations.CollaboratorUsers_Info)}\r\n                              selectArray={[\r\n                                'Id',\r\n                                'Name',\r\n                                'UserGroupId',\r\n                                'UserGroupName',\r\n                                'UserGroups',\r\n                                'Budgets',\r\n                              ]}\r\n                              predicates={reservationCollaboratorsFilter}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                (isEdit && !editable)\r\n                              }\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {globalSettings.purchaseOrderBudgetEnabled &&\r\n                          ((formik.values.Budget as IBudgetFilterDto)\r\n                            ?.PurchaseOrderOptionId ??\r\n                            PurchaseOrderOptions.Hidden) !==\r\n                            PurchaseOrderOptions.Hidden && (\r\n                            <FormRow>\r\n                              <FormTextField\r\n                                name=\"PurchaseOrder\"\r\n                                label={t(translations.PurchaseOrder)}\r\n                                disabled={\r\n                                  formik.isSubmitting ||\r\n                                  readonly ||\r\n                                  (isEdit && !editable)\r\n                                }\r\n                                fullWidth\r\n                              />\r\n                            </FormRow>\r\n                          )}\r\n                      </FormFieldsSection>\r\n                    )}\r\n\r\n                    {isEdit &&\r\n                      (!useSidePanel || (useSidePanel && sidePanelExpanded)) &&\r\n                      allowOngoingModifications && (\r\n                        <ReservationWorkOrders\r\n                          reservationId={formik.values.Id}\r\n                          equipments={\r\n                            formik.values\r\n                              .EquipmentsData as IReservationEquipmentDto[]\r\n                          }\r\n                          onWorkTypeClick={onWorkTypeClick}\r\n                        />\r\n                      )}\r\n                  </FormLeftSection>\r\n\r\n                  <FormRightSection isCover={isCover}>\r\n                    {(!print || (!customFormOnlyPrinted && print)) && (\r\n                      <FormFieldsSection>\r\n                        {(!useSidePanel ||\r\n                          (useSidePanel && sidePanelExpanded)) && (\r\n                          <React.Fragment>\r\n                            <FormRow fullRow={true}>\r\n                              <FormReservationStatusPicker\r\n                                name=\"Status\"\r\n                                label={t(translations.ReservationStatus)}\r\n                                disabled={\r\n                                  formik.isSubmitting || readonly || !isAdmin\r\n                                }\r\n                                onChange={() => setStatusChanged(true)}\r\n                                fullWidth\r\n                              />\r\n                            </FormRow>\r\n                          </React.Fragment>\r\n                        )}\r\n                        {tutoringVisible && (\r\n                          <FormRow fullRow={true}>\r\n                            <FormSwitch\r\n                              boldLebel\r\n                              name=\"Tutoring\"\r\n                              id=\"tutoringSwitchId\"\r\n                              info={t(\r\n                                translations.ReservationTrainingApproval_Desc,\r\n                              )}\r\n                              label={t(\r\n                                translations.TutoringAssistedReservation,\r\n                              )}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                readonly ||\r\n                                !tutoringEnabled\r\n                              }\r\n                              onChange={() => setTutoringChanged(true)}\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                        {(!useSidePanel ||\r\n                          (useSidePanel && sidePanelExpanded && !isCover)) && (\r\n                          <React.Fragment>\r\n                            {trainingSignUpVisible && (\r\n                              <FormRow fullRow={true}>\r\n                                <FormSwitch\r\n                                  boldLebel\r\n                                  id=\"trainingSignupId\"\r\n                                  name=\"TrainingSignUp\"\r\n                                  info={t(translations.TrainingSignUp_info)}\r\n                                  label={t(translations.TrainingSignUp)}\r\n                                  disabled={\r\n                                    formik.isSubmitting ||\r\n                                    readonly ||\r\n                                    reservationSettings?.TrainingSessionOnly\r\n                                  }\r\n                                  onChange={() => {\r\n                                    setIsTrainingSignUp(!isTrainingSignUp);\r\n                                  }}\r\n                                />\r\n                              </FormRow>\r\n                            )}\r\n                          </React.Fragment>\r\n                        )}\r\n\r\n                        {!customFormOnlyPrinted && print && (\r\n                          <FormRow fullRow={true}>\r\n                            <FormRichTextField\r\n                              name=\"Remarks\"\r\n                              placeholder={t(translations.Remarks)}\r\n                              disabled={\r\n                                formik.isSubmitting ||\r\n                                (isEdit && !editable) ||\r\n                                readonly\r\n                              }\r\n                              fullWidth={true}\r\n                            />\r\n                          </FormRow>\r\n                        )}\r\n                      </FormFieldsSection>\r\n                    )}\r\n                    {!isEdit && !formik.values.TrainingSignUp && (\r\n                      <RepetitiveControl\r\n                        startDate={dateUtils.dateOrStringToDate(\r\n                          formik.values.StartTime,\r\n                        )}\r\n                        disabled={readonly}\r\n                        submitFormRef={repetitiveFormRef}\r\n                        title={t(translations.RepetitiveReservation) as string}\r\n                        type={RepetitiveFor.Reservations}\r\n                        formIsValid={validateForms}\r\n                      />\r\n                    )}\r\n                    {globalSettings.ServiceRequestReservationEnabled &&\r\n                      isServiceAdmin &&\r\n                      isEdit && (\r\n                        <PrintPDFSection\r\n                          print={print || false}\r\n                          id=\"ServiceRequest\"\r\n                        >\r\n                          <ReservationRequestDetails\r\n                            reservationId={formik.values.Id}\r\n                          />\r\n                        </PrintPDFSection>\r\n                      )}\r\n                    {globalSettings.offlineServiceWithReservation &&\r\n                      !!reservationSettings &&\r\n                      (equipmentSettings?.OfflineServicesVisible ||\r\n                        (reservationSettings?.OfflineMandatory !== undefined &&\r\n                          reservationSettings?.OfflineMandatory?.length >\r\n                            0)) && (\r\n                        <PrintPDFSection\r\n                          print={print || false}\r\n                          id=\"OfflineServicesDetails\"\r\n                        >\r\n                          <ReservationOfflineServices\r\n                            hanleUpdateLocalServices={changeOfflineServices}\r\n                            onServiceClick={onOfflineServiceClick}\r\n                            equipmentSettings={equipmentSettings}\r\n                            reservationSettings={reservationSettings}\r\n                            globalSettings={globalSettings}\r\n                            isEdit={isEdit}\r\n                            onAddBatchClick={onAddBatchClick}\r\n                            values={formik.values}\r\n                            title={\r\n                              t(translations.ReservationConsumables) as string\r\n                            }\r\n                            setError={setError}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              (isEdit && !editable) ||\r\n                              readonly\r\n                            }\r\n                          />\r\n                        </PrintPDFSection>\r\n                      )}\r\n\r\n                    {globalSettings.resCustomFormEnabled &&\r\n                      !!reservationSettings &&\r\n                      (reservationSettings.CustomForms?.length > 0 ||\r\n                        (isEdit && formik.values.FormValues?.length > 0)) && (\r\n                        <PrintPDFSection\r\n                          print={print || false}\r\n                          fullWidth={true}\r\n                          id=\"CustomFormDetails\"\r\n                        >\r\n                          <ReservationCustomForm\r\n                            multiple={globalSettings.resMultipleFormsEnabled}\r\n                            customForms={\r\n                              !!reservationSettings &&\r\n                              reservationSettings.CustomForms?.length > 0\r\n                                ? reservationSettings.CustomForms\r\n                                : []\r\n                            }\r\n                            readonly={readonly}\r\n                            isAdmin={isAdmin}\r\n                            customFormRef={customFormRef}\r\n                            formIsValid={validateForms}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              (isEdit && !editable) ||\r\n                              readonly\r\n                            }\r\n                            validationEnabled={!savedForLater}\r\n                            saveFormValues={(\r\n                              values: IFormValueDto[],\r\n                              files: IFormFileValue[],\r\n                              originalFiles: IFormFileValue[],\r\n                            ) => {\r\n                              formik.setFieldValue(\r\n                                'FormValues',\r\n                                updateFormValues(\r\n                                  formik.values.FormValues,\r\n                                  values,\r\n                                ),\r\n                                false,\r\n                              );\r\n                              setCurrentFormFiles(files);\r\n                              setOriginalFormFiles(originalFiles);\r\n                            }}\r\n                            formValues={formik.values.FormValues}\r\n                          />\r\n                        </PrintPDFSection>\r\n                      )}\r\n\r\n                    {formik.values.SampleRunId !== null &&\r\n                      formik.values.SampleRunId !== undefined && (\r\n                        <FormRow>\r\n                          <Button\r\n                            variant=\"text\"\r\n                            to={generatePath(RUN_DETAILS_PAGE_PATH, {\r\n                              id: formik.values.SampleRunId,\r\n                            })}\r\n                            title={t(translations.ReservationSampleRunId_Desc)}\r\n                          >\r\n                            {t(translations.SampleRunId)}:&ensp;\r\n                            {formik.values.SampleRunId}\r\n                          </Button>\r\n                        </FormRow>\r\n                      )}\r\n                    {!print && (\r\n                      <FormRow fullRow={true}>\r\n                        <FormRichTextField\r\n                          name=\"Remarks\"\r\n                          placeholder={t(translations.Remarks)}\r\n                          disabled={\r\n                            formik.isSubmitting ||\r\n                            (isEdit && !editable) ||\r\n                            readonly\r\n                          }\r\n                          fullWidth={true}\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {isEdit &&\r\n                      !!reservationSettings &&\r\n                      (!useSidePanel ||\r\n                        (useSidePanel && sidePanelExpanded && !isCover)) && (\r\n                        <FormFieldsSection>\r\n                          <ReadOnlyDetails details={reservationSettings} />\r\n                        </FormFieldsSection>\r\n                      )}\r\n                  </FormRightSection>\r\n                </StyledForm>\r\n              </PrintPDFSection>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport { initEquipmentsData } from 'app/components/pickers/MultiSelectPickers/EquipmentReservationPicker';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport {\r\n  IMandatoryEquipmentsDto,\r\n  IReservationEquipmentDto,\r\n  PrerequisitsResult,\r\n  ReservationDetailsState,\r\n  ReservationSettingsState,\r\n  TrainingSessionResult,\r\n} from '../slice/types';\r\nimport { IndexNode } from 'app/components/Forms/FormsLayout/StyledForm';\r\nimport { Box, Link as MuiLink } from '@material-ui/core';\r\nimport { Caption } from 'app/components/Typography';\r\nimport { Body } from 'app/components/Typography';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { BulletedList } from 'app/components/BasicList/StyledList';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport const staffUserChangeHandler = (\r\n  values: ReservationDetailsState,\r\n  isEdit: boolean,\r\n  setValue: (\r\n    field: string,\r\n    value: any,\r\n    shouldValidate?: boolean | undefined,\r\n  ) => void,\r\n  equipmentsChangeHandler: (\r\n    values: ReservationDetailsState,\r\n    changeStatus?: boolean | undefined,\r\n    selectedEqs?: IReservationEquipmentDto[],\r\n  ) => void,\r\n  extendStaffMandatoryEquipment: (\r\n    staff: IReservationEquipmentDto | null,\r\n  ) => void,\r\n  extendMandatoryEquipments: (mandatories: IMandatoryEquipmentsDto[]) => void,\r\n  initStaffReservation: (\r\n    staffEquipmentId: number,\r\n    values: ReservationDetailsState,\r\n  ) => void,\r\n  setStaffEquipmentRestricted: (staffUser: string) => void,\r\n  reservationSettings?: ReservationSettingsState,\r\n) => {\r\n  let staffEquipmentId =\r\n    values.StaffUser !== null\r\n      ? (values.StaffUser as IUserFilterDto).StaffEquipmentId\r\n      : null;\r\n  if (staffEquipmentId !== null) {\r\n    let allEquipments = [\r\n      ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n      ...(((reservationSettings?.MandatoriesEquipments || []) as Entity<\r\n        number\r\n      >[]) as IReservationEquipmentDto[]),\r\n      ...((values.OptionalsEquipments.filter(f => f.checked === true) as Entity<\r\n        number\r\n      >[]) as IReservationEquipmentDto[]),\r\n    ];\r\n    if (!allEquipments.some(f => f.Id === staffEquipmentId)) {\r\n      if (isEdit) {\r\n        (async () => {\r\n          try {\r\n            let setEquipments: Entity<number>[] = [];\r\n            let data = await initEquipmentsData(\r\n              staffEquipmentId.toString(),\r\n              'AccServices,OfflineServices,StaffUserSelection,MandatoriesEquipments,OptionalsEquipments',\r\n            );\r\n            if (data.length > 0) {\r\n              let staffEquipment = data[0];\r\n              if (\r\n                !!reservationSettings &&\r\n                reservationSettings.StaffMandatoryEquipment !== null\r\n              ) {\r\n                setEquipments = [\r\n                  ...values.EquipmentsData.filter(\r\n                    f =>\r\n                      f.Id !== reservationSettings.StaffMandatoryEquipment?.Id,\r\n                  ),\r\n                  Object.assign({}, staffEquipment, {\r\n                    noremoved: true,\r\n                    titleInfo: `Mandatory instrument for ${values.StaffUser?.Name}`,\r\n                  }),\r\n                ];\r\n              } else {\r\n                setEquipments = [\r\n                  ...values.EquipmentsData,\r\n                  Object.assign({}, staffEquipment, {\r\n                    noremoved: true,\r\n                    titleInfo: `Mandatory instrument for ${values.StaffUser?.Name}`,\r\n                  }),\r\n                ];\r\n              }\r\n              setValue('EquipmentsData', setEquipments);\r\n              extendStaffMandatoryEquipment(\r\n                staffEquipment as IReservationEquipmentDto,\r\n              );\r\n              equipmentsChangeHandler(\r\n                Object.assign({}, values, {\r\n                  EquipmentsData: setEquipments,\r\n                }),\r\n                true,\r\n              );\r\n            } else {\r\n              setStaffEquipmentRestricted(values.StaffUser?.Name ?? '');\r\n              setValue('StaffUser', null);\r\n            }\r\n          } catch {}\r\n        })();\r\n      } else {\r\n        (async () => {\r\n          try {\r\n            let notRestricted = await ReservationsApi.userCanBookEquipment(\r\n              staffEquipmentId,\r\n            );\r\n\r\n            if (notRestricted.value === true) {\r\n              initStaffReservation(staffEquipmentId, values);\r\n            } else {\r\n              setStaffEquipmentRestricted(values.StaffUser?.Name ?? '');\r\n              setValue('StaffUser', null);\r\n            }\r\n          } catch {}\r\n        })();\r\n      }\r\n    }\r\n  } else {\r\n    if (\r\n      !!reservationSettings &&\r\n      reservationSettings.StaffMandatoryEquipment !== null\r\n    ) {\r\n      if (isEdit) {\r\n        let setEquipments = values.EquipmentsData.filter(\r\n          f => f.Id !== reservationSettings.StaffMandatoryEquipment?.Id,\r\n        );\r\n        setValue('EquipmentsData', setEquipments);\r\n        equipmentsChangeHandler(\r\n          Object.assign({}, values, { EquipmentsData: setEquipments }),\r\n          true,\r\n        );\r\n      } else {\r\n        if (reservationSettings.MandatoriesEquipments.length > 0) {\r\n          let mand = reservationSettings.MandatoriesEquipments.filter(\r\n            f => f.Id !== reservationSettings.StaffMandatoryEquipment?.Id,\r\n          );\r\n          let alleqs = [\r\n            ...(values.EquipmentsData as IReservationEquipmentDto[]),\r\n            ...((mand as Entity<number>[]) as IReservationEquipmentDto[]),\r\n            ...((values.OptionalsEquipments.filter(\r\n              f => f.checked === true,\r\n            ) as Entity<number>[]) as IReservationEquipmentDto[]),\r\n          ];\r\n          extendMandatoryEquipments(mand);\r\n          equipmentsChangeHandler(values, true, alleqs);\r\n        }\r\n      }\r\n      extendStaffMandatoryEquipment(null);\r\n    }\r\n  }\r\n};\r\nexport const prerquisitErrorsHandler = (\r\n  data: PrerequisitsResult,\r\n  equipments: Entity<number>[],\r\n  setPrerequisitErrors: (items: IndexNode[]) => void,\r\n  onEquipmentClicked?: (equipment: Entity<number>) => void,\r\n  onRestrictionsClick?: (equipment: Entity<number>) => void,\r\n) => {\r\n  setPrerequisitErrors(\r\n    data.PrerequisiteTrainings.length > 0\r\n      ? [\r\n          {\r\n            index: 'prerequisiteIndex',\r\n            node: (\r\n              <Box\r\n                style={{\r\n                  display: 'flex',\r\n                  flexDirection: 'column',\r\n                  gap: 8,\r\n                }}\r\n              >\r\n                <Caption>{data.ErrorMessage}</Caption>\r\n                {data.PrerequisiteTrainings.map(pre => (\r\n                  <Caption key={pre.Id}>\r\n                    {' '}\r\n                    <MuiLink\r\n                      style={{ cursor: 'pointer' }}\r\n                      onClick={() =>\r\n                        !!onEquipmentClicked && onEquipmentClicked(pre)\r\n                      }\r\n                    >\r\n                      {pre.Name}\r\n                    </MuiLink>\r\n                  </Caption>\r\n                ))}\r\n                {equipments.length === 1 ? (\r\n                  <Caption>\r\n                    <MuiLink\r\n                      style={{ cursor: 'pointer', marginLeft: 'auto' }}\r\n                      onClick={() =>\r\n                        !!onRestrictionsClick &&\r\n                        onRestrictionsClick(equipments[0])\r\n                      }\r\n                    >\r\n                      {i18next.t(translations.AllRestrictions)}\r\n                    </MuiLink>\r\n                  </Caption>\r\n                ) : (\r\n                  <React.Fragment>\r\n                    <Body size=\"small\" bold={true}>\r\n                      {i18next.t(translations.AllRestrictions)}\r\n                    </Body>\r\n                    <BulletedList\r\n                      items={equipments.map(per => {\r\n                        return {\r\n                          key: per.Id,\r\n                          node: (\r\n                            <Caption>\r\n                              <MuiLink\r\n                                style={{ cursor: 'pointer' }}\r\n                                onClick={() =>\r\n                                  !!onRestrictionsClick &&\r\n                                  onRestrictionsClick(per)\r\n                                }\r\n                              >\r\n                                {per.Name}\r\n                              </MuiLink>\r\n                            </Caption>\r\n                          ),\r\n                        };\r\n                      })}\r\n                    />\r\n                  </React.Fragment>\r\n                )}\r\n              </Box>\r\n            ),\r\n          },\r\n        ]\r\n      : [\r\n          {\r\n            index: 'pErrorIndex',\r\n            node: <Caption>{data.ErrorMessage}</Caption>,\r\n          },\r\n        ],\r\n  );\r\n};\r\nexport const trainingSessionChangeHandler = (\r\n  data: TrainingSessionResult | null,\r\n  setMessage: (items: IndexNode[]) => void,\r\n  initTrainingSession: (\r\n    data: TrainingSessionResult,\r\n    values: ReservationDetailsState,\r\n  ) => void,\r\n  values: ReservationDetailsState,\r\n) => {\r\n  if (data !== null && data.HasTrainingSession === true) {\r\n    setMessage([\r\n      {\r\n        index: 'trainingSessionWarning',\r\n        node: (\r\n          <Box\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {(i18next.t(translations.warn_TrainingSessionsTimeSlot) as string)\r\n                .replace('{0}', dateUtils.shortDateTimeFormat(data.Start) ?? '')\r\n                .replace('{1}', dateUtils.shortDateTimeFormat(data.End) ?? '')}\r\n            </Body>\r\n            <Button\r\n              variant=\"main\"\r\n              size=\"small\"\r\n              onClick={e => initTrainingSession(data, values)}\r\n            >\r\n              {i18next.t(translations.SignUp) as string}\r\n            </Button>\r\n          </Box>\r\n        ),\r\n      },\r\n    ]);\r\n  }\r\n};\r\nexport const durationErrorsHandler = (\r\n  data: string[],\r\n  equipments: Entity<number>[],\r\n  setDurationErrors: (items: IndexNode[]) => void,\r\n  onRestrictionsClick?: (equipment: Entity<number>) => void,\r\n) => {\r\n  setDurationErrors([\r\n    {\r\n      index: 'durationErrors',\r\n      node: (\r\n        <Box\r\n          style={{\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            gap: 8,\r\n          }}\r\n        >\r\n          {data.map(dur => (\r\n            <Caption key={dur.slice(0, 3 + dur.length)}>{dur}</Caption>\r\n          ))}\r\n          {equipments.length === 1 ? (\r\n            <Caption>\r\n              <MuiLink\r\n                style={{ cursor: 'pointer', marginLeft: 'auto' }}\r\n                onClick={() =>\r\n                  !!onRestrictionsClick && onRestrictionsClick(equipments[0])\r\n                }\r\n              >\r\n                {i18next.t(translations.AllRestrictions)}\r\n              </MuiLink>\r\n            </Caption>\r\n          ) : (\r\n            <React.Fragment>\r\n              <Body size=\"small\" bold={true}>\r\n                {i18next.t(translations.AllRestrictions)}\r\n              </Body>\r\n              <BulletedList\r\n                items={equipments.map(per => {\r\n                  return {\r\n                    key: per.Id,\r\n                    node: (\r\n                      <Caption>\r\n                        <MuiLink\r\n                          style={{ cursor: 'pointer' }}\r\n                          onClick={() =>\r\n                            !!onRestrictionsClick && onRestrictionsClick(per)\r\n                          }\r\n                        >\r\n                          {per.Name}\r\n                        </MuiLink>\r\n                      </Caption>\r\n                    ),\r\n                  };\r\n                })}\r\n              />\r\n            </React.Fragment>\r\n          )}\r\n        </Box>\r\n      ),\r\n    },\r\n  ]);\r\n};\r\nexport const otheMessagesHandler = (\r\n  data: string[],\r\n  type: 'warning' | 'error' | 'info' | 'success',\r\n  setMessage: (items: IndexNode[]) => void,\r\n) => {\r\n  let index = `other_${type}_${data.length}`;\r\n  let message = [\r\n    {\r\n      index: index,\r\n      node: (\r\n        <Box\r\n          style={{\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            gap: 8,\r\n          }}\r\n        >\r\n          {data.map(msg => (\r\n            <Caption key={`ind_${msg.slice(0, 3)}_${msg.length}`}>\r\n              {msg}\r\n            </Caption>\r\n          ))}\r\n        </Box>\r\n      ),\r\n    },\r\n  ];\r\n  setMessage(message);\r\n};\r\nexport const customFormErrorsHandler = (\r\n  data: string[],\r\n  setMessage: (items: IndexNode[]) => void,\r\n) => {\r\n  setMessage([\r\n    {\r\n      index: 'cutFErrors',\r\n      node: (\r\n        <Box\r\n          style={{\r\n            display: 'flex',\r\n            flexDirection: 'column',\r\n            gap: 8,\r\n          }}\r\n        >\r\n          {data.map(dur => (\r\n            <Caption key={`ind_${dur.slice(0, 3)}_${dur.length}`}>\r\n              {dur}\r\n            </Caption>\r\n          ))}\r\n        </Box>\r\n      ),\r\n    },\r\n  ]);\r\n};\r\nexport const permissionsErrorsHandler = (\r\n  data: string[],\r\n  equipments: Entity<number>[],\r\n  setMessage: (items: IndexNode[]) => void,\r\n  onRestrictionsClick?: (equipment: Entity<number>) => void,\r\n) => {\r\n  setMessage([\r\n    {\r\n      index: 'permIndex',\r\n      node: (\r\n        <Box style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>\r\n          {data.map((t, index) => (\r\n            <Caption key={`index_${t.slice(0, 3)}_${t.length}`}>{t}</Caption>\r\n          ))}\r\n          {equipments.length === 1 ? (\r\n            <Caption>\r\n              <MuiLink\r\n                style={{ cursor: 'pointer', marginLeft: 'auto' }}\r\n                onClick={() =>\r\n                  !!onRestrictionsClick && onRestrictionsClick(equipments[0])\r\n                }\r\n              >\r\n                {i18next.t(translations.AllRestrictions)}\r\n              </MuiLink>\r\n            </Caption>\r\n          ) : (\r\n            <React.Fragment>\r\n              <Body size=\"small\" bold={true}>\r\n                {i18next.t(translations.AllRestrictions)}\r\n              </Body>\r\n              <BulletedList\r\n                items={equipments.map(per => {\r\n                  return {\r\n                    key: per.Id,\r\n                    node: (\r\n                      <Caption>\r\n                        <MuiLink\r\n                          style={{ cursor: 'pointer' }}\r\n                          onClick={() =>\r\n                            !!onRestrictionsClick && onRestrictionsClick(per)\r\n                          }\r\n                        >\r\n                          {per.Name}\r\n                        </MuiLink>\r\n                      </Caption>\r\n                    ),\r\n                  };\r\n                })}\r\n              />\r\n            </React.Fragment>\r\n          )}\r\n        </Box>\r\n      ),\r\n    },\r\n  ]);\r\n};\r\n","import { FormikProps } from 'formik';\r\nimport { ReservationDetailsState, ServiceSettingsState } from '../slice/types';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport function getReservationCollaboratorsFilter(\r\n  equipmentSettings: ServiceSettingsState | undefined,\r\n  formik: FormikProps<ReservationDetailsState>,\r\n) {\r\n  return [\r\n    equipmentSettings?.BudgetVisible === true\r\n      ? new Condition<IUserFilterDto>(\r\n          'Budgets',\r\n          ODataOperators.Any,\r\n          formik.values.Budget?.Id ?? 0,\r\n        )\r\n      : undefined,\r\n    formik.values.BookedBy?.Id !== undefined\r\n      ? new Condition<IUserFilterDto>(\r\n          'Id',\r\n          ODataOperators.NotEquals,\r\n          formik.values.BookedBy?.Id,\r\n        )\r\n      : undefined,\r\n  ].filter(f => f !== undefined) as Condition<IUserFilterDto>[];\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { UserTrainingReservationData } from '../slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { DialogActionsRenderer } from 'app/components/BasicDialog/DialogActionsRender';\r\nimport { useDispatch } from 'react-redux';\r\nimport { TrainingDetailsProps } from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { ITrainingReservations } from 'app/pages/ReservationHistoryPage/ITrainingReservations';\r\nimport { ReservationsApi } from 'api/ReservationsApi';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { AxiosError } from 'axios';\r\nimport i18next from 'i18next';\r\n\r\nexport interface ApproveTrainingRecordsProps {\r\n  show: boolean;\r\n  data: UserTrainingReservationData;\r\n  handleApproveOnce: () => void;\r\n  handleEditAssisted: (p: TrainingDetailsProps, reset: boolean) => void;\r\n}\r\nexport function ApproveTrainingRecords(props: ApproveTrainingRecordsProps) {\r\n  const { show, data, handleApproveOnce, handleEditAssisted } = props;\r\n  const dispatch = useDispatch();\r\n  const history = useHistory();\r\n  const { actions: appSetActions } = useAppSettingsSlice();\r\n  const { t } = useTranslation();\r\n  const existingTrainings = React.useMemo(() => {\r\n    return data.Equipments.filter(f => f.RequiresAdminApproval === true);\r\n  }, [data.Equipments]);\r\n  const servicesWithoutTraining = React.useMemo(() => {\r\n    return data.Equipments.filter(f => f.TrainingRecordId === null);\r\n  }, [data.Equipments]);\r\n\r\n  //BKT-9144 Customer feedback UiO: Assisted: Toggle “DO NOT SHOW POP UP FOR APPROVING THE USER FOR GOOD/ CREATING TRAINING RECORD” to ON does not hide the pop up.\r\n  //setting - DO NOT SHOW POP UP FOR APPROVING THE USER FOR GOOD/ CREATING TRAINING RECORD\r\n  const showPopupAccordingToSetting = React.useMemo(() => {\r\n    return !data.Equipments.every(f => f.NotShowPopup === true);\r\n  }, [data.Equipments]);\r\n\r\n  const showPopup = React.useMemo(() => {\r\n    return (\r\n      (!data.Equipments.every(f => f.NotShowPopup === true) &&\r\n        existingTrainings.length > 0) ||\r\n      servicesWithoutTraining.length > 0\r\n    );\r\n  }, [\r\n    data.Equipments,\r\n    existingTrainings.length,\r\n    servicesWithoutTraining.length,\r\n  ]);\r\n\r\n  const handleEditClick = React.useCallback(() => {\r\n    if (existingTrainings.length === 1) {\r\n      handleEditAssisted(\r\n        {\r\n          id: (existingTrainings[0].TrainingRecordId ?? 0).toString(),\r\n          equId: undefined,\r\n          equIds: undefined,\r\n          fatherId: undefined,\r\n          rid: undefined,\r\n          date: undefined,\r\n          user: undefined,\r\n          useSidePanel: true,\r\n        } as TrainingDetailsProps,\r\n        true,\r\n      );\r\n    } else {\r\n      history.push(\r\n        `/History?un=${data.UserName}&st=${dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(data.StartTime),\r\n        )}&et=${dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(data.EndTime),\r\n        )}`,\r\n      );\r\n    }\r\n  }, [\r\n    data.EndTime,\r\n    data.StartTime,\r\n    data.UserName,\r\n    existingTrainings,\r\n    handleEditAssisted,\r\n    history,\r\n  ]);\r\n  const handleNweCreateClick = React.useCallback(() => {\r\n    handleEditAssisted(\r\n      {\r\n        id: undefined,\r\n        equId: undefined,\r\n        equIds: data.Equipments.map(f => f.EquipmentId).join(','),\r\n        fatherId: data.FatherId !== null ? data.FatherId.toString() : undefined,\r\n        rid:\r\n          data.FatherId !== null\r\n            ? undefined\r\n            : data.ReservationId !== null\r\n            ? data.ReservationId.toString()\r\n            : undefined,\r\n        date: dateUtils.formatISO(dateUtils.dateOrStringToDate(data.StartTime)),\r\n        user: data.UserName,\r\n        useSidePanel: true,\r\n      } as TrainingDetailsProps,\r\n      true,\r\n    );\r\n  }, [\r\n    handleEditAssisted,\r\n    data.Equipments,\r\n    data.FatherId,\r\n    data.ReservationId,\r\n    data.StartTime,\r\n    data.UserName,\r\n  ]);\r\n  const handleCreateTrainings = React.useCallback(() => {\r\n    const postData = servicesWithoutTraining.map(item => {\r\n      return {\r\n        BookedBy: data.UserName,\r\n        ReservationId: data.ReservationId,\r\n        EquipmentId: item.EquipmentId,\r\n        StartTime: data.StartTime,\r\n        TrainingLevelId: item.TrainingRecordId,\r\n      };\r\n    }) as ITrainingReservations[];\r\n    (async () => {\r\n      try {\r\n        let trdata = await ReservationsApi.createTraining(postData);\r\n        if (trdata.length > 0) {\r\n          let success = t(translations.TrainingsCreatedSuccessfully) as string;\r\n          dispatch(\r\n            appSetActions.addNotification({\r\n              variant: 'success',\r\n              message: success.replace('{0}', trdata.length),\r\n              key: 'training-created',\r\n            }),\r\n          );\r\n        } else {\r\n          let info = t(translations.TrainingsAlreadyExist) as string;\r\n          dispatch(\r\n            appSetActions.addNotification({\r\n              variant: 'warning',\r\n              message: info,\r\n              key: 'training-warning',\r\n            }),\r\n          );\r\n        }\r\n        handleApproveOnce();\r\n      } catch (error) {\r\n        const message =\r\n          (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n          ((error as AxiosError)?.response?.status === 403\r\n            ? i18next.t(translations.Forbidden)\r\n            : undefined) ??\r\n          i18next.t(translations.errormessage);\r\n        dispatch(\r\n          appSetActions.addNotification({\r\n            variant: 'error',\r\n            message: message,\r\n            key: 'training-error',\r\n          }),\r\n        );\r\n      }\r\n    })();\r\n  }, [\r\n    appSetActions,\r\n    data.ReservationId,\r\n    data.StartTime,\r\n    data.UserName,\r\n    dispatch,\r\n    handleApproveOnce,\r\n    servicesWithoutTraining,\r\n    t,\r\n  ]);\r\n  const actions: DialogActionsRenderer[] = React.useMemo(() => {\r\n    let buttons: DialogActionsRenderer[] = [];\r\n    buttons.push(() => (\r\n      <ActionButton\r\n        key=\"approveOnce\"\r\n        text={t(translations.ApproveOnce)}\r\n        variant=\"main\"\r\n        onClick={() => handleApproveOnce()}\r\n      />\r\n    ));\r\n    if (existingTrainings.length > 0) {\r\n      buttons.push(() => (\r\n        <ActionButton\r\n          key=\"editTraining\"\r\n          text={(t(translations.menu_EditUserTraining) as string).replace(\r\n            '{0}',\r\n            '' + existingTrainings[0].TrainingRecordId ?? 0,\r\n          )}\r\n          variant=\"white\"\r\n          onClick={() => handleEditClick()}\r\n        />\r\n      ));\r\n    }\r\n    buttons.push(() => (\r\n      <ActionButton\r\n        key=\"createNewTraining\"\r\n        text={t(translations.CreateDetailedTraining)}\r\n        variant=\"main\"\r\n        onClick={() => handleNweCreateClick()}\r\n      />\r\n    ));\r\n    if (servicesWithoutTraining.length > 0) {\r\n      buttons.push(() => (\r\n        <ActionButton\r\n          key=\"createTraining\"\r\n          text={t(translations.ApproveForGood)}\r\n          variant=\"main\"\r\n          onClick={() => handleCreateTrainings()}\r\n        />\r\n      ));\r\n    }\r\n    return buttons;\r\n  }, [\r\n    existingTrainings,\r\n    handleApproveOnce,\r\n    handleCreateTrainings,\r\n    handleEditClick,\r\n    handleNweCreateClick,\r\n    servicesWithoutTraining.length,\r\n    t,\r\n  ]);\r\n  return (\r\n    <DialogConfirm\r\n      isOpen={show && showPopupAccordingToSetting && showPopup}\r\n      title={t(translations.AssistedReservationApprovalOptions)}\r\n      body={\r\n        existingTrainings.length > 0\r\n          ? t(translations.This_user_already_has_a_valid_training)\r\n          : t(translations.CreateNewTrainingRecord_YesNo)\r\n      }\r\n      maxWidth=\"md\"\r\n      actions={actions}\r\n    />\r\n  );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n  ServicesFilter,\r\n  UserPicker,\r\n} from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { Caption } from 'app/components/Typography';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\n\r\nexport interface TransferReservationProps {\r\n  show: boolean;\r\n  handleTransfer: (value: IUserFilterDto) => void;\r\n  transferAllowedToGroup: boolean;\r\n  services: IServiceTypeFilterDto[];\r\n  adGroup?: string;\r\n  budgetExpirementModuleEnabled?: boolean;\r\n  trnsferSubmitted?: boolean;\r\n  onClose: () => void;\r\n  user?: AuthenticatedUser;\r\n}\r\n\r\nexport function TransferReservation(props: TransferReservationProps) {\r\n  const {\r\n    show,\r\n    handleTransfer,\r\n    transferAllowedToGroup,\r\n    services,\r\n    adGroup,\r\n    budgetExpirementModuleEnabled,\r\n    trnsferSubmitted,\r\n    user,\r\n    onClose,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const [\r\n    trasferToUser,\r\n    setTranferToUser,\r\n  ] = React.useState<IUserFilterDto | null>(null);\r\n\r\n  return (\r\n    <DialogConfirm\r\n      isOpen={show}\r\n      title={t(translations.TransferReservation)}\r\n      processing={trnsferSubmitted}\r\n      confirmButtonLabel={t(translations.Transfer)}\r\n      body={\r\n        <React.Fragment>\r\n          <FormFieldsSection\r\n            titleSection={\r\n              <Caption>\r\n                {t(translations.TransferReservation_info) as string}\r\n              </Caption>\r\n            }\r\n          >\r\n            <FormRow fullRow={true}>\r\n              <UserPicker\r\n                name=\"User\"\r\n                variant=\"filled\"\r\n                urlType=\"full\"\r\n                info={t(translations.ReservationUser_Desc)}\r\n                label={t(translations.TransferToUser)}\r\n                disabled={trnsferSubmitted}\r\n                predicates={[\r\n                  ...ServicesFilter(\r\n                    services,\r\n                    budgetExpirementModuleEnabled || false,\r\n                    transferAllowedToGroup ? adGroup : undefined,\r\n                    undefined,\r\n                    undefined,\r\n                  ),\r\n                  `(Id ne ${quoteODataValue(user?.Id || '')})`,\r\n                ]}\r\n                onChange={value => setTranferToUser(value)}\r\n                value={trasferToUser}\r\n                error={trasferToUser === null || trasferToUser === undefined}\r\n                helperText={\r\n                  trasferToUser === null || trasferToUser === undefined\r\n                    ? (t(translations.err_UserFieldRequired) as string)\r\n                    : undefined\r\n                }\r\n                fullWidth\r\n                selectArray={['Id', 'Name', 'UserGroups']}\r\n              />\r\n            </FormRow>\r\n          </FormFieldsSection>\r\n        </React.Fragment>\r\n      }\r\n      onConfirm={ev => {\r\n        if (trasferToUser !== null) {\r\n          handleTransfer(trasferToUser);\r\n        }\r\n      }}\r\n      onCancel={() => onClose()}\r\n      onClose={() => onClose()}\r\n      maxWidth=\"sm\"\r\n    />\r\n  );\r\n}\r\n","import { IModificationsDto } from 'api/odata/generated/entities/IModificationsDto';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { UnconfigurableTable } from 'app/components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from './Filter';\r\n\r\nexport interface ReservationModificationsProps {\r\n  resId: number;\r\n  open: boolean;\r\n  setOpen: (open: boolean) => void;\r\n}\r\nexport const ReservationModifications = ({\r\n  resId,\r\n  open,\r\n  setOpen,\r\n}: ReservationModificationsProps) => {\r\n  const { t } = useTranslation();\r\n  const columns = useMemo(() => getColumns(t), [t]);\r\n  const url = `/api/odata/v4/ModificationHistory/Reservations`;\r\n  return (\r\n    <DialogConfirm\r\n      isOpen={open}\r\n      confirmButtonLabel={t(translations.Done)}\r\n      body={\r\n        <React.Fragment>\r\n          <TTable\r\n            api={{ path: url, search: { key: resId } }}\r\n            screenName={t(translations.ModificationsHistory)}\r\n            columns={columns}\r\n            serviceGroups={[]}\r\n            useExport\r\n            additionalColumns={['UserName', 'Id']}\r\n            exportNotConfigurable={true}\r\n            searchColumns={[\r\n              'cast(Id,Edm.String)',\r\n              'Field',\r\n              'OldValue',\r\n              'UserName',\r\n              'NewValue',\r\n              'UserDisplayName',\r\n            ]}\r\n          />\r\n        </React.Fragment>\r\n      }\r\n      onCancel={() => setOpen(false)}\r\n      maxWidth=\"md\"\r\n    />\r\n  );\r\n};\r\n\r\nconst TTable = filterHandler<IModificationsDto, {}>(\r\n  UnconfigurableTable,\r\n  GetFilters,\r\n  {\r\n    isSidePanel: true,\r\n  },\r\n);\r\n","import { IModificationsDto } from 'api/odata/generated/entities/IModificationsDto';\r\nimport DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n  const res: Column<IModificationsDto>[] = [\r\n    // {\r\n    //   accessor: 'Id',\r\n    //   Header: t(translations.HashSymbol) as string,\r\n    // },\r\n    {\r\n      accessor: 'Field',\r\n      Header: t(translations.Field) as string,\r\n    },\r\n    {\r\n      accessor: 'OldValue',\r\n      Header: t(translations.OldValue) as string,\r\n    },\r\n    {\r\n      accessor: 'NewValue',\r\n      Header: t(translations.NewValue) as string,\r\n    },\r\n    {\r\n      accessor: 'UserDisplayName',\r\n      Header: t(translations.User) as string,\r\n    },\r\n    {\r\n      accessor: 'Date',\r\n      Header: t(translations.Date) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { IModificationsDto } from 'api/odata/generated/entities/IModificationsDto';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport {\r\n  getDefaultFilterDatePeriod,\r\n  presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\n\r\nexport const GetFilters: GetPageFilters<IModificationsDto> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const res: IFilterSettings<IModificationsDto>[] = [\r\n    {\r\n      fieldName: 'Date',\r\n      displayName: t(translations.Period),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      urlKey: 'period',\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { LinearProgress, useTheme } from '@material-ui/core';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { Body, ButtonLabel } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { PricingState } from '../../slice/types';\r\n\r\nexport interface CalculatePricingProps {\r\n  open: boolean;\r\n  onClose: () => void;\r\n  title: React.ReactNode;\r\n  edit: boolean;\r\n  credit?: PricingState;\r\n  creditProcessing?: boolean;\r\n  creditCompleted?: boolean;\r\n}\r\nconst CreditContainer = styled('div')(({ theme }) => ({\r\n  display: 'flex',\r\n  flexDirection: 'column',\r\n  paddingTop: '16px',\r\n  gap: 32,\r\n  width: '100%',\r\n  '& .creditItem': {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    gap: 16,\r\n    width: '100%',\r\n  },\r\n}));\r\nexport function CalculatePricing(props: CalculatePricingProps) {\r\n  const {\r\n    open,\r\n    onClose,\r\n    credit,\r\n    creditProcessing,\r\n    title,\r\n    creditCompleted,\r\n    edit,\r\n  } = props;\r\n  const theme = useTheme();\r\n  const { t } = useTranslation();\r\n  return (\r\n    <DialogConfirm\r\n      isOpen={open}\r\n      title={title}\r\n      onClose={onClose}\r\n      onConfirm={() => onClose()}\r\n      body={\r\n        creditProcessing && !creditCompleted ? (\r\n          <div style={{ width: '100%' }}>\r\n            <LinearProgress variant=\"query\" color=\"primary\" />\r\n          </div>\r\n        ) : (\r\n          <CreditContainer theme={theme}>\r\n            <div className=\"creditItem\">\r\n              <ButtonLabel size=\"small\">\r\n                {t(translations.Pricing_EstimatedCost)}\r\n              </ButtonLabel>\r\n              <Body size=\"small\">\r\n                {(t(\r\n                  edit\r\n                    ? translations.PricingConfirmationLabelEditText1\r\n                    : translations.PricingConfirmationLabelText1,\r\n                ) as string).replace('{0}', (credit?.credit || 0).toFixed(2))}\r\n              </Body>\r\n            </div>\r\n            {!!credit?.balance && credit?.balance !== null && (\r\n              <div className=\"creditItem\">\r\n                <ButtonLabel size=\"small\">\r\n                  {t(translations.Pricing_Balance)}\r\n                </ButtonLabel>\r\n                <Body size=\"small\">\r\n                  {(t(translations.Pricing_BalanceResult) as string).replace(\r\n                    '{0}',\r\n                    (credit?.balance || 0).toFixed(2),\r\n                  )}\r\n                </Body>\r\n              </div>\r\n            )}\r\n          </CreditContainer>\r\n        )\r\n      }\r\n      maxWidth={'sm'}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * ReservationDetails\r\n *\r\n */\r\nimport React from 'react';\r\nimport { Box } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n  getSingleReservationStatus,\r\n  IReservationEquipmentDto,\r\n  RecurringReservationUpdateOptions,\r\n  ReservationDetailsState,\r\n  ReservationGlobalState,\r\n  ReservationQueryStringParameters,\r\n  ReservationStatus,\r\n  TransferToReservation,\r\n} from './slice/types';\r\nimport { useReservationSlice } from './slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport {\r\n  selectAsyncChangeLoading,\r\n  selectByApprovalErrors,\r\n  selectCloneReservations,\r\n  selectConfirmAssistedReservations,\r\n  selectCredit,\r\n  selectCreditCompleted,\r\n  selectCreditProcessing,\r\n  selectEquipmentChangeCompleted,\r\n  selectEquipmentsSettings,\r\n  selectIsCreditSubmited,\r\n  selectIsEdit,\r\n  selectProcessing,\r\n  selectReservation,\r\n  selectReservationCompleted,\r\n  selectReservationHasError,\r\n  selectReservationNotFound,\r\n  selectReservationProcessing,\r\n  selectReservationSettings,\r\n  selectSavedOfflineServices,\r\n  selectTransferProcessing,\r\n  selectTransferReservation,\r\n  selectTransferStepCompleted,\r\n  selectTransferToUser,\r\n  selectTransferWaitingApproval,\r\n  selectUserCanRequestApproval,\r\n  selectUserTrainingData,\r\n} from './slice/selectors';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { ReservationForm } from './ReservationForm';\r\nimport { selectRepetitiveData } from 'app/components/Forms/FormRepetitive/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport useGlobalSettingsHook from './components/useGlobalSettingsHook';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport {\r\n  ApproveReservationButton,\r\n  CancelReservationButton,\r\n  CreateTrainingButton,\r\n  SaveForLaterButton,\r\n  SaveFormButton,\r\n  TransferButton,\r\n} from './components/ReservationActions';\r\nimport { ApproveTrainingRecords } from './components/ApproveTrainingRecords';\r\nimport { TrainingDetailsProps } from 'app/pages/UserTrainings/TrainingDetailsPage/Details';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { FormikProps } from 'formik';\r\nimport { TransferReservation } from './components/TransferReservation';\r\nimport { ReservationModifications } from './components/Modifications';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { Body, H3 } from 'app/components/Typography';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n  SwitchActionsProps,\r\n  SwitchTarget,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/SwitchActions';\r\nimport { Entity } from 'types/common';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { ErrorServices } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { CalculatePricing } from './components/CalculatePricing';\r\nimport { Alert } from '@material-ui/lab';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { toLocationDescriptor } from 'app/components/BasicLinks/Link';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { PrintToPDF } from 'app/components/PrintToPDF';\r\nimport { usePrintPDFSlice } from 'app/components/PrintToPDF/slice';\r\nimport { getPrintPDFDefaultSections } from './components/utils';\r\n\r\nexport interface ReservationDetailsProps\r\n  extends SidePanelContentProps,\r\n    CoverProps {\r\n  queryParams: ReservationQueryStringParameters;\r\n  useSwitchButtons?: boolean;\r\n  onCloseReservation?: () => void;\r\n}\r\n\r\nexport const ReservationDetails = React.memo(function ReservationDetails(\r\n  props: ReservationDetailsProps,\r\n) {\r\n  const {\r\n    queryParams,\r\n    useSidePanel,\r\n    useSwitchButtons,\r\n    closeCover,\r\n    isCover,\r\n    onCloseReservation,\r\n  } = props;\r\n\r\n  const dispatch = useDispatch();\r\n  const { t } = useTranslation();\r\n  const { actions } = useReservationSlice();\r\n\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const { actions: printActions } = usePrintPDFSlice();\r\n  const isMobile = DetectIsMobile();\r\n\r\n  /// Refs ///\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const repetitiveFormRef = React.useRef<any>(null);\r\n  const customFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<\r\n    ReservationDetailsState\r\n  > | null>(null);\r\n\r\n  /// selectors ///\r\n  const processing = useSelector(selectProcessing);\r\n  const reservation = useSelector(selectReservation);\r\n  const reservationId = reservation.data?.Id ?? tryParseInt(queryParams.id);\r\n  const reservationSettings = useSelector(selectReservationSettings);\r\n  const equipmentSettings = useSelector(selectEquipmentsSettings);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const repetitiveValues = useSelector(selectRepetitiveData);\r\n  const actionCompleted = useSelector(selectReservationCompleted);\r\n  const hasError = useSelector(selectReservationHasError);\r\n  const reservationProcessing = useSelector(selectReservationProcessing);\r\n  const confirmAssisted = useSelector(selectConfirmAssistedReservations);\r\n  const assistedTrainingData = useSelector(selectUserTrainingData);\r\n  const equipmentChangeCompleted = useSelector(selectEquipmentChangeCompleted);\r\n  const transferProcessing = useSelector(selectTransferProcessing);\r\n  const transferStepWaiting = useSelector(selectTransferWaitingApproval);\r\n  const transferUser = useSelector(selectTransferToUser);\r\n  const transferredForId = useSelector(selectTransferReservation);\r\n  const transferStepCompleted = useSelector(selectTransferStepCompleted);\r\n  const savedOfflineServices = useSelector(selectSavedOfflineServices);\r\n  const creditProcessing = useSelector(selectCreditProcessing);\r\n  const credit = useSelector(selectCredit);\r\n  const creditCompleted = useSelector(selectCreditCompleted);\r\n  const isCloned = useSelector(selectCloneReservations);\r\n  const edit = useSelector(selectIsEdit);\r\n  const asyncChangeLoading = useSelector(selectAsyncChangeLoading);\r\n  const isCreditSubmited = useSelector(selectIsCreditSubmited);\r\n  const ByApprovalErrors = useSelector(selectByApprovalErrors);\r\n  const userCanRequestApproval = useSelector(selectUserCanRequestApproval);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const reservationNotFound = useSelector(selectReservationNotFound);\r\n  const showShortView = React.useMemo(() => {\r\n    return isMobile || (useSidePanel && !sidePanelExpanded);\r\n  }, [isMobile, sidePanelExpanded, useSidePanel]);\r\n  const [print, setPrint] = React.useState<boolean>(false);\r\n  const [printExpanded, setPrintExpanded] = React.useState<boolean>(false);\r\n  const handlePrintToPDF = React.useCallback(() => {\r\n    setPrint(true);\r\n    if (!sidePanelExpanded) {\r\n      dispatch(layoutActions.setExpanded(true));\r\n      setPrintExpanded(true);\r\n    }\r\n  }, [dispatch, layoutActions, sidePanelExpanded]);\r\n  const handleClosePrintToPDF = React.useCallback(() => {\r\n    if (printExpanded) {\r\n      dispatch(layoutActions.setExpanded(false));\r\n      setPrintExpanded(false);\r\n    }\r\n    setPrint(false);\r\n  }, [dispatch, layoutActions, printExpanded]);\r\n  //cover\r\n  // const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(\r\n    () => {\r\n      if (confirmBeforeTransfer) {\r\n        setShowTransfer(true);\r\n        return false;\r\n      } else {\r\n        dispatch(actions.resetDetailsState());\r\n        if (!!onCloseReservation) {\r\n          return false;\r\n        }\r\n        return true;\r\n      }\r\n    },\r\n    () => {\r\n      if (confirmBeforeTransfer) {\r\n        setConfirmBeforeTransfer(false);\r\n      }\r\n    },\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n  /// Settings ///\r\n  const globalSettings = useGlobalSettingsHook();\r\n  /// Local State ///\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  //const [edit, setEdit] = React.useState<boolean | undefined>(false);\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [showConfirmRecurring, setShowConfirmRecurring] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [showConfirmAssisted, setShowConfirmAssisted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [createTrainingOpen, setCreateTrainingOpen] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [confirmBeforeTransfer, setConfirmBeforeTransfer] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [showTransfer, setShowTransfer] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [showCalculateCredit, setShowCalculateCredit] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [confirmCloned, setConfirmCloned] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [canceled, setCanceled] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [openModifications, setOpenModifications] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const { newDate } = useSystemDate();\r\n  /// Memo State ///\r\n  const repeat = React.useMemo(() => {\r\n    return edit && reservationSettings?.Repeat;\r\n  }, [edit, reservationSettings]);\r\n  const userReadOnly = IsReadOnlyUser(User);\r\n  const IsAdmin = React.useMemo(() => {\r\n    return (\r\n      equipmentSettings?.IsAllAdmin ||\r\n      User?.IsAllGroupOrLabTechAdmin(\r\n        reservation?.data?.EquipmentsData.map(\r\n          g => (g as IReservationEquipmentDto).ServiceGroupId,\r\n        ),\r\n        reservation?.data?.EquipmentsData.map(f => {\r\n          return {\r\n            Id: f.Id,\r\n            Name: f.Name,\r\n            ServiceTypeId: ServiceType.Online,\r\n          } as IServiceTypeFilterDto;\r\n        }),\r\n      ) ||\r\n      false\r\n    );\r\n  }, [equipmentSettings?.IsAllAdmin, User, reservation?.data?.EquipmentsData]);\r\n  const isOwner = React.useMemo(() => {\r\n    return reservation?.data?.BookedBy?.Id === User?.Id;\r\n  }, [User?.Id, reservation?.data?.BookedBy]);\r\n  const isUserGroupCoordinator = React.useMemo(() => {\r\n    return (\r\n      User &&\r\n      User.Roles.includes(Roles.UserGroupCoord) &&\r\n      (edit\r\n        ? reservation?.data?.ADGroup?.Id === User.ActiveUserGroup?.Id\r\n        : true)\r\n    );\r\n  }, [User, edit, reservation?.data?.ADGroup?.Id]);\r\n  const trainingSessionEnabled = React.useMemo(() => {\r\n    return (\r\n      globalSettings.trainingSessionEnabled &&\r\n      !equipmentSettings?.HideTrainingSession\r\n    );\r\n  }, [\r\n    equipmentSettings?.HideTrainingSession,\r\n    globalSettings.trainingSessionEnabled,\r\n  ]);\r\n  const trainingSignUp = React.useMemo(() => {\r\n    return (\r\n      trainingSessionEnabled &&\r\n      (reservation?.data?.TrainingSignUp ||\r\n        innerFormRef.current?.values.TrainingSignUp)\r\n      //&&\r\n      // innerFormRef.current?.values.EquipmentsData.length === 1\r\n    );\r\n  }, [reservation?.data?.TrainingSignUp, trainingSessionEnabled]);\r\n  const allowOngoingModifications = React.useMemo(() => {\r\n    return (\r\n      isOwner &&\r\n      reservationSettings?.Ongoing &&\r\n      equipmentSettings?.AllowModification\r\n    );\r\n  }, [\r\n    equipmentSettings?.AllowModification,\r\n    isOwner,\r\n    reservationSettings?.Ongoing,\r\n  ]);\r\n  const editable = React.useMemo(() => {\r\n    return (\r\n      IsAdmin ||\r\n      isUserGroupCoordinator ||\r\n      (isOwner && reservationSettings?.FutureReservation) ||\r\n      (reservationSettings?.Ongoing && allowOngoingModifications)\r\n    );\r\n  }, [\r\n    allowOngoingModifications,\r\n    IsAdmin,\r\n    isUserGroupCoordinator,\r\n    reservationSettings?.FutureReservation,\r\n    reservationSettings?.Ongoing,\r\n    isOwner,\r\n  ]);\r\n  const terminationEnabled = React.useMemo(() => {\r\n    return (\r\n      globalSettings.reservationTerminationEnabled &&\r\n      reservationSettings?.Ongoing &&\r\n      reservation?.data?.Status?.Id !== ReservationStatus.Cancelled &&\r\n      reservation?.data?.Status?.Id !== ReservationStatus.CancelledByAdmin &&\r\n      equipmentSettings?.AllowUsersToShortenReservations &&\r\n      (IsAdmin || isOwner)\r\n    );\r\n  }, [\r\n    IsAdmin,\r\n    equipmentSettings?.AllowUsersToShortenReservations,\r\n    globalSettings.reservationTerminationEnabled,\r\n    isOwner,\r\n    reservation?.data?.Status?.Id,\r\n    reservationSettings?.Ongoing,\r\n  ]);\r\n  const allowSortenReservation = React.useMemo(() => {\r\n    return globalSettings.reservationTerminationEnabled\r\n      ? false\r\n      : equipmentSettings?.AllowUsersToShortenReservations;\r\n  }, [\r\n    equipmentSettings?.AllowUsersToShortenReservations,\r\n    globalSettings.reservationTerminationEnabled,\r\n  ]);\r\n  const timeEnabledForOwner = React.useMemo(() => {\r\n    return (\r\n      reservationSettings?.FutureReservation ||\r\n      (reservationSettings?.Ongoing &&\r\n        (allowSortenReservation ||\r\n          equipmentSettings?.AllowModification ||\r\n          equipmentSettings?.AllowExtendReservation))\r\n    );\r\n  }, [\r\n    equipmentSettings?.AllowExtendReservation,\r\n    equipmentSettings?.AllowModification,\r\n    reservationSettings?.FutureReservation,\r\n    reservationSettings?.Ongoing,\r\n    allowSortenReservation,\r\n  ]);\r\n  const timeEnabled = React.useMemo(() => {\r\n    return (\r\n      (IsAdmin || isUserGroupCoordinator || (isOwner && timeEnabledForOwner)) &&\r\n      !reservationSettings?.TerminateReservation\r\n    );\r\n  }, [\r\n    IsAdmin,\r\n    isOwner,\r\n    isUserGroupCoordinator,\r\n    reservationSettings?.TerminateReservation,\r\n    timeEnabledForOwner,\r\n  ]);\r\n  const canBeCanceled = React.useMemo(() => {\r\n    return (\r\n      edit &&\r\n      editable &&\r\n      reservation?.data?.Status?.Id !== ReservationStatus.Cancelled &&\r\n      reservation?.data?.Status?.Id !== ReservationStatus.CancelledByAdmin\r\n    );\r\n  }, [edit, editable, reservation?.data?.Status?.Id]);\r\n  const canBeApproved = React.useMemo(() => {\r\n    return (\r\n      edit &&\r\n      editable &&\r\n      ((reservation?.data?.Status?.Id === ReservationStatus.Pending &&\r\n        IsAdmin) ||\r\n        (reservation?.data?.Status?.Id === ReservationStatus.PendingCoord &&\r\n          isUserGroupCoordinator))\r\n    );\r\n  }, [\r\n    IsAdmin,\r\n    edit,\r\n    editable,\r\n    isUserGroupCoordinator,\r\n    reservation?.data?.Status?.Id,\r\n  ]);\r\n  const canSaveForLater = React.useMemo(() => {\r\n    return (\r\n      globalSettings.draftReservationsEnabled &&\r\n      equipmentSettings?.DraftSaveForLater &&\r\n      (IsAdmin || isOwner) &&\r\n      reservation?.data?.Status?.Id !== ReservationStatus.Cancelled &&\r\n      reservation?.data?.Status?.Id !== ReservationStatus.CancelledByAdmin\r\n    );\r\n  }, [\r\n    IsAdmin,\r\n    equipmentSettings?.DraftSaveForLater,\r\n    globalSettings.draftReservationsEnabled,\r\n    isOwner,\r\n    reservation?.data?.Status?.Id,\r\n  ]);\r\n  const reservationCanceled = React.useMemo(() => {\r\n    return (\r\n      (edit && reservation?.data?.Status?.Id === ReservationStatus.Cancelled) ||\r\n      reservation?.data?.Status?.Id === ReservationStatus.CancelledByAdmin\r\n    );\r\n  }, [edit, reservation?.data?.Status?.Id]);\r\n  const calculateButtonVisible = React.useMemo(() => {\r\n    return globalSettings.showCalculatePrice &&\r\n      globalSettings.budgetModuleEnabled\r\n      ? equipmentSettings?.BudgetsTurnedOn\r\n      : true;\r\n  }, [\r\n    equipmentSettings?.BudgetsTurnedOn,\r\n    globalSettings.budgetModuleEnabled,\r\n    globalSettings.showCalculatePrice,\r\n  ]);\r\n  const not_restricted = React.useMemo(() => {\r\n    if (edit) {\r\n      let budget =\r\n        reservation?.data?.Budget !== null &&\r\n        reservation?.data?.Budget !== undefined\r\n          ? reservation.data.Budget\r\n          : null;\r\n      let noInstumentRestricted = globalSettings.reservationRestricted\r\n        ? IsAdmin || isUserGroupCoordinator || isOwner\r\n        : globalSettings.userGroupReservationRestricted\r\n        ? reservation?.data?.ADGroup?.Id === User?.ActiveUserGroup?.Id ||\r\n          IsAdmin ||\r\n          isUserGroupCoordinator ||\r\n          isOwner\r\n        : true;\r\n      let confidential =\r\n        ((!!reservation?.data?.BudgetExperiment &&\r\n          reservation?.data?.BudgetExperiment !== null) ||\r\n          globalSettings.confidentialBudgetsEnabled) &&\r\n        !!reservation?.data?.Budget &&\r\n        (budget === null\r\n          ? false\r\n          : (budget as IBudgetFilterDto).Confidential ?? false);\r\n      let noBudgetRestricted = confidential ? IsAdmin || isOwner : true;\r\n\r\n      return noInstumentRestricted && noBudgetRestricted;\r\n    }\r\n\r\n    return true;\r\n  }, [\r\n    IsAdmin,\r\n    User?.ActiveUserGroup?.Id,\r\n    edit,\r\n    globalSettings.confidentialBudgetsEnabled,\r\n    globalSettings.reservationRestricted,\r\n    globalSettings.userGroupReservationRestricted,\r\n    isOwner,\r\n    isUserGroupCoordinator,\r\n    reservation?.data?.ADGroup?.Id,\r\n    reservation?.data?.Budget,\r\n    reservation?.data?.BudgetExperiment,\r\n  ]);\r\n  /// get initial state of the equipmentSettings\r\n  // const equipmentSettings = React.useMemo(() => {\r\n  //   if (!!reservation.data) {\r\n  //     let sett = mapSettingsFromServices(\r\n  //       reservation.data.EquipmentsData as IReservationEquipmentDto[],\r\n  //       {} as ServiceSettingsState,\r\n  //       globalSettings,\r\n  //     );\r\n  //     return Object.assign(sett, {\r\n  //       CustomForms: reservationSettings?.CustomForms,\r\n  //     });\r\n  //   } else {\r\n  //     return {} as ServiceSettingsState;\r\n  //   }\r\n  // }, [globalSettings, reservation.data, reservationSettings?.CustomForms]);\r\n  /// mount effect - init ///\r\n  React.useEffect(() => {\r\n    if (!print && edit) {\r\n      dispatch(printActions.setUseSections(true));\r\n      dispatch(\r\n        printActions.updateSections(\r\n          getPrintPDFDefaultSections(\r\n            t,\r\n            globalSettings.ServiceRequestReservationEnabled && IsAdmin,\r\n            (reservation?.data?.FormValues?.length ?? 0) > 0,\r\n          ),\r\n        ),\r\n      );\r\n    }\r\n  }, [\r\n    IsAdmin,\r\n    dispatch,\r\n    edit,\r\n    globalSettings.ServiceRequestReservationEnabled,\r\n    print,\r\n    printActions,\r\n    reservation?.data?.FormValues?.length,\r\n    t,\r\n  ]);\r\n  const workOrderSwithProps = React.useMemo(() => {\r\n    if (!edit) {\r\n      let eqids = queryParams.selectedIds;\r\n      let start = queryParams.Start;\r\n      let end = queryParams.singleClick ? undefined : queryParams.End;\r\n      let defaultMulti = globalSettings.multipleInstrumentsEnabled;\r\n      if (reservation && reservation.data) {\r\n        start = dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(reservation.data.StartTime),\r\n        );\r\n        end = queryParams.singleClick\r\n          ? undefined\r\n          : dateUtils.formatQueryStringDate(\r\n              dateUtils.dateOrStringToDate(reservation.data.EndTime),\r\n            );\r\n        defaultMulti =\r\n          globalSettings.multipleInstrumentsEnabled &&\r\n          reservation.data.EquipmentsData.length > 0;\r\n        eqids = reservation.data.EquipmentsData.map(f => f.Id).join(',');\r\n      }\r\n\r\n      let p = {\r\n        queryParams: {\r\n          eqid: eqids,\r\n          down: 'true',\r\n          offH: 'true',\r\n          eStart: start,\r\n          offStart: start,\r\n          offEnd: end,\r\n          defaultMulti: defaultMulti.toString(),\r\n          source: queryParams.source,\r\n          id: undefined,\r\n          aType: undefined,\r\n          title: undefined,\r\n          sympt: undefined,\r\n          aStatus: undefined,\r\n          aStart: undefined,\r\n          desc: undefined,\r\n          assetId: undefined,\r\n          reason: undefined,\r\n          sid: undefined,\r\n        } as WorkOrderQueryStringParameters,\r\n        useSidePanel: true,\r\n        useSwithButtons: useSwitchButtons,\r\n      } as WorkOrderDetailsProps;\r\n      return p;\r\n    }\r\n    return undefined;\r\n  }, [\r\n    edit,\r\n    globalSettings.multipleInstrumentsEnabled,\r\n    queryParams.End,\r\n    queryParams.Start,\r\n    queryParams.selectedIds,\r\n    queryParams.singleClick,\r\n    queryParams.source,\r\n    reservation,\r\n    useSwitchButtons,\r\n  ]);\r\n  const allowEditMultipleEquipments = React.useMemo(() => {\r\n    return (\r\n      globalSettings.multipleInstrumentsEnabled &&\r\n      !trainingSignUp &&\r\n      globalSettings.allowAddRemoveOnEditReservation\r\n    );\r\n  }, [\r\n    globalSettings.allowAddRemoveOnEditReservation,\r\n    globalSettings.multipleInstrumentsEnabled,\r\n    trainingSignUp,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = firstLoad && !userReadOnly;\r\n    // if (!reservation || !reservation.data) {\r\n\r\n    // }\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initReservation({\r\n          query: queryParams,\r\n          globalSettings: globalSettings,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    firstLoad,\r\n    globalSettings,\r\n    queryParams,\r\n    reservation,\r\n    userReadOnly,\r\n  ]);\r\n  React.useEffect(() => {\r\n    if (edit) {\r\n      if (\r\n        savedOfflineServices.length > 0 &&\r\n        savedOfflineServices.some(f => f.Id < 1)\r\n      ) {\r\n        dispatch(layoutActions.setNotSavedChanges(true));\r\n      }\r\n    }\r\n  }, [dispatch, edit, layoutActions, savedOfflineServices]);\r\n  /// functions, callbacks ///\r\n  // const closeCover = () => {\r\n  //   setCover(undefined);\r\n  // };\r\n  // const handleClose = () => {\r\n  //   if (hasChanges) {\r\n  //     dispatch(layoutActions.setConfirmOpen(true));\r\n  //   } else {\r\n  //     handleCloselClick();\r\n  //   }\r\n  // };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      if (!!onCloseReservation) {\r\n        onCloseReservation();\r\n        dispatch(actions.resetDetailsState());\r\n      } else {\r\n        closePanel({\r\n          isCover: isCover || !!cover,\r\n          useSidePanel: useSidePanel,\r\n          showConfirm: hasChanges,\r\n          onClose: () => {\r\n            dispatch(actions.resetDetailsState());\r\n          },\r\n        } as SidePanelCloseState);\r\n      }\r\n    } else {\r\n      dispatch(push('/reservations'));\r\n    }\r\n  }, [\r\n    actions,\r\n    closePanel,\r\n    cover,\r\n    dispatch,\r\n    hasChanges,\r\n    isCover,\r\n    onCloseReservation,\r\n    useSidePanel,\r\n  ]);\r\n\r\n  const handleSaveClick = React.useCallback(\r\n    (e: any) => {\r\n      if (repeat) {\r\n        setShowConfirmRecurring(true);\r\n      } else {\r\n        handleSubmitForm(e);\r\n      }\r\n    },\r\n    [repeat],\r\n  );\r\n\r\n  const cancelReservation = React.useCallback(() => {\r\n    let status = getSingleReservationStatus(\r\n      ReservationStatus.Cancelled as number,\r\n    );\r\n    dispatch(actions.setAnyValue({ fieldKey: 'Status', fieldValue: status }));\r\n    setCanceled(true);\r\n  }, [actions, dispatch]);\r\n  const approveReservation = React.useCallback(() => {\r\n    let status = getSingleReservationStatus(\r\n      ReservationStatus.Approved as number,\r\n    );\r\n    dispatch(actions.setAnyValue({ fieldKey: 'Status', fieldValue: status }));\r\n  }, [actions, dispatch]);\r\n  const draftReservation = React.useCallback(() => {\r\n    let status = getSingleReservationStatus(ReservationStatus.Draft as number);\r\n    dispatch(actions.extendReservationSettings({ SaveForLater: true }));\r\n    dispatch(actions.setAnyValue({ fieldKey: 'Status', fieldValue: status }));\r\n  }, [actions, dispatch]);\r\n  const handleChangeStatus = React.useCallback(\r\n    (event: any, status: ReservationStatus) => {\r\n      if (status === ReservationStatus.Cancelled) {\r\n        cancelReservation();\r\n      } else if (status === ReservationStatus.Approved) {\r\n        approveReservation();\r\n      } else if (status === ReservationStatus.Draft) {\r\n        draftReservation();\r\n      }\r\n      setTimeout(() => handleSaveClick(event), 10);\r\n    },\r\n    [approveReservation, cancelReservation, draftReservation, handleSaveClick],\r\n  );\r\n  const handleSubmitForm = (e: any) => {\r\n    if (customFormRef.current) {\r\n      customFormRef.current(e);\r\n      setTimeout(() => {\r\n        if (repetitiveFormRef.current) {\r\n          repetitiveFormRef.current(e);\r\n        }\r\n        if (submitFormRef.current) {\r\n          submitFormRef.current(e);\r\n        }\r\n      }, 50);\r\n    } else {\r\n      if (repetitiveFormRef.current) {\r\n        repetitiveFormRef.current(e);\r\n      }\r\n      if (submitFormRef.current) {\r\n        submitFormRef.current(e);\r\n      }\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (\r\n      values: ReservationDetailsState,\r\n      customFormFiles: IFormFileValue[],\r\n      originalFormFiles: IFormFileValue[],\r\n    ) => {\r\n      setBusy(true);\r\n      if (isCreditSubmited) {\r\n        setShowCalculateCredit(true);\r\n        let value = {\r\n          details: values,\r\n          settings: reservationSettings,\r\n          customFormFiles: [],\r\n          RepetitiveOptions: repetitiveValues,\r\n          offlineServices: savedOfflineServices,\r\n        } as ReservationGlobalState;\r\n        dispatch(\r\n          actions.createReservation({\r\n            state: value,\r\n            calcCredit: true,\r\n          }),\r\n        );\r\n      } else {\r\n        if (edit) {\r\n          dispatch(\r\n            actions.updateReservation({\r\n              current: values,\r\n              original: reservation.data || values,\r\n              currentCustomFormFiles: customFormFiles,\r\n              originalCustomFormFiles: originalFormFiles,\r\n              offlineServices: savedOfflineServices,\r\n              settings: reservationSettings,\r\n            }),\r\n          );\r\n        } else {\r\n          let value = {\r\n            details: {\r\n              ...values,\r\n              SampleRunId: reservation.data?.SampleRunId,\r\n            },\r\n            settings: reservationSettings,\r\n            customFormFiles: customFormFiles,\r\n            RepetitiveOptions: repetitiveValues,\r\n            offlineServices: savedOfflineServices,\r\n          } as ReservationGlobalState;\r\n          //console.log('data', value);\r\n          dispatch(\r\n            actions.createReservation({\r\n              state: value,\r\n              calcCredit: undefined,\r\n            }),\r\n          );\r\n        }\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      edit,\r\n      isCreditSubmited,\r\n      repetitiveValues,\r\n      reservation.data,\r\n      reservationSettings,\r\n      savedOfflineServices,\r\n    ],\r\n  );\r\n  const [offlineServicesErrors, setOfflineServicesErrors] = React.useState<\r\n    ErrorServices[]\r\n  >([]);\r\n  const handleSetError = React.useCallback(\r\n    (error: ErrorServices) => {\r\n      if (error.error !== undefined) {\r\n        setOfflineServicesErrors([\r\n          ...offlineServicesErrors.filter(f => f.id !== error.id),\r\n          error,\r\n        ]);\r\n      } else {\r\n        setOfflineServicesErrors([\r\n          ...offlineServicesErrors.filter(f => f.id !== error.id),\r\n        ]);\r\n      }\r\n    },\r\n    [offlineServicesErrors],\r\n  );\r\n  const handleTerminate = React.useCallback(() => {\r\n    dispatch(\r\n      actions.setAnyValue({\r\n        fieldKey: 'EndTime',\r\n        fieldValue: dateUtils.formatISO(newDate()),\r\n      }),\r\n    );\r\n    dispatch(\r\n      actions.setAnyValue({\r\n        fieldKey: 'Remarks',\r\n        fieldValue: t(translations.AutoEndReservation_remarks) as string,\r\n      }),\r\n    );\r\n    setTimeout(() => {\r\n      dispatch(\r\n        actions.updateReservation({\r\n          current:\r\n            innerFormRef?.current?.values ||\r\n            reservation.data ||\r\n            ({} as ReservationDetailsState),\r\n          original: reservation.data || ({} as ReservationDetailsState),\r\n          currentCustomFormFiles: [],\r\n          originalCustomFormFiles: [],\r\n          offlineServices: savedOfflineServices,\r\n          settings: reservationSettings,\r\n          terminate: true,\r\n        }),\r\n      );\r\n    }, 10);\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    newDate,\r\n    reservation.data,\r\n    reservationSettings,\r\n    savedOfflineServices,\r\n    t,\r\n  ]);\r\n  //------ Confirm Repetitive Update/Delete handlers -------//\r\n  const handleUpdateAllRecurrent = (e: any) => {\r\n    dispatch(\r\n      actions.updateReservationSettings({\r\n        RecurringUpdateOption: RecurringReservationUpdateOptions.All,\r\n      }),\r\n    );\r\n    handleSubmitForm(e);\r\n    setShowConfirmRecurring(false);\r\n    setCanceled(undefined);\r\n  };\r\n  const handleUpdateFollowing = (e: any) => {\r\n    dispatch(\r\n      actions.updateReservationSettings({\r\n        RecurringUpdateOption: RecurringReservationUpdateOptions.Following,\r\n      }),\r\n    );\r\n    handleSubmitForm(e);\r\n    setShowConfirmRecurring(false);\r\n    setCanceled(undefined);\r\n  };\r\n  const handleUpdateJustOne = (e: any) => {\r\n    dispatch(\r\n      actions.updateReservationSettings({\r\n        RecurringUpdateOption:\r\n          RecurringReservationUpdateOptions.CurrentReservation,\r\n      }),\r\n    );\r\n    handleSubmitForm(e);\r\n    setShowConfirmRecurring(false);\r\n    setCanceled(undefined);\r\n  };\r\n  const assistedApproveOnse = () => {\r\n    setShowConfirmAssisted(false);\r\n    dispatch(actions.resetAssisteTrainingData());\r\n    dispatch(layoutActions.setRefreshTable(true));\r\n    if (!isCloned) {\r\n      handleCloselClick();\r\n    }\r\n  };\r\n  const handleByApprovalConfirm = React.useCallback(\r\n    (e: any) => {\r\n      dispatch(\r\n        actions.updateReservationSettings({\r\n          UserRequestedByApproval: true,\r\n        }),\r\n      );\r\n      dispatch(actions.setByApprovalErrors(undefined));\r\n      // dispatch(actions.setUserCanRequestApproval(undefined));\r\n      // handleSubmitForm(e);\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const editAssisted = React.useCallback(\r\n    (p: TrainingDetailsProps, reset: boolean) => {\r\n      openPanel({\r\n        renderPageType: RenderPageType.TrainingDetails,\r\n        renderPageProps: {\r\n          ...p,\r\n          useSidePanel: true,\r\n          isCover: useSidePanel,\r\n          onTrainingClose: () => {\r\n            setCreateTrainingOpen(false);\r\n            handleCloselClick();\r\n          },\r\n        } as TrainingDetailsProps,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      });\r\n      setCreateTrainingOpen(true);\r\n      dispatch(actions.resetAssisteTrainingData());\r\n    },\r\n    [openPanel, useSidePanel, dispatch, actions, handleCloselClick],\r\n  );\r\n  const handleCancelTransfer = () => {\r\n    if (transferUser !== null) {\r\n      dispatch(\r\n        actions.cancelTransfer({\r\n          User: transferUser,\r\n          ReservtionId: transferredForId || reservation?.data?.Id || 0,\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  const handleEquipmentClick = React.useCallback(\r\n    (equipment: Entity<number>) => {\r\n      let assetProps = {\r\n        identifier: {\r\n          serviceId: equipment.Id,\r\n          serviceType: 'Online',\r\n        },\r\n        useSidePanel: true,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.AssetDetails,\r\n        renderPageProps: assetProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const handleRestrictionsClick = React.useCallback(\r\n    (equipment: Entity<number>) => {\r\n      let restrictProps = {\r\n        serviceId: equipment.Id,\r\n        showTable: IsAdmin,\r\n        serviceGroupId: (equipment as IReservationEquipmentDto).ServiceGroupId,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.RestrictionDetails,\r\n        renderPageProps: restrictProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [IsAdmin, useSidePanel, openPanel],\r\n  );\r\n  const handleOfflineServiceClick = React.useCallback(\r\n    (service: IOtherServices) => {\r\n      if (edit) {\r\n        let otherProps = {\r\n          initialService: service,\r\n          saveCreatable: true,\r\n          queryParams: {\r\n            id: '' + service.Id ?? -1,\r\n          },\r\n        };\r\n        openPanel({\r\n          renderPageType: RenderPageType.OtherServiceDetails,\r\n          renderPageProps: otherProps,\r\n          expanded: false,\r\n          useSidePanel: useSidePanel,\r\n          isCover: useSidePanel,\r\n        } as SidePanelOpenState);\r\n      }\r\n    },\r\n    [edit, openPanel, useSidePanel],\r\n  );\r\n  const handleWorkTypeClick = React.useCallback(\r\n    (\r\n      event: IWorkOrderTypeDto,\r\n      equipmentIds: number[],\r\n      reservationId: number,\r\n    ) => {\r\n      let woProps = {\r\n        queryParams: {\r\n          id: undefined,\r\n          aType: event.Id.toString(),\r\n          eqid: equipmentIds.join(','),\r\n          reservationId: reservationId.toString(),\r\n        } as WorkOrderQueryStringParameters,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.WorkOrderDetails,\r\n        renderPageProps: woProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n        onClose: () => dispatch(actions.setRefreshWorkOrderLink(true)),\r\n      } as SidePanelOpenState);\r\n    },\r\n    [actions, dispatch, openPanel, useSidePanel],\r\n  );\r\n  const handleAddBatchClick = React.useCallback(\r\n    (batch: IInventoryBatchDto | null, serviceTypeId: number) => {\r\n      let batchProps = {\r\n        initialBatch: batch ?? undefined,\r\n        queryParams: {\r\n          id: '' + (batch?.Id ?? -1),\r\n          stid: '' + serviceTypeId,\r\n        },\r\n        saveCreatable: useSidePanel,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.InventoryBatch,\r\n        renderPageProps: batchProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const handleCalculateCredit = React.useCallback(\r\n    (e: any) => {\r\n      dispatch(actions.setSubmitCredit(true));\r\n      handleSubmitForm(e);\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (reservationId !== undefined && !isCloned) {\r\n        //setEdit(true);\r\n      } else {\r\n        //setEdit(false);\r\n      }\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          if (confirmAssisted && assistedTrainingData !== null) {\r\n            setShowConfirmAssisted(true);\r\n          } else {\r\n            setShowConfirmAssisted(false);\r\n            if (!isCloned && !createTrainingOpen) {\r\n              handleCloselClick();\r\n            }\r\n          }\r\n        }\r\n        if (terminationEnabled) {\r\n          dispatch(actions.resetTerminateState());\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actionCompleted,\r\n    actions,\r\n    assistedTrainingData,\r\n    confirmAssisted,\r\n    createTrainingOpen,\r\n    dispatch,\r\n    handleCloselClick,\r\n    hasError,\r\n    isCloned,\r\n    processing,\r\n    reservationId,\r\n    terminationEnabled,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = creditProcessing === false;\r\n    if (active) {\r\n      if (creditCompleted === true && !showCalculateCredit) {\r\n        dispatch(actions.resetCreditState());\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    creditCompleted,\r\n    creditProcessing,\r\n    dispatch,\r\n    showCalculateCredit,\r\n  ]);\r\n\r\n  React.useEffect(() => {\r\n    if (transferProcessing === false && transferStepCompleted === true) {\r\n      setShowTransfer(false);\r\n    }\r\n  }, [actions, dispatch, transferProcessing, transferStepCompleted]);\r\n\r\n  /// actions ///\r\n  const leftActions = React.useMemo(() => {\r\n    let mactions = [] as ActionRenderer[];\r\n    if (!edit || (edit && (IsAdmin || isUserGroupCoordinator || isOwner))) {\r\n      mactions.push(() => (\r\n        <React.Fragment>\r\n          <SaveFormButton\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"save\" />}\r\n            onClick={e => {\r\n              dispatch(actions.setCloneReservation(false));\r\n              dispatch(actions.resetOperateState());\r\n              handleSaveClick(e);\r\n            }}\r\n            disabled={\r\n              busy ||\r\n              equipmentChangeCompleted === false ||\r\n              transferStepWaiting === true ||\r\n              (edit && reservationCanceled && !IsAdmin)\r\n            }\r\n            processing={!requestCompleted && busy}\r\n            text={t(translations.Save)}\r\n          />\r\n        </React.Fragment>\r\n      ));\r\n    }\r\n    if (edit) {\r\n      if (!!equipmentSettings && !!reservationSettings) {\r\n        if (canBeCanceled) {\r\n          mactions.push(() => (\r\n            <React.Fragment>\r\n              <CancelReservationButton\r\n                size=\"small\"\r\n                startIcon={<Icon icon=\"trash\" />}\r\n                onClick={e =>\r\n                  handleChangeStatus(e, ReservationStatus.Cancelled)\r\n                }\r\n                disabled={\r\n                  busy ||\r\n                  transferStepWaiting === true ||\r\n                  equipmentChangeCompleted === false\r\n                }\r\n                variant=\"white\"\r\n                processing={!requestCompleted && busy}\r\n                text={\r\n                  showShortView\r\n                    ? t(translations.Cancel)\r\n                    : t(translations.CancelReservation)\r\n                }\r\n              />\r\n            </React.Fragment>\r\n          ));\r\n        }\r\n        if (canBeApproved) {\r\n          mactions.push(() => (\r\n            <React.Fragment>\r\n              <ApproveReservationButton\r\n                size=\"small\"\r\n                startIcon={<Icon icon=\"check\" />}\r\n                onClick={e => handleChangeStatus(e, ReservationStatus.Approved)}\r\n                disabled={\r\n                  busy ||\r\n                  transferStepWaiting === true ||\r\n                  equipmentChangeCompleted === false\r\n                }\r\n                variant=\"white\"\r\n                processing={!requestCompleted && busy}\r\n                text={\r\n                  showShortView\r\n                    ? t(translations.Approve)\r\n                    : t(translations.ApproveReservation)\r\n                }\r\n              />\r\n            </React.Fragment>\r\n          ));\r\n        }\r\n        if (\r\n          (equipmentSettings.AllowedToTransfer ||\r\n            equipmentSettings.AllowedToTransferAll) &&\r\n          !transferStepWaiting &&\r\n          !repeat &&\r\n          canBeCanceled\r\n        ) {\r\n          mactions.push(() => (\r\n            <React.Fragment>\r\n              <TransferButton\r\n                size=\"small\"\r\n                onClick={e => {\r\n                  if (hasChanges) {\r\n                    dispatch(layoutActions.setConfirmOpen(true));\r\n                    setConfirmBeforeTransfer(true);\r\n                  } else {\r\n                    setShowTransfer(true);\r\n                  }\r\n                }}\r\n                disabled={busy}\r\n                variant=\"white\"\r\n                title={t(translations.TransferReservation)}\r\n                processing={transferProcessing}\r\n                text={t(translations.Transfer)}\r\n              />\r\n            </React.Fragment>\r\n          ));\r\n        }\r\n      }\r\n    }\r\n    if (\r\n      IsAdmin &&\r\n      globalSettings.assistedReservationsEnabled &&\r\n      globalSettings.tutoringModulesEnabled &&\r\n      equipmentSettings?.IsEquipmentTutoring &&\r\n      edit &&\r\n      assistedTrainingData !== null &&\r\n      assistedTrainingData.Equipments.some(f => f.TrainingRecordId === null)\r\n    ) {\r\n      mactions.push(() => (\r\n        <React.Fragment>\r\n          <CreateTrainingButton\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"dumbbell\" />}\r\n            onClick={e =>\r\n              editAssisted(\r\n                {\r\n                  id: undefined,\r\n                  equId: undefined,\r\n                  equIds: assistedTrainingData.Equipments.map(\r\n                    f => f.EquipmentId,\r\n                  ).join(','),\r\n                  fatherId: reservation.data?.FatherId?.toString() ?? undefined,\r\n                  rid:\r\n                    reservation.data?.FatherId !== null &&\r\n                    reservation.data?.FatherId !== undefined\r\n                      ? undefined\r\n                      : reservation.data?.Id !== null\r\n                      ? reservation.data?.Id.toString()\r\n                      : undefined,\r\n                  date: dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(\r\n                      reservation.data?.StartTime ?? new Date(),\r\n                    ),\r\n                  ),\r\n                  user: reservation.data?.BookedBy?.Id,\r\n                  useSidePanel: true,\r\n                } as TrainingDetailsProps,\r\n                false,\r\n              )\r\n            }\r\n            disabled={busy}\r\n            variant=\"white\"\r\n            text={t(translations.CreateTraining)}\r\n          />\r\n        </React.Fragment>\r\n      ));\r\n    }\r\n    if (canSaveForLater) {\r\n      mactions.push(() => (\r\n        <React.Fragment>\r\n          <SaveForLaterButton\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"floppy-disk-circle-arrow-right\" />}\r\n            onClick={e => handleChangeStatus(e, ReservationStatus.Draft)}\r\n            disabled={\r\n              busy ||\r\n              transferStepWaiting === true ||\r\n              equipmentChangeCompleted === false\r\n            }\r\n            variant=\"white\"\r\n            processing={!requestCompleted && busy}\r\n            text={t(translations.SaveForLater)}\r\n          />\r\n        </React.Fragment>\r\n      ));\r\n    }\r\n    if (calculateButtonVisible) {\r\n      mactions.push(() => (\r\n        <Button\r\n          id={'CalculateCreditPopupButtonId'}\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"money-bill\" />}\r\n          onClick={e => handleCalculateCredit(e)}\r\n          title={\r\n            offlineServicesErrors.length > 0\r\n              ? (t(translations.OfflineServicesError_info) as string)\r\n              : (t(translations.CalculatePricing_info) as string)\r\n          }\r\n          disabled={\r\n            creditProcessing ||\r\n            equipmentChangeCompleted === false ||\r\n            offlineServicesErrors.length > 0\r\n          }\r\n          processing={creditProcessing}\r\n        >\r\n          {t(translations.CalculatePricing)}\r\n        </Button>\r\n      ));\r\n    }\r\n    if (edit && (IsAdmin || isUserGroupCoordinator || isOwner)) {\r\n      mactions.push(() => (\r\n        <Button\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"square\" />}\r\n          aria-label=\"history\"\r\n          onClick={() => setOpenModifications(true)}\r\n        >\r\n          {t(translations.ModificationsHistory)}\r\n        </Button>\r\n      ));\r\n    }\r\n    if (IsAdmin || isOwner) {\r\n      mactions.push(() => (\r\n        <Button\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"clone\" />}\r\n          aria-label=\"clone\"\r\n          disabled={\r\n            busy ||\r\n            equipmentChangeCompleted === false ||\r\n            transferStepWaiting === true ||\r\n            (edit && reservationCanceled && !IsAdmin)\r\n          }\r\n          title={t(translations.res_SaveAndClone_info)}\r\n          onClick={e => {\r\n            dispatch(actions.resetOperateState());\r\n            if (edit) {\r\n              if (hasChanges) {\r\n                setConfirmCloned(hasChanges);\r\n              } else {\r\n                dispatch(actions.setCloneReservation(true));\r\n                handleSaveClick(e);\r\n              }\r\n            } else {\r\n              dispatch(actions.setCloneReservation(true));\r\n              handleSaveClick(e);\r\n            }\r\n          }}\r\n        >\r\n          {edit ? t(translations.SaveAndClone) : t(translations.CreateAndClone)}\r\n        </Button>\r\n      ));\r\n    }\r\n    mactions.push(() => (\r\n      <React.Fragment>\r\n        <Button\r\n          variant=\"white\"\r\n          component={LinkBehavior}\r\n          disabled={\r\n            !edit ||\r\n            reservationSettings?.FatherId === undefined ||\r\n            reservationSettings?.FatherId === null\r\n          }\r\n          startIcon={<Icon icon=\"link\" />}\r\n          size=\"small\"\r\n          onClick={e => {\r\n            dispatch(\r\n              appSettingsActions.navigate(\r\n                toLocationDescriptor({\r\n                  path: '/reservations',\r\n                  search: { relId: reservationId },\r\n                }),\r\n              ),\r\n            );\r\n            if (sidePanelExpanded) {\r\n              dispatch(layoutActions.setExpanded(false));\r\n            }\r\n          }}\r\n        >\r\n          {t(translations.ShowRelatedReservations)}\r\n        </Button>\r\n      </React.Fragment>\r\n    ));\r\n    if (edit) {\r\n      mactions.push(() => (\r\n        <Button\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"print\" />}\r\n          aria-label=\"print\"\r\n          onClick={handlePrintToPDF}\r\n          title={t(translations.PrintPdf)}\r\n          disabled={print}\r\n        >\r\n          {t(translations.PrintPdf)}\r\n        </Button>\r\n      ));\r\n    }\r\n    return mactions;\r\n  }, [\r\n    IsAdmin,\r\n    actions,\r\n    appSettingsActions,\r\n    assistedTrainingData,\r\n    busy,\r\n    calculateButtonVisible,\r\n    canBeApproved,\r\n    canBeCanceled,\r\n    canSaveForLater,\r\n    creditProcessing,\r\n    dispatch,\r\n    edit,\r\n    editAssisted,\r\n    equipmentChangeCompleted,\r\n    equipmentSettings,\r\n    globalSettings.assistedReservationsEnabled,\r\n    globalSettings.tutoringModulesEnabled,\r\n    handleCalculateCredit,\r\n    handleChangeStatus,\r\n    handlePrintToPDF,\r\n    handleSaveClick,\r\n    hasChanges,\r\n    isOwner,\r\n    isUserGroupCoordinator,\r\n    layoutActions,\r\n    offlineServicesErrors.length,\r\n    print,\r\n    repeat,\r\n    requestCompleted,\r\n    reservation.data?.BookedBy?.Id,\r\n    reservation.data?.FatherId,\r\n    reservation.data?.Id,\r\n    reservation.data?.StartTime,\r\n    reservationCanceled,\r\n    reservationId,\r\n    reservationSettings,\r\n    showShortView,\r\n    sidePanelExpanded,\r\n    t,\r\n    transferProcessing,\r\n    transferStepWaiting,\r\n  ]);\r\n\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <IconButton\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            title={t(translations.Close)}\r\n            onClick={handleCloselClick}\r\n          >\r\n            <Icon icon=\"times\" />\r\n          </IconButton>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCloselClick, t]);\r\n\r\n  const pageTitle = React.useMemo(() => {\r\n    return reservation?.data\r\n      ? edit\r\n        ? ` ${\r\n            isCloned\r\n              ? t(translations.CloneReservation)\r\n              : t(translations.Reservation)\r\n          } #${reservationId || 'N/A'}`\r\n        : reservation.data.TrainingSignUp\r\n        ? t(translations.TrainingSignUp)\r\n        : ` ${\r\n            isCloned\r\n              ? t(translations.CloneReservation)\r\n              : t(translations.AddReservation)\r\n          }`\r\n      : undefined;\r\n  }, [edit, isCloned, reservation.data, reservationId, t]);\r\n  const pageName = React.useMemo(() => {\r\n    return edit\r\n      ? t(translations.menu_ReservationDetails)\r\n      : t(translations.menu_NewReservation);\r\n  }, [edit, t]);\r\n  const useSwitchActions = React.useMemo(() => {\r\n    return (\r\n      !edit && IsAdmin && !reservation.data?.TransferFromId && useSwitchButtons\r\n    );\r\n  }, [IsAdmin, edit, reservation.data?.TransferFromId, useSwitchButtons]);\r\n\r\n  const switchState = React.useMemo(() => {\r\n    return !!workOrderSwithProps && !edit && useSwitchButtons\r\n      ? ({\r\n          target: SwitchTarget.WorkOrder,\r\n          getProps: () => workOrderSwithProps,\r\n        } as SwitchActionsProps)\r\n      : undefined;\r\n  }, [edit, useSwitchButtons, workOrderSwithProps]);\r\n  const ByApprovalAvailable = React.useMemo(() => {\r\n    return (\r\n      userCanRequestApproval === true &&\r\n      ByApprovalErrors !== undefined &&\r\n      ByApprovalErrors.length > 0\r\n    );\r\n  }, [ByApprovalErrors, userCanRequestApproval]);\r\n\r\n  /// render ///\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={pageName}\r\n        titlePage={pageTitle}\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={true}\r\n        closeSidePanel={handleCloselClick}\r\n        //leftTopActions={topActions}\r\n        useSwitchActions={useSwitchActions}\r\n        switchState={switchState}\r\n        topProcessing={\r\n          equipmentChangeCompleted === false || asyncChangeLoading === true\r\n        }\r\n        leftActions={not_restricted ? leftActions : []}\r\n        leftActionsMaxLength={edit ? 2 : 1}\r\n        pageLink={buildURL(\r\n          publicUrl + 'reservations/details',\r\n          props.queryParams,\r\n        )}\r\n        toPageLink={`reservations/details?${toQueryString(props.queryParams)}`}\r\n        rightActions={rightActions}\r\n        isCover={isCover}\r\n        // rightTopActions={not_restricted ? rightTopActions : undefined}\r\n        //rightTopActionsAsMenu\r\n        confirm={\r\n          showConfirmRecurring ? (\r\n            <DialogConfirm\r\n              isOpen={showConfirmRecurring}\r\n              title={\r\n                canceled\r\n                  ? t(translations.CancelMultipleReservations)\r\n                  : t(translations.UpdateMultipleReservations)\r\n              }\r\n              processing={reservationProcessing}\r\n              body={t(translations.WeeklyReservationConfirmationMessage)}\r\n              confirmButtonLabel={t(translations.JustThisOne)}\r\n              onConfirm={handleUpdateJustOne}\r\n              maxWidth=\"md\"\r\n              onCancel={() => {\r\n                setShowConfirmRecurring(false);\r\n              }}\r\n              actions={[\r\n                () => (\r\n                  <ActionButton\r\n                    text={\r\n                      canceled\r\n                        ? t(translations.CancelFollowing)\r\n                        : t(translations.UpdateFollowing)\r\n                    }\r\n                    variant=\"main\"\r\n                    onClick={handleUpdateFollowing}\r\n                  />\r\n                ),\r\n                () => (\r\n                  <ActionButton\r\n                    text={\r\n                      canceled\r\n                        ? t(translations.CancelAll)\r\n                        : t(translations.UpdateAll)\r\n                    }\r\n                    variant=\"main\"\r\n                    onClick={handleUpdateAllRecurrent}\r\n                  />\r\n                ),\r\n              ]}\r\n            />\r\n          ) : confirmCloned ? (\r\n            <DialogConfirm\r\n              isOpen={confirmCloned}\r\n              title={t(translations.CloneReservation)}\r\n              body={t(translations.CloneReservationConfirm)}\r\n              confirmButtonLabel={t(translations.Proceed)}\r\n              onConfirm={e => {\r\n                dispatch(actions.setCloneReservation(true));\r\n                handleSaveClick(e);\r\n                setConfirmCloned(false);\r\n              }}\r\n              maxWidth=\"md\"\r\n              onCancel={() => {\r\n                setConfirmCloned(false);\r\n              }}\r\n            />\r\n          ) : requestCompleted &&\r\n            confirmAssisted &&\r\n            assistedTrainingData !== null ? (\r\n            <ApproveTrainingRecords\r\n              show={showConfirmAssisted || false}\r\n              data={assistedTrainingData}\r\n              handleApproveOnce={assistedApproveOnse}\r\n              handleEditAssisted={editAssisted}\r\n            />\r\n          ) : showTransfer ? (\r\n            <TransferReservation\r\n              show={showTransfer}\r\n              transferAllowedToGroup={\r\n                equipmentSettings?.AllowedToTransfer || false\r\n              }\r\n              services={(reservation?.data\r\n                ?.EquipmentsData as IReservationEquipmentDto[]).map(f => {\r\n                return {\r\n                  Id: f.Id,\r\n                  Name: f.Name,\r\n                  ServiceTypeId: 1,\r\n                  ServiceGroupId: f.ServiceGroupId,\r\n                  HideProject: f.HideProjects,\r\n                } as IServiceTypeFilterDto;\r\n              })}\r\n              adGroup={reservation?.data?.ADGroup?.Id}\r\n              trnsferSubmitted={transferProcessing}\r\n              handleTransfer={value => {\r\n                let transfer = {\r\n                  User: value,\r\n                  ReservtionId: reservation?.data?.Id ?? 0,\r\n                } as TransferToReservation;\r\n                dispatch(actions.transferReservation(transfer));\r\n              }}\r\n              user={User}\r\n              onClose={() => setShowTransfer(false)}\r\n            />\r\n          ) : showCalculateCredit ? (\r\n            <CalculatePricing\r\n              open={showCalculateCredit}\r\n              title={t(translations.CalculatePricing)}\r\n              onClose={() => setShowCalculateCredit(false)}\r\n              edit={edit}\r\n              credit={credit}\r\n              creditCompleted={creditCompleted}\r\n              creditProcessing={creditProcessing}\r\n            />\r\n          ) : !!openModifications ? (\r\n            <ReservationModifications\r\n              open={openModifications}\r\n              setOpen={value => setOpenModifications(value)}\r\n              resId={reservation?.data?.Id ?? 0}\r\n            />\r\n          ) : ByApprovalAvailable ? (\r\n            <DialogConfirm\r\n              isOpen={ByApprovalAvailable}\r\n              title={t(translations.ByApprovalConfirmationModalTitle)}\r\n              processing={reservationProcessing}\r\n              body={\r\n                <>\r\n                  {!!ByApprovalErrors &&\r\n                    ByApprovalErrors.map((error, index) => (\r\n                      <Alert key={index} color=\"warning\">\r\n                        {error}\r\n                      </Alert>\r\n                    ))}\r\n                  <Body>{t(translations.ReservationConfirmByApproval)}</Body>\r\n                </>\r\n              }\r\n              confirmButtonLabel={t(translations.Confirm)}\r\n              onConfirm={handleByApprovalConfirm}\r\n              maxWidth=\"md\"\r\n              onCancel={() => {\r\n                dispatch(actions.setByApprovalErrors(undefined));\r\n                dispatch(actions.setUserCanRequestApproval(undefined));\r\n              }}\r\n            />\r\n          ) : (\r\n            <></>\r\n          )\r\n        }\r\n        cover={cover}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n        coverClosed={coverClosed}\r\n      >\r\n        {reservation?.data !== undefined && !processing ? (\r\n          not_restricted ? (\r\n            <PrintToPDF\r\n              title={pageTitle || ''}\r\n              print={print}\r\n              printTitle={pageTitle || ''}\r\n              useSections={true}\r\n              close={handleClosePrintToPDF}\r\n            >\r\n              <ReservationForm\r\n                initialValues={\r\n                  reservation?.data || ({} as ReservationDetailsState)\r\n                }\r\n                bindSubmitForm={bindSubmitForm}\r\n                onSubmit={handleSubmit}\r\n                isEdit={edit || false}\r\n                repetitiveFormRef={repetitiveFormRef}\r\n                formRef={innerFormRef}\r\n                isAdmin={IsAdmin}\r\n                user={User}\r\n                isUserGroupCoordinator={isUserGroupCoordinator}\r\n                trainingSignUp={trainingSignUp}\r\n                trainingSessionEnabled={trainingSessionEnabled}\r\n                allowEditMultipleEquipments={allowEditMultipleEquipments}\r\n                useSidePanel={useSidePanel}\r\n                onEquipmentClicked={handleEquipmentClick}\r\n                onRestrictionsClick={handleRestrictionsClick}\r\n                onOfflineServiceClick={handleOfflineServiceClick}\r\n                onAddBatchClick={handleAddBatchClick}\r\n                onStatusChange={handleChangeStatus}\r\n                onWorkTypeClick={handleWorkTypeClick}\r\n                globalSettings={globalSettings}\r\n                customFormRef={customFormRef}\r\n                editable={editable}\r\n                timeEnabled={timeEnabled}\r\n                cancelTransfer={handleCancelTransfer}\r\n                waitingTransferApproval={transferStepWaiting}\r\n                transferToUser={transferUser}\r\n                transferForId={transferredForId}\r\n                terminationEnabled={terminationEnabled}\r\n                handleTerminate={handleTerminate}\r\n                offlineServicesErrors={offlineServicesErrors}\r\n                setError={handleSetError}\r\n                assistedTrainingData={assistedTrainingData}\r\n                allowOngoingModifications={allowOngoingModifications}\r\n                isCover={isCover}\r\n                print={print}\r\n              />\r\n            </PrintToPDF>\r\n          ) : (\r\n            <FlexRowDiv style={{ alignSelf: 'center', justifySelf: 'center' }}>\r\n              <Box\r\n                style={{ display: 'flex', flexDirection: 'column', gap: 16 }}\r\n              >\r\n                <H3>{t(translations.RestrictedNotAllowed) as string}</H3>\r\n                <Button\r\n                  variant=\"ghost\"\r\n                  size=\"medium\"\r\n                  startIcon={<Icon icon=\"times\" />}\r\n                  onClick={handleCloselClick}\r\n                >\r\n                  {t(translations.Continue)}\r\n                </Button>\r\n              </Box>\r\n            </FlexRowDiv>\r\n          )\r\n        ) : reservation?.data === undefined &&\r\n          !processing &&\r\n          (reservationNotFound || userReadOnly) ? (\r\n          <FlexRowDiv style={{ alignSelf: 'center', justifySelf: 'center' }}>\r\n            <Box\r\n              style={{\r\n                display: 'flex',\r\n                flexDirection: 'column',\r\n                gap: 16,\r\n                paddingInline: 16,\r\n              }}\r\n            >\r\n              <H3>{t(translations.RestrictedNotAllowed) as string}</H3>\r\n              <Button\r\n                variant=\"ghost\"\r\n                size=\"medium\"\r\n                startIcon={<Icon icon=\"times\" />}\r\n                onClick={handleCloselClick}\r\n              >\r\n                {t(translations.Continue)}\r\n              </Button>\r\n            </Box>\r\n          </FlexRowDiv>\r\n        ) : (\r\n          <React.Fragment>\r\n            {' '}\r\n            <Box component=\"div\">\r\n              <Progress inProgress={processing} size={80} />\r\n            </Box>\r\n          </React.Fragment>\r\n        )}\r\n      </PageWrapper>\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","export enum MinTimeAheadPeriodTypes {\r\n  Hours = 0,\r\n  Days = 1,\r\n}\r\n","import { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/Restrictions';\r\n\r\nexport const RestrictionsApi = {\r\n  getRestrictionByService: (id: number | undefined) => {\r\n    return httpClient.get(url + '/' + (id ?? -1));\r\n  },\r\n};\r\n","export enum TrainingStatus {\r\n  Passed = 1,\r\n  Missing = 2,\r\n  Expired = 3,\r\n}\r\nexport enum PrerequisiteFor {\r\n  NotAllow = 0,\r\n  WithinMyCore = 1,\r\n  WithinCorAssetCatGroup = 2,\r\n  WithinCoreAssetCat = 3,\r\n  WithinSpecificCore = 4,\r\n  AccrossSystem = 5,\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { UserPicker } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IRestrictedUserPermissionResult } from 'api/odata/generated/entities/IRestrictedUserPermissionResult';\r\nimport { Entity } from 'types/common';\r\n\r\nimport { translations } from 'locales/translations';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { Box, makeStyles, Theme, createStyles } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport { SimpleList } from 'app/components/BasicList/StyledList';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\n\r\nexport interface UserOwnPermissionsProps {\r\n  user: Entity<string> | null;\r\n  isAdmin?: boolean;\r\n  onUserChange: (value: Entity<string> | null) => void;\r\n  permissions: IRestrictedUserPermissionResult[];\r\n  permLoading: boolean;\r\n  restrictedOption: boolean | null;\r\n  EquipmentName: string;\r\n  serviceGroupId: number;\r\n  serviceId: number;\r\n}\r\n\r\nexport const UserOwnPermissions = React.memo(function UserOwnPermissions(\r\n  props: UserOwnPermissionsProps,\r\n) {\r\n  const {\r\n    user,\r\n    isAdmin,\r\n    onUserChange,\r\n    permissions,\r\n    permLoading,\r\n    restrictedOption,\r\n    EquipmentName,\r\n    serviceGroupId,\r\n    serviceId,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const handleUserChange = React.useCallback(\r\n    (value: Entity<string> | null) => {\r\n      onUserChange(value);\r\n    },\r\n    [onUserChange],\r\n  );\r\n  const userIsAdmin = React.useMemo(() => {\r\n    if (user === null) {\r\n      return false;\r\n    } else {\r\n      return (\r\n        (user as IUserFilterDto)?.ServiceGroupIds?.some(\r\n          f => f === serviceGroupId,\r\n        ) ||\r\n        (user as IUserFilterDto)?.Services?.some(f => f.Id === serviceId) ||\r\n        (user as IUserFilterDto)?.IsAdminPanel\r\n      );\r\n    }\r\n  }, [serviceGroupId, serviceId, user]);\r\n  return (\r\n    <React.Fragment>\r\n      {isAdmin && (\r\n        <FormRow>\r\n          <UserPicker\r\n            label={t(translations.ShowRestrictionsFor)}\r\n            placeholder={t(translations.PleaseSelectAUser)}\r\n            id=\"specificPermissions\"\r\n            name=\"userPermissions\"\r\n            disableClearable={false}\r\n            clearOnBlur={false}\r\n            variant=\"filled\"\r\n            fullWidth={true}\r\n            value={user as IUserFilterDto}\r\n            onChange={value => handleUserChange(value)}\r\n            selectArray={[\r\n              'Id',\r\n              'Name',\r\n              'UserGroups',\r\n              'Budgets',\r\n              'IsAdminPanel',\r\n              'IsEquipmentAdmin',\r\n              'IsGroupAdmin',\r\n              'IsLabTech',\r\n              'Services',\r\n              'ServiceGroupIds',\r\n            ]}\r\n          />\r\n        </FormRow>\r\n      )}\r\n\r\n      {user !== null && (\r\n        <FormRow>\r\n          <FormLabelText\r\n            name=\"permissions\"\r\n            html={\r\n              <Box className={classes.permRoot}>\r\n                {permLoading ? (\r\n                  <Box key=\"loading\" className={classes.permRoot}>\r\n                    <Skeleton key={'first'} width=\"100%\" variant=\"text\" />\r\n                    <Skeleton key={'last'} width=\"100%\" variant=\"text\" />\r\n                  </Box>\r\n                ) : restrictedOption === null && !userIsAdmin ? (\r\n                  <BasicAlert\r\n                    variant=\"standard\"\r\n                    content={{\r\n                      type: 'warning',\r\n                      message: (t(\r\n                        translations.res_err_Permissions_StaffOnly,\r\n                      ) as string).replace('{0}', EquipmentName),\r\n                      closable: false,\r\n                    }}\r\n                  />\r\n                ) : permissions.length > 0 ? (\r\n                  <Box>\r\n                    {permissions.filter(x => x.Valid === true).length > 0 && (\r\n                      <React.Fragment>\r\n                        <Body size=\"small\" bold={true}>\r\n                          {'Allowed on:'}\r\n                        </Body>\r\n                        <SimpleList\r\n                          key={'allowedon'}\r\n                          className={classes.cardContentRows}\r\n                        >\r\n                          {permissions\r\n                            .filter(x => x.Valid === true)\r\n                            .map(item => (\r\n                              <li\r\n                                key={`allowed-${item.TimeSlotTypeId}`}\r\n                                className={classes.contentRow}\r\n                              >\r\n                                <React.Fragment>\r\n                                  <Icon\r\n                                    icon=\"circle\"\r\n                                    fontSize=\"6px\"\r\n                                    color=\"primary\"\r\n                                  />\r\n                                  <Box\r\n                                    component=\"span\"\r\n                                    className={classes.rowOverRule}\r\n                                  >\r\n                                    <Body\r\n                                      size=\"small\"\r\n                                      key={`body-${item.TimeSlotTypeId}`}\r\n                                    >{`${item.PermissionName} - ${item.TimeSlotTypeName}`}</Body>\r\n                                  </Box>\r\n                                </React.Fragment>\r\n                              </li>\r\n                            ))}\r\n                        </SimpleList>\r\n                      </React.Fragment>\r\n                    )}\r\n                    {permissions.filter(x => x.Valid === false).length > 0 && (\r\n                      <React.Fragment>\r\n                        <Body size=\"small\" bold={true}>\r\n                          {'Not allowed on:'}\r\n                        </Body>\r\n                        <SimpleList\r\n                          key={'notallowedon'}\r\n                          className={classes.cardContentRows}\r\n                        >\r\n                          {permissions\r\n                            .filter(x => x.Valid === false)\r\n                            .map((item, index) => (\r\n                              <li\r\n                                key={`notallowed-${item.TimeSlotTypeName}`}\r\n                                className={classes.contentRow}\r\n                              >\r\n                                <React.Fragment>\r\n                                  <Icon\r\n                                    icon=\"circle\"\r\n                                    fontSize=\"6px\"\r\n                                    color=\"primary\"\r\n                                  />\r\n                                  <Box\r\n                                    component=\"span\"\r\n                                    className={classes.rowOverRule}\r\n                                  >\r\n                                    <Body\r\n                                      size=\"small\"\r\n                                      key={`body-${item.TimeSlotTypeName}`}\r\n                                    >{`${item.TimeSlotTypeName}`}</Body>\r\n                                  </Box>\r\n                                </React.Fragment>\r\n                              </li>\r\n                            ))}\r\n                        </SimpleList>\r\n                      </React.Fragment>\r\n                    )}\r\n                  </Box>\r\n                ) : (\r\n                  <Box key=\"notFound\" className={classes.permRoot}>\r\n                    {user !== null ? (\r\n                      <Body size=\"small\" bold={true}>\r\n                        {t(translations.NoAdditionalRestrictionsFound)}\r\n                      </Body>\r\n                    ) : (\r\n                      <></>\r\n                    )}\r\n                  </Box>\r\n                )}\r\n              </Box>\r\n            }\r\n          />\r\n        </FormRow>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    permRoot: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      gap: '8px',\r\n    },\r\n    cardContent: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      padding: '12px',\r\n      width: '100%',\r\n      gap: 8,\r\n    },\r\n    cardTitle: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      justifyContent: 'space-between',\r\n      height: 20,\r\n    },\r\n    title: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      justifyContent: 'flex-start',\r\n      gap: 8,\r\n    },\r\n    titleOverRule: {\r\n      display: 'inline-block',\r\n      whiteSpace: 'pre',\r\n      overflow: 'hidden',\r\n      textOverflow: 'ellipsis',\r\n      maxWidth: '30ch',\r\n      [theme.breakpoints.down('sm')]: {\r\n        maxWidth: '25ch',\r\n      },\r\n    },\r\n    cardContentRows: {\r\n      padding: 0,\r\n      margin: 0,\r\n    },\r\n    contentRow: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: 0,\r\n      gap: 8,\r\n    },\r\n    rowOverRule: {\r\n      display: 'inline-block',\r\n      whiteSpace: 'pre',\r\n      overflow: 'hidden',\r\n      textOverflow: 'ellipsis',\r\n      maxWidth: '29ch',\r\n    },\r\n    rowTitle: {\r\n      color: theme.palette.common.graySubtitle,\r\n      paddingRight: 8,\r\n      display: 'inline',\r\n    },\r\n    rowText: {\r\n      color: theme.palette.common.blackRegular,\r\n      display: 'inline',\r\n      '& > *': {\r\n        display: 'inherit',\r\n      },\r\n    },\r\n    cardActions: {\r\n      justifyContent: 'space-between',\r\n      padding: '0px',\r\n      gap: 8,\r\n      width: '100%',\r\n    },\r\n    cardActionsButtons: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      gap: 8,\r\n      justifyContent: 'flex-start',\r\n      width: '100%',\r\n    },\r\n  }),\r\n);\r\n","import { httpClient } from './HttpClient';\r\n\r\nvar restUrl = '/api/odata/v4/RestrictedUserPermissions';\r\n\r\nexport const UserPermissionsApi = {\r\n  getUserRestrictions: (payload: { serviceId: number; username: string }) => {\r\n    return httpClient.post(restUrl + '/UserPermissions', payload);\r\n  },\r\n  getUserSlotPermissions: (payload: {\r\n    serviceId: number;\r\n    username: string;\r\n  }) => {\r\n    return httpClient.post(restUrl + '/UserSlotPermissions', payload);\r\n  },\r\n};\r\n","import { Box } from '@material-ui/core';\r\nimport { RestrictionsApi } from 'api/RestrictionsApi';\r\nimport { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { MinTimeAheadPeriodTypes } from 'enums/MinTimeAheadPeriodTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { IRestrictions } from '../../AssetPopUp/IAsset';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n} from 'app/slice/selectors';\r\nimport { UserOwnPermissions } from './components/UserOwnPermissions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport { IUserRestrictionsResult } from 'api/odata/generated/entities/IRestrictedUserPermissionResult';\r\nimport { Body } from 'app/components/Typography';\r\nimport { TrainingStatus } from 'enums/TrainingStatus';\r\nimport { UserPermissionsApi } from 'api/UserPermissionsApi';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport {\r\n  convertAuthToIUserFilterDto,\r\n  IUserFilterDto,\r\n} from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { AssetPicker } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport { BasicCard } from 'app/components/BasicCards';\r\nimport { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IsAssetImageExist } from 'types/AppSettings';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface InstrumentRestrictionsProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  serviceId?: number;\r\n  serviceGroupId?: number;\r\n  initUser?: string;\r\n  onClose?: () => void;\r\n  showTable?: boolean;\r\n  assetPickerDisabled?: boolean;\r\n  withNoPadding?: boolean;\r\n  useShortView?: boolean;\r\n  hideEquipmentFormTitle?: boolean;\r\n  withNoWrapper?: boolean;\r\n}\r\nexport interface Prerequisites {\r\n  Id: number;\r\n  Name: string;\r\n  ServiceId: number;\r\n  StatusName?: string;\r\n  StatusId?: number;\r\n  ImageName?: string;\r\n}\r\nexport function InstrumentRestrictions(props: InstrumentRestrictionsProps) {\r\n  const {\r\n    serviceId,\r\n    serviceGroupId,\r\n    useSidePanel,\r\n    initUser,\r\n    assetPickerDisabled,\r\n    hideEquipmentFormTitle,\r\n    withNoPadding,\r\n    useShortView,\r\n    isCover,\r\n    closeCover,\r\n    withNoWrapper,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const authuser = useSelector(selectAuthenticatedUser);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  //const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const isMobile = DetectIsMobile();\r\n  const [equipmentId, setEquipmentId] = React.useState<number | undefined>(\r\n    serviceId,\r\n  );\r\n  const [equipmentGroupId, setEquipmentGroupId] = React.useState<\r\n    number | undefined\r\n  >(serviceGroupId);\r\n  const [\r\n    selectedService,\r\n    setSelectedService,\r\n  ] = useAsyncExtendedState<IAssetDto | null>(null);\r\n  const isAdmin = React.useMemo(() => {\r\n    return (\r\n      authuser !== undefined &&\r\n      (authuser.HasAdminServicePermissions(ServiceType.Online, equipmentId) ||\r\n        authuser.HasLabTechServicePermissions(\r\n          ServiceType.Online,\r\n          equipmentId,\r\n        ) ||\r\n        authuser?.HasAdminGroupPermissions(equipmentGroupId) ||\r\n        authuser?.HasLabTechGroupPermissions(equipmentGroupId))\r\n    );\r\n  }, [equipmentGroupId, equipmentId, authuser]);\r\n  const [selectedUser, setSelectedUser] = React.useState<IUserFilterDto | null>(\r\n    !!authuser && !isAdmin\r\n      ? convertAuthToIUserFilterDto(authuser)\r\n      : !!initUser\r\n      ? ({ Id: initUser, Name: initUser } as IUserFilterDto)\r\n      : null,\r\n  );\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState();\r\n  const fetchRestrictions = async (\r\n    serviceId?: number,\r\n  ): Promise<IRestrictions> => {\r\n    return RestrictionsApi.getRestrictionByService(serviceId);\r\n  };\r\n  const [restrictions, setRestriction] = useAsyncExtendedState<\r\n    IRestrictions | undefined\r\n  >(undefined);\r\n  const [fetchRestrictionsState, fetchRestrictionsPromise] = usePromise(\r\n    fetchRestrictions,\r\n  );\r\n\r\n  const [userRestrictions, setUserRestrictions] = useAsyncExtendedState<\r\n    IUserRestrictionsResult | undefined\r\n  >(undefined);\r\n\r\n  const fetchUserRestrictions = async (\r\n    user: Entity<string>,\r\n    serviceId: number,\r\n  ): Promise<IUserRestrictionsResult> => {\r\n    return UserPermissionsApi.getUserSlotPermissions({\r\n      serviceId: serviceId,\r\n      username: user.Id,\r\n    });\r\n  };\r\n  const [fetchUserRestrictionsState, fetchUserRestrictionsPromise] = usePromise(\r\n    fetchUserRestrictions,\r\n  );\r\n  const fetchAsset = async (serviceId: number): Promise<IAssetDto> => {\r\n    return initAssetsData(serviceId.toString(), true, undefined, true).then(\r\n      result => result[0],\r\n    );\r\n  };\r\n  const [fetchAssetState, fetchAssetPromise] = usePromise(fetchAsset);\r\n  const openAsset = useOpenAssetPopUp();\r\n  useEffectOnMount(() => {\r\n    setRestriction(fetchRestrictionsPromise(equipmentId));\r\n    if (isAdmin) {\r\n      if (!!initUser) {\r\n        (async () => {\r\n          try {\r\n            const data = await initUserData(initUser, 'full');\r\n            if (!!data && data.length > 0) {\r\n              let selected = (data[0] ?? {\r\n                Id: initUser,\r\n                Name: initUser,\r\n              }) as IUserFilterDto;\r\n              setSelectedUser(selected);\r\n              setUserRestrictions(\r\n                fetchUserRestrictionsPromise(selected, equipmentId || -1),\r\n              );\r\n            }\r\n          } catch {}\r\n        })();\r\n      } else {\r\n        setSelectedUser(null);\r\n      }\r\n    } else {\r\n      if (selectedUser !== null) {\r\n        setUserRestrictions(\r\n          fetchUserRestrictionsPromise(selectedUser, equipmentId || -1),\r\n        );\r\n      }\r\n    }\r\n    if (isAdmin) {\r\n      setSelectedService(fetchAssetPromise(equipmentId || -1));\r\n    }\r\n\r\n    return () => {};\r\n  });\r\n  React.useEffect(() => {\r\n    const messageKey = 'QuizLoad';\r\n    if (fetchRestrictionsState.error) {\r\n      dispatch(\r\n        actions.addNotification({\r\n          variant: 'error',\r\n          message: 'Something went wrong.',\r\n          key: messageKey,\r\n        }),\r\n      );\r\n    }\r\n  }, [fetchRestrictionsState.error, actions, dispatch]);\r\n  const minTimeAhead = (rest: IRestrictions): string => {\r\n    if (rest.MinTimeAheadPeriodValue !== null) {\r\n      return `${t(translations.Before)}: ${rest.MinTimeAheadPeriodValue.toFixed(\r\n        2,\r\n      )}\r\n       ${(t(translations.AdvancedReservation) as string).replace(\r\n         '{0}',\r\n         enumToEntityArray(MinTimeAheadPeriodTypes).filter(\r\n           f => f.Id === rest.MinTimeAheadPeriodType,\r\n         )[0].Name,\r\n       )}`;\r\n    } else if (rest.MinTimeAheadMinutesSinceMidnight !== null) {\r\n      return `${t(translations.OnTheSameDay)}: ${(t(\r\n        translations.ToBeBookedBy,\r\n      ) as string).replace(\r\n        '{0}',\r\n        dateUtils.dateFnsUtils.format(\r\n          new Date(0, 0, 0, 0, rest.MinTimeAheadMinutesSinceMidnight),\r\n          dateUtils.DateIOFormats.fullDateTime24h,\r\n        ),\r\n      )}`;\r\n    } else {\r\n      return '';\r\n    }\r\n  };\r\n  const getStatus = React.useCallback(\r\n    (asset: IAssetDto) => {\r\n      let validRender =\r\n        !!userRestrictions &&\r\n        userRestrictions.PrerequisiteTrainingsIndicators.length > 0 &&\r\n        userRestrictions.PrerequisiteTrainingsIndicators.some(\r\n          f => f.Id === asset.ServiceId,\r\n        );\r\n      if (!!userRestrictions && validRender) {\r\n        let found = userRestrictions.PrerequisiteTrainingsIndicators.find(\r\n          f => f.Id === asset.ServiceId,\r\n        );\r\n        let status = enumToEntityArray(TrainingStatus).find(\r\n          f => f.Id === found?.Status,\r\n        )?.Name;\r\n        let statusName = `${status} ${\r\n          asset.PrerequisiteFor === 1\r\n            ? ' - ( ' + t(translations.CoreWideRequirement) + ' )'\r\n            : ''\r\n        }`;\r\n        return {\r\n          StatusName: statusName,\r\n          Status: found?.Status,\r\n        };\r\n      }\r\n      return undefined;\r\n    },\r\n    [t, userRestrictions],\r\n  );\r\n  const prerequisites: Prerequisites[] = React.useMemo(() => {\r\n    let results: Prerequisites[] = [];\r\n    if (!!restrictions && restrictions.PrerequisiteEquipments.length > 0) {\r\n      results = restrictions.PrerequisiteEquipments.map(preq => {\r\n        let usrrest = getStatus(preq);\r\n        return {\r\n          Id: preq.Id,\r\n          Name: preq.Name,\r\n          ServiceId: preq.ServiceId,\r\n          ImageName: preq.Image,\r\n          StatusId: usrrest?.Status,\r\n          StatusName: usrrest?.StatusName,\r\n        } as Prerequisites;\r\n      });\r\n    }\r\n    return results;\r\n  }, [getStatus, restrictions]);\r\n\r\n  // const PrerequisiteWithStatus = ({ asset }: { asset: IAssetDto }) => {\r\n  //   let validRender =\r\n  //     !!userRestrictions &&\r\n  //     userRestrictions.PrerequisiteTrainingsIndicators.length > 0 &&\r\n  //     userRestrictions.PrerequisiteTrainingsIndicators.some(\r\n  //       f => f.Id === asset.ServiceId,\r\n  //     );\r\n\r\n  //   if (!!userRestrictions && validRender) {\r\n  //     let found = userRestrictions.PrerequisiteTrainingsIndicators.find(\r\n  //       f => f.Id === asset.ServiceId,\r\n  //     );\r\n  //     let status = enumToEntityArray(TrainingStatus).find(\r\n  //       f => f.Id === found?.Status,\r\n  //     )?.Name;\r\n  //     let statusName = `${status} - ${\r\n  //       asset.PrerequisiteFor === 1\r\n  //         ? '( ' + t(translations.CoreWideRequirement) + ' )'\r\n  //         : ''\r\n  //     }`;\r\n  //     return (\r\n  //       <Body size=\"small\" bold={true}\r\n  //         color={found?.Status === TrainingStatus.Passed ? 'success' : 'danger'}\r\n  //       >\r\n  //         {cliTruncate(statusName, 25, { position: 'end' })}\r\n  //       </Body>\r\n  //     );\r\n  //   } else {\r\n  //     return <></>;\r\n  //   }\r\n  // };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: isCover,\r\n      useSidePanel: useSidePanel,\r\n    } as SidePanelCloseState);\r\n  }, [closePanel, isCover, useSidePanel]);\r\n  const userOnChange = (value: Entity<string> | null) => {\r\n    setSelectedUser(value as IUserFilterDto);\r\n    if (value === null) {\r\n      setUserRestrictions(undefined);\r\n    } else {\r\n      setUserRestrictions(\r\n        fetchUserRestrictionsPromise(value, equipmentId || -1),\r\n      );\r\n    }\r\n  };\r\n  const assetOnChange = (value: IAssetDto | null) => {\r\n    setSelectedService(value);\r\n    setRestriction(fetchRestrictionsPromise(value?.ServiceId ?? undefined));\r\n    setSelectedUser(null);\r\n    setUserRestrictions(undefined);\r\n  };\r\n  React.useEffect(() => {\r\n    if (fetchAssetState.status !== 'pending') {\r\n      setEquipmentId(selectedService?.ServiceId ?? undefined);\r\n      setEquipmentGroupId(selectedService?.ServiceGroupId ?? undefined);\r\n    }\r\n    return () => {};\r\n  }, [\r\n    fetchAssetState.status,\r\n    selectedService?.ServiceGroupId,\r\n    selectedService?.ServiceId,\r\n  ]);\r\n  // const minReservationGap = (rest: IRestrictions): string => {\r\n  //   let gaps = [\r\n  //     rest.MinReservationOrderGap,\r\n  //     rest.UserReservationGap,\r\n  //     rest.UserGroupReservationGap,\r\n  //     rest.InstituteReservationGap,\r\n  //   ];\r\n  //   if (gaps.filter(g => g > 0).length > 0) {\r\n  //     return Math.min(...gaps.filter(g => g > 0)).toString();\r\n  //   }\r\n  //   return '';\r\n  // };\r\n  const RenderContent = () => {\r\n    return !!restrictions ? (\r\n      <StyledFormFieldsContainer noPadding={withNoPadding}>\r\n        <FormLeftSection showShortView={useShortView}>\r\n          <FormFieldsSection\r\n            titleSection={\r\n              withNoWrapper ? t(translations.InstrumentRestrictions) : undefined\r\n            }\r\n          >\r\n            {isAdmin && (\r\n              <React.Fragment>\r\n                <FormRow>\r\n                  <AssetPicker\r\n                    ariaLabel={t(translations.Resource)}\r\n                    label={t(translations.Resource)}\r\n                    id=\"available-resources\"\r\n                    onChange={assetOnChange}\r\n                    admin={true}\r\n                    variant=\"filled\"\r\n                    fullWidth={true}\r\n                    showOnlyActiveAssets={true}\r\n                    value={selectedService}\r\n                    disabled={assetPickerDisabled}\r\n                  />\r\n                </FormRow>\r\n                <UserOwnPermissions\r\n                  user={selectedUser}\r\n                  isAdmin={true}\r\n                  onUserChange={userOnChange}\r\n                  permissions={\r\n                    !!userRestrictions ? userRestrictions.Permissions : []\r\n                  }\r\n                  permLoading={fetchUserRestrictionsState.status === 'pending'}\r\n                  restrictedOption={restrictions.LimitlessReservationAllowed}\r\n                  EquipmentName={restrictions.Name}\r\n                  serviceGroupId={\r\n                    equipmentGroupId || restrictions.ServiceGroupId\r\n                  }\r\n                  serviceId={equipmentId || restrictions.Id}\r\n                />\r\n              </React.Fragment>\r\n            )}\r\n            {prerequisites.length > 0 && (\r\n              <FormRow>\r\n                <FormLabelText\r\n                  name=\"PrerequisiteTrainings\"\r\n                  html={\r\n                    <React.Fragment>\r\n                      <Body size=\"small\" bold={true}>\r\n                        {t(translations.PrerequisiteTrainings)}\r\n                      </Body>\r\n\r\n                      <Box\r\n                        style={{\r\n                          display: 'flex',\r\n                          flexDirection:\r\n                            props.isCover || isMobile ? 'column' : 'row',\r\n                          flex: '1 1 100%',\r\n                          alignItems: `${\r\n                            props.isCover || isMobile ? 'stretch' : 'flex-start'\r\n                          }`,\r\n                          gap: '8px',\r\n                        }}\r\n                      >\r\n                        {prerequisites.map(item => {\r\n                          return (\r\n                            <BasicCard\r\n                              key={item.ServiceId}\r\n                              position=\"horizontal\"\r\n                              cardSize=\"small\"\r\n                              title={item.Name}\r\n                              cardContent={\r\n                                item.StatusId === undefined ? undefined : (\r\n                                  <Body\r\n                                    size=\"small\"\r\n                                    bold={true}\r\n                                    style={{\r\n                                      color:\r\n                                        item.StatusId === TrainingStatus.Passed\r\n                                          ? bookitColors.success.regular\r\n                                          : item.StatusId ===\r\n                                            TrainingStatus.Expired\r\n                                          ? bookitColors.warning.regular\r\n                                          : bookitColors.danger.regular,\r\n                                    }}\r\n                                  >\r\n                                    {item.StatusName}\r\n                                  </Body>\r\n                                  //<PrerequisiteWithStatus asset={item} />\r\n                                )\r\n                              }\r\n                              imageSrc={getAssetImageThumbSrc(\r\n                                item.ImageName || null,\r\n                                'horizontal',\r\n                                IsAssetImageExist(\r\n                                  appSettings,\r\n                                  item.ImageName || null,\r\n                                  'horizontal',\r\n                                ),\r\n                              )}\r\n                              useImage={true}\r\n                              // status={\r\n                              //   item.StatusId === undefined\r\n                              //     ? 'info'\r\n                              //     : item.StatusId === TrainingStatus.Passed\r\n                              //     ? 'success'\r\n                              //     : item.StatusId === TrainingStatus.Expired\r\n                              //     ? 'warning'\r\n                              //     : 'error'\r\n                              // }\r\n                              maxContentHeight={40}\r\n                              useButtons={false}\r\n                              primaryAction={() =>\r\n                                openAsset(\r\n                                  {\r\n                                    id: item.Id,\r\n                                    serviceId: item.ServiceId,\r\n                                    serviceType: 'Online',\r\n                                    useSidePanel: useSidePanel,\r\n                                  },\r\n                                  openPanel,\r\n                                )\r\n                              }\r\n                              backStyle=\"white\"\r\n                            />\r\n                            // <Box\r\n                            //   style={{\r\n                            //     display: 'flex',\r\n                            //     flexDirection: 'row',\r\n                            //     alignItems: 'center',\r\n                            //     gap: '8px',\r\n                            //   }}\r\n                            //   key={item.ServiceId}\r\n                            // >\r\n                            //   <BookitChip\r\n                            //     onClick={() => openAsset(item)}\r\n                            //     variant=\"default\"\r\n                            //     size=\"small\"\r\n                            //     label={item.Name}\r\n                            //     key={item.Id}\r\n                            //   />\r\n                            //   <PrerequisiteWithStatus asset={item} />\r\n                            // </Box>\r\n                          );\r\n                        })}\r\n                      </Box>\r\n                    </React.Fragment>\r\n                  }\r\n                />\r\n              </FormRow>\r\n            )}\r\n\r\n            {restrictions.ForceTutoring === true && (\r\n              <FormRow>\r\n                <FormLabelText\r\n                  name=\"ApprovalRequired\"\r\n                  label={t(translations.TrainingMandatory)}\r\n                  text={\r\n                    !userRestrictions ||\r\n                    (!!userRestrictions && !userRestrictions.PreApproved) ? (\r\n                      <>{t(translations.ApprovalRequired)}</>\r\n                    ) : (\r\n                      <React.Fragment>\r\n                        <Box\r\n                          style={{\r\n                            display: 'flex',\r\n                            flexDirection: 'row',\r\n                            alignItems: 'center',\r\n                            gap: 8,\r\n                          }}\r\n                        >\r\n                          <Icon icon=\"check\" color=\"success\" />\r\n                          {t(translations.PreApproved) as string}\r\n                          <InfoIcon\r\n                            title={t(translations.PreApproved_info) as string}\r\n                          />\r\n                        </Box>\r\n                      </React.Fragment>\r\n                    )\r\n                  }\r\n                />\r\n              </FormRow>\r\n            )}\r\n\r\n            {restrictions.MinReservationOrder !== null &&\r\n              restrictions.MinReservationOrder > 0 && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"MinReservationOrder\"\r\n                    label={t(translations.MinimumReservationDurationH)}\r\n                    text={restrictions.MinReservationOrder}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n\r\n            {restrictions.MaxReservationOrder !== null &&\r\n              restrictions.MaxReservationOrder > 0 && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"MaxReservationOrder\"\r\n                    label={t(translations.MaximumReservationDurationH)}\r\n                    text={restrictions.MaxReservationOrder}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n\r\n            {restrictions.ReservationMinimumGap !== null &&\r\n              restrictions.ReservationMinimumGap > 0 && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"ReservationMinimumGap\"\r\n                    label={t(translations.ReservationMinimumGap)}\r\n                    text={restrictions.ReservationMinimumGap}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n            {restrictions.CarryOverTimeSlotTypeId !== null &&\r\n              restrictions.CarryOverTimeSlotGap != null && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"CarryOverTimeSlotTypeId\"\r\n                    label={t(translations.CarryOverTimeSlotGap)}\r\n                    text={`${restrictions.CarryOverTimeSlotGap} hours over timeslot ${restrictions.CarryOverTimeSlotTypeName}`}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n            {(restrictions.MinTimeAheadPeriodValue !== null ||\r\n              restrictions.MinTimeAheadMinutesSinceMidnight != null) && (\r\n              <FormRow>\r\n                <FormLabelText\r\n                  name=\"MinimumTimeAhead\"\r\n                  label={t(translations.MinimumTimeAhead)}\r\n                  info={\r\n                    restrictions.MinTimeAheadPeriodValue !== null\r\n                      ? t(translations.AdvancedReservation_info)\r\n                      : t(translations.ToBeBookedBy_info)\r\n                  }\r\n                  text={minTimeAhead(restrictions)}\r\n                />\r\n              </FormRow>\r\n            )}\r\n            {restrictions.RestrictionsOverview !== null &&\r\n              restrictions.RestrictionsOverview !== '' && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"RestrictionsOverview\"\r\n                    label={t(translations.RestrictionsOverview)}\r\n                    text={restrictions.RestrictionsOverview}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n            {restrictions.BypassQuotas === true && (\r\n              <FormRow>\r\n                <FormLabelText\r\n                  name=\"BypassQuotasForReservations\"\r\n                  label={t(translations.BypassQuotasForReservations)}\r\n                  text={<BooleanRender value={restrictions.BypassQuotas} />}\r\n                />\r\n              </FormRow>\r\n            )}\r\n            {restrictions.BypassUserQuotasAndGaps &&\r\n              restrictions.BypassUserQuotasAndGapsD !== null &&\r\n              restrictions.BypassUserQuotasAndGapsD > 0 && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"BypassUserQuotasAndGapsD\"\r\n                    label={t(translations.BypassUserQuotasAndGapsD_Description)}\r\n                    text={`${restrictions.BypassUserQuotasAndGapsD} ${t(\r\n                      translations.BypassUserQuotasAndGapsD_DescriptionCont,\r\n                    )}`}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n            {restrictions.BypassMinResDurationD &&\r\n              restrictions.BypassMinResDurationT !== null &&\r\n              restrictions.BypassMinResDurationT > 0 && (\r\n                <FormRow>\r\n                  <FormLabelText\r\n                    name=\"BypassMinResDurationT\"\r\n                    label={t(translations.BypassMinResDurationT)}\r\n                    text={`${restrictions.BypassMinResDurationT} ${t(\r\n                      translations.BypassMinResDurationD_DescriptionCont,\r\n                    )}`}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n          </FormFieldsSection>\r\n          {!isAdmin && restrictions.LimitlessReservationAllowed !== true && (\r\n            <FormFieldsSection\r\n              titleSection={t(translations.AdditionalRestrictions)}\r\n              titleLink={\r\n                <Tooltip\r\n                  title={t(translations.SpecificUserSlotPermissions_info)}\r\n                >\r\n                  <span style={{ marginLeft: '1ch' }}>\r\n                    <Icon icon=\"info-circle\" />\r\n                  </span>\r\n                </Tooltip>\r\n              }\r\n            >\r\n              <UserOwnPermissions\r\n                user={!!authuser ? convertAuthToIUserFilterDto(authuser) : null}\r\n                isAdmin={false}\r\n                onUserChange={userOnChange}\r\n                permissions={\r\n                  !!userRestrictions ? userRestrictions.Permissions : []\r\n                }\r\n                permLoading={fetchUserRestrictionsState.status === 'pending'}\r\n                restrictedOption={restrictions.LimitlessReservationAllowed}\r\n                EquipmentName={restrictions.Name}\r\n                serviceGroupId={equipmentGroupId || restrictions.ServiceGroupId}\r\n                serviceId={equipmentId || restrictions.Id}\r\n              />\r\n            </FormFieldsSection>\r\n          )}\r\n        </FormLeftSection>\r\n        {/* this functionallity hidden by the task https://prog4biz.atlassian.net/browse/BKT-6141  */}\r\n        {/* {(!showTable || (useSidePanel && !sidePanelExpanded)) && (\r\n                <FormFieldsSection\r\n                  titleSection={t(translations.ViewAllInstrumentPermissions)}\r\n                  titleLink={\r\n                    <RestrictionsLink\r\n                      serviceId={serviceId || -1}\r\n                      title={t(translations.ShowRestrictionsFull)}\r\n                      showTable={true}\r\n                      useSidePanel={true}\r\n                    >\r\n                      <Icon icon={['fal', 'table']} size=\"lg\" />\r\n                    </RestrictionsLink>\r\n                  }\r\n                >\r\n                  {' '}\r\n                </FormFieldsSection>\r\n              )}\r\n              {showTable && (sidePanelExpanded || !useSidePanel) && (\r\n                <UserPermissionsTable\r\n                  serviceId={serviceId || -1}\r\n                  isSidePanel={useSidePanel || false}\r\n                  byUserFilter={false}\r\n                />\r\n              )} */}\r\n      </StyledFormFieldsContainer>\r\n    ) : (\r\n      <React.Fragment>{}</React.Fragment>\r\n    );\r\n  };\r\n  return withNoWrapper ? (\r\n    <RenderContent />\r\n  ) : (\r\n    <PageWrapper\r\n      useSidePanel={useSidePanel}\r\n      closable={useSidePanel || isCover}\r\n      disableExpandToggle={isCover}\r\n      loading={fetchRestrictionsState.status !== 'resolved'} //loading || rows.length === 0\r\n      pageLink={`/instrumentRestrictions?eid=${equipmentId}`}\r\n      toPageLink={`instrumentRestrictions?eid=${equipmentId}`}\r\n      pageName={t(translations.InstrumentRestrictions)}\r\n      useShortView={useShortView}\r\n      cover={cover}\r\n      hideMenu={useShortView}\r\n      coverClosed={coverClosed}\r\n      titlePage={\r\n        restrictions\r\n          ? hideEquipmentFormTitle\r\n            ? t(translations.ReservationRestrictions)\r\n            : `${restrictions.Name} - ${t(\r\n                translations.ReservationRestrictions,\r\n              )}`\r\n          : ''\r\n      }\r\n      titleTooltip={\r\n        restrictions\r\n          ? `${restrictions.Name} - ${t(translations.ReservationRestrictions)}`\r\n          : ''\r\n      }\r\n      children={\r\n        <Box height={'100%'} padding={'8px 0px'}>\r\n          {restrictions ? (\r\n            <RenderContent />\r\n          ) : (\r\n            <>{t(translations.err_Equipment_NotFound)}</>\r\n          )}\r\n        </Box>\r\n      }\r\n      closeSidePanel={handleCloselClick}\r\n      //rightTopActions={data?.AmAdmin ? [EditButton] : undefined}\r\n      isCover={isCover} //&& !showTable\r\n      closeCover={!isCover ? onCloseCover : closeCover}\r\n    />\r\n  );\r\n}\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n  prog4biz: () => _t(translations.Prog4biz),\r\n  bookitlabCopyrightNotice: () =>\r\n    _t(translations.BookitlabCopyrightNoticeTitle),\r\n  softwareBy: () => _t(translations.SoftwareBy),\r\n  systemTime: () => _t(translations.SystemTime),\r\n  lastCodeUpdate: () => _t(translations.LastCodeUpdate),\r\n  termOfUse: () => _t(translations.TermsOfUse),\r\n};\r\n","import styled from 'styled-components';\r\n\r\nexport const CopyrightSection = styled('div')(({ theme }) => ({\r\n  '&.copyrightSection': {\r\n    display: 'flex',\r\n    alignItems: 'center',\r\n    flexDirection: 'row',\r\n    justifyContent: 'space-between',\r\n    gap: 8,\r\n    alignSelf: 'stretch',\r\n    width: 'calc(100% - 16px)',\r\n    padding: '0px 16px 0px 32px',\r\n    [theme.breakpoints.down('sm')]: {\r\n      flexDirection: 'column',\r\n      justifyContent: 'flex-start',\r\n      padding: '0px 0px',\r\n      width: '100%',\r\n      gap: 4,\r\n    },\r\n  },\r\n}));\r\n","/**\r\n *\r\n * Copyright\r\n *\r\n */\r\nimport { useTheme } from '@material-ui/core';\r\nimport {\r\n  selectAppTimeZone,\r\n  selectAuthenticatedUser,\r\n  selectLastCodeUpdate,\r\n  selectWebVersion,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Link } from '../ExternalLink';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\nimport { messages } from './messages';\r\nimport { CopyrightSection } from './styled';\r\n\r\nexport interface CopyrightProps {\r\n  disableVersionOnMobile?: boolean;\r\n}\r\n\r\nexport function Copyright(props: CopyrightProps) {\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const webVersion = useSelector(selectWebVersion);\r\n  const lastUpdate = useSelector(selectLastCodeUpdate);\r\n  const appTimeZone = useSelector(selectAppTimeZone);\r\n  const appOffset = appTimeZone?.TimezoneOffsetMinutes ?? 0;\r\n  const getOffset = () => {\r\n    const currentDateOffset = new Date().getTimezoneOffset();\r\n    const appNow = dateUtils.addMinutes(\r\n      new Date(),\r\n      appOffset + currentDateOffset,\r\n    );\r\n    return appNow;\r\n  };\r\n  const [appNow, setAppNow] = React.useState<Date>(getOffset());\r\n  React.useEffect(() => {\r\n    const interval = setInterval(() => {\r\n      // const currentDateOffset = new Date().getTimezoneOffset();\r\n      // const appNow = dateUtils.addMinutes(\r\n      //   new Date(),\r\n      //   appOffset + currentDateOffset,\r\n      // );\r\n      setAppNow(getOffset());\r\n    }, 60000);\r\n\r\n    return () => {\r\n      clearInterval(interval);\r\n    };\r\n  });\r\n  const theme = useTheme();\r\n  return (\r\n    <CopyrightSection theme={theme} className={'copyrightSection'}>\r\n      <BasicTypography variant=\"tipsBold\" color=\"secondary\" align=\"left\">\r\n        <Link href=\"http://bookit-lab.com\" target=\"_blank\">\r\n          {t(messages.bookitlabCopyrightNotice())}\r\n        </Link>\r\n        <>{` `}</>\r\n        <span>{t(messages.softwareBy())}</span>\r\n        <>{` `}</>\r\n        <Link href=\"http://prog4biz.com/\" target=\"_blank\">\r\n          {t(messages.prog4biz())}\r\n        </Link>{' '}\r\n        {new Date().getFullYear()}\r\n        {'.'}\r\n      </BasicTypography>\r\n      {!props.disableVersionOnMobile && (\r\n        <BasicTypography variant=\"tipsBold\" color=\"secondary\" align=\"right\">\r\n          <span>\r\n            {`v${webVersion}; ` || ''}{' '}\r\n            {` ${t(messages.systemTime())}: ${dateUtils.longDateTimeFormat(\r\n              appNow,\r\n            )};`}{' '}\r\n            {lastUpdate &&\r\n              `${t(messages.lastCodeUpdate())}: ${dateUtils.longDateTimeFormat(\r\n                lastUpdate,\r\n              )};`}\r\n          </span>\r\n        </BasicTypography>\r\n      )}\r\n      {!!authenticatedUser && (\r\n        <span>\r\n          <BasicTypography variant=\"tipsBold\" align=\"right\">\r\n            <Link href=\"/TermsOfUseAgreement\" target=\"_blank\">\r\n              {t(messages.termOfUse())}\r\n            </Link>\r\n          </BasicTypography>\r\n        </span>\r\n      )}\r\n    </CopyrightSection>\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.messagesState || initialState;\r\n\r\nexport const selectMessages = createSelector([selectSlice], state =>\r\n  state.messages.filter(\r\n    (val, ind, arr) => arr.findIndex(f => f.key === val.key) === ind,\r\n  ),\r\n);\r\nexport const selectMsgInitProcessing = createSelector(\r\n  [selectSlice],\r\n  state => state.processing,\r\n);\r\n\r\nexport const selectMessagesAlreadyExist = createSelector(\r\n  [selectSlice],\r\n  state => state.initialized,\r\n);\r\n","import { ReservationQueryStringParameters } from './slice/types';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useCallback } from 'react';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport const useOpenReservationSidePanel = () => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  return useCallback(\r\n    (params: ReservationQueryStringParameters, useSwitchButtons?: boolean) => {\r\n      dispatch(\r\n        actions.openSidePanel({\r\n          type: RenderPageType.ReservationDetails,\r\n          props: {\r\n            useSidePanel: true,\r\n            queryParams: params,\r\n            useSwitchButtons: useSwitchButtons,\r\n          },\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n};\r\n","import parse from 'html-react-parser';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { OptionsObject, SnackbarProvider, useSnackbar } from 'notistack';\r\nimport React, { useEffect, useMemo, useState } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useMessagesSlice } from './slice';\r\nimport { selectMessages, selectMessagesAlreadyExist } from './slice/selector';\r\nimport {\r\n  CalendarMessageProps,\r\n  LoanDesk,\r\n  Message,\r\n  messageType,\r\n  StartedReservation,\r\n  UsageReservation,\r\n} from './slice/type';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { createStyles, Link, makeStyles, Theme } from '@material-ui/core';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport ButtonLink from '../BasicLinks/ButtonLink';\r\nimport { useOpenReservationSidePanel } from 'app/pages/ReservationDetails/Details/useOpenReservationSidePanel';\r\nimport { H3 } from '../Typography';\r\nimport { Entity } from 'types/common';\r\nimport { dashboardKey } from '../Dashboard/slice/types';\r\nimport { DialogConfirm } from '../DialogConfirm';\r\n\r\nconst useMessageStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      zIndex: theme.zIndex.modal,\r\n    },\r\n    item: {\r\n      backgroundColor: theme.palette.background.default + ' !important',\r\n      color: theme.palette.text.primary + ' !important',\r\n      border: '1px solid ' + theme.palette.info.main,\r\n      minWidth: 'auto',\r\n    },\r\n    base: {\r\n      '& > div': {\r\n        zIndex: theme.zIndex.modal - 1,\r\n      },\r\n      //this accesses the div that can effect the justify content.\r\n      //if notistack is updated, it will likely not be needed as the bug has been fixed in newer versions.\r\n      '&>div>div>div': {\r\n        justifyContent: 'flex-end',\r\n      },\r\n    },\r\n  }),\r\n);\r\nconst MaxMessage = 3;\r\nconst closeAllKey = 'closeAllMessagesKey';\r\n\r\nexport type pageNames = dashboardKey | 'calendar' | 'assetDetails';\r\nexport const pageToType: Partial<Record<pageNames, messageType[]>> = {\r\n  calendar: [messageType.calendar],\r\n  assetDetails: [messageType.reservationStarted, messageType.usageReservation],\r\n};\r\nexport interface MessageProps {\r\n  pageName: pageNames;\r\n  selectedEquipment?: Entity<number>[];\r\n  secondaryPage?: boolean;\r\n}\r\n\r\nexport const Messages = ({ secondaryPage, ...props }: MessageProps) => {\r\n  const classes = useMessageStyles();\r\n  const alreadyExists = useSelector(selectMessagesAlreadyExist);\r\n\r\n  return (\r\n    <span className={classes.base}>\r\n      <SnackbarProvider\r\n        hideIconVariant\r\n        anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\r\n        preventDuplicate\r\n        variant=\"info\"\r\n        maxSnack={MaxMessage + 1}\r\n        classes={{\r\n          root: classes.root,\r\n          variantInfo: classes.item,\r\n        }}\r\n      >\r\n        <MessagesChildren\r\n          {...props}\r\n          secondaryPage={secondaryPage && alreadyExists > 1}\r\n        />\r\n      </SnackbarProvider>\r\n    </span>\r\n  );\r\n};\r\n\r\nconst MessagesChildren = (props: MessageProps) => {\r\n  const { pageName, selectedEquipment } = props;\r\n  const dispatch = useDispatch();\r\n  const { enqueueSnackbar, closeSnackbar } = useSnackbar();\r\n  const { actions } = useMessagesSlice();\r\n  const allMessages = useSelector(selectMessages);\r\n  const classes = useStyles();\r\n  const messages = useMemo(() => {\r\n    const types = pageToType[props.pageName];\r\n    if (types === undefined) return allMessages;\r\n    return allMessages.filter(m => types.includes(m.type));\r\n  }, [allMessages, props.pageName]);\r\n\r\n  useEffectOnMount(() => {\r\n    if (props.secondaryPage) return;\r\n    dispatch(\r\n      actions.init({\r\n        pageName: pageName,\r\n        selectedEquipment: selectedEquipment,\r\n      }),\r\n    );\r\n\r\n    return () => {\r\n      dispatch(actions.clear());\r\n    };\r\n  });\r\n  useEffect(() => {\r\n    dispatch(actions.clear());\r\n    closeSnackbar();\r\n    dispatch(\r\n      actions.init({\r\n        pageName: pageName,\r\n        selectedEquipment: selectedEquipment,\r\n      }),\r\n    );\r\n  }, [actions, closeSnackbar, dispatch, pageName, selectedEquipment]);\r\n  useEffect(() => {\r\n    if (props.secondaryPage) {\r\n      closeSnackbar();\r\n      return;\r\n    }\r\n    if (messages.length > 1) {\r\n      const closeAllOptions: OptionsObject = {\r\n        persist: true,\r\n        key: closeAllKey,\r\n      };\r\n\r\n      enqueueSnackbar(\r\n        <ButtonLink\r\n          onClick={() => {\r\n            closeSnackbar();\r\n            dispatch(actions.clear());\r\n          }}\r\n        >\r\n          <Icon icon=\"close\" />\r\n          <WithSpace>\r\n            <CloseAll />\r\n          </WithSpace>\r\n        </ButtonLink>,\r\n        closeAllOptions,\r\n      );\r\n    } else {\r\n      closeSnackbar(closeAllKey);\r\n    }\r\n    messages.slice(0, MaxMessage).forEach(m => {\r\n      const close = () => {\r\n        dispatch(actions.remove(m.key));\r\n        closeSnackbar(m.key);\r\n      };\r\n      const options: OptionsObject = {\r\n        persist: true,\r\n        key: m.key,\r\n        action: key => (\r\n          <Box\r\n            width={'100%'}\r\n            display=\"flex\"\r\n            flexDirection=\"column-reverse\"\r\n            alignItems=\"center\"\r\n            justifyContent=\"space-between\"\r\n          >\r\n            {/* {m.type === messageType.removableAnnouncment && (\r\n              <GotIt\r\n                onClick={() => {\r\n                  dispatch(actions.remove(key));\r\n                  closeSnackbar(key);\r\n                  dispatch(\r\n                    actions.gotIt(\r\n                      AllowedSettings[AllowedSettings.DashboardAnnouncement],\r\n                    ),\r\n                  );\r\n                }}\r\n              />\r\n            )} */}\r\n            <Icon icon=\"close\" onClick={close} />\r\n          </Box>\r\n        ),\r\n      };\r\n\r\n      enqueueSnackbar(\r\n        <>\r\n          <span className={classes.root}>\r\n            <RenderMessge message={m} close={close} />\r\n          </span>\r\n          <>\r\n            {m.type === messageType.removableAnnouncment && (\r\n              <GotIt\r\n                onClick={() => {\r\n                  dispatch(actions.remove(m.key));\r\n                  closeSnackbar(m.key);\r\n                  dispatch(\r\n                    actions.gotIt(\r\n                      AllowedSettings[AllowedSettings.DashboardAnnouncement],\r\n                    ),\r\n                  );\r\n                }}\r\n              />\r\n            )}\r\n          </>\r\n        </>,\r\n        options,\r\n      );\r\n    });\r\n  }, [\r\n    actions,\r\n    classes,\r\n    closeSnackbar,\r\n    dispatch,\r\n    enqueueSnackbar,\r\n    messages,\r\n    props.secondaryPage,\r\n  ]);\r\n  return null;\r\n};\r\n\r\nconst CloseAll = () => {\r\n  const { t } = useTranslation();\r\n  return <>{t(translations.CloseAll)}</>;\r\n};\r\n\r\nconst GotIt = ({ onClick }: { onClick: () => void }) => {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <Button size=\"small\" onClick={onClick}>\r\n      {t(translations.GotIt)}\r\n    </Button>\r\n  );\r\n};\r\n\r\nconst RenderMessge = ({\r\n  message,\r\n  close,\r\n}: withClose<{\r\n  message: Message;\r\n}>) => {\r\n  switch (message.type) {\r\n    case messageType.Announcment:\r\n    case messageType.removableAnnouncment:\r\n      return <Truncicated title={null} value={message.props as string} />;\r\n    case messageType.reservationStarted:\r\n      const props = message.props as StartedReservation;\r\n      return <ReservationStartedMessage close={close} {...props} />;\r\n    case messageType.usageReservation:\r\n      return (\r\n        <UsageReservationMessage\r\n          close={close}\r\n          {...(message.props as UsageReservation)}\r\n        />\r\n      );\r\n    case messageType.loadDesk:\r\n      return <LoanDeskMessage {...(message.props as LoanDesk)} />;\r\n    case messageType.calendar:\r\n      return <CalendarMessage {...(message.props as CalendarMessageProps)} />;\r\n    default:\r\n      return null;\r\n  }\r\n};\r\n\r\ntype withClose<T> = T & { close: () => void };\r\n\r\nconst ReservationStartedMessage = ({\r\n  close,\r\n  ...props\r\n}: withClose<StartedReservation>) => {\r\n  const { t } = useTranslation();\r\n  const openSidePanel = useOpenReservationSidePanel();\r\n  const assets = (\r\n    <React.Fragment key=\"asset_space_link\">\r\n      <AssetLink id={props.Asset.Id}>{props.Asset.Name}</AssetLink>\r\n    </React.Fragment>\r\n  );\r\n  if (props.AllowUsersToShortenReservations && props.AllUsagesEnded) {\r\n    return (\r\n      <>\r\n        {assets} {t(translations.InstrumentStillReservered)}\r\n        <Button\r\n          onClick={() => {\r\n            openSidePanel({ id: '' + props.Id });\r\n            close();\r\n          }}\r\n        >\r\n          {t(translations.ReleaseUnusedReservation)}\r\n        </Button>\r\n      </>\r\n    );\r\n  }\r\n  let messages: React.ReactNode = '';\r\n  if (props.AllowUsersToShortenReservations) {\r\n    const message = t(translations.YouHaveOngoingReservations);\r\n    messages = message\r\n      .split('{0}')\r\n      .map<React.ReactNode>((f, i) => (\r\n        <React.Fragment>\r\n          <span key={'ReservationStarted' + i}> {f} </span>\r\n        </React.Fragment>\r\n      ))\r\n      .reduce((prev, curr) => [prev, assets, curr]);\r\n  } else if (props.AllowExtendReservation || props.AllowModification) {\r\n    const message = t(translations.ReservationStarted);\r\n    const link = (\r\n      <WithSpace key=\"res_space_link\">\r\n        <Link\r\n          key=\"res_link\"\r\n          onClick={() => openSidePanel({ id: '' + props.Id })}\r\n        >\r\n          {props.Id}\r\n        </Link>\r\n      </WithSpace>\r\n    );\r\n    messages = message\r\n      .split('{0}')\r\n      .map<React.ReactNode>((m, idx) => (\r\n        <span key={'assets_' + idx}>\r\n          {' '}\r\n          {m\r\n            .split('{1}')\r\n            .map<React.ReactNode>((f, i) => (\r\n              <React.Fragment>\r\n                <span key={'ReservationStarted' + i}> {f} </span>\r\n              </React.Fragment>\r\n            ))\r\n            .reduce((prev, curr) => [prev, assets, curr])}\r\n        </span>\r\n      ))\r\n      .reduce((prev, curr) => [prev, link, curr]);\r\n  }\r\n  const canEdit =\r\n    props.AllowUsersToShortenReservations ||\r\n    props.AllowModification ||\r\n    props.AllowExtendReservation;\r\n  return (\r\n    <>\r\n      {messages}\r\n      {canEdit && (\r\n        <Button\r\n          onClick={() => {\r\n            openSidePanel({ id: '' + props.Id });\r\n            close();\r\n          }}\r\n        >\r\n          {t(translations.UpdateOngoingReservations)}\r\n        </Button>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n\r\nconst UsageReservationMessage = ({\r\n  close,\r\n  ...props\r\n}: withClose<UsageReservation>) => {\r\n  const { t } = useTranslation();\r\n  const assets = (\r\n    <React.Fragment key=\"asset_space_link\">\r\n      <AssetLink id={props.Id}>{props.Name}</AssetLink>\r\n    </React.Fragment>\r\n  );\r\n  const message = t(translations.IpRelay_reservationTimeForInstrument);\r\n  const messages = message\r\n    .split('{0}')\r\n    .map<React.ReactNode>((f, i) => (\r\n      <span key={'UsageReservation' + i}> {f} </span>\r\n    ))\r\n    .reduce((prev, curr) => [prev, assets, curr]);\r\n  return (\r\n    <>\r\n      {messages}\r\n      <Button\r\n        target=\"_blank\"\r\n        href={{ path: '/Usage.aspx', search: { id: props.Id } }}\r\n        onClick={close}\r\n      >\r\n        {t(translations.IpRelay_LinkToUsage)}\r\n      </Button>\r\n    </>\r\n  );\r\n};\r\n\r\nconst CalendarMessage = (props: CalendarMessageProps) => {\r\n  return (\r\n    <Truncicated value={props.Body ?? ''} title={props.Title}>\r\n      {props.Body && parse(props.Body)}\r\n    </Truncicated>\r\n  );\r\n};\r\n\r\nconst LoanDeskMessage = (props: LoanDesk) => {\r\n  const { t } = useTranslation();\r\n  const openSidePanel = useOpenReservationSidePanel();\r\n  const message = t(translations.ReservationStartedMessage_LoanDesk);\r\n  const link = (\r\n    <WithSpace>\r\n      <Link onClick={() => openSidePanel({ id: '' + props.Id })}>\r\n        {props.Id}\r\n      </Link>\r\n    </WithSpace>\r\n  );\r\n  const asset = (\r\n    <WithSpace>\r\n      <AssetLink id={props.AssetDetails.Id}>\r\n        {props.AssetDetails.Name}\r\n      </AssetLink>\r\n    </WithSpace>\r\n  );\r\n  const messages = message\r\n    .split('{0}')\r\n    .map(m =>\r\n      m\r\n        .split('{1}')\r\n        .map<React.ReactNode>((f, i) => (\r\n          <React.Fragment key={'LoanDesk' + i}> {f} </React.Fragment>\r\n        ))\r\n        .reduce((prev, curr) => [prev, asset, curr]),\r\n    )\r\n    .reduce((prev, curr) => [prev, link, curr]);\r\n  return <>{messages}</>;\r\n};\r\n\r\nconst WithSpace = ({ children }: React.PropsWithChildren<{}>) => {\r\n  return (\r\n    <>\r\n      &nbsp;\r\n      {children}\r\n      &nbsp;\r\n    </>\r\n  );\r\n};\r\n\r\nconst Truncicated = ({\r\n  value,\r\n  title,\r\n  children,\r\n}: React.PropsWithChildren<{ value: string; title: string | null }>) => {\r\n  const classes = useStyles();\r\n  const height = useMemo(() => getSize(value, title, classes.root), [\r\n    classes.root,\r\n    title,\r\n    value,\r\n  ]);\r\n  const parsed = parse(value);\r\n  const moreTitle = useMemo(() => MoreTitle(title), [title]);\r\n  if (height > 140) {\r\n    return (\r\n      <Tooltip title={<>{parsed}</>}>\r\n        <>\r\n          <span className={classes.truncate}>\r\n            <MorePopUp Link={moreTitle}>\r\n              <TitleIfExists title={title} />\r\n              {children ?? parsed}\r\n            </MorePopUp>\r\n            {children ?? parsed}\r\n          </span>\r\n          <MoreLink>\r\n            <TitleIfExists title={title} />\r\n            {children ?? parsed}\r\n          </MoreLink>\r\n        </>\r\n      </Tooltip>\r\n    );\r\n  }\r\n  return (\r\n    <span>\r\n      <TitleIfExists title={title} />\r\n      {children ?? parsed}\r\n    </span>\r\n  );\r\n};\r\n\r\nconst getSize = (value: string, title: string | null, style: string) => {\r\n  const div = document.createElement('div');\r\n  div.classList.add(style);\r\n  if (title !== null) {\r\n    const h3 = document.createElement('h3');\r\n    h3.innerText = title;\r\n    div.appendChild(h3);\r\n  }\r\n  const inner = document.createElement('div');\r\n  inner.innerHTML = value;\r\n  div.appendChild(inner);\r\n  document.body.appendChild(div);\r\n  const height = div.clientHeight;\r\n  div.parentNode?.removeChild(div);\r\n  return height;\r\n};\r\n\r\nconst MoreLink = ({ children }: React.PropsWithChildren<{}>) => {\r\n  return <MorePopUp Link={MoreButton}>{children}</MorePopUp>;\r\n};\r\n\r\nconst TitleIfExists = ({ title }: { title: string | null }) => {\r\n  return (title ?? '') === '' ? null : <H3>{title}</H3>;\r\n};\r\n\r\nconst MoreTitle = (title: string | null): MorePopUpLink => {\r\n  return ({ onClick }) => {\r\n    return (title ?? '') === '' ? null : (\r\n      <H3 onClick={onClick} style={{ cursor: 'pointer' }}>\r\n        {title}\r\n      </H3>\r\n    );\r\n  };\r\n};\r\n\r\nconst MoreButton: MorePopUpLink = ({ onClick }) => {\r\n  return (\r\n    <Button onClick={onClick} variant=\"text\" size=\"small\">\r\n      More\r\n    </Button>\r\n  );\r\n};\r\n\r\ntype MorePopUpLink = React.FC<{ onClick: () => void }>;\r\n\r\nconst MorePopUp = ({\r\n  Link,\r\n  children,\r\n}: React.PropsWithChildren<{\r\n  Link: MorePopUpLink;\r\n}>) => {\r\n  const [open, setOpen] = useState(false);\r\n  const close = () => setOpen(false);\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      <Link onClick={() => setOpen(true)} />\r\n      <DialogConfirm\r\n        isOpen={open}\r\n        onClose={close}\r\n        body={children}\r\n        confirmButtonLabel={t(translations.OK)}\r\n        onConfirm={close}\r\n      />\r\n    </>\r\n  );\r\n};\r\n\r\nconst useStyles = makeStyles(theme =>\r\n  createStyles({\r\n    root: {\r\n      maxWidth: '380px',\r\n      maxHeight: '180px',\r\n      zIndex: theme.zIndex.drawer,\r\n    },\r\n    truncate: {\r\n      overflow: 'hidden',\r\n      textOverflow: 'ellipsis',\r\n      height: '150px',\r\n      display: '-webkit-box',\r\n      WebkitLineClamp: 5,\r\n      WebkitBoxOrient: 'vertical',\r\n    },\r\n  }),\r\n);\r\n","import { AssetBarcodeScanParameters } from 'app/pages/AssetsInventory/Details/slice/types';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/BarcodeScanLog';\r\nexport const BarcodeScanApi = {\r\n  scanBarcode: (payload: AssetBarcodeScanParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    return httpClient.post(`${url}/BarcodeScan`, data);\r\n  },\r\n  logNoRoomAccess: (payload: number) => {\r\n    const data = {\r\n      roomId: payload,\r\n    };\r\n    return httpClient.post(`${url}/LogNoRoomAccess`, data);\r\n  },\r\n  logRoomScan: (payload: number) => {\r\n    const data = {\r\n      roomId: payload,\r\n    };\r\n    return httpClient.post(`${url}/LogRoomScann`, data);\r\n  },\r\n  logLocationScan: (roomId: number, locationId: number) => {\r\n    const data = {\r\n      roomId: roomId,\r\n      locationId: locationId,\r\n    };\r\n    return httpClient.post(`${url}/LogLocationScann`, data);\r\n  },\r\n  logSubLocationScan: (\r\n    roomId: number,\r\n    locationId: number,\r\n    sublocationId: number,\r\n  ) => {\r\n    const data = {\r\n      roomId: roomId,\r\n      locationId: locationId,\r\n      sublocationId: sublocationId,\r\n    };\r\n    return httpClient.post(`${url}/LogSubLocationScann`, data);\r\n  },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { ISubLocationListDto } from 'api/odata/generated/entities/ISubLocationListDto';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport {\r\n  selectAppSettings,\r\n  selectBarcodeScanTarget,\r\n  selectGlobalSetting,\r\n} from 'app/slice/selectors';\r\nimport { parseBarcode, ScanTarget, ScanTemplateResult } from 'app/slice/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { assetInventoryActions as actions } from '.';\r\nimport {\r\n  selectLocationSelected,\r\n  selectRoomSelected,\r\n  selectScanProcessing,\r\n  selectSubLocationSelected,\r\n} from './selectors';\r\nimport { AssetBarcodeScanParameters, AssetBarcodeScanResult } from './types';\r\nimport { BarcodeScanApi as api } from 'api/BarcodeScanApi';\r\n\r\nfunction* doSetSelectedRoom(action: PayloadAction<IRoomDto | null>) {\r\n  yield put(actions.setSelectedRoom_Success(action.payload));\r\n}\r\nfunction* doSetSelectedLocation(\r\n  action: PayloadAction<ILocationListDto | null>,\r\n) {\r\n  yield put(actions.setSelectedLocation_Success(action.payload));\r\n}\r\nfunction* doSetSelectedSubLocation(\r\n  action: PayloadAction<ISubLocationListDto | null>,\r\n) {\r\n  yield put(actions.setSelectedSubLocation_Success(action.payload));\r\n}\r\nfunction* doBarcodeScan(action: PayloadAction<{ data: string }>) {\r\n  // const MIN_LENGTH_DEFAULT = 6;\r\n  // const minBarcodeLengthString: string | undefined = yield select(state =>\r\n  //   selectGlobalSetting(state, AllowedSettings.MinBarcodeLength),\r\n  // );\r\n  const minBarcodeAssetLengthString: string | undefined = yield select(state =>\r\n    selectGlobalSetting(state, AllowedSettings.QRCodeBaseLength),\r\n  );\r\n  // const MinBarcodeLength =\r\n  //   tryParseInt(minBarcodeLengthString) ?? MIN_LENGTH_DEFAULT;\r\n  const MinAssetQRLength = tryParseInt(minBarcodeAssetLengthString) ?? 0;\r\n  // prevent accidental barcode detection on fast user input\r\n  if (action.payload.data.length < MinAssetQRLength) {\r\n    return;\r\n  }\r\n  const scannTarget: ScanTarget | undefined = yield select(\r\n    selectBarcodeScanTarget,\r\n  );\r\n  if (scannTarget === undefined || scannTarget !== ScanTarget.Inventory) {\r\n    return;\r\n  }\r\n  const isScanning = yield select(selectScanProcessing);\r\n  if (isScanning === true) {\r\n    return;\r\n  }\r\n  yield put(actions.setScanProcessing(true));\r\n  const appSettings: AppSettings = yield select(selectAppSettings);\r\n  yield put(\r\n    appSettingsActions.addNotification({\r\n      variant: 'info',\r\n      message:\r\n        i18next.t(translations.BarcodeScanModalBody) +\r\n        ' ' +\r\n        action.payload.data,\r\n    }),\r\n  );\r\n  try {\r\n    const scanResult = parseBarcode(action.payload.data, appSettings);\r\n    if (scanResult === undefined) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: (i18next.t(\r\n            translations.BarcodeNotFoundEx,\r\n          ) as string).replace('{{barcode}}', action.payload.data),\r\n        }),\r\n      );\r\n      yield put(actions.scanManualBarcode_error());\r\n    } else {\r\n      const room: IRoomDto | null = yield select(selectRoomSelected);\r\n      const location: ILocationListDto | null = yield select(\r\n        selectLocationSelected,\r\n      );\r\n      const subLocation: ISubLocationListDto | null = yield select(\r\n        selectSubLocationSelected,\r\n      );\r\n      // in case when barcode is entered manually\r\n      if (\r\n        scanResult.type === ScanTemplateResult.Internal ||\r\n        scanResult.type === ScanTemplateResult.Asset\r\n      ) {\r\n        let params = {\r\n          Barcode: scanResult.InternalCode ?? '',\r\n          RoomId: room?.Id,\r\n          LocationId: location?.Id,\r\n          SubLocationId: subLocation?.Id,\r\n        } as AssetBarcodeScanParameters;\r\n        const result = yield call(api.scanBarcode, params);\r\n        let response = result as AssetBarcodeScanResult;\r\n        if (response.SuccessMessages.length > 0) {\r\n          if (!!response.RoomDetails) {\r\n            if (room !== null && room !== undefined) {\r\n              if (room.Id !== response.RoomDetails.Id) {\r\n                yield put(\r\n                  actions.setSelectedRoom_Success(response.RoomDetails),\r\n                );\r\n                yield put(actions.setSelectedLocation_Success(null));\r\n                yield put(actions.setSelectedSubLocation_Success(null));\r\n              }\r\n            } else {\r\n              yield put(actions.setSelectedRoom_Success(response.RoomDetails));\r\n              yield put(actions.setSelectedLocation_Success(null));\r\n              yield put(actions.setSelectedSubLocation_Success(null));\r\n            }\r\n          }\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              variant: 'success',\r\n              message: response.SuccessMessages[0],\r\n            }),\r\n          );\r\n          yield put(actions.scanManualBarcode_Success());\r\n        } else {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              variant: 'error',\r\n              message: response.ErrorMessages[0],\r\n            }),\r\n          );\r\n          yield put(actions.scanManualBarcode_error());\r\n        }\r\n      } else if (scanResult.type === ScanTemplateResult.Room) {\r\n        if (\r\n          room !== null &&\r\n          room !== undefined &&\r\n          room.Id === tryParseInt(scanResult.RoomId)\r\n        ) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              variant: 'warning',\r\n              message: `Room: ${room.Name} already selected`,\r\n            }),\r\n          );\r\n          yield put(actions.scanManualBarcode_error());\r\n        } else {\r\n          // const roomData = yield call(\r\n          //   initRoomData,\r\n          //   scanResult.RoomId,\r\n          //   undefined,\r\n          //   undefined,\r\n          //   [\r\n          //     'Id',\r\n          //     'Name',\r\n          //     'AreaId',\r\n          //     'Areaname',\r\n          //     'Barcode',\r\n          //     'BuildingDescription',\r\n          //     'BuildingId',\r\n          //     'BuildingName',\r\n          //     'Description',\r\n          //     'Floor',\r\n          //     'CampusId',\r\n          //     'CampusName',\r\n          //   ],\r\n          // );\r\n          if (scanResult.RoomId !== undefined) {\r\n            const roomResult = yield call(\r\n              api.logRoomScan,\r\n              parseInt(scanResult.RoomId),\r\n            );\r\n            let response = roomResult as AssetBarcodeScanResult;\r\n            if (response.SuccessMessages.length > 0) {\r\n              if (!!response.RoomDetails) {\r\n                yield put(\r\n                  actions.setSelectedRoom_Success(response.RoomDetails),\r\n                );\r\n                yield put(actions.setSelectedLocation_Success(null));\r\n                yield put(actions.setSelectedSubLocation_Success(null));\r\n              }\r\n              yield put(\r\n                appSettingsActions.addNotification({\r\n                  variant: 'success',\r\n                  message: response.SuccessMessages[0],\r\n                }),\r\n              );\r\n              yield put(actions.scanManualBarcode_Success());\r\n            } else {\r\n              yield put(\r\n                appSettingsActions.addNotification({\r\n                  variant: 'error',\r\n                  message: response.ErrorMessages[0],\r\n                }),\r\n              );\r\n              yield put(actions.scanManualBarcode_error());\r\n            }\r\n            // yield put(actions.setSelectedRoom_Success(roomData[0]));\r\n            // yield put(actions.setSelectedLocation_Success(null));\r\n            // yield put(actions.setSelectedSubLocation_Success(null));\r\n            // yield put(\r\n            //   appSettingsActions.addNotification({\r\n            //     variant: 'success',\r\n            //     message: i18next.t(translations.RoomScanned),\r\n            //   }),\r\n            // );\r\n            // yield put(actions.scanManualBarcode_Success());\r\n          }\r\n        }\r\n      } else if (scanResult.type === ScanTemplateResult.Location) {\r\n        if (\r\n          location !== null &&\r\n          location !== undefined &&\r\n          location.Id === tryParseInt(scanResult.LocationId) &&\r\n          room?.Id === tryParseInt(scanResult.RoomId)\r\n        ) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              variant: 'warning',\r\n              message: `Location: ${location.Name} already selected`,\r\n            }),\r\n          );\r\n          yield put(actions.scanManualBarcode_error());\r\n        } else {\r\n          if (\r\n            scanResult.LocationId !== undefined &&\r\n            scanResult.RoomId !== undefined\r\n          ) {\r\n            const roomResult = yield call(\r\n              api.logLocationScan,\r\n              parseInt(scanResult.RoomId),\r\n              parseInt(scanResult.LocationId),\r\n            );\r\n            let response = roomResult as AssetBarcodeScanResult;\r\n            if (response.SuccessMessages.length > 0) {\r\n              if (!!response.RoomDetails && !!response.LocationDetails) {\r\n                yield put(\r\n                  actions.setSelectedRoom_Success(response.RoomDetails),\r\n                );\r\n                yield put(\r\n                  actions.setSelectedLocation_Success(response.LocationDetails),\r\n                );\r\n                yield put(actions.setSelectedSubLocation_Success(null));\r\n              }\r\n              yield put(\r\n                appSettingsActions.addNotification({\r\n                  variant: 'success',\r\n                  message: response.SuccessMessages[0],\r\n                }),\r\n              );\r\n              yield put(actions.scanManualBarcode_Success());\r\n            } else {\r\n              yield put(\r\n                appSettingsActions.addNotification({\r\n                  variant: 'error',\r\n                  message: response.ErrorMessages[0],\r\n                }),\r\n              );\r\n              yield put(actions.scanManualBarcode_error());\r\n            }\r\n          } else {\r\n            yield put(\r\n              appSettingsActions.addNotification({\r\n                variant: 'error',\r\n                message: `Scanned Location not found`,\r\n              }),\r\n            );\r\n            yield put(actions.scanManualBarcode_error());\r\n          }\r\n          // const locationData = yield call(\r\n          //   initLocationData,\r\n          //   scanResult.LocationId,\r\n          // );\r\n          // let locationResults = locationData as ILocationListDto[];\r\n          // if (!locationResults || locationResults.length === 0) {\r\n          //   yield put(\r\n          //     appSettingsActions.addNotification({\r\n          //       variant: 'error',\r\n          //       message: `Scanned Location not found`,\r\n          //     }),\r\n          //   );\r\n          //   yield put(actions.scanManualBarcode_error());\r\n          // } else {\r\n          //   let loc = locationResults[0];\r\n          //   if (\r\n          //     room === null ||\r\n          //     room === undefined ||\r\n          //     (loc.RoomId ?? 0) !== room.Id\r\n          //   ) {\r\n          //     if (loc.RoomId !== null && loc.RoomId !== undefined) {\r\n          //       const roomLocationData = yield call(\r\n          //         initRoomData,\r\n          //         loc.RoomId.toString(),\r\n          //         undefined,\r\n          //         undefined,\r\n          //         [\r\n          //           'Id',\r\n          //           'Name',\r\n          //           'AreaId',\r\n          //           'Areaname',\r\n          //           'Barcode',\r\n          //           'BuildingDescription',\r\n          //           'BuildingId',\r\n          //           'BuildingName',\r\n          //           'Description',\r\n          //           'Floor',\r\n          //           'CampusId',\r\n          //           'CampusName',\r\n          //         ],\r\n          //       );\r\n          //       let roomLocData = roomLocationData[0];\r\n          //       if (!roomLocData) {\r\n          //         yield put(\r\n          //           appSettingsActions.addNotification({\r\n          //             variant: 'error',\r\n          //             message: `No related Room found, Please select a Room first`,\r\n          //           }),\r\n          //         );\r\n          //         yield put(actions.scanManualBarcode_error());\r\n          //       } else {\r\n          //         yield put(actions.setSelectedRoom_Success(roomLocData));\r\n          //         yield put(actions.setSelectedLocation_Success(loc));\r\n          //         yield put(actions.setSelectedSubLocation_Success(null));\r\n          //         yield put(\r\n          //           appSettingsActions.addNotification({\r\n          //             variant: 'success',\r\n          //             message: 'Location Scanned',\r\n          //           }),\r\n          //         );\r\n          //         yield put(actions.scanManualBarcode_Success());\r\n          //       }\r\n          //     } else {\r\n          //       yield put(\r\n          //         appSettingsActions.addNotification({\r\n          //           variant: 'error',\r\n          //           message: `No related Room found for scanned Location, Please select a Room first`,\r\n          //         }),\r\n          //       );\r\n          //       yield put(actions.scanManualBarcode_error());\r\n          //     }\r\n          //   } else {\r\n          //     yield put(actions.setSelectedLocation_Success(loc));\r\n          //     yield put(actions.setSelectedSubLocation_Success(null));\r\n          //     yield put(\r\n          //       appSettingsActions.addNotification({\r\n          //         variant: 'success',\r\n          //         message: 'Location Scanned',\r\n          //       }),\r\n          //     );\r\n          //     yield put(actions.scanManualBarcode_Success());\r\n          //   }\r\n          // }\r\n        }\r\n      } else if (scanResult.type === ScanTemplateResult.SubLocation) {\r\n        if (\r\n          subLocation !== null &&\r\n          subLocation !== undefined &&\r\n          subLocation.Id === tryParseInt(scanResult.SubLocationId) &&\r\n          subLocation.LocationListId === tryParseInt(scanResult.LocationId) &&\r\n          subLocation.RoomId === tryParseInt(scanResult.RoomId)\r\n        ) {\r\n          yield put(\r\n            appSettingsActions.addNotification({\r\n              variant: 'warning',\r\n              message: `Sub Location: ${subLocation.Name} already selected`,\r\n            }),\r\n          );\r\n          yield put(actions.scanManualBarcode_error());\r\n        } else {\r\n          if (\r\n            scanResult.SubLocationId !== undefined &&\r\n            scanResult.LocationId !== undefined &&\r\n            scanResult.RoomId !== undefined\r\n          ) {\r\n            const roomResult = yield call(\r\n              api.logSubLocationScan,\r\n              parseInt(scanResult.RoomId),\r\n              parseInt(scanResult.LocationId),\r\n              parseInt(scanResult.SubLocationId),\r\n            );\r\n            let response = roomResult as AssetBarcodeScanResult;\r\n            if (response.SuccessMessages.length > 0) {\r\n              if (\r\n                !!response.RoomDetails &&\r\n                !!response.LocationDetails &&\r\n                !!response.SubLocationDetails\r\n              ) {\r\n                yield put(\r\n                  actions.setSelectedRoom_Success(response.RoomDetails),\r\n                );\r\n                yield put(\r\n                  actions.setSelectedLocation_Success(response.LocationDetails),\r\n                );\r\n                yield put(\r\n                  actions.setSelectedSubLocation_Success(\r\n                    response.SubLocationDetails,\r\n                  ),\r\n                );\r\n              }\r\n              yield put(\r\n                appSettingsActions.addNotification({\r\n                  variant: 'success',\r\n                  message: response.SuccessMessages[0],\r\n                }),\r\n              );\r\n              yield put(actions.scanManualBarcode_Success());\r\n            } else {\r\n              yield put(\r\n                appSettingsActions.addNotification({\r\n                  variant: 'error',\r\n                  message: response.ErrorMessages[0],\r\n                }),\r\n              );\r\n              yield put(actions.scanManualBarcode_error());\r\n            }\r\n          } else {\r\n            yield put(\r\n              appSettingsActions.addNotification({\r\n                variant: 'error',\r\n                message: `Scanned Sub Location not found`,\r\n              }),\r\n            );\r\n            yield put(actions.scanManualBarcode_error());\r\n          }\r\n          // const subLocationData = yield call(\r\n          //   initSubLocationListData,\r\n          //   scanResult.SubLocationId,\r\n          // );\r\n          // let subResults = subLocationData as ISubLocationListDto[];\r\n          // if (!subResults || subResults.length === 0) {\r\n          //   yield put(\r\n          //     appSettingsActions.addNotification({\r\n          //       variant: 'error',\r\n          //       message: `Scanned Sub Location not found`,\r\n          //     }),\r\n          //   );\r\n          //   yield put(actions.scanManualBarcode_error());\r\n          // } else {\r\n          //   let sub = subResults[0];\r\n          //   if (\r\n          //     room === null ||\r\n          //     room === undefined ||\r\n          //     (sub.RoomId ?? 0) !== room.Id\r\n          //   ) {\r\n          //     if (sub.RoomId !== null && sub.RoomId !== undefined) {\r\n          //       const roomSubLocData = yield call(\r\n          //         initRoomData,\r\n          //         sub.RoomId.toString(),\r\n          //         undefined,\r\n          //         undefined,\r\n          //         [\r\n          //           'Id',\r\n          //           'Name',\r\n          //           'AreaId',\r\n          //           'Areaname',\r\n          //           'Barcode',\r\n          //           'BuildingDescription',\r\n          //           'BuildingId',\r\n          //           'BuildingName',\r\n          //           'Description',\r\n          //           'Floor',\r\n          //           'CampusId',\r\n          //           'CampusName',\r\n          //         ],\r\n          //       );\r\n          //       let roomSubData = roomSubLocData[0];\r\n          //       if (!roomSubData) {\r\n          //         yield put(\r\n          //           appSettingsActions.addNotification({\r\n          //             variant: 'error',\r\n          //             message: `No related Room found, Please select a Room first`,\r\n          //           }),\r\n          //         );\r\n          //         yield put(actions.scanManualBarcode_error());\r\n          //       } else {\r\n          //         const locSubData = yield call(\r\n          //           initLocationData,\r\n          //           sub.LocationListId.toString(),\r\n          //         );\r\n          //         yield put(actions.setSelectedRoom_Success(roomSubData));\r\n          //         yield put(actions.setSelectedLocation_Success(locSubData[0]));\r\n          //         yield put(actions.setSelectedSubLocation_Success(sub));\r\n          //         yield put(\r\n          //           appSettingsActions.addNotification({\r\n          //             variant: 'success',\r\n          //             message: 'Sub Location Scanned',\r\n          //           }),\r\n          //         );\r\n          //         yield put(actions.scanManualBarcode_Success());\r\n          //       }\r\n          //     } else {\r\n          //       yield put(\r\n          //         appSettingsActions.addNotification({\r\n          //           variant: 'error',\r\n          //           message: `No related Room found for scanned Sub Location, Please select a Room first`,\r\n          //         }),\r\n          //       );\r\n          //       yield put(actions.scanManualBarcode_error());\r\n          //     }\r\n          //   } else if (location === null || location === undefined) {\r\n          //     const locSubData = yield call(\r\n          //       initLocationData,\r\n          //       sub.LocationListId.toString(),\r\n          //     );\r\n          //     yield put(actions.setSelectedLocation_Success(locSubData[0]));\r\n          //     yield put(actions.setSelectedSubLocation_Success(sub));\r\n          //     yield put(\r\n          //       appSettingsActions.addNotification({\r\n          //         variant: 'success',\r\n          //         message: 'Sub Location Scanned',\r\n          //       }),\r\n          //     );\r\n          //     yield put(actions.scanManualBarcode_Success());\r\n          //   } else {\r\n          //     yield put(actions.setSelectedSubLocation_Success(sub));\r\n          //     yield put(\r\n          //       appSettingsActions.addNotification({\r\n          //         variant: 'success',\r\n          //         message: 'Sub Location Scanned',\r\n          //       }),\r\n          //     );\r\n          //     yield put(actions.scanManualBarcode_Success());\r\n          //   }\r\n          // }\r\n        }\r\n      } else {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            message: (i18next.t(\r\n              translations.BarcodeNotFoundEx,\r\n            ) as string).replace('{{barcode}}', action.payload.data),\r\n          }),\r\n        );\r\n        yield put(actions.scanManualBarcode_error());\r\n      }\r\n    }\r\n  } catch (error) {\r\n    console.error(`${action.type}`, action.payload, error);\r\n    yield put(actions.scanManualBarcode_error());\r\n  }\r\n}\r\nfunction* doSetNoRoomAccess() {\r\n  const roomSelected: IRoomDto | null = yield select(selectRoomSelected);\r\n  if (roomSelected === null || roomSelected === undefined) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: 'Please select a Room first',\r\n      }),\r\n    );\r\n    yield put(actions.setNoRoomAccess_error());\r\n  } else {\r\n    const result = yield call(api.logNoRoomAccess, roomSelected.Id);\r\n    let response = result as AssetBarcodeScanResult;\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'success',\r\n          message: response.SuccessMessages[0],\r\n        }),\r\n      );\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'warning',\r\n            message: response.WarningMessages[0],\r\n          }),\r\n        );\r\n      }\r\n      yield put(actions.setNoRoomAccess_success());\r\n    }\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: response.ErrorMessages[0],\r\n        }),\r\n      );\r\n      yield put(actions.setNoRoomAccess_error());\r\n    }\r\n  }\r\n}\r\nexport function* assetInventoryStateSaga() {\r\n  yield takeLatest(\r\n    actions.setSelectedSubLocation.type,\r\n    doSetSelectedSubLocation,\r\n  );\r\n  yield takeLatest(actions.setSelectedLocation.type, doSetSelectedLocation);\r\n  yield takeLatest(actions.setSelectedRoom.type, doSetSelectedRoom);\r\n  yield takeLatest(BARCODE_SCANNED, doBarcodeScan);\r\n  yield takeLatest(actions.scanManualBarcode, doBarcodeScan);\r\n  yield takeLatest(actions.setNoRoomAccess, doSetNoRoomAccess);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { ISubLocationListDto } from 'api/odata/generated/entities/ISubLocationListDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { assetInventoryStateSaga } from './saga';\r\nimport { AssetInventoryState } from './types';\r\n\r\nexport const initialState: AssetInventoryState = {\r\n  selectedRoomState: null,\r\n  selectedLocationState: null,\r\n  selectedSubLocationState: null,\r\n  scanProcessing: undefined,\r\n  noRoomAccessProcessing: undefined,\r\n  logFilters: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'assetInventory',\r\n  initialState,\r\n  reducers: {\r\n    setSelectedRoom(state, action: PayloadAction<IRoomDto | null>) {},\r\n    setSelectedRoom_Success(state, action: PayloadAction<IRoomDto | null>) {\r\n      state.selectedRoomState = action.payload;\r\n    },\r\n    setSelectedLocation(\r\n      state,\r\n      action: PayloadAction<ILocationListDto | null>,\r\n    ) {},\r\n    setSelectedLocation_Success(\r\n      state,\r\n      action: PayloadAction<ILocationListDto | null>,\r\n    ) {\r\n      state.selectedLocationState = action.payload;\r\n    },\r\n    setSelectedSubLocation(\r\n      state,\r\n      action: PayloadAction<ISubLocationListDto | null>,\r\n    ) {},\r\n    setSelectedSubLocation_Success(\r\n      state,\r\n      action: PayloadAction<ISubLocationListDto | null>,\r\n    ) {\r\n      state.selectedSubLocationState = action.payload;\r\n    },\r\n    scanManualBarcode(state, action: PayloadAction<{ data: string }>) {},\r\n    scanManualBarcode_Success(state, action: PayloadAction) {\r\n      state.scanProcessing = false;\r\n    },\r\n    scanManualBarcode_error(state, action: PayloadAction) {\r\n      state.scanProcessing = false;\r\n    },\r\n    setNoRoomAccess(state, action: PayloadAction) {\r\n      state.noRoomAccessProcessing = true;\r\n    },\r\n    setNoRoomAccess_success(state, action: PayloadAction) {\r\n      state.noRoomAccessProcessing = false;\r\n    },\r\n    setNoRoomAccess_error(state, action: PayloadAction) {\r\n      state.noRoomAccessProcessing = false;\r\n    },\r\n    setNoRoomAccessProcessing(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.noRoomAccessProcessing = action.payload;\r\n    },\r\n    setScanProcessing(state, action: PayloadAction<boolean | undefined>) {\r\n      state.scanProcessing = action.payload;\r\n    },\r\n    setLogFilters(\r\n      state,\r\n      action: PayloadAction<Record<string, any> | undefined>,\r\n    ) {\r\n      state.logFilters = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: assetInventoryActions } = slice;\r\n\r\nexport const useAssetInventorySlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: assetInventoryStateSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useAssetInventorySlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { call, put, select, takeLatest } from 'redux-saga/effects';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { messagesActions as actions } from '.';\r\nimport {\r\n  CalendarMessageProps,\r\n  LoanDesk,\r\n  Message,\r\n  messageType,\r\n  StartedReservation,\r\n  UsageReservation,\r\n} from './type';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport { MessageProps, pageNames } from '..';\r\n\r\nconst reservePrefix = 'reservationStarted_';\r\nconst usagePrefix = 'usageReservation_';\r\nconst loanPrefix = 'LoanDeskReservation_';\r\n// const announcePrefix = 'Announcment_';\r\nconst calendarprefix = 'calendar_';\r\n\r\nconst reservationStartedurl = '/api/odata/v4/ReservationStarted';\r\nconst usageReservationUrl = '/api/odata/v4/UsageReservation';\r\nconst LoanDeskReservationUrl = '/api/odata/v4/LoanDeskReservation';\r\nconst calendarUrl = odataUrlPrefix + 'CalendarMessages/Show';\r\nfunction* doInit(action: PayloadAction<MessageProps>) {\r\n  const messages: Message[] = [];\r\n  const page = action.payload.pageName;\r\n  const funcs = getPageMessages(page);\r\n  for (let index = 0; index < funcs.length; index++) {\r\n    const func = funcs[index];\r\n    yield* func(messages, action.payload);\r\n  }\r\n  // if (page !== 'calendar') {\r\n  //   yield* addReservations(messages);\r\n  //   yield* addUsages(messages);\r\n  //   yield* addLoanDesks(messages);\r\n  //   // yield* doAnnouncement(messages);\r\n  // }\r\n  // yield* addCalendarMessages(messages, action.payload);\r\n  yield put(actions.init_success(messages));\r\n}\r\n\r\ntype MessageGetter = (\r\n  messages: Message[],\r\n  props: MessageProps,\r\n) => Generator<unknown, void, unknown>;\r\n\r\nfunction getPageMessages(pageName: pageNames): MessageGetter[] {\r\n  switch (pageName) {\r\n    case 'calendar':\r\n      return [addCalendarMessages];\r\n    case 'assetDetails':\r\n      return [addReservations, addUsages];\r\n    default:\r\n      return [addReservations, addUsages, addLoanDesks, addCalendarMessages];\r\n  }\r\n}\r\n\r\nfunction* doeRefreshReservations(_action: PayloadAction) {\r\n  const messages: Message[] = [];\r\n  yield* addReservations(messages);\r\n  yield put(actions.init_success(messages));\r\n}\r\n\r\nfunction* addReservations(messages: Message[]) {\r\n  const reservationsInValue = yield call(httpClient.get, reservationStartedurl);\r\n  const reservations = reservationsInValue.value as StartedReservation[];\r\n  messages.push(\r\n    ...reservations.map((r, _i) => ({\r\n      type: messageType.reservationStarted,\r\n      props: r,\r\n      key: reservePrefix + r.Id,\r\n    })),\r\n  );\r\n}\r\n\r\nfunction* addUsages(messages: Message[]) {\r\n  const usagesInValue = yield call(httpClient.get, usageReservationUrl);\r\n  const usages = usagesInValue.value as UsageReservation[];\r\n  messages.push(\r\n    ...usages.map((r, _i) => ({\r\n      type: messageType.usageReservation,\r\n      props: r,\r\n      key: usagePrefix + r.Id,\r\n    })),\r\n  );\r\n}\r\n\r\nfunction* addLoanDesks(messages: Message[]) {\r\n  const LoanDeskInValue = yield call(httpClient.get, LoanDeskReservationUrl);\r\n  const LoanDesks = LoanDeskInValue.value as LoanDesk[];\r\n  messages.push(\r\n    ...LoanDesks.map((r, _i) => ({\r\n      type: messageType.loadDesk,\r\n      props: r,\r\n      key: loanPrefix + r.Id,\r\n    })),\r\n  );\r\n}\r\n\r\nfunction* addCalendarMessages(messages: Message[], props: MessageProps) {\r\n  const params: {\r\n    $select: string;\r\n    $filter?: string;\r\n  } = { $select: 'Id,Title,Body' };\r\n  const now = new Date();\r\n  const groups = yield select(selectGlobalServiceGroupFilter);\r\n  params.$filter = new ODataFilterBuilder({\r\n    predicates: [\r\n      new Condition(\r\n        'StartDate',\r\n        ODataOperators.LessThanEqual,\r\n        now,\r\n      ).withNull() ?? '',\r\n      new Condition(\r\n        'EndDate',\r\n        ODataOperators.GreaterThanEqual,\r\n        now,\r\n      ).withNull() ?? '',\r\n      new Condition(\r\n        'ServiceGroupId',\r\n        ODataOperators.Includes,\r\n        groups,\r\n      ).withNull() ?? '',\r\n      new Condition('ShowOn', ODataOperators.Contains, props.pageName),\r\n      new Condition(\r\n        'EquipmentId',\r\n        ODataOperators.Includes,\r\n        props.selectedEquipment,\r\n      ).withNull() ?? '',\r\n    ],\r\n  }).toString();\r\n  const calendarInValue = yield call(httpClient.get, calendarUrl, params);\r\n  const calendars = calendarInValue.value as CalendarMessageProps[];\r\n  messages.push(\r\n    ...calendars.map(c => ({\r\n      type: messageType.calendar,\r\n      key: calendarprefix + c.Id,\r\n      props: c,\r\n    })),\r\n  );\r\n}\r\n\r\n// function* doAnnouncement(messages: Message[]) {\r\n//   const settings: GlobalSettings = yield select(selectglobalSettings);\r\n//   const userSettings: UserProfile = yield select(selectUserProfileSettings);\r\n//   if (\r\n//     settings.GetBooleanByKey(AllowedSettings.ShowDashboardAnnouncement) &&\r\n//     !userSettings.GetSettingByKey(\r\n//       AllowedSettings[AllowedSettings.DashboardAnnouncement],\r\n//     )\r\n//   ) {\r\n//     const announcent = settings.GetString(\r\n//       AllowedSettings.DashboardAnnouncement,\r\n//     );\r\n//     if (!!announcent) {\r\n//       messages.push({\r\n//         type: messageType.removableAnnouncment,\r\n//         props: announcent,\r\n//         key: announcePrefix + 0,\r\n//       });\r\n//     }\r\n//   }\r\n//   const userHelp = settings.GetString(AllowedSettings.Help_Dashboard);\r\n//   if (userHelp.trim() !== '') {\r\n//     messages.push({\r\n//       type: messageType.Announcment,\r\n//       props: userHelp,\r\n//       key: announcePrefix + 1,\r\n//     });\r\n//   }\r\n// }\r\n\r\nfunction* doGotIt(action: PayloadAction<string>) {\r\n  const authenticatedUser: AuthenticatedUser | undefined = yield select(\r\n    selectAuthenticatedUser,\r\n  );\r\n  yield put(\r\n    appSettingsActions.saveUserProfileSetting({\r\n      Key: action.payload,\r\n      Value: true.toString(),\r\n      UserName: authenticatedUser?.Id ?? '',\r\n      Enabled: true,\r\n    }),\r\n  );\r\n}\r\n\r\nexport function* messagesSaga() {\r\n  yield takeLatest(actions.init.type, doInit);\r\n  yield takeLatest(actions.gotIt.type, doGotIt);\r\n  yield takeLatest(actions.refreshUsages.type, doeRefreshReservations);\r\n}\r\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\r\nimport { SnackbarKey } from 'notistack';\r\nimport { useInjectReducer, useInjectSaga } from 'redux-injectors';\r\nimport { messagesSaga } from './saga';\r\nimport { Message, MessagesState } from './type';\r\nimport { MessageProps } from '..';\r\n\r\nexport const initialState: MessagesState = {\r\n  messages: [],\r\n  initialized: 0,\r\n  processing: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'messagesState',\r\n  initialState,\r\n  reducers: {\r\n    init(state, action: PayloadAction<MessageProps>) {\r\n      state.initialized = state.initialized + 1;\r\n      state.processing = true;\r\n    },\r\n    init_success(state, action: PayloadAction<Message[]>) {\r\n      state.messages.push(...action.payload);\r\n      state.processing = false;\r\n    },\r\n    remove(state, action: PayloadAction<SnackbarKey>) {\r\n      state.messages = [\r\n        ...state.messages.filter(m => m.key !== action.payload),\r\n      ];\r\n    },\r\n    gotIt(state, action: PayloadAction<string>) {},\r\n    clear(state, action: PayloadAction) {\r\n      state.messages = [];\r\n      state.initialized = state.initialized - 1;\r\n    },\r\n    refreshUsages(state, action: PayloadAction) {},\r\n  },\r\n});\r\nexport const { actions: messagesActions } = slice;\r\n\r\nexport const useMessagesSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: messagesSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { FormFieldsSection } from 'app/components/Forms/FormsLayout';\r\nimport {\r\n  loadOfflineServiceData,\r\n  UsageRelatedFilter,\r\n} from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { BookQuickServices } from 'app/pages/OtherServiceDetails/Details/components/BookQuickServices';\r\nimport { ErrorServices } from 'app/pages/OtherServiceDetails/Details/slice/types';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IUsageHistory } from 'app/pages/UsageHistoryPage/IUsageHistory';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface EndUsageOfflineServicesProps {\r\n  title: string;\r\n  offlineIds: number[];\r\n  usageId: number;\r\n  onChange: (services: IOtherServices[]) => void;\r\n  isProcessing: boolean;\r\n  setError?: (error: ErrorServices) => void;\r\n  reset?: boolean;\r\n  usageData?: IUsageHistory;\r\n}\r\nexport function EndUsageOfflineServices(props: EndUsageOfflineServicesProps) {\r\n  const { title, setError, offlineIds, usageId, onChange, usageData } = props;\r\n  const { t } = useTranslation();\r\n  //const dispatch = useDispatch();\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  //const { actions } = useOfflineServiceStateSlice();\r\n  //const { actions: layoutActions } = useLayoutSlice();\r\n  const [servicesSelected, setServicesSelected] = useAsyncExtendedState<\r\n    IOtherServices[]\r\n  >([]);\r\n  //const { openPanel } = useSidePanelState(undefined, undefined, false, false);\r\n  React.useEffect(() => {\r\n    if (props.reset === true) {\r\n      setServicesSelected([]);\r\n    }\r\n  }, [props.reset, setServicesSelected]);\r\n  const changeOfflineServices = React.useCallback(\r\n    (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n      if (operation === 'add') {\r\n        let addedServ = services.filter(\r\n          f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n        );\r\n        setServicesSelected([...servicesSelected, ...addedServ]);\r\n        onChange([...servicesSelected, ...addedServ]);\r\n      }\r\n      if (operation === 'remove') {\r\n        let otherServices = servicesSelected.filter(f => {\r\n          return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n        });\r\n        setServicesSelected(otherServices);\r\n        onChange(otherServices);\r\n      }\r\n      if (operation === 'update') {\r\n        const updated = servicesSelected.map(f => {\r\n          let service = services.find(s => s.ServiceTypeID === f.ServiceTypeID);\r\n          if (!!service && service !== null) {\r\n            return Object.assign({}, f, service);\r\n          } else {\r\n            return f;\r\n          }\r\n        });\r\n        setServicesSelected(updated);\r\n        onChange(updated);\r\n      }\r\n    },\r\n    [onChange, servicesSelected, setServicesSelected],\r\n  );\r\n  const initServices = async (): Promise<IOtherServices[]> => {\r\n    return new Promise(async resolve => {\r\n      resolve(servicesSelected);\r\n    });\r\n  };\r\n  const fetchServiceType = async (\r\n    searchTerm: string | null,\r\n    predicates: (string | Condition<IOfflineServiceFilterDto>)[] | undefined,\r\n  ) => {\r\n    try {\r\n      const data = await loadOfflineServiceData(\r\n        [\r\n          ...UsageRelatedFilter(\r\n            offlineIds,\r\n            servicesSelected.map(f => f.Id),\r\n          ),\r\n          ...(predicates ?? []),\r\n        ],\r\n        'base',\r\n        [],\r\n        undefined,\r\n        'InventoryBatches',\r\n      )(searchTerm, undefined);\r\n      return data.value;\r\n    } catch {\r\n      return [];\r\n    }\r\n  };\r\n  const prepareService = (serviceType: IOfflineServiceFilterDto) => {\r\n    let batch = serviceType.InventoryBatchesEnabled\r\n      ? !!serviceType.InventoryBatches &&\r\n        serviceType.InventoryBatches.length > 0\r\n        ? serviceType.InventoryBatches.filter(\r\n            f =>\r\n              (f.ExpirationDate === null ||\r\n                getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n              (serviceType.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n              f.StokRenewed === true,\r\n          ).sort((a: IInventoryBatchDto, b: IInventoryBatchDto) => {\r\n            return b.Id - a.Id;\r\n          })[0]\r\n        : null\r\n      : null;\r\n    let data = {\r\n      Id: 0,\r\n      BookedBy: usageData?.UserName,\r\n      UserDisplayName: usageData?.UserDisplayName,\r\n      BudgetID: usageData?.BudgetId,\r\n      Budget: usageData?.BudgetNumber,\r\n      BudgetExperimentId: usageData?.BudgetExperimentId,\r\n      BudgetExperimentName: usageData?.BudgetExperimentName,\r\n      Quantity: serviceType.DefaultQuantity,\r\n      DefaultQuantity: serviceType.DefaultQuantity,\r\n      ExternalCustomerId: null,\r\n      ExternalCustomerName: null,\r\n      FundingType: null,\r\n      IntQuantityOnly: serviceType.IntQuantityOnly,\r\n      DiscountFactor: 1,\r\n      InstituteProjectId: null,\r\n      InstituteProjectName: null,\r\n      PurchaseOrder: null,\r\n      Reference: null,\r\n      Mandatory: false,\r\n      Remarks: (t(translations.UsageOfflineServiceDefaultRemarks) as string)\r\n        .replace('{0}', String(usageId))\r\n        .replace('{1}', ''),\r\n      ReservationId: null,\r\n      UsageId: usageId,\r\n      ServiceDate: dateUtils.formatISO(dateUtils.dateOrStringToDate(newDate())),\r\n      ServiceTypeID: serviceType.Id,\r\n      ServiceType: serviceType.Name,\r\n      ServiceGroupId: serviceType.ServiceGroupId,\r\n      Units: serviceType.UnitTypeName,\r\n      UserGroup: usageData?.UserGroup,\r\n      UserGroupName: usageData?.UserGroupName,\r\n      AllowToUser: serviceType.AllowToUser,\r\n      BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n      StaffOnly: serviceType.StaffOnly,\r\n      TrackInventory: serviceType.TrackInventory,\r\n      NotLessThanZero: serviceType.NotLessThanZero,\r\n      InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n      InventoryBatchId: batch === null ? null : batch.Id,\r\n      InventoryBatchName: batch === null ? null : batch.Name,\r\n      InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n    } as IOtherServices;\r\n    return data;\r\n  };\r\n  const createService = async (\r\n    serviceType: IOfflineServiceFilterDto,\r\n  ): Promise<IOtherServices | undefined> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticService = prepareService(serviceType);\r\n      changeOfflineServices([staticService], 'add');\r\n      resolve(staticService);\r\n    });\r\n  };\r\n  const onRemoveService = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices([service], 'remove');\r\n      resolve(service);\r\n    });\r\n  };\r\n  const onUpdateService = (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices([service], 'update');\r\n      resolve(service);\r\n    });\r\n  };\r\n  // const handleOfflineServiceClick = React.useCallback(\r\n  //   (service: IOtherServices) => {\r\n  //     if (edit) {\r\n  //       let otherProps = {\r\n  //         initialService: service,\r\n  //         saveCreatable: true,\r\n  //         queryParams: {\r\n  //           id: '' + service.Id ?? -1,\r\n  //         },\r\n  //       };\r\n  //       openPanel({\r\n  //         renderPageType: RenderPageType.OtherServiceDetails,\r\n  //         renderPageProps: otherProps,\r\n  //         expanded: false,\r\n  //         useSidePanel: useSidePanel,\r\n  //         isCover: useSidePanel,\r\n  //       } as SidePanelOpenState);\r\n  //     }\r\n  //   },\r\n  //   [edit, openPanel, useSidePanel],\r\n  // );\r\n  // const onOfflineServiceClick = React.useCallback(\r\n  //   (service: IOtherServices) => {\r\n  //     let otherProps = {\r\n  //       initialService: Object.assign({}, service, {\r\n  //         UserGroup: usageData?.UserGroup ?? null,\r\n  //         UserGroupName: usageData?.UserGroupName ?? null,\r\n  //         Budget: usageData?.BudgetNumber ?? null,\r\n  //         BudgetID: usageData?.BudgetId ?? null,\r\n  //         UserDisplayName: usageData?.UserDisplayName ?? null,\r\n  //         BookedBy: usageData?.UserName ?? null,\r\n  //       }),\r\n  //       editCreatable: true,\r\n  //       queryParams: {\r\n  //         id: '' + service.Id ?? -1,\r\n  //       },\r\n  //     };\r\n  //     dispatch(layoutActions.setNotSavedChanges(false));\r\n  //     openPanel({\r\n  //       renderPageType: RenderPageType.OtherServiceDetails,\r\n  //       renderPageProps: otherProps,\r\n  //       expanded: false,\r\n  //       useSidePanel: false,\r\n  //       isCover: false,\r\n  //     } as SidePanelOpenState);\r\n  //   },\r\n  //   [\r\n  //     dispatch,\r\n  //     layoutActions,\r\n  //     openPanel,\r\n  //     usageData?.BudgetId,\r\n  //     usageData?.BudgetNumber,\r\n  //     usageData?.UserDisplayName,\r\n  //     usageData?.UserGroup,\r\n  //     usageData?.UserGroupName,\r\n  //     usageData?.UserName,\r\n  //   ],\r\n  // );\r\n  return (\r\n    <FormFieldsSection titleSection={title} titleVariant=\"boldS\">\r\n      <BookQuickServices\r\n        loadSeviceTypes={fetchServiceType}\r\n        createServiceFromServiceType={createService}\r\n        initServicesFunc={initServices}\r\n        onServiceRemove={onRemoveService}\r\n        onServiceUpdate={onUpdateService}\r\n        //onServiceClick={onOfflineServiceClick}\r\n        isEditMode={false}\r\n        disabled={false}\r\n        createdEditable={true}\r\n        //onAddBatchClick={onAddBatchClick}\r\n        setError={setError}\r\n      />\r\n    </FormFieldsSection>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport { useEffect, useState } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { FormHelperText } from '@material-ui/core';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledFormFieldsContainer,\r\n} from '../Forms/FormsLayout';\r\nimport { SkeletonIfLoading } from 'app/Layout/FrontendLayout/components/PageWrapper/components/SkeletonIfLoading';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { odataUrlPrefix } from 'utils/url-utils';\r\nimport { Body } from '../Typography';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport styled from 'styled-components';\r\nimport { EndUsageOfflineServices } from './EndUsageOfflineServices';\r\nimport { IUsageHistory } from 'app/pages/UsageHistoryPage/IUsageHistory';\r\nimport { BasicCheckBox } from '../BasicCheckBox';\r\n\r\ninterface OffService {\r\n  quantity: number | null;\r\n  service: Entity<number> | null;\r\n}\r\n\r\nexport interface EndUsageData {\r\n  services: OffService[];\r\n  remarks: string | undefined;\r\n}\r\n\r\nexport interface EndUsageConfirmProps {\r\n  isopen: boolean;\r\n  onClose: () => void;\r\n  ids?: number[];\r\n  onConfirm: (data: EndUsageData) => void;\r\n  usageProcessing?: boolean;\r\n  message?: string;\r\n  equipmentId?: number;\r\n  usageId: number;\r\n}\r\n\r\nexport const EndUsageConfirm = ({\r\n  isopen,\r\n  onClose,\r\n  onConfirm,\r\n  usageProcessing,\r\n  message,\r\n  equipmentId,\r\n  usageId,\r\n  ...props\r\n}: EndUsageConfirmProps) => {\r\n  const [selectedServices, setSelectedServices] = useState<OffService[]>([]);\r\n  const [remarks, setRemarks] = useState<string | undefined>();\r\n  const [ids, setIds] = useState(props.ids);\r\n  const [loading, setLoading] = useState(false);\r\n  const [error, setError] = useState<string | undefined>();\r\n  const [reset, setReset] = useState(false);\r\n  const [usageData, setUsageData] = useState<IUsageHistory | undefined>(\r\n    undefined,\r\n  );\r\n  const [confirmUsageEnd, setConfirmUsageEnd] = useState(false);\r\n  useEffect(() => {\r\n    if (!!ids || !equipmentId || !isopen) return;\r\n    let mounted = true;\r\n    setLoading(true);\r\n    (async () => {\r\n      try {\r\n        const res = await httpClient.get(\r\n          `${odataUrlPrefix}AssetDetails/GetEquipmentServices`,\r\n          { equipmentId },\r\n        );\r\n        const usage = await httpClient.get(`${odataUrlPrefix}UsageHistory`, {\r\n          $filter: `Id eq ${usageId}`,\r\n        });\r\n        if (mounted) {\r\n          setIds(res.value);\r\n          setLoading(false);\r\n          setReset(false);\r\n          setUsageData(usage.value[0]);\r\n        }\r\n      } catch (error) {\r\n      } finally {\r\n        if (mounted) {\r\n          setLoading(false);\r\n        }\r\n      }\r\n    })();\r\n    return () => {\r\n      mounted = false;\r\n    };\r\n  }, [ids, equipmentId, isopen, usageId]);\r\n  const { t } = useTranslation();\r\n  const handleClose = () => {\r\n    onClose();\r\n    setReset(true);\r\n    setError(undefined);\r\n  };\r\n  const endUsageWithOffline = React.useMemo(() => {\r\n    return !!ids && ids.length > 0;\r\n  }, [ids]);\r\n  const endUsageOfflineValid = React.useMemo(() => {\r\n    return (!!remarks && remarks !== '') || selectedServices.length > 0;\r\n  }, [remarks, selectedServices]);\r\n  return (\r\n    <DialogConfirm\r\n      title={t(translations.ConfirmEndUsage_title)}\r\n      subtitle={\r\n        endUsageWithOffline ? t(translations.EndUsageConfirmTitle) : undefined\r\n      }\r\n      isOpen={isopen}\r\n      onCancel={handleClose}\r\n      onClose={handleClose}\r\n      dialogRootClassName={'end-usage-dialog'}\r\n      processing={usageProcessing}\r\n      maxWidth=\"sm\"\r\n      body={\r\n        <SkeletonIfLoading loading={loading}>\r\n          <>\r\n            {!!ids && endUsageWithOffline ? (\r\n              <EndUsageRoot className=\"end-usage-root\" id=\"end-usage\">\r\n                {/* <p>{t(translations.EndUsageConfirmTitle)}</p> */}\r\n                <StyledFormFieldsContainer noPadding>\r\n                  <FormLeftSection>\r\n                    <EndUsageOfflineServices\r\n                      offlineIds={ids}\r\n                      isProcessing={loading}\r\n                      title={t(translations.UsageEndOfflineService) as string}\r\n                      setError={err => setError(err.error)}\r\n                      usageId={usageId}\r\n                      reset={reset}\r\n                      usageData={usageData}\r\n                      onChange={services => {\r\n                        setSelectedServices(\r\n                          services.map(s => {\r\n                            return {\r\n                              quantity: s.Quantity,\r\n                              service: {\r\n                                Id: s.ServiceTypeID,\r\n                                Name: s.ServiceTypeName,\r\n                              } as Entity<number>,\r\n                            };\r\n                          }),\r\n                        );\r\n                      }}\r\n                    />\r\n                    <FormFieldsSection\r\n                      titleSection={t(translations.ReasonRemarks)}\r\n                      titleVariant=\"boldS\"\r\n                    >\r\n                      <FormRow>\r\n                        <TextControlField\r\n                          placeholder={\r\n                            t(translations.UsageEndRemarksPlaceholder) as string\r\n                          }\r\n                          variant=\"filled\"\r\n                          fullWidth\r\n                          id=\"end-usage-remarks\"\r\n                          rows={10}\r\n                          multiline\r\n                          autoFocus\r\n                          value={remarks}\r\n                          onChange={v => setRemarks(v.target.value)}\r\n                        />\r\n                      </FormRow>\r\n                      <FormRow>\r\n                        <BasicCheckBox\r\n                          label={t(translations.ConfirmServicesCorrectly)}\r\n                          onChange={(val, e) =>\r\n                            setConfirmUsageEnd(e.target.checked)\r\n                          }\r\n                          checked={confirmUsageEnd}\r\n                          name={'Confirm'}\r\n                          required={confirmUsageEnd !== true}\r\n                          maxLabelWidth={100}\r\n                        />\r\n                      </FormRow>\r\n                    </FormFieldsSection>\r\n                    {error && <FormHelperText error>{error}</FormHelperText>}\r\n                  </FormLeftSection>\r\n                </StyledFormFieldsContainer>\r\n              </EndUsageRoot>\r\n            ) : (\r\n              <Body>{message ?? t(translations.ConfirmEndUsage)}</Body>\r\n            )}\r\n          </>\r\n        </SkeletonIfLoading>\r\n      }\r\n      disabled={\r\n        usageProcessing ||\r\n        (endUsageWithOffline &&\r\n          (confirmUsageEnd !== true || !endUsageOfflineValid))\r\n      }\r\n      onConfirm={() => {\r\n        if (endUsageWithOffline) {\r\n          if (!endUsageOfflineValid) {\r\n            setError(t(translations.ConfirmEndUsage_err) as string);\r\n            return;\r\n          }\r\n        }\r\n        if (!error) {\r\n          onConfirm({ services: selectedServices, remarks: remarks });\r\n        }\r\n      }}\r\n    />\r\n  );\r\n};\r\nconst EndUsageRoot = styled.div`\r\n  &.end-usage-root {\r\n    display: flex;\r\n    flex-direction: column;\r\n    gap: 16px;\r\n    & .end-usage-item {\r\n      border: 1px solid ${bookitColors.grayscale.grayBorders};\r\n      border-radius: 5px;\r\n      gap: 10%;\r\n      padding: 10px 0px;\r\n      display: flex;\r\n      justify-content: space-around;\r\n    }\r\n  }\r\n`;\r\n","/**\r\n *\r\n * BasicDialogActions\r\n *\r\n */\r\nimport {\r\n  Box,\r\n  createStyles,\r\n  DialogActions as MuiDialogActions,\r\n  makeStyles,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { DialogActionsRenderer } from './DialogActionsRender';\r\n\r\nconst actionsStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      justifyContent: 'space-between',\r\n      margin: 0,\r\n      padding: theme.spacing(3, 4),\r\n      boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n    },\r\n    leftActions: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: 0,\r\n      flexWrap: 'wrap',\r\n      gap: 8,\r\n    },\r\n    rightActions: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n      padding: '4px 16px',\r\n      flexWrap: 'wrap',\r\n      gap: 8,\r\n    },\r\n  }),\r\n);\r\nexport interface BasicDialogActionsProps {\r\n  leftActions: DialogActionsRenderer[];\r\n  rightActions: DialogActionsRenderer[];\r\n}\r\n\r\nexport function BasicDialogActions(props: BasicDialogActionsProps) {\r\n  const { leftActions, rightActions } = props;\r\n  const classes = actionsStyles();\r\n  return (\r\n    <MuiDialogActions className={classes.root}>\r\n      {leftActions.length > 0 && (\r\n        <Box className={classes.leftActions}>\r\n          {leftActions.map((item, index) => (\r\n            <span key={index}>{item()}</span>\r\n          ))}\r\n        </Box>\r\n      )}\r\n      <Box className={classes.rightActions}>\r\n        {rightActions.length > 0 &&\r\n          rightActions.map((item, index) => <span key={index}>{item()}</span>)}\r\n      </Box>\r\n    </MuiDialogActions>\r\n  );\r\n}\r\n","/**\r\n *\r\n * Popper\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  ClickAwayListener,\r\n  createStyles,\r\n  makeStyles,\r\n  Paper,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Popper as MuiPopper } from '@material-ui/core';\r\nimport { Box } from '../basic/Wrappers/Box';\r\nimport { PopperTitle } from './PopperTitle';\r\nimport clsx from 'clsx';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\n\r\nexport interface PopperProps {\r\n  id?: string;\r\n  title: string;\r\n  open: boolean;\r\n  anchorEl?: EventTarget & HTMLDivElement;\r\n  children: React.ReactNode;\r\n  onClose: React.MouseEventHandler<HTMLButtonElement>;\r\n  className?: string;\r\n  closeTitle?: string;\r\n  clickAway?: boolean;\r\n  clickAwayFunc?: (e: any) => void;\r\n  minWidth?: string | number;\r\n  maxWidth?: string | number;\r\n}\r\n/**\r\n * A Popper with consistent title + close interface\r\n */\r\nexport const Popper = React.forwardRef<PopperProps, any>(function Popper(\r\n  props,\r\n  ref,\r\n) {\r\n  const {\r\n    id,\r\n    title,\r\n    open,\r\n    anchorEl,\r\n    children,\r\n    onClose,\r\n    className,\r\n    closeTitle,\r\n    clickAway,\r\n    clickAwayFunc,\r\n    minWidth,\r\n    maxWidth,\r\n    ...other\r\n  } = props;\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const { checkIsMobile, isLandscape } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const handleClickAway = e => {\r\n    if (clickAway) {\r\n      if (e.target.nodeName === 'BODY' && e.type === 'click') {\r\n        return;\r\n      }\r\n      if (!!clickAwayFunc) {\r\n        clickAwayFunc(e);\r\n      } else {\r\n        onClose(e);\r\n      }\r\n    }\r\n  };\r\n  const classes = useStyles({\r\n    isMobile: isMobile,\r\n    minWidth: minWidth,\r\n    maxWidth: maxWidth,\r\n  })(props);\r\n\r\n  return (\r\n    <MuiPopper\r\n      id={id}\r\n      open={open}\r\n      anchorEl={anchorEl}\r\n      placement=\"bottom-start\"\r\n      ref={ref}\r\n      container={document.fullscreenElement ?? document.body}\r\n      // placement={isMobile ? 'bottom' : 'bottom-start'}\r\n      className={clsx(classes.root, className, {\r\n        [classes.rootMobile]: isMobile && !isLandscape,\r\n        [classes.rootMobileHorizontal]: isMobile && isLandscape,\r\n      })}\r\n      {...other}\r\n    >\r\n      <ClickAwayListener onClickAway={handleClickAway}>\r\n        <Paper className={classes.poperPaper} elevation={1} ref={ref}>\r\n          <PopperTitle\r\n            title={props.title}\r\n            closeButtonTitle={props.closeTitle}\r\n            onClose={props.onClose}\r\n          />\r\n          <Box className={classes.poperRoot}>{props.children}</Box>\r\n        </Paper>\r\n      </ClickAwayListener>\r\n    </MuiPopper>\r\n  );\r\n});\r\n\r\nconst useStyles = props =>\r\n  makeStyles<Theme, PopperProps>((theme: Theme) =>\r\n    createStyles({\r\n      root: {\r\n        // https://github.com/mui/material-ui/issues/18905\r\n        zIndex: theme.zIndex.modal,\r\n      },\r\n      rootMobile: {\r\n        width: `100vw`,\r\n        height: 'calc(100% - 32px)',\r\n        // long content of the popper overflows popper box on mobile\r\n        overflow: 'auto',\r\n        marginTop: theme.spacing(4),\r\n      },\r\n      rootMobileHorizontal: {\r\n        width: '100%',\r\n        height: '100%',\r\n        // long content of the popper overflows popper box on mobile\r\n        overflow: 'auto',\r\n        //marginTop: theme.spacing(4),\r\n      },\r\n      poperPaper: {\r\n        height: '100%',\r\n        minWidth: props.minWidth\r\n          ? props.minWidth\r\n          : props.isMobile\r\n          ? '100%'\r\n          : '500px',\r\n        maxWidth: props.maxWidth\r\n          ? props.maxWidth\r\n          : props.isMobile\r\n          ? '100%'\r\n          : '700px',\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        padding: 24,\r\n        gap: 16,\r\n        boxShadow: '0px 2px 18px rgba(8, 24, 41, 0.16)',\r\n        maxHeight: '100dvh',\r\n        overflow: 'hidden',\r\n      },\r\n      poperTitle: {},\r\n      poperRoot: {\r\n        width: '100%',\r\n        height: '100%',\r\n      },\r\n      selectTitle: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        padding: '8px 8px',\r\n        justifyContent: 'space-between',\r\n        width: '100%',\r\n        '&>label': {\r\n          width: '100%',\r\n          textAlign: 'center',\r\n        },\r\n      },\r\n      selectContent: {\r\n        marginTop: theme.spacing(2),\r\n        boxShadow: 'inset 0px 1px 0px #E0E5EC',\r\n      },\r\n    }),\r\n  );\r\n","/**\r\n *\r\n * Popper\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from '../Typography';\r\n\r\nexport interface PopperTitleProps {\r\n  title: React.ReactNode;\r\n  onClose: React.MouseEventHandler<HTMLButtonElement>;\r\n  className?: string;\r\n  closeButtonTitle?: string;\r\n}\r\n\r\nexport function PopperTitle({ title, onClose, ...props }: PopperTitleProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const classes = useStyles({ isMobile: isMobile });\r\n  const closeTitle = props.closeButtonTitle ?? t(translations.Close);\r\n  return (\r\n    <Box className={classes.poperTitle}>\r\n      <IconButton\r\n        shape=\"square\"\r\n        size=\"xs\"\r\n        variant=\"ghost\"\r\n        aria-label=\"Close\"\r\n        onClick={onClose}\r\n        style={{ position: 'absolute', right: 8, top: 8 }}\r\n      >\r\n        <Tooltip title={closeTitle}>\r\n          <span>\r\n            <Icon icon=\"times\" color=\"default\" colorExtend=\"textHover\" />\r\n          </span>\r\n        </Tooltip>\r\n      </IconButton>\r\n\r\n      <Box className={classes.poperTditle}>\r\n        <Body size=\"small\" bold={true}>\r\n          {title}\r\n        </Body>\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\n\r\nconst useStyles = makeStyles<Theme, { isMobile: boolean }>((theme: Theme) =>\r\n  createStyles({\r\n    poperTitle: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '8px 8px',\r\n      justifyContent: 'space-between',\r\n      width: '100%',\r\n      '&>label': {\r\n        width: '100%',\r\n        textAlign: 'center',\r\n      },\r\n    },\r\n  }),\r\n);\r\n","/**\r\n *\r\n * RichTextEditor\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { StartRichEditor } from './RichEditor';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface RichTextEditorProps {\r\n  value?: string | undefined;\r\n  onChange: (value: string | undefined) => void;\r\n  placeholder?: string;\r\n  autofocus?: boolean;\r\n  hasMentions?: boolean;\r\n  onChangeMentions?: (mentions: Entity<string>[]) => void;\r\n  additionalButtons?: ((classname, key) => React.ReactNode)[];\r\n  disabled?: boolean;\r\n  isInvoiceTemplateEditor?: boolean;\r\n  extendedMode?: boolean;\r\n  labelOnTop?: boolean;\r\n  info?: NonNullable<React.ReactNode>;\r\n  setControlsVisible?: (visible: boolean) => void;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\n\r\nexport function RichTextEditor(props: RichTextEditorProps) {\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const hasMentions = React.useMemo(() => {\r\n    return (\r\n      props.hasMentions &&\r\n      !globalSettings.GetBooleanByKey(\r\n        AllowedSettings.HideCommentSharingForAllUsers,\r\n      )\r\n    );\r\n  }, [globalSettings, props.hasMentions]);\r\n  return (\r\n    <StartRichEditor\r\n      initialValue={props.value}\r\n      onChange={props.onChange}\r\n      placeholder={props.placeholder}\r\n      autoFocus={props.autofocus}\r\n      hasMentions={hasMentions}\r\n      onChangeMentions={props.onChangeMentions}\r\n      additionalButtons={props.additionalButtons}\r\n      disabled={props.disabled}\r\n      isInvoiceTemplateEditor={props.isInvoiceTemplateEditor}\r\n      extendedMode={props.extendedMode}\r\n      info={props.info}\r\n      labelOnTop={props.labelOnTop}\r\n      setControlsVisible={props.setControlsVisible}\r\n      serviceGroups={props.serviceGroups}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AdminUserPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { UserMultiPicker } from '../pickers/AutocompletePickers/UserMultiPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { UserPicker } from '../pickers/AutocompletePickers/UserPicker';\r\n\r\nexport const FormAdminUsersPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IUserFilterDto[] | null> &\r\n  IFieldProps & { multiple: boolean }) => {\r\n  const [field, meta, helpers] = useField<IUserFilterDto[] | null>(props);\r\n  if (props.multiple) {\r\n    return (\r\n      <UserMultiPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        predicates={props.predicates}\r\n        disabled={props.disabled}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value ?? undefined}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        urlType=\"admin\"\r\n      />\r\n    );\r\n  } else {\r\n    return (\r\n      <UserPicker\r\n        predicates={props.predicates}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          if (value !== null) {\r\n            helpers.setValue([value], true);\r\n          } else {\r\n            helpers.setValue([], true);\r\n          }\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        // value={field.value ?? undefined}\r\n        value={\r\n          field.value !== null\r\n            ? field.value.length > 0\r\n              ? (field.value[0] as IUserFilterDto | null | undefined)\r\n              : null\r\n            : null\r\n        }\r\n        error={meta?.error !== undefined}\r\n        variant=\"filled\"\r\n        disabled={props.disabled}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        urlType=\"admin\"\r\n      />\r\n    );\r\n  }\r\n};\r\nexport const FormAdminSingleUsersPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IUserFilterDto | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<IUserFilterDto | null>(props);\r\n\r\n  return (\r\n    <UserPicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field?.value}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      disabled={props.disabled}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      urlType=\"admin\"\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * DatesRangeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\n\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport {\r\n  getPeriodTypesEntity,\r\n  PeriodTypes,\r\n  PeriodTypesEntity,\r\n} from 'app/components/DatePeriods';\r\nimport { DatesRange } from 'types/DatesRange';\r\n\r\nimport { DatePeriodsPicker } from 'app/components/pickers/DatePeriodsPicker';\r\nimport { selectTwoDaysTimelineButtonEnabled } from 'app/pages/CalendarPage/Scheduler/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\n\r\n/**\r\n * Date picker to be used as a BasicTable filter component\r\n */\r\nexport const DatesPeriodFilter = (props: IFilterComponentProps) => {\r\n  const { t } = useTranslation();\r\n  const twoDaysEnabled = useSelector(selectTwoDaysTimelineButtonEnabled);\r\n  const [value, setValue] = React.useState<PresetDatesRange>(\r\n    props.value !== undefined ? props.value : new PresetDatesRange(),\r\n  );\r\n  const handleTypeChange = (value: PeriodTypesEntity | null) => {\r\n    let changedValue = Object.assign(\r\n      new PresetDatesRange(),\r\n      {\r\n        type:\r\n          (value as PeriodTypesEntity) ??\r\n          (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n      },\r\n      DatesRange.fromPreset(\r\n        (value as PeriodTypesEntity) ??\r\n          (getPeriodTypesEntity('CustomDate') as PeriodTypesEntity),\r\n        null,\r\n        null,\r\n      ),\r\n    );\r\n    setValue(state => changedValue);\r\n    props.onChange(changedValue);\r\n  };\r\n  return (\r\n    <>\r\n      {value !== undefined && (\r\n        <>\r\n          <DatePeriodsPicker\r\n            isOpen={true}\r\n            onChange={handleTypeChange}\r\n            periods={SchedulerDatePositionArray.filter(\r\n              f => twoDaysEnabled === true || f !== 'TodayTomorrow',\r\n            )}\r\n            value={\r\n              props.value instanceof PresetDatesRange\r\n                ? (props.value.type as PeriodTypesEntity | undefined)\r\n                : (props.value as PeriodTypesEntity | undefined)\r\n            }\r\n            disableClearable={true}\r\n            placeholder={t(translations.Forever)}\r\n            size=\"small\"\r\n            id=\"datesrangeid\"\r\n            aria-label=\"Date Periods select\"\r\n          />\r\n        </>\r\n      )}\r\n    </>\r\n  );\r\n};\r\nexport default DatesPeriodFilter;\r\n\r\nexport const SchedulerDatePositionArray: Array<SchedulerDatePositionUnion> = [\r\n  'Today',\r\n  'Tomorrow',\r\n  'Yesterday',\r\n  'TodayTomorrow',\r\n  'ThisWeek',\r\n  'NextWeek',\r\n  'ThisMonth',\r\n  'NextMonth',\r\n  'LastWeek',\r\n  'LastMonth',\r\n  'ThisQuarter',\r\n  'LastQuarter',\r\n  'NextQuarter',\r\n  'ThisYear',\r\n  'LastYear',\r\n  'NextYear',\r\n  'CustomDate',\r\n];\r\ntype Extends<T, U extends T> = U;\r\nexport type SchedulerDatePositionUnion = Extends<\r\n  PeriodTypes,\r\n  | 'Today'\r\n  | 'Tomorrow'\r\n  | 'Yesterday'\r\n  | 'TodayTomorrow'\r\n  | 'ThisWeek'\r\n  | 'NextWeek'\r\n  | 'ThisMonth'\r\n  | 'NextMonth'\r\n  | 'LastWeek'\r\n  | 'LastMonth'\r\n  | 'ThisQuarter'\r\n  | 'LastQuarter'\r\n  | 'NextQuarter'\r\n  | 'ThisYear'\r\n  | 'LastYear'\r\n  | 'NextYear'\r\n  | 'CustomDate'\r\n>;\r\n","export enum WorkWeekDays {\r\n  FirstDay = 1,\r\n  SecondsDay = 2,\r\n  ThirdDay = 3,\r\n  FourthDay = 4,\r\n  FifthDay = 5,\r\n  SixthDay = 6,\r\n}\r\n","import {\r\n  IViewState,\r\n  ViewLengths,\r\n  ViewLengthsArray,\r\n  ViewTypes,\r\n} from '../slice/types';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n  SchedulerDatePositionArray,\r\n  SchedulerDatePositionUnion,\r\n} from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { DatesRange } from 'types/DatesRange';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport type SchedulerPosition = SchedulerDatePositionUnion | ViewLengths;\r\n\r\nexport type SchedulerPositionState = Pick<\r\n  IViewState,\r\n  'viewLength' | 'date' | 'preset' | 'viewType'\r\n>;\r\n\r\nexport const parsePosition = (\r\n  s?: SchedulerPosition,\r\n  d?: Timestamp,\r\n  vt?: ViewTypes,\r\n): SchedulerPositionState => {\r\n  const result: SchedulerPositionState = {\r\n    preset: 'ThisWeek',\r\n    viewLength: 'week',\r\n    date: dateUtils.formatISO(dateUtils.startOfWeek(new Date())),\r\n    viewType: vt ?? 'calendar',\r\n  };\r\n  if (d !== undefined) {\r\n    const parsedDate = dateUtils.tryParse(d);\r\n    if (parsedDate !== null) {\r\n      result.date = dateUtils.formatISO(parsedDate);\r\n    }\r\n  }\r\n\r\n  if (s !== undefined) {\r\n    // try parse preset period/position like nextweek\r\n    const presetPosition:\r\n      | SchedulerDatePositionUnion\r\n      | undefined = SchedulerDatePositionArray.find(\r\n      f => f.toLowerCase() === s.toLowerCase(),\r\n    );\r\n    if (presetPosition !== undefined) {\r\n      const preset = DatesRange.fromPreset(\r\n        { Id: presetPosition, Name: 'dummy' },\r\n        null,\r\n        null,\r\n      );\r\n      if (preset.start !== null) {\r\n        result.date = dateUtils.formatISO(preset.start);\r\n      }\r\n      result.viewLength = presetPeriodToViewLength(\r\n        presetPosition,\r\n        result.viewType,\r\n      );\r\n    }\r\n    const viewLength: ViewLengths | undefined = ViewLengthsArray.find(\r\n      f => f.toLowerCase() === s.toLowerCase(),\r\n    );\r\n    if (viewLength !== undefined) {\r\n      result.viewLength = viewLength;\r\n    }\r\n  }\r\n  return result;\r\n};\r\n\r\nexport function presetPeriodToViewLength(\r\n  preset: SchedulerDatePositionUnion,\r\n  viewType: ViewTypes,\r\n): ViewLengths {\r\n  switch (preset) {\r\n    case 'Today':\r\n    case 'Yesterday':\r\n    case 'Tomorrow':\r\n      return 'day';\r\n    case 'TodayTomorrow':\r\n      return 'twodays';\r\n    case 'LastWeek':\r\n    case 'ThisWeek':\r\n    case 'NextWeek':\r\n      return 'week';\r\n    case 'LastMonth':\r\n    case 'ThisMonth':\r\n    case 'NextMonth':\r\n      return 'month';\r\n    case 'LastQuarter':\r\n    case 'ThisQuarter':\r\n    case 'NextQuarter':\r\n      return viewType === 'timeline' ? 'quarter' : 'week';\r\n    case 'LastYear':\r\n    case 'ThisYear':\r\n    case 'NextYear':\r\n      return viewType === 'timeline' ? 'year' : 'week';\r\n    case 'CustomDate':\r\n      return 'customdays';\r\n    default:\r\n      assertExhaustive(preset);\r\n  }\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\nimport { pick } from 'lodash';\r\nimport { Period } from 'types/Period';\r\n\r\n/**\r\n * Adjusts start/end times of a reservation to match the ForceFullDayReservations requirements:\r\n * * starts = now if reservation is placed for today, start of the day otherwise\r\n * * ends = midnight of the next day\r\n * @param period\r\n * @returns adjusted start/end times\r\n */\r\nexport function applyForceFullDayReservations(\r\n  period: Period,\r\n  forceFullDayReservations: boolean | undefined,\r\n): Period {\r\n  if (forceFullDayReservations !== true) {\r\n    return pick(period, 'start', 'end');\r\n  }\r\n\r\n  const now = new Date();\r\n  const startsToday =\r\n    dateUtils.truncateTime(now).getTime() ===\r\n    dateUtils.truncateTime(period.start).getTime();\r\n\r\n  const startTime = startsToday ? now : dateUtils.truncateTime(period.start);\r\n\r\n  const truncatedEndTime = dateUtils.truncateTime(period.end);\r\n  const adjustEndTime = period.end.getTime() !== truncatedEndTime.getTime();\r\n  const endTime = adjustEndTime\r\n    ? dateUtils.addDays(dateUtils.truncateTime(period.end), 1)\r\n    : period.end;\r\n  const result = {\r\n    start: startTime,\r\n    end: endTime,\r\n    start_date: startTime,\r\n    end_date: endTime,\r\n  };\r\n  return result;\r\n}\r\n","import { flow, partialRight } from 'lodash';\r\nimport { Period } from 'types/Period';\r\nimport { applyForceFullDayReservations } from './applyForceFullDayReservations';\r\nimport { SchedulerPeriod } from '../types/SchedulerPeriod';\r\n\r\n/**\r\n * Intended to adjust new event start/end according to ForceFullDayReservations equipment setting\r\n * @param period\r\n * @param forceFullDayReservations\r\n * @returns\r\n */\r\nexport function adjustSchedulerEventTimes(\r\n  period: SchedulerPeriod,\r\n  forceFullDayReservations: boolean | undefined,\r\n): SchedulerPeriod {\r\n  const p = (period: SchedulerPeriod): Period => ({\r\n    start: period.start_date,\r\n    end: period.end_date,\r\n  });\r\n  const pp = (period: Period): SchedulerPeriod => ({\r\n    start_date: period.start,\r\n    end_date: period.end,\r\n  });\r\n\r\n  const result = flow(\r\n    p,\r\n    partialRight(applyForceFullDayReservations, forceFullDayReservations),\r\n    pp,\r\n  )(period);\r\n  return result;\r\n}\r\n","import { useEffect } from 'react';\r\n\r\ntype ListenerProps = {\r\n  [key in keyof WindowEventMap]?: EventListenerOrEventListenerObject;\r\n};\r\n\r\nexport default function useGlobalDOMEvents(props: ListenerProps) {\r\n  useEffect(() => {\r\n    for (let [key, func] of Object.entries(props)) {\r\n      window.addEventListener(key, func, false);\r\n    }\r\n    return () => {\r\n      for (let [key, func] of Object.entries(props)) {\r\n        window.removeEventListener(key, func, false);\r\n      }\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, []);\r\n}\r\n","/**\r\n *\r\n * FiltersGroupDisplay\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { FilterDisplay } from '../FilterDisplay';\r\nimport { IFilterSettings } from '../IFilterSettings';\r\nimport { areSameFilter, filterKey } from '../utils';\r\n\r\nexport interface FiltersGroupDisplayProps<TRow> {\r\n  appliedFilters: IFilterSettings<TRow>[];\r\n  onChange: (items: IFilterSettings<TRow>[]) => void;\r\n  openFilter: () => void;\r\n}\r\n\r\nexport function FiltersGroupDisplay<TRow>(\r\n  props: FiltersGroupDisplayProps<TRow>,\r\n) {\r\n  const [items, setItems] = React.useState(\r\n    props.appliedFilters.filter(f => f.value !== null && f.value !== undefined),\r\n  );\r\n  React.useEffect(() => {\r\n    setItems(\r\n      props.appliedFilters.filter(\r\n        f => f.value !== null && f.value !== undefined,\r\n      ),\r\n    );\r\n  }, [props.appliedFilters]);\r\n  const handleDelete = item => {\r\n    props.onChange(\r\n      props.appliedFilters.map(f =>\r\n        !areSameFilter({ f, item }) ? f : { ...f, ...{ value: null } },\r\n      ),\r\n    );\r\n  };\r\n  return (\r\n    <>\r\n      {items\r\n        .filter(f => f.value !== undefined)\r\n        .map((item, index) => (\r\n          <FilterDisplay\r\n            key={`filter-display-${JSON.stringify(filterKey(item))}`}\r\n            filter={item}\r\n            onDelete={handleDelete}\r\n            openFilter={props.openFilter}\r\n          />\r\n        ))}\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * FilterDisplay\r\n *\r\n */\r\nimport { Chip, ChipProps, Theme, useTheme } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IFilterSettings } from '../IFilterSettings';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { Entity } from 'types/common';\r\nimport { IsEntity, IsNotEmptyArray } from '../AppliedFilterComponent';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport styled from 'styled-components';\r\n\r\nexport interface FilterDisplayProps<TRow> {\r\n  filter: IFilterSettings<TRow>;\r\n  onDelete: (item: IFilterSettings<TRow>) => void;\r\n  openFilter: () => void;\r\n}\r\nexport const FilterChip = styled(\r\n  ({\r\n    theme,\r\n    ...other\r\n  }: {\r\n    theme: Theme;\r\n  } & ChipProps) => <Chip {...other} />,\r\n)`\r\n  &.filter-display-root {\r\n    gap: ${props => props.theme.spacing(1)}px;\r\n    max-width: 58ch;\r\n    border-radius: 8px;\r\n    background-color: ${props => props.theme.palette.common.grayDividers};\r\n  }\r\n`;\r\nexport function FilterDisplay<TRow>(props: FilterDisplayProps<TRow>) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const theme = useTheme();\r\n  const isMobile = DetectIsMobile();\r\n  const value = props.filter.value;\r\n  const displayValue =\r\n    typeof value === 'string'\r\n      ? value\r\n      : typeof value === 'number'\r\n      ? value?.toString()\r\n      : value instanceof Date\r\n      ? dateUtils.shortDateFormat(value)\r\n      : value instanceof PresetDatesRange\r\n      ? value?.GetPresetDatesRangeDisplayString(t)\r\n      : IsEntity(value)\r\n      ? (value as Entity<number>).Name\r\n      : IsNotEmptyArray(value)\r\n      ? (value as Array<Entity<number>>).map(v => v.Name).join(', ')\r\n      : props.filter.getDisplay !== undefined\r\n      ? props.filter.getDisplay(value)\r\n      : t(translations.NA);\r\n  const isInversed = props.filter.isInversed ? 'Not ' : '';\r\n\r\n  const handleDelete = event => {\r\n    props.onDelete(props.filter);\r\n  };\r\n  return !!props.filter.renderFilterDisplay ? (\r\n    <>{props.filter.renderFilterDisplay(props)}</>\r\n  ) : (\r\n    <>\r\n      <FilterChip\r\n        theme={theme}\r\n        className={'filter-display-root'}\r\n        onClick={props.openFilter}\r\n        label={\r\n          <>\r\n            <BasicTypography\r\n              component=\"span\"\r\n              noWrap\r\n              style={\r\n                isMobile\r\n                  ? {\r\n                      overflow: 'hidden',\r\n                      textOverflow: 'ellipsis',\r\n                      maxWidth: '10ch',\r\n                    }\r\n                  : undefined\r\n              }\r\n            >\r\n              {props.filter.displayName}\r\n            </BasicTypography>\r\n            :&ensp;\r\n            {displayValue === undefined || displayValue === null ? (\r\n              <Skeleton width={'15ch'} />\r\n            ) : props.filter.displayName.length + displayValue.length > 40 ? (\r\n              <Tooltip\r\n                title={isInversed + displayValue}\r\n                placement=\"bottom-start\"\r\n                arrow\r\n              >\r\n                <span>\r\n                  <BasicTypography\r\n                    component=\"span\"\r\n                    noWrap\r\n                    style={\r\n                      isMobile\r\n                        ? {\r\n                            overflow: 'hidden',\r\n                            textOverflow: 'ellipsis',\r\n                            maxWidth: '30ch',\r\n                          }\r\n                        : undefined\r\n                    }\r\n                  >\r\n                    {isInversed}\r\n                    {displayValue}\r\n                  </BasicTypography>\r\n                </span>\r\n              </Tooltip>\r\n            ) : (\r\n              <BasicTypography\r\n                component=\"span\"\r\n                noWrap\r\n                style={\r\n                  isMobile\r\n                    ? {\r\n                        overflow: 'hidden',\r\n                        textOverflow: 'ellipsis',\r\n                        maxWidth: '30ch',\r\n                      }\r\n                    : undefined\r\n                }\r\n              >\r\n                {isInversed}\r\n                {displayValue}\r\n              </BasicTypography>\r\n            )}\r\n          </>\r\n        }\r\n        onDelete={handleDelete}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { useLabelPrintSlice } from '../slice';\r\nimport { Identifiable } from 'types/common';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { ICanRaiseBasicTableRefreshEvent } from 'app/components/BasicTable/ControlledTable/ControlledTableProps';\r\n\r\nexport interface PrintAssetLabelsButtonProps\r\n  extends ButtonProps,\r\n    ICanRaiseBasicTableRefreshEvent {\r\n  rows: Array<Identifiable<number>>;\r\n}\r\n\r\nexport function PrintSelectedAssetLabelsButton({\r\n  rows,\r\n  onRefresh,\r\n  onClick,\r\n  ...props\r\n}: PrintAssetLabelsButtonProps) {\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const allowedRoles = [\r\n    Roles.Administrators,\r\n    Roles.LabTech,\r\n    Roles.GroupAdministrators,\r\n    Roles.EquipmentAdministrator,\r\n  ];\r\n  const systemSettings = useSelector(selectglobalSettings);\r\n  // enable print only if any of the supported printers settings has been turned on\r\n  const printEnabled =\r\n    systemSettings.GetBooleanByKey(AllowedSettings.DymoPrinterSupported) ||\r\n    systemSettings.GetBooleanByKey(AllowedSettings.ZebraPrinterSupported);\r\n\r\n  const show =\r\n    printEnabled &&\r\n    authenticatedUser?.Roles?.some(role => allowedRoles.includes(role));\r\n\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLabelPrintSlice();\r\n\r\n  if (!show) {\r\n    return <></>;\r\n  } else {\r\n    const assetIds = rows.map(f => f.Id);\r\n    props.children = props.children ?? t(translations.PrintLabels);\r\n    props.title = props.title ?? t(translations.PrintLabels);\r\n    props.disabled = props.disabled || assetIds.length === 0;\r\n    return (\r\n      <SelectedRowsActionIconButton\r\n        text={t(translations.PrintLabels)}\r\n        title={t(translations.PrintLabels)}\r\n        onRefresh={onRefresh}\r\n        rows={[]}\r\n        variantButton=\"button\"\r\n        action={() => {\r\n          dispatch(actions.open({ ids: assetIds, type: 'Asset' }));\r\n          return Promise.resolve<IResponseType>({\r\n            ErrorMessages: [],\r\n            SuccessMessages: [],\r\n            WarningMessages: [],\r\n          });\r\n        }}\r\n      />\r\n    );\r\n  }\r\n}\r\n","import { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectIsAuthenticated,\r\n  selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { ConfigurableTypes, ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Column } from 'react-table';\r\nimport { Notification } from 'types/Notification';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { IRow } from '.';\r\nimport {\r\n  getTableColumns,\r\n  GetCachedConfigurableColumnsData,\r\n} from './ConfigurableColumns';\r\n\r\nexport interface IUseConfigurableColumnsProps<TRow extends IRow> {\r\n  columns: Array<Column<TRow>>;\r\n  /**\r\n   * Id of the screen that table related to. Required!\r\n   */\r\n  screenId?: ScreensId;\r\n}\r\nexport const useConfigurableColumns = <TRow extends IRow>({\r\n  screenId,\r\n  columns,\r\n}: IUseConfigurableColumnsProps<TRow>) => {\r\n  // Configurable columns\r\n  // columns will be replaced with configurableColumns\r\n\r\n  const { t } = useTranslation();\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const AuthenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const dispatch = useDispatch();\r\n  const { actions: globalActions } = useAppSettingsSlice();\r\n  const setGlobalMessage = React.useCallback(\r\n    (message: Notification) => {\r\n      dispatch(globalActions.addNotification(message));\r\n    },\r\n    [dispatch, globalActions],\r\n  );\r\n  const [configurableColumns, setConfigurableColumns] = useAsyncExtendedState<\r\n    Column<TRow>[] | undefined\r\n  >(screenId === undefined ? columns : undefined);\r\n\r\n  const loadConfigurableColumns = React.useCallback(\r\n    async (props: {\r\n      screenId: ScreensId;\r\n      columns: Array<Column<TRow>>;\r\n      isAuthenticated?: boolean;\r\n      force?: boolean;\r\n    }) => {\r\n      try {\r\n        const config = await GetCachedConfigurableColumnsData(\r\n          props.screenId,\r\n          ConfigurableTypes.ColumnScreenConfig,\r\n\r\n          isAuthenticated,\r\n          props.force,\r\n        );\r\n\r\n        return getTableColumns({\r\n          response: config,\r\n          ConfigurableColumnsSetUp: columns,\r\n        });\r\n      } catch (error) {\r\n        setGlobalMessage({\r\n          key: 'WrongColumnDefinition',\r\n          message: t(translations.WrongColumnDefinition_info) as string,\r\n          variant: 'warning',\r\n          autoHideDuration: 30000,\r\n          closable: true,\r\n        });\r\n        return getTableColumns({\r\n          response: [],\r\n          ConfigurableColumnsSetUp: columns,\r\n        });\r\n      }\r\n    },\r\n    [columns, isAuthenticated, setGlobalMessage, t],\r\n  );\r\n  const [fetchConfigState, getConfigurableColumns] = usePromise(\r\n    loadConfigurableColumns,\r\n  );\r\n\r\n  const [\r\n    configurableColumnsExport,\r\n    setConfigurableColumnsExport,\r\n  ] = useAsyncExtendedState<Array<keyof TRow> | undefined>(undefined);\r\n  const loadConfigurableColumnsExport = React.useCallback(\r\n    async (listId: ScreensId, isAuthenticated: boolean | undefined) => {\r\n      const d = await GetCachedConfigurableColumnsData(\r\n        listId,\r\n        ConfigurableTypes.ColumnExportConfig,\r\n        isAuthenticated,\r\n        false,\r\n      );\r\n      const p = d.map(f => f.Id);\r\n      return p;\r\n    },\r\n    [],\r\n  );\r\n  const [, fetchExport] = usePromise(loadConfigurableColumnsExport);\r\n\r\n  // useEffect will only be called once because columns and screenId do not change, it is a trick\r\n  React.useEffect(() => {\r\n    if (screenId !== undefined) {\r\n      setConfigurableColumns(getConfigurableColumns({ screenId, columns }));\r\n    }\r\n    if (screenId !== undefined) {\r\n      setConfigurableColumnsExport(fetchExport(screenId, isAuthenticated));\r\n    }\r\n  }, [\r\n    columns,\r\n    fetchExport,\r\n    getConfigurableColumns,\r\n    isAuthenticated,\r\n    screenId,\r\n    setConfigurableColumns,\r\n    setConfigurableColumnsExport,\r\n  ]);\r\n\r\n  const refreshConfigurableColumns = React.useCallback(() => {\r\n    if (screenId !== undefined) {\r\n      setConfigurableColumns(\r\n        loadConfigurableColumns({\r\n          screenId,\r\n          columns,\r\n          force: true,\r\n          isAuthenticated,\r\n        }),\r\n      );\r\n    }\r\n  }, [\r\n    screenId,\r\n    setConfigurableColumns,\r\n    loadConfigurableColumns,\r\n    columns,\r\n    isAuthenticated,\r\n  ]);\r\n\r\n  const handleConfigurableColumns = React.useCallback(() => {\r\n    if (screenId && AuthenticatedUser) {\r\n      let targetUrl = '/ConfigurableColumn.aspx';\r\n      // eslint-disable-next-line no-restricted-globals\r\n      let path = location.pathname.split('/');\r\n      // eslint-disable-next-line no-restricted-globals\r\n      const search = location.search;\r\n\r\n      let publicSub = publicUrl?.split('/');\r\n      path.shift();\r\n      if (path.length > 1) {\r\n        if (\r\n          !!publicSub &&\r\n          (publicSub[publicSub.length - 1] === ''\r\n            ? publicSub[publicSub.length - 2]\r\n            : publicSub[publicSub.length - 1]) === path[0]\r\n        ) {\r\n          path.shift();\r\n        }\r\n      }\r\n      let returnUrl = '~/' + path.join('/') + search;\r\n      let redirUrl = toRootedURL(targetUrl, {\r\n        id: screenId,\r\n        UserName: AuthenticatedUser.Id,\r\n        ReturnUrl: returnUrl,\r\n      });\r\n      // eslint-disable-next-line no-restricted-globals\r\n      window.open(redirUrl, '_blank'); // + returnUrl;\r\n    }\r\n  }, [AuthenticatedUser, publicUrl, screenId]);\r\n\r\n  // The configCompleted variable is used to show the loading indicator while the configurable columns data is being loaded\r\n  // There's nothing to complete when there's no screenId and this variable does not need a separate state as it's a derivative of the fetch status.\r\n  const configCompleted =\r\n    screenId === undefined || fetchConfigState.status === 'resolved';\r\n  return {\r\n    configurableColumns,\r\n    configurableColumnsExport,\r\n    handleConfigurableColumns,\r\n    configCompleted,\r\n    refreshConfigurableColumns,\r\n  };\r\n};\r\n","import React from 'react';\r\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { TablePaginationActionsProps } from '@material-ui/core/TablePagination/TablePaginationActions';\r\nimport Box from '@material-ui/core/Box';\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n  root: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    alignItems: 'flex-start',\r\n    padding: 0,\r\n    gap: theme.spacing(1.5),\r\n    paddingRight: theme.spacing(1.5),\r\n  },\r\n}));\r\n\r\nconst TablePaginationActions: React.FC<TablePaginationActionsProps> = props => {\r\n  const classes = useStyles();\r\n  const theme = useTheme();\r\n  const { count, page, rowsPerPage, onChangePage } = props;\r\n\r\n  const handleFirstPageButtonClick = event => {\r\n    onChangePage(event, 0);\r\n  };\r\n\r\n  const handleBackButtonClick = event => {\r\n    onChangePage(event, page - 1);\r\n  };\r\n\r\n  const handleNextButtonClick = event => {\r\n    onChangePage(event, page + 1);\r\n  };\r\n\r\n  const handleLastPageButtonClick = event => {\r\n    onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\r\n  };\r\n\r\n  return (\r\n    <Box component={'div'} className={classes.root}>\r\n      <IconButton\r\n        onClick={handleFirstPageButtonClick}\r\n        disabled={page === 0}\r\n        variant=\"ghost\"\r\n        size=\"xs\"\r\n        shape=\"square\"\r\n        aria-label=\"first page\"\r\n      >\r\n        {theme.direction === 'rtl' ? (\r\n          <Icon icon=\"chevron-double-right\" />\r\n        ) : (\r\n          <Icon icon=\"chevron-double-left\" />\r\n        )}\r\n      </IconButton>\r\n      <IconButton\r\n        onClick={handleBackButtonClick}\r\n        disabled={page === 0}\r\n        variant=\"ghost\"\r\n        shape=\"square\"\r\n        size=\"xs\"\r\n        aria-label=\"previous page\"\r\n      >\r\n        {theme.direction === 'rtl' ? (\r\n          <Icon icon=\"chevron-right\" />\r\n        ) : (\r\n          <Icon icon=\"chevron-left\" />\r\n        )}\r\n      </IconButton>\r\n      <IconButton\r\n        onClick={handleNextButtonClick}\r\n        disabled={page >= Math.ceil(count / rowsPerPage) - 1}\r\n        variant=\"ghost\"\r\n        shape=\"square\"\r\n        size=\"xs\"\r\n        aria-label=\"next page\"\r\n      >\r\n        {theme.direction === 'rtl' ? (\r\n          <Icon icon=\"chevron-left\" />\r\n        ) : (\r\n          <Icon icon=\"chevron-right\" />\r\n        )}\r\n      </IconButton>\r\n      <IconButton\r\n        onClick={handleLastPageButtonClick}\r\n        disabled={page >= Math.ceil(count / rowsPerPage) - 1}\r\n        variant=\"ghost\"\r\n        shape=\"square\"\r\n        size=\"xs\"\r\n        aria-label=\"last page\"\r\n      >\r\n        {theme.direction === 'rtl' ? (\r\n          <Icon icon=\"chevron-double-left\" />\r\n        ) : (\r\n          <Icon icon=\"chevron-double-right\" />\r\n        )}\r\n      </IconButton>\r\n    </Box>\r\n  );\r\n};\r\n\r\n// TablePaginationActions.propTypes = {\r\n//   count: PropTypes.number.isRequired,\r\n//   onChangePage: PropTypes.func.isRequired,\r\n//   page: PropTypes.number.isRequired,\r\n//   rowsPerPage: PropTypes.number.isRequired,\r\n// };\r\n\r\nexport default TablePaginationActions;\r\n","/**\r\n *\r\n * ExportButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Menu, MenuItem } from '@material-ui/core';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useDialogAlertSlice } from 'app/components/DialogAlert/slice';\r\nimport { ExportImportActions } from 'app/components/PopupImportExport/Actions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport fileDownload from 'js-file-download';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface ExportButtonProps<T extends IRow> {\r\n  //selectedRows: T[];\r\n  onClick: () => Promise<void>;\r\n  onDownloadTemplateClick?: () => void;\r\n  useExportForImport?: boolean;\r\n  getAllFilteredRowsCallback?: (prop: keyof T) => Promise<T[]>;\r\n  selectedFilterRowProp?: keyof T;\r\n  screenId?: ScreensId;\r\n}\r\n\r\nexport function ExportButton<T extends IRow>(props: ExportButtonProps<T>) {\r\n  const { t } = useTranslation();\r\n  const [anchorEl, setAnchorEl] = React.useState(null);\r\n  const [processing, setProcessing] = React.useState<boolean>(false);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useDialogAlertSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const handleClick = event => {\r\n    setAnchorEl(event.currentTarget);\r\n  };\r\n\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n  };\r\n  const handleExport = async () => {\r\n    handleClose();\r\n    setProcessing(true);\r\n    await props.onClick();\r\n    setProcessing(false);\r\n  };\r\n\r\n  const handleExportForImportClick = async () => {\r\n    handleClose();\r\n    if (\r\n      !!props.getAllFilteredRowsCallback &&\r\n      !!props.selectedFilterRowProp &&\r\n      !!props.screenId\r\n    ) {\r\n      setProcessing(true);\r\n      await handleExportForImport(\r\n        props.getAllFilteredRowsCallback,\r\n        props.selectedFilterRowProp,\r\n        props.screenId,\r\n      );\r\n      setProcessing(false);\r\n    } else {\r\n      dispatch(actions.showAlert('Import for Export is not configured!'));\r\n    }\r\n  };\r\n  const handleExportForImport = async (\r\n    rowsCallback: (prop: keyof T) => Promise<T[]>,\r\n    p: keyof T,\r\n    screenId: ScreensId,\r\n  ) => {\r\n    let toBigQS = '';\r\n    try {\r\n      const selectedRows = await rowsCallback(p);\r\n      const exportRows = !!selectedRows\r\n        ? selectedRows.map(item => item[p])\r\n        : [];\r\n      toBigQS = exportRows.join(',');\r\n      const res = await ExportImportActions.ExportForImport(\r\n        screenId,\r\n        exportRows,\r\n      );\r\n      const cd = res.headers['content-disposition'];\r\n      const filename =\r\n        cd !== undefined ? cd.split('filename=')[1] : 'ExportForImport.xlsx';\r\n      fileDownload(res.data, filename);\r\n      if (ScreensId.MyAssets === screenId) {\r\n        const MaxRecordsAllowedAssetImport = parseInt(\r\n          settings.GetString(AllowedSettings.MaxRecordsAllowedAssetImport),\r\n        );\r\n        if (exportRows.length > MaxRecordsAllowedAssetImport) {\r\n          dispatch(\r\n            appSettingsActions.addNotification({\r\n              variant: 'warning',\r\n              message: `Only ${MaxRecordsAllowedAssetImport} rows were exported`,\r\n            }),\r\n          );\r\n        }\r\n      }\r\n    } catch (error) {\r\n      let messageLongQS =\r\n        toBigQS.length > 5000\r\n          ? (t(translations.err_ImportForExportFailed_longQS) as string)\r\n          : undefined;\r\n      let deffMessage = t(translations.err_ImportForExportFailed) as string;\r\n      dispatch(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: !!messageLongQS ? messageLongQS : deffMessage,\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  const handleDownloadTemplateClick = () => {\r\n    if (props.onDownloadTemplateClick !== undefined) {\r\n      props.onDownloadTemplateClick();\r\n    }\r\n  };\r\n\r\n  const showSingleExportButton = ![\r\n    props.useExportForImport === true ? true : undefined,\r\n    props.onDownloadTemplateClick,\r\n  ].some(item => item !== undefined);\r\n\r\n  // render a menu if both set of columns are provided\r\n  // render single button if only export columns are present and the \"for import\" is not set\r\n  return (\r\n    <React.Fragment>\r\n      <Button\r\n        id=\"export-button\"\r\n        aria-controls=\"export-menu-button\"\r\n        aria-haspopup=\"true\"\r\n        variant=\"white\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"print\" size=\"sm\" />}\r\n        onClick={showSingleExportButton ? handleExport : handleClick}\r\n        processing={processing}\r\n        title={t(translations.ExportButtonTooltip) as string}\r\n      >\r\n        {t(translations.Export)}\r\n      </Button>\r\n      {!showSingleExportButton && (\r\n        <>\r\n          <Menu\r\n            id=\"export-menu-button\"\r\n            anchorEl={anchorEl}\r\n            keepMounted\r\n            open={Boolean(anchorEl)}\r\n            onClose={handleClose}\r\n            MenuListProps={{ dense: true }}\r\n            getContentAnchorEl={null}\r\n            anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}\r\n          >\r\n            <MenuItem onClick={handleExport}>\r\n              {t(translations.ExportToXLSX)}\r\n            </MenuItem>\r\n            {props.useExportForImport === true && (\r\n              <MenuItem onClick={handleExportForImportClick}>\r\n                {t(translations.ExportForImport)}\r\n              </MenuItem>\r\n            )}\r\n            {props.onDownloadTemplateClick !== undefined && (\r\n              <MenuItem onClick={handleDownloadTemplateClick}>\r\n                {t(translations.DownloadTemplate)}\r\n              </MenuItem>\r\n            )}\r\n          </Menu>\r\n        </>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { Box } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../ControlledTable/ControlledTableProps';\r\nimport { SelectedRowsActionRenderer } from '../SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\n\r\nexport interface SelectedActionsProps<TRow>\r\n  extends ICanRaiseBasicTableRefreshEvent {\r\n  actions: SelectedRowsActionRenderer<TRow>[];\r\n  selectedArray: TRow[];\r\n  toggleAllRowsSelected: (value?: boolean) => void;\r\n  totalRows: number;\r\n  shortView?: boolean;\r\n}\r\n\r\nexport function SelectedActions<TRow>({\r\n  actions,\r\n  onRefresh,\r\n  selectedArray,\r\n  toggleAllRowsSelected,\r\n  totalRows,\r\n  shortView,\r\n  ...props\r\n}: SelectedActionsProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const clearSelection = () => {\r\n    toggleAllRowsSelected(false);\r\n  };\r\n  const allActions = React.useMemo(() => {\r\n    return actions.filter(f => f !== undefined);\r\n  }, [actions]);\r\n  return shortView ? (\r\n    <>\r\n      <Box component=\"span\" alignSelf=\"center\">\r\n        <Body\r\n          bold={true}\r\n          size=\"small\"\r\n        >{`${selectedArray.length} of ${totalRows} Items`}</Body>\r\n      </Box>\r\n      <>{allActions[0](selectedArray, onRefresh, toggleAllRowsSelected)}</>\r\n      {allActions.length > 1 && (\r\n        <ReactActions\r\n          id=\"selectedMobileActions\"\r\n          size=\"small\"\r\n          icon=\"list\"\r\n          iconVariant=\"white\"\r\n          keepOpen\r\n          items={allActions\r\n            .filter((f, indx) => {\r\n              return indx > 0 && f !== undefined;\r\n            })\r\n            .map((item, index) =>\r\n              item(selectedArray, onRefresh, toggleAllRowsSelected),\r\n            )}\r\n        ></ReactActions>\r\n      )}\r\n      {/* <ActionButton\r\n        onClick={clearSelection}\r\n        title={t(translations.ClearSelection) as string}\r\n        text={t(translations.Clear) as string}\r\n        starticon=\"times\"\r\n        variant=\"ghost\"\r\n      /> */}\r\n    </>\r\n  ) : (\r\n    <>\r\n      <Box component=\"span\" alignSelf=\"center\">\r\n        <Body\r\n          bold={true}\r\n          size=\"small\"\r\n        >{`${selectedArray.length} of ${totalRows} Items`}</Body>\r\n      </Box>\r\n\r\n      {allActions.map((item, index) => (\r\n        <span key={index}>\r\n          {item(selectedArray, onRefresh, toggleAllRowsSelected)}\r\n        </span>\r\n      ))}\r\n      <ActionButton\r\n        onClick={clearSelection}\r\n        title={t(translations.ClearSelection) as string}\r\n        text={t(translations.Clear) as string}\r\n        starticon=\"times\"\r\n        variant=\"ghost\"\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nexport interface ConfigureColumnsButtonProps {\r\n  onClick?: () => void;\r\n}\r\nexport function ConfigureColumnsButton(props: ConfigureColumnsButtonProps) {\r\n  const { t } = useTranslation();\r\n  const { onClick } = props;\r\n\r\n  return (\r\n    <Button\r\n      title={t(translations.ConfigurableColumnsLink) as string}\r\n      variant=\"white\"\r\n      size=\"small\"\r\n      startIcon={<Icon icon=\"table\" />}\r\n      onClick={onClick}\r\n    >\r\n      {t(translations.Columns)}\r\n    </Button>\r\n  );\r\n}\r\n","import { useLocation } from 'react-router-dom';\r\nimport { usePrevious } from './usePrevious';\r\nimport { useEffect } from 'react';\r\n//import { Location } from '@types/history';\r\n\r\nexport const useLocationChange = action => {\r\n  const location = useLocation();\r\n  const prevLocation = usePrevious(location);\r\n  useEffect(() => {\r\n    action(location, prevLocation);\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [location]);\r\n};\r\n","import styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const TabsWrapper = styled('div')(({ theme }) => ({\r\n  '&.tabsWrapper': {\r\n    display: 'flex',\r\n    padding: '0px 32px',\r\n    flexDirection: 'column',\r\n    alignItems: 'flex-start',\r\n    alignSelf: 'stretch',\r\n    gap: '32px',\r\n    width: '100%',\r\n    '&.scrollContent': {\r\n      overflow: 'hidden',\r\n    },\r\n    '&.tabsHorizontal': {\r\n      '& .basicTabs': {\r\n        flexGrow: 1,\r\n        width: '100%',\r\n        borderBottom: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n      },\r\n    },\r\n    '&.tabsVertical': {\r\n      flexDirection: 'row',\r\n      padding: '0px',\r\n    },\r\n    '& .basicTabs': {\r\n      backgroundColor: 'transparent',\r\n    },\r\n  },\r\n}));\r\nexport const TabPanelWrapper = styled('div')(({ theme }) => ({\r\n  '&.tabPanel': {\r\n    width: '100%',\r\n    '&.scrollablePanel': {\r\n      height: '100%',\r\n      overflowY: 'auto',\r\n      '&::-webkit-scrollbar': {\r\n        width: '6px',\r\n      },\r\n      '&::-webkit-scrollbar-thumb': {\r\n        boxShadow: `inset 0 0 2px ${bookitColors.grayscale.grayBorders}`,\r\n        borderRadius: '4px',\r\n        backgroundColor: bookitColors.grayscale.grayBorders,\r\n      },\r\n    },\r\n  },\r\n}));\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IFileDto } from 'api/odata/generated/entities/IFileDto';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { FormInputFile } from 'app/components/Forms/FormInputFile';\r\nimport React from 'react';\r\nimport { Identifiable } from 'types/common';\r\nimport { CustomFormFieldProps } from '../CustomFormFields';\r\n\r\nexport function CustomFormFileUpload({\r\n  formField,\r\n  readonly,\r\n  disabled,\r\n  ...props\r\n}: CustomFormFieldProps) {\r\n  return (\r\n    <FormInputFile\r\n      {...props}\r\n      disabled={readonly || disabled}\r\n      label={formField.Label}\r\n      key={formField.Id}\r\n      referenceId={formField.Id}\r\n      multiple={formField.IsMultiple}\r\n      helperText={formField.Description ?? undefined}\r\n      showPreview={true}\r\n      shrinkLabel={true}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\nconst url = '/api/odata/v4/Files';\r\nexport const InitFormFiles = (\r\n  id: string,\r\n  formField: IFormFieldDto | undefined,\r\n) => {\r\n  const initids = id\r\n    .split(',')\r\n    .filter(f => f !== '')\r\n    .map(item => {\r\n      return { Id: item };\r\n    }) as Identifiable<string>[];\r\n  if (initids.length > 0) {\r\n    let filter: string | undefined = '';\r\n    if (formField) {\r\n      if (formField.IsMultiple) {\r\n        filter = new Condition(\r\n          'Id',\r\n          ODataOperators.Includes,\r\n          initids,\r\n        ).toString();\r\n      } else {\r\n        filter = `Id eq ${initids[0].Id}`;\r\n      }\r\n    }\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: filter,\r\n      $select: 'Id,Name,Size,TypeId',\r\n      $skip: 0,\r\n      $top: initids.length,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as IFileDto[]);\r\n  } else {\r\n    return new Promise<IFileDto[]>((resolve, reject) => {\r\n      resolve([] as IFileDto[]);\r\n    });\r\n  }\r\n};\r\n","import { IRepetitiveDto, RepetitiveInit } from 'types/IRepetitiveDto';\r\nimport { RepetitiveForm } from '.';\r\nimport * as React from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRepetitiveSlice } from './slice';\r\nimport { Portal } from '@material-ui/core';\r\nimport { useRef } from 'react';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { MutableRefObject } from 'react';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { RepetitiveFor } from './slice/types';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nexport interface RepetitiveControlProps {\r\n  startDate?: Date | null;\r\n  saveRepetitive?: (values: IRepetitiveDto) => void;\r\n  submitFormRef: MutableRefObject<any>;\r\n  title?: string;\r\n  type: RepetitiveFor;\r\n  disabled?: boolean;\r\n  formIsValid?: (isValid: boolean) => void;\r\n  withTopSeparator?: boolean;\r\n  withBottomSeparator?: boolean;\r\n  //submitForm: (e) => void;\r\n}\r\n\r\nexport function RepetitiveControl(props: RepetitiveControlProps) {\r\n  const {\r\n    saveRepetitive,\r\n    submitFormRef,\r\n    startDate,\r\n    title,\r\n    type,\r\n    disabled,\r\n    formIsValid,\r\n    withTopSeparator,\r\n    withBottomSeparator,\r\n  } = props;\r\n  //const submitFormRef = React.useRef<any>(null);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRepetitiveSlice();\r\n  const [initData, setInitData] = React.useState<IRepetitiveDto | undefined>(\r\n    undefined,\r\n  );\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  //  React.useMemo(() => {\r\n  //   return RepetitiveInit(\r\n  //     startDate ? dateUtils.dateOrStringToDate(startDate) : new Date(),\r\n  //     dateUtils.addDays(\r\n  //       startDate ? dateUtils.dateOrStringToDate(startDate) : new Date(),\r\n  //       7,\r\n  //     ),\r\n  //   );\r\n  // }, [startDate]);\r\n  useEffectOnMount(() => {\r\n    setInitData(() =>\r\n      RepetitiveInit(startDate ? getOffsetDate(startDate) : newDate()),\r\n    );\r\n    // if (startDate !== undefined && startDate !== null) {\r\n    //   dispatch(actions.setStartDate(dateUtils.dateOrStringToDate(startDate)));\r\n    // } else {\r\n    //   dispatch(actions.setStartDate(new Date()));\r\n    // }\r\n    return () => {};\r\n  });\r\n  //   React.useEffect(() => {\r\n  //     let active = doSubmit;\r\n  //     if (active) {\r\n  //       if (submitFormRef.current) {\r\n  //         submitFormRef.current.Submit();\r\n  //         dispatch(actions.setSubmit(false));\r\n  //       }\r\n  //     }\r\n  //     return () => {\r\n  //       active = false;\r\n  //     };\r\n  //   }, [actions, dispatch, doSubmit]);\r\n\r\n  //   const handleSubmitForm = e => {\r\n  //     if (submitFormRef.current) {\r\n  //       submitFormRef.current(e);\r\n  //     }\r\n  //   };\r\n  const portalRef = useRef(null);\r\n  const bindSubmitForm = React.useCallback(\r\n    submitForm => {\r\n      submitFormRef.current = submitForm;\r\n    },\r\n    [submitFormRef],\r\n  );\r\n  const handleSubmit = React.useCallback(\r\n    (values: IRepetitiveDto) => {\r\n      if (saveRepetitive) {\r\n        saveRepetitive(values);\r\n      } else {\r\n        var d = {\r\n          StartDate:\r\n            values.StartDate === undefined\r\n              ? undefined\r\n              : dateUtils.formatISO(\r\n                  dateUtils.dateOrStringToDate(values.StartDate),\r\n                ),\r\n          RecurringEvents: values.RecurringEvents,\r\n          RepeatsOnDays: values.RepeatsOnDays,\r\n          RecurringEndDate:\r\n            values.RecurringEndDate === undefined\r\n              ? undefined\r\n              : dateUtils.formatISO(\r\n                  dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n                ),\r\n          RepeatsEveryDay: values.RepeatsEveryDay,\r\n          RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n          RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n        } as IRepetitiveDto;\r\n        dispatch(actions.saveState(d));\r\n      }\r\n    },\r\n    [actions, dispatch, saveRepetitive],\r\n  );\r\n  return initData ? (\r\n    <React.Fragment>\r\n      <div ref={portalRef} style={{ width: '100%' }} />\r\n      <Portal container={portalRef.current}>\r\n        <RepetitiveForm\r\n          onSubmit={handleSubmit}\r\n          disabled={disabled}\r\n          formIsValid={formIsValid}\r\n          RepetitiveData={\r\n            initData ?? undefined\r\n            //   RepetitiveInit(\r\n            //     dateUtils.dateOrStringToDate(startDate || new Date()),\r\n            //     null,\r\n            //   )\r\n          }\r\n          bindSubmitForm={bindSubmitForm}\r\n          title={title}\r\n          type={type}\r\n          withBottomSeparator={withBottomSeparator}\r\n          withTopSeparator={withTopSeparator}\r\n        />\r\n      </Portal>\r\n      {/* <SaveFormButton onClick={handleSubmitForm} edit={false} text=\"Rep Save\" /> */}\r\n    </React.Fragment>\r\n  ) : (\r\n    <React.Fragment>\r\n      <Skeleton variant=\"rect\" />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { Entity } from 'types/common';\r\n\r\nexport interface IComment {\r\n  Id: number;\r\n  Text: string;\r\n  CreatedAt: Date | string;\r\n  CreatedBy: Entity<string>;\r\n  Files: CommentFile[];\r\n  IsInternal?: boolean | null;\r\n}\r\n\r\nexport interface NewComment {\r\n  Text?: string;\r\n  Files?: FileList;\r\n  Users: Entity<string>[];\r\n  IsInternal?: boolean | null;\r\n}\r\n\r\nexport interface CommentFile {\r\n  Id: string;\r\n  Name: string;\r\n  Size?: number;\r\n}\r\nexport const ConvertNewToComment = (\r\n  newcomment: NewComment,\r\n  Id: number,\r\n  CreatedAt: Date | string,\r\n  CreatedBy: Entity<string>,\r\n) => {\r\n  let newFiles: CommentFile[] = [];\r\n  if (!!newcomment.Files && newcomment.Files.length > 0) {\r\n    for (\r\n      let i: number = 0;\r\n      !!newcomment.Files && i < newcomment.Files.length;\r\n      i++\r\n    ) {\r\n      let item = newcomment.Files.item(i);\r\n      if (!!item) {\r\n        newFiles.push({\r\n          Id: i.toString(),\r\n          Name: item.name,\r\n          Size: item.size,\r\n        } as CommentFile);\r\n      }\r\n    }\r\n  }\r\n  return {\r\n    Id: Id,\r\n    Text: newcomment.Text || '',\r\n    CreatedAt: CreatedAt,\r\n    CreatedBy: CreatedBy,\r\n    Files: newFiles,\r\n    IsInternal: newcomment.IsInternal,\r\n  } as IComment;\r\n};\r\n","import { AxiosError } from 'axios';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Identifiable } from 'types/common';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport interface IDeleteSamplesResult {\r\n  successCount: number;\r\n  errors: Error[];\r\n}\r\nexport async function deleteSamples(\r\n  samples: Identifiable<number>[],\r\n): Promise<IDeleteSamplesResult> {\r\n  let successCount = 0;\r\n  const errors: Error[] = [];\r\n  // todo: convert to transaction/batch\r\n  for (const sample of samples) {\r\n    const url = `/api/odata/v4/samples(${sample.Id})`;\r\n    try {\r\n      await httpClient.delete(url);\r\n      successCount++;\r\n    } catch (error) {\r\n      const message =\r\n        (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n        i18next.t(translations.errormessage);\r\n      errors.push(new Error(message));\r\n    }\r\n  }\r\n\r\n  return {\r\n    successCount: successCount,\r\n    errors: errors,\r\n  };\r\n}\r\n","import BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport parse from 'html-react-parser';\r\n\r\nimport { uniqueId } from 'lodash';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\n\r\nexport interface ImportProps {\r\n  onDownloadTemplateButtonClick?: React.MouseEventHandler<HTMLButtonElement>;\r\n  processing: boolean;\r\n  title?: string;\r\n  accept: '.xlsx' | '.xls' | '.csv';\r\n  disabled?: boolean;\r\n  hideImportButton?: boolean;\r\n  hideMessage?: boolean;\r\n}\r\nexport interface ImportComponentProps extends ImportProps {\r\n  handleFileChange: (file: File) => void;\r\n}\r\nexport function ImportComponent(props: ImportComponentProps) {\r\n  const { t } = useTranslation();\r\n  const ref = React.useRef<HTMLInputElement>(null);\r\n  const handleFileChange = event => {\r\n    const file = ref.current?.files?.[0];\r\n    if (file !== undefined) {\r\n      props.handleFileChange(file);\r\n    }\r\n  };\r\n\r\n  const [fileId] = React.useState(uniqueId('import-file-'));\r\n  const [buttonId] = React.useState(uniqueId('import-file-'));\r\n  return (\r\n    <Box>\r\n      {props.onDownloadTemplateButtonClick !== undefined && (\r\n        <BasicTypography>\r\n          {t(translations.ImportRecordsDescription)}\r\n          <InfoIcon title={parse(t(translations.ImportRecordsSteps))} />\r\n        </BasicTypography>\r\n      )}\r\n      {props.onDownloadTemplateButtonClick !== undefined && (\r\n        <BasicTypography>\r\n          <label htmlFor={buttonId}>\r\n            {t(translations.ToImportNewRecords)}:\r\n          </label>\r\n          &emsp;\r\n          <Button id={buttonId} onClick={props.onDownloadTemplateButtonClick}>\r\n            {t(translations.DownloadTemplate)}\r\n          </Button>\r\n        </BasicTypography>\r\n      )}\r\n      <BasicTypography>\r\n        {props.hideMessage === undefined ||\r\n          (props.hideMessage === false && (\r\n            <label htmlFor={fileId}>\r\n              {t(translations.UploadTheUpdatedFile)}:\r\n            </label>\r\n          ))}\r\n        &emsp;\r\n        <Box>\r\n          <input\r\n            id={fileId}\r\n            type=\"file\"\r\n            name=\"file\"\r\n            ref={ref}\r\n            accept={props.accept}\r\n            onChange={handleFileChange}\r\n          />\r\n        </Box>\r\n      </BasicTypography>\r\n    </Box>\r\n  );\r\n}\r\n","import { Action } from '@reduxjs/toolkit';\r\nimport { Task } from 'redux-saga';\r\nimport { fork, take, cancel, ActionPattern } from 'redux-saga/effects';\r\n\r\n/**\r\n * Similar to takeEvery, but also filters by the action parameters\r\n * see https://redux-saga.js.org/docs/api/#takelatestpattern-saga-args\r\n * @param patternOrChannel\r\n * @param keyfn\r\n * @param saga\r\n * @param args\r\n * @returns\r\n */\r\nexport const takeLatestByKey = <TPayload>(\r\n  patternOrChannel: ActionPattern<Action<any>>,\r\n  keyfn: (payload: TPayload) => string | number | symbol,\r\n  saga,\r\n  ...args\r\n) =>\r\n  fork(function* () {\r\n    const tasks: Record<string | number | symbol, Task> = {};\r\n    while (true) {\r\n      const action = yield take(patternOrChannel);\r\n      const key = keyfn(action.payload);\r\n      const isKeyEmpty = key === null && key === undefined;\r\n      if (isKeyEmpty) {\r\n        console.warn(\r\n          `Empty key (${JSON.stringify(key)}) in takeLatestByKey.`,\r\n          patternOrChannel,\r\n        );\r\n      }\r\n\r\n      if (!isKeyEmpty) {\r\n        if (tasks[key]) {\r\n          yield cancel(tasks[key]); // cancel is no-op if the task has already terminated\r\n        }\r\n      }\r\n      const task: Task = yield fork(saga, ...args.concat(action));\r\n      if (!isKeyEmpty) {\r\n        tasks[key] = task;\r\n      }\r\n    }\r\n  });\r\n","import { IInvoiceTemplateDto } from 'app/pages/InvoiceTemplates/InvoiceTemplatesPage/IInvoiceTemplateDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/InvoiceTemplates';\r\nexport const InvoiceTemplatesApi = {\r\n  insertInvoiceTemplate: invoiceTemplate => {\r\n    const form = new FormData();\r\n    Object.keys(invoiceTemplate).forEach(k => {\r\n      form.append(k, invoiceTemplate[k]);\r\n    });\r\n\r\n    if (\r\n      !!invoiceTemplate.HeaderFile &&\r\n      invoiceTemplate.HeaderFile?.length > 0\r\n    ) {\r\n      form.append(\r\n        'TemplateHeaderFile',\r\n        invoiceTemplate.HeaderFile[0].PostedFile,\r\n      );\r\n    }\r\n    if (\r\n      !!invoiceTemplate.FooterFile &&\r\n      invoiceTemplate.FooterFile?.length > 0\r\n    ) {\r\n      form.append(\r\n        'TemplateFooterFile',\r\n        invoiceTemplate.FooterFile[0].PostedFile,\r\n      );\r\n    }\r\n    return httpClient.post(url, form);\r\n  },\r\n  updateInvoiceTemplate: (Id: number, invoiceTemplate) => {\r\n    const form = new FormData();\r\n    Object.keys(invoiceTemplate).forEach(k => {\r\n      form.append(k, invoiceTemplate[k]);\r\n    });\r\n\r\n    if (\r\n      !!invoiceTemplate.HeaderFile &&\r\n      invoiceTemplate.HeaderFile?.length > 0\r\n    ) {\r\n      form.append(\r\n        'TemplateHeaderFile',\r\n        invoiceTemplate.HeaderFile[0].PostedFile,\r\n      );\r\n    }\r\n    if (\r\n      !!invoiceTemplate.FooterFile &&\r\n      invoiceTemplate.FooterFile?.length > 0\r\n    ) {\r\n      form.append(\r\n        'TemplateFooterFile',\r\n        invoiceTemplate.FooterFile[0].PostedFile,\r\n      );\r\n    }\r\n    return httpClient.put<any, IResponseType>(url + '(' + Id + ')', form);\r\n  },\r\n  deleteInvoiceTemplates: (\r\n    rows: IInvoiceTemplateDto[],\r\n  ): Promise<IResponseType> => {\r\n    const invoiceTemplatesIds: number[] = rows.map(item => item.Id);\r\n    const data = { invoiceTemplatesIds };\r\n    const url = '/api/odata/v4/InvoiceTemplates/DeleteInvoiceTemplates';\r\n    return httpClient.post(url, data);\r\n  },\r\n  getInvoiceTemplateById: (Id: number) => {\r\n    const params: {\r\n      $filter?: string;\r\n      $select: string;\r\n    } = {\r\n      $filter: '(Id eq ' + Id + ')',\r\n      $select: [\r\n        'Id',\r\n        'Name',\r\n        'CreatedAt',\r\n        'LastUpdated',\r\n        'FundingType',\r\n        'ServiceGroupId',\r\n        'ServiceGroup',\r\n        'Html',\r\n        'TableHeaderColor',\r\n        'TableBodyColor',\r\n        'HeaderFileName',\r\n        'FooterFileName',\r\n      ].join(','),\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n};\r\n","import { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  InventoryBatchPicker,\r\n  InventoryBatchPickerProps,\r\n} from '../pickers/AutocompletePickers/InventoryBatchesPicker';\r\n\r\nexport const FormInventoryBatchPicker = (\r\n  props: FieldHookConfig<IInventoryBatchDto | null> &\r\n    Omit<InventoryBatchPickerProps, 'onChange'>,\r\n) => {\r\n  const [field, meta, helpers] = useField<IInventoryBatchDto | null>(props);\r\n  const handleChange = val => {\r\n    props.onChange?.(val);\r\n    helpers.setValue(val, true);\r\n  };\r\n  return (\r\n    <InventoryBatchPicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      disabled={props.disabled}\r\n      label={props.label}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      variant=\"filled\"\r\n    />\r\n  );\r\n};\r\n","export enum ReferenceType {\r\n  AllReferences = 0,\r\n  Reservation = 1,\r\n  Usage = 2,\r\n  OfflineService = 3,\r\n  ServiceRequest = 4,\r\n  Subscription = 5,\r\n}\r\n","/**\r\n *\r\n * BasicDialogContent\r\n *\r\n */\r\nimport {\r\n  DialogContent,\r\n  DialogContentProps as MuiDialogContentProps,\r\n  styled,\r\n} from '@material-ui/core';\r\nexport interface BasicDialogContentProps extends MuiDialogContentProps {\r\n  children: React.ReactNode;\r\n}\r\nexport function BasicDialogContent(props: BasicDialogContentProps) {\r\n  const { children } = props;\r\n  return <StyledDialogContent>{children}</StyledDialogContent>;\r\n}\r\nconst StyledDialogContent = styled(DialogContent)(({ theme }) => ({\r\n  padding: theme.spacing(2, 3),\r\n  borderTop: 'unset',\r\n}));\r\n","import { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\n\r\nexport function getServiceRequestTicketTitle(item: IServiceRequestTicketDto) {\r\n  return `#${item.ServiceRequestId} - ${item.ServiceRequest.CreatedFor?.Name}`;\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useServiceRequestsKanbanSlice } from '../../slice';\r\nimport { Dto } from '../../slice/types';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface ParentTicketDetailsButtonProps {\r\n  item?: Dto;\r\n}\r\n\r\nexport function ParentTicketDetailsButton({\r\n  item,\r\n}: ParentTicketDetailsButtonProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const dispatch = useDispatch();\r\n  const { actions } = useServiceRequestsKanbanSlice();\r\n  const handleOpenParentTicketClick = () => {\r\n    if (item !== undefined) {\r\n      dispatch(actions.showEditParent(item));\r\n    }\r\n  };\r\n  if (\r\n    item === undefined ||\r\n    item.ParentTicketId === null ||\r\n    item.ParentTicketId === undefined\r\n  ) {\r\n    return null;\r\n  }\r\n  return (\r\n    <Button variant=\"white\" onClick={handleOpenParentTicketClick}>\r\n      {t(translations.MainTicket)}\r\n    </Button>\r\n  );\r\n}\r\n","import { Caption } from 'app/components/Typography';\r\nimport { FormikErrors } from 'formik';\r\nimport styled from 'styled-components';\r\n\r\nexport interface ErrorsSummuryProps<T> {\r\n  errors: FormikErrors<T>;\r\n}\r\nconst SummuryBox = styled('div')`\r\n  display: flex;\r\n  flex-direction: column;\r\n  gap: 8px;\r\n`;\r\nexport function ErrorsSummury<T>(props: ErrorsSummuryProps<T>) {\r\n  const data = Object.entries(props.errors).map(f => {\r\n    return { name: f[0], msg: f[1] };\r\n  });\r\n  return data.length > 0 ? (\r\n    <SummuryBox>\r\n      {data.map(item => (\r\n        <Caption color=\"error\" key={item.name}>\r\n          {item.msg as string}\r\n        </Caption>\r\n      ))}\r\n    </SummuryBox>\r\n  ) : null;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for ArticlesExternalSearchPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ArticlesExternalSearchPagePath = '/articles/search';\r\nexport const ArticlesExternalSearchPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ArticlesExternalSearchPage,\r\n);\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataOperators,\r\n  quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePickerProps,\r\n  AutocompletePicker,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { BudgetExperimentStatuses } from 'enums/BudgetExperimentStatuses';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nexport function budgetExperimentsFilter(\r\n  serviceTypes: IServiceTypeFilterDto[],\r\n  serviceType: ServiceType | undefined,\r\n  budgetId: number | undefined,\r\n  resStart: Date | string | null | undefined,\r\n  resEnd: Date | string | null | undefined,\r\n): (string | Condition<IBudgetExperimentsFilterDto>)[] {\r\n  const predicates: (string | Condition<IBudgetExperimentsFilterDto>)[] = [];\r\n\r\n  predicates.push(\r\n    new Condition<IBudgetExperimentsFilterDto>(\r\n      'Active',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n\r\n  predicates.push(\r\n    new Condition<IBudgetExperimentsFilterDto>(\r\n      'StatusId',\r\n      ODataOperators.Equals,\r\n      BudgetExperimentStatuses.Approved,\r\n    ),\r\n  );\r\n\r\n  predicates.push(\r\n    new Condition<IBudgetExperimentsFilterDto>(\r\n      'BudgetTaskActive',\r\n      ODataOperators.Equals,\r\n      true,\r\n    ),\r\n  );\r\n\r\n  if (!isNullOrUndefined(budgetId)) {\r\n    predicates.push(\r\n      new Condition<IBudgetExperimentsFilterDto>(\r\n        'BudgetTaskBudgetId',\r\n        ODataOperators.Equals,\r\n        budgetId,\r\n      ),\r\n    );\r\n  }\r\n\r\n  if (serviceTypes.length > 0) {\r\n    let ids = serviceTypes\r\n      .filter(f => f.ServiceGroupId !== null)\r\n      .map(f => {\r\n        return { Id: f.ServiceGroupId } as Identifiable<number>;\r\n      });\r\n    if (ids.length > 0) {\r\n      predicates.push(\r\n        `(${new Condition<IBudgetExperimentsFilterDto>(\r\n          'BudgetTaskAllCoresAllowed',\r\n          ODataOperators.Equals,\r\n          true,\r\n        )} or ${new Condition<IBudgetExperimentsFilterDto>(\r\n          'BudgetTaskServiceGroupIds',\r\n          ODataOperators.AnyIn,\r\n          ids,\r\n        )})`,\r\n      );\r\n      predicates.push(\r\n        `(BudgetExperimentServiceGroups/any(s: s/ServiceGroupId in ${quoteODataValue(\r\n          ids,\r\n        )} and s/StatusId eq ${quoteODataValue(\r\n          BudgetExperimentStatuses.Approved,\r\n        )}))`,\r\n      );\r\n    }\r\n  }\r\n\r\n  if (predicates.length > 0) {\r\n    return predicates;\r\n  }\r\n  return [];\r\n}\r\n\r\nexport interface BudgetExperimentsPickerProps\r\n  extends Omit<\r\n    AutocompletePickerProps<IBudgetExperimentsFilterDto>,\r\n    'loadData'\r\n  > {\r\n  username?: string;\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n}\r\nconst url = '/api/odata/v4/BudgetExperimentsFilter';\r\nexport const initBudgetExperimentData = (\r\n  initval: string | undefined,\r\n  username: string,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(`${url}?username=${username}`, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IBudgetExperimentsFilterDto>)[] | undefined,\r\n  username: string,\r\n) =>\r\n  getAutoCompleteLoadDataFn<IBudgetExperimentsFilterDto>({\r\n    url: `${url}?username=${username}`,\r\n    predicates: predicates,\r\n    select: ['Id', 'Name', 'Active', 'StatusId'],\r\n  });\r\nexport function BudgetExperimentsPicker(props: BudgetExperimentsPickerProps) {\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const { username } = props;\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    username || authenticatedUser?.Id || '',\r\n  );\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={innerLoadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'budgetexperimentsfilterId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport const loadBudgetExperiments = loadData;\r\n","import { IBudgetExperimentsFilterDto } from 'api/odata/generated/entities/IBudgetExperimentsFilterDto';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { BudgetExperimentsPicker } from '../pickers/AutocompletePickers/BudgetExperimentsPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormBudgetExperimentsPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IBudgetExperimentsFilterDto | null> &\r\n  IFieldProps & {\r\n    username: string | undefined;\r\n  }) => {\r\n  const [field, meta, helpers] = useField<IBudgetExperimentsFilterDto | null>(\r\n    props,\r\n  );\r\n  return (\r\n    <BudgetExperimentsPicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      disabled={props.disabled}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      username={props.username}\r\n    />\r\n  );\r\n};\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectConnectedSettings } from '../slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { isMember } from 'app/pages/ReservationDetails/Details/components/FormFieldListeners/isMember';\r\n\r\nexport interface UserGroupListenerProps<T> {\r\n  userName: Entity<string> | null;\r\n  services: Entity<number>[];\r\n  userGroup: Entity<string> | null | undefined;\r\n  isEdit: boolean;\r\n  setUser: (value: Entity<string> | null) => void;\r\n  setBudget: (value: Entity<number> | null) => void;\r\n  values?: T;\r\n  forceDisabled?: boolean;\r\n  user: AuthenticatedUser | undefined;\r\n}\r\nexport function UserGroupListener<T>({\r\n  userName: selectedUser,\r\n  services,\r\n  userGroup,\r\n  isEdit,\r\n  setUser,\r\n  setBudget,\r\n  forceDisabled,\r\n  user,\r\n}: UserGroupListenerProps<T>) {\r\n  const [initilized, setInitilized] = React.useState(!forceDisabled);\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  React.useEffect(() => {\r\n    if (!initilized) {\r\n      if (userGroup !== null) {\r\n        if (\r\n          serviceSettings.budgetVisible &&\r\n          !isEdit &&\r\n          services.length > 0 &&\r\n          selectedUser !== null\r\n        ) {\r\n          if (!serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n            if (!isMember(selectedUser, userGroup)) {\r\n              setUser(null);\r\n              if (serviceSettings.budgetVisible && !isEdit) {\r\n                setBudget(null);\r\n              }\r\n            }\r\n          }\r\n        } else if (!serviceSettings.budgetVisible && !isEdit) {\r\n          if (!isMember(selectedUser, userGroup)) {\r\n            setUser(null);\r\n          }\r\n        }\r\n      } else {\r\n        if (!serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n          setUser(null);\r\n          if (serviceSettings.budgetVisible && !isEdit) {\r\n            setBudget(null);\r\n          }\r\n        }\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [userGroup]);\r\n\r\n  return null;\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectConnectedSettings } from '../slice/selectors';\r\n\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { isMember } from 'app/pages/ReservationDetails/Details/components/FormFieldListeners/isMember';\r\n\r\nexport interface UserNameListenerProps<T> {\r\n  userName: Entity<string> | null;\r\n  userGroup: Entity<string> | null;\r\n  services: Entity<number>[];\r\n  user: AuthenticatedUser | undefined;\r\n  globalSettings: GlobalSettingsType;\r\n  isEdit: boolean;\r\n  startTime: Date | string;\r\n  endTime?: Date | string;\r\n  setUserGroup: (value: Entity<string> | null) => void;\r\n  setBudget: (value: Entity<number> | null) => void;\r\n  values?: T;\r\n  forceDisabled?: boolean;\r\n}\r\nexport function UserNameListener<T>(props: UserNameListenerProps<T>) {\r\n  const {\r\n    userName: selectedUser,\r\n    services,\r\n    isEdit,\r\n    userGroup: selectedUserGroupo,\r\n    globalSettings,\r\n    setUserGroup,\r\n    forceDisabled,\r\n  } = props;\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n    return serviceSettings.budgetVisible\r\n      ? globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n      : false;\r\n  }, [\r\n    globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n    serviceSettings.budgetVisible,\r\n  ]);\r\n\r\n  const [initilized, setInitilized] = React.useState(!forceDisabled);\r\n  React.useEffect(() => {\r\n    if (!initilized) {\r\n      var reservationUserGroupGroupByBudgetUserGroup =\r\n        services.length === 0\r\n          ? globalSettings.reservationUserGroupGroupByBudgetUserGroup\r\n          : ReservationUserGroupGroupByBudgetUserGroup;\r\n\r\n      if (!isEdit) {\r\n        if (selectedUser !== null) {\r\n          if (!reservationUserGroupGroupByBudgetUserGroup) {\r\n            if (!isMember(selectedUser, selectedUserGroupo)) {\r\n              const selectedUserDto = selectedUser as IUserFilterDto;\r\n              setUserGroup({\r\n                Id: selectedUserDto.UserGroupId,\r\n                Name: selectedUserDto.UserGroupName,\r\n              } as Entity<string>);\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {};\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [selectedUser]);\r\n\r\n  return null;\r\n}\r\n","import { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { IUserGroupDto } from 'api/odata/generated/entities/IUserGroupDto';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectConnectedSettings } from '../slice/selectors';\r\nimport {\r\n  budgetExperimentsFilter,\r\n  loadBudgetExperiments,\r\n} from 'app/components/pickers/AutocompletePickers/BudgetExperimentsPicker';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { initBudgetData } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\n\r\nexport interface BudgetListenerProps<T> {\r\n  budget: Entity<number> | null;\r\n  values?: T;\r\n  setUserGroup: (value: Entity<string> | null) => void;\r\n  setBudgetExperiment: (value: Entity<number> | null) => void;\r\n  setBudget: (value: Entity<number> | null) => void;\r\n  userName: Entity<string> | null;\r\n  services: Entity<number>[];\r\n  isEdit: boolean;\r\n  startTime: Date | string;\r\n  endTime?: Date | string;\r\n  user: AuthenticatedUser | undefined;\r\n  serviceTypeEnum?: ServiceType;\r\n  forceDisabled?: boolean;\r\n}\r\n\r\nexport function BudgetListener<T>(props: BudgetListenerProps<T>) {\r\n  const {\r\n    budget,\r\n    setUserGroup,\r\n    setBudgetExperiment,\r\n    setBudget,\r\n    services,\r\n    userName,\r\n    isEdit,\r\n    startTime,\r\n    endTime,\r\n    serviceTypeEnum,\r\n    user,\r\n    forceDisabled,\r\n  } = props;\r\n  const [initilized, setInitilized] = React.useState(!forceDisabled);\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  const currentUser =\r\n    !!userName && userName !== null ? userName.Id : user?.Id || '';\r\n  const fetchBudgetExperiment = async () => {\r\n    try {\r\n      const budgetExperiments = await loadBudgetExperiments(\r\n        budgetExperimentsFilter(\r\n          services as IServiceTypeFilterDto[],\r\n          serviceTypeEnum,\r\n          budget?.Id,\r\n          startTime,\r\n          endTime,\r\n        ),\r\n        currentUser,\r\n      )(null);\r\n      return budgetExperiments.value;\r\n    } catch {\r\n      return [];\r\n    }\r\n  };\r\n  React.useEffect(() => {\r\n    let cancel = false;\r\n    if (!initilized) {\r\n      if (!!budget?.Id) {\r\n        if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n          //let budget = values.Budget as IBudgetFilterDto;\r\n          if (!!(budget as IBudgetFilterDto).UserGroupId) {\r\n            setUserGroup({\r\n              Id: (budget as IBudgetFilterDto).UserGroupId,\r\n              Name: (budget as IBudgetFilterDto).UserGroupName,\r\n            } as IUserGroupDto);\r\n          }\r\n        }\r\n        if (serviceSettings.budgetExpirementVisible && !isEdit) {\r\n          if ((budget as IBudgetFilterDto).HideExperiments === false) {\r\n            (async () => {\r\n              await fetchBudgetExperiment()\r\n                .then(experiments => {\r\n                  if (cancel) {\r\n                    return;\r\n                  }\r\n                  if (experiments.length > 0) {\r\n                    if (experiments.length === 1) {\r\n                      setBudgetExperiment(experiments[0]);\r\n                    } else {\r\n                      setBudgetExperiment(null);\r\n                    }\r\n                  } else {\r\n                    setBudgetExperiment(null);\r\n                  }\r\n                })\r\n                .catch(() => {\r\n                  setBudgetExperiment(null);\r\n                });\r\n            })();\r\n          } else {\r\n            setBudgetExperiment(null);\r\n          }\r\n        }\r\n      } else {\r\n        if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n          setUserGroup(null);\r\n        }\r\n        if (serviceSettings.budgetExpirementVisible) {\r\n          setBudgetExperiment(null);\r\n        }\r\n      }\r\n    } else {\r\n      if (isEdit && budget !== null) {\r\n        (async () => {\r\n          await initBudgetData(budget.Id.toString())\r\n            .then(budg => {\r\n              if (cancel) {\r\n                return;\r\n              }\r\n              setBudget(budg[0]);\r\n            })\r\n            .catch(() => {});\r\n        })();\r\n      }\r\n    }\r\n    setInitilized(false);\r\n    return () => {\r\n      cancel = true;\r\n    };\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [budget]);\r\n\r\n  return null;\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useCallback, useRef, useState, useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { FieldHandler, FormListener } from '../FormRender/FormRenderer';\r\nimport * as Yup from 'yup';\r\nimport {\r\n  BudgetEntitySechema,\r\n  BudgetExperimentEntitySechema,\r\n  InstituteProjectEntitySechema,\r\n  UserEntitySchema,\r\n  UserGroupEntitySchema,\r\n} from '../Schemas';\r\nimport { TransformDate } from '../Schemas/SchemaMethods';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Formik, FormikProps, FormikValues } from 'formik';\r\nimport { FormUserPicker } from '../FormUserPicker';\r\nimport { FormFieldsSection, FormRow } from '../FormsLayout';\r\nimport { FormBudgetExperimentsPicker } from '../FormBudgetExperimentsPicker';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { budgetExperimentsFilter } from 'app/components/pickers/AutocompletePickers/BudgetExperimentsPicker';\r\nimport { FormRestrictedUserGroupPicker } from '../FormRestrictedUserGroupPicker';\r\nimport { RestrictedFilter } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport { FormLabelText } from '../FormLabelText';\r\nimport { Box } from '@material-ui/core';\r\nimport { ServicesFilter } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { FormFundingTypePicker } from '../FormFundingTypePicker';\r\nimport { FormBudgetPicker } from '../FormBudgetPicker';\r\nimport { restrictedBudgetFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport {\r\n  selectConnectedFieldHandler,\r\n  selectConnectedFiltersData,\r\n  selectConnectedSettings,\r\n} from './slice/selectors';\r\nimport { useConnectedFiltersSlice } from './slice';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { UserGroupListener } from './FormFieldListeners/UserGroupListener';\r\nimport { UserNameListener } from './FormFieldListeners/UserNameListener';\r\nimport { BudgetListener } from './FormFieldListeners/BudgetListener';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport React from 'react';\r\nimport { Roles } from 'app/slice/types';\r\nimport { FormBookitDateTimePicker } from '../FormBookitDateTimePicker';\r\nimport produce from 'immer';\r\nimport { Entity } from 'types/common';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport { FormTextField } from '../FormTextField';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface ConnectedFiltersFormProps {\r\n  isEdit: boolean;\r\n  onSubmit: (item: IConnectedFiltersDto) => void;\r\n  ConnectedFiltersData?: IConnectedFiltersDto;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  serviceTypeEnum?: ServiceType;\r\n  serviceTypes: IServiceTypeFilterDto[];\r\n  globalSettings: GlobalSettingsType;\r\n  startTimeLabel?: string;\r\n  endTimeLabel?: string;\r\n  startLabelInline?: boolean;\r\n  endLabelInline?: boolean;\r\n  formIsValid?: (isValid: boolean) => void;\r\n  orderForConsumables?: boolean;\r\n  forceDisabled?: boolean;\r\n  budgetPickerInfo?: string;\r\n}\r\n\r\nexport function ConnectedFiltersForm({\r\n  isEdit,\r\n  onSubmit,\r\n  ConnectedFiltersData,\r\n  processing,\r\n  bindSubmitForm,\r\n  serviceTypeEnum,\r\n  serviceTypes,\r\n  startTimeLabel,\r\n  endTimeLabel,\r\n  startLabelInline,\r\n  endLabelInline,\r\n  globalSettings,\r\n  formIsValid,\r\n  orderForConsumables,\r\n  forceDisabled,\r\n  budgetPickerInfo,\r\n}: ConnectedFiltersFormProps): JSX.Element {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useConnectedFiltersSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  //USER AUTH\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const connectedSettings = useSelector(selectConnectedSettings);\r\n  const connectedData = useSelector(selectConnectedFiltersData);\r\n  //PICKER STATES\r\n  const [userChanged, setUserChanged] = useState<boolean>(false);\r\n  const [userGroupChanged, setUserGroupChanged] = useState<boolean>(false);\r\n  const [budgetChanged, setBudgetChanged] = useState<boolean>(false);\r\n  const [budgetExpirementChanged, setBudgetExpirementChanged] = useState<\r\n    boolean\r\n  >(false);\r\n  const [startTimeChanged, setStartTimeChanged] = useState<boolean>(false);\r\n  const [endTimeChanged, setEndTimeChanged] = useState<boolean>(false);\r\n  const { newDate } = useSystemDate();\r\n  //REFS\r\n  const formikRef = useRef<FormikProps<FormikValues>>(null);\r\n  //SCHEMA\r\n  const computedSchema = useMemo(() => {\r\n    const ConnectedFiltersSchema: Yup.SchemaOf<IConnectedFiltersDto> = Yup.object(\r\n      {\r\n        StartTime: Yup.date()\r\n          .transform(TransformDate)\r\n          .default(dateUtils.dateOrStringToDate(newDate())),\r\n        EndTime: Yup.date().transform(TransformDate).optional(),\r\n        User: UserEntitySchema.label(t(translations.User) as string)\r\n          .nullable()\r\n          .notRequired(),\r\n        UserGroup: UserGroupEntitySchema.label(\r\n          t(translations.UserGroup) as string,\r\n        )\r\n          .nullable()\r\n          .default(null),\r\n        Budget: BudgetEntitySechema.label(\r\n          t(translations.BudgetNumber) as string,\r\n        )\r\n          .nullable()\r\n          .default(null),\r\n        //BudgetExperimentId if displayed then should be required\r\n        BudgetExperiment: BudgetExperimentEntitySechema.nullable().default(\r\n          null,\r\n        ),\r\n        InstituteProject: InstituteProjectEntitySechema.nullable()\r\n          .notRequired()\r\n          .optional()\r\n          .default(null),\r\n        ExternalCustomer: Yup.mixed()\r\n          .label(t(translations.ExternalCustomer) as string)\r\n          .nullable(true),\r\n        FundingType: Yup.mixed()\r\n          .default(getSingleInvoiceFundingType(0))\r\n          .label(t(translations.FundingType) as string),\r\n        PurchaseOrder: Yup.string()\r\n          .label(t(translations.PurchaseOrder) as string)\r\n          .nullable(true)\r\n          .min(globalSettings.purchaseOrderLengthSetting ?? 0)\r\n          .when('Budget', {\r\n            is: budget => {\r\n              const result =\r\n                globalSettings.purchaseOrderBudgetEnabled &&\r\n                (budget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n                  PurchaseOrderOptions.Mandatory;\r\n              return result;\r\n            },\r\n            then: schema => schema.required(),\r\n          }),\r\n        Reference: Yup.string()\r\n          .label(t(translations.Reference) as string)\r\n          .nullable(true),\r\n      },\r\n    );\r\n    if (connectedSettings.budgetVisible === true) {\r\n      ConnectedFiltersSchema.fields.Budget.withMutation(schema =>\r\n        schema\r\n          .required(\r\n            `${t(translations.BudgetIsRequired) as string} ${\r\n              !!budgetPickerInfo && forceDisabled ? budgetPickerInfo : ''\r\n            }`,\r\n          )\r\n          .label(t(translations.BudgetNumber) as string),\r\n      );\r\n    }\r\n    if (!processing) {\r\n      if (\r\n        connectedSettings.budgetExpirementVisible &&\r\n        !!connectedData &&\r\n        !!connectedData.Budget &&\r\n        connectedData.Budget !== null &&\r\n        (connectedData.Budget as IBudgetFilterDto).HideExperiments !==\r\n          undefined &&\r\n        (connectedData.Budget as IBudgetFilterDto)?.HideExperiments === false\r\n      ) {\r\n        ConnectedFiltersSchema.fields.BudgetExperiment.withMutation(schema =>\r\n          schema.required(\r\n            t(translations.res_err_BudgetExperimentRequired) as string,\r\n          ),\r\n        );\r\n      }\r\n      if (\r\n        !connectedSettings.budgetVisible ||\r\n        (connectedSettings.budgetVisible &&\r\n          !connectedSettings.ReservationUserGroupGroupByBudgetUserGroup) ||\r\n        connectedSettings.userGroupVisible\r\n      ) {\r\n        ConnectedFiltersSchema.fields.UserGroup.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.UserGroup) as string)\r\n            .required(t(translations.err_UserGroupRequired) as string),\r\n        );\r\n        ConnectedFiltersSchema.fields.User.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.User) as string)\r\n            .required(t(translations.err_UserFieldRequired) as string),\r\n        );\r\n      }\r\n      if (connectedSettings.endTimeVisible) {\r\n        ConnectedFiltersSchema.fields.EndTime.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.EndTime) as string)\r\n            .required(t(translations._errEndTimeRequired) as string)\r\n            .min(\r\n              Yup.ref('StartTime'),\r\n              t(translations.err_EndTimeLowerThanStartTime) as string,\r\n            ),\r\n        );\r\n      }\r\n      if (connectedSettings.userVisible) {\r\n        ConnectedFiltersSchema.fields.User.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.User) as string)\r\n            .required(t(translations.err_UserFieldRequired) as string),\r\n        );\r\n      }\r\n    }\r\n\r\n    return ConnectedFiltersSchema;\r\n  }, [\r\n    budgetPickerInfo,\r\n    connectedData,\r\n    connectedSettings.ReservationUserGroupGroupByBudgetUserGroup,\r\n    connectedSettings.budgetExpirementVisible,\r\n    connectedSettings.budgetVisible,\r\n    connectedSettings.endTimeVisible,\r\n    connectedSettings.userGroupVisible,\r\n    connectedSettings.userVisible,\r\n    forceDisabled,\r\n    globalSettings.purchaseOrderBudgetEnabled,\r\n    globalSettings.purchaseOrderLengthSetting,\r\n    newDate,\r\n    processing,\r\n    t,\r\n  ]);\r\n  const fieldHandler = useSelector(selectConnectedFieldHandler);\r\n  const isRoleAdmin =\r\n    authenticatedUser?.Roles.includes(Roles.Administrators) ||\r\n    authenticatedUser?.Roles.includes(Roles.GroupAdministrators) ||\r\n    authenticatedUser?.Roles.includes(Roles.LabTech);\r\n  const reserFieldHandler = () => {\r\n    dispatch(actions.resetConnectedHandler());\r\n  };\r\n  const updateDataState = useCallback(\r\n    (value: IConnectedFiltersDto) => {\r\n      dispatch(actions.saveState(value));\r\n      dispatch(\r\n        actions.extendSettingsState({\r\n          services: serviceTypes,\r\n          globalSettings: globalSettings,\r\n          settings: connectedSettings,\r\n          isEdit: isEdit,\r\n          data: value,\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      actions,\r\n      connectedSettings,\r\n      dispatch,\r\n      globalSettings,\r\n      isEdit,\r\n      serviceTypes,\r\n    ],\r\n  );\r\n  const editAllowed = useMemo(() => {\r\n    return (\r\n      !isEdit ||\r\n      (isEdit &&\r\n        (connectedSettings.isServiceAdmin === true ||\r\n          authenticatedUser?.Id === connectedData?.User?.Id))\r\n    );\r\n  }, [\r\n    authenticatedUser?.Id,\r\n    connectedData?.User?.Id,\r\n    connectedSettings.isServiceAdmin,\r\n    isEdit,\r\n  ]);\r\n  const createUpdateAllowed = useMemo(() => {\r\n    return (\r\n      (isEdit && editAllowed) ||\r\n      (!isEdit && (connectedSettings.isServiceAdmin || isRoleAdmin))\r\n    );\r\n  }, [connectedSettings.isServiceAdmin, editAllowed, isEdit, isRoleAdmin]);\r\n  //FUNCTIONS\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n\r\n  //ON FORM CHANGE\r\n  const handleFormChange = useCallback(\r\n    (values: IConnectedFiltersDto, isValid, dirty, setValue) => {\r\n      if (userGroupChanged) {\r\n        updateDataState(values);\r\n        setUserGroupChanged(false);\r\n      }\r\n      if (userChanged) {\r\n        updateDataState(values);\r\n        setUserChanged(false);\r\n      }\r\n      if (startTimeChanged) {\r\n        updateDataState(values);\r\n        setStartTimeChanged(false);\r\n      }\r\n      if (endTimeChanged) {\r\n        updateDataState(values);\r\n        setEndTimeChanged(false);\r\n      }\r\n      if (budgetChanged) {\r\n        updateDataState(values);\r\n\r\n        setBudgetChanged(false);\r\n      }\r\n      if (budgetExpirementChanged) {\r\n        updateDataState(values);\r\n        setBudgetExpirementChanged(false);\r\n      }\r\n    },\r\n    [\r\n      budgetChanged,\r\n      budgetExpirementChanged,\r\n      endTimeChanged,\r\n      startTimeChanged,\r\n      updateDataState,\r\n      userChanged,\r\n      userGroupChanged,\r\n    ],\r\n  );\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <Formik\r\n        innerRef={formikRef}\r\n        validationSchema={computedSchema}\r\n        initialValues={ConnectedFiltersData || ({} as IConnectedFiltersDto)}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('submitting', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formIsValid) {\r\n            formIsValid(formik.isValid);\r\n          }\r\n          return (\r\n            <>\r\n              <form id=\"connectedFiltersForm\" onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['UserGroup', 'User', 'Budget', 'BudgetExperiment']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  additionalFunc={value =>\r\n                    updateDataState(\r\n                      Object.assign(\r\n                        {},\r\n                        formik.values,\r\n                        value,\r\n                      ) as IConnectedFiltersDto,\r\n                    )\r\n                  }\r\n                  resetFieldState={reserFieldHandler}\r\n                />\r\n                {!forceDisabled && (\r\n                  <React.Fragment>\r\n                    <UserGroupListener\r\n                      userGroup={formik.values.UserGroup}\r\n                      userName={formik.values.User}\r\n                      services={serviceTypes}\r\n                      isEdit={isEdit}\r\n                      user={authenticatedUser}\r\n                      setUser={value => {\r\n                        console.debug('setUser', value);\r\n                        formik.setFieldValue('User', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            User: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                      }}\r\n                      setBudget={value => {\r\n                        formik.setFieldValue('Budget', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            Budget: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                      }}\r\n                      forceDisabled={forceDisabled}\r\n                    />\r\n                    <UserNameListener\r\n                      userName={formik.values.User}\r\n                      services={serviceTypes}\r\n                      isEdit={isEdit}\r\n                      setUserGroup={value => {\r\n                        formik.setFieldValue('UserGroup', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            UserGroup: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                      }}\r\n                      setBudget={value => {\r\n                        formik.setFieldValue('Budget', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            Budget: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                      }}\r\n                      user={authenticatedUser}\r\n                      globalSettings={globalSettings}\r\n                      startTime={formik.values.StartTime}\r\n                      endTime={formik.values.EndTime}\r\n                      userGroup={formik.values.UserGroup}\r\n                      forceDisabled={forceDisabled}\r\n                    />\r\n                    <BudgetListener\r\n                      setUserGroup={value => {\r\n                        formik.setFieldValue('UserGroup', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            UserGroup: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                      }}\r\n                      setBudgetExperiment={value => {\r\n                        formik.setFieldValue('BudgetExperiment', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            BudgetExperiment: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                      }}\r\n                      setBudget={value => {\r\n                        formik.setFieldValue('Budget', value);\r\n                        updateDataState(\r\n                          Object.assign({}, formik.values, {\r\n                            Budget: value,\r\n                          }) as IConnectedFiltersDto,\r\n                        );\r\n                        if (isEdit) {\r\n                          dispatch(layoutActions.setNotSavedChanges(false));\r\n                        }\r\n                      }}\r\n                      budget={formik.values.Budget}\r\n                      userName={formik.values.User}\r\n                      services={serviceTypes}\r\n                      isEdit={isEdit}\r\n                      startTime={formik.values.StartTime}\r\n                      endTime={formik.values.EndTime}\r\n                      user={authenticatedUser}\r\n                      forceDisabled={forceDisabled}\r\n                    />\r\n                  </React.Fragment>\r\n                )}\r\n\r\n                {orderForConsumables ? (\r\n                  <FormFieldsSection>\r\n                    {connectedSettings.fundingTypeVisible && (\r\n                      <FormRow>\r\n                        <FormFundingTypePicker\r\n                          name=\"FundingType\"\r\n                          label={t(translations.FundingType)}\r\n                          disabled={\r\n                            formik.isSubmitting || !editAllowed || forceDisabled\r\n                          }\r\n                          onChange={value => {\r\n                            formik.setValues(\r\n                              produce(values => {\r\n                                // clear budget selection when funding type is changed to an incompatible value\r\n                                // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n                                if (\r\n                                  (value as Entity<number>).Id !==\r\n                                  (values.Budget as IBudgetFilterDto)\r\n                                    ?.FundingTypeId\r\n                                ) {\r\n                                  values.Budget = null;\r\n                                }\r\n                                values.FundingType = value;\r\n                              }),\r\n                            );\r\n                          }}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.budgetVisible && (\r\n                      <FormRow>\r\n                        <FormBudgetPicker\r\n                          name=\"Budget\"\r\n                          id=\"BudgetID\"\r\n                          predicates={restrictedBudgetFilter({\r\n                            budgetLimitedByUsers:\r\n                              connectedSettings.budgetLimitedByUsers || false,\r\n                            isBudgetsWithoutUserGroup:\r\n                              connectedSettings.isBudgetsWithoutUserGroup ||\r\n                              false,\r\n                            userGroupId: connectedSettings.ReservationUserGroupGroupByBudgetUserGroup\r\n                              ? undefined\r\n                              : formik.values.UserGroup?.Id,\r\n                            serviceGroupId: undefined,\r\n                            services: serviceTypes,\r\n                            startTime: dateUtils.dateOrStringToDate(\r\n                              formik.values.StartTime,\r\n                            ),\r\n                            endTime: dateUtils.dateOrStringToDate(\r\n                              formik.values.EndTime,\r\n                            ),\r\n                            user: createUpdateAllowed\r\n                              ? formik.values.User === null ||\r\n                                formik.values.User === undefined\r\n                                ? undefined\r\n                                : formik.values.User.Id\r\n                              : authenticatedUser?.Id,\r\n                            defaultBudgetEnabled:\r\n                              globalSettings.defaultBudgetEnabled,\r\n                            userDefaultBudgetEnabled:\r\n                              globalSettings.userDefaultBudgetEnabled,\r\n                            hideNonDefaultBudgets:\r\n                              globalSettings.hideNonDefaultBudgets,\r\n                            // funding type is set to Internal by default even if it's not in use\r\n                            fundingType: connectedSettings.fundingTypeVisible\r\n                              ? formik.values.FundingType\r\n                              : null,\r\n                          })}\r\n                          label={t(translations.BudgetNumber)}\r\n                          onChange={() => setBudgetChanged(true)}\r\n                          disabled={\r\n                            formik.isSubmitting ||\r\n                            connectedSettings.hideProject ||\r\n                            !editAllowed ||\r\n                            forceDisabled\r\n                          }\r\n                          info={budgetPickerInfo}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.budgetExpirementVisible &&\r\n                      formik.values.Budget !== null &&\r\n                      formik.values.Budget?.HideExperiments !== true && (\r\n                        <FormRow fullRow>\r\n                          <FormBudgetExperimentsPicker\r\n                            fullWidth\r\n                            id=\"BudgetExperimentID\"\r\n                            name=\"BudgetExperiment\"\r\n                            placeholder={t(translations.BudgetExperiment)}\r\n                            label={t(translations.BudgetExperiment)}\r\n                            predicates={budgetExperimentsFilter(\r\n                              serviceTypes,\r\n                              serviceTypeEnum,\r\n                              formik.values.Budget?.Id,\r\n                              formik.values.StartTime,\r\n                              formik.values.EndTime,\r\n                            )}\r\n                            onChange={() => setBudgetExpirementChanged(true)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              !editAllowed ||\r\n                              forceDisabled\r\n                            }\r\n                            username={\r\n                              formik.values.User?.Id ?? authenticatedUser?.Id\r\n                            }\r\n                          />\r\n                        </FormRow>\r\n                      )}\r\n                    {globalSettings.purchaseOrderBudgetEnabled &&\r\n                      ((formik.values.Budget as IBudgetFilterDto)\r\n                        ?.PurchaseOrderOptionId ??\r\n                        PurchaseOrderOptions.Hidden) !==\r\n                        PurchaseOrderOptions.Hidden && (\r\n                        <FormRow>\r\n                          <FormTextField\r\n                            name=\"PurchaseOrder\"\r\n                            label={t(translations.PurchaseOrder)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              !editAllowed ||\r\n                              forceDisabled\r\n                            }\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                      )}\r\n                    <FormRow fullRow>\r\n                      <FormBookitDateTimePicker\r\n                        fullWidth\r\n                        id=\"StartTimeID\"\r\n                        name=\"StartTime\"\r\n                        label={\r\n                          startTimeLabel || (t(translations.From) as string)\r\n                        }\r\n                        labelInline={startLabelInline}\r\n                        onChange={() => setStartTimeChanged(true)}\r\n                        disabled={\r\n                          formik.isSubmitting || isEdit || forceDisabled\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                    {connectedSettings.endTimeVisible && (\r\n                      <FormRow>\r\n                        <FormBookitDateTimePicker\r\n                          name=\"EndTime\"\r\n                          id=\"resEnd\"\r\n                          label={endTimeLabel || t(translations.To)}\r\n                          labelInline={endLabelInline}\r\n                          disabled={\r\n                            formik.isSubmitting || isEdit || forceDisabled\r\n                          }\r\n                          onChange={() => setEndTimeChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.userGroupVisible ? (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormRestrictedUserGroupPicker\r\n                          name=\"UserGroup\"\r\n                          label={t(translations.UserGroup)}\r\n                          predicates={RestrictedFilter(\r\n                            undefined,\r\n                            undefined,\r\n                            undefined,\r\n                            globalSettings.onlyOwnUserGroupsAllowed,\r\n                          )}\r\n                          disabled={\r\n                            formik.isSubmitting || isEdit || forceDisabled\r\n                          }\r\n                          onChange={() => setUserGroupChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    ) : (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormLabelText\r\n                          id=\"UserGroupId\"\r\n                          name=\"UserGroup\"\r\n                          label={t(translations.UserGroup)}\r\n                          info={\r\n                            connectedSettings.ReservationUserGroupGroupByBudgetUserGroup\r\n                              ? t(translations.SponsorDepartment_Desc)\r\n                              : undefined\r\n                          }\r\n                          html={\r\n                            <Box\r\n                              width=\"100%\"\r\n                              display=\"flex\"\r\n                              flexDirection=\"row\"\r\n                              alignItems=\"center\"\r\n                              justifyContent=\"flex-start\"\r\n                            >\r\n                              {formik.values.UserGroup !== undefined &&\r\n                              formik.values.UserGroup !== null\r\n                                ? formik.values.UserGroup.Name\r\n                                : (t(translations.NA) as string)}\r\n                            </Box>\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.userVisible ? (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormUserPicker\r\n                          name=\"User\"\r\n                          id=\"UserNameId\"\r\n                          info={t(translations.ReservationUser_Desc)}\r\n                          predicates={ServicesFilter(\r\n                            serviceTypes,\r\n                            connectedSettings.budgetExpirementVisible || false,\r\n                            formik.values.UserGroup?.Id,\r\n                            undefined,\r\n                            globalSettings.defaultBudgetEnabled,\r\n                          )}\r\n                          label={t(translations.User)}\r\n                          disabled={\r\n                            formik.isSubmitting || isEdit || forceDisabled\r\n                          }\r\n                          onChange={() => setUserChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    ) : (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormLabelText\r\n                          id=\"UserNameIdText\"\r\n                          name=\"User\"\r\n                          label={t(translations.User) as string}\r\n                          html={\r\n                            <Box\r\n                              width=\"100%\"\r\n                              display=\"flex\"\r\n                              flexDirection=\"row\"\r\n                              alignItems=\"center\"\r\n                              justifyContent=\"flex-start\"\r\n                            >\r\n                              {formik.values.User !== null &&\r\n                              formik.values.User !== undefined\r\n                                ? formik.values.User.Name\r\n                                : (t(translations.NA) as string)}\r\n                            </Box>\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                  </FormFieldsSection>\r\n                ) : (\r\n                  <FormFieldsSection>\r\n                    {' '}\r\n                    <FormRow fullRow>\r\n                      <FormBookitDateTimePicker\r\n                        fullWidth\r\n                        id=\"StartTimeID\"\r\n                        name=\"StartTime\"\r\n                        label={\r\n                          startTimeLabel || (t(translations.From) as string)\r\n                        }\r\n                        labelInline={startLabelInline}\r\n                        onChange={() => setStartTimeChanged(true)}\r\n                        disabled={\r\n                          formik.isSubmitting || isEdit || forceDisabled\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                    {connectedSettings.endTimeVisible && (\r\n                      <FormRow>\r\n                        <FormBookitDateTimePicker\r\n                          name=\"EndTime\"\r\n                          id=\"resEnd\"\r\n                          label={endTimeLabel || t(translations.To)}\r\n                          labelInline={endLabelInline}\r\n                          disabled={\r\n                            formik.isSubmitting || isEdit || forceDisabled\r\n                          }\r\n                          onChange={() => setEndTimeChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.userGroupVisible ? (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormRestrictedUserGroupPicker\r\n                          name=\"UserGroup\"\r\n                          label={t(translations.UserGroup)}\r\n                          predicates={RestrictedFilter(\r\n                            undefined,\r\n                            undefined,\r\n                            undefined,\r\n                            globalSettings.onlyOwnUserGroupsAllowed,\r\n                          )}\r\n                          disabled={\r\n                            formik.isSubmitting || isEdit || forceDisabled\r\n                          }\r\n                          onChange={() => setUserGroupChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    ) : (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormLabelText\r\n                          id=\"UserGroupId\"\r\n                          name=\"UserGroup\"\r\n                          label={t(translations.UserGroup)}\r\n                          info={\r\n                            connectedSettings.ReservationUserGroupGroupByBudgetUserGroup\r\n                              ? t(translations.SponsorDepartment_Desc)\r\n                              : undefined\r\n                          }\r\n                          html={\r\n                            <Box\r\n                              width=\"100%\"\r\n                              display=\"flex\"\r\n                              flexDirection=\"row\"\r\n                              alignItems=\"center\"\r\n                              justifyContent=\"flex-start\"\r\n                            >\r\n                              {formik.values.UserGroup !== undefined &&\r\n                              formik.values.UserGroup !== null\r\n                                ? formik.values.UserGroup.Name\r\n                                : (t(translations.NA) as string)}\r\n                            </Box>\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.userVisible ? (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormUserPicker\r\n                          name=\"User\"\r\n                          id=\"UserNameId\"\r\n                          info={t(translations.ReservationUser_Desc)}\r\n                          predicates={ServicesFilter(\r\n                            serviceTypes,\r\n                            connectedSettings.budgetExpirementVisible || false,\r\n                            formik.values.UserGroup?.Id,\r\n                            formik.values.Budget?.Id,\r\n                            globalSettings.defaultBudgetEnabled,\r\n                          )}\r\n                          label={t(translations.User)}\r\n                          disabled={\r\n                            formik.isSubmitting || isEdit || forceDisabled\r\n                          }\r\n                          onChange={() => setUserChanged(true)}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    ) : (\r\n                      <FormRow hide={!createUpdateAllowed}>\r\n                        <FormLabelText\r\n                          id=\"UserNameIdText\"\r\n                          name=\"User\"\r\n                          label={t(translations.User) as string}\r\n                          html={\r\n                            <Box\r\n                              width=\"100%\"\r\n                              display=\"flex\"\r\n                              flexDirection=\"row\"\r\n                              alignItems=\"center\"\r\n                              justifyContent=\"flex-start\"\r\n                            >\r\n                              {formik.values.User !== null &&\r\n                              formik.values.User !== undefined\r\n                                ? formik.values.User.Name\r\n                                : (t(translations.NA) as string)}\r\n                            </Box>\r\n                          }\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.fundingTypeVisible && (\r\n                      <FormRow>\r\n                        <FormFundingTypePicker\r\n                          name=\"FundingType\"\r\n                          label={t(translations.FundingType)}\r\n                          disabled={\r\n                            formik.isSubmitting || !editAllowed || forceDisabled\r\n                          }\r\n                          onChange={value => {\r\n                            formik.setValues(\r\n                              produce(values => {\r\n                                // clear budget selection when funding type is changed to an incompatible value\r\n                                // for example, if an external budget is selected, and funding type is changed to internal - budget should be reset\r\n                                if (\r\n                                  (value as Entity<number>).Id !==\r\n                                  (values.Budget as IBudgetFilterDto)\r\n                                    ?.FundingTypeId\r\n                                ) {\r\n                                  values.Budget = null;\r\n                                }\r\n                                values.FundingType = value;\r\n                              }),\r\n                            );\r\n                          }}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.budgetVisible && (\r\n                      <FormRow>\r\n                        <FormBudgetPicker\r\n                          name=\"Budget\"\r\n                          id=\"BudgetID\"\r\n                          predicates={restrictedBudgetFilter({\r\n                            budgetLimitedByUsers:\r\n                              connectedSettings.budgetLimitedByUsers || false,\r\n                            isBudgetsWithoutUserGroup:\r\n                              connectedSettings.isBudgetsWithoutUserGroup ||\r\n                              false,\r\n                            userGroupId: connectedSettings.ReservationUserGroupGroupByBudgetUserGroup\r\n                              ? undefined\r\n                              : formik.values.UserGroup?.Id,\r\n                            serviceGroupId: undefined,\r\n                            services: serviceTypes,\r\n                            startTime: dateUtils.dateOrStringToDate(\r\n                              formik.values.StartTime,\r\n                            ),\r\n                            endTime: dateUtils.dateOrStringToDate(\r\n                              formik.values.EndTime,\r\n                            ),\r\n                            user: createUpdateAllowed\r\n                              ? formik.values.User === null ||\r\n                                formik.values.User === undefined\r\n                                ? undefined\r\n                                : formik.values.User.Id\r\n                              : authenticatedUser?.Id,\r\n                            defaultBudgetEnabled:\r\n                              globalSettings.defaultBudgetEnabled,\r\n                            userDefaultBudgetEnabled:\r\n                              globalSettings.userDefaultBudgetEnabled,\r\n                            hideNonDefaultBudgets:\r\n                              globalSettings.hideNonDefaultBudgets,\r\n                            // funding type is set to Internal by default even if it's not in use\r\n                            fundingType: connectedSettings.fundingTypeVisible\r\n                              ? formik.values.FundingType\r\n                              : null,\r\n                          })}\r\n                          label={t(translations.BudgetNumber)}\r\n                          onChange={() => setBudgetChanged(true)}\r\n                          disabled={\r\n                            formik.isSubmitting ||\r\n                            !editAllowed ||\r\n                            connectedSettings.hideProject ||\r\n                            forceDisabled\r\n                          }\r\n                          useSearchOrPredicate={\r\n                            globalSettings.hideNonDefaultBudgets\r\n                          }\r\n                          info={budgetPickerInfo}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {connectedSettings.budgetExpirementVisible &&\r\n                      formik.values.Budget !== null &&\r\n                      formik.values.Budget?.HideExperiments !== true && (\r\n                        <FormRow fullRow>\r\n                          <FormBudgetExperimentsPicker\r\n                            fullWidth\r\n                            id=\"BudgetExperimentID\"\r\n                            name=\"BudgetExperiment\"\r\n                            placeholder={t(translations.BudgetExperiment)}\r\n                            label={t(translations.BudgetExperiment)}\r\n                            predicates={budgetExperimentsFilter(\r\n                              serviceTypes,\r\n                              serviceTypeEnum,\r\n                              formik.values.Budget?.Id,\r\n                              formik.values.StartTime,\r\n                              formik.values.EndTime,\r\n                            )}\r\n                            onChange={() => setBudgetExpirementChanged(true)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              !editAllowed ||\r\n                              forceDisabled\r\n                            }\r\n                            username={\r\n                              formik.values.User?.Id ?? authenticatedUser?.Id\r\n                            }\r\n                          />\r\n                        </FormRow>\r\n                      )}\r\n                    {globalSettings.purchaseOrderBudgetEnabled &&\r\n                      ((formik.values.Budget as IBudgetFilterDto)\r\n                        ?.PurchaseOrderOptionId ??\r\n                        PurchaseOrderOptions.Hidden) !==\r\n                        PurchaseOrderOptions.Hidden && (\r\n                        <FormRow>\r\n                          <FormTextField\r\n                            name=\"PurchaseOrder\"\r\n                            label={t(translations.PurchaseOrder)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              !editAllowed ||\r\n                              forceDisabled\r\n                            }\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                      )}\r\n                  </FormFieldsSection>\r\n                )}\r\n              </form>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n}\r\n","import { Portal } from '@material-ui/core';\r\nimport { Skeleton } from '@material-ui/lab';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { Fragment, MutableRefObject, useCallback, useRef } from 'react';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ConnectedFiltersForm } from '.';\r\nimport { useConnectedFiltersSlice } from './slice';\r\n\r\nexport interface ConnectedFiltersControlProps {\r\n  initialState?: IConnectedFiltersDto;\r\n  saveConnectedFilters?: (values: IConnectedFiltersDto) => void;\r\n  submitFormRef: MutableRefObject<any>;\r\n  isEdit: boolean;\r\n  serviceTypeEnum?: ServiceType;\r\n  serviceTypes: IServiceTypeFilterDto[];\r\n  formIsValid?: (isValid: boolean) => void;\r\n  globalSettings: GlobalSettingsType;\r\n  startTimeLabel?: string;\r\n  endTimeLabel?: string;\r\n  startLabelInline?: boolean;\r\n  endLabelInline?: boolean;\r\n  orderForConsumables?: boolean;\r\n  forceDisabled?: boolean;\r\n  budgetPickerInfo?: string;\r\n}\r\n\r\nexport function ConnectedFiltersControl(\r\n  props: ConnectedFiltersControlProps,\r\n): JSX.Element {\r\n  //PROPS\r\n  const {\r\n    initialState,\r\n    saveConnectedFilters,\r\n    submitFormRef,\r\n    isEdit,\r\n    serviceTypeEnum,\r\n    serviceTypes,\r\n    formIsValid,\r\n    globalSettings,\r\n    startTimeLabel,\r\n    endTimeLabel,\r\n    startLabelInline,\r\n    endLabelInline,\r\n    orderForConsumables,\r\n    forceDisabled,\r\n    budgetPickerInfo,\r\n  } = props;\r\n  //REDUX\r\n  const dispatch = useDispatch();\r\n  const { actions } = useConnectedFiltersSlice();\r\n\r\n  //REFS\r\n  const portalRef = useRef(null);\r\n  //BIND\r\n  const bindSubmitForm = useCallback(\r\n    submitForm => {\r\n      submitFormRef.current = submitForm;\r\n    },\r\n    [submitFormRef],\r\n  );\r\n  //ON SUBMIT\r\n  const handleSubmit = useCallback(\r\n    (values: IConnectedFiltersDto) => {\r\n      if (saveConnectedFilters) {\r\n        saveConnectedFilters(values);\r\n      } else {\r\n        var d = {\r\n          StartTime:\r\n            values.StartTime === undefined\r\n              ? undefined\r\n              : dateUtils.formatISO(\r\n                  dateUtils.dateOrStringToDate(values.StartTime),\r\n                ),\r\n          User: values.User,\r\n          UserGroup: values.UserGroup,\r\n          Budget: values.Budget,\r\n          BudgetExperiment: values.BudgetExperiment,\r\n          InstituteProject: values.InstituteProject,\r\n          EndTime: values.EndTime,\r\n          ExternalCustomer: values.ExternalCustomer,\r\n          FundingType: values.FundingType,\r\n          PurchaseOrder: values.PurchaseOrder,\r\n          Reference: values.Reference,\r\n        } as IConnectedFiltersDto;\r\n        dispatch(actions.saveState(d));\r\n      }\r\n    },\r\n    [actions, dispatch, saveConnectedFilters],\r\n  );\r\n\r\n  //RENDER\r\n  return initialState ? (\r\n    <Fragment>\r\n      <div ref={portalRef} style={{ width: '100%' }} />\r\n      <Portal container={portalRef.current}>\r\n        <ConnectedFiltersForm\r\n          isEdit={isEdit}\r\n          onSubmit={handleSubmit}\r\n          ConnectedFiltersData={initialState ?? undefined}\r\n          bindSubmitForm={bindSubmitForm}\r\n          formIsValid={formIsValid}\r\n          serviceTypeEnum={serviceTypeEnum}\r\n          serviceTypes={serviceTypes}\r\n          globalSettings={globalSettings}\r\n          startTimeLabel={startTimeLabel}\r\n          processing={initialState === undefined}\r\n          orderForConsumables={orderForConsumables}\r\n          forceDisabled={forceDisabled}\r\n          budgetPickerInfo={budgetPickerInfo}\r\n          endTimeLabel={endTimeLabel}\r\n          startLabelInline={startLabelInline}\r\n          endLabelInline={endLabelInline}\r\n        />\r\n      </Portal>\r\n    </Fragment>\r\n  ) : (\r\n    <Fragment>\r\n      <Skeleton variant=\"rect\" />\r\n    </Fragment>\r\n  );\r\n}\r\n","import { IRegionDto } from 'app/pages/Regions/IRegionDto';\r\nimport { IResponseType, IResponseTypeWithId } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport const RegionsApi = {\r\n  getRegion: (payload: { id: number }) => {\r\n    const url = '/api/odata/v4/Regions';\r\n    const params: {\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $filter: '(Id eq ' + payload.id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n  getRegions: () => {\r\n    const url = '/api/odata/v4/Regions';\r\n    const params: {\r\n      $select: string;\r\n    } = {\r\n      $select: 'Id,Name',\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n  insertRegion: (data: IRegionDto) => {\r\n    const url = '/api/odata/v4/Regions';\r\n    return httpClient.post(url, data);\r\n  },\r\n  updateRegion: (data: IRegionDto, rowId: number) => {\r\n    const url = '/api/odata/v4/Regions';\r\n    return httpClient.put<any, IResponseTypeWithId>(\r\n      url + '(' + rowId + ')',\r\n      data,\r\n    );\r\n  },\r\n  deleteRegion: (Id: number) => {\r\n    const url = `/api/odata/v4/Regions/${Id}`;\r\n    return httpClient.deleteCustom<IResponseType>(url);\r\n  },\r\n  deleteSelectedRows: (payload: number[]) => {\r\n    const url = `/api/odata/v4/Regions/DeleteIds`;\r\n    const data = { ids: payload };\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { regionsActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { IRegionDto } from 'app/pages/Regions/IRegionDto';\r\nimport { RegionsApi as api } from 'api/RegionsApi';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { RegionDetailsProps } from '..';\r\nimport { AxiosError } from 'axios';\r\nimport { IResponseTypeWithId } from 'types/ResponseType';\r\n\r\nfunction* doInitRegion(\r\n  action: PayloadAction<{\r\n    id: number;\r\n    initial?: IRegionDto;\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IRegionDto | undefined = action.payload.initial;\r\n    if (data === undefined) {\r\n      const result = yield call(api.getRegion, { id: action.payload.id });\r\n      console.debug('region result: ', result);\r\n      data = result.value[0];\r\n    }\r\n    yield put(\r\n      actions.initRegion_Success({\r\n        hasErrors: data === undefined,\r\n        data: data ?? { Id: 0, Name: '' },\r\n        isEdit: action.payload.id > 0,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    yield put(actions.initRegion_Error(error));\r\n  }\r\n}\r\nfunction* doCreateRegion(action: PayloadAction<{ model: IRegionDto }>) {\r\n  try {\r\n    const result = yield call(api.insertRegion, action.payload.model);\r\n    let response = result as IResponseTypeWithId;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: 'regionInsertError',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (responseSuccess.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'regionInsertSuccess',\r\n            message: responseSuccess[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: true,\r\n              itemName: i18next.t(translations.Region),\r\n              detailsType: RenderPageType.RegionDetails,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                id: '' + response.Id ?? -1,\r\n                initialModel: {\r\n                  Id: response.Id ?? -1,\r\n                  Name: action.payload.model.Name,\r\n                },\r\n              } as RegionDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (responseWarnings.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseWarnings.map(item => {\r\n              return {\r\n                key: 'regionInsertWarning',\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = responseErrors.length > 0;\r\n    yield put(\r\n      actions.createRegion_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'regionInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createRegion_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdateRegion(\r\n  action: PayloadAction<{\r\n    current: IRegionDto;\r\n    original: IRegionDto;\r\n  }>,\r\n) {\r\n  try {\r\n    const results = yield call(\r\n      api.updateRegion,\r\n      action.payload.current,\r\n      action.payload.current.Id,\r\n    );\r\n    let response = results as IResponseTypeWithId;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'regionUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'regionUpdateSuccess',\r\n            message: response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: false,\r\n              itemName: i18next.t(translations.Region),\r\n              detailsType: RenderPageType.RegionDetails,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id ?? -1,\r\n                },\r\n                initialModel: action.payload.current,\r\n              } as RegionDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: 'regionUpdateWarn',\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateRegion_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'regionUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateRegion_Error(Error));\r\n  }\r\n}\r\n\r\nexport function* regionsSaga() {\r\n  yield takeLatest(actions.initRegion.type, doInitRegion);\r\n  yield takeLatest(actions.createRegion.type, doCreateRegion);\r\n  yield takeLatest(actions.updateRegion.type, doUpdateRegion);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IRegionDto } from 'app/pages/Regions/IRegionDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { regionsSaga } from './saga';\r\nimport { RegionsState } from './types';\r\n\r\nexport const initialState: RegionsState = {\r\n  detailsState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n    error: undefined,\r\n  },\r\n  processing: false,\r\n  isEdit: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'regions',\r\n  initialState,\r\n  reducers: {\r\n    initRegion(\r\n      state,\r\n      action: PayloadAction<{\r\n        id: number;\r\n        initial?: IRegionDto;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initRegion_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        data: IRegionDto;\r\n        isEdit: boolean;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.detailsState.data = action.payload.data;\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.isEdit = action.payload.isEdit;\r\n    },\r\n    initRegion_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    resetRegionState(state, action: PayloadAction) {\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.processing = false;\r\n    },\r\n    createRegion(\r\n      state,\r\n      action: PayloadAction<{\r\n        model: IRegionDto;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    createRegion_Success(state, action: PayloadAction<{ hasErrors: boolean }>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n    },\r\n    createRegion_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n    updateRegion(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: IRegionDto;\r\n        original: IRegionDto;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    updateRegion_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n    },\r\n    updateRegion_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: regionsActions } = slice;\r\n\r\nexport const useRegionsSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: regionsSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useRegionsSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.regions || initialState;\r\n\r\nexport const selectRegions = createSelector([selectSlice], state => state);\r\n\r\nexport const selectRegionsProcessing = createSelector(\r\n  [selectRegions],\r\n  state => state.processing,\r\n);\r\n\r\nexport const selectDataProcessing = createSelector(\r\n  [selectRegions],\r\n  state => state.detailsState.processing,\r\n);\r\n\r\nexport const selectRegionsData = createSelector(\r\n  [selectRegions],\r\n  state => state.detailsState.data,\r\n);\r\nexport const selectRegionsHasErrors = createSelector(\r\n  [selectRegions],\r\n  state => state.detailsState.hasErrors,\r\n);\r\nexport const selectDetailsCompleted = createSelector(\r\n  [selectRegions],\r\n  state => state.detailsState.completed,\r\n);\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n  selectContinueToLink,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IRegionDto } from '../../IRegionDto';\r\nimport { useRegionsSlice } from './slice';\r\nimport {\r\n  selectDetailsCompleted,\r\n  selectRegionsData,\r\n  selectRegionsHasErrors,\r\n  selectRegionsProcessing,\r\n} from './slice/selectors';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface RegionDetailsProps extends CoverProps, SidePanelContentProps {\r\n  id?: string;\r\n  initialModel?: IRegionDto;\r\n  onClose?: () => void;\r\n}\r\n\r\nexport const RegionDetails = React.memo(function RegionDetails(\r\n  props: RegionDetailsProps,\r\n) {\r\n  const { useSidePanel, id, initialModel, onClose } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRegionsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n  /// Selectors ///\r\n  const processing = useSelector(selectRegionsProcessing);\r\n  const regionData = useSelector(selectRegionsData);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const actionCompleted = useSelector(selectDetailsCompleted);\r\n  const hasError = useSelector(selectRegionsHasErrors);\r\n  /// Refs ///\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<IRegionDto>>(null);\r\n  //cover\r\n  const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [edit, setEdit] = React.useState<boolean | undefined>(false);\r\n\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initRegion({\r\n          id: tryParseInt(id) ?? -1,\r\n          initial: initialModel,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actions, dispatch, firstLoad, initialModel, id]);\r\n  /// functions, callbacks ///\r\n  const closeCover = () => {\r\n    setCover(undefined);\r\n  };\r\n  const handleClose = () => {\r\n    handleCloselClick();\r\n  };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    if (!!onClose) {\r\n      onClose();\r\n    } else {\r\n      if (useSidePanel) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(push('/Regions'));\r\n      }\r\n    }\r\n    dispatch(actions.resetRegionState());\r\n  }, [actions, dispatch, layoutActions, onClose, useSidePanel]);\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: IRegionDto) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateRegion({\r\n            current: values,\r\n            original: regionData || values,\r\n          }),\r\n        );\r\n      } else {\r\n        dispatch(actions.createRegion({ model: values }));\r\n      }\r\n    },\r\n    [actions, dispatch, edit, regionData],\r\n  );\r\n  /// Use Effects ///\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (id !== undefined && !isNaN(parseInt(id))) {\r\n        setEdit(true);\r\n      } else {\r\n        setEdit(false);\r\n      }\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actionCompleted, handleCloselClick, hasError, processing, id]);\r\n  React.useEffect(() => {\r\n    if (confirmApproved) {\r\n      dispatch(actions.resetRegionState());\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(layoutActions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(appSettingsActions.navigate(continueLink));\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n      //dispatch(actions.setChangedState(false));\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n\r\n    return () => undefined;\r\n  }, [\r\n    actions,\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n  ]);\r\n  const regionSchema: Yup.SchemaOf<IRegionDto> = Yup.object({\r\n    Id: Yup.number().notRequired().default(-1),\r\n    Name: Yup.string().required(t(translations.RegionNameIsRequired)),\r\n  });\r\n  const leftActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={busy}\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    return actions;\r\n  }, [busy, handleSaveClick, requestCompleted, t]);\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCloselClick}\r\n          >\r\n            {t(translations.Close)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCloselClick, t]);\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={\r\n          edit\r\n            ? t(translations.menu_EditRegion)\r\n            : t(translations.menu_AddNewRegion)\r\n        }\r\n        titlePage={\r\n          regionData\r\n            ? edit\r\n              ? ` ${t(translations.Region)} #${id || 'N/A'}`\r\n              : ` ${t(translations.AddRegion)}`\r\n            : undefined\r\n        }\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || props.isCover}\r\n        disableExpandToggle={props.isCover}\r\n        closeSidePanel={props.isCover ? onClose : handleClose}\r\n        leftActions={leftActions}\r\n        children={\r\n          regionData !== undefined && !processing ? (\r\n            <Formik\r\n              validationSchema={regionSchema}\r\n              initialValues={regionData}\r\n              validateOnMount={true}\r\n              validateOnBlur={false}\r\n              validateOnChange={true}\r\n              enableReinitialize\r\n              innerRef={innerFormRef}\r\n              onSubmit={async (values, formikHelpers) => {\r\n                // call setSubmit to finish submit cycle\r\n                formikHelpers.validateForm(values).then(responseErrors => {\r\n                  if (!isEmpty(responseErrors)) {\r\n                    formikHelpers.setSubmitting(false);\r\n                    console.debug('errors', responseErrors);\r\n                  } else {\r\n                    console.debug('submitting', values);\r\n                    formikHelpers.setSubmitting(true);\r\n                    handleSubmit(values);\r\n                  }\r\n                });\r\n              }}\r\n            >\r\n              {formik => {\r\n                bindSubmitForm(formik.submitForm);\r\n                return (\r\n                  <React.Fragment>\r\n                    <StyledForm onSubmit={formik.handleSubmit}>\r\n                      <FormLeftSection>\r\n                        <FormFieldsSection\r\n                          titleSection={t(translations.RegionDetails) as string}\r\n                        >\r\n                          <FormRow fullRow>\r\n                            <FormTextField\r\n                              name=\"Name\"\r\n                              label={t(translations.RegionName)}\r\n                              disabled={formik.isSubmitting}\r\n                              fullWidth\r\n                            />\r\n                          </FormRow>\r\n                        </FormFieldsSection>\r\n                      </FormLeftSection>\r\n                    </StyledForm>\r\n                  </React.Fragment>\r\n                );\r\n              }}\r\n            </Formik>\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + 'regions/details', { id: id })}\r\n        toPageLink={`regions/details?${toQueryString({ id: id })}`}\r\n        rightActions={rightActions}\r\n        isCover={props.isCover}\r\n        cover={cover}\r\n        closeCover={props.closeCover || closeCover}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { Dialog } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\n\r\nexport interface PopupPrintToPDFDialogProps {\r\n  open: boolean;\r\n  content: React.ReactNode;\r\n  fullWidth: boolean;\r\n  padding: string;\r\n}\r\nexport function PopupPrintToPDFDialog(props: PopupPrintToPDFDialogProps) {\r\n  return (\r\n    <Dialog\r\n      disableBackdropClick\r\n      disableEscapeKeyDown\r\n      open={props.open}\r\n      aria-labelledby={'PrintToPDF-dialog-popup'}\r\n      fullScreen={false}\r\n      fullWidth={props.fullWidth}\r\n    >\r\n      <Box\r\n        style={{\r\n          width: '100%',\r\n          height: '100%',\r\n          padding: props.padding,\r\n          backgroundColor: '#fcfcfd',\r\n        }}\r\n      >\r\n        {props.content}\r\n      </Box>\r\n    </Dialog>\r\n  );\r\n}\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    titleContainer: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n    },\r\n    closeButton: {\r\n      position: 'absolute',\r\n      right: theme.spacing(1),\r\n      top: theme.spacing(1),\r\n      color: theme.palette.grey[500],\r\n    },\r\n    container: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n    },\r\n    boxcontainer: {\r\n      display: 'flex',\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    selectFileBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      marginTop: '24px',\r\n    },\r\n    infoBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      marginTop: '24px',\r\n      padding: '10PX',\r\n      backgroundColor: '#f0f9ff',\r\n    },\r\n  }),\r\n);\r\n","import React from 'react';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Check, CheckProps } from 'app/components/BasicInputs/Check';\r\n\r\nexport interface CheckBoxProps\r\n  extends Pick<CheckProps, 'value' | 'name' | 'id' | 'label' | 'onChange'> {\r\n  checked: (name: string | undefined) => boolean;\r\n  onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n}\r\n\r\nexport function CheckBox({ checked, ...props }: CheckBoxProps) {\r\n  return (\r\n    <Box>\r\n      <Check\r\n        label=\"This dashboard\"\r\n        color={'primary'}\r\n        checked={checked(props.name)}\r\n        {...props}\r\n        size=\"small\"\r\n      />\r\n      {props.label}\r\n    </Box>\r\n  );\r\n}\r\n","/* eslint-disable prettier/prettier */\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport React, { useCallback, useMemo } from 'react';\r\nimport { useStyles } from './styles';\r\nimport { CheckBox } from './CheckBox';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { usePrintPDFSlice } from '../slice';\r\nimport { PrintPDFItem } from '../slice/types';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { LinearProgress } from '@material-ui/core';\r\nimport { selectPrintPDFSections } from '../slice/selectors';\r\n\r\nconst convertItemsToFlags = (items: PrintPDFItem[]) => {\r\n  const res = {};\r\n  for (const item of items) {\r\n    res[item.id] = item.checked;\r\n  }\r\n  return res;\r\n};\r\n\r\nexport interface PopupPrintToPDFComponentProps {\r\n  title: string;\r\n  items: PrintPDFItem[];\r\n  processing?: boolean;\r\n  preparing?: boolean;\r\n  disabled?: boolean;\r\n  onSubmit: () => void;\r\n  close: () => void;\r\n}\r\n\r\nexport function PopupPrintToPDFComponent(props: PopupPrintToPDFComponentProps) {\r\n  const {items, close, title, processing, disabled, onSubmit, preparing} = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = usePrintPDFSlice();\r\n  const classes = useStyles();\r\n  const sections = useSelector(selectPrintPDFSections);\r\n  const [checkboxes, setCheckboxes] = React.useState<object>(\r\n    convertItemsToFlags(items),\r\n  );\r\n  const handleCheckboxChange = useCallback(\r\n    (event: React.ChangeEvent<HTMLInputElement>) => {\r\n      const id = items.find(\r\n        f => f.id === event.target.value,\r\n      )?.id ?? items[0].id;\r\n\r\n      if (id !== undefined) {\r\n        dispatch(\r\n          actions.updateSection({ id: id, checked: event.target.checked }),\r\n        );\r\n        setCheckboxes({\r\n          ...checkboxes,\r\n          [id]: event.target.checked,\r\n        });\r\n      }\r\n    },\r\n    [actions, checkboxes, dispatch, items],\r\n  );\r\n  const handleCheckboxChecked = useCallback(\r\n    name => {\r\n      return name !== undefined && checkboxes[name];\r\n    },\r\n    [checkboxes],\r\n  );\r\n  const content = useMemo(() => {\r\n    if (!!sections && sections.length > 0) {\r\n      const res = sections.filter(f=> !f.static).map(item => {\r\n        return (\r\n          <CheckBox\r\n            name={item.id}\r\n            id={item.id}\r\n            value={item.id}\r\n            checked={handleCheckboxChecked}\r\n            onChange={handleCheckboxChange}\r\n            label={item.label}\r\n          />\r\n        );\r\n      });\r\n      return res;\r\n    } else {\r\n      return <></>;\r\n    }\r\n  }, [handleCheckboxChange, handleCheckboxChecked, sections]);\r\n  return (\r\n    <>\r\n      <Box className={clsx(classes.root)}>\r\n        <Box style={{ height: '85%' }}>\r\n          <Box className={classes.titleContainer}>\r\n            <IconButton\r\n              variant=\"ghost\"\r\n              aria-label=\"close\"\r\n              className={classes.closeButton}\r\n              onClick={close}\r\n              size=\"small\"\r\n            >\r\n              <Icon icon=\"times\" />\r\n            </IconButton>\r\n            <H4>{title}</H4>\r\n          </Box>\r\n          {preparing !== undefined && preparing && (\r\n            <Box style={{ width: '100%' }}>\r\n              <LinearProgress variant=\"query\" color=\"primary\" />\r\n            </Box>\r\n          )}\r\n          <Box style={{ marginBottom: '15px' }}>{content}</Box>\r\n        </Box>\r\n        <Box style={{ height: '15%' }} className={clsx(classes.container)}>\r\n          <Box style={{ display: 'flex' }}>\r\n            <Button\r\n              processing={processing}\r\n              disabled={disabled}\r\n              onClick={() => onSubmit()}\r\n            >\r\n              {'Print'}\r\n            </Button>\r\n            <Button\r\n              variant=\"ghost\"\r\n              onClick={close}\r\n              style={{ marginLeft: '10px' }}\r\n            >\r\n              {t(translations.Cancel)}\r\n            </Button>\r\n          </Box>\r\n        </Box>\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n","import { PrintPDFItem } from '../slice/types';\r\nimport { PopupPrintToPDFDialog } from './Dialog';\r\nimport { PopupPrintToPDFComponent } from './PopupPrintToPDFComponent';\r\n\r\nexport interface PrintToPDFPopupProps {\r\n  title: string;\r\n  show: boolean;\r\n  processing?: boolean;\r\n  preparing?: boolean;\r\n  disabled?: boolean;\r\n  items: PrintPDFItem[];\r\n  fullWidth?: boolean;\r\n  onClose: () => void;\r\n  onSubmit: () => void;\r\n}\r\nexport function PrintToPDFPopup({\r\n  title,\r\n  show,\r\n  items,\r\n  processing,\r\n  preparing,\r\n  disabled,\r\n  fullWidth,\r\n  onClose,\r\n  onSubmit,\r\n}: PrintToPDFPopupProps) {\r\n  return (\r\n    <>\r\n      <PopupPrintToPDFDialog\r\n        open={show}\r\n        padding={'32px'}\r\n        fullWidth={fullWidth === undefined ? true : fullWidth}\r\n        content={\r\n          <PopupPrintToPDFComponent\r\n            title={title}\r\n            items={items}\r\n            processing={processing}\r\n            preparing={preparing}\r\n            disabled={disabled}\r\n            close={onClose}\r\n            onSubmit={onSubmit}\r\n          />\r\n        }\r\n      />\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * PriorityPicker\r\n *\r\n */\r\n\r\nimport {\r\n  ServiceRequestMilestoneStatusesUnionArray,\r\n  ServiceRequestMilestoneStatusesUnion,\r\n} from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport {\r\n  EnumPicker,\r\n  EnumPickerProps,\r\n  withEnumOptions,\r\n} from 'app/components/BasicPickers/EnumPicker';\r\n\r\nexport type ServiceRequestMilestoneStatusPickerProps = Omit<\r\n  EnumPickerProps<ServiceRequestMilestoneStatusesUnion>,\r\n  'EnumNamesArray'\r\n>;\r\nexport const ServiceRequestMilestoneStatusPicker = withEnumOptions<\r\n  ServiceRequestMilestoneStatusesUnion\r\n>(ServiceRequestMilestoneStatusesUnionArray)(EnumPicker);\r\n","/**\r\n *\r\n * FormServiceRequestMilestoneStatusPicker\r\n *\r\n */\r\n\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  ServiceRequestMilestoneStatusPicker,\r\n  ServiceRequestMilestoneStatusPickerProps,\r\n} from '../pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusPicker';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\n\r\nexport const FormServiceRequestMilestoneStatusPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<ServiceRequestMilestoneStatusesUnion | null> &\r\n  Omit<IFieldProps, 'onChange'> &\r\n  Pick<ServiceRequestMilestoneStatusPickerProps, 'onChange'>) => {\r\n  const [\r\n    field,\r\n    meta,\r\n    helpers,\r\n  ] = useField<ServiceRequestMilestoneStatusesUnion | null>(props);\r\n  return (\r\n    <>\r\n      <ServiceRequestMilestoneStatusPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as Yup from 'yup';\r\nimport { IServiceRequestMilestoneForm } from '../../RequestSamplesPage/slice/types';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { ServiceRequestMilestoneStatusesUnionArray } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { FormUsersPicker } from 'app/components/Forms/FormUsersPicker';\r\nimport { FormServiceRequestMilestoneStatusPicker } from 'app/components/Forms/FormServiceRequestMilestoneStatusPicker';\r\nimport { selectServiceRequestMilestoneProcessing } from '../../RequestSamplesPage/slice/selectors';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface ServiceRequestMilestoneDetailsProps {\r\n  serviceRequestId: number;\r\n  type: 'Insert' | 'Update';\r\n  value?: IServiceRequestMilestoneDto;\r\n}\r\n\r\nexport function ServiceRequestMilestoneDetails(\r\n  props: ServiceRequestMilestoneDetailsProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const submitRef = React.useRef<(() => Promise<void>) | undefined>();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const processing = useSelector(selectServiceRequestMilestoneProcessing);\r\n\r\n  const formType =\r\n    props.value?.Id !== undefined && props.value.Id > 0 ? 'Update' : 'Insert';\r\n  const insert = React.useCallback(\r\n    (value: IServiceRequestMilestoneForm) => {\r\n      dispatch(\r\n        actions.insertMilestone({\r\n          ...toDto(value),\r\n          ...{ ServiceRequestId: props.serviceRequestId },\r\n        }),\r\n      );\r\n    },\r\n\r\n    [actions, dispatch, props.serviceRequestId],\r\n  );\r\n  const updateCharge = React.useCallback(\r\n    (value: IServiceRequestMilestoneForm) => {\r\n      dispatch(\r\n        actions.updateMilestone({\r\n          ...toDto(value),\r\n          ...{ ServiceRequestId: props.serviceRequestId },\r\n        }),\r\n      );\r\n    },\r\n\r\n    [actions, dispatch, props.serviceRequestId],\r\n  );\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: IServiceRequestMilestoneForm) => {\r\n      switch (formType) {\r\n        case 'Insert':\r\n          insert(values);\r\n          break;\r\n        case 'Update':\r\n          updateCharge(values);\r\n          break;\r\n      }\r\n    },\r\n    [formType, insert, updateCharge],\r\n  );\r\n  const handleSubmitButtonClick = () => {\r\n    submitRef.current?.();\r\n  };\r\n  const initialValues = toInitialValues(props.value);\r\n  const title =\r\n    props.type === 'Insert'\r\n      ? t(translations.AddMilestone)\r\n      : t(translations.Milestone);\r\n  const handleClose = () => dispatch(actions.closeSidePanel());\r\n  return (\r\n    <PageWrapper\r\n      useSidePanel\r\n      closable\r\n      disableExpandToggle\r\n      isCover={true}\r\n      pageName={title}\r\n      titlePage={title}\r\n      topProcessing={processing}\r\n      closeSidePanel={handleClose}\r\n      leftActions={[\r\n        () => (\r\n          <Button\r\n            onClick={handleSubmitButtonClick}\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"save\" />}\r\n            processing={processing}\r\n          >\r\n            {t(translations.Submit)}\r\n          </Button>\r\n        ),\r\n      ]}\r\n      rightActions={[\r\n        () => (\r\n          <Button\r\n            onClick={() => dispatch(actions.closeSidePanel())}\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n          >\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n        ),\r\n      ]}\r\n    >\r\n      <Formik\r\n        initialValues={initialValues}\r\n        validationSchema={serviceRequestMilestoneSchema}\r\n        onSubmit={handleSubmit}\r\n      >\r\n        {formik => {\r\n          submitRef.current = formik.submitForm;\r\n          return (\r\n            <StyledForm>\r\n              <FormRightSection>\r\n                <FormRow fullRow>\r\n                  <FormTextField\r\n                    name=\"Name\"\r\n                    id=\"Name\"\r\n                    label={t(translations.Name)}\r\n                    fullWidth\r\n                    autoFocus\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormBookitDatePicker\r\n                    name=\"TargetDate\"\r\n                    id=\"TargetDate\"\r\n                    label={t(translations.TargetDate)}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n\r\n                <FormRow fullRow>\r\n                  <FormUsersPicker\r\n                    name=\"Assignees\"\r\n                    id=\"Assignees\"\r\n                    label={t(translations.AssignedTo)}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormBookitDatePicker\r\n                    name=\"CompletionDate\"\r\n                    id=\"CompletionDate\"\r\n                    label={t(translations.CompletionDate)}\r\n                    onChange={value => {\r\n                      const currentStatus = formik.values.Status;\r\n                      const newStatus:\r\n                        | ServiceRequestMilestoneStatusesUnion\r\n                        | undefined =\r\n                        value !== null\r\n                          ? 'Completed'\r\n                          : currentStatus === 'Completed'\r\n                          ? 'NotStarted'\r\n                          : currentStatus;\r\n                      formik.setFieldValue('Status', newStatus);\r\n                    }}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormServiceRequestMilestoneStatusPicker\r\n                    name=\"Status\"\r\n                    id=\"Status\"\r\n                    label={t(translations.Status)}\r\n                    onChange={value => {\r\n                      switch (value) {\r\n                        case 'Completed':\r\n                          if (\r\n                            formik.values.CompletionDate === null ||\r\n                            formik.values.CompletionDate === undefined\r\n                          ) {\r\n                            formik.setFieldValue('CompletionDate', new Date());\r\n                          }\r\n                          break;\r\n                        case 'NotStarted':\r\n                        case 'Started':\r\n                          formik.setFieldValue('CompletionDate', null);\r\n                          break;\r\n                      }\r\n                    }}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormTextField\r\n                    name=\"Description\"\r\n                    id=\"Description\"\r\n                    label={t(translations.Description)}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n              </FormRightSection>\r\n            </StyledForm>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </PageWrapper>\r\n  );\r\n}\r\n\r\nconst serviceRequestMilestoneSchema: Yup.SchemaOf<IServiceRequestMilestoneForm> = Yup.object(\r\n  {\r\n    Assignees: Yup.mixed().optional(),\r\n    CompletionDate: Yup.date().optional().nullable(),\r\n    Id: Yup.number().optional(),\r\n    Name: Yup.string().required(),\r\n    Status: Yup.string()\r\n      .oneOf(ServiceRequestMilestoneStatusesUnionArray)\r\n      .optional() as Yup.SchemaOf<ServiceRequestMilestoneStatusesUnion>,\r\n    TargetDate: Yup.date().optional().nullable(),\r\n    Description: Yup.string().optional(),\r\n  },\r\n);\r\n\r\nconst toDto = (\r\n  value: IServiceRequestMilestoneForm,\r\n): Partial<IServiceRequestMilestoneDto> &\r\n  Pick<IServiceRequestMilestoneDto, 'TargetDate'> => {\r\n  return {\r\n    Id: value.Id,\r\n    Charged: false,\r\n    CompletionDate:\r\n      value.CompletionDate === null\r\n        ? undefined\r\n        : value.CompletionDate === undefined\r\n        ? undefined\r\n        : dateUtils.formatISO(value.CompletionDate),\r\n    Description: value.Description,\r\n    Name: value.Name ?? null,\r\n    Status: value.Status,\r\n    TargetDate:\r\n      value.TargetDate === null\r\n        ? null\r\n        : value.TargetDate === undefined\r\n        ? null\r\n        : dateUtils.formatISO(value.TargetDate),\r\n    Assignees: value.Assignees,\r\n  };\r\n};\r\nconst toInitialValues = (\r\n  value?: IServiceRequestMilestoneDto,\r\n): IServiceRequestMilestoneForm => {\r\n  if (value === undefined) {\r\n    return {\r\n      TargetDate: null,\r\n      CompletionDate: null,\r\n    };\r\n  }\r\n\r\n  const result: IServiceRequestMilestoneForm = {\r\n    Id: value.Id,\r\n    Assignees: value.Assignees,\r\n    CompletionDate:\r\n      value.CompletionDate === null\r\n        ? null\r\n        : dateUtils.parseISO(value.CompletionDate),\r\n    Description: value.Description ?? undefined,\r\n    Name: value.Name ?? undefined,\r\n    Status: value.Status ?? undefined,\r\n    TargetDate:\r\n      value.TargetDate === null\r\n        ? null\r\n        : dateUtils.parseISO(value.TargetDate) ?? undefined,\r\n  };\r\n  return result;\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  UnitType,\r\n  UnitTypePicker,\r\n  UnitTypePickerProps,\r\n} from '../pickers/AutocompletePickers/UnitTypePicker';\r\n\r\nexport const FormUnitTypeTypePicker = (\r\n  props: FieldHookConfig<UnitType | null> &\r\n    Omit<UnitTypePickerProps, 'onChange'>,\r\n) => {\r\n  const [field, meta, helpers] = useField<UnitType | null>(props);\r\n  const handleChange = val => {\r\n    props.onChange?.(val);\r\n    helpers.setValue(val, true);\r\n  };\r\n  return (\r\n    <UnitTypePicker\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      disabled={props.disabled}\r\n      label={props.label}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      $select={props.$select}\r\n      variant=\"filled\"\r\n    />\r\n  );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from '../BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport const FormServiceRequestMilestoneChargeServicePicker = ({\r\n  serviceRequestId,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  Omit<BaseURLPickerProps<Entity<number>>, 'onChange' | 'url'> & {\r\n    serviceRequestId: number;\r\n  }) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  const handleChange = val => {\r\n    props.onChange?.(val);\r\n    helpers.setValue(val, true);\r\n  };\r\n  const url = `/api/odata/v4/ServiceRequests/${serviceRequestId}/ConsumableServices`;\r\n  return (\r\n    <BaseURLPicker\r\n      url={url}\r\n      predicates={props.predicates}\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      disabled={props.disabled}\r\n      label={props.label}\r\n      onChange={handleChange}\r\n      onBlur={field?.onBlur}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      variant=\"filled\"\r\n    />\r\n  );\r\n};\r\n","import { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport {\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport * as Yup from 'yup';\r\nimport { IServiceRequestMilestoneChargeForm } from '../../RequestSamplesPage/slice/types';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormUnitTypeTypePicker } from 'app/components/Forms/FormUnitTypePicker';\r\nimport { selectServiceRequestMilestoneProcessing } from '../../RequestSamplesPage/slice/selectors';\r\nimport { FormServiceRequestMilestoneChargeServicePicker } from 'app/components/Forms/FormServiceRequestMilestoneChargeServicePicker';\r\nimport { BaseToggleButtonGroup } from 'app/components/BasicButtons/BaseToggleButtonGroup';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\nimport {\r\n  getUnitTypesData,\r\n  UnitType,\r\n} from 'app/components/pickers/AutocompletePickers/UnitTypePicker';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\n\r\nexport type ServiceRequestMilestoneChargeType = 'service' | 'charge';\r\nexport interface ServiceRequestMilestoneChargeDetailsProps {\r\n  serviceRequestMilestoneId: number;\r\n  serviceRequestId: number;\r\n  type: ServiceRequestMilestoneChargeType;\r\n  enableAddonCharge: boolean;\r\n  enableManualCharge: boolean;\r\n  value?: IServiceRequestMilestoneChargeDto;\r\n  unitType?: Entity<number>;\r\n}\r\nexport function ServiceRequestMilestoneChargeDetails(\r\n  props: ServiceRequestMilestoneChargeDetailsProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const innerFormRef = React.useRef<FormikProps<\r\n    IServiceRequestMilestoneChargeForm\r\n  > | null>(null);\r\n  const submitRef = React.useRef<(() => Promise<void>) | undefined>();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const processing = useSelector(selectServiceRequestMilestoneProcessing);\r\n  const [selectedType, setSelectedType] = React.useState(props.type);\r\n  const formType =\r\n    props.value?.Id !== undefined && props.value.Id > 0 ? 'Update' : 'Insert';\r\n  const title =\r\n    formType === 'Insert'\r\n      ? selectedType === 'charge'\r\n        ? t(translations.AddCharge)\r\n        : t(translations.AddService)\r\n      : selectedType === 'charge'\r\n      ? t(translations.Charge)\r\n      : t(translations.Service);\r\n\r\n  const insertCharge = React.useCallback(\r\n    (value: IServiceRequestMilestoneChargeForm) => {\r\n      if (value.Type === 'service' && value.Service === undefined) {\r\n        return;\r\n      }\r\n\r\n      switch (value.Type) {\r\n        case 'service':\r\n          dispatch(\r\n            actions.insertMilestoneCharge({\r\n              OfflineServiceType: value.Service, // value.Service?.Id,\r\n              Quantity: value.Quantity,\r\n              Remarks: value.Remarks,\r\n              ServiceRequestId: props.serviceRequestId,\r\n              ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n              Date:\r\n                value.Date === null\r\n                  ? undefined\r\n                  : value.Date === undefined\r\n                  ? undefined\r\n                  : dateUtils.formatISO(value.Date),\r\n            }),\r\n          );\r\n          break;\r\n        case 'charge':\r\n          dispatch(\r\n            actions.insertMilestoneCharge({\r\n              Quantity: value.Quantity,\r\n              Rate: value.Rate,\r\n              Remarks: value.Remarks,\r\n              ServiceRequestId: props.serviceRequestId,\r\n              ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n              Date:\r\n                value.Date === null\r\n                  ? undefined\r\n                  : value.Date === undefined\r\n                  ? undefined\r\n                  : dateUtils.formatISO(value.Date),\r\n              // Id: props.value?.Id,\r\n              Name: value.Name,\r\n              Unit: value.Unit,\r\n            }),\r\n          );\r\n          break;\r\n      }\r\n    },\r\n\r\n    [\r\n      actions,\r\n      dispatch,\r\n      props.serviceRequestId,\r\n      props.serviceRequestMilestoneId,\r\n    ],\r\n  );\r\n  const updateCharge = React.useCallback(\r\n    (value: IServiceRequestMilestoneChargeForm) => {\r\n      if (props.value?.Id === undefined) {\r\n        return;\r\n      }\r\n      switch (value.Type) {\r\n        case 'service':\r\n          dispatch(\r\n            actions.updateMilestoneCharge({\r\n              Id: props.value?.Id,\r\n              OfflineServiceType: value.Service, // value.Service?.Id,\r\n              Quantity: value.Quantity,\r\n              Remarks: value.Remarks,\r\n              ServiceRequestId: props.serviceRequestId,\r\n              ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n              Date:\r\n                value.Date === null\r\n                  ? undefined\r\n                  : value.Date === undefined\r\n                  ? undefined\r\n                  : dateUtils.formatISO(value.Date),\r\n            }),\r\n          );\r\n          break;\r\n        case 'charge':\r\n          dispatch(\r\n            actions.updateMilestoneCharge({\r\n              Id: props.value?.Id,\r\n              Quantity: value.Quantity,\r\n              Rate: value.Rate,\r\n              Remarks: value.Remarks,\r\n              ServiceRequestId: props.serviceRequestId,\r\n              ServiceRequestMilestoneId: props.serviceRequestMilestoneId,\r\n              Date:\r\n                value.Date === null\r\n                  ? undefined\r\n                  : value.Date === undefined\r\n                  ? undefined\r\n                  : dateUtils.formatISO(value.Date),\r\n              // Id: props.value?.Id,\r\n              Name: value.Name,\r\n              Unit: value.Unit,\r\n            }),\r\n          );\r\n          break;\r\n      }\r\n    },\r\n\r\n    [\r\n      actions,\r\n      dispatch,\r\n      props.serviceRequestId,\r\n      props.serviceRequestMilestoneId,\r\n      props.value?.Id,\r\n    ],\r\n  );\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: IServiceRequestMilestoneChargeForm) => {\r\n      switch (formType) {\r\n        case 'Insert':\r\n          insertCharge(values);\r\n          break;\r\n        case 'Update':\r\n          updateCharge(values);\r\n          break;\r\n      }\r\n    },\r\n    [formType, insertCharge, updateCharge],\r\n  );\r\n\r\n  const initialValues = toInitialValues(props.type, props.value);\r\n\r\n  //USE EFFECT ON MOUNT\r\n  useEffectOnMount(() => {\r\n    let mounted = true;\r\n    (async () => {\r\n      try {\r\n        //According to https://prog4biz.atlassian.net/browse/BKT-10663\r\n        if (!!props.unitType) {\r\n          if (mounted) {\r\n            innerFormRef.current?.setFieldValue(\r\n              'Unit',\r\n              props.unitType as UnitType,\r\n            );\r\n          }\r\n        } else {\r\n          const initUnitTypeValue: UnitType = await getUnitTypesData().then(\r\n            resp => resp.filter(u => u.Name === 'Unit')[0] ?? null,\r\n          );\r\n          if (mounted) {\r\n            innerFormRef.current?.setFieldValue('Unit', initUnitTypeValue);\r\n          }\r\n        }\r\n      } catch (e) {\r\n        console.error(e);\r\n      }\r\n    })();\r\n    return () => {\r\n      mounted = false;\r\n    };\r\n  });\r\n\r\n  return (\r\n    <PageWrapper\r\n      useSidePanel\r\n      closable\r\n      disableExpandToggle\r\n      topProcessing={processing}\r\n      isCover={true}\r\n      pageName={title}\r\n      titlePage={title}\r\n      leftActions={[\r\n        () => (\r\n          <Button\r\n            onClick={() => {\r\n              submitRef.current?.();\r\n            }}\r\n            size=\"small\"\r\n            processing={processing}\r\n            startIcon={<Icon icon=\"save\" />}\r\n          >\r\n            {t(translations.Submit)}\r\n          </Button>\r\n        ),\r\n      ]}\r\n      closeSidePanel={() => dispatch(actions.closeSidePanel)}\r\n      rightActions={[\r\n        () => (\r\n          <Button\r\n            onClick={() => dispatch(actions.closeSidePanel())}\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n          >\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n        ),\r\n      ]}\r\n    >\r\n      <Formik\r\n        initialValues={initialValues}\r\n        validationSchema={addServiceSchema}\r\n        onSubmit={handleSubmit}\r\n        handle\r\n        innerRef={innerFormRef}\r\n      >\r\n        {formik => {\r\n          submitRef.current = formik.submitForm;\r\n          if (!formik.isValid) {\r\n            console.debug('form errors', formik.errors);\r\n          }\r\n\r\n          return (\r\n            <StyledForm>\r\n              <FormRightSection>\r\n                {formType === 'Insert' &&\r\n                  props.enableAddonCharge &&\r\n                  props.enableManualCharge && (\r\n                    <FormRow>\r\n                      <ChargeTypeToggle\r\n                        value={formik.values.Type ?? 'charge'}\r\n                        onChange={value => {\r\n                          formik.setFieldValue('Type', value);\r\n                          setSelectedType(value);\r\n                        }}\r\n                      />\r\n                    </FormRow>\r\n                  )}\r\n                {formik.values.Type === 'charge' && (\r\n                  <FormRow fullRow>\r\n                    <FormTextField\r\n                      name=\"Name\"\r\n                      id=\"Name\"\r\n                      label={t(translations.Name)}\r\n                      fullWidth\r\n                      autoFocus\r\n                    />\r\n                  </FormRow>\r\n                )}\r\n                {formik.values.Type === 'charge' && (\r\n                  <FormRow fullRow>\r\n                    <FormUnitTypeTypePicker\r\n                      name=\"Unit\"\r\n                      id=\"Unit\"\r\n                      label={t(translations.Unit)}\r\n                      $select={['Id', 'Name']}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                )}\r\n                <FormRow fullRow>\r\n                  <FormBookitDatePicker\r\n                    name=\"srDate\"\r\n                    id=\"srDate\"\r\n                    label={t(translations.Date)}\r\n                    fullWidth\r\n                    autoFocus={formik.values.Type !== 'charge'}\r\n                    onChange={value => {\r\n                      formik.setFieldValue('Date', value);\r\n                    }}\r\n                  />\r\n                </FormRow>\r\n                {/* todo: filter out the consumable services */}\r\n                {formik.values.Type === 'service' && (\r\n                  <FormRow fullRow>\r\n                    <FormServiceRequestMilestoneChargeServicePicker\r\n                      serviceRequestId={props.serviceRequestId}\r\n                      name=\"Service\"\r\n                      id=\"Service\"\r\n                      label={t(translations.Service)}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                )}\r\n                {formik.values.Type === 'charge' && (\r\n                  <FormRow>\r\n                    <FormNumberField\r\n                      name=\"Rate\"\r\n                      id=\"Rate\"\r\n                      label={t(translations.Rate)}\r\n                      min={0.01}\r\n                      max={999999}\r\n                      step={0.01}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                )}\r\n                <FormRow>\r\n                  <FormNumberField\r\n                    name=\"Quantity\"\r\n                    id=\"Quantity\"\r\n                    label={t(translations.Quantity)}\r\n                    min={0.01}\r\n                    max={999999}\r\n                    step={0.01}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRichTextField\r\n                  name=\"Remarks\"\r\n                  id=\"Remarks\"\r\n                  label={t(translations.Remarks)}\r\n                  fullWidth\r\n                />\r\n              </FormRightSection>\r\n            </StyledForm>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </PageWrapper>\r\n  );\r\n}\r\n\r\nconst addServiceSchema: Yup.SchemaOf<IServiceRequestMilestoneChargeForm> = Yup.object(\r\n  {\r\n    Id: Yup.number().optional(),\r\n    Date: Yup.date().optional().nullable(),\r\n    Unit: Yup.mixed().when('Type', {\r\n      is: 'charge',\r\n      then: Yup.mixed().required(),\r\n    }),\r\n    Service: Yup.mixed().when('Type', {\r\n      is: 'service',\r\n      then: Yup.mixed().required(),\r\n    }),\r\n    Name: Yup.string().when('Type', {\r\n      is: 'charge',\r\n      then: Yup.string().required(),\r\n    }),\r\n    Rate: Yup.number().when('Type', {\r\n      is: 'charge',\r\n      then: Yup.number().required(),\r\n    }),\r\n    Quantity: Yup.number().positive().required(),\r\n    Type: Yup.string().oneOf(['charge', 'service']).required() as Yup.SchemaOf<\r\n      ServiceRequestMilestoneChargeType\r\n    >,\r\n    Remarks: Yup.mixed().optional(),\r\n  },\r\n);\r\n\r\ninterface ChargeTypeToggleProps {\r\n  value: ServiceRequestMilestoneChargeType;\r\n  onChange?: (value: ServiceRequestMilestoneChargeType) => void;\r\n}\r\nfunction ChargeTypeToggle(props: ChargeTypeToggleProps) {\r\n  const { t } = useTranslation();\r\n  const options = React.useMemo<Entity<ServiceRequestMilestoneChargeType>[]>(\r\n    () => [\r\n      {\r\n        Id: 'service',\r\n        Name: t(translations.Service),\r\n      },\r\n      {\r\n        Id: 'charge',\r\n        Name: t(translations.Charge),\r\n      },\r\n    ],\r\n    [t],\r\n  );\r\n  const handleChange = (\r\n    value: Entity<ServiceRequestMilestoneChargeType> | null,\r\n  ) => {\r\n    if (value !== null) {\r\n      props.onChange?.(value.Id);\r\n    }\r\n  };\r\n  const entityValue = options.find(f => f.Id === props.value);\r\n\r\n  return (\r\n    <BaseToggleButtonGroup\r\n      options={options}\r\n      onChange={handleChange}\r\n      value={entityValue ?? null}\r\n      fullWidth\r\n    />\r\n  );\r\n}\r\n\r\nconst toInitialValues = (\r\n  type: ServiceRequestMilestoneChargeType,\r\n  value?: IServiceRequestMilestoneChargeDto,\r\n) => {\r\n  const result: IServiceRequestMilestoneChargeForm =\r\n    value === undefined\r\n      ? {\r\n          Date: null,\r\n        }\r\n      : {\r\n          Id: value.Id,\r\n          Service: value.Service ?? undefined,\r\n          Quantity: value.Quantity ?? undefined,\r\n          Remarks: value.Remarks ?? undefined,\r\n          Date: value.Date === null ? null : dateUtils.parseISO(value.Date),\r\n          Name: value.Name ?? undefined,\r\n          Rate: value.Rate ?? undefined,\r\n          Type: type,\r\n          Unit: value.UnitType ?? undefined,\r\n        };\r\n\r\n  result.Type = type;\r\n  return result;\r\n};\r\n","import { isEqual } from 'lodash';\r\nimport { Descendant } from 'slate';\r\nimport { jsx } from 'slate-hyperscript';\r\nimport { ParagraphElement } from 'types/Slate';\r\nimport { removeHtml } from 'utils/string-utils';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nconst ELEMENT_TAGS = {\r\n  A: el => ({ type: 'link', url: el.getAttribute('href') }),\r\n  BLOCKQUOTE: () => ({ type: 'quote' }),\r\n  H1: () => ({ type: 'heading-one' }),\r\n  H2: () => ({ type: 'heading-two' }),\r\n  H3: () => ({ type: 'heading-three' }),\r\n  H4: () => ({ type: 'heading-four' }),\r\n  H5: () => ({ type: 'heading-five' }),\r\n  H6: () => ({ type: 'heading-six' }),\r\n  IMG: el => ({ type: 'image', url: el.getAttribute('src') }),\r\n  LI: () => ({ type: 'list-item' }),\r\n  OL: () => ({ type: 'numbered-list' }),\r\n  P: () => ({ type: 'paragraph' }),\r\n  PRE: () => ({ type: 'code' }),\r\n  UL: () => ({ type: 'bulleted-list' }),\r\n  MENTION: el => ({\r\n    type: 'mention',\r\n    user: {\r\n      Id: el.getAttribute('id'),\r\n      Name: el.getAttribute('name').split('|').join(' '),\r\n    },\r\n  }),\r\n  TABLE: () => ({ type: 'table' }),\r\n  TBODY: () => ({ type: 'tbody' }),\r\n  THEAD: () => ({ type: 'thead' }),\r\n  TR: () => ({ type: 'table-row' }),\r\n  TD: () => ({ type: 'table-cell' }),\r\n  TH: () => ({ type: 'table-cell-header' }),\r\n};\r\n\r\n// COMPAT: `B` is omitted here because Google Docs uses `<b>` in weird ways.\r\nconst TEXT_TAGS = {\r\n  CODE: () => ({ code: true }),\r\n  DEL: () => ({ strikethrough: true }),\r\n  EM: () => ({ italic: true }),\r\n  I: () => ({ italic: true }),\r\n  S: () => ({ strikethrough: true }),\r\n  STRONG: () => ({ bold: true }),\r\n  U: () => ({ underline: true }),\r\n  DATA: () => ({ plain: true }),\r\n};\r\n\r\nexport const deserialize = el => {\r\n  if (el.nodeType === 3) {\r\n    return el.textContent;\r\n  } else if (el.nodeType !== 1) {\r\n    return null;\r\n  } else if (el.nodeName === 'BR') {\r\n    return '\\n';\r\n  }\r\n\r\n  const { nodeName } = el;\r\n  let parent = el;\r\n\r\n  if (\r\n    nodeName === 'PRE' &&\r\n    el.childNodes[0] &&\r\n    el.childNodes[0].nodeName === 'CODE'\r\n  ) {\r\n    parent = el.childNodes[0];\r\n  }\r\n  let children = Array.from(parent.childNodes).map(deserialize).flat();\r\n\r\n  if (children.length === 0) {\r\n    children = [{ text: '' }];\r\n  }\r\n\r\n  if (el.nodeName === 'BODY') {\r\n    return jsx('fragment', {}, children);\r\n  }\r\n\r\n  if (ELEMENT_TAGS[nodeName]) {\r\n    const attrs = ELEMENT_TAGS[nodeName](el);\r\n    return jsx('element', attrs, children);\r\n  }\r\n\r\n  if (ELEMENT_TAGS[el.className]) {\r\n    const attrs = ELEMENT_TAGS[el.className](el);\r\n    return jsx('element', attrs, children);\r\n  }\r\n\r\n  if (TEXT_TAGS[nodeName]) {\r\n    try {\r\n      const attrs = TEXT_TAGS[nodeName](el);\r\n      return children.map(child => jsx('text', attrs, child));\r\n    } catch (error) {\r\n      //console.log(error); //If have <strong> element, error: The <text> hyperscript tag can only contain text content as children.\r\n      return children;\r\n    }\r\n  }\r\n\r\n  return children;\r\n};\r\n\r\nconst deserializeHtml = node => {\r\n  if (node) {\r\n    return deserialize(node);\r\n  } else return [];\r\n};\r\n\r\nexport const deserializeHtmlString = (\r\n  htmlString: string | undefined | null,\r\n) => {\r\n  let currentSring = htmlString || '';\r\n  if (isEmptyOrWhitespace(currentSring)) {\r\n    currentSring = '<p></p>';\r\n  } else {\r\n    if (currentSring.indexOf('<') === -1) {\r\n      currentSring = '<p>' + currentSring + '</p>';\r\n    }\r\n  }\r\n  const parsed = new DOMParser().parseFromString(currentSring, 'text/html');\r\n  return deserializeHtml(parsed.body);\r\n};\r\n\r\nconst elementHtmlString = props => {\r\n  const { attributes, children, element } = props;\r\n\r\n  switch (element.type) {\r\n    default:\r\n      return '<p ' + attributes + '>' + children + '</p>';\r\n    case 'quote':\r\n      return '<blockquote' + attributes + '>' + children + '</blockquote>';\r\n    case 'code':\r\n      return (\r\n        '<pre>' +\r\n        '<code ' +\r\n        attributes +\r\n        '>' +\r\n        children +\r\n        '</code> ' +\r\n        '</pre> '\r\n      );\r\n    case 'bulleted-list':\r\n      return '<ul ' + attributes + '>' + children + '</ul>';\r\n    case 'heading-one':\r\n      return '<h1 ' + attributes + '>' + children + '</h1>';\r\n    case 'heading-two':\r\n      return '<h2 ' + attributes + '>' + children + '</h2>';\r\n    case 'heading-three':\r\n      return '<h3 ' + attributes + '>' + children + '</h3>';\r\n    case 'heading-four':\r\n      return '<h4 ' + attributes + '>' + children + '</h4>';\r\n    case 'heading-five':\r\n      return '<h5 ' + attributes + '>' + children + '</h5>';\r\n    case 'heading-six':\r\n      return '<h6 ' + attributes + '>' + children + '</h6>';\r\n    case 'list-item':\r\n      return '<li ' + attributes + '>' + children + '</li>';\r\n    case 'numbered-list':\r\n      return '<ol ' + attributes + '>' + children + '</ol>';\r\n    case 'link':\r\n      return (\r\n        '<a href=' + element.url + ' ' + attributes + '>' + children + '</a>'\r\n      );\r\n    case 'mention':\r\n      return (\r\n        '<span class=\"MENTION\" id=' +\r\n        element.user.Id +\r\n        ' name=' +\r\n        element.user.Name.split(' ').join('|') +\r\n        ' ' +\r\n        attributes +\r\n        '>' +\r\n        children +\r\n        '</span>'\r\n      );\r\n    case 'thead':\r\n      return '<thead ' + attributes + '>' + children + '</thead>';\r\n    case 'tbody':\r\n      return '<tbody ' + attributes + '>' + children + '</tbody>';\r\n    case 'table':\r\n      return (\r\n        '<table style=\"height: 70px; width: 99.3288%; border-collapse: collapse; border: solid 1px; font-size: 13px; margin: center;\" ' +\r\n        attributes +\r\n        '>' +\r\n        children +\r\n        '</table>'\r\n      );\r\n    case 'table-row':\r\n      return (\r\n        '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\" ' +\r\n        attributes +\r\n        '>' +\r\n        children +\r\n        '</tr>'\r\n      );\r\n    case 'table-cell':\r\n      return (\r\n        '<td style=\"border: solid 1px #CCCCCF;\" ' +\r\n        attributes +\r\n        '>' +\r\n        children +\r\n        '</td>'\r\n      );\r\n    case 'table-cell-header':\r\n      return '<th ' + attributes + '>' + children + '</th>';\r\n    case 'image':\r\n      return '<img ' + attributes + ' crossorigin=\"anonymous\" />';\r\n    //case 'image':\r\n    //return <ImageElement {...props} />;\r\n  }\r\n};\r\n\r\nconst leafHtmlString = ({ attributes, children, leaf }) => {\r\n  if (children === '\\n') {\r\n    return '<br />';\r\n  }\r\n\r\n  if (leaf.bold) {\r\n    children = '<strong>' + children + '</strong>';\r\n  }\r\n\r\n  if (leaf.code) {\r\n    children = '<code>' + children + '</code>';\r\n  }\r\n\r\n  if (leaf.italic) {\r\n    children = '<em>' + children + '</em>';\r\n  }\r\n\r\n  if (leaf.underline) {\r\n    children = '<u>' + children + '</u>';\r\n  }\r\n\r\n  if (leaf.strikethrough) {\r\n    children = '<del>' + children + '</del>';\r\n  }\r\n  if (leaf.plain) {\r\n    children = '<data>' + children + '</data>';\r\n  }\r\n  if (attributes !== '') {\r\n    return '<span ' + attributes + '>' + children + '</span>';\r\n  } else {\r\n    if (children) return children;\r\n    else return '';\r\n  }\r\n};\r\n\r\nfunction serializeItemHtmlString(item) {\r\n  let children = [];\r\n  if (item.children !== undefined) {\r\n    children = item.children.map(item => {\r\n      if (item.type) {\r\n        return serializeItemHtmlString(item);\r\n      } else {\r\n        return leafHtmlString({\r\n          attributes: '',\r\n          children: item.text,\r\n          leaf: item,\r\n        });\r\n      }\r\n    });\r\n  }\r\n  return elementHtmlString({\r\n    attributes: '',\r\n    children: children.join(''),\r\n    element: item,\r\n  });\r\n}\r\n\r\n/**\r\n * This one serves as an empty placeholder since Slate does not accept undefined. When an empty array is passed it throws one of the following errors:\r\n * * Cannot get the start point in the node at path [] because it has no start text node.\r\n * * Cannot resolve a Slate point from DOM point: [object HTMLDivElement],0\r\n */\r\nconst EMPTY_SLATE_NODE: ParagraphElement[] = [\r\n  {\r\n    type: 'paragraph',\r\n    children: [{ text: '', type: 'text' }],\r\n  },\r\n];\r\n\r\nexport function serializeHtmlString(\r\n  data: Descendant[] | undefined,\r\n): string | undefined {\r\n  const emptyValue = undefined;\r\n  // data won't be undefined since Slate does not work with it, but nevertheless\r\n  if (data === undefined || data === null) {\r\n    return emptyValue;\r\n  }\r\n  // empty array -> empty value\r\n  if (data.length === 0) {\r\n    return emptyValue;\r\n  }\r\n  // default empty slate value -> empty value\r\n  if (isEqual(data, EMPTY_SLATE_NODE)) {\r\n    return emptyValue;\r\n  }\r\n  const elements = data.map(item => {\r\n    return serializeItemHtmlString(item);\r\n  });\r\n  const result = elements.join('');\r\n  // double check that serialized html does have something typed in and is not just a bunch of html entities\r\n  if (isEmptyOrWhitespace(removeHtml(result))) {\r\n    return emptyValue;\r\n  } else {\r\n    return result;\r\n  }\r\n}\r\n","import Box from '@material-ui/core/Box';\r\nimport ToggleButton from '@material-ui/lab/ToggleButton';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport isHotkey from 'is-hotkey';\r\nimport React, {\r\n  ReactNode,\r\n  useCallback,\r\n  useEffect,\r\n  useMemo,\r\n  useRef,\r\n  useState,\r\n} from 'react';\r\nimport {\r\n  createEditor,\r\n  Descendant,\r\n  Editor,\r\n  Range,\r\n  Transforms,\r\n  Point,\r\n  Element as SlateElement,\r\n} from 'slate';\r\nimport { withHistory } from 'slate-history';\r\nimport {\r\n  Editable,\r\n  ReactEditor,\r\n  Slate,\r\n  useFocused,\r\n  useSelected,\r\n  useSlate,\r\n  withReact,\r\n} from 'slate-react';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport {\r\n  deserialize,\r\n  deserializeHtmlString,\r\n  serializeHtmlString,\r\n} from './RichEditorSerializer';\r\nimport { useStyles } from './styles';\r\nimport { CustomEditor, MentionElement } from 'types/Slate';\r\nimport ReactDOM from 'react-dom';\r\nimport {\r\n  relevantUrl,\r\n  UserPicker,\r\n} from '../pickers/AutocompletePickers/UserPicker';\r\nimport { DropDown } from '../DropDown';\r\nimport { createStyles, makeStyles, MenuItem, Theme } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { debounce } from 'lodash';\r\n\r\nimport imageExtensions from 'image-extensions';\r\nimport isUrl from 'is-url';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport clsx from 'clsx';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\n\r\nconst HOTKEYS = {\r\n  'mod+b': 'bold',\r\n  'mod+i': 'italic',\r\n  'mod+u': 'underline',\r\n  'mod+`': 'code',\r\n};\r\n\r\nexport interface RichEditorProps {\r\n  value: Descendant[];\r\n  setValue: (value: Descendant[]) => void;\r\n  onChangeMentions?: (mentions: Entity<string>[]) => void;\r\n  placeholder?: string;\r\n  info?: NonNullable<React.ReactNode>;\r\n  autoFocus?: boolean;\r\n  borders?: boolean;\r\n  compact?: boolean;\r\n  readonly?: boolean;\r\n  hasMentions?: boolean;\r\n  additionalButtons?: ((className, key) => ReactNode)[];\r\n  disabled?: boolean;\r\n  useCodeButton?: boolean;\r\n  isInvoiceTemplateEditor?: boolean;\r\n  extendedMode?: boolean;\r\n  setControlsVisible?: (visible: boolean) => void;\r\n  labelOnTop?: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\n\r\nconst RichTextWithMentions = (props: RichEditorProps) => {\r\n  const {\r\n    value,\r\n    setValue,\r\n    placeholder,\r\n    info,\r\n    autoFocus,\r\n    hasMentions,\r\n    onChangeMentions,\r\n    additionalButtons,\r\n    disabled,\r\n    useCodeButton,\r\n    isInvoiceTemplateEditor,\r\n    setControlsVisible,\r\n    labelOnTop,\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    extendedMode,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const renderElement = useCallback(props => <Element {...props} />, []);\r\n  const renderLeaf = useCallback(props => <Leaf {...props} />, []);\r\n  const editor = useMemo(() => {\r\n    return withMentions(\r\n      withImages(withTables(withHtml(withHistory(withReact(createEditor()))))),\r\n    );\r\n  }, []);\r\n  const [initValue, setInitValue] = useState(value);\r\n  const ref = useRef<HTMLDivElement>(null);\r\n  const [target, setTarget] = useState<Range | undefined>();\r\n  const [index, setIndex] = useState(0);\r\n  const [search, setSearch] = useState('');\r\n  const [users, setUsers] = useState<Entity<string>[]>([]);\r\n  const [mention, setMention] = useState<any>();\r\n  const [mentions, setMentions] = useState<Entity<string>[]>([]);\r\n  const showControlPanel = React.useMemo(() => {\r\n    let stringVal = serializeHtmlString(initValue);\r\n    return stringVal !== '' && stringVal !== undefined && stringVal !== null;\r\n  }, [initValue]);\r\n  const servicegroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const serviceGroups = useMemo(\r\n    () => props.serviceGroups ?? servicegroups,\r\n    [props.serviceGroups, servicegroups],\r\n  );\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const withoutServiceGroups =\r\n    authenticatedUser?.isLabTech() || authenticatedUser?.isGroupAdmin();\r\n  useEffect(() => {\r\n    if (setControlsVisible) {\r\n      setControlsVisible(showControlPanel);\r\n    }\r\n  }, [setControlsVisible, showControlPanel]);\r\n  useEffect(() => {\r\n    if (!hasMentions) return;\r\n    let unmounted = false;\r\n    (search => {\r\n      const url = relevantUrl;\r\n      const params: {\r\n        $orderby: string;\r\n        $top: number;\r\n        $filter?: string;\r\n        $select?: string;\r\n      } = {\r\n        $orderby: 'Name asc',\r\n        $select: 'Id,Name',\r\n        $top: 10,\r\n      };\r\n      if (search !== null) {\r\n        params.$filter = new ODataFilterBuilder<Entity<string>>({\r\n          predicates: [],\r\n          stringColumns: ['Name'],\r\n          stringSearch: search,\r\n          globalServiceGroupFilter:\r\n            !serviceGroups?.length || withoutServiceGroups\r\n              ? undefined\r\n              : [\r\n                  new Condition<any>(\r\n                    'ServiceGroups',\r\n                    ODataOperators.AnyIn,\r\n                    serviceGroups,\r\n                    'Id',\r\n                  ),\r\n                ],\r\n        }).toString();\r\n      }\r\n\r\n      httpClient\r\n        .get(url, params)\r\n        .then(response => response.value as Entity<string>[])\r\n        .then(v => {\r\n          if (!unmounted) {\r\n            setUsers(v);\r\n          }\r\n        })\r\n        .catch(e => console.error(e));\r\n    })(search);\r\n    return () => {\r\n      unmounted = true;\r\n    };\r\n  }, [search, hasMentions, serviceGroups, withoutServiceGroups]);\r\n\r\n  useEffect(() => {\r\n    if (target && mention && hasMentions) {\r\n      Transforms.insertNodes(\r\n        editor,\r\n        [\r\n          { text: '', plain: true } as any,\r\n          mention as MentionElement,\r\n          { text: ' ', plain: true } as any,\r\n        ],\r\n        {\r\n          at: target,\r\n        },\r\n      );\r\n      Transforms.move(editor, { distance: 2 });\r\n      setTarget(undefined);\r\n      setMention(undefined);\r\n    }\r\n  }, [target, mention, editor, hasMentions]);\r\n\r\n  const onKeyDown = useCallback(\r\n    event => {\r\n      if (hasMentions && target && users.length) {\r\n        switch (event.key) {\r\n          case 'ArrowDown':\r\n            event.preventDefault();\r\n            const prevIndex = index >= users.length - 1 ? 0 : index + 1;\r\n            setIndex(prevIndex);\r\n            break;\r\n          case 'ArrowUp':\r\n            event.preventDefault();\r\n            const nextIndex = index <= 0 ? users.length - 1 : index - 1;\r\n            setIndex(nextIndex);\r\n            break;\r\n          case 'Tab':\r\n          case 'Enter':\r\n            event.preventDefault();\r\n            setMention({\r\n              type: 'mention',\r\n              user: { ...users[index] },\r\n              children: [{ text: '' }],\r\n            });\r\n            break;\r\n          case 'Escape':\r\n            event.preventDefault();\r\n            setTarget(undefined);\r\n            break;\r\n        }\r\n      }\r\n    },\r\n    [hasMentions, index, target, users],\r\n  );\r\n  useEffect(() => {\r\n    if (target) {\r\n      const el = ref.current;\r\n      if (!el) return;\r\n      const domRange = ReactEditor.toDOMRange(editor, target);\r\n      const rect = domRange.getBoundingClientRect();\r\n      el.style.top = `${rect.top + window.pageYOffset + 24}px`;\r\n      el.style.left = `${rect.left + window.pageXOffset}px`;\r\n    }\r\n  }, [editor, target]);\r\n  const onMentionsChange = () => {\r\n    if (!hasMentions) return;\r\n    const newMentions = getMentions(editor);\r\n    if (newMentions.length !== mentions.length) {\r\n      setMentions(newMentions);\r\n      onChangeMentions?.(newMentions);\r\n      return;\r\n    }\r\n    if (mentions.every(m => newMentions.map(v => v.Id).includes(m.Id))) return;\r\n    setMentions(newMentions);\r\n    onChangeMentions?.(newMentions);\r\n  };\r\n\r\n  const classes = useStyles(props)();\r\n\r\n  //const fileUploadRef = useRef(null);\r\n\r\n  /*   const onChangeUpload = e => {\r\n    fnRemoteImage(editor, e.target.files);\r\n  }; */\r\n\r\n  const styles = makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      editorBodyStyle: {\r\n        width: '100%',\r\n        maxHeight: '42vh',\r\n        minHeight: '100px',\r\n        paddingLeft: '8px',\r\n        overflowY: 'auto',\r\n        '&::-webkit-scrollbar': {\r\n          width: '6px',\r\n        },\r\n        '&::-webkit-scrollbar-thumb': {\r\n          boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n          borderRadius: '6px',\r\n          backgroundColor: theme.palette.common.grayBorders,\r\n        },\r\n      },\r\n    }),\r\n  );\r\n  const editorClass = styles();\r\n\r\n  const debounceValue = React.useCallback(\r\n    value =>\r\n      debounce(value => {\r\n        setValue(value);\r\n      }, 50)(value),\r\n    [setValue],\r\n  );\r\n  return (\r\n    <Box className={classes.root}>\r\n      <Slate\r\n        editor={editor}\r\n        value={initValue}\r\n        onChange={value => {\r\n          const { selection } = editor;\r\n          if (selection && Range.isCollapsed(selection)) {\r\n            const [start] = Range.edges(selection);\r\n            const wordBefore = Editor.before(editor, start, { unit: 'word' });\r\n            const before = wordBefore && Editor.before(editor, wordBefore);\r\n            const beforeRange = before && Editor.range(editor, before, start);\r\n            const beforeText =\r\n              beforeRange && Editor.string(editor, beforeRange);\r\n            const beforeMatch = beforeText && beforeText.match(/^@(\\w+)$/);\r\n            const after = Editor.after(editor, start);\r\n            const afterRange = Editor.range(editor, start, after);\r\n            const afterText = Editor.string(editor, afterRange);\r\n            const afterMatch = afterText.match(/^(\\s|$)/);\r\n            if (beforeMatch && afterMatch) {\r\n              setTarget(beforeRange);\r\n              setSearch(beforeMatch[1]);\r\n              setIndex(0);\r\n            } else {\r\n              setTarget(undefined);\r\n            }\r\n          }\r\n          debounceValue(value);\r\n          setInitValue(value);\r\n          onMentionsChange();\r\n        }}\r\n      >\r\n        {showControlPanel && (\r\n          <Box className={classes.header}>\r\n            <Box className={classes.headerControls}>\r\n              <MarkButton\r\n                format=\"bold\"\r\n                className={classes.button}\r\n                aria-label=\"bold\"\r\n              >\r\n                <Icon icon=\"bold\" fixedWidth />\r\n              </MarkButton>\r\n              <MarkButton\r\n                format=\"italic\"\r\n                className={classes.button}\r\n                aria-label=\"italic\"\r\n              >\r\n                <Icon icon=\"italic\" fixedWidth />\r\n              </MarkButton>\r\n              <MarkButton\r\n                format=\"underline\"\r\n                className={classes.button}\r\n                aria-label=\"underline\"\r\n              >\r\n                <Icon icon=\"underline\" fixedWidth />\r\n              </MarkButton>\r\n              {useCodeButton && (\r\n                <MarkButton\r\n                  format=\"code\"\r\n                  className={classes.button}\r\n                  aria-label=\"code\"\r\n                >\r\n                  <Icon icon=\"code\" fixedWidth />\r\n                </MarkButton>\r\n              )}\r\n              <BlockButton\r\n                format=\"heading-one\"\r\n                className={classes.button}\r\n                aria-label=\"heading-one\"\r\n              >\r\n                {/* <LooksOneIcon /> */}\r\n                <Icon icon=\"h1\" fixedWidth />\r\n              </BlockButton>\r\n              <BlockButton\r\n                format=\"heading-two\"\r\n                className={classes.button}\r\n                aria-label=\"heading-two\"\r\n              >\r\n                {/* <LooksTwoIcon /> */}\r\n                <Icon icon=\"h2\" fixedWidth />\r\n              </BlockButton>\r\n              <BlockButton\r\n                format=\"block-quote\"\r\n                className={classes.button}\r\n                aria-label=\"block-quote\"\r\n              >\r\n                <Icon icon=\"quote-right\" fixedWidth />\r\n              </BlockButton>\r\n              <BlockButton\r\n                format=\"numbered-list\"\r\n                className={classes.button}\r\n                aria-label=\"numbered-list\"\r\n              >\r\n                <Icon icon=\"list-ol\" fixedWidth />\r\n              </BlockButton>\r\n              <BlockButton\r\n                format=\"bulleted-list\"\r\n                className={classes.button}\r\n                aria-label=\"bulleted-list\"\r\n              >\r\n                <Icon icon=\"list-ul\" fixedWidth />\r\n              </BlockButton>\r\n              {/*             <BlockButton\r\n              format=\"file-alt\"\r\n              className={classes.button}\r\n              aria-label=\"file-alt\"\r\n              onMouseDown={event => {\r\n                event.preventDefault();\r\n                if (!!fileUploadRef.current) {\r\n                  (fileUploadRef.current as any).click();\r\n                }\r\n              }}\r\n            >\r\n              <Icon icon=\"file-alt\" fixedWidth />\r\n            </BlockButton> */}\r\n              {/*             <input\r\n              type=\"file\"\r\n              onChange={onChangeUpload}\r\n              id=\"chooseFile\"\r\n              className=\"invisible\"\r\n              ref={fileUploadRef}\r\n            /> */}\r\n              {hasMentions && (\r\n                <>\r\n                  <DropDown\r\n                    size=\"small\"\r\n                    style={{ lineHeight: 1 }}\r\n                    className={classes.button}\r\n                    color=\"default\"\r\n                    variant=\"ghost\"\r\n                    onMouseDown={e => {\r\n                      e.preventDefault();\r\n                      const end = Editor.end(editor, []);\r\n                      const { selection } = editor;\r\n                      setTarget(selection ?? { anchor: end, focus: end });\r\n                      setUsers([]);\r\n                    }}\r\n                    menuChildren={close => [\r\n                      <MenuItem key=\"userPickerDropDown\">\r\n                        <UserPicker\r\n                          value={null}\r\n                          urlType=\"relevant\"\r\n                          placeholder={t(translations.EnterAUser)}\r\n                          withGroupFilter={!withoutServiceGroups}\r\n                          serviceGroups={props.serviceGroups}\r\n                          selectArray={['Id', 'Name']}\r\n                          onChange={v => {\r\n                            if (!v) return;\r\n                            setMention({\r\n                              type: 'mention',\r\n                              user: v,\r\n                              children: [{ text: '' }],\r\n                            });\r\n                            close();\r\n                          }}\r\n                        />\r\n                      </MenuItem>,\r\n                    ]}\r\n                  >\r\n                    <Icon icon=\"at\" fixedWidth />\r\n                  </DropDown>\r\n                </>\r\n              )}\r\n              {additionalButtons &&\r\n                additionalButtons.map((b, i) =>\r\n                  b(classes.button, 'richtextbutton' + i),\r\n                )}\r\n            </Box>\r\n          </Box>\r\n        )}\r\n        <Box\r\n          className={clsx({\r\n            [classes.text]: !isInvoiceTemplateEditor,\r\n            [classes.textWithInfo]: !isInvoiceTemplateEditor && !!info,\r\n            [classes.textWithControls]: showControlPanel,\r\n            [editorClass.editorBodyStyle]: isInvoiceTemplateEditor,\r\n          })}\r\n        >\r\n          <Editable\r\n            readOnly={disabled}\r\n            className={\r\n              isInvoiceTemplateEditor === true\r\n                ? editorClass.editorBodyStyle\r\n                : undefined\r\n            }\r\n            renderElement={renderElement}\r\n            renderLeaf={renderLeaf}\r\n            placeholder={placeholder}\r\n            disabled={disabled}\r\n            spellCheck\r\n            autoFocus={autoFocus}\r\n            onKeyDown={event => {\r\n              for (const hotkey in HOTKEYS) {\r\n                if (isHotkey(hotkey, event.nativeEvent)) {\r\n                  event.preventDefault();\r\n                  const mark = HOTKEYS[hotkey];\r\n                  toggleMark(editor, mark);\r\n                }\r\n              }\r\n              onKeyDown(event);\r\n            }}\r\n          />\r\n          {!!info && (\r\n            <span\r\n              className={clsx(classes.infoIcon, {\r\n                [classes.withTopLabel]: labelOnTop,\r\n                [classes.showControls]: showControlPanel,\r\n                [classes.showControlsWithTop]: showControlPanel && labelOnTop,\r\n              })}\r\n            >\r\n              <InfoIcon title={info} />\r\n            </span>\r\n          )}\r\n\r\n          {hasMentions && target && users.length > 0 && search !== '' && (\r\n            <Portal>\r\n              <div\r\n                ref={ref}\r\n                style={{\r\n                  position: 'absolute',\r\n                  zIndex: 10000,\r\n                  padding: '3px',\r\n                  background: 'white',\r\n                  borderRadius: '4px',\r\n                  boxShadow: '0 1px 5px rgba(0,0,0,.2)',\r\n                }}\r\n                data-cy=\"mentions-portal\"\r\n              >\r\n                {users.map((char, i) => (\r\n                  <div\r\n                    key={char.Id + i}\r\n                    style={{\r\n                      padding: '1px 3px',\r\n                      borderRadius: '3px',\r\n                      background: i === index ? '#B4D5FF' : 'transparent',\r\n                    }}\r\n                    onMouseEnter={() => {\r\n                      setIndex(i);\r\n                    }}\r\n                    onMouseDown={() =>\r\n                      setMention({\r\n                        type: 'mention',\r\n                        user: char,\r\n                        children: [{ text: '' }],\r\n                      })\r\n                    }\r\n                  >\r\n                    {char.Name}\r\n                  </div>\r\n                ))}\r\n              </div>\r\n            </Portal>\r\n          )}\r\n        </Box>\r\n      </Slate>\r\n    </Box>\r\n  );\r\n};\r\n\r\nconst toggleMark = (editor, format) => {\r\n  const isActive = isMarkActive(editor, format);\r\n\r\n  if (isActive) {\r\n    Editor.removeMark(editor, format);\r\n  } else {\r\n    Editor.addMark(editor, format, true);\r\n  }\r\n};\r\n\r\nconst MarkButton = ({ format, children, className, ...props }) => {\r\n  const editor = useSlate();\r\n  return (\r\n    <ToggleButton\r\n      size=\"small\"\r\n      value={format}\r\n      className={className}\r\n      selected={isMarkActive(editor, format)}\r\n      onMouseDown={event => {\r\n        event.preventDefault();\r\n        toggleMark(editor, format);\r\n      }}\r\n      style={{ lineHeight: 1 }}\r\n      {...props}\r\n    >\r\n      {children}\r\n    </ToggleButton>\r\n  );\r\n};\r\n\r\nconst BlockButton = ({ format, children, className, ...props }) => {\r\n  const editor = useSlate();\r\n  return (\r\n    <ToggleButton\r\n      size=\"small\"\r\n      value={format}\r\n      selected={isBlockActive(editor, format)}\r\n      className={className}\r\n      onMouseDown={event => {\r\n        event.preventDefault();\r\n        toggleBlock(editor, format);\r\n      }}\r\n      style={{ lineHeight: 1 }}\r\n      {...props}\r\n    >\r\n      {children}\r\n    </ToggleButton>\r\n  );\r\n};\r\n\r\nconst isBlockActive = (editor, format) => {\r\n  const [match] = Editor.nodes(editor, {\r\n    match: n => n.type === format,\r\n  });\r\n  return !!match;\r\n};\r\n\r\nconst LIST_TYPES = ['numbered-list', 'bulleted-list'];\r\n\r\nconst toggleBlock = (editor, format) => {\r\n  const isActive = isBlockActive(editor, format);\r\n  const isList = LIST_TYPES.includes(format);\r\n\r\n  Transforms.unwrapNodes(editor, {\r\n    match: n => LIST_TYPES.includes(n.type),\r\n    split: true,\r\n  });\r\n\r\n  Transforms.setNodes(editor, {\r\n    type: isActive ? 'paragraph' : isList ? 'list-item' : format,\r\n  });\r\n\r\n  if (!isActive && isList) {\r\n    const block = { type: format, children: [] };\r\n    Transforms.wrapNodes(editor, block);\r\n  }\r\n};\r\n\r\nconst isMarkActive = (editor, format) => {\r\n  const marks = editor.marks ? Editor.marks(editor) : null;\r\n  return marks ? marks[format] === true : false;\r\n};\r\n\r\nexport const StartRichEditor: React.FC<{\r\n  initialValue: string | undefined;\r\n  onChange: (value: string | undefined) => void;\r\n  placeholder?: string;\r\n  autoFocus?: boolean;\r\n  hasMentions?: boolean;\r\n  onChangeMentions?: (mentions: Entity<string>[]) => void;\r\n  additionalButtons?: ((className, key) => ReactNode)[];\r\n  disabled?: boolean;\r\n  isInvoiceTemplateEditor?: boolean;\r\n  extendedMode?: boolean;\r\n  info?: NonNullable<React.ReactNode>;\r\n  setControlsVisible?: (visible: boolean) => void;\r\n  labelOnTop?: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n}> = ({\r\n  initialValue,\r\n  onChange,\r\n  placeholder,\r\n  autoFocus,\r\n  hasMentions,\r\n  onChangeMentions,\r\n  additionalButtons,\r\n  disabled,\r\n  isInvoiceTemplateEditor,\r\n  extendedMode,\r\n  info,\r\n  setControlsVisible,\r\n  labelOnTop,\r\n  serviceGroups,\r\n}) => {\r\n  const setValue = value => {\r\n    onChange(serializeHtmlString(value));\r\n  };\r\n\r\n  return (\r\n    <RichTextWithMentions\r\n      value={deserializeHtmlString(initialValue)}\r\n      setValue={setValue}\r\n      placeholder={placeholder}\r\n      autoFocus={autoFocus}\r\n      hasMentions={hasMentions}\r\n      onChangeMentions={onChangeMentions}\r\n      additionalButtons={additionalButtons}\r\n      info={info}\r\n      disabled={disabled}\r\n      isInvoiceTemplateEditor={isInvoiceTemplateEditor}\r\n      extendedMode={extendedMode}\r\n      setControlsVisible={setControlsVisible}\r\n      labelOnTop={labelOnTop}\r\n      serviceGroups={serviceGroups}\r\n    />\r\n  );\r\n};\r\n\r\nconst withMentions = (editor: CustomEditor) => {\r\n  const { isInline, isVoid } = editor;\r\n\r\n  editor.isInline = element => {\r\n    return element.type === 'mention' ? true : isInline(element);\r\n  };\r\n\r\n  editor.isVoid = element => {\r\n    return element.type === 'mention' ? true : isVoid(element);\r\n  };\r\n\r\n  return editor;\r\n};\r\n\r\nconst getMentions = editor => {\r\n  const mentions = Editor.nodes(editor, {\r\n    match: node => node.type === 'mention',\r\n    at: [],\r\n  });\r\n  const set = new Set<string>();\r\n  const res: Entity<string>[] = [];\r\n  for (const [node] of mentions) {\r\n    if (node.type === 'mention') {\r\n      const user = (node as MentionElement).user;\r\n      if (!set.has(user.Id)) {\r\n        res.push(user);\r\n        set.add(user.Id);\r\n      }\r\n    }\r\n  }\r\n  return res;\r\n};\r\n\r\nconst Portal = ({ children }) => {\r\n  return typeof document === 'object'\r\n    ? ReactDOM.createPortal(children, document.body)\r\n    : null;\r\n};\r\n\r\nconst fnRemoteImage = (editor, files) => {\r\n  for (const file of files) {\r\n    const [mime] = file.type.split('/');\r\n    if (mime === 'image') {\r\n      const formData = new FormData();\r\n      formData.append('image', file);\r\n      //Need fixing - currently this route is commented on server\r\n      fetch('/api/odata/v4/Files/InsertFile', {\r\n        method: 'POST',\r\n        body: formData,\r\n      })\r\n        .then(response => response.json())\r\n        .then(result => {\r\n          console.log(result);\r\n          insertImage(\r\n            editor,\r\n            result.data\r\n              .uri /* 'file:///C:/bookitlab/web-ui/public/favicon.png' */,\r\n          );\r\n        })\r\n        .catch(error => {\r\n          alert('Error:' + error);\r\n        });\r\n    }\r\n  }\r\n};\r\n\r\nconst withImages = editor => {\r\n  const { insertData, isVoid } = editor;\r\n\r\n  editor.isVoid = element => {\r\n    return element.type === 'image' ? true : isVoid(element);\r\n  };\r\n\r\n  editor.insertData = data => {\r\n    const text = data.getData('text/plain');\r\n    const { files } = data;\r\n    console.log('insertData:', files);\r\n    if (files && files.length > 0) {\r\n      fnRemoteImage(editor, files);\r\n    } else if (isImageUrl(text)) {\r\n      insertImage(editor, text);\r\n    } else {\r\n      insertData(data);\r\n    }\r\n  };\r\n\r\n  return editor;\r\n};\r\n\r\nconst isImageUrl = url => {\r\n  if (!url) return false;\r\n  if (!isUrl(url)) return false;\r\n  const ext = new URL(url).pathname.split('.').pop();\r\n  return imageExtensions.includes(ext as string);\r\n};\r\n\r\nconst insertImage = (editor, url) => {\r\n  const text = { text: '' };\r\n  const image = { type: 'image', url, children: [text] };\r\n  Transforms.insertNodes(editor, image as any);\r\n};\r\n\r\nconst withTables = editor => {\r\n  const { deleteBackward, deleteForward, insertBreak } = editor;\r\n\r\n  editor.deleteBackward = unit => {\r\n    const { selection } = editor;\r\n\r\n    if (selection && Range.isCollapsed(selection)) {\r\n      const [cell] = Editor.nodes(editor, {\r\n        match: n =>\r\n          !Editor.isEditor(n) &&\r\n          SlateElement.isElement(n) &&\r\n          n.type === 'table-cell',\r\n      });\r\n\r\n      if (cell) {\r\n        const [, cellPath] = cell;\r\n        const start = Editor.start(editor, cellPath);\r\n\r\n        if (Point.equals(selection.anchor, start)) {\r\n          return;\r\n        }\r\n      }\r\n    }\r\n\r\n    deleteBackward(unit);\r\n  };\r\n\r\n  editor.deleteForward = unit => {\r\n    const { selection } = editor;\r\n\r\n    if (selection && Range.isCollapsed(selection)) {\r\n      const [cell] = Editor.nodes(editor, {\r\n        match: n =>\r\n          !Editor.isEditor(n) &&\r\n          SlateElement.isElement(n) &&\r\n          n.type === 'table-cell',\r\n      });\r\n\r\n      if (cell) {\r\n        const [, cellPath] = cell;\r\n        const end = Editor.end(editor, cellPath);\r\n\r\n        if (Point.equals(selection.anchor, end)) {\r\n          return;\r\n        }\r\n      }\r\n    }\r\n\r\n    deleteForward(unit);\r\n  };\r\n\r\n  editor.insertBreak = () => {\r\n    const { selection } = editor;\r\n\r\n    if (selection) {\r\n      const [table] = Editor.nodes(editor, {\r\n        match: n =>\r\n          !Editor.isEditor(n) &&\r\n          SlateElement.isElement(n) &&\r\n          n.type === 'table',\r\n      });\r\n\r\n      if (table) {\r\n        return;\r\n      }\r\n    }\r\n\r\n    insertBreak();\r\n  };\r\n\r\n  return editor;\r\n};\r\n\r\nconst withHtml = editor => {\r\n  const { insertData, isInline, isVoid } = editor;\r\n\r\n  editor.isInline = element => {\r\n    return element.type === 'link' ? true : isInline(element);\r\n  };\r\n\r\n  editor.isVoid = element => {\r\n    return element.type === 'image' ? true : isVoid(element);\r\n  };\r\n\r\n  editor.insertData = data => {\r\n    const html = data.getData('text/html');\r\n\r\n    if (html) {\r\n      const parsed = new DOMParser().parseFromString(html, 'text/html');\r\n      const fragment = deserialize(parsed.body);\r\n      Transforms.insertFragment(editor, fragment);\r\n      return;\r\n    }\r\n\r\n    insertData(data);\r\n  };\r\n\r\n  return editor;\r\n};\r\n\r\nconst Element = ({ attributes, children, element }) => {\r\n  switch (element.type) {\r\n    case 'thead':\r\n      return <thead {...attributes}>{children}</thead>;\r\n    case 'tbody':\r\n      return <tbody {...attributes}>{children}</tbody>;\r\n    case 'table':\r\n      return <table {...attributes}>{children}</table>;\r\n    case 'table-row':\r\n      //return <tr {...attributes}>{children}</tr>;\r\n      return (\r\n        <TrStyled\r\n          attributes={attributes}\r\n          children={children}\r\n          element={element}\r\n        />\r\n      );\r\n    case 'table-cell':\r\n      //return <td {...attributes}>{children}</td>;\r\n      return (\r\n        <TdStyled\r\n          attributes={attributes}\r\n          children={children}\r\n          element={element}\r\n        />\r\n      );\r\n    case 'table-cell-header':\r\n      return <th {...attributes}>{children}</th>;\r\n    case 'block-quote':\r\n      return <blockquote {...attributes}>{children}</blockquote>;\r\n    case 'bulleted-list':\r\n      return <ul {...attributes}>{children}</ul>;\r\n    case 'heading-one':\r\n      return <h1 {...attributes}>{children}</h1>;\r\n    case 'heading-two':\r\n      return <h2 {...attributes}>{children}</h2>;\r\n    case 'heading-three':\r\n      return <h3 {...attributes}>{children}</h3>;\r\n    case 'heading-four':\r\n      return <h4 {...attributes}>{children}</h4>;\r\n    case 'heading-five':\r\n      return <h5 {...attributes}>{children}</h5>;\r\n    case 'heading-six':\r\n      return <h6 {...attributes}>{children}</h6>;\r\n    case 'list-item':\r\n      return <li {...attributes}>{children}</li>;\r\n    case 'numbered-list':\r\n      return <ol {...attributes}>{children}</ol>;\r\n    case 'link':\r\n      return (\r\n        <a href={element.url} {...attributes}>\r\n          {children}\r\n        </a>\r\n      );\r\n    case 'mention':\r\n      return (\r\n        <Mention\r\n          attributes={attributes}\r\n          children={children}\r\n          element={element}\r\n        />\r\n      );\r\n    case 'image':\r\n      return (\r\n        <ImageElement\r\n          attributes={attributes}\r\n          children={children}\r\n          element={element}\r\n        />\r\n      );\r\n    default:\r\n      return <p {...attributes}>{children}</p>;\r\n  }\r\n};\r\n\r\nconst Leaf = ({ attributes, children, leaf }) => {\r\n  if (leaf.bold) {\r\n    children = <strong>{children}</strong>;\r\n  }\r\n\r\n  if (leaf.code) {\r\n    children = <code>{children}</code>;\r\n  }\r\n\r\n  if (leaf.italic) {\r\n    children = <em>{children}</em>;\r\n  }\r\n\r\n  if (leaf.underline) {\r\n    children = <u>{children}</u>;\r\n  }\r\n  if (leaf.plain) {\r\n    children = <data>{children}</data>;\r\n  }\r\n\r\n  return <span {...attributes}>{children}</span>;\r\n};\r\n\r\nexport const ImageElement = ({ attributes, children, element }) => {\r\n  const selected = useSelected();\r\n  const focused = useFocused();\r\n  return (\r\n    <div {...attributes}>\r\n      {children}\r\n      <img\r\n        alt=\"Image1\"\r\n        src={element.url}\r\n        className=\"ImageElement\"\r\n        style={{\r\n          display: 'block',\r\n          maxWidth: '100%',\r\n          maxHeight: '20em',\r\n          boxShadow: selected && focused ? '0 0 0 2px blue' : 'none',\r\n        }}\r\n      />\r\n    </div>\r\n  );\r\n};\r\n\r\nexport const TrStyled = ({ attributes, children, element }) => {\r\n  return (\r\n    <tr\r\n      {...attributes}\r\n      className=\"TrStyled\"\r\n      style={{\r\n        textAlign: 'center',\r\n      }}\r\n    >\r\n      {children}\r\n    </tr>\r\n  );\r\n};\r\n\r\nexport const TdStyled = ({ attributes, children, element }) => {\r\n  return (\r\n    <td\r\n      {...attributes}\r\n      className=\"TdStyled\"\r\n      style={{\r\n        border: 'solid 1px #CCCCCF',\r\n      }}\r\n    >\r\n      {children}\r\n    </td>\r\n  );\r\n};\r\n\r\nexport const Mention = ({ attributes, children, element }) => {\r\n  const selected = useSelected();\r\n  const focused = useFocused();\r\n  return (\r\n    <span\r\n      {...attributes}\r\n      contentEditable={false}\r\n      className=\"MENTION\"\r\n      style={{\r\n        padding: '3px 3px 2px',\r\n        margin: '0 1px',\r\n        verticalAlign: 'baseline',\r\n        display: 'inline-block',\r\n        borderRadius: '10px',\r\n        backgroundColor: '#eee',\r\n        fontSize: '0.9em',\r\n        boxShadow: selected && focused ? '0 0 0 2px #B4D5FF' : 'none',\r\n      }}\r\n    >\r\n      @{element.user.Name}\r\n      {children}\r\n    </span>\r\n  );\r\n};\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\nexport const useStyles = props =>\r\n  makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      root: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        //padding: '0px 0px 0px 1px',\r\n        background: theme.palette.common.white,\r\n        border: `1px solid ${theme.palette.common.grayComponentsLight}`,\r\n        boxSizing: 'border-box',\r\n        borderRadius: 8,\r\n      },\r\n      header: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        //padding: '1px 0px',\r\n        width: '100%',\r\n        background: theme.palette.common.white,\r\n        borderBottom: `1px solid ${theme.palette.common.grayComponentsLight}`,\r\n        boxSizing: 'border-box',\r\n        borderRadius: '8px 8px 0px 0px',\r\n      },\r\n      headerControls: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        padding: 0,\r\n        width: '100%',\r\n        flexWrap: 'wrap',\r\n      },\r\n      button: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'center',\r\n        justifyContent: 'center',\r\n        padding: 10,\r\n        border: 'none',\r\n        borderRadius: 0,\r\n        boxShadow: 'inset -1px 0px 0px #E0E5EC',\r\n        color: theme.palette.common.blackRegular,\r\n      },\r\n      text: {\r\n        paddingLeft: theme.spacing(1),\r\n        width: '100%',\r\n        minHeight: 32,\r\n        maxHeight: 300,\r\n        overflowY: 'auto',\r\n      },\r\n      textWithControls: {\r\n        paddingTop: 8,\r\n      },\r\n      textWithInfo: {\r\n        paddingRight: 24,\r\n      },\r\n      infoIcon: {\r\n        position: 'absolute',\r\n        right: '12px',\r\n        top: '16px',\r\n      },\r\n      withTopLabel: {\r\n        top: '42px',\r\n      },\r\n      showControls: {\r\n        top: '48px',\r\n      },\r\n      showControlsWithTop: {\r\n        top: '72px',\r\n      },\r\n    }),\r\n  );\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    avatar: {\r\n      width: '48px',\r\n      height: '48px',\r\n      backgroundColor: '#DBF9ED',\r\n      color: '#10BD79',\r\n    },\r\n    withPointer: {\r\n      cursor: 'pointer',\r\n    },\r\n  }),\r\n);\r\n","import { useMemo } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Body } from '../Typography';\r\nimport { useStyles } from './styles';\r\nimport { Avatar as MuiAvatar } from '@material-ui/core';\r\nimport clsx from 'clsx';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface AvatarProps {\r\n  user?: Entity<string> | null;\r\n}\r\nexport const Avatar = ({ user }: AvatarProps) => {\r\n  const { t } = useTranslation();\r\n  const initials = useMemo(() => {\r\n    const defaultText = t(translations.NA);\r\n    if (user === null) {\r\n      return defaultText;\r\n    }\r\n    if (user === undefined) {\r\n      return defaultText;\r\n    }\r\n    const split = user.Name.split(' ');\r\n    return (split[0][0] + (split[1] ? split[1][0] : '')).toUpperCase();\r\n  }, [t, user]);\r\n  const classes = useStyles();\r\n  const Id = user?.Id ?? undefined;\r\n  return (\r\n    <MuiAvatar\r\n      className={clsx(classes.avatar, {\r\n        [classes.withPointer]: Id !== undefined,\r\n      })}\r\n    >\r\n      <span\r\n        onClick={() => {\r\n          if (Id !== undefined) {\r\n            window.open(toRootedURL('/UserProfile.aspx?id=' + Id), '_blank');\r\n          }\r\n        }}\r\n      >\r\n        <Body\r\n          bold={true}\r\n          className={clsx({ [classes.withPointer]: Id !== undefined })}\r\n          color=\"textSecondary\"\r\n        >\r\n          {initials}\r\n        </Body>\r\n      </span>\r\n    </MuiAvatar>\r\n  );\r\n};\r\n","import { Formik, FormikProps } from 'formik';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser, IIsAdminOfParams } from 'types/AuthenticatedUser';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport {\r\n  FieldHandler,\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { ServiceTypeSchema } from 'app/components/Forms/Schemas';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport {\r\n  OtherServiceDetailsState,\r\n  ServiceChangeStateParameters,\r\n} from '../slice/types';\r\nimport { useOfflineServiceStateSlice } from '../slice';\r\nimport {\r\n  selectConnectedInitState,\r\n  selectFieldHandler,\r\n  selectInventoryBatchEditable,\r\n  selectServiceChangeState,\r\n  selectServiceHasError,\r\n} from '../slice/selectors';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FormOfflineServiceTypePicker } from 'app/components/Forms/FormOfflineServiceTypePicker';\r\nimport { OfflineServiceRelatedFilter } from 'app/components/pickers/AutocompletePickers/OfflineServiceTypePicker';\r\nimport { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport {\r\n  selectConnectedFiltersData,\r\n  selectConnectedSettings,\r\n} from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { ConnectedFiltersControl } from 'app/components/Forms/FormConnectedFilters/ConnectedFiltersControl';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormInventoryBatchPicker } from 'app/components/Forms/FormInventoryBatchPicker';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BatchesByServiceTypeFilter } from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nexport interface OfflineFormProps {\r\n  onSubmit: (item: OtherServiceDetailsState) => void;\r\n  initialValues: OtherServiceDetailsState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  innerFormRef: React.RefObject<FormikProps<OtherServiceDetailsState>>;\r\n  connectedFiltersFormRef: React.MutableRefObject<any>;\r\n  globalSettings: GlobalSettingsType;\r\n  editCreatable?: boolean;\r\n  onBatchClick: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n}\r\nexport const OfflineForm = React.memo(function OfflineForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isEdit,\r\n  isAdmin,\r\n  user,\r\n  connectedFiltersFormRef,\r\n  globalSettings,\r\n  innerFormRef,\r\n  editCreatable,\r\n  onBatchClick,\r\n}: OfflineFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n  //const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const fieldHandler = useSelector(selectFieldHandler);\r\n  const hasError = useSelector(selectServiceHasError);\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  const connectedData = useSelector(selectConnectedFiltersData);\r\n  const connectedInit = useSelector(selectConnectedInitState);\r\n  const serviceChangeState = useSelector(selectServiceChangeState);\r\n  const batchRequested = useSelector(selectInventoryBatchEditable);\r\n  const readonly = !isAdmin && isEdit;\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const handleSubmit = (values: OtherServiceDetailsState) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(actions.resetValueHandler());\r\n  };\r\n\r\n  /// Local State ///\r\n  const [serviceChanged, setServiceChanged] = React.useState(false);\r\n  const [quantityChanged, setQuantityChanged] = React.useState(false);\r\n  const [batchChanged, setBatchChanged] = React.useState(false);\r\n  const [allIsValid, setAllIsValid] = React.useState<boolean>(true);\r\n  const [serviceTypeSelected, setServiceTypeSelected] = useAsyncExtendedState<\r\n    IOfflineServiceFilterDto | undefined\r\n  >(initialValues.ServiceType ?? undefined);\r\n  const minStep = React.useMemo(() => {\r\n    return !!serviceTypeSelected\r\n      ? serviceTypeSelected.IntQuantityOnly === true\r\n        ? 1\r\n        : 0.01\r\n      : 1;\r\n  }, [serviceTypeSelected]);\r\n  const step = React.useMemo(() => {\r\n    return !!serviceTypeSelected\r\n      ? serviceTypeSelected.IntQuantityOnly === true\r\n        ? 1\r\n        : 0.01\r\n      : 1;\r\n  }, [serviceTypeSelected]);\r\n  const fundingTypeVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      globalSettings.fundingTypeBudgetEnabled\r\n    );\r\n  }, [globalSettings]);\r\n  // const defaultQuantity = React.useMemo(() => {\r\n  //   return initialValues.Quantity ?? serviceTypeSelected?.DefaultQuantity;\r\n  // }, [initialValues.Quantity, serviceTypeSelected]);\r\n  const maxStep = 9999;\r\n  const inputProps = {\r\n    step: step,\r\n    min: minStep,\r\n    max: maxStep,\r\n    'aria-label': 'Counter',\r\n  };\r\n  const IsAdminOfService = React.useMemo(() => {\r\n    return user?.IsAdminOf({\r\n      ServiceGroupId: serviceTypeSelected?.ServiceGroupId,\r\n      ServiceId: serviceTypeSelected?.Id,\r\n      ServiceTypeId: ServiceType.Offline,\r\n    } as IIsAdminOfParams);\r\n  }, [serviceTypeSelected, user]);\r\n\r\n  const handleFormChange = React.useCallback(\r\n    (\r\n      values: OtherServiceDetailsState,\r\n      isValid,\r\n      dirty,\r\n      setValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (serviceChanged) {\r\n        dispatch(\r\n          connectedFiltersActions.extendSettingsState({\r\n            services:\r\n              values.ServiceType === null\r\n                ? []\r\n                : [\r\n                    {\r\n                      Id: values.ServiceType.Id,\r\n                      Name: values.ServiceType.Name,\r\n                      ServiceGroupId: values.ServiceType.ServiceGroupId,\r\n                      ServiceTypeId: ServiceType.Offline,\r\n                      Active: true,\r\n                      BudgetsTurnedOn: values.ServiceType.BudgetsTurnedOn,\r\n                      HideProject: values.ServiceType.HideProjects,\r\n                    } as IServiceTypeFilterDto,\r\n                  ],\r\n            globalSettings: globalSettings,\r\n            settings: serviceSettings,\r\n            isEdit: isEdit,\r\n            data: connectedData,\r\n          }),\r\n        );\r\n        if (\r\n          values.ServiceType !== null &&\r\n          !isEdit &&\r\n          connectedData?.User !== null\r\n        ) {\r\n          const parameters = {\r\n            ServiceTypes: [values.ServiceType.Id],\r\n            ReservationId: values.ReservationId || null,\r\n            UsageId: values.UsageId || null,\r\n            BookedBy: connectedData?.User?.Id || null,\r\n            ADGroup: connectedData?.UserGroup?.Id || null,\r\n            Start: dateUtils.formatISO(\r\n              dateUtils.dateOrStringToDate(\r\n                connectedData?.StartTime || new Date(),\r\n              ),\r\n            ),\r\n            BudgetId: connectedData?.Budget?.Id || null,\r\n            FundingTypeId: connectedData?.FundingType?.Id || 0,\r\n          } as ServiceChangeStateParameters;\r\n          dispatch(actions.initServiceChangeStateData(parameters));\r\n        }\r\n        setServiceTypeSelected(values.ServiceType ?? undefined);\r\n        if (\r\n          values.ServiceType?.DefaultQuantity !== null &&\r\n          values.ServiceType?.DefaultQuantity !== undefined\r\n        ) {\r\n          dispatch(\r\n            actions.setAnyValue({\r\n              fieldKey: 'Quantity',\r\n              fieldValue: values.ServiceType.DefaultQuantity,\r\n            }),\r\n          );\r\n        }\r\n\r\n        setServiceChanged(false);\r\n      }\r\n      if (quantityChanged) {\r\n        setQuantityChanged(false);\r\n      }\r\n      if (batchChanged) {\r\n        setBatchChanged(false);\r\n      }\r\n    },\r\n    [\r\n      serviceChanged,\r\n      quantityChanged,\r\n      batchChanged,\r\n      dispatch,\r\n      connectedFiltersActions,\r\n      globalSettings,\r\n      serviceSettings,\r\n      isEdit,\r\n      connectedData,\r\n      setServiceTypeSelected,\r\n      actions,\r\n    ],\r\n  );\r\n  const validateForms = React.useCallback((isValid: boolean) => {\r\n    setAllIsValid(isValid);\r\n  }, []);\r\n  /// refs\r\n  // const formRef = React.useRef<FormikProps<ReservationDetailsState> | null>(\r\n  //   null,\r\n  // );\r\n  /// useEffects\r\n  React.useEffect(() => {\r\n    if (innerFormRef.current) {\r\n      innerFormRef.current.validateForm();\r\n    }\r\n  }, [innerFormRef]);\r\n\r\n  React.useEffect(() => {\r\n    if (batchRequested !== undefined) {\r\n      dispatch(\r\n        actions.setAnyValue({\r\n          fieldKey: 'InventoryBatch',\r\n          fieldValue: batchRequested,\r\n        }),\r\n      );\r\n      dispatch(actions.setInventoryBatchEditable(undefined));\r\n    }\r\n  }, [actions, batchRequested, dispatch]);\r\n\r\n  React.useEffect(() => {\r\n    if (!!serviceChangeState && !editCreatable) {\r\n      console.log('service settings: ', serviceSettings);\r\n      if (!!serviceChangeState) {\r\n        if (serviceSettings.budgetVisible && !isEdit) {\r\n          dispatch(\r\n            connectedFiltersActions.setConnectedValue({\r\n              fieldKey: 'Budget',\r\n              fieldValue: serviceChangeState.DefaultBudget,\r\n            }),\r\n          );\r\n          if (\r\n            fundingTypeVisible &&\r\n            serviceChangeState.DefaultBudget?.FundingTypeId !== undefined &&\r\n            serviceChangeState.DefaultBudget?.FundingTypeId !== null\r\n          ) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'FundingType',\r\n                fieldValue: serviceChangeState.DefaultBudget.FundingTypeId,\r\n              }),\r\n            );\r\n          }\r\n          if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n            if (serviceChangeState.DefaultBudget !== null) {\r\n              dispatch(\r\n                connectedFiltersActions.setConnectedValue({\r\n                  fieldKey: 'UserGroup',\r\n                  fieldValue: {\r\n                    Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n                    Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n                  },\r\n                }),\r\n              );\r\n            }\r\n          } else {\r\n            if (\r\n              connectedData?.UserGroup === null ||\r\n              connectedData?.UserGroup === undefined\r\n            ) {\r\n              dispatch(\r\n                connectedFiltersActions.setConnectedValue({\r\n                  fieldKey: 'UserGroup',\r\n                  fieldValue: {\r\n                    Id:\r\n                      (connectedData?.User as IUserFilterDto).UserGroupId ??\r\n                      user?.ActiveUserGroup?.Id,\r\n                    Name:\r\n                      (connectedData?.User as IUserFilterDto).UserGroupName ??\r\n                      user?.ActiveUserGroup?.Name,\r\n                  },\r\n                }),\r\n              );\r\n            }\r\n          }\r\n          if (\r\n            serviceSettings.budgetExpirementVisible &&\r\n            serviceChangeState.DefaultExperiment !== null\r\n          ) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'BudgetExperiment',\r\n                fieldValue: serviceChangeState.DefaultExperiment,\r\n              }),\r\n            );\r\n          }\r\n        } else {\r\n          if (serviceSettings.isUserGroupCoordinator) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'UserGroup',\r\n                fieldValue: {\r\n                  Id: user?.ActiveUserGroup?.Id,\r\n                  Name: user?.ActiveUserGroup?.Name,\r\n                },\r\n              }),\r\n            );\r\n          }\r\n        }\r\n      }\r\n      dispatch(actions.resetServiceChangeState());\r\n    }\r\n  }, [\r\n    actions,\r\n    connectedData?.User,\r\n    connectedData?.UserGroup,\r\n    connectedFiltersActions,\r\n    dispatch,\r\n    editCreatable,\r\n    fundingTypeVisible,\r\n    isEdit,\r\n    serviceChangeState,\r\n    serviceSettings,\r\n    user?.ActiveUserGroup?.Id,\r\n    user?.ActiveUserGroup?.Name,\r\n  ]);\r\n\r\n  const computedSchema = React.useMemo(() => {\r\n    const otherServiceSchema: Yup.SchemaOf<OtherServiceDetailsState> = Yup.object(\r\n      {\r\n        Id: Yup.number().notRequired().default(-1),\r\n        ServiceType: ServiceTypeSchema.nullable().required(\r\n          t(translations.err_OfflineServiceTypeRequired),\r\n        ),\r\n        DiscountFactor: Yup.number()\r\n          .nullable()\r\n          .label(t(translations.DiscountFactor) as string)\r\n          .max(maxStep)\r\n          .min(0.01)\r\n          .default(null),\r\n        Remarks: Yup.string()\r\n          .nullable()\r\n          .label(t(translations.Remarks) as string),\r\n        Quantity: Yup.number()\r\n          .label(t(translations.Quantity) as string)\r\n          .required(t(translations.err_Quantity_required))\r\n          .nullable()\r\n          .default(null)\r\n          .max(maxStep)\r\n          .min(minStep)\r\n          .test(\r\n            'empty',\r\n            t(translations.err_Quantity_required) as string,\r\n            (value, context) => {\r\n              let currVal = (context as any).from[0].value.Quantity;\r\n              if (\r\n                currVal === undefined ||\r\n                currVal === null ||\r\n                isNaN(currVal) ||\r\n                currVal === 0\r\n              ) {\r\n                return false;\r\n              }\r\n              return true;\r\n            },\r\n          )\r\n          .test(\r\n            'integerOnly',\r\n            t(translations.err_IntQuantityOnly) as string,\r\n            (value, context) => {\r\n              let currVal = (context as any).from[0].value.Quantity;\r\n              if (\r\n                !!serviceTypeSelected &&\r\n                serviceTypeSelected.IntQuantityOnly &&\r\n                currVal % 1 !== 0\r\n              ) {\r\n                return false;\r\n              }\r\n              return true;\r\n            },\r\n          ),\r\n        ReservationId: Yup.number().nullable().notRequired().optional(),\r\n        UsageId: Yup.number().nullable().notRequired().optional(),\r\n        SyncReservation: Yup.boolean().nullable().notRequired().optional(),\r\n        SyncUsage: Yup.boolean().nullable().notRequired().optional(),\r\n        InventoryBatch: (Yup.mixed() as Yup.SchemaOf<IInventoryBatchDto>)\r\n          .nullable()\r\n          .label(t(translations.Batch) as string),\r\n        // ServiceDate: Yup.date()\r\n        // .default(dateUtils.dateOrStringToDate(new Date()))\r\n        // .label(t(translations.StartTime) as string)\r\n        // .required(t(translations._errStartTimeRequired) as string),\r\n        // Budget: Yup.mixed()\r\n        // .label(t(translations.BudgetNumber) as string)\r\n        // .nullable(true),\r\n        // BudgetExperiment: Yup.mixed()\r\n        // .label(t(translations.BudgetExperiment) as string)\r\n        // .nullable(true),\r\n        // BookedBy: Yup.mixed()\r\n        //   .label(t(translations.User) as string)\r\n        //   .required(() => t(translations.err_UserFieldRequired) as string),\r\n        // UserGroup: Yup.mixed()\r\n        //   .label(t(translations.UserGroup) as string)\r\n        //   .nullable(true),\r\n        // InstituteProject: Yup.mixed()\r\n        //   .label(t(translations.InstituteProject) as string)\r\n        //   .nullable(true),\r\n        // ExternalCustomer: Yup.mixed()\r\n        //   .label(t(translations.ExternalCustomer) as string)\r\n        //   .nullable(true),\r\n        // FundingType: Yup.mixed().label(t(translations.FundingType) as string),\r\n        // PurchaseOrder: Yup.string()\r\n        //   .label(t(translations.PurchaseOrder) as string)\r\n        //   .nullable(true),\r\n        // Reference: Yup.string()\r\n        //   .label(t(translations.Reference) as string)\r\n        //   .nullable(true),\r\n      },\r\n    );\r\n    if (!!serviceTypeSelected && serviceTypeSelected.TrackInventory) {\r\n      if (serviceTypeSelected?.NotLessThanZero) {\r\n        // if (serviceTypeSelected.Inventory === 0) {\r\n        //   otherServiceSchema.fields.Quantity.withMutation(schema =>\r\n        //     schema\r\n        //       .label(t(translations.Quantity) as string)\r\n        //       .required(t(translations.err_Quantity_required))\r\n        //       .default(null)\r\n        //       .nullable()\r\n        //       .max(maxStep)\r\n        //       .min(minStep)\r\n        //       .test(\r\n        //         'empty',\r\n        //         t(translations.err_Quantity_required) as string,\r\n        //         (value, context) => {\r\n        //           let currVal = context.from[0].value.Quantity;\r\n        //           if (\r\n        //             currVal === undefined ||\r\n        //             currVal === null ||\r\n        //             isNaN(currVal) ||\r\n        //             currVal === 0\r\n        //           ) {\r\n        //             return false;\r\n        //           }\r\n        //           return true;\r\n        //         },\r\n        //       )\r\n        //       .test(\r\n        //         'minQuantWithZero',\r\n        //         t(\r\n        //           translations.NotAllowNegativeInventory_currentEqualsZero_err,\r\n        //         ) as string,\r\n        //         (value, context) => {\r\n        //           let currVal = context.from[0].value.Quantity;\r\n        //           let current = currVal as number;\r\n        //           if (current < 1) {\r\n        //             return false;\r\n        //           }\r\n        //           return true;\r\n        //         },\r\n        //       ),\r\n        //   );\r\n        // } else {\r\n        //   otherServiceSchema.fields.Quantity.withMutation(schema =>\r\n        //     schema\r\n        //       .label(t(translations.Quantity) as string)\r\n        //       .required(t(translations.err_Quantity_required))\r\n        //       .max(maxStep)\r\n        //       .min(minStep)\r\n        //       .test(\r\n        //         'empty',\r\n        //         t(translations.err_Quantity_required) as string,\r\n        //         (value, context) => {\r\n        //           let currVal = context.from[0].value.Quantity;\r\n        //           if (\r\n        //             currVal === undefined ||\r\n        //             currVal === null ||\r\n        //             isNaN(currVal) ||\r\n        //             currVal === 0\r\n        //           ) {\r\n        //             return false;\r\n        //           }\r\n        //           return true;\r\n        //         },\r\n        //       )\r\n        //       .test(\r\n        //         'minQuant',\r\n        //         (t(\r\n        //           translations.NotAllowNegativeInventory_currentMoreThanZero_err,\r\n        //         ) as string).replace(\r\n        //           '{0}',\r\n        //           serviceTypeSelected.Inventory.toString(),\r\n        //         ),\r\n        //         (value, context) => {\r\n        //           let currVal = context.from[0].value.Quantity;\r\n        //           let current = currVal as number;\r\n        //           if (serviceTypeSelected.Inventory - current < 0) {\r\n        //             return false;\r\n        //           }\r\n        //           return true;\r\n        //         },\r\n        //       ),\r\n        //   );\r\n        // }\r\n      }\r\n      if (serviceTypeSelected?.InventoryBatchesEnabled) {\r\n        otherServiceSchema.fields.InventoryBatch.withMutation(schema =>\r\n          schema\r\n            .label(t(translations.Batch) as string)\r\n            .nullable()\r\n            .required(t(translations.err_InventoryBatch_required) as string),\r\n        );\r\n      }\r\n    }\r\n\r\n    // if (budgetVisible === true) {\r\n    //   otherServiceSchema.fields.Budget.withMutation(schema =>\r\n    //     schema.required(t(translations.BudgetIsRequired) as string),\r\n    //   );\r\n    // }\r\n    return otherServiceSchema;\r\n  }, [minStep, serviceTypeSelected, t]);\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={computedSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        validateOnChange={true}\r\n        enableReinitialize\r\n        innerRef={innerFormRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          if (allIsValid) {\r\n            formikHelpers.validateForm(values).then(responseErrors => {\r\n              if (!isEmpty(responseErrors)) {\r\n                formikHelpers.setSubmitting(false);\r\n                console.debug('errors', responseErrors);\r\n              }\r\n              // else if (errorMessages.length > 0) {\r\n              //   console.debug('errors', errorMessages);\r\n              //   formikHelpers.setSubmitting(false);\r\n              // }\r\n              else {\r\n                console.debug('submitting', values);\r\n                formikHelpers.setSubmitting(true);\r\n                handleSubmit(values);\r\n              }\r\n            });\r\n          } else {\r\n            formikHelpers.setSubmitting(false);\r\n          }\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Reservation errors', formik.errors);\r\n          }\r\n          // if (newStatus && !statusUpdated) {\r\n          //   formik.setFieldValue('Status', newStatus, true);\r\n          //   statusUpdated = true;\r\n          // }\r\n          console.log('Reservation submitting', formik.isSubmitting);\r\n          return (\r\n            <React.Fragment>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['ServiceType']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={resetFieldHandler}\r\n                />\r\n                <SubmittingHandler\r\n                  value={hasError === true && submitting === undefined}\r\n                  resetSubmitting={resetSubmitting}\r\n                />\r\n                <FormLeftSection\r\n                // warningNodes={warningMessages}\r\n                // infoNodes={infoMessages}\r\n                // errors={errorMessages}\r\n                // successNodes={successMessages}\r\n                >\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.Details) as string}\r\n                  >\r\n                    <FormRow fullRow={true}>\r\n                      <FormOfflineServiceTypePicker\r\n                        fullWidth\r\n                        id=\"ServiceTypeID\"\r\n                        name=\"ServiceType\"\r\n                        predicates={OfflineServiceRelatedFilter(\r\n                          [],\r\n                          undefined,\r\n                          connectedData?.Budget?.Id,\r\n                          connectedData?.Budget === null ||\r\n                            connectedData?.Budget === undefined\r\n                            ? undefined\r\n                            : (connectedData?.Budget as IBudgetFilterDto)\r\n                                .ServiceGroupServicesAllowed,\r\n                        )}\r\n                        urlType=\"base\"\r\n                        label={t(translations.Consumable)}\r\n                        placeholder={t(translations.PleaseSelectServices)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          isEdit ||\r\n                          editCreatable === true\r\n                        }\r\n                        onChange={val => {\r\n                          setServiceChanged(true);\r\n                        }}\r\n                      />\r\n                    </FormRow>\r\n                    <ConnectedFiltersControl\r\n                      initialState={connectedInit}\r\n                      submitFormRef={connectedFiltersFormRef}\r\n                      isEdit={isEdit}\r\n                      serviceTypeEnum={ServiceType.Offline}\r\n                      serviceTypes={\r\n                        !serviceTypeSelected\r\n                          ? []\r\n                          : [\r\n                              {\r\n                                Id: serviceTypeSelected.Id,\r\n                                Name: serviceTypeSelected.Name,\r\n                                Active: true,\r\n                                BudgetsTurnedOn:\r\n                                  serviceTypeSelected.BudgetsTurnedOn,\r\n                                HideProject: serviceTypeSelected.HideProjects,\r\n                                ServiceGroupId:\r\n                                  serviceTypeSelected.ServiceGroupId,\r\n                                ServiceTypeId:\r\n                                  serviceTypeSelected.ServiceTypeId,\r\n                              } as IServiceTypeFilterDto,\r\n                            ]\r\n                      }\r\n                      globalSettings={globalSettings}\r\n                      formIsValid={validateForms}\r\n                      startTimeLabel={\r\n                        t(translations.LogDateTimeLabel) as string\r\n                      }\r\n                      startLabelInline={true}\r\n                      forceDisabled={editCreatable}\r\n                    />\r\n                    {!!serviceTypeSelected &&\r\n                      serviceTypeSelected?.InventoryBatchesEnabled &&\r\n                      IsAdminOfService &&\r\n                      !isEdit && (\r\n                        <React.Fragment>\r\n                          <FormRow>\r\n                            <FormInventoryBatchPicker\r\n                              name=\"InventoryBatch\"\r\n                              id=\"batchId\"\r\n                              fullWidth\r\n                              label={t(translations.InventoryBatches)}\r\n                              disabled={formik.isSubmitting || isEdit}\r\n                              predicates={BatchesByServiceTypeFilter(\r\n                                serviceTypeSelected.Id,\r\n                                true,\r\n                              )}\r\n                              onChange={val => {\r\n                                setBatchChanged(true);\r\n                              }}\r\n                            />\r\n                          </FormRow>\r\n                          {formik.values.ServiceType !== null &&\r\n                            formik.values.ServiceType !== undefined &&\r\n                            IsAdminOfService && (\r\n                              <React.Fragment>\r\n                                {formik.values.InventoryBatch !== null &&\r\n                                  formik.values.InventoryBatch !==\r\n                                    undefined && (\r\n                                    <Button\r\n                                      variant=\"text\"\r\n                                      size=\"small\"\r\n                                      onClick={e =>\r\n                                        onBatchClick(\r\n                                          formik.values.InventoryBatch ?? null,\r\n                                          formik.values.ServiceType?.Id ?? 0,\r\n                                        )\r\n                                      }\r\n                                    >\r\n                                      {t(translations.EditSelectedBatch)}\r\n                                    </Button>\r\n                                  )}\r\n                                <Button\r\n                                  variant=\"text\"\r\n                                  size=\"small\"\r\n                                  onClick={e =>\r\n                                    onBatchClick(\r\n                                      null,\r\n                                      formik.values.ServiceType?.Id ?? 0,\r\n                                    )\r\n                                  }\r\n                                >\r\n                                  {t(translations.AddNewBatch)}\r\n                                </Button>\r\n                              </React.Fragment>\r\n                            )}\r\n                        </React.Fragment>\r\n                      )}\r\n                    <FormRow fullRow>\r\n                      <FormNumberField\r\n                        fullWidth\r\n                        id=\"QuantityID\"\r\n                        name=\"Quantity\"\r\n                        noWarnOnNuN={true}\r\n                        inputMode=\"decimal\"\r\n                        placeholder={t(translations.Quantity)}\r\n                        label={t(translations.Quantity)}\r\n                        disabled={formik.isSubmitting}\r\n                        onChange={event => {\r\n                          const precision =\r\n                            formik.values.ServiceType?.IntQuantityOnly === false\r\n                              ? 2\r\n                              : 0;\r\n                          const value = +(+event.target.value).toFixed(\r\n                            precision,\r\n                          );\r\n                          console.log('qyt', value);\r\n                          // if (value < step) {\r\n                          //   event.preventDefault();\r\n                          //   event.stopPropagation();\r\n                          //   formik.setFieldError(\r\n                          //     'Quantity',\r\n                          //     (t(\r\n                          //       translations.err_LowQuantity,\r\n                          //     ) as string).replace('{0}', minStep.toString()),\r\n                          //   );\r\n                          // } else if (value > 0 && value > maxStep) {\r\n                          //   event.preventDefault();\r\n                          //   event.stopPropagation();\r\n                          //   formik.setFieldError(\r\n                          //     'Quantity',\r\n                          //     (t(\r\n                          //       translations.err_HighQuantity,\r\n                          //     ) as string).replace('{0}', maxStep.toString()),\r\n                          //   );\r\n                          // }\r\n                        }}\r\n                        inputProps={inputProps}\r\n                      />\r\n                    </FormRow>\r\n                    {formik.values.ServiceType !== null &&\r\n                      formik.values.ServiceType !== undefined &&\r\n                      IsAdminOfService &&\r\n                      !globalSettings.priceSheetPricing &&\r\n                      globalSettings.billingModuleEnabled && (\r\n                        <FormRow fullRow>\r\n                          <FormNumberField\r\n                            fullWidth\r\n                            id=\"DiscountFactorID\"\r\n                            name=\"DiscountFactor\"\r\n                            noWarnOnNuN={true}\r\n                            inputMode=\"decimal\"\r\n                            placeholder={t(translations.DiscountFactor)}\r\n                            label={t(translations.DiscountFactor)}\r\n                            disabled={formik.isSubmitting}\r\n                            inputProps={{\r\n                              step: 0.01,\r\n                              min: 0.01,\r\n                              max: 9999,\r\n                              'aria-label': 'Factor',\r\n                            }}\r\n                          />\r\n                        </FormRow>\r\n                      )}\r\n                    <FormRow fullRow={true}>\r\n                      <FormRichTextField\r\n                        name=\"Remarks\"\r\n                        placeholder={t(translations.Remarks)}\r\n                        disabled={formik.isSubmitting || readonly}\r\n                        fullWidth={true}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Box, LinearProgress } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { OfflineForm } from './OfflineForm';\r\nimport { useOfflineServiceStateSlice } from './slice';\r\nimport {\r\n  selectCredit,\r\n  selectCreditCompleted,\r\n  selectCreditProcessing,\r\n  selectHasCharges,\r\n  selectIsEdit,\r\n  selectProcessing,\r\n  selectService,\r\n  selectServiceCompleted,\r\n  selectServiceHasError,\r\n} from './slice/selectors';\r\nimport {\r\n  OfflineServiceQueryStringParameters,\r\n  OtherServiceDetailsState,\r\n} from './slice/types';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { selectConnectedSettings } from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { ReferenceType } from 'enums/ReferenceType';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Body, ButtonLabel } from 'app/components/Typography';\r\nimport { Roles } from 'app/slice/types';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\n\r\nexport interface OtherServiceDetailsProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  queryParams: OfflineServiceQueryStringParameters;\r\n  initialService?: IOtherServices;\r\n  onClose?: () => void;\r\n  editCreatable?: boolean;\r\n  saveCreatable?: boolean;\r\n}\r\n\r\nexport const OtherServiceDetails = React.memo(function OtherServiceDetails(\r\n  props: OtherServiceDetailsProps,\r\n) {\r\n  const {\r\n    useSidePanel,\r\n    queryParams,\r\n    initialService,\r\n    editCreatable,\r\n    saveCreatable,\r\n    isCover,\r\n    closeCover,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n\r\n  /// Settings ///\r\n  const globalSettings = useGlobalSettingsHook();\r\n  const history = useHistory();\r\n  /// Selectors ///\r\n  const processing = useSelector(selectProcessing);\r\n  const offlineService = useSelector(selectService);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const actionCompleted = useSelector(selectServiceCompleted);\r\n  //const serviceProcessing = useSelector(selectServiceProcessing);\r\n  const hasError = useSelector(selectServiceHasError);\r\n  const credit = useSelector(selectCredit);\r\n  const creditProccessing = useSelector(selectCreditProcessing);\r\n  const creditCompleted = useSelector(selectCreditCompleted);\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  const hasCharges = useSelector(selectHasCharges);\r\n  const edit = useSelector(selectIsEdit);\r\n  /// Refs ///\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const connectedFiltersFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<OtherServiceDetailsState>>(\r\n    null,\r\n  );\r\n  //cover\r\n  // const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(\r\n    () => {\r\n      dispatch(actions.resetDetailsState());\r\n      return true;\r\n    },\r\n    undefined,\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [showCalculateCredit, setShowCalculateCredit] = React.useState(false);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const IsAdmin = React.useMemo(() => {\r\n    return (\r\n      User?.HasAdminGroupPermissions(\r\n        offlineService?.data?.ServiceType?.ServiceGroupId ?? undefined,\r\n      ) ||\r\n      User?.HasLabTechGroupPermissions(\r\n        offlineService?.data?.ServiceType?.ServiceGroupId ?? undefined,\r\n      ) ||\r\n      User?.HasAdminServicePermissions(\r\n        ServiceType.Offline,\r\n        offlineService?.data?.ServiceType?.Id,\r\n      ) ||\r\n      User?.HasLabTechServicePermissions(\r\n        ServiceType.Offline,\r\n        offlineService?.data?.ServiceType?.Id,\r\n      )\r\n    );\r\n  }, [User, offlineService]);\r\n\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      User !== undefined &&\r\n      (User.Roles.includes(Roles.CalendarOnly) ||\r\n        User.Roles.includes(Roles.Readonly) ||\r\n        User.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [User]);\r\n\r\n  /// mount effect - init ///\r\n  // useEffectOnMount(() => {\r\n  //   setRequestCompleted(undefined);\r\n  //   dispatch(actions.initDetails(queryParams, ));\r\n  //   return () => {};\r\n  // });\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initDetails({\r\n          query: queryParams,\r\n          globalSettings: globalSettings,\r\n          service: initialService,\r\n          editCreatable: editCreatable,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    editCreatable,\r\n    firstLoad,\r\n    globalSettings,\r\n    initialService,\r\n    queryParams,\r\n  ]);\r\n  /// functions, callbacks ///\r\n  // const closeCover = () => {\r\n  //   setCover(undefined);\r\n  // };\r\n  // const handleClose = () => {\r\n  //   if (hasChanges && !editCreatable) {\r\n  //     dispatch(layoutActions.setConfirmOpen(true));\r\n  //   } else {\r\n  //     handleCloselClick();\r\n  //   }\r\n  // };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    // dispatch(actions.resetDetailsState(editCreatable));\r\n    // if (!!onClose) {\r\n    //   onClose();\r\n    // } else {\r\n    //   if (useSidePanel) {\r\n    //     dispatch(layoutActions.resetSidePanel());\r\n    //   } else {\r\n    //     dispatch(push('/otherServices'));\r\n    //   }\r\n    // }\r\n    // if (!editCreatable) {\r\n    //   dispatch(connectedFiltersActions.resetConnectedState());\r\n    // }\r\n    if (useSidePanel) {\r\n      closePanel({\r\n        isCover: isCover,\r\n        useSidePanel: useSidePanel,\r\n        showConfirm: hasChanges && !editCreatable,\r\n        onClose: () => {\r\n          dispatch(actions.resetDetailsState(editCreatable));\r\n          if (!editCreatable) {\r\n            dispatch(connectedFiltersActions.resetConnectedState());\r\n          }\r\n        },\r\n      } as SidePanelCloseState);\r\n    } else {\r\n      dispatch(push('/otherServices'));\r\n    }\r\n  }, [\r\n    actions,\r\n    closePanel,\r\n    connectedFiltersActions,\r\n    dispatch,\r\n    editCreatable,\r\n    hasChanges,\r\n    isCover,\r\n    useSidePanel,\r\n  ]);\r\n  const handleSaveClick = React.useCallback(\r\n    (e: any) => {\r\n      if (editCreatable && !!initialService) {\r\n        if (\r\n          !!innerFormRef.current?.errors &&\r\n          !!innerFormRef.current?.errors['Quantity']\r\n        ) {\r\n          dispatch(\r\n            appSettingsActions.addNotification({\r\n              variant: 'error',\r\n              message: innerFormRef.current?.errors['Quantity'],\r\n            }),\r\n          );\r\n          return;\r\n        }\r\n        dispatch(\r\n          actions.setEditCreatableService(\r\n            Object.assign({}, initialService, {\r\n              Remarks: innerFormRef.current?.values.Remarks,\r\n              Quantity: innerFormRef.current?.values.Quantity || null,\r\n              DiscountFactor:\r\n                innerFormRef.current?.values.DiscountFactor || null,\r\n              InventoryBatchId:\r\n                innerFormRef.current?.values.InventoryBatch?.Id || null,\r\n              InventoryBatchName:\r\n                innerFormRef.current?.values.InventoryBatch?.Name || null,\r\n              InventoryBatchAmount:\r\n                innerFormRef.current?.values.InventoryBatch?.Inventory || null,\r\n            }),\r\n          ),\r\n        );\r\n        handleCloselClick();\r\n      } else {\r\n        handleSubmitForm(e);\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      appSettingsActions,\r\n      dispatch,\r\n      editCreatable,\r\n      handleCloselClick,\r\n      initialService,\r\n    ],\r\n  );\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (connectedFiltersFormRef.current) {\r\n      connectedFiltersFormRef.current(e);\r\n    }\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: OtherServiceDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateService({\r\n            current: values,\r\n            original: offlineService.data || values,\r\n            saveCreatable: saveCreatable,\r\n          }),\r\n        );\r\n      } else {\r\n        dispatch(\r\n          actions.createService({\r\n            model: values,\r\n            saveCreatable: saveCreatable,\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [actions, dispatch, edit, offlineService.data, saveCreatable],\r\n  );\r\n  const handleCalculateCredit = React.useCallback(() => {\r\n    setShowCalculateCredit(true);\r\n    dispatch(\r\n      actions.getCredit(\r\n        innerFormRef?.current?.values ||\r\n          offlineService?.data ||\r\n          ({} as OtherServiceDetailsState),\r\n      ),\r\n    );\r\n  }, [actions, dispatch, offlineService?.data]);\r\n  const handleCalculateClose = React.useCallback(() => {\r\n    setShowCalculateCredit(false);\r\n    dispatch(actions.resetCreditState());\r\n  }, [actions, dispatch]);\r\n  /// Use Effects ///\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n        //setEdit(true);\r\n      } else {\r\n        //setEdit(false);\r\n      }\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          dispatch(layoutActions.setNotSavedChanges(false));\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actionCompleted,\r\n    dispatch,\r\n    handleCloselClick,\r\n    hasError,\r\n    layoutActions,\r\n    processing,\r\n    queryParams.id,\r\n  ]);\r\n  // React.useEffect(() => {\r\n  //   if (confirmApproved) {\r\n  //     dispatch(actions.resetDetailsState());\r\n  //     if (continueToOther.continueOnApprove) {\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //       setTimeout(() => {\r\n  //         dispatch(\r\n  //           layoutActions.openSidePanel({\r\n  //             type: continueToOther.pageType,\r\n  //             props: continueToOther.pageProps,\r\n  //             expanded: continueToOther.expanded,\r\n  //           }),\r\n  //         );\r\n  //         dispatch(layoutActions.resetContinueState());\r\n  //       }, 200);\r\n  //     } else if (continueLink !== undefined) {\r\n  //       dispatch(appSettingsActions.navigate(continueLink));\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //     } else {\r\n  //       dispatch(layoutActions.resetSidePanel());\r\n  //     }\r\n  //     //dispatch(actions.setChangedState(false));\r\n  //   }\r\n  //   if (confirmRejected) {\r\n  //     dispatch(layoutActions.resetConfirmState());\r\n  //   }\r\n\r\n  //   return () => undefined;\r\n  // }, [\r\n  //   actions,\r\n  //   appSettingsActions,\r\n  //   confirmApproved,\r\n  //   confirmRejected,\r\n  //   continueLink,\r\n  //   continueToOther,\r\n  //   dispatch,\r\n  //   edit,\r\n  //   layoutActions,\r\n  // ]);\r\n  const onBatchClick = React.useCallback(\r\n    (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n      let batchProps = {\r\n        initialBatch: batch ?? undefined,\r\n        queryParams: {\r\n          id: '' + (batch?.Id ?? -1),\r\n          stid: '' + serviceType,\r\n        },\r\n        saveCreatable: true,\r\n        useSidePanel: true,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.InventoryBatch,\r\n        renderPageProps: batchProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const leftActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={busy}\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    if (globalSettings.showCalcPriceOnOfflineService && !edit) {\r\n      actions.push(() => (\r\n        <Button\r\n          id={'CalculateCreditPopupButtonId'}\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"money-bill\" />}\r\n          title={t(translations.CalculatePricing_info) as string}\r\n          onClick={handleCalculateCredit}\r\n          disabled={creditProccessing}\r\n          processing={creditProccessing}\r\n        >\r\n          {t(translations.CalculatePricing)}\r\n        </Button>\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    busy,\r\n    creditProccessing,\r\n    edit,\r\n    globalSettings.showCalcPriceOnOfflineService,\r\n    handleCalculateCredit,\r\n    handleSaveClick,\r\n    requestCompleted,\r\n    t,\r\n  ]);\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCloselClick}\r\n          >\r\n            {t(translations.Close)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCloselClick, t]);\r\n  const topButtons: ActionRenderer[] = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    if (serviceSettings.chargesViewAllowed && edit && hasCharges) {\r\n      actions.push(() => (\r\n        <TopActionButton\r\n          text={t(translations.OfflineServiceCharges)}\r\n          icon=\"dollar-sign\"\r\n          startIcon=\"dollar-sign\"\r\n          size=\"small\"\r\n          onClick={() =>\r\n            history.push(\r\n              `/Charges?${toQueryString({\r\n                refType: ReferenceType.OfflineService as number,\r\n                refId: queryParams.id,\r\n              }).toString()}`,\r\n            )\r\n          }\r\n          variant=\"white\"\r\n          shape=\"square\"\r\n        />\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    edit,\r\n    hasCharges,\r\n    history,\r\n    queryParams.id,\r\n    serviceSettings.chargesViewAllowed,\r\n    t,\r\n  ]);\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={\r\n          edit\r\n            ? t(translations.EditOfflineServiceTitle)\r\n            : t(translations.AddNewOfflineService)\r\n        }\r\n        titlePage={\r\n          offlineService?.data\r\n            ? edit\r\n              ? ` ${t(translations.ConsumableLog)} #${queryParams.id || 'N/A'}`\r\n              : ` ${t(translations.ConsumableLog)}`\r\n            : undefined\r\n        }\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || isCover}\r\n        disableExpandToggle={true}\r\n        closeSidePanel={handleCloselClick}\r\n        // leftTopActions={topButtons}\r\n        rightTopActions={topButtons}\r\n        rightTopActionsAsMenu={true}\r\n        //leftTopActions={topActions}\r\n        //topProcessing={equipmentChangeCompleted === false}\r\n        leftActions={isReadOnlyUser ? [] : leftActions}\r\n        children={\r\n          offlineService?.data !== undefined && !processing ? (\r\n            <OfflineForm\r\n              initialValues={\r\n                offlineService?.data || ({} as OtherServiceDetailsState)\r\n              }\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              isEdit={edit || false}\r\n              connectedFiltersFormRef={connectedFiltersFormRef}\r\n              isAdmin={IsAdmin || false}\r\n              user={User}\r\n              globalSettings={globalSettings}\r\n              innerFormRef={innerFormRef}\r\n              editCreatable={editCreatable}\r\n              onBatchClick={onBatchClick}\r\n            />\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + 'otherServices/details', queryParams)}\r\n        toPageLink={`otherServices/details?${toQueryString(queryParams)}`}\r\n        rightActions={isReadOnlyUser ? [] : rightActions}\r\n        confirm={\r\n          showCalculateCredit ? (\r\n            <DialogConfirm\r\n              isOpen={showCalculateCredit}\r\n              title={t(translations.CalculatePricing)}\r\n              onConfirm={() => handleCalculateClose()}\r\n              onClose={() => handleCalculateClose()}\r\n              body={\r\n                creditProccessing && !creditCompleted ? (\r\n                  <Box width=\"100%\">\r\n                    <LinearProgress variant=\"query\" color=\"primary\" />\r\n                  </Box>\r\n                ) : (\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      flexDirection: 'column',\r\n                      paddingTop: '16px',\r\n                      gap: 32,\r\n                      width: '100%',\r\n                    }}\r\n                  >\r\n                    <Box\r\n                      style={{\r\n                        display: 'flex',\r\n                        flexDirection: 'row',\r\n                        justifyContent: 'space-between',\r\n                        gap: 16,\r\n                        width: '100%',\r\n                      }}\r\n                    >\r\n                      <ButtonLabel size=\"small\">\r\n                        {t(translations.Pricing_EstimatedCost)}\r\n                      </ButtonLabel>\r\n                      <Body size=\"small\">\r\n                        {(t(\r\n                          edit\r\n                            ? translations.PricingConfirmationOfflineEditText1\r\n                            : translations.PricingConfirmationOfflineText1,\r\n                        ) as string).replace(\r\n                          '{0}',\r\n                          (credit?.credit || 0).toFixed(2),\r\n                        )}\r\n                      </Body>\r\n                    </Box>\r\n                    {!!credit?.balance && credit?.balance !== null && (\r\n                      <Box\r\n                        style={{\r\n                          display: 'flex',\r\n                          flexDirection: 'row',\r\n                          justifyContent: 'space-between',\r\n                          gap: 16,\r\n                          width: '100%',\r\n                        }}\r\n                      >\r\n                        <ButtonLabel size=\"small\">\r\n                          {t(translations.Pricing_Balance)}\r\n                        </ButtonLabel>\r\n                        <Body size=\"small\">\r\n                          {(t(\r\n                            translations.Pricing_BalanceResult,\r\n                          ) as string).replace(\r\n                            '{0}',\r\n                            (credit?.balance || 0).toFixed(2),\r\n                          )}\r\n                        </Body>\r\n                      </Box>\r\n                    )}\r\n                  </Box>\r\n                )\r\n              }\r\n              maxWidth={'sm'}\r\n            />\r\n          ) : (\r\n            <></>\r\n          )\r\n        }\r\n        isCover={isCover}\r\n        cover={cover}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n        coverClosed={coverClosed}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nconst url = '/api/odata/v4/PaymentMethodFilter/WithSystemSettings';\r\nexport interface PaymentMethodPickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url'> {}\r\nexport const PaymentMethodPicker = (props: PaymentMethodPickerProps) => {\r\n  return (\r\n    <BaseURLPicker url={url} {...props} id={props.id || 'paymenttypeId'} />\r\n  );\r\n};\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  PaymentMethodPicker,\r\n  PaymentMethodPickerProps,\r\n} from '../pickers/AutocompletePickers/PaymentMethodPicker';\r\n\r\nexport const FormPaymentMethodPicker = ({\r\n  onChange,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  Omit<PaymentMethodPickerProps, 'onChange'>) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <PaymentMethodPicker\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined && meta?.touched}\r\n        helperText={meta.error}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useRowSelect, PluginHook, Row } from 'react-table';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { Icon } from 'app/components//BasicIcons/FontAwesome';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport {\r\n  getConditionalSelectColumnCheckboxProps,\r\n  getConditionalSelectHeaderCheckboxProps,\r\n} from './ConditionalSelectHeaderCheckbox';\r\nimport { defaultCheckIfRowIsSelectable } from './index';\r\n\r\n/**\r\n * Adds useRowSelect with the checkboxes in the first column\r\n * @param tablePlugins table plugins array passed into useTable\r\n * @param isRowSelectable controls row select-ability\r\n * @param onSelectedChange\r\n */\r\nexport function addRowSelect<TRow extends IRow>(\r\n  tablePlugins: PluginHook<TRow>[],\r\n  isRowSelectable?: (row: Row<TRow>) => boolean,\r\n  onSelectedChange?: (row: TRow, checked: boolean) => void,\r\n) {\r\n  tablePlugins.push(useRowSelect);\r\n  tablePlugins.push(hooks => {\r\n    hooks.visibleColumns.push(columns => [\r\n      // Let's make a column for selection\r\n      {\r\n        id: 'selection',\r\n        disableSortBy: true,\r\n        // The header can use the table's getToggleAllRowsSelectedProps method\r\n        // to render a checkbox\r\n        Header: props => {\r\n          const checkboxProps = React.useMemo(() => {\r\n            return getConditionalSelectHeaderCheckboxProps<TRow>({\r\n              headerProps: props,\r\n              checkIfRowIsSelectable:\r\n                isRowSelectable || defaultCheckIfRowIsSelectable,\r\n              onSelectedChange: onSelectedChange,\r\n              shouldSelectPage: false,\r\n            });\r\n          }, [props]);\r\n          return (\r\n            <div style={{ padding: '3px', gap: '10px' }} aria-label=\"Check All\">\r\n              <Check\r\n                {...checkboxProps}\r\n                inputProps={{ 'aria-label': 'Select All' }}\r\n                withPadding={false}\r\n                size=\"small\"\r\n              />\r\n            </div>\r\n          );\r\n        },\r\n        // The cell can use the individual row's getToggleRowSelectedProps method\r\n        // to the render a checkbox\r\n        Cell: ({ row }) => {\r\n          if (!row.original.Rows || row.original.Rows.length <= 1) {\r\n            const checkProps = getConditionalSelectColumnCheckboxProps<TRow>({\r\n              row: row,\r\n              checkIfRowIsSelectable:\r\n                isRowSelectable || defaultCheckIfRowIsSelectable,\r\n              onSelectedChange: onSelectedChange,\r\n            });\r\n\r\n            if (!!isRowSelectable && !isRowSelectable(row)) {\r\n              return <></>;\r\n            } else {\r\n              return (\r\n                <div\r\n                  onClick={e => e.stopPropagation()}\r\n                  style={{ padding: '3px', gap: '10px' }}\r\n                >\r\n                  <Check\r\n                    {...checkProps}\r\n                    inputProps={{ 'aria-label': 'Select' }}\r\n                    withPadding={false}\r\n                    size=\"small\"\r\n                  />\r\n                </div>\r\n              );\r\n            }\r\n          }\r\n          return (\r\n            <div style={{ padding: '10px', gap: '10px' }}>\r\n              <Icon\r\n                {...row.getToggleRowExpandedProps()}\r\n                icon={row.isExpanded ? 'minus' : 'plus'}\r\n              />\r\n            </div>\r\n          );\r\n        },\r\n      },\r\n      ...columns,\r\n    ]);\r\n  });\r\n}\r\n","import { HeaderProps, Row } from 'react-table';\r\nimport { IRow } from '.';\r\n\r\ninterface GetConditionalSelectHeaderCheckboxProps<TRow extends IRow> {\r\n  /** react-table's header props */\r\n  headerProps: React.PropsWithChildren<HeaderProps<TRow>>;\r\n  /** A predicate - based on your business logic - to determine whether a given row should be selectable */\r\n  checkIfRowIsSelectable: (row: Row<TRow>) => boolean;\r\n  /** Whether to allow page selection. Default: true */\r\n  shouldSelectPage?: boolean;\r\n  onSelectedChange?: (row: TRow, checked: boolean) => void;\r\n}\r\n\r\n/**\r\n * A convenience method for react-table headers for allowing conditional select\r\n * @param headerProps react-table's header props\r\n * @param checkIfRowIsSelectable A predicate - based on your business logic - to determine whether a given row should be selectable\r\n * @param shouldSelectPage Whether to allow page selection. Default: true\r\n * @returns Modified `checkboxProps` to enforce the conditional select\r\n */\r\nexport const getConditionalSelectHeaderCheckboxProps = <TRow extends IRow>({\r\n  headerProps,\r\n  checkIfRowIsSelectable,\r\n  onSelectedChange,\r\n  shouldSelectPage = true,\r\n}: GetConditionalSelectHeaderCheckboxProps<TRow>) => {\r\n  // Note that in my comments I differentiate between the standard logic and the logic for the conditional select\r\n  const checkIfAllSelectableRowsSelected = (rows: Row<TRow>[]) =>\r\n    rows.filter(checkIfRowIsSelectable).every(row => row.isSelected);\r\n  // Standard: Here we define the selection type for the next click: Select Page / Select All\r\n  const isSelectPage =\r\n    shouldSelectPage &&\r\n    headerProps.page\r\n      // For conditional select: Filter the rows based on your business logic\r\n      .filter(checkIfRowIsSelectable)\r\n      // Standard: `isSelectPage === true` if some of the rows are not yet selected\r\n      // This (standard) logic might be confusing to understand at first, but - as a side note - the idea is as follows:\r\n      // This is the variable that defines whether the header props that will be received FOR THE NEXT CLICK will be for Select Page or for Select All\r\n      // Try to play this out in your head:\r\n      //  - Initially, none of the rows are selected, so when we clicking the button initially, we will select only the (selectable) rows on the page (i.e. Select Page), hence the next click will be for Select All, hence `isSelectPage` will be `false`\r\n      //  - When clicking again, we will select the rest of the (selectable) rows (i.e. Select All). The next click will again be Select All (for de-selecting all), hence `isSelectPage` will be `false`\r\n      //  - Finally, when clicking again, we will de-select all rows. The next click will be for Select Page, hence `isSelectPage` will `true`\r\n      .some(row => !row.isSelected);\r\n\r\n  // Standard: Get the props based on Select Page / Select All\r\n  const checkboxProps = isSelectPage\r\n    ? headerProps.getToggleAllPageRowsSelectedProps()\r\n    : headerProps.getToggleAllRowsSelectedProps();\r\n\r\n  // For conditional select: The header checkbox should be:\r\n  //   - checked if all selectable rows are selected\r\n  //   - indeterminate if only some selectable rows are selected (but not all)\r\n  const disabled = headerProps.rows.filter(checkIfRowIsSelectable).length === 0;\r\n  const checked =\r\n    !disabled && checkIfAllSelectableRowsSelected(headerProps.rows);\r\n  const indeterminate =\r\n    !checked && headerProps.rows.some(row => row.isSelected);\r\n\r\n  // For conditional select: This is where the magic happens\r\n  const onChange = () => {\r\n    // If we're in Select All and all selectable rows are already selected: deselect all rows\r\n    if (!isSelectPage && checkIfAllSelectableRowsSelected(headerProps.rows)) {\r\n      headerProps.rows.forEach(row => {\r\n        headerProps.toggleRowSelected(row.id, false);\r\n        if (!!onSelectedChange) {\r\n          onSelectedChange(row.original, checked);\r\n        }\r\n      });\r\n    } else {\r\n      // Otherwise:\r\n      // First, define the rows to work with: if we're in Select Page, use `headerProps.page`, otherwise (Select All) use headerProps.rows\r\n      const rows = isSelectPage ? headerProps.page : headerProps.rows;\r\n      // Then select every selectable row\r\n      rows.forEach(row => {\r\n        const checked = checkIfRowIsSelectable(row);\r\n        headerProps.toggleRowSelected(row.id, checked);\r\n        if (!!onSelectedChange) {\r\n          onSelectedChange(row.original, checked);\r\n        }\r\n      });\r\n    }\r\n  };\r\n\r\n  // For conditional select: override checked, indeterminate and onChange - to enforce conditional select based on our business logic\r\n  return {\r\n    ...checkboxProps,\r\n    checked,\r\n    indeterminate,\r\n    onChange,\r\n    disabled,\r\n  };\r\n};\r\ninterface GetConditionalSelectColumnCheckboxProps<TRow extends IRow> {\r\n  /** react-table's header props */\r\n  row: Row<TRow>;\r\n  /** A predicate - based on your business logic - to determine whether a given row should be selectable */\r\n  checkIfRowIsSelectable: (row: Row<TRow>) => boolean;\r\n  onSelectedChange?: (row: TRow, checked: boolean) => void;\r\n}\r\n\r\nexport const getConditionalSelectColumnCheckboxProps = <TRow extends IRow>({\r\n  row,\r\n  checkIfRowIsSelectable,\r\n  onSelectedChange,\r\n}: GetConditionalSelectColumnCheckboxProps<TRow>) => {\r\n  const checkboxProps = row.getToggleRowSelectedProps();\r\n  const disabled = !checkIfRowIsSelectable(row);\r\n  const checked = row.isSelected;\r\n  const onChange = (ev: React.ChangeEvent<HTMLInputElement>) => {\r\n    const checked = ev.target.checked && checkIfRowIsSelectable(row);\r\n    row.toggleRowSelected(checked);\r\n    if (!!onSelectedChange) {\r\n      onSelectedChange(row.original, checked);\r\n    }\r\n  };\r\n  return {\r\n    ...checkboxProps,\r\n    checked,\r\n    onChange,\r\n    disabled,\r\n  };\r\n};\r\n","export enum InvoiceFundingType {\r\n  //All,\r\n  FundingType_Internal = 0,\r\n  FundingType_External = 1,\r\n}\r\n","export enum ScreenToShowOn {\r\n  ShowOn_InvoicesList = 1,\r\n  ShowOn_InvoiceBatches = 2,\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { BaseURLPicker } from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nconst url = '/api/odata/v4/InstrumentCatFilter';\r\nexport const initInstrumentCatData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return Promise.resolve([]);\r\n  }\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: new Condition<Entity<string>>(\r\n      'Id',\r\n      ODataOperators.Equals,\r\n      initval,\r\n    ).toString(),\r\n    $select: 'Id,Name',\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\n\r\nexport const InstrumentCatFilter = (props: IFilterComponentProps) => {\r\n  const handleChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  return (\r\n    <BaseURLPicker\r\n      value={props.value}\r\n      size=\"small\"\r\n      onChange={handleChange}\r\n      url={url}\r\n    />\r\n  );\r\n};\r\n","import { UserMultiPicker } from 'app/components/pickers/AutocompletePickers/UserMultiPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\n\r\nexport const UserAssetContactMultiFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<string>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <UserMultiPicker\r\n      value={props.value as IUserFilterDto[]}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      urlType={'full'}\r\n      selectArray={['Id', 'Name', 'UserGroupId']}\r\n    />\r\n  );\r\n};\r\nexport default UserAssetContactMultiFilter;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { VariantType } from 'notistack';\r\nimport { IResponseType } from 'types/ResponseType';\r\n\r\nexport const GetResponseMessages = (\r\n  response,\r\n  infoText: string,\r\n): IResponseType => {\r\n  let messages: IResponseType = {\r\n    SuccessMessages: [],\r\n    ErrorMessages: [],\r\n    WarningMessages: [],\r\n  };\r\n  if (response.SuccessMessages && response.SuccessMessages.length > 0) {\r\n    response.SuccessMessages.forEach(element => {\r\n      messages.SuccessMessages.push(element);\r\n    });\r\n  }\r\n  if (response.ErrorMessages && response.ErrorMessages.length > 0) {\r\n    response.ErrorMessages.forEach(element => {\r\n      messages.ErrorMessages.push(element);\r\n    });\r\n  }\r\n  if (response.WarningMessages && response.WarningMessages.length > 0) {\r\n    response.WarningMessages.forEach(element => {\r\n      messages.WarningMessages.push(element);\r\n    });\r\n  }\r\n  if (\r\n    messages.SuccessMessages.length === 0 &&\r\n    response.ErrorMessages.length === 0 &&\r\n    response.WarningMessages.length === 0\r\n  ) {\r\n    messages.SuccessMessages = [infoText];\r\n  }\r\n  return messages;\r\n};\r\n\r\nconst GetMessagesArray = (response: IResponseType) => {\r\n  const res: INotification[] = [];\r\n  if (response.ErrorMessages.length > 0) {\r\n    response.ErrorMessages.forEach(errmsg =>\r\n      res.push({\r\n        variant: 'error',\r\n        message: errmsg,\r\n      }),\r\n    );\r\n  }\r\n  if (response.SuccessMessages.length > 0) {\r\n    response.SuccessMessages.forEach(sccmsg =>\r\n      res.push({\r\n        variant: 'success',\r\n        message: sccmsg,\r\n      }),\r\n    );\r\n  }\r\n  if (response.WarningMessages.length > 0) {\r\n    response.WarningMessages.forEach(wrnmsg =>\r\n      res.push({\r\n        variant: 'warning',\r\n        message: wrnmsg,\r\n      }),\r\n    );\r\n  }\r\n  return res;\r\n};\r\n\r\nexport const DoAction1 = <Model extends unknown>(\r\n  f: (item: Model) => Promise<any>,\r\n  item: Model,\r\n  t: TFunction,\r\n): Promise<IResponseType> => {\r\n  return new Promise<IResponseType>((resolve, reject) => {\r\n    return f(item)\r\n      .then(response => {\r\n        const messages: IResponseType = GetResponseMessages(\r\n          response,\r\n          t(translations.Success) as string,\r\n        );\r\n        resolve(messages);\r\n      })\r\n      .catch(error => {\r\n        console.log('status error', error);\r\n        let err = t(translations.Failed) as string;\r\n        reject(err);\r\n      });\r\n  });\r\n};\r\n\r\nexport interface INotification {\r\n  variant?: VariantType;\r\n  message: string;\r\n}\r\n\r\nexport const DoAction = async <Model extends unknown>(\r\n  f: (item: Model) => Promise<any>,\r\n  item: Model,\r\n  t: TFunction,\r\n  handleSubmitCallResult: (values: INotification[]) => void,\r\n) => {\r\n  try {\r\n    const response = await DoAction1(f, item, t);\r\n    handleSubmitCallResult(GetMessagesArray(response));\r\n  } catch (error) {\r\n    handleSubmitCallResult([\r\n      {\r\n        variant: 'error',\r\n        message: error as string,\r\n      },\r\n    ]);\r\n  }\r\n};\r\n\r\nexport const insertUserAD = (item: { Name: string }) => {\r\n  const params = { Id: -1, Name: item.Name };\r\n  return httpClient.post(`/api/odata/v4/UsersADImport`, params);\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { PeriodTypes } from 'app/components/DatePeriods';\r\n\r\nexport interface UpdateModel {\r\n  Async: boolean;\r\n  Recalculate: boolean;\r\n  Item: {\r\n    ServiceGroupsCsv: string;\r\n    UserGroupsCsv?: string;\r\n    PeriodType?: PeriodTypes;\r\n    Start: string;\r\n    End: string;\r\n    Remarks: string;\r\n    BudgetIds: number[];\r\n    BudgetIncluded?: boolean;\r\n    invoiceBy?: number;\r\n    CoreInvoiceBy: string;\r\n    InvoiceCreatedBy: string;\r\n    InvoiceVat: string;\r\n    FundingTypeId?: number;\r\n    CoreBy: number;\r\n    ShowZeroAmountInvoices?: boolean;\r\n    ShowInvoicePartialEvents: boolean;\r\n  };\r\n}\r\nexport class BillingPreviewApi {\r\n  FormView1_UpdateItem = (item: UpdateModel) => {\r\n    return httpClient.post(`/api/odata/v4/BillingPreview`, item);\r\n  };\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { AlignRight } from '../AlignRight';\r\n\r\nconst PercentageRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n}: {\r\n  value: number | null;\r\n}) => (value === null ? null : <AlignRight>{value?.toFixed(2)} %</AlignRight>);\r\n\r\nexport default PercentageRenderer;\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.labelPrint || initialState;\r\n\r\nexport const selectLabelPrint = createSelector([selectSlice], state => state);\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nconst DateTimeRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n}) => <>{dateUtils.shortDateTimeFormat(value)}</>;\r\nexport default DateTimeRenderer;\r\n","import { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { Link as MuiLink, styled } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useArticlesSlice } from 'app/pages/ArticlesPage/slice';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nconst TruncatedLabel = styled('span')({\r\n  width: '30ch',\r\n  display: 'inline-block',\r\n  overflow: 'hidden',\r\n  textOverflow: 'ellipsis',\r\n});\r\n\r\nexport const ArticleLink = (props: {\r\n  value?: IArticleDto;\r\n  Id?: number;\r\n  externalId?: string;\r\n  externalIdSource?: string;\r\n  children: React.ReactNode;\r\n  title?: string;\r\n  useSidePanel?: boolean;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) => {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useArticlesSlice();\r\n  const openArticle = useOpenArticlePopUp();\r\n  const open = () => {\r\n    if (props.Id === 0) {\r\n      dispatch(actions.clearArticleDetails());\r\n    }\r\n    openArticle(\r\n      {\r\n        value: props.value,\r\n        Id: props.Id,\r\n        externalId: props.externalId,\r\n        externalIdSource: props.externalIdSource,\r\n        useSidePanel: props.useSidePanel,\r\n      },\r\n      props.openPanelWithCover,\r\n    );\r\n  };\r\n  return (\r\n    <Tooltip title={props.title ?? t(translations.PublicationDetails)}>\r\n      <TruncatedLabel>\r\n        <MuiLink\r\n          style={{\r\n            cursor: 'pointer',\r\n          }}\r\n          onClick={() => open()}\r\n          color=\"textPrimary\"\r\n        >\r\n          {props.children}\r\n        </MuiLink>\r\n      </TruncatedLabel>\r\n    </Tooltip>\r\n  );\r\n};\r\n\r\nexport const useOpenArticlePopUp = () => {\r\n  const { openPanel } = useSidePanelState();\r\n  return React.useCallback(\r\n    (\r\n      props: {\r\n        value?: IArticleDto;\r\n        Id?: number;\r\n        externalId?: string;\r\n        externalIdSource?: string;\r\n        useSidePanel?: boolean;\r\n      },\r\n      openPanelWithCover?: (state: SidePanelOpenState) => void,\r\n    ) => {\r\n      const panelState = {\r\n        renderPageType: RenderPageType.Article,\r\n        renderPageProps: props,\r\n        expanded: false,\r\n        useSidePanel: props.useSidePanel,\r\n        isCover: props.useSidePanel,\r\n      } as SidePanelOpenState;\r\n      if (!!openPanelWithCover) {\r\n        openPanelWithCover(panelState);\r\n      } else {\r\n        openPanel({\r\n          renderPageType: RenderPageType.Article,\r\n          renderPageProps: props,\r\n          expanded: false,\r\n          useSidePanel: false,\r\n          isCover: false,\r\n        } as SidePanelOpenState);\r\n      }\r\n    },\r\n    [openPanel],\r\n  );\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\nexport const DurationRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n}) => {\r\n  const { t } = useTranslation();\r\n  if (value === null || value === undefined) {\r\n    return t(translations.NA);\r\n  }\r\n  let totalSeconds = parseInt(value);\r\n  if (isNaN(totalSeconds)) {\r\n    return t(translations.NA);\r\n  }\r\n  const hours = Math.floor(totalSeconds / 3600);\r\n  totalSeconds -= hours * 3600;\r\n  const minutes = Math.floor(totalSeconds / 60);\r\n  totalSeconds -= minutes * 60;\r\n  const seconds = totalSeconds;\r\n\r\n  return [hours, minutes, seconds]\r\n    .map(f => String(f).padStart(2, '0'))\r\n    .join(':');\r\n};\r\nexport default DurationRenderer;\r\n","export enum DeatilsOperations {\r\n  add,\r\n  edit,\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.internalIdLogin || initialState;\r\n\r\nexport const selectInternalIdLogin = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\nexport const selectInternalIdLoginUserId = createSelector(\r\n  [selectInternalIdLogin],\r\n  state => state.identity?.Id,\r\n);\r\nexport const selectInternalIdLoginUserName = createSelector(\r\n  [selectInternalIdLogin],\r\n  state => state.identity?.Name,\r\n);\r\nexport const selectLoginType = createSelector(\r\n  [selectSlice],\r\n  state => state.identity?.LoginType,\r\n);\r\n","/**\r\n *\r\n * CustomPickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { CustomPicker } from 'app/components/pickers/CustomPicker';\r\n\r\nexport interface CustomPickerFilterProps extends IFilterComponentProps {\r\n  disabled?: boolean;\r\n  placeholder?: string;\r\n}\r\nexport function CustomPickerFilter(props: CustomPickerFilterProps) {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <CustomPicker\r\n      value={props.value}\r\n      customData={props.customData as Entity<number>[]}\r\n      isOpen={props.open}\r\n      onChange={handleOnChange}\r\n      size=\"small\"\r\n      placeholder={\r\n        props.placeholder !== undefined\r\n          ? props.placeholder\r\n          : t(translations.AllValues)\r\n      }\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      fullWidth={props.fullWidth}\r\n      disabled={props.disabled}\r\n    />\r\n  );\r\n}\r\nexport default CustomPickerFilter;\r\n","/**\r\n *\r\n * CustomPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nexport interface CustomPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {\r\n  disabled?: boolean;\r\n}\r\nexport const initCustomPicker = (initval: string | undefined) => {\r\n  return new Promise<Entity<number>[]>((resolve, reject) => {\r\n    resolve([] as Entity<number>[]);\r\n  });\r\n};\r\nexport function CustomPicker(props: CustomPickerProps) {\r\n  const loadData = () => {\r\n    const options =\r\n      props.customData !== undefined\r\n        ? ((props.customData as unknown) as Entity<number>[])\r\n        : ([] as Entity<number>[]);\r\n    return Promise.resolve<Entity<number>[]>(options);\r\n  };\r\n  return (\r\n    <>\r\n      <AutocompletePicker\r\n        loadData={loadData}\r\n        mini={props.mini ? true : undefined}\r\n        id={props.id || 'custompickerId'}\r\n        fullWidth={props.fullWidth}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.publicAsset || initialState;\r\n\r\nexport const selectPublicAsset = createSelector([selectSlice], state => state);\r\n\r\nexport const selectPublicAssetProcessing = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.processing,\r\n);\r\n\r\nexport const selectSelectedUnitItem = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.data,\r\n);\r\nexport const selectSelectedUnits = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.selectedData,\r\n);\r\nexport const selectSelectedUnitSearch = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.dataSearch,\r\n);\r\nexport const selectAssetPublicFilter = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.filters,\r\n);\r\nexport const selectMenuOpen = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.menuOpen,\r\n);\r\nexport const selectGlobalSearchOpen = createSelector(\r\n  [selectPublicAsset],\r\n  state => state.globalSearchOpen,\r\n);\r\n","/**\r\n *\r\n * ServiceTypeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ServiceTypePicker } from 'app/components/pickers/AutocompletePickers/ServiceTypePicker';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const ServiceTypeFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <ServiceTypePicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      additionalItem={props.additionalItem as Entity<number> | undefined}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default ServiceTypeFilter;\r\n","import { Entity } from 'types/common';\r\nimport { httpClient } from './HttpClient';\r\nimport { EmailTypeUnion } from './odata/generated/enums/EmailType';\r\nconst url = '/api/odata/v4/email';\r\nexport const EmailApi = {\r\n  SendEmail: ({ Files, Bcc, Cc, To, ...data }: IEmail) => {\r\n    const form = new FormData();\r\n    Object.keys(data).forEach(k => {\r\n      form.append(k, data[k]);\r\n    });\r\n    form.append('Bcc', Bcc.map(v => v.Id) as any);\r\n    form.append('Cc', Cc.map(v => v.Id) as any);\r\n    form.append('To', To.map(v => v.Id) as any);\r\n\r\n    for (let i = 0; !!Files && i < Files?.length; i++) {\r\n      let item = Files?.item(i);\r\n      if (!!item) {\r\n        form.append('file' + i, item);\r\n      }\r\n    }\r\n    return httpClient.post(url, form);\r\n  },\r\n};\r\n\r\nexport interface IEmail {\r\n  Id?: number;\r\n  Type: EmailTypeUnion;\r\n  To: Entity<string>[];\r\n  ExtraTo?: string;\r\n  Cc: Entity<string>[];\r\n  ExtraCc?: string;\r\n  Bcc: Entity<string>[];\r\n  ExtraBcc?: string;\r\n  Subject: string;\r\n  Body?: string;\r\n  Files?: FileList;\r\n  SaveToLog: boolean;\r\n  SaveAsTemlate?: boolean;\r\n  ServiceGroup?: number;\r\n}\r\n","import { EmailApi, IEmail } from 'api/EmailApi';\r\nimport { extractErrorMessages } from 'api/utils';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { useResponseModel } from './useResponseModel';\r\n\r\nexport const useSendMail = (setBusy?: (busy: boolean) => void) => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const { t } = useTranslation();\r\n  const response = useResponseModel();\r\n\r\n  return useCallback(\r\n    (email: IEmail) => {\r\n      try {\r\n        setBusy?.(true);\r\n        EmailApi.SendEmail(email)\r\n          .then(v => {\r\n            const value = v as IResponseType;\r\n            response(value);\r\n          })\r\n          .catch(e => {\r\n            //console.log(e);\r\n            const error = extractErrorMessages(e);\r\n            dispatch(\r\n              actions.addNotification({\r\n                variant: 'error',\r\n                message: !!error\r\n                  ? error[0]\r\n                  : (t(translations.err_SendEmailToUserFailed) as string),\r\n              }),\r\n            );\r\n            setBusy?.(false);\r\n          })\r\n          .finally(() => setBusy?.(false));\r\n      } catch (e) {\r\n        const error = extractErrorMessages(e);\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'error',\r\n            message: !!error\r\n              ? error[0]\r\n              : (t(translations.err_SendEmailToUserFailed) as string),\r\n          }),\r\n        );\r\n        setBusy?.(false);\r\n      }\r\n    },\r\n    [actions, dispatch, response, setBusy, t],\r\n  );\r\n};\r\n","/**\r\n *\r\n * UserDisciplineFilter\r\n *\r\n */\r\nimport { UserDisciplinePicker } from 'app/components/pickers/AutocompletePickers/UserDisciplinePicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const UserDisciplineFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <UserDisciplinePicker\r\n      value={props.value as Entity<number> | undefined}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default UserDisciplineFilter;\r\n","import { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport * as React from 'react';\r\nimport { savedViewsApi as api } from 'api/savedViewsApi';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useSavedViewSlice } from '../SavedViewPage/slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Entity } from 'types/common';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ListItem, MenuItem } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SavedViewDetailsProps } from '../SavedViewPage/Details';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n  selectUpdateSavedViewCompleted,\r\n  selectUpdateSavedViewHasError,\r\n} from '../SavedViewPage/slice/selectors';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface AddToListsProps<TRow> {\r\n  rows: TRow[];\r\n  getEquipments: (rows: TRow[]) => Entity<number>[];\r\n  getAssets: (rows: TRow[]) => Promise<Entity<number>[]>;\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function AddToLists<TRow>({\r\n  rows,\r\n  getEquipments,\r\n  getAssets,\r\n  useSidePanel,\r\n}: AddToListsProps<TRow>) {\r\n  const { t } = useTranslation();\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const { openPanel } = useSidePanelState();\r\n  const isAdmin = React.useMemo(() => {\r\n    return (\r\n      user !== undefined &&\r\n      (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n        user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n        user.Roles.indexOf(Roles.LabTech) >= 0)\r\n    );\r\n  }, [user]);\r\n  const dispatch = useDispatch();\r\n  const [myViews, setMyViews] = React.useState<ISavedViewDto[]>([]);\r\n  const savedActions = useSavedViewSlice();\r\n  const [, setLoadingCompleted] = React.useState<boolean>(false);\r\n  const requestUpdateCompleted = useSelector(selectUpdateSavedViewCompleted);\r\n  const hasUpdateError = useSelector(selectUpdateSavedViewHasError);\r\n  const [input, setInnput] = React.useState<string>();\r\n  const options = myViews.filter((item, index) =>\r\n    item.Name.toLowerCase().includes((input || '').toLowerCase()),\r\n  );\r\n\r\n  useEffectOnMount(() => {\r\n    api\r\n      .getMySavedViews({\r\n        user: user,\r\n        serviceGroups: undefined,\r\n        isAdmin: isAdmin,\r\n        onlyMyView: true,\r\n      })\r\n      .then(response => {\r\n        setMyViews(() => {\r\n          return response || [];\r\n        });\r\n        setLoadingCompleted(true);\r\n      });\r\n    return () => {};\r\n  });\r\n  const openDetailsList = React.useCallback(\r\n    (id?: number) => {\r\n      let params = {\r\n        id: id,\r\n        useSidePanel: true,\r\n        eid: getEquipments(rows)\r\n          .map(f => f.Id)\r\n          .join(','),\r\n      } as SavedViewDetailsProps;\r\n      openPanel({\r\n        renderPageType: RenderPageType.SavedViewDetails,\r\n        renderPageProps: params,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [getEquipments, openPanel, rows, useSidePanel],\r\n  );\r\n  const updateAssets = React.useCallback(\r\n    (id: number) => {\r\n      let view = myViews.filter(f => f.Id === id)[0];\r\n      getAssets(rows).then(assets => {\r\n        dispatch(\r\n          savedActions.actions.updateViewAssets({\r\n            assets: assets,\r\n            view: view,\r\n          }),\r\n        );\r\n      });\r\n    },\r\n    [dispatch, getAssets, myViews, rows, savedActions.actions],\r\n  );\r\n  React.useEffect(() => {\r\n    let active = requestUpdateCompleted && !hasUpdateError;\r\n    if (active) {\r\n      dispatch(savedActions.actions.resetUpdateSavedViewState());\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [dispatch, hasUpdateError, requestUpdateCompleted, savedActions.actions]);\r\n  return (\r\n    <DropDown\r\n      variant=\"white\"\r\n      size=\"small\"\r\n      menuChildren={onClose => [\r\n        <ListItem key=\"lists-search\">\r\n          <TextControlField\r\n            placeholder={t(translations.SearchFilter)}\r\n            size=\"small\"\r\n            startIcon={\r\n              <Icon icon=\"search\" color=\"filters\" colorExtend=\"light\" />\r\n            }\r\n            value={input || ''}\r\n            aria-label={t(translations.SearchFilter)}\r\n            inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n            onChange={e => setInnput(e.target.value)}\r\n            autoFocus\r\n            fullWidth\r\n          />\r\n        </ListItem>,\r\n        <ListItem key=\"create-lists\" value=\"action\">\r\n          <Button\r\n            variant=\"white\"\r\n            size=\"small\"\r\n            fullWidth={true}\r\n            aria-label=\"create view\"\r\n            startIcon={<Icon icon=\"plus\" />}\r\n            onClick={() => {\r\n              openDetailsList();\r\n              onClose();\r\n            }}\r\n          >\r\n            {t(translations.CreateList)}\r\n          </Button>\r\n        </ListItem>,\r\n        ...options.map(s => (\r\n          <MenuItem\r\n            key={s.Id}\r\n            onClick={e => {\r\n              updateAssets(s.Id);\r\n              onClose();\r\n            }}\r\n          >\r\n            {s.Name}\r\n          </MenuItem>\r\n        )),\r\n      ]}\r\n      menuProps={{\r\n        anchorOrigin: {\r\n          vertical: 'bottom',\r\n          horizontal: 'left',\r\n        },\r\n        transformOrigin: {\r\n          vertical: 'top',\r\n          horizontal: 'left',\r\n        },\r\n        getContentAnchorEl: null,\r\n      }}\r\n      addChevron\r\n    >\r\n      {t(translations.AddToList)}\r\n    </DropDown>\r\n  );\r\n}\r\n","import { List, ListItem } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface ListRendererProps {\r\n  value: string[];\r\n  localized?: boolean;\r\n  notLocalizedValue?: string[];\r\n  row?: any;\r\n}\r\n\r\nexport const ListRenderer = (props: ListRendererProps) => {\r\n  const { value, localized, notLocalizedValue } = props;\r\n  const { t } = useTranslation();\r\n  const onlyone =\r\n    (value.length === 1 &&\r\n      (notLocalizedValue === undefined || notLocalizedValue.length === 0)) ||\r\n    (value.length === 0 &&\r\n      notLocalizedValue !== undefined &&\r\n      notLocalizedValue.length === 1);\r\n\r\n  const title = (\r\n    <React.Fragment>\r\n      {value.length > 0 ? (\r\n        <>{localized ? (t(value[0].trim()) as string) : value[0].trim()}</>\r\n      ) : notLocalizedValue !== undefined && notLocalizedValue.length > 0 ? (\r\n        <>{notLocalizedValue[0].trim()}</>\r\n      ) : (\r\n        <></>\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n\r\n  const tooltipTitle = (\r\n    <React.Fragment>\r\n      <List dense={true}>\r\n        {value.map((item, index) => {\r\n          return (\r\n            <ListItem key={index}>\r\n              {localized ? (t(item.trim()) as string) : item.trim()}\r\n            </ListItem>\r\n          );\r\n        })}\r\n        {notLocalizedValue !== undefined\r\n          ? notLocalizedValue.map((item, index) => {\r\n              return <ListItem key={index}>{item.trim()}</ListItem>;\r\n            })\r\n          : ''}\r\n      </List>\r\n    </React.Fragment>\r\n  );\r\n\r\n  const listOfItems =\r\n    value.length > 0 ||\r\n    (notLocalizedValue !== undefined && notLocalizedValue.length > 0) ? (\r\n      onlyone ? (\r\n        <>{title}</>\r\n      ) : (\r\n        <React.Fragment>\r\n          <span>{title}</span>\r\n          <Tooltip data-html=\"true\" title={tooltipTitle} arrow>\r\n            <span>\r\n              <Icon icon=\"list\" style={{ marginLeft: '8px' }} />\r\n            </span>\r\n          </Tooltip>\r\n        </React.Fragment>\r\n      )\r\n    ) : (\r\n      <>{''}</>\r\n    );\r\n  return listOfItems;\r\n};\r\n","/**\r\n *\r\n * AssetCatPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { selectReservationStatuses } from 'app/slice/selectors';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ReservationStatusProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const initReservationStatusData = (t: TFunction) => (\r\n  initialValue: string | undefined,\r\n) => {\r\n  const id = initialValue === undefined ? NaN : parseInt(initialValue);\r\n  if (isNaN(id)) {\r\n    return Promise.resolve([] as Entity<number>[]);\r\n  } else {\r\n    return Promise.resolve([\r\n      {\r\n        Id: id,\r\n        Name: t(translations[ReservationStatus[id]]),\r\n      },\r\n    ]);\r\n  }\r\n};\r\n\r\nexport function ReservationStatusPicker(props: ReservationStatusProps) {\r\n  const { t } = useTranslation();\r\n  const options = useSelector(state => selectReservationStatuses(state, t));\r\n  const getOptions = React.useCallback(() => options, [options]);\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'reservation-status-id'}\r\n      getOptions={getOptions}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  RoomPicker,\r\n  RoomsUrl,\r\n} from '../pickers/AutocompletePickers/RoomPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\n\r\nexport const FormRoomPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps & { variant?: 'standard' | 'filled' | 'outlined' } & {\r\n    urlType?: RoomsUrl;\r\n    withoutServiceGroups?: boolean;\r\n  }) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <RoomPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value as IRoomDto}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        disabled={props.disabled}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        variant={props.variant}\r\n        urlType={props.urlType}\r\n        withoutServiceGroups={props.withoutServiceGroups}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * InfoIcon\r\n *\r\n */\r\nimport React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Tooltip, TooltipsProps } from '../BasicTooltips/Tooltip';\r\n\r\nexport interface InfoIconProps extends Pick<TooltipsProps, 'title'> {}\r\n\r\nexport const InfoIcon = React.memo(function BookitlabLoginLogo(\r\n  props: InfoIconProps,\r\n) {\r\n  const classes = useStyles();\r\n  return (\r\n    <Tooltip title={props.title}>\r\n      <span>\r\n        <Icon icon=\"info-circle\" className={classes.root} />\r\n      </span>\r\n    </Tooltip>\r\n  );\r\n});\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      marginLeft: '1ch',\r\n      // root css\r\n    },\r\n  }),\r\n);\r\n","import { Dialog } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\n\r\nexport interface PopupImportExportDialogProps {\r\n  open: boolean;\r\n  content: React.ReactNode;\r\n}\r\nexport function PopupImportExportDialog(props: PopupImportExportDialogProps) {\r\n  return (\r\n    <Dialog\r\n      disableBackdropClick\r\n      disableEscapeKeyDown\r\n      open={props.open}\r\n      aria-labelledby={'exportimport-dialog-popup'}\r\n      fullScreen={true}\r\n      fullWidth={true}\r\n    >\r\n      <Box\r\n        style={{\r\n          width: '100%',\r\n          height: '100%',\r\n          padding: '32px',\r\n          backgroundColor: '#fcfcfd',\r\n        }}\r\n      >\r\n        {props.content}\r\n      </Box>\r\n    </Dialog>\r\n  );\r\n}\r\n","export enum AutomaticAssetImportNaming {\r\n  NA = 0,\r\n  ByAssetCatModelNumber = 1,\r\n}\r\n","import { ScreensId } from 'enums/ConfigurableTypes';\r\nimport * as Excel from 'exceljs';\r\nimport { ValueType } from 'exceljs';\r\nimport Papa from 'papaparse';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ExportImportActions } from '../Actions';\r\nimport { ImportAdditionalData, ImportColumn } from '../Actions/Types';\r\nimport { AutomaticAssetImportNaming } from '../Components/Types';\r\n\r\nexport class CImportData {\r\n  private _ScreenId!: ScreensId;\r\n  private needReloadTemplateColumns!: boolean;\r\n  private _ImportAssetImageFiles: boolean = false;\r\n  private _AutoGenerateAssetNamesBasedOn: Entity<number> | null = {\r\n    Id: AutomaticAssetImportNaming.NA as number,\r\n    Name: 'N/A',\r\n  };\r\n  private _UpdateQRCode: boolean = false;\r\n  private _ImportAdditionalData: ImportAdditionalData =\r\n    ImportAdditionalData.none;\r\n  public TemplateColumns: Entity<string>[] | undefined;\r\n  public File: File | undefined;\r\n  public Images: File[] | undefined;\r\n  public RowCount: number | undefined;\r\n  public Header: ImportColumn[] | undefined;\r\n  public Table: string[][] | undefined;\r\n  public AddOnly: boolean | undefined = false;\r\n  book: Excel.Workbook;\r\n  constructor() {\r\n    this.book = new Excel.Workbook();\r\n  }\r\n  public get ScreenId() {\r\n    return this._ScreenId;\r\n  }\r\n  public set ScreenId(screenId: ScreensId) {\r\n    if (this._ScreenId !== screenId) {\r\n      this.needReloadTemplateColumns = true;\r\n    }\r\n    this._ScreenId = screenId;\r\n  }\r\n  public get ImportAssetImageFiles() {\r\n    return this._ImportAssetImageFiles;\r\n  }\r\n  public set ImportAssetImageFiles(value: boolean) {\r\n    this._ImportAssetImageFiles = value;\r\n  }\r\n  public get AutoGenerateAssetNamesBasedOn() {\r\n    return this._AutoGenerateAssetNamesBasedOn;\r\n  }\r\n  public set AutoGenerateAssetNamesBasedOn(value: Entity<number> | null) {\r\n    this._AutoGenerateAssetNamesBasedOn = value;\r\n  }\r\n  public get UpdateQRCode() {\r\n    return this._UpdateQRCode;\r\n  }\r\n  public set UpdateQRCode(value: boolean) {\r\n    this._UpdateQRCode = value;\r\n  }\r\n  public get ImportAdditionalData() {\r\n    return this._ImportAdditionalData;\r\n  }\r\n  public set ImportAdditionalData(value: ImportAdditionalData) {\r\n    this._ImportAdditionalData = value;\r\n  }\r\n  public ColumnCount() {\r\n    var count: number = 0;\r\n    if (this.Header !== undefined) {\r\n      this.Header.forEach(c => {\r\n        if (c.Include) {\r\n          count++;\r\n        }\r\n      });\r\n    }\r\n    return count;\r\n  }\r\n  private Clear() {\r\n    this.AddOnly = false;\r\n    this.RowCount = undefined;\r\n    this.Header = undefined;\r\n    this.Table = undefined;\r\n  }\r\n  Init(File: File) {\r\n    this.File = File;\r\n    this.Clear();\r\n  }\r\n  ClearImages() {\r\n    this.Images = undefined;\r\n  }\r\n  AddImages(Files: File[]) {\r\n    if (this.Images === undefined) {\r\n      this.Images = Files;\r\n    } else {\r\n      for (const f of Files) {\r\n        const ff = this.Images.find(v => v.name === f.name);\r\n        if (ff === undefined) {\r\n          this.Images.push(f);\r\n        }\r\n      }\r\n    }\r\n  }\r\n  RemoveImage(name: string) {\r\n    if (this.Images !== undefined) {\r\n      const fi = this.Images.findIndex(v => v.name === name);\r\n      if (fi >= 0) {\r\n        this.Images.splice(fi, 1);\r\n      }\r\n    }\r\n  }\r\n  LoadTemplateColumns(): Promise<any> {\r\n    if (\r\n      this.needReloadTemplateColumns ||\r\n      this.TemplateColumns === undefined ||\r\n      this.TemplateColumns.length === 0\r\n    ) {\r\n      if (this.ScreenId !== undefined) {\r\n        this.needReloadTemplateColumns = false;\r\n        return ExportImportActions.TemplateColumns(\r\n          this.ScreenId,\r\n          this.ImportAdditionalData,\r\n        );\r\n      } else {\r\n        return Promise.resolve();\r\n      }\r\n    } else {\r\n      return Promise.resolve();\r\n    }\r\n  }\r\n  public InitHeaderByTemplate() {\r\n    if (this.TemplateColumns !== undefined && this.TemplateColumns.length > 0) {\r\n      this.Header?.forEach((hvalue, cn) => {\r\n        const v = this.TemplateColumns?.find(tvalue => {\r\n          return tvalue.Name === hvalue.ExcelName;\r\n        });\r\n        if (this.Header !== undefined && v !== undefined) {\r\n          this.Header[cn].Name = v.Id;\r\n        }\r\n      });\r\n    }\r\n  }\r\n  SetTemplateColumns(values: Entity<string>[] | undefined) {\r\n    if (values !== undefined) {\r\n      this.TemplateColumns = values.map(value => {\r\n        return {\r\n          Id: value.Id,\r\n          //Name: value.hasCustomName ? value.CustomName : value.DisplayName,\r\n          Name: value.Name,\r\n        };\r\n      });\r\n      this.InitHeaderByTemplate();\r\n    }\r\n  }\r\n  private GetCellData(cell: Excel.Cell): string {\r\n    let value: any;\r\n    if (cell.value === undefined) {\r\n      return '';\r\n    } else {\r\n      value = cell.value;\r\n    }\r\n    switch (cell.type) {\r\n      case ValueType.Null:\r\n        return '';\r\n      case ValueType.Number:\r\n      case ValueType.String:\r\n      case ValueType.Boolean:\r\n      case ValueType.SharedString:\r\n      case ValueType.Formula:\r\n      case ValueType.RichText:\r\n        return value.toString();\r\n      case ValueType.Date:\r\n        const d = dateUtils.shortDateTimeFormat(value);\r\n        return d !== null ? d : '';\r\n      case ValueType.Hyperlink:\r\n        return value.text;\r\n      case ValueType.Error:\r\n        return '';\r\n      default:\r\n        return '';\r\n    }\r\n  }\r\n  LoadXlsx(): Promise<any> {\r\n    if (this.File !== undefined) {\r\n      var reader: any;\r\n      reader = this.book.xlsx;\r\n      return reader\r\n        .load(this.File)\r\n        .then(() => {\r\n          const ws = this.book.getWorksheet(1);\r\n          this.RowCount = ws.rowCount - 1;\r\n          const row1 = ws.getRow(1);\r\n          this.Header = [];\r\n          row1.eachCell((cell, cn) => {\r\n            this.Header?.push({\r\n              Include: true,\r\n              ExcelName: cell.value?.toString(),\r\n              Name: undefined,\r\n            });\r\n          });\r\n          if (this.Header !== undefined && this.Header.length) {\r\n            this.InitHeaderByTemplate();\r\n            const rc = ws.rowCount < 7 ? ws.rowCount + 1 : 7;\r\n            this.Table = [];\r\n            for (let i = 2; i < rc; i++) {\r\n              const row = ws.getRow(i);\r\n              // init tr\r\n              let tr: string[] = this.Header.map(() => '');\r\n              row.eachCell((cell, cn) => {\r\n                const s = this.GetCellData(cell);\r\n                tr[cn - 1] = s !== undefined ? s : '';\r\n              });\r\n              this.Table?.push(tr);\r\n            }\r\n            return true;\r\n          }\r\n        })\r\n        .catch(err => {\r\n          console.log(err.message);\r\n        });\r\n    } else {\r\n      this.Clear();\r\n      return Promise.resolve();\r\n    }\r\n  }\r\n\r\n  LoadCsv(): Promise<any> {\r\n    if (this.File !== undefined) {\r\n      const file = this.File;\r\n      return new Promise((resolve, reject) => {\r\n        Papa.parse(file, {\r\n          header: true,\r\n          dynamicTyping: true,\r\n          complete: results => {\r\n            this.RowCount = results.data.length - 1;\r\n            const row1 = results.meta.fields;\r\n            this.Header = [];\r\n            row1?.forEach((cell, cn) => {\r\n              this.Header?.push({\r\n                Include: true,\r\n                ExcelName: cell,\r\n                Name: undefined,\r\n              });\r\n            });\r\n            this.InitHeaderByTemplate();\r\n            const rc = this.RowCount < 6 ? this.RowCount : 5;\r\n            this.Table = [];\r\n            for (let i = 0; i < rc; i++) {\r\n              const obj = results.data[i] as {};\r\n              if (obj !== undefined) {\r\n                const d = Object.keys(obj).map(key => {\r\n                  const v = obj[key];\r\n                  if (typeof v === 'boolean') return v.toString();\r\n                  else return v;\r\n                });\r\n                this.Table?.push(d);\r\n              }\r\n            }\r\n            resolve(true);\r\n          },\r\n          error: error => {\r\n            reject(error);\r\n          },\r\n        });\r\n      });\r\n    } else {\r\n      this.Clear();\r\n      return Promise.resolve();\r\n    }\r\n  }\r\n\r\n  LoadExcelfile(): Promise<any> {\r\n    if (this.File !== undefined) {\r\n      const ext = this.File.name.split('.').pop();\r\n      switch (ext) {\r\n        case 'xlsx':\r\n          return this.LoadXlsx();\r\n        case 'csv':\r\n          return this.LoadCsv();\r\n        default:\r\n          this.Clear();\r\n          return Promise.resolve();\r\n      }\r\n    } else {\r\n      this.Clear();\r\n      return Promise.resolve();\r\n    }\r\n  }\r\n}\r\nexport const ImprotData = new CImportData();\r\n","import * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { useDropzone } from 'react-dropzone';\r\nimport { styled } from '@material-ui/core';\r\n//import fileDownload from 'js-file-download';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\n//import { Button } from 'app/components/BasicButtons/Button';\r\nimport { ImprotData } from '../Data';\r\n\r\nexport interface SelectFileProps {\r\n  accept: any;\r\n  downloadFileName?: string;\r\n  filesPlaceholder: React.ReactNode;\r\n  selectFileHandler: (value: boolean) => void;\r\n}\r\n\r\n/**\r\n * Multiline text field with and option to update value by dropping a file\r\n * @param param0\r\n * @returns\r\n */\r\nexport const SelectFile = ({\r\n  label,\r\n  onBlur,\r\n  value,\r\n  name,\r\n  error,\r\n  helperText,\r\n  accept,\r\n  downloadFileName,\r\n  filesPlaceholder,\r\n  selectFileHandler,\r\n  ...props\r\n}: FieldHookConfig<string> & TextFieldProps & SelectFileProps) => {\r\n  const onDrop = React.useCallback(\r\n    (acceptedFiles: File[]) => {\r\n      // Do something with the files\r\n      const file = acceptedFiles[0];\r\n      ImprotData.Init(file);\r\n      selectFileHandler(file !== undefined);\r\n    },\r\n    [selectFileHandler],\r\n  );\r\n\r\n  const { acceptedFiles, getRootProps, getInputProps } = useDropzone({\r\n    onDrop,\r\n    maxFiles: 1,\r\n    maxSize: 1000000,\r\n    accept: {\r\n      'application/imp': [accept],\r\n    },\r\n  });\r\n\r\n  const files = acceptedFiles.map(file => (\r\n    <li key={file.name}>\r\n      {file.name} - {file.size} bytes\r\n    </li>\r\n  ));\r\n\r\n  /*const handleDownloadClick = () => {\r\n    if (downloadFileName !== undefined && fileContent !== null) {\r\n      fileDownload(fileContent, downloadFileName);\r\n    }\r\n  };*/\r\n\r\n  return (\r\n    <>\r\n      <StyledDropboxContainer {...getRootProps({ className: 'dropzone' })}>\r\n        <input {...getInputProps()} />\r\n        <p>{filesPlaceholder}</p>\r\n      </StyledDropboxContainer>\r\n      <aside>\r\n        <h4>Files</h4>\r\n        <ul>{files}</ul>\r\n        {/*} <Button variant=\"text\" size=\"small\" onClick={handleDownloadClick}>\r\n          {downloadFileName}\r\n         </Button>*/}\r\n      </aside>\r\n    </>\r\n  );\r\n};\r\nconst StyledDropboxContainer = styled('div')(({ theme }) => ({\r\n  flex: 1,\r\n  display: 'flex',\r\n  flexDirection: 'column',\r\n  alignItems: 'center',\r\n  padding: '20px',\r\n  borderWidth: '2px',\r\n  borderRadius: '2px',\r\n  borderColor: theme.palette.common.grayBorders,\r\n  borderStyle: 'dashed',\r\n  backgroundColor: theme.palette.background.paper,\r\n  color: '#bdbdbd',\r\n  outline: 'none',\r\n  transition: 'border .24s ease-in-out',\r\n}));\r\n","import * as React from 'react';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nexport function TypePicker(props) {\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={() =>\r\n        Promise.resolve(['.xlsx', '.csv'].map(s => ({ Id: s, Name: s })))\r\n      }\r\n      variant=\"filled\"\r\n      fullWidth\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { AutocompletePicker } from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AutomaticAssetImportNaming } from './Types';\r\n\r\nexport function AutomaticAssetImportNamingPicker(props) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={() =>\r\n        Promise.resolve([\r\n          { Id: AutomaticAssetImportNaming.NA as number, Name: 'N/A' },\r\n          {\r\n            Id: AutomaticAssetImportNaming.ByAssetCatModelNumber as number,\r\n            Name: t(translations.ByAssetCatModelNumber),\r\n          },\r\n        ])\r\n      }\r\n      variant=\"filled\"\r\n      fullWidth\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport './styles.css';\r\nexport interface FileSize {\r\n  size: number;\r\n  name: string;\r\n}\r\nexport interface Image {\r\n  name: string;\r\n  path: string;\r\n  size: FileSize;\r\n}\r\nexport interface ImageListProps {\r\n  data: Image[] | undefined;\r\n  removeImage: (name: string) => void;\r\n}\r\nexport const ImageList = (props: ImageListProps) => {\r\n  const { t } = useTranslation();\r\n  const data: Image[] = props.data !== undefined ? props.data : [];\r\n  return (\r\n    <>\r\n      {data.length > 0 ? (\r\n        <div\r\n          style={{\r\n            width: 384,\r\n            maxHeight: 200,\r\n            overflowY: 'auto',\r\n            overflowX: 'clip',\r\n            borderStyle: 'solid',\r\n            borderWidth: '1px',\r\n            borderColor: 'gray',\r\n          }}\r\n        >\r\n          {data.map(value => (\r\n            <>\r\n              <div\r\n                className={'hiddenImgTxt'}\r\n                style={{ display: 'flex', alignItems: 'center' }}\r\n              >\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  aria-label=\"close\"\r\n                  title={t(translations.RemoveImage)}\r\n                  onClick={() => {\r\n                    props.removeImage(value.name);\r\n                  }}\r\n                  size=\"small\"\r\n                >\r\n                  <Icon icon=\"times\" />\r\n                </IconButton>\r\n                {value.name +\r\n                  ' - ' +\r\n                  value.size.size.toString() +\r\n                  ' ' +\r\n                  value.size.name}\r\n              </div>\r\n              <div className={'hiddenimg'}>\r\n                <img\r\n                  src={value.path}\r\n                  alt={value.path}\r\n                  style={{ maxWidth: '50px', maxHeight: '50px' }}\r\n                />\r\n              </div>\r\n            </>\r\n          ))}\r\n        </div>\r\n      ) : (\r\n        <></>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { useDropzone } from 'react-dropzone';\r\nimport { styled } from '@material-ui/core';\r\nimport { TextFieldProps } from 'app/components/TextField';\r\nimport { ImprotData } from '../Data';\r\nimport { ImageList, Image, FileSize } from './ImageList';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ExportImportActions } from '../Actions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport fileDownload from 'js-file-download';\r\nimport { AxiosError } from 'axios';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface SelectImageFilesProps {\r\n  accept: any;\r\n  filesPlaceholder: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Multiline text field with and option to update value by dropping a file\r\n * @param param0\r\n * @returns\r\n */\r\nconst getFileSize = (size): FileSize => {\r\n  var string;\r\n  if (size >= 1024 * 1024 * 1024 * 1024) {\r\n    size = size / (1024 * 1024 * 1024 * 1024);\r\n    string = 'TiB';\r\n  } else if (size >= 1024 * 1024 * 1024) {\r\n    size = size / (1024 * 1024 * 1024);\r\n    string = 'GiB';\r\n  } else if (size >= 1024 * 1024) {\r\n    size = size / (1024 * 1024);\r\n    string = 'MiB';\r\n  } else if (size >= 1024) {\r\n    size = size / 1024;\r\n    string = 'KiB';\r\n  } else {\r\n    string = 'b';\r\n  }\r\n  return { size: Math.round(size), name: string };\r\n};\r\n\r\nexport const SelectImageFiles = ({\r\n  label,\r\n  onBlur,\r\n  value,\r\n  name,\r\n  error,\r\n  helperText,\r\n  accept,\r\n  filesPlaceholder,\r\n  ...props\r\n}: FieldHookConfig<string> & TextFieldProps & SelectImageFilesProps) => {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const [importing, setImporting] = React.useState<boolean>(false);\r\n  const [paths, setPaths] = React.useState<Image[] | undefined>();\r\n  const MaximumImagesPerOneUpload =\r\n    tryParseInt(\r\n      settings?.GetString(AllowedSettings.MaximumImagesPerOneUpload),\r\n    ) ?? 10;\r\n  const MaxImageSize =\r\n    (tryParseInt(\r\n      settings?.GetString(AllowedSettings.MaxLoadedAssetImageMbSize),\r\n    ) ?? 1) *\r\n    1024 *\r\n    1024;\r\n  const setImages = React.useCallback(() => {\r\n    if (ImprotData.Images !== undefined) {\r\n      setPaths(\r\n        ImprotData.Images.map(file => {\r\n          return {\r\n            name: file.name,\r\n            path: URL.createObjectURL(file),\r\n            size: getFileSize(file.size),\r\n          };\r\n        }),\r\n      );\r\n    } else {\r\n      setPaths(undefined);\r\n    }\r\n  }, []);\r\n  React.useEffect(() => {\r\n    setImages();\r\n  }, [setImages]);\r\n  const onDrop = React.useCallback(\r\n    (acceptedFiles: File[]) => {\r\n      ImprotData.AddImages(acceptedFiles);\r\n      setImages();\r\n    },\r\n    [setImages],\r\n  );\r\n  const removeImage = React.useCallback(\r\n    (name: string) => {\r\n      ImprotData.RemoveImage(name);\r\n      setImages();\r\n    },\r\n    [setImages],\r\n  );\r\n\r\n  const { getRootProps, getInputProps } = useDropzone({\r\n    onDrop,\r\n    maxFiles: MaximumImagesPerOneUpload,\r\n    maxSize: MaxImageSize,\r\n    accept: accept,\r\n  });\r\n\r\n  const importImages = React.useCallback(async () => {\r\n    if (ImprotData.Images !== undefined) {\r\n      setImporting(true);\r\n      try {\r\n        const res = await ExportImportActions.ImportImages(\r\n          ImprotData.Images,\r\n          ScreensId.MyAssets,\r\n        );\r\n        const cd = res.headers['content-disposition'];\r\n        const filename =\r\n          cd !== undefined\r\n            ? cd.split('filename=')[1]\r\n            : 'ExportForImport_Articles.xlsx';\r\n        fileDownload(res.data, filename);\r\n        ImprotData.ClearImages();\r\n        setPaths(undefined);\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'success',\r\n            message: 'Images loaded successfully !',\r\n          }),\r\n        );\r\n      } catch (error) {\r\n        if ((error as AxiosError).isAxiosError) {\r\n          //var errorCode = (error as AxiosError).response?.status;\r\n          dispatch(\r\n            actions.addNotification({\r\n              variant: 'error',\r\n              message: error as string,\r\n            }),\r\n          );\r\n        }\r\n      }\r\n      setImporting(false);\r\n    }\r\n  }, [actions, dispatch]);\r\n\r\n  return (\r\n    <>\r\n      <div style={{ display: 'flex', alignItems: 'center' }}>\r\n        {t(translations.RecommendationsOfLoadImages)}\r\n        <IconButton\r\n          title={t(translations.RecommendationsBodyOfLoadImages)}\r\n          variant=\"ghost\"\r\n          shape=\"square\"\r\n          size=\"small\"\r\n        >\r\n          <Icon icon=\"info-circle\" color=\"primary\" />\r\n        </IconButton>\r\n      </div>\r\n      <div style={{ display: 'flex', alignItems: 'center' }}>\r\n        {t(translations.InformationToLoadImages)}\r\n        <IconButton\r\n          title={t(translations.RecommendationsBodyOfLoadImages)}\r\n          variant=\"ghost\"\r\n          shape=\"square\"\r\n          size=\"small\"\r\n        >\r\n          <Icon icon=\"info-circle\" color=\"primary\" />\r\n        </IconButton>\r\n      </div>\r\n      <StyledDropboxContainer {...getRootProps({ className: 'dropzone' })}>\r\n        <input {...getInputProps()} />\r\n        <p>{filesPlaceholder}</p>\r\n      </StyledDropboxContainer>\r\n      <ImageList data={paths} removeImage={removeImage} />\r\n      <Box style={{ display: 'flex', marginTop: '20px' }}>\r\n        <Button\r\n          processing={importing}\r\n          disabled={paths === undefined || paths.length === 0}\r\n          onClick={importImages}\r\n        >\r\n          {t(translations.LoadImages)}\r\n        </Button>\r\n        <Button\r\n          style={{ marginLeft: '10px' }}\r\n          variant=\"white\"\r\n          disabled={paths === undefined || paths.length === 0}\r\n          onClick={() => {\r\n            ImprotData.ClearImages();\r\n            setPaths(undefined);\r\n          }}\r\n        >\r\n          {t(translations.ClearAll)}\r\n        </Button>\r\n      </Box>\r\n    </>\r\n  );\r\n};\r\nconst StyledDropboxContainer = styled('div')(({ theme }) => ({\r\n  flex: 1,\r\n  display: 'flex',\r\n  flexDirection: 'column',\r\n  alignItems: 'center',\r\n  padding: '20px',\r\n  borderWidth: '2px',\r\n  borderRadius: '2px',\r\n  borderColor: theme.palette.common.grayBorders,\r\n  borderStyle: 'dashed',\r\n  backgroundColor: theme.palette.background.paper,\r\n  color: '#bdbdbd',\r\n  outline: 'none',\r\n  transition: 'border .24s ease-in-out',\r\n}));\r\n","import { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { H3 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { SelectFile } from './SelectFile';\r\nimport { TypePicker } from './TypePicker';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport { ImprotData } from '../Data';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { AutomaticAssetImportNamingPicker } from './AutomaticAssetImportNamingPicker';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectAssetFieldSettings,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { AutomaticAssetNamings } from 'enums/enums';\r\nimport { SelectImageFiles } from './SelectImageFiles';\r\nimport { ImportAdditionalData } from '../Actions/Types';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\n\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    titleContainer: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n    },\r\n    closeButton: {\r\n      position: 'absolute',\r\n      right: theme.spacing(3),\r\n      top: theme.spacing(3),\r\n      color: theme.palette.grey[500],\r\n    },\r\n    container: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n    },\r\n    boxcontainer: {\r\n      display: 'flex',\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    selectFileBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      marginTop: '24px',\r\n    },\r\n    selectImageBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n    },\r\n    infoBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      marginTop: '24px',\r\n      padding: '10PX',\r\n      backgroundColor: '#f0f9ff',\r\n    },\r\n  }),\r\n);\r\n\r\nexport interface PopupImportExportStep1Props {\r\n  title: string;\r\n  filetype: Entity<string> | null;\r\n  nextName: string;\r\n  cancelName: string;\r\n  ImportTenplateHandler: () => void;\r\n  handleFileTypeChange: (value: Entity<string> | null) => void;\r\n  next: () => void;\r\n  cancel: () => void;\r\n}\r\nexport function PopupImportExportStep1(props: PopupImportExportStep1Props) {\r\n  const [filetype, setFiletype] = React.useState<Entity<string> | null>(\r\n    props.filetype,\r\n  );\r\n  const { t } = useTranslation();\r\n  const [fileIsSelected, setFileIsSelected] = React.useState<boolean>(false);\r\n  const [importAssetImageFiles, setImportAssetImageFiles] = React.useState<\r\n    boolean\r\n  >(ImprotData.ImportAssetImageFiles);\r\n  const classes = useStyles();\r\n  const handleImportAssetImageFiles = React.useCallback((f: boolean) => {\r\n    setImportAssetImageFiles(f);\r\n  }, []);\r\n  const handleFileTypeChange = React.useCallback(\r\n    (value: Entity<string> | null) => {\r\n      setFiletype(value);\r\n      props.handleFileTypeChange(value);\r\n    },\r\n    [props],\r\n  );\r\n  const selectFileHandler = React.useCallback((value: boolean) => {\r\n    setFileIsSelected(value);\r\n  }, []);\r\n  return (\r\n    <>\r\n      <Box className={clsx(classes.root)}>\r\n        <Box style={{ height: '85%' }}>\r\n          <Box className={classes.titleContainer}>\r\n            <IconButton\r\n              variant=\"ghost\"\r\n              aria-label=\"close\"\r\n              className={classes.closeButton}\r\n              onClick={props.cancel}\r\n              size=\"small\"\r\n            >\r\n              <Icon icon=\"times\" />\r\n            </IconButton>\r\n            <H3>{props.title}</H3>\r\n          </Box>\r\n          <Box className={clsx(classes.boxcontainer)}>\r\n            <Box style={{ width: '50%' }}>\r\n              {ImprotData.ScreenId === ScreensId.MyAssets &&\r\n                ImprotData.ImportAdditionalData ===\r\n                  ImportAdditionalData.none && (\r\n                  <AssetProperties\r\n                    ImportAssetImageFiles={handleImportAssetImageFiles}\r\n                  />\r\n                )}\r\n              {importAssetImageFiles === false && (\r\n                <>\r\n                  <SelectFileBox\r\n                    fileType={filetype}\r\n                    handleFileTypeChange={handleFileTypeChange}\r\n                    selectFileHandler={selectFileHandler}\r\n                  />\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      justifyContent: 'center',\r\n                      width: '384px',\r\n                    }}\r\n                  >\r\n                    {t(translations.BulkImportTitle)}\r\n                  </Box>\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      justifyContent: 'center',\r\n                      width: '384px',\r\n                    }}\r\n                  >\r\n                    <Button\r\n                      startIcon={<Icon icon=\"download\" />}\r\n                      variant=\"white\"\r\n                      onClick={() => {\r\n                        props.ImportTenplateHandler();\r\n                      }}\r\n                    >\r\n                      {t(translations.GetTheTemplate)}\r\n                    </Button>\r\n                  </Box>\r\n                </>\r\n              )}\r\n            </Box>\r\n            <Box style={{ width: '50%' }}>\r\n              <InfoBox ImportTenplateHandler={props.ImportTenplateHandler} />\r\n            </Box>\r\n          </Box>\r\n        </Box>\r\n        {importAssetImageFiles === false && (\r\n          <Box style={{ height: '15%' }} className={clsx(classes.container)}>\r\n            <Button onClick={props.next} disabled={!fileIsSelected}>\r\n              {props.nextName}\r\n            </Button>\r\n            <Button\r\n              variant=\"white\"\r\n              onClick={props.cancel}\r\n              style={{ marginLeft: '10px' }}\r\n            >\r\n              {props.cancelName}\r\n            </Button>\r\n          </Box>\r\n        )}\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n\r\ninterface AssetPropertiesProps {\r\n  ImportAssetImageFiles: (f: boolean) => void;\r\n}\r\nfunction AssetProperties(props: AssetPropertiesProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const [importAssetImageFiles, setImportAssetImageFiles] = React.useState<\r\n    boolean\r\n  >(ImprotData.ImportAssetImageFiles);\r\n  const [\r\n    autoGenerateAssetNamesBasedOn,\r\n    setAutoGenerateAssetNamesBasedOn,\r\n  ] = React.useState<Entity<number> | null>(\r\n    ImprotData.AutoGenerateAssetNamesBasedOn,\r\n  );\r\n  const [updateQRCode, setUpdateQRCode] = React.useState<boolean>(\r\n    ImprotData.UpdateQRCode,\r\n  );\r\n  const classes = useStyles();\r\n  //const appSettings = useSelector(selectAppSettings);\r\n  const app = useSelector(selectAssetFieldSettings);\r\n\r\n  const showInternalCode = React.useMemo(\r\n    () => app[AssetAttributes.InternalCode]?.Enabled === true,\r\n    [app],\r\n  );\r\n\r\n  const settings = useSelector(selectglobalSettings);\r\n\r\n  const ImportAssetAutoNaming = settings.GetString(\r\n    AllowedSettings.AutomaticAssetNamings,\r\n  );\r\n\r\n  const handleImageChange = React.useCallback(\r\n    event => {\r\n      const value = event.target.checked;\r\n      ImprotData.ImportAssetImageFiles = value;\r\n      setImportAssetImageFiles(value);\r\n      props.ImportAssetImageFiles(value);\r\n    },\r\n    [props],\r\n  );\r\n  const handleAutoNameingChange = React.useCallback(\r\n    (value: Entity<number> | null) => {\r\n      ImprotData.AutoGenerateAssetNamesBasedOn = value;\r\n      setAutoGenerateAssetNamesBasedOn(value);\r\n    },\r\n    [],\r\n  );\r\n  const handleUpdateQRCodeChange = React.useCallback(event => {\r\n    const value = event.target.checked;\r\n    ImprotData.UpdateQRCode = value;\r\n    setUpdateQRCode(value);\r\n  }, []);\r\n  return (\r\n    <>\r\n      <Box style={{ width: '384px', marginTop: '10px' }}>\r\n        <Box>\r\n          <Check\r\n            name={'ImportAssetImageFiles'}\r\n            id={'1'}\r\n            checked={importAssetImageFiles}\r\n            onChange={handleImageChange}\r\n          />\r\n          <Body bold={true}>{t(translations.ImportAssetImageFiles)}</Body>\r\n        </Box>\r\n        {(ImportAssetAutoNaming === '' ||\r\n          parseInt(ImportAssetAutoNaming) ===\r\n            (AutomaticAssetNamings.No as number)) && (\r\n          <Box style={{ marginTop: '8px', marginBottom: '8px' }}>\r\n            <AutomaticAssetImportNamingPicker\r\n              name=\"AutomaticAssetImportNaming\"\r\n              fullWidth\r\n              placeholder={t(translations.ImportAssetAutoNaming)}\r\n              label={t(translations.ImportAssetAutoNaming)}\r\n              disabled={false}\r\n              value={autoGenerateAssetNamesBasedOn}\r\n              info={t(translations.ImportAssetAutoNaming_info)}\r\n              onChange={handleAutoNameingChange}\r\n            />\r\n          </Box>\r\n        )}\r\n        {showInternalCode && (\r\n          <Box className={clsx(classes.container)}>\r\n            <Check\r\n              name={'UpdateQRCode'}\r\n              id={'2'}\r\n              checked={updateQRCode}\r\n              onChange={handleUpdateQRCodeChange}\r\n            />\r\n            <Body bold={true}>{t(translations.ImportAssetsUpdateQRcodes)}</Body>\r\n            <IconButton\r\n              title={t(translations.ImportAssetsUpdateQRcodesInfo)}\r\n              variant=\"ghost\"\r\n              shape=\"square\"\r\n              size=\"small\"\r\n            >\r\n              <Icon icon=\"info-circle\" color=\"primary\" />\r\n            </IconButton>\r\n          </Box>\r\n        )}\r\n        {importAssetImageFiles && (\r\n          <SelectImageFilesBox selectFileHandler={() => {}} />\r\n        )}\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\ninterface SelectFileBoxProps {\r\n  handleFileTypeChange: (value: Entity<string> | null) => void;\r\n  selectFileHandler: (value: boolean) => void;\r\n  fileType: Entity<string> | null;\r\n}\r\nfunction SelectFileBox(props: SelectFileBoxProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const [filetype, setFiletype] = React.useState<Entity<string> | null>(\r\n    props.fileType,\r\n  );\r\n  const classes = useStyles();\r\n  const downloadMime = undefined;\r\n  const downloadFileExtension =\r\n    downloadMime === undefined ? undefined : filetype;\r\n  const downloadFileName =\r\n    downloadFileExtension === undefined ? undefined : undefined;\r\n  const handleChange = React.useCallback(\r\n    (value: Entity<string> | null) => {\r\n      setFiletype(value);\r\n      props.handleFileTypeChange(value);\r\n    },\r\n    [props],\r\n  );\r\n  const fh = React.useMemo((): React.ReactNode => {\r\n    let s = t(translations.MaxFileSize);\r\n    s = s.replace('{0}', '100');\r\n    return (\r\n      <>\r\n        <Body bold={true}>{t(translations.DragTheFilesOrBrowse)}</Body>\r\n        <div style={{ textAlign: 'center' }}> {s} </div>\r\n      </>\r\n    );\r\n  }, [t]);\r\n  return (\r\n    <Box\r\n      className={clsx(classes.selectFileBox)}\r\n      style={{ width: '384px', height: '256' }}\r\n    >\r\n      <TypePicker\r\n        name=\"ImportFileType\"\r\n        fullWidth\r\n        placeholder={t(translations.ImportFileType)}\r\n        label={t(translations.ImportFileType)}\r\n        disabled={false}\r\n        value={filetype}\r\n        onChange={handleChange}\r\n      />\r\n      <Box style={{ marginTop: '10px' }}>\r\n        <SelectFile\r\n          name=\"Xml\"\r\n          multiline={true}\r\n          fullWidth\r\n          placeholder={t(translations.Template)}\r\n          label={t(translations.Template)}\r\n          disabled={false}\r\n          accept={filetype !== null ? filetype.Id : ''}\r\n          downloadFileName={downloadFileName}\r\n          filesPlaceholder={fh}\r\n          selectFileHandler={props.selectFileHandler}\r\n        />\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\ninterface SelectImageFilesBoxProps {\r\n  selectFileHandler: (value: boolean) => void;\r\n}\r\nfunction SelectImageFilesBox(props: SelectImageFilesBoxProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const classes = useStyles();\r\n  const fh = React.useMemo((): React.ReactNode => {\r\n    let s = t(translations.MaxFileSize);\r\n    s = s.replace('{0}', '100');\r\n    return (\r\n      <>\r\n        <Body bold={true}>{t(translations.DragTheImagesOrBrowse)}</Body>\r\n        <br />\r\n        <div style={{ color: 'black' }}>\r\n          {t(translations.AssetImgSupportedTypes)}\r\n        </div>\r\n        <div style={{ textAlign: 'center' }}> {s} </div>\r\n      </>\r\n    );\r\n  }, [t]);\r\n  const accept = {\r\n    'application/png': ['.png'],\r\n    'application/jpg': ['.jpg'],\r\n    'application/gif': ['.gif'],\r\n    'application/bmp': ['.bmp'],\r\n    'application/jpe': ['.jpe'],\r\n    'application/jpeg': ['.jpeg'],\r\n    'application/ico': ['.ico'],\r\n  };\r\n  return (\r\n    <Box\r\n      className={clsx(classes.selectImageBox)}\r\n      style={{ width: '384px', height: '256' }}\r\n    >\r\n      <Box>\r\n        <SelectImageFiles\r\n          name=\"Images\"\r\n          multiline={true}\r\n          fullWidth\r\n          placeholder={t(translations.Template)}\r\n          label={t(translations.Template)}\r\n          disabled={false}\r\n          accept={accept}\r\n          filesPlaceholder={fh}\r\n        />\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\n\r\ninterface InfoBoxProps {\r\n  ImportTenplateHandler: () => void;\r\n}\r\nfunction InfoBox(props: InfoBoxProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const classes = useStyles();\r\n  const BulkCreateNewRecords: string[] = React.useMemo(() => {\r\n    return t(translations.Bulk_CNR1).split('{0}');\r\n  }, [t]);\r\n  return (\r\n    <Box className={clsx(classes.infoBox)} style={{ width: '488px' }}>\r\n      <Box style={{ margin: '10px' }}>\r\n        <Body bold={true}>\r\n          {t(translations.ExcelImportSpecificRequirements)}\r\n        </Body>\r\n        <ul>\r\n          <li>{t(translations.Excel_ISR1)}</li>\r\n          <li>{t(translations.Excel_ISR2)}</li>\r\n        </ul>\r\n      </Box>\r\n      <Box style={{ margin: '10px' }}>\r\n        <Body bold={true}>{t(translations.CSVImportSpecificRequirements)}</Body>\r\n        <ul>\r\n          <li>{t(translations.CSV_ISR1)}</li>\r\n        </ul>\r\n      </Box>\r\n      <Box style={{ margin: '10px' }}>\r\n        <Body bold={true}>{t(translations.BulkCreateNewRecords)}</Body>\r\n        <ul>\r\n          <li>\r\n            <div style={{ display: 'flex', alignItems: 'center' }}>\r\n              {BulkCreateNewRecords[0]}\r\n              <Button\r\n                variant=\"text\"\r\n                onClick={() => {\r\n                  props.ImportTenplateHandler();\r\n                }}\r\n              >\r\n                {t(translations.Buli_CNR2)}\r\n              </Button>\r\n              {BulkCreateNewRecords[1]}\r\n            </div>\r\n          </li>\r\n        </ul>\r\n      </Box>\r\n      <Box style={{ margin: '10px' }}>\r\n        <Body bold={true}>{t(translations.UpdateExistingRecords)}</Body>\r\n        <ul>\r\n          <li>{t(translations.Update_ER1)}</li>\r\n          <li>{t(translations.Update_ER2)}</li>\r\n          <li>{t(translations.Update_ER3)}</li>\r\n        </ul>\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\n","import {\r\n  Box,\r\n  createStyles,\r\n  LinearProgress,\r\n  makeStyles,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { H2 } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\n\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    container: {\r\n      display: 'flex',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n    },\r\n  }),\r\n);\r\n\r\nexport interface PopupImportExportProgressProps {\r\n  title: string;\r\n  info: string;\r\n  buttonName: string;\r\n  onClick: () => void;\r\n}\r\nexport function PopupImportExportProgress(\r\n  props: PopupImportExportProgressProps,\r\n) {\r\n  const classes = useStyles();\r\n  return (\r\n    <>\r\n      <Box className={clsx(classes.root)}>\r\n        <Box style={{ height: '85%' }} className={clsx(classes.container)}>\r\n          <Box style={{ width: '40%', textAlign: 'center' }}>\r\n            <H2>{props.title}</H2>\r\n            <LinearProgress\r\n              style={{ marginTop: '10px', marginBottom: '10px' }}\r\n            />\r\n            {props.info}\r\n          </Box>\r\n        </Box>\r\n        <Box style={{ height: '15%' }} className={clsx(classes.container)}>\r\n          <Button variant=\"white\" onClick={props.onClick}>\r\n            <Icon icon=\"times\" size=\"xs\" style={{ marginRight: '5px' }} />\r\n            {props.buttonName}\r\n          </Button>\r\n        </Box>\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface NamePickerPrpps\r\n  extends Omit<AutocompletePickerProps<Entity<string>>, 'loadData'> {\r\n  names: Entity<string>[] | undefined;\r\n}\r\nexport function NamePicker(props: NamePickerPrpps) {\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={() =>\r\n        Promise.resolve(props.names !== undefined ? props.names : [])\r\n      }\r\n      variant=\"filled\"\r\n      fullWidth\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import {\r\n  createStyles,\r\n  makeStyles,\r\n  Table,\r\n  TableBody,\r\n  TableCell,\r\n  TableContainer,\r\n  TableHead,\r\n  TableRow,\r\n  Theme,\r\n  withStyles,\r\n} from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { NamePicker } from '../NamePicker';\r\n\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      height: '100%',\r\n      overflowX: 'auto',\r\n      overflowY: 'auto',\r\n    },\r\n    headerRow: {\r\n      height: 56,\r\n    },\r\n    tableRow: {\r\n      height: 40,\r\n    },\r\n  }),\r\n);\r\n\r\nconst StyledTableRow = withStyles(theme => ({\r\n  root: {\r\n    height: 40,\r\n  },\r\n}))(TableRow);\r\n\r\nexport interface HeaderColumnProps {\r\n  checked: boolean;\r\n  name: string;\r\n  cn: number;\r\n  onChange: (value: boolean, cn: number) => void;\r\n}\r\nexport function HeaderColumn(props: HeaderColumnProps) {\r\n  const [checked, setChecked] = React.useState<boolean>(props.checked);\r\n  const handleCheckChandge = React.useCallback(\r\n    (value: boolean, cn: number) => {\r\n      setChecked(value);\r\n      props.onChange(value, cn);\r\n    },\r\n    [props],\r\n  );\r\n  return (\r\n    <Box\r\n      style={{\r\n        width: '100%',\r\n        height: '100%',\r\n        display: 'flex',\r\n        alignItems: 'center',\r\n      }}\r\n    >\r\n      <Check\r\n        size=\"small\"\r\n        color=\"primary\"\r\n        onChange={(event, value) => {\r\n          handleCheckChandge(value, props.cn);\r\n        }}\r\n        checked={checked}\r\n      />\r\n      <Box\r\n        style={{\r\n          width: '100%',\r\n          height: '100%',\r\n          display: 'flex',\r\n          alignItems: 'center',\r\n          justifyContent: 'center',\r\n        }}\r\n      >\r\n        {props.name}\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\nexport interface HeaderColumnPickerProps {\r\n  names: Entity<string>[] | undefined;\r\n  value?: Entity<string> | null | undefined;\r\n  cn: number;\r\n  onChange: (value: Entity<string> | null | undefined, cn: number) => void;\r\n}\r\nexport function HeaderColumnPicker(props: HeaderColumnPickerProps) {\r\n  const [value, setValue] = React.useState<Entity<string> | null | undefined>(\r\n    props.value,\r\n  );\r\n  const [showPicker, setShowPicker] = React.useState<boolean>(true);\r\n  const handleValueChandge = React.useCallback(\r\n    (value: Entity<string> | null | undefined, cn: number) => {\r\n      setValue(value);\r\n      props.onChange(value, cn);\r\n      if (value !== null) {\r\n        setShowPicker(false);\r\n      }\r\n    },\r\n    [props],\r\n  );\r\n  return (\r\n    <>\r\n      {showPicker ? (\r\n        <NamePicker\r\n          value={value}\r\n          onChange={value => handleValueChandge(value, props.cn)}\r\n          names={props.names}\r\n        />\r\n      ) : (\r\n        <Box\r\n          style={{\r\n            width: '100%',\r\n            height: '100%',\r\n            display: 'flex',\r\n            alignItems: 'center',\r\n            justifyContent: 'center',\r\n          }}\r\n          onClick={() => {\r\n            setShowPicker(true);\r\n          }}\r\n        >\r\n          {value?.Name}\r\n        </Box>\r\n      )}\r\n    </>\r\n  );\r\n}\r\nexport interface BasicTableProps {\r\n  header1: JSX.Element[];\r\n  header2: JSX.Element[];\r\n  rows: string[][];\r\n}\r\n\r\nexport function BasicTable({ header1, header2, rows }: BasicTableProps) {\r\n  const classes = useStyles();\r\n  return (\r\n    <TableContainer className={classes.root}>\r\n      <Table aria-label=\"simple table\">\r\n        <TableHead>\r\n          <TableRow className={classes.headerRow}>\r\n            {header1.map(column => (\r\n              <TableCell>{column}</TableCell>\r\n            ))}\r\n          </TableRow>\r\n          {header2.length > 0 && (\r\n            <TableRow className={classes.headerRow}>\r\n              {header2.map(column => (\r\n                <TableCell>{column}</TableCell>\r\n              ))}\r\n            </TableRow>\r\n          )}\r\n        </TableHead>\r\n        <TableBody>\r\n          {rows.map((row, index) => (\r\n            <StyledTableRow key={index}>\r\n              {row.map(cell => (\r\n                <TableCell align=\"right\">{cell}</TableCell>\r\n              ))}\r\n            </StyledTableRow>\r\n          ))}\r\n        </TableBody>\r\n      </Table>\r\n    </TableContainer>\r\n  );\r\n}\r\n","import React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport clsx from 'clsx';\r\nimport { H3 } from 'app/components/Typography';\r\nimport { BasicTable, HeaderColumn, HeaderColumnPicker } from './Table';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ImprotData } from '../Data';\r\nimport { Entity } from 'types/common';\r\nimport { BasicToggle } from 'app/components/BasicToggle';\r\n//import { ImportColumn } from '../Actions/Types';\r\n//import { ValuePicker } from './ValuePicker';\r\n\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    titleContainer: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n    },\r\n    closeButton: {\r\n      position: 'absolute',\r\n      right: theme.spacing(3),\r\n      top: theme.spacing(3),\r\n      color: theme.palette.grey[500],\r\n    },\r\n    container: {\r\n      display: 'flex',\r\n    },\r\n    containerCenter: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n    },\r\n    boxcontainer: {\r\n      display: 'flex',\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    toggleBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      marginTop: '24px',\r\n    },\r\n    infoBox: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      marginTop: '24px',\r\n      padding: '10PX',\r\n      backgroundColor: '#f0f9ff',\r\n    },\r\n    border: {\r\n      borderStyle: 'solid',\r\n      borderColor: 'red',\r\n    },\r\n  }),\r\n);\r\nexport interface PopupImportExportStep3Props {\r\n  title: string;\r\n  backName: string;\r\n  nextName: string;\r\n  cancelName: string;\r\n  rows: number;\r\n  back: () => void;\r\n  next: () => void;\r\n  cancel: () => void;\r\n}\r\nexport function PopupImportExportStep3(props: PopupImportExportStep3Props) {\r\n  const classes = useStyles();\r\n  const [toggle1, setToggle1] = React.useState<boolean>(true);\r\n  const handleColumnCheckboxChange = React.useCallback(\r\n    (value: boolean, cn: number) => {\r\n      if (ImprotData.Header !== undefined) {\r\n        ImprotData.Header[cn].Include = value;\r\n      }\r\n    },\r\n    [],\r\n  );\r\n  const handleColumnPickerChange = React.useCallback(\r\n    (value: Entity<string> | null | undefined, cn: number) => {\r\n      if (ImprotData.Header !== undefined) {\r\n        ImprotData.Header[cn].Name = value?.Id;\r\n      }\r\n    },\r\n    [],\r\n  );\r\n  /*const getColumnValue = React.useCallback((column: ImportColumn) => {\r\n    if (column.ExcelName !== undefined) {\r\n      const v = ImprotData.TemplateColumns?.find(value => {\r\n        return value.Name === column.ExcelName;\r\n      });\r\n      return v;\r\n    } else {\r\n      return undefined;\r\n    }\r\n  }, []);*/\r\n  const handleToggleChange1 = React.useCallback((value: boolean) => {\r\n    setToggle1(value);\r\n  }, []);\r\n  return (\r\n    <>\r\n      <Box className={clsx(classes.root)}>\r\n        <Box style={{ height: '2%' }}>\r\n          <Box className={classes.titleContainer}>\r\n            <IconButton\r\n              variant=\"ghost\"\r\n              aria-label=\"close\"\r\n              className={classes.closeButton}\r\n              onClick={props.cancel}\r\n              size=\"small\"\r\n            >\r\n              <Icon icon=\"times\" />\r\n            </IconButton>\r\n            <H3>{props.title}</H3>\r\n          </Box>\r\n        </Box>\r\n        <Box style={{ height: '23%' }} className={clsx(classes.boxcontainer)}>\r\n          <Box style={{ width: '50%' }}>\r\n            <ToggleBox\r\n              rows={props.rows}\r\n              toggle1={toggle1}\r\n              handleToggleChange1={handleToggleChange1}\r\n            />\r\n          </Box>\r\n          <Box style={{ width: '50%' }}>\r\n            <InfoBox />\r\n          </Box>\r\n        </Box>\r\n        <Box style={{ height: '60%' }} className={clsx(classes.boxcontainer)}>\r\n          <BasicTable\r\n            header1={\r\n              ImprotData.Header !== undefined\r\n                ? ImprotData.Header.map((value, cn) => {\r\n                    return (\r\n                      <HeaderColumn\r\n                        checked={value.Include}\r\n                        name={\r\n                          value.ExcelName !== undefined ? value.ExcelName : ''\r\n                        }\r\n                        onChange={handleColumnCheckboxChange}\r\n                        cn={cn}\r\n                      />\r\n                    );\r\n                  })\r\n                : []\r\n            }\r\n            header2={\r\n              ImprotData.Header !== undefined && !toggle1\r\n                ? ImprotData.Header.map((value, cn) => {\r\n                    return (\r\n                      <HeaderColumnPicker\r\n                        names={ImprotData.TemplateColumns}\r\n                        //value={getColumnValue(value)}\r\n                        onChange={handleColumnPickerChange}\r\n                        cn={cn}\r\n                      />\r\n                    );\r\n                  })\r\n                : []\r\n            }\r\n            rows={ImprotData.Table !== undefined ? ImprotData.Table : []}\r\n          />\r\n        </Box>\r\n        <Box style={{ height: '15%', marginTop: '10px' }}>\r\n          <Box\r\n            style={{ height: '50%' }}\r\n            className={clsx(classes.containerCenter)}\r\n          >\r\n            {/*<ValuePicker\r\n              style={{ width: '25%' }}\r\n              value={undefined}\r\n              onChange={() => {}}\r\n              names={undefined}\r\n          />*/}\r\n            {/*<Button style={{ marginLeft: '10px' }} onClick={props.next}>\r\n              {props.nextName}\r\n          </Button>*/}\r\n          </Box>\r\n          <Box\r\n            style={{ height: '50%' }}\r\n            className={clsx(classes.containerCenter)}\r\n          >\r\n            <Button\r\n              variant=\"white\"\r\n              onClick={props.back}\r\n              style={{ marginLeft: '10px', marginRight: '10px' }}\r\n            >\r\n              {props.backName}\r\n            </Button>\r\n            <Button onClick={props.next}>{props.nextName}</Button>\r\n            <Button\r\n              variant=\"white\"\r\n              onClick={props.cancel}\r\n              style={{ marginLeft: '10px' }}\r\n            >\r\n              {props.cancelName}\r\n            </Button>\r\n          </Box>\r\n        </Box>\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n\r\ninterface ToggleBoxProps {\r\n  rows: number;\r\n  toggle1: boolean;\r\n  handleToggleChange1: (value: boolean) => void;\r\n}\r\nfunction ToggleBox(props: ToggleBoxProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const [toggle1, setToggle1] = React.useState<boolean>(props.toggle1);\r\n  const [toggle2, setToggle2] = React.useState<boolean>(true);\r\n  const classes = useStyles();\r\n  const rows = React.useMemo((): React.ReactNode => {\r\n    let s = t(translations.RecordsInTheFile);\r\n    s = s.replace('{0}', props.rows.toString());\r\n    return (\r\n      <>\r\n        <div>\r\n          <Body bold={true}> {s} </Body>\r\n        </div>\r\n      </>\r\n    );\r\n  }, [props.rows, t]);\r\n  const handleChange1 = React.useCallback(\r\n    (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => {\r\n      setToggle1(checked);\r\n      props.handleToggleChange1(checked);\r\n    },\r\n    [props],\r\n  );\r\n  const handleChange2 = React.useCallback(\r\n    (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => {\r\n      setToggle2(checked);\r\n      ImprotData.AddOnly = !checked;\r\n    },\r\n    [],\r\n  );\r\n  return (\r\n    <Box className={clsx(classes.toggleBox)}>\r\n      <Box style={{ margin: '10px' }}>\r\n        {rows}\r\n        <br />\r\n        <BasicToggle\r\n          name=\"checkedB\"\r\n          onChange={handleChange1}\r\n          defaultChecked={true}\r\n          checked={toggle1}\r\n          label={t(translations.FirstRowContainsColumnsName)}\r\n        />\r\n        <br />\r\n        <BasicToggle\r\n          name=\"checkedC\"\r\n          onChange={handleChange2}\r\n          defaultChecked={true}\r\n          checked={toggle2}\r\n          label={t(translations.UpdateAnyExistingRecords)}\r\n        />\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\ninterface InfoBoxProps {}\r\nfunction InfoBox(props: InfoBoxProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const classes = useStyles();\r\n  return (\r\n    <Box className={clsx(classes.infoBox)} style={{ width: '488px' }}>\r\n      <Box style={{ margin: '10px' }}>\r\n        <li>{t(translations.UncheckColumnIfYouDontWantItToBeImported)}</li>\r\n        <li>{t(translations.OnlyFirst5RowsOfTheFileAreDisplayedForPreview)}</li>\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\n","import { Box, createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport clsx from 'clsx';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ImportResult } from '../Actions/Types';\r\n\r\nexport const useStyles = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      width: '100%',\r\n      height: '100%',\r\n    },\r\n    container: {\r\n      display: 'flex',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n    },\r\n    containerRows: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      width: '300px',\r\n    },\r\n    row: {\r\n      display: 'flex',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n    },\r\n    rowData: {\r\n      display: 'flex',\r\n      width: '100%',\r\n      margin: '3px',\r\n    },\r\n    divider: {\r\n      backgroundColor: theme.palette.divider,\r\n    },\r\n    color: {\r\n      color: theme.palette.primary.main,\r\n    },\r\n  }),\r\n);\r\n\r\ninterface RowDataProps {\r\n  Name: string;\r\n  Value: string;\r\n}\r\n\r\nfunction RowData(props: RowDataProps) {\r\n  const classes = useStyles();\r\n  return (\r\n    <Box className={clsx(classes.rowData)}>\r\n      <Box style={{ flexGrow: 2, textAlign: 'left' }}> {props.Name} </Box>\r\n      <Box>\r\n        <Body bold={true}>{props.Value}</Body>\r\n      </Box>\r\n    </Box>\r\n  );\r\n}\r\nexport interface PopupImportExportStep5Props {\r\n  state: ImportResult;\r\n  newRows: number;\r\n  existingRows: number;\r\n  errors: number;\r\n  errorMessage?: string;\r\n  handleDownloadImportErrorReport: () => void;\r\n  onClick: () => void;\r\n}\r\nexport function PopupImportExportStep5(props: PopupImportExportStep5Props) {\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const content: React.ReactNode = React.useMemo((): React.ReactNode => {\r\n    switch (props.state) {\r\n      case ImportResult.success:\r\n        return (\r\n          <>\r\n            <Box className={clsx(classes.containerRows)}>\r\n              <Box style={{ display: 'flex', justifyContent: 'center' }}>\r\n                <Icon\r\n                  style={{ marginBottom: '20px' }}\r\n                  icon={['fas', 'check-circle']}\r\n                  color={'success'}\r\n                  size=\"3x\"\r\n                />\r\n              </Box>\r\n              <Box style={{ display: 'flex', justifyContent: 'center' }}>\r\n                <H4>{t(translations.ImportSuccessfullyCompleted)}</H4>\r\n              </Box>\r\n              <Box\r\n                style={{ marginTop: '20px' }}\r\n                className={clsx(classes.divider)}\r\n                height={2}\r\n              ></Box>\r\n              <RowData\r\n                Name={t(translations.NewRecordsImported)}\r\n                Value={props.newRows.toString()}\r\n              />\r\n              <RowData\r\n                Name={t(translations.ExistingRecordsUpdated)}\r\n                Value={props.existingRows.toString()}\r\n              />\r\n              <RowData\r\n                Name={t(translations.ErrorsDuringImport)}\r\n                Value={props.errors.toString()}\r\n              />\r\n              <Box className={clsx(classes.row)} style={{ marginTop: '10px' }}>\r\n                <Box>\r\n                  <IconButton\r\n                    onClick={() => props.handleDownloadImportErrorReport()}\r\n                    title={t(translations.DownloadImportErrorReport)}\r\n                    variant=\"ghost\"\r\n                    shape=\"square\"\r\n                    aria-label=\"close\"\r\n                    size=\"small\"\r\n                    style={{ width: '100%' }}\r\n                  >\r\n                    <Icon icon=\"download\" color=\"primary\" />\r\n                    <Box className={clsx(classes.color)}>\r\n                      {t(translations.DownloadDetailedImportResults)}\r\n                    </Box>\r\n                  </IconButton>\r\n                </Box>\r\n              </Box>\r\n            </Box>\r\n          </>\r\n        );\r\n      case ImportResult.error:\r\n        return (\r\n          <>\r\n            <Box className={clsx(classes.containerRows)}>\r\n              <Box style={{ display: 'flex', justifyContent: 'center' }}>\r\n                <Icon\r\n                  style={{ marginBottom: '20px' }}\r\n                  icon={['fas', 'exclamation-circle']}\r\n                  color={'accent'}\r\n                  size=\"3x\"\r\n                />\r\n              </Box>\r\n              <Box style={{ display: 'flex', justifyContent: 'center' }}>\r\n                <H4>{t(translations.ImportCompletedWithErrors)}</H4>\r\n              </Box>\r\n              <Box\r\n                style={{ marginTop: '20px' }}\r\n                className={clsx(classes.divider)}\r\n                height={2}\r\n              ></Box>\r\n              <RowData\r\n                Name={t(translations.NewRecordsImported)}\r\n                Value={props.newRows.toString()}\r\n              />\r\n              <RowData\r\n                Name={t(translations.ExistingRecordsUpdated)}\r\n                Value={props.existingRows.toString()}\r\n              />\r\n              <RowData\r\n                Name={t(translations.ErrorsDuringImport)}\r\n                Value={props.errors.toString()}\r\n              />\r\n              <Box className={clsx(classes.row)} style={{ marginTop: '10px' }}>\r\n                <Box>\r\n                  <IconButton\r\n                    onClick={() => props.handleDownloadImportErrorReport()}\r\n                    title={t(translations.DownloadImportErrorReport)}\r\n                    variant=\"ghost\"\r\n                    shape=\"square\"\r\n                    aria-label=\"close\"\r\n                    size=\"small\"\r\n                    style={{ width: '100%' }}\r\n                  >\r\n                    <Icon icon=\"download\" color=\"primary\" />\r\n                    <Box className={clsx(classes.color)}>\r\n                      {t(translations.DownloadImportErrorReport)}\r\n                    </Box>\r\n                  </IconButton>\r\n                </Box>\r\n              </Box>\r\n            </Box>\r\n          </>\r\n        );\r\n      case ImportResult.failed:\r\n        return (\r\n          <>\r\n            <Box className={clsx(classes.containerRows)}>\r\n              <Box style={{ display: 'flex', justifyContent: 'center' }}>\r\n                <Icon\r\n                  style={{ marginBottom: '20px' }}\r\n                  icon={['fas', 'times-circle']}\r\n                  color={'danger'}\r\n                  size=\"3x\"\r\n                />\r\n              </Box>\r\n              <Box style={{ display: 'flex', justifyContent: 'center' }}>\r\n                <H4>{t(translations.ImportHasFailed)}</H4>\r\n              </Box>\r\n              <Box\r\n                style={{ marginTop: '20px' }}\r\n                className={clsx(classes.divider)}\r\n                height={2}\r\n              ></Box>\r\n              <Box>{t(translations.ImportErrorFailedMessage)}</Box>\r\n              {props.errorMessage !== undefined && (\r\n                <Box style={{ marginTop: '10px' }}>\r\n                  {t(translations.ImportAdditionalDetails)}:{' '}\r\n                  {props.errorMessage}\r\n                </Box>\r\n              )}\r\n            </Box>\r\n          </>\r\n        );\r\n      case ImportResult.default:\r\n        return (\r\n          <>\r\n            <Icon\r\n              icon={['fas', 'question-circle']}\r\n              color={'default'}\r\n              size=\"3x\"\r\n            />\r\n          </>\r\n        );\r\n      default:\r\n        return (\r\n          <>\r\n            <Icon\r\n              icon={['fas', 'question-circle']}\r\n              color={'default'}\r\n              size=\"3x\"\r\n            />\r\n          </>\r\n        );\r\n    }\r\n  }, [\r\n    classes.color,\r\n    classes.containerRows,\r\n    classes.divider,\r\n    classes.row,\r\n    props,\r\n    t,\r\n  ]);\r\n  return (\r\n    <>\r\n      <Box className={clsx(classes.root)}>\r\n        <Box style={{ height: '85%' }} className={clsx(classes.container)}>\r\n          {content}\r\n        </Box>\r\n        <Box style={{ height: '15%' }} className={clsx(classes.container)}>\r\n          <Button variant=\"main\" onClick={props.onClick}>\r\n            {t(translations.ImportBackToPage)}\r\n          </Button>\r\n        </Box>\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n","import React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { PopupImportExportDialog } from './Components/Dialog';\r\nimport { PopupImportExportStep1 } from './Components/step1';\r\nimport { PopupImportExportProgress } from './Components/step2_4';\r\nimport { PopupImportExportStep3 } from './Components/step3';\r\nimport { PopupImportExportStep5 } from './Components/step5';\r\nimport { ImprotData } from './Data';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { GenericImport } from './Actions/Import';\r\nimport { ImportAdditionalData, ImportResult } from './Actions/Types';\r\nimport fileDownload from 'js-file-download';\r\nimport { ExportImportActions } from './Actions';\r\nimport { Entity } from 'types/common';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useDispatch } from 'react-redux';\r\n\r\n/**\r\n *\r\n * PopupExportImport\r\n *\r\n */\r\nexport interface PopupImportExportProps {\r\n  title: string;\r\n  show: boolean;\r\n  screenId: ScreensId;\r\n  budgetType?: number;\r\n  iad?: ImportAdditionalData;\r\n  close: () => void;\r\n}\r\nexport function PopupImportExport({\r\n  title,\r\n  show,\r\n  screenId,\r\n  budgetType,\r\n  iad,\r\n  close,\r\n}: PopupImportExportProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const [step, setStep] = React.useState<number>(0);\r\n  const [rows, setRows] = React.useState<number>(0);\r\n  const [columns, setColumns] = React.useState<number>(0);\r\n  const [filetype, setFiletype] = React.useState<Entity<string> | null>({\r\n    Id: '.xlsx',\r\n    Name: '.xlsx',\r\n  });\r\n  const [importResult, setImportResult] = React.useState<ImportResult>(\r\n    ImportResult.default,\r\n  );\r\n  const [resultData, setResultData] = React.useState<any | undefined>();\r\n  const [resultFileName, setResultFileName] = React.useState<\r\n    string | undefined\r\n  >();\r\n  const [newRows, setNewRows] = React.useState<number>(0);\r\n  const [existingRows, setExistingRows] = React.useState<number>(0);\r\n  const [errors, setErrors] = React.useState<number>(0);\r\n  const [errorMessage, setErrorMessage] = React.useState<string | undefined>();\r\n  React.useEffect(() => {\r\n    ImprotData.ClearImages();\r\n    ImprotData.ScreenId = screenId;\r\n    ImprotData.ImportAdditionalData =\r\n      iad !== undefined ? iad : ImportAdditionalData.none;\r\n  }, [iad, screenId]);\r\n  const cancel = React.useCallback(() => {\r\n    setRows(0);\r\n    setColumns(0);\r\n    setResultData(undefined);\r\n    setStep(0);\r\n    ImprotData.ClearImages();\r\n    close();\r\n  }, [close]);\r\n  const cancelFileUpload = React.useCallback(() => {\r\n    cancel();\r\n  }, [cancel]);\r\n  const cancelImport = React.useCallback(() => {\r\n    cancel();\r\n  }, [cancel]);\r\n  const back = React.useCallback(() => {\r\n    if (step > 1) {\r\n      setStep(step - 2);\r\n    }\r\n  }, [step]);\r\n  /*const delay = delayInms => {\r\n    return new Promise(resolve => setTimeout(resolve, delayInms));\r\n  };*/\r\n  const handleFileTypeChange = React.useCallback(\r\n    (value: Entity<string> | null) => {\r\n      setFiletype(value);\r\n    },\r\n    [],\r\n  );\r\n  const ImportTenplateHandler = React.useCallback(async () => {\r\n    const res = await ExportImportActions.ImportTemplate(\r\n      screenId,\r\n      filetype !== null ? filetype.Name : '.xlsx',\r\n      iad,\r\n    );\r\n    const cd = res.headers['content-disposition'];\r\n    const filename =\r\n      cd !== undefined\r\n        ? cd.split('filename=')[1]\r\n        : 'template' + (filetype !== null ? filetype.Name : '');\r\n    fileDownload(res.data, filename);\r\n  }, [filetype, iad, screenId]);\r\n  const next = React.useCallback(async () => {\r\n    switch (step) {\r\n      case 0:\r\n        setStep(1);\r\n        const res = await ImprotData.LoadExcelfile();\r\n        if (res !== undefined) {\r\n          setRows(ImprotData.RowCount !== undefined ? ImprotData.RowCount : 0);\r\n          const cc = await ImprotData.LoadTemplateColumns();\r\n          if (cc !== undefined) {\r\n            ImprotData.SetTemplateColumns(cc);\r\n          }\r\n          //await delay(5000);\r\n          setStep(2);\r\n        } else {\r\n          setStep(0);\r\n        }\r\n        break;\r\n      case 1:\r\n        break;\r\n      case 2:\r\n        setColumns(ImprotData.ColumnCount());\r\n        setStep(3);\r\n        const importFileResult = await GenericImport(ImprotData.File, {\r\n          ScreenId: screenId,\r\n          Columns: ImprotData.Header !== undefined ? ImprotData.Header : [],\r\n          BudgetType: budgetType ?? 1,\r\n          AddOnly: ImprotData.AddOnly ?? false,\r\n          Iad: iad ?? ImportAdditionalData.none,\r\n          ImportAssetImageFiles: ImprotData.ImportAssetImageFiles,\r\n          AutoGenerateAssetNamesBasedOn:\r\n            ImprotData.AutoGenerateAssetNamesBasedOn?.Id,\r\n          UpdateQRCode: ImprotData.UpdateQRCode,\r\n        });\r\n        //await delay(5000);\r\n        setResultData(\r\n          importFileResult !== undefined\r\n            ? importFileResult.resultData\r\n            : undefined,\r\n        );\r\n        setResultFileName(\r\n          importFileResult !== undefined\r\n            ? importFileResult.resultFileName\r\n            : undefined,\r\n        );\r\n        setImportResult(\r\n          importFileResult !== undefined\r\n            ? importFileResult.importResult\r\n            : ImportResult.default,\r\n        );\r\n        setErrorMessage(\r\n          importFileResult !== undefined\r\n            ? importFileResult.errorMessage\r\n            : undefined,\r\n        );\r\n        setNewRows(\r\n          importFileResult !== undefined\r\n            ? importFileResult.NewRecordsImported\r\n            : 0,\r\n        );\r\n        setExistingRows(\r\n          importFileResult !== undefined\r\n            ? importFileResult.ExistingRecordsUpdated\r\n            : 0,\r\n        );\r\n        setErrors(\r\n          importFileResult !== undefined ? importFileResult.ImportErrors : 0,\r\n        );\r\n        dispatch(actions.setRefreshTable(true));\r\n        setStep(4);\r\n        break;\r\n      case 3:\r\n        break;\r\n      case 4:\r\n        break;\r\n      default:\r\n    }\r\n  }, [actions, budgetType, dispatch, iad, screenId, step]);\r\n  const handleDownloadImportErrorReport = React.useCallback(() => {\r\n    if (\r\n      resultData !== undefined &&\r\n      resultFileName !== undefined &&\r\n      resultFileName !== ''\r\n    ) {\r\n      fileDownload(resultData, resultFileName);\r\n      setResultData(undefined);\r\n    }\r\n  }, [resultData, resultFileName]);\r\n  const steps = React.useMemo((): React.ReactNode[] => {\r\n    return [\r\n      <PopupImportExportStep1\r\n        title={title}\r\n        filetype={filetype}\r\n        nextName={t(translations.Next)}\r\n        cancelName={t(translations.Cancel)}\r\n        ImportTenplateHandler={ImportTenplateHandler}\r\n        handleFileTypeChange={handleFileTypeChange}\r\n        next={next}\r\n        cancel={cancel}\r\n      />,\r\n      <PopupImportExportProgress\r\n        title={t(translations.UploadingFile)}\r\n        buttonName={t(translations.CancelFileUpload)}\r\n        info={rows.toString() + ' ' + t(translations.RowsFound)}\r\n        onClick={cancelFileUpload}\r\n      />,\r\n      <PopupImportExportStep3\r\n        title={title}\r\n        backName={t(translations.Back)}\r\n        nextName={t(translations.Next)}\r\n        cancelName={t(translations.Cancel)}\r\n        rows={rows}\r\n        back={back}\r\n        next={next}\r\n        cancel={cancel}\r\n      />,\r\n      <PopupImportExportProgress\r\n        title={t(translations.ImportingData)}\r\n        buttonName={t(translations.CancelImport)}\r\n        info={\r\n          rows.toString() +\r\n          ' ' +\r\n          t(translations.ImportRowsFor) +\r\n          ' ' +\r\n          columns.toString() +\r\n          ' ' +\r\n          t(translations.ImportColumns)\r\n        }\r\n        onClick={cancelImport}\r\n      />,\r\n      <PopupImportExportStep5\r\n        state={importResult}\r\n        newRows={newRows}\r\n        existingRows={existingRows}\r\n        errors={errors}\r\n        errorMessage={errorMessage}\r\n        handleDownloadImportErrorReport={handleDownloadImportErrorReport}\r\n        onClick={cancelFileUpload}\r\n      />,\r\n    ];\r\n  }, [\r\n    ImportTenplateHandler,\r\n    back,\r\n    cancel,\r\n    cancelFileUpload,\r\n    cancelImport,\r\n    columns,\r\n    errorMessage,\r\n    errors,\r\n    existingRows,\r\n    filetype,\r\n    handleDownloadImportErrorReport,\r\n    handleFileTypeChange,\r\n    importResult,\r\n    newRows,\r\n    next,\r\n    rows,\r\n    t,\r\n    title,\r\n  ]);\r\n  return (\r\n    <>\r\n      <PopupImportExportDialog open={show} content={steps[step]} />\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * LoanableFilter\r\n *\r\n */\r\nimport { CampusPicker } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const CampusFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <CampusPicker\r\n      onChange={handleOnChange}\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      size=\"small\"\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n      urlType={props.urlType}\r\n      withoutServiceGroups={props.withoutServiceGroups}\r\n    />\r\n  );\r\n};\r\n\r\nexport default CampusFilter;\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ServiceUserGroupPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<string>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ServiceUserGroupFilter';\r\nexport const initServiceUserGroupData = (initval: string) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: new Condition<Entity<string>>(\r\n      'Id',\r\n      ODataOperators.Equals,\r\n      initval,\r\n    ).toString(),\r\n    $select: 'Id,Name',\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\nconst loadData = (\r\n  searchTerm: string | null,\r\n  predicates?: (string | Condition<Entity<string>>)[],\r\n) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null || (predicates && predicates.length > 0)) {\r\n    params.$filter = new ODataFilterBuilder<Entity<string>>({\r\n      predicates: predicates ?? [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm ?? '',\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\nexport function ServiceUserGroupPicker(props: ServiceUserGroupPickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      id={props.id || 'serviceusergroupId'}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n  BaseURLMultiPicker,\r\n  BaseURLMultiPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLMultiPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface UserGroupMultiPickerProps\r\n  extends Omit<BaseURLMultiPickerProps<string>, 'url'> {}\r\n\r\nconst url = '/api/odata/v4/UserGroupFilter';\r\n\r\nexport const initUserGroupMultiData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return Promise.resolve([] as Entity<string>[]);\r\n  }\r\n  const ids = initval.split('|');\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n  } = {\r\n    $orderby: 'Id asc',\r\n    $filter: '(Id in (' + ids.map(v => \"'\" + v + \"'\").join(',') + '))',\r\n    $select: 'Id,Name',\r\n    $top: ids.length,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\n\r\nexport const UserGroupMultiPicker = (props: UserGroupMultiPickerProps) => {\r\n  return <BaseURLMultiPicker url={url} {...props} />;\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { put, select, takeLatest } from 'redux-saga/effects';\r\nimport { publicAssetActions as actions } from '.';\r\nimport { BrowseByUnitItemDto } from './types';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { selectRouterSearchParams } from 'app/slice/router-selectors';\r\n\r\nfunction* dosetSelectedItem(\r\n  action: PayloadAction<{\r\n    item: BrowseByUnitItemDto | undefined;\r\n    search: string;\r\n    init?: boolean;\r\n  }>,\r\n) {\r\n  const path = '/Assets/Public';\r\n  const currentSearch = new URLSearchParams(action.payload.search);\r\n\r\n  if (!action.payload.init) {\r\n    yield put(\r\n      routerActions.push({ pathname: path, search: currentSearch.toString() }),\r\n    );\r\n  }\r\n  yield put(actions.setSelectedItem_Success(action.payload));\r\n}\r\nfunction* dosetSelectedItems(\r\n  action: PayloadAction<{\r\n    items: BrowseByUnitItemDto[];\r\n    search: string;\r\n    init?: boolean;\r\n  }>,\r\n) {\r\n  const path = '/Assets/Public';\r\n  const currentSearch = new URLSearchParams(action.payload.search);\r\n  //const newSearch = getSearchFromItems(action.payload.items, currentSearch);\r\n  if (!action.payload.init) {\r\n    yield put(\r\n      routerActions.push({ pathname: path, search: currentSearch.toString() }),\r\n    );\r\n  }\r\n\r\n  yield put(actions.setSelectedItems_Success(action.payload));\r\n}\r\nfunction* dosetAssetPublicFilters(\r\n  action: PayloadAction<Record<string, any> | undefined>,\r\n) {\r\n  const currentSearch = yield select(selectRouterSearchParams);\r\n\r\n  const path = '/Assets/Public';\r\n  const newSearch = !!action.payload\r\n    ? toQueryString(action.payload)\r\n    : currentSearch;\r\n  for (const key of newSearch.keys()) {\r\n    if ((currentSearch as URLSearchParams).has(key)) {\r\n      const filterValue = newSearch.get(key);\r\n      if (filterValue !== null) {\r\n        let currValue = currentSearch.get(key);\r\n        if (filterValue !== currValue) {\r\n          currentSearch.set(key, filterValue);\r\n        }\r\n      } else {\r\n        currentSearch.delete(key);\r\n      }\r\n    } else {\r\n      const filterValue = newSearch.get(key);\r\n      if (filterValue !== null) {\r\n        currentSearch.set(key, filterValue);\r\n      }\r\n    }\r\n  }\r\n  yield put(\r\n    routerActions.push({\r\n      pathname: path,\r\n      search: currentSearch.toString(),\r\n    }),\r\n  );\r\n  yield put(actions.setAssetPublicFilters_success(action.payload));\r\n}\r\nexport function* publicAssetSaga() {\r\n  yield takeLatest(actions.setSelectedItem.type, dosetSelectedItem);\r\n  yield takeLatest(actions.setSelectedItems.type, dosetSelectedItems);\r\n  yield takeLatest(actions.setAssetPublicFilters.type, dosetAssetPublicFilters);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { publicAssetSaga } from './saga';\r\nimport { BrowseByUnitItemDto, PublicAssetState } from './types';\r\n\r\nexport const initialState: PublicAssetState = {\r\n  processing: false,\r\n  error: undefined,\r\n  data: undefined,\r\n  selectedData: [],\r\n  dataSearch: undefined,\r\n  filters: undefined,\r\n  menuOpen: undefined,\r\n  globalSearchOpen: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'publicAsset',\r\n  initialState,\r\n  reducers: {\r\n    setSelectedItem(\r\n      state,\r\n      action: PayloadAction<{\r\n        item: BrowseByUnitItemDto | undefined;\r\n        search: string;\r\n        init?: boolean;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.error = undefined;\r\n    },\r\n    setSelectedItem_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        item: BrowseByUnitItemDto | undefined;\r\n        search: string;\r\n        init?: boolean;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.error = undefined;\r\n      state.data = action.payload.item;\r\n      if (!action.payload.init) {\r\n        state.dataSearch = action.payload.search;\r\n      }\r\n    },\r\n    setSelectedItems(\r\n      state,\r\n      action: PayloadAction<{\r\n        items: BrowseByUnitItemDto[];\r\n        search: string;\r\n        init?: boolean;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.error = undefined;\r\n    },\r\n    setSelectedItems_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        items: BrowseByUnitItemDto[];\r\n        search: string;\r\n        init?: boolean;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.error = undefined;\r\n      state.selectedData = action.payload.items;\r\n      if (!action.payload.init) {\r\n        state.dataSearch = action.payload.search;\r\n      }\r\n    },\r\n    setAssetPublicFilters(\r\n      state,\r\n      action: PayloadAction<Record<string, any> | undefined>,\r\n    ) {},\r\n    setAssetPublicFilters_success(\r\n      state,\r\n      action: PayloadAction<Record<string, any> | undefined>,\r\n    ) {\r\n      state.filters = action.payload;\r\n    },\r\n    setMenuOpen(state, action: PayloadAction<boolean | undefined>) {\r\n      state.menuOpen = action.payload;\r\n    },\r\n    toggleMenuOpen(state, action: PayloadAction) {\r\n      state.menuOpen = !state.menuOpen;\r\n    },\r\n    setGlobalSearchOpen(state, action: PayloadAction<boolean | undefined>) {\r\n      state.globalSearchOpen = action.payload;\r\n    },\r\n    toggleGlobalSearchOpen(state, action: PayloadAction) {\r\n      state.globalSearchOpen = !state.globalSearchOpen;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: publicAssetActions } = slice;\r\n\r\nexport const usePublicAssetSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: publicAssetSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = usePublicAssetSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","/**\r\n *\r\n * InvoiceRowReferenceLinks\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Tooltip } from '../BasicTooltips/Tooltip';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { ReservationEditButton } from '../ReservationEditButton';\r\nimport { OtherServiceEditLink } from 'app/pages/OtherServiceDetails/OtherServiceDetailsPage';\r\nimport { GetServiceRequestDetailsPath } from 'app/pages/Samples/RequestSamplesPage/slice/path';\r\n\r\nexport interface InvoiceRowReferenceLinksProps {\r\n  ReservationId: number | null;\r\n  UsageId: number | null;\r\n  OfflineServiceId: number | null;\r\n  ServiceRequestId: number | null;\r\n  SubscriptionId: number | null;\r\n  useSidePanel: boolean;\r\n}\r\n\r\nexport function InvoiceRowReferenceLinks(props: InvoiceRowReferenceLinksProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  let references: Array<{\r\n    id: number | null;\r\n    link: string;\r\n    title: string;\r\n    target?: string;\r\n  }> = [];\r\n\r\n  if (props.UsageId)\r\n    references.push({\r\n      id: props.UsageId,\r\n      link: '/UsageDetails.aspx?id=' + props.UsageId,\r\n      title: t(translations.menu_UsageDetails) as string,\r\n      target: '_blank',\r\n    });\r\n\r\n  if (props.ServiceRequestId)\r\n    references.push({\r\n      id: props.ServiceRequestId,\r\n      link: GetServiceRequestDetailsPath(props.ServiceRequestId),\r\n      title: t(translations.ServiceRequestDetails) as string,\r\n      target: undefined,\r\n    });\r\n\r\n  if (props.SubscriptionId)\r\n    references.push({\r\n      id: props.SubscriptionId,\r\n      link: '/Invoices/Subscriptions/Edit.aspx?id=' + props.SubscriptionId,\r\n      title: t(translations.SubscriptionDetails) as string,\r\n      target: '_blank',\r\n    });\r\n\r\n  let result = references.map((item, i) => {\r\n    return (\r\n      <React.Fragment key={i}>\r\n        <Tooltip title={item.title} arrow>\r\n          <span>\r\n            <Link href={item.link} target={item.target}>\r\n              {item.id}\r\n            </Link>\r\n          </span>\r\n        </Tooltip>\r\n        <br />\r\n      </React.Fragment>\r\n    );\r\n  });\r\n  return (\r\n    <>\r\n      {props.ReservationId !== null && (\r\n        <ReservationEditButton\r\n          variant=\"text\"\r\n          reservationId={props.ReservationId}\r\n          useSidePanel={props.useSidePanel}\r\n        />\r\n      )}\r\n      {props.OfflineServiceId !== null && (\r\n        <OtherServiceEditLink\r\n          id={props.OfflineServiceId}\r\n          useSidePanel={props.useSidePanel}\r\n        />\r\n      )}\r\n      {result}\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { LocationPicker } from '../pickers/AutocompletePickers/LocationPicker';\r\nimport { ILocationListDto } from 'api/odata/generated/entities/ILocationListDto';\r\n\r\nexport const FormLocationPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & {\r\n  label?: string;\r\n  fullWidth: boolean;\r\n  autoFocus?: boolean;\r\n  name: string;\r\n  placeholder: string;\r\n  disabled?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n}) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <LocationPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value as ILocationListDto}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n        variant={props.variant}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * PopupImport\r\n *\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button, ButtonProps } from '../BasicButtons/Button';\r\nimport { DialogConfirm } from '../DialogConfirm';\r\nimport { InfoIcon } from '../InfoIcon';\r\nimport parse from 'html-react-parser';\r\n\r\nimport { uniqueId } from 'lodash';\r\nimport BasicTypography from '../Typography/BasicTypography';\r\n\r\nexport interface PopupImportProps\r\n  extends Pick<ButtonProps, 'size' | 'variant'> {\r\n  onImportButtonClick: () => void;\r\n  onDownloadTemplateButtonClick?: () => Promise<void>;\r\n  onConfirm: (event, file: any) => void;\r\n  onCancel: () => void;\r\n  processing: boolean;\r\n  open: boolean;\r\n  title?: string;\r\n  accept: '.xlsx' | '.xls' | '.csv';\r\n  disabled?: boolean;\r\n  hideImportButton?: boolean;\r\n  hideMessage?: boolean;\r\n}\r\n\r\nexport function PopupImport(props: PopupImportProps) {\r\n  const { t } = useTranslation();\r\n  const ref = React.useRef<HTMLInputElement>(null);\r\n  const handleConfirm = event => {\r\n    const file = ref.current?.files?.[0];\r\n    if (file !== undefined) {\r\n      props.onConfirm(event, file);\r\n    }\r\n  };\r\n  const [\r\n    downloadTemplateprocessing,\r\n    setDownloadTemplateProcessing,\r\n  ] = React.useState<boolean>(false);\r\n  const [fileId] = React.useState(uniqueId('import-file-'));\r\n  const [buttonId] = React.useState(uniqueId('import-file-'));\r\n  return (\r\n    <>\r\n      {props.hideImportButton === undefined ||\r\n        (props.hideImportButton === false && (\r\n          <Button\r\n            disabled={props.disabled}\r\n            onClick={props.onImportButtonClick}\r\n            size={props.size}\r\n            variant={props.variant}\r\n          >\r\n            {t(translations.Import)}\r\n          </Button>\r\n        ))}\r\n      <DialogConfirm\r\n        onConfirm={handleConfirm}\r\n        processing={props.processing}\r\n        onCancel={props.onCancel}\r\n        isOpen={props.open}\r\n        confirmButtonLabel={t(translations.Import)}\r\n        title={props.title ?? t(translations.ImportRecords)}\r\n        body={\r\n          <>\r\n            {props.onDownloadTemplateButtonClick !== undefined && (\r\n              <BasicTypography>\r\n                {t(translations.ImportRecordsDescription)}\r\n                <InfoIcon title={parse(t(translations.ImportRecordsSteps))} />\r\n              </BasicTypography>\r\n            )}\r\n            {props.onDownloadTemplateButtonClick !== undefined && (\r\n              <BasicTypography>\r\n                <label htmlFor={buttonId}>\r\n                  {t(translations.ToImportNewRecords)}:\r\n                </label>\r\n                &emsp;\r\n                <Button\r\n                  id={buttonId}\r\n                  onClick={async () => {\r\n                    if (props.onDownloadTemplateButtonClick !== undefined) {\r\n                      setDownloadTemplateProcessing(true);\r\n                      await props.onDownloadTemplateButtonClick();\r\n                      setDownloadTemplateProcessing(false);\r\n                    }\r\n                  }}\r\n                  processing={downloadTemplateprocessing}\r\n                >\r\n                  {t(translations.DownloadTemplate)}\r\n                </Button>\r\n              </BasicTypography>\r\n            )}\r\n            <BasicTypography>\r\n              {props.hideMessage === undefined ||\r\n                (props.hideMessage === false && (\r\n                  <label htmlFor={fileId}>\r\n                    {t(translations.UploadTheUpdatedFile)}:\r\n                  </label>\r\n                ))}\r\n              &emsp;\r\n              <input\r\n                id={fileId}\r\n                type=\"file\"\r\n                name=\"file\"\r\n                ref={ref}\r\n                accept={props.accept}\r\n              />\r\n            </BasicTypography>\r\n          </>\r\n        }\r\n      />\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * TagsFilter\r\n *\r\n */\r\nimport { TagsPicker } from 'app/components/pickers/AutocompletePickers/TagsPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const TagsFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <TagsPicker\r\n      value={props.value ?? []}\r\n      onChange={handleOnChange}\r\n      size=\"small\"\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      filterSelectedOptions\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\nexport default TagsFilter;\r\n","/**\r\n *\r\n * LoanableFilter\r\n *\r\n */\r\nimport { LoanablePicker } from 'app/components/pickers/AutocompletePickers/LoanablePicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const LoanableFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <LoanablePicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default LoanableFilter;\r\n","/**\r\n *\r\n * StatusFilter\r\n *\r\n */\r\nimport { StatusPicker } from 'app/components/pickers/AutocompletePickers/StatusPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const StatusFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <StatusPicker\r\n      value={props.value as Entity<number> | undefined}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      size=\"small\"\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default StatusFilter;\r\n","/**\r\n *\r\n * LockersFilter\r\n *\r\n */\r\nimport { LockersPicker } from 'app/components/pickers/AutocompletePickers/LockersPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const LockersFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <LockersPicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default LockersFilter;\r\n","/**\r\n *\r\n * AssemblyTypePicker\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { AssemblyTypePicker } from 'app/components/pickers/StaticOptionsPickers/AssemblyTypePicker';\r\n\r\nexport const AssetTypesFilter = (props: IFilterComponentProps): JSX.Element => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  //RENDER\r\n  const { t } = useTranslation();\r\n  return (\r\n    <AssemblyTypePicker\r\n      value={props.value as Entity<number> | undefined}\r\n      onChange={handleOnChange}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      size=\"small\"\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n    />\r\n  );\r\n};\r\n\r\nexport default AssetTypesFilter;\r\n","/**\r\n *\r\n * AreasFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { AreasPicker } from 'app/components/pickers/AutocompletePickers/AreassPicker';\r\n\r\nexport const AreasFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      <AreasPicker\r\n        ariaLabel={props.label}\r\n        id={props.id}\r\n        value={props.value as Entity<number> | undefined}\r\n        size=\"small\"\r\n        onChange={handleOnChange}\r\n        isOpen={props.open}\r\n        placeholder={t(translations.AllValues)}\r\n      />\r\n    </>\r\n  );\r\n};\r\nexport default AreasFilter;\r\n","/**\r\n *\r\n * OnlineServiceTypeFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { OnlineServiceTypePicker } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\n\r\nexport const OnlineServiceTypeFilter = (\r\n  props: IFilterComponentProps,\r\n): JSX.Element => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  //RENDER\r\n  const { t } = useTranslation();\r\n  return (\r\n    <OnlineServiceTypePicker\r\n      value={props.value as Entity<number> | undefined}\r\n      onChange={handleOnChange}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n    />\r\n  );\r\n};\r\n\r\nexport default OnlineServiceTypeFilter;\r\n","/**\r\n *\r\n * MyAssetAvailabilityTypeMultiFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { MyAssetAvailabilityTypeMultiPicker } from 'app/components/pickers/AutocompletePickers/MyAssetAvailabilityTypeMultiPicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\n\r\nexport const MyAssetAvailabilityTypeMultiFilter = (\r\n  props: IFilterComponentProps,\r\n) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <MyAssetAvailabilityTypeMultiPicker\r\n      isOpen={props.open}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      placeholder={t(translations.AllValues)}\r\n      value={props.value}\r\n      size=\"small\"\r\n      onChange={handleOnChange}\r\n      urlType={props.urlType}\r\n      filterSelectedOptions\r\n    />\r\n  );\r\n};\r\nexport const AvailabilityTypeAvailableMultiFilter = (\r\n  props: IFilterComponentProps,\r\n) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <MyAssetAvailabilityTypeMultiPicker\r\n      isOpen={props.open}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      value={props.value}\r\n      urlType={props.urlType}\r\n      predicates={[\r\n        `${new Condition('Id', ODataOperators.Excludes, [\r\n          { Id: AvailabilityTypes.NotAvailable as number },\r\n          { Id: AvailabilityTypes.AvailableNotBookable as number },\r\n        ]).toString()}`,\r\n      ]}\r\n      onChange={handleOnChange}\r\n      filterSelectedOptions\r\n    />\r\n  );\r\n};\r\nexport const AvailabilityTypeAvailableOnlineMultiFilter = (\r\n  props: IFilterComponentProps,\r\n) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <MyAssetAvailabilityTypeMultiPicker\r\n      isOpen={props.open}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n      placeholder={t(translations.AllValues)}\r\n      value={props.value}\r\n      urlType=\"onlineServices\"\r\n      onChange={handleOnChange}\r\n      filterSelectedOptions\r\n    />\r\n  );\r\n};\r\nexport default MyAssetAvailabilityTypeMultiFilter;\r\n","/**\r\n *\r\n * TrainingStatePicker\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { TrainingState } from 'enums/TrainingState';\r\n\r\nexport interface TrainingStatePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nexport function TrainingStatePicker(props: TrainingStatePickerProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const loadData = () => {\r\n    const options = enumToEntityArray(TrainingState, t);\r\n    return Promise.resolve<Entity<number>[]>(options);\r\n  };\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      {...props}\r\n      id={props.id || 'TrainingStateId'}\r\n      placeholder={t(translations.AllValues)}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * TrainingStatePickerFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { TrainingStatePicker } from 'app/components/pickers/AutocompletePickers/TrainingStatePicker';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetEnum, GetRawValue } from '../../types/FilterParam';\r\nimport { TFunction } from 'i18next';\r\nimport { TrainingState } from 'enums/TrainingState';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\n\r\nexport function TrainingStatePickerFilter(props: IFilterComponentProps) {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <TrainingStatePicker\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      onChange={handleOnChange}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id || 'TrainingStatePicker'}\r\n    />\r\n  );\r\n}\r\nexport function getTrainingStatePickerFilter<TRow>(\r\n  accessor: keyof TRow,\r\n  params: URLSearchParams,\r\n  t: TFunction,\r\n): IFilterSettings<TRow> {\r\n  return {\r\n    id: 'TrainingStateId',\r\n    fieldName: accessor,\r\n    displayName: t(translations.TrainingState),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'TrainingStateId',\r\n    value: GetEnum(GetRawValue(params, 'TrainingStateId'), TrainingState, t),\r\n    component: TrainingStatePickerFilter,\r\n    customFilter: (value, settings) => {\r\n      const id = (value as Entity<number>)?.Id;\r\n      switch (id) {\r\n        case TrainingState.Available:\r\n          const x = new Condition(settings.fieldName, ODataOperators.Includes, [\r\n            TrainingState.Available,\r\n            TrainingState.UnderMinimum,\r\n          ]).toString();\r\n          return x;\r\n        case TrainingState.Maximum:\r\n        case TrainingState.SignedUp:\r\n        case TrainingState.UnderMinimum:\r\n          return new Condition(\r\n            settings.fieldName,\r\n            ODataOperators.Equals,\r\n            id,\r\n          ).toString();\r\n      }\r\n    },\r\n  };\r\n}\r\nexport default TrainingStatePickerFilter;\r\n","/**\r\n *\r\n * ReservationOrDowntimePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { ReservationOrDowntimeEnum } from 'enums/ReservationOrDowntimeEnum';\r\n\r\nexport interface ReservationOrDowntimePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nexport function ReservationOrDowntimePicker(\r\n  props: ReservationOrDowntimePickerProps,\r\n) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const loadData = () => {\r\n    const options = enumToEntityArray(ReservationOrDowntimeEnum, t);\r\n    return Promise.resolve<Entity<number>[]>(options);\r\n  };\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      {...props}\r\n      id={props.id || 'TrainingStateId'}\r\n      placeholder={t(translations.AllValues)}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * ReservationOrDowntimePickerFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { ReservationOrDowntimePicker } from 'app/components/pickers/AutocompletePickers/ReservationOrDowntimePicker';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetEnum, GetRawValue } from '../../types/FilterParam';\r\nimport { TFunction } from 'i18next';\r\nimport { ReservationOrDowntimeEnum } from 'enums/ReservationOrDowntimeEnum';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\n\r\nexport function ReservationOrDowntimePickerFilter(\r\n  props: IFilterComponentProps,\r\n) {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <ReservationOrDowntimePicker\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      onChange={handleOnChange}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id || 'ReservationOrDowntimePicker'}\r\n    />\r\n  );\r\n}\r\nexport function getReservationOrDowntimePickerFilter<TRow>(\r\n  accessor: keyof TRow,\r\n  params: URLSearchParams,\r\n  t: TFunction,\r\n): IFilterSettings<TRow> {\r\n  return {\r\n    id: 'ReservationOrDowntime',\r\n    fieldName: accessor,\r\n    displayName: t(translations.ReservationOrDowntime),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'ReservationOrDowntime',\r\n    value: GetEnum(\r\n      GetRawValue(params, 'ReservationOrDowntime'),\r\n      ReservationOrDowntimeEnum,\r\n      t,\r\n    ),\r\n    component: ReservationOrDowntimePickerFilter,\r\n  };\r\n}\r\nexport default ReservationOrDowntimePickerFilter;\r\n","/**\r\n *\r\n * WithReservationsOnlyFilter\r\n *\r\n */\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { BooleanPicker } from 'app/components/BooleanPicker';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { URLSearchParams } from 'url';\r\nimport { IFilterSettings } from '../../BasicFilter/IFilterSettings';\r\nimport {\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  GetRawValue,\r\n  URLSearchParamsCI,\r\n} from '../../types/FilterParam';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport interface WithReservationsOnlyFilterProps {}\r\n\r\nexport function WithReservationsOnlyFilter(props: IFilterComponentProps) {\r\n  const handleOnChange = (value: Entity<boolean> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <BooleanPicker\r\n      value={props.value}\r\n      isOpen={props.open}\r\n      falseName={t(translations.ShowAll) as string}\r\n      size=\"small\"\r\n      onChange={handleOnChange}\r\n      placeholder={t(translations.ShowAll)}\r\n      ariaLabel={props.label}\r\n      id={props.id || 'withEventspickerId'}\r\n      info={t(translations.WithEventsOnly_info)}\r\n    />\r\n  );\r\n}\r\nexport function pushReservationsOnlyFilter<\r\n  T extends { WithReservationsOnly: boolean | null }\r\n>(\r\n  result: IFilterSettings<T>[],\r\n  t: TFunction,\r\n  params: URLSearchParamsCI,\r\n  notDefault?: boolean,\r\n) {\r\n  const id = 'WithReservationsOnly';\r\n  result.push({\r\n    id: id,\r\n    fieldName: 'WithReservationsOnly',\r\n    displayName: t(translations.WithEventsOnly),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: id,\r\n    value: GetBooleanEntity(GetBooleanOrUndefined(GetRawValue(params, id)), t),\r\n    component: WithReservationsOnlyFilter,\r\n    defaultValue: false,\r\n    urlKey: id,\r\n    notDefault,\r\n  });\r\n}\r\nexport function getWithReservationsOnlyFilter<TRow>(\r\n  fieldName: keyof TRow,\r\n  params: URLSearchParams,\r\n  t: TFunction,\r\n): IFilterSettings<TRow> {\r\n  const id = 'WithReservationsOnly';\r\n  return {\r\n    id: id,\r\n    fieldName: fieldName,\r\n    queryStringSerializer: id,\r\n    displayName: t(translations.WithEventsOnly),\r\n    operator: ODataOperators.Equals,\r\n    value: GetBooleanEntity(GetBooleanOrUndefined(GetRawValue(params, id)), t),\r\n    component: WithReservationsOnlyFilter,\r\n    urlKey: id,\r\n  };\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport {\r\n  pushAssetAvailabilityFilter,\r\n  pushAssetCatFilter,\r\n  pushAssetCatGroupFilter,\r\n  pushBookedByFilter,\r\n  pushBudgetManagerFilter,\r\n  pushBuildingFilter,\r\n  pushCampusFilter,\r\n  pushRoomFilter,\r\n  pushServicesCalendarFilter,\r\n} from 'app/pages/ReservationHistoryPage/Filter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { ITrainingSessionDto } from 'api/odata/generated/entities/ITrainingSessionDto';\r\nimport { getTrainingStatePickerFilter } from 'app/components/BasicTable/Filters/TrainingStatePickerFilter';\r\nimport { getReservationOrDowntimePickerFilter } from 'app/components/BasicTable/Filters/ReservationOrDowntimePickerFilter';\r\nimport { pushReservationsOnlyFilter } from 'app/components/BasicTable/Filters/WithReservationsOnlyFilter';\r\nimport { getBudgetsFilterSettings } from 'app/components/BasicTable/Filters/ProjectFilter/getBudgetsFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { Identifiable } from 'types/common';\r\nimport { IRoomDto } from 'api/odata/generated/entities/IRoomDto';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nexport type CombinedSchedulerTRow = ICalendarReservationDto &\r\n  ITrainingSessionDto & {\r\n    ReservationOrDowntime: number | null;\r\n    WithReservationsOnly: boolean | null;\r\n  };\r\n\r\nexport const getFilters: GetPageFilters<CombinedSchedulerTRow> =\r\n  (t, appSettings, user, settings) => search => {\r\n    const params = new URLSearchParamsCI(search);\r\n    const result: Array<IFilterSettings<CombinedSchedulerTRow>> = [];\r\n    pushServicesCalendarFilter(result, t, params, false, 'Id', 'reserved');\r\n    pushAssetCatFilter(result, t, params);\r\n    pushAssetCatGroupFilter(result, t, params);\r\n    pushRoomFilter(result, t, params, undefined, {\r\n      dependencyProp: ['AssetBuildingId'],\r\n      filterPredicates: (value, fieldName) => {\r\n        if (isNullOrUndefined(value)) {\r\n          return [];\r\n        }\r\n        if (fieldName === 'AssetBuildingId') {\r\n          return [\r\n            `${new Condition<IRoomDto>(\r\n              'BuildingId',\r\n              ODataOperators.Equals,\r\n              (value as Identifiable<number>).Id,\r\n            ).toString()}`,\r\n          ];\r\n        }\r\n        return [];\r\n      },\r\n    });\r\n    pushReservationsOnlyFilter(result, t, params);\r\n    // result.push(\r\n    //   getWithReservationsOnlyFilter<CombinedSchedulerTRow>(\r\n    //     'WithReservationsOnly',\r\n    //     params,\r\n    //     t,\r\n    //   ),\r\n    // );\r\n    pushCampusFilter(appSettings, result, t, params, true);\r\n    pushBuildingFilter(result, t, params, true);\r\n    const budgetsFilter = getBudgetsFilterSettings<CombinedSchedulerTRow>(\r\n      params,\r\n      'BudgetId',\r\n      t,\r\n      appSettings,\r\n    );\r\n    if (budgetsFilter !== undefined) {\r\n      result.push({ ...budgetsFilter, notDefault: true });\r\n    }\r\n    pushBudgetManagerFilter(appSettings, result, t, params, true);\r\n    pushAssetAvailabilityFilter(result, t, params, true);\r\n    pushBookedByFilter(result, t, params, true);\r\n\r\n    result.push({\r\n      ...getTrainingStatePickerFilter<CombinedSchedulerTRow>(\r\n        'TrainingState',\r\n        params,\r\n        t,\r\n      ),\r\n      notDefault: true,\r\n    });\r\n    result.push({\r\n      ...getReservationOrDowntimePickerFilter<CombinedSchedulerTRow>(\r\n        'ReservationOrDowntime',\r\n        params,\r\n        t,\r\n      ),\r\n      notDefault: true,\r\n    });\r\n\r\n    return result;\r\n  };\r\n","/**\r\n *\r\n * SamplePlateTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface SamplePlateTypePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {\r\n  name?: string;\r\n  placeholder?: string;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  disabled?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/SamplePlateTypes';\r\nexport const initSamplePlateTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string; $select: string } = {\r\n    $orderby: 'Name asc',\r\n    $select: 'Id,Name',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function SamplePlateTypePicker(props: SamplePlateTypePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      id={props.id || 'sampletypeId'}\r\n      size={props.size}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { SamplePlateTypePicker } from '../pickers/AutocompletePickers/SamplePlateTypePicker';\r\n\r\nexport const FormSamplePlateTypePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & {\r\n  label?: string;\r\n  fullWidth: boolean;\r\n  autoFocus?: boolean;\r\n  name: string;\r\n  placeholder: string;\r\n  disabled?: boolean;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n}) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <SamplePlateTypePicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n        variant={props.variant}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { FormFieldsBox } from '../wrappers';\r\nimport { Divider, useTheme } from '@material-ui/core';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { BookitTypographyVariant } from '@material-ui/core/styles/createTypography';\r\n\r\nexport interface FormFieldsSectionProps {\r\n  children: React.ReactNode;\r\n  titleSection?: string | React.ReactNode;\r\n  titleLink?: React.ReactNode;\r\n  styleSection?: React.CSSProperties;\r\n  withTopSeparator?: boolean;\r\n  withBottomSeparator?: boolean;\r\n  titleVariant?: BookitTypographyVariant;\r\n}\r\nexport const FormFieldsSection = (props: FormFieldsSectionProps) => {\r\n  const {\r\n    children,\r\n    titleSection,\r\n    titleLink,\r\n    styleSection,\r\n    withTopSeparator,\r\n    withBottomSeparator,\r\n    titleVariant,\r\n  } = props;\r\n  const theme = useTheme();\r\n  return (\r\n    <FormFieldsBox\r\n      style={styleSection}\r\n      theme={theme}\r\n      className={'fields-section'}\r\n    >\r\n      {withTopSeparator && (\r\n        <Divider\r\n          style={{ width: '100%', alignSelf: 'center', marginBottom: 12 }}\r\n        />\r\n      )}\r\n      {titleSection && (\r\n        <div className={'sectiontitle'}>\r\n          <BasicTypography variant={titleVariant ?? 'boldM'}>\r\n            {titleSection}\r\n          </BasicTypography>\r\n          {titleLink || <></>}\r\n        </div>\r\n      )}\r\n\r\n      <div className={`fields`}>{children}</div>\r\n      {withBottomSeparator && (\r\n        <Divider\r\n          style={{ width: '100%', alignSelf: 'center', marginTop: 12 }}\r\n        />\r\n      )}\r\n    </FormFieldsBox>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectSidePanelOpen,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport { IndexNode } from '../StyledForm/index';\r\nimport clsx from 'clsx';\r\nimport { LeftSection } from '../wrappers';\r\n\r\nexport interface FormLeftSectionProps {\r\n  pageDescription?: string;\r\n  warning?: string;\r\n  info?: string;\r\n  children: React.ReactNode;\r\n  showShortView?: boolean;\r\n  errors?: IndexNode[];\r\n  warningNodes?: IndexNode[];\r\n  infoNodes?: IndexNode[];\r\n  successNodes?: IndexNode[];\r\n  isCover?: boolean;\r\n}\r\nexport const FormLeftSection = (props: FormLeftSectionProps) => {\r\n  const {\r\n    pageDescription,\r\n    children,\r\n    warning,\r\n    info,\r\n    errors,\r\n    warningNodes,\r\n    infoNodes,\r\n    successNodes,\r\n    isCover,\r\n  } = props;\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const theme = useTheme();\r\n  const showShortView = React.useMemo(() => {\r\n    return (\r\n      props.showShortView ||\r\n      isMobile ||\r\n      (sidePanelOpen && !sidePanelExpanded) ||\r\n      isCover\r\n    );\r\n  }, [\r\n    isCover,\r\n    isMobile,\r\n    props.showShortView,\r\n    sidePanelExpanded,\r\n    sidePanelOpen,\r\n  ]);\r\n\r\n  const [dataErrors, setDataErrors] = React.useState<IndexNode[]>(errors || []);\r\n  const [dataWarnings, setDataWarnings] = React.useState<IndexNode[]>(\r\n    warningNodes || [],\r\n  );\r\n  const [dataSuccess, setDataSuccess] = React.useState<IndexNode[]>(\r\n    successNodes || [],\r\n  );\r\n  const [dataInfos, setDataInfos] = React.useState<IndexNode[]>(\r\n    infoNodes || [],\r\n  );\r\n  const colapsedMinHeight = React.useMemo(() => {\r\n    return showShortView ? 60 : 50;\r\n  }, [showShortView]);\r\n  const handleCloseError = React.useCallback(\r\n    (index: number) => {\r\n      if (dataErrors.length > 0) {\r\n        setDataErrors(() => dataErrors.splice(index, 1));\r\n      }\r\n    },\r\n    [dataErrors],\r\n  );\r\n  const handleCloseWarning = React.useCallback(\r\n    (index: number) => {\r\n      if (dataWarnings.length > 0) {\r\n        setDataWarnings(() => dataWarnings.splice(index, 1));\r\n      }\r\n    },\r\n    [dataWarnings],\r\n  );\r\n  const handleCloseInfo = React.useCallback(\r\n    (index: number) => {\r\n      if (dataInfos.length > 0) {\r\n        setDataInfos(() => dataInfos.splice(index, 1));\r\n      }\r\n    },\r\n    [dataInfos],\r\n  );\r\n  const handleCloseSuccess = React.useCallback(\r\n    (index: number) => {\r\n      if (dataSuccess.length > 0) {\r\n        setDataSuccess(() => dataSuccess.splice(index, 1));\r\n      }\r\n    },\r\n    [dataSuccess],\r\n  );\r\n  React.useEffect(() => {\r\n    if (!!errors && errors.length > 0) {\r\n      setDataErrors(errors);\r\n    } else {\r\n      setDataErrors([]);\r\n    }\r\n    if (!!warningNodes && warningNodes.length > 0) {\r\n      setDataWarnings(warningNodes);\r\n    } else {\r\n      setDataWarnings([]);\r\n    }\r\n    if (!!infoNodes && infoNodes.length > 0) {\r\n      setDataInfos(infoNodes);\r\n    } else {\r\n      setDataInfos([]);\r\n    }\r\n    if (!!successNodes && successNodes.length > 0) {\r\n      setDataSuccess(successNodes);\r\n    } else {\r\n      setDataSuccess([]);\r\n    }\r\n  }, [errors, infoNodes, successNodes, warningNodes]);\r\n  return (\r\n    <LeftSection\r\n      className={clsx('leftsection', { shortView: showShortView })}\r\n      theme={theme}\r\n    >\r\n      {pageDescription && (\r\n        <BasicAlert\r\n          showMore={true}\r\n          collapsedMinHeight={colapsedMinHeight}\r\n          style={{\r\n            width: sidePanelExpanded ? 'calc(100% + 0px)' : 'calc(100% + 24px)',\r\n            margin: sidePanelExpanded\r\n              ? '12px -12px 12px 0px'\r\n              : '12px -12px 12px -12px',\r\n          }}\r\n          content={{\r\n            type: 'info',\r\n            closable: true,\r\n            message: pageDescription,\r\n          }}\r\n        />\r\n      )}\r\n      {warning && (\r\n        <BasicAlert\r\n          collapsedMinHeight={colapsedMinHeight}\r\n          showMore={true}\r\n          content={{\r\n            type: 'warning',\r\n            closable: true,\r\n            message: warning,\r\n          }}\r\n        />\r\n      )}\r\n      {info && (\r\n        <BasicAlert\r\n          showMore={true}\r\n          collapsedMinHeight={colapsedMinHeight}\r\n          content={{\r\n            type: 'info',\r\n            closable: true,\r\n            message: info,\r\n          }}\r\n        />\r\n      )}\r\n      {dataSuccess.length > 0 && (\r\n        <React.Fragment>\r\n          {dataSuccess.map((succ, index) => (\r\n            <BasicAlert\r\n              key={succ.index}\r\n              collapsedMinHeight={colapsedMinHeight}\r\n              content={{\r\n                type: 'success',\r\n                closable: true,\r\n                children: succ.node,\r\n                variant: succ.variant,\r\n              }}\r\n              variant={succ.variant}\r\n              showMore={succ.showMore === undefined ? true : succ.showMore}\r\n              onClose={ev => handleCloseSuccess(index)}\r\n            />\r\n          ))}\r\n        </React.Fragment>\r\n      )}\r\n      {dataInfos.length > 0 && (\r\n        <React.Fragment>\r\n          {dataInfos.map((info, index) => (\r\n            <BasicAlert\r\n              key={info.index}\r\n              collapsedMinHeight={colapsedMinHeight}\r\n              content={{\r\n                type: 'info',\r\n                closable: true,\r\n                children: info.node,\r\n                variant: info.variant,\r\n              }}\r\n              variant={info.variant}\r\n              showMore={info.showMore === undefined ? true : info.showMore}\r\n              onClose={ev => handleCloseInfo(index)}\r\n            />\r\n          ))}\r\n        </React.Fragment>\r\n      )}\r\n      {dataWarnings.length > 0 && (\r\n        <React.Fragment>\r\n          {dataWarnings.map((warn, index) => (\r\n            <BasicAlert\r\n              key={warn.index}\r\n              collapsedMinHeight={colapsedMinHeight}\r\n              content={{\r\n                type: 'warning',\r\n                closable: true,\r\n                children: warn.node,\r\n                variant: warn.variant,\r\n              }}\r\n              variant={warn.variant}\r\n              showMore={warn.showMore === undefined ? true : warn.showMore}\r\n              onClose={ev => handleCloseWarning(index)}\r\n            />\r\n          ))}\r\n        </React.Fragment>\r\n      )}\r\n      {dataErrors.length > 0 && (\r\n        <React.Fragment>\r\n          {dataErrors.map((err, index) => (\r\n            <BasicAlert\r\n              key={err.index}\r\n              collapsedMinHeight={colapsedMinHeight}\r\n              content={{\r\n                type: 'error',\r\n                closable: true,\r\n                children: err.node,\r\n                variant: err.variant,\r\n              }}\r\n              variant={err.variant}\r\n              showMore={err.showMore === undefined ? true : err.showMore}\r\n              onClose={ev => handleCloseError(index)}\r\n            />\r\n          ))}\r\n        </React.Fragment>\r\n      )}\r\n      {children}\r\n    </LeftSection>\r\n  );\r\n};\r\n","import React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { ICanRaiseBasicTableRefreshEvent } from '../../ControlledTable/ControlledTableProps';\r\n\r\nexport interface RefreshIconProps extends ICanRaiseBasicTableRefreshEvent {\r\n  loading?: boolean;\r\n  title: string;\r\n}\r\nexport function RefreshIcon(props: RefreshIconProps) {\r\n  const handleClick = React.useCallback(() => {\r\n    if (props.loading === true) {\r\n      return;\r\n    }\r\n\r\n    props.onRefresh?.();\r\n  }, [props]);\r\n\r\n  return (\r\n    <IconButton\r\n      variant=\"ghost\"\r\n      onClick={handleClick}\r\n      title={props.title}\r\n      disabled={props.loading}\r\n    >\r\n      <Icon icon=\"refresh\" spin={props.loading} />\r\n    </IconButton>\r\n  );\r\n}\r\n","/**\r\n *\r\n * NumbersRangeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\nimport { INumbersRange } from 'types/INumbersRange';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { debounce } from 'lodash';\r\n\r\n/**\r\n * Number picker to be used as a BasicTable filter component\r\n */\r\nexport const NumbersRangeFilter = ({\r\n  value: propsValue,\r\n  onChange,\r\n  additionalItem,\r\n  labelFunc,\r\n  ...props\r\n}: IFilterComponentProps) => {\r\n  const { t } = useTranslation();\r\n\r\n  const [value, setValue] = React.useState<INumbersRange | null>(propsValue);\r\n  const handleStartChange: React.ChangeEventHandler<\r\n    HTMLTextAreaElement | HTMLInputElement\r\n  > = event => {\r\n    setValue(value => {\r\n      const newState = {\r\n        end: value?.end ?? null,\r\n        start: +event.target.value ?? null,\r\n      };\r\n      d(newState);\r\n      return newState;\r\n    });\r\n  };\r\n  const handleEndChange: React.ChangeEventHandler<\r\n    HTMLTextAreaElement | HTMLInputElement\r\n  > = event => {\r\n    setValue(value => {\r\n      const newState = {\r\n        start: value?.start ?? null,\r\n        end: +event.target.value ?? null,\r\n      };\r\n      d(newState);\r\n      return newState;\r\n    });\r\n  };\r\n  const d = debounce(onChange, 250);\r\n  return (\r\n    <>\r\n      {value !== undefined && (\r\n        <>\r\n          <>\r\n            <TextControlField\r\n              value={value?.start ?? ''}\r\n              min={value?.end ?? undefined}\r\n              type=\"number\"\r\n              size=\"small\"\r\n              onChange={handleStartChange}\r\n              placeholder={t(translations.AllValues)}\r\n              id=\"numberstartId\"\r\n              {...props}\r\n              inputProps={{ 'aria-label': 'Number Start Filter' }}\r\n            />\r\n\r\n            <Icon\r\n              icon=\"arrow-from-left\"\r\n              color=\"primary\"\r\n              style={{ marginLeft: '4px', marginRight: '4px' }}\r\n            />\r\n            <TextControlField\r\n              value={value?.end || null}\r\n              min={value?.start ?? undefined}\r\n              size=\"small\"\r\n              type=\"number\"\r\n              onChange={handleEndChange}\r\n              placeholder={t(translations.AllValues)}\r\n              id=\"numberendid\"\r\n              inputProps={{ 'aria-label': 'Number End Filter' }}\r\n              {...props}\r\n            />\r\n          </>\r\n        </>\r\n      )}\r\n    </>\r\n  );\r\n};\r\nexport default NumbersRangeFilter;\r\n","/**\r\n *\r\n * AvailabilityTypeFilter\r\n *\r\n */\r\nimport { AvailabilityTypeBookablePicker } from 'app/components/pickers/AutocompletePickers/AvailabilityTypePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const AvailabilityTypeBookableFilter = (\r\n  props: IFilterComponentProps,\r\n) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  return (\r\n    <AvailabilityTypeBookablePicker\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n      isOpen={props.open}\r\n      size=\"small\"\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n    />\r\n  );\r\n};\r\nexport default AvailabilityTypeBookableFilter;\r\n","import { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { ReservationDetailsProps } from '../ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../ReservationDetails/Details/slice/types';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\n\r\nexport const trainingSessionPrimaryAction: PrimaryActionDynamic<ITrainingSessionsRow> = (\r\n  openPanel,\r\n  row,\r\n  toggle,\r\n  user,\r\n  useSidePanel,\r\n) => {\r\n  if (!IsReadOnlyUser(user)) {\r\n    const params = (row.original.hasReservation\r\n      ? {\r\n          id: String(row.original.myReservationId),\r\n        }\r\n      : {\r\n          selectedIds: String(row.original.ServiceId),\r\n          tsid: String(row.original.Id),\r\n          Start: dateUtils.formatQueryStringDate(\r\n            dateUtils.dateOrStringToDate(row.original.StartDate ?? new Date()),\r\n          ),\r\n          End: dateUtils.formatQueryStringDate(\r\n            dateUtils.dateOrStringToDate(row.original.EndDate ?? new Date()),\r\n          ),\r\n          un: user?.Id,\r\n        }) as ReservationQueryStringParameters;\r\n    openPanel({\r\n      renderPageType: RenderPageType.ReservationDetails,\r\n      renderPageProps: {\r\n        useSidePanel: true,\r\n        queryParams: params,\r\n      } as ReservationDetailsProps,\r\n      useSidePanel: useSidePanel,\r\n      expanded: false,\r\n      isCover: useSidePanel,\r\n    });\r\n  }\r\n};\r\n\r\nexport default trainingSessionPrimaryAction;\r\n","import { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { WorkOrderDetailsProps } from '../WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { allowedToViewAlert } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\n\r\nexport const workOrderPrimaryAction: PrimaryActionDynamic<IWorkOrderDetailsDto> = (\r\n  openPanel,\r\n  row,\r\n  toggle,\r\n  user,\r\n  useSidePanel,\r\n) => {\r\n  if (allowedToViewAlert(user, row.original)) {\r\n    openPanel({\r\n      renderPageType: RenderPageType.WorkOrderDetails,\r\n      renderPageProps: {\r\n        queryParams: { id: '' + row.original.Id },\r\n        useSidePanel: true,\r\n      } as WorkOrderDetailsProps,\r\n      useSidePanel: useSidePanel,\r\n      expanded: false,\r\n      isCover: useSidePanel,\r\n    });\r\n  }\r\n};\r\n\r\nexport default workOrderPrimaryAction;\r\n","import * as React from 'react';\r\nimport {\r\n  Box,\r\n  ListItem,\r\n  ListItemSecondaryAction,\r\n  ListItemText,\r\n  Menu,\r\n  MenuList,\r\n} from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Body } from 'app/components/Typography';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport {\r\n  BatchesByServiceTypeFilter,\r\n  convertInventoryBatchName,\r\n  loadInventoryBatchesData,\r\n} from 'app/components/pickers/AutocompletePickers/InventoryBatchesPicker';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { GetResponseMessages, IResponseType } from 'types/ResponseType';\r\nimport { OtherServicesApi } from 'api/OtherServicesApi';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\n\r\nexport interface InventoryBatchListProps {\r\n  serviceTypeId: number;\r\n  isAdmin: boolean;\r\n  addNewBatchClick: () => void;\r\n  anchorEl: any;\r\n  onClose: () => void;\r\n  onBatchClick?: (batch: IInventoryBatchDto) => void;\r\n  selectedBatch?: IInventoryBatchDto;\r\n  batches: IInventoryBatchDto[];\r\n  onRenewStockClick?: (batchId?: number) => void;\r\n  batchDeletable?: boolean;\r\n  showRenewStockButtons?: boolean;\r\n  createdRenewal?: IOtherServices;\r\n}\r\n\r\nexport const InventoryBatchList = React.memo(function InventoryBatchList(\r\n  props: InventoryBatchListProps,\r\n) {\r\n  const {\r\n    isAdmin,\r\n    serviceTypeId,\r\n    addNewBatchClick,\r\n    anchorEl,\r\n    onClose,\r\n    onBatchClick,\r\n    selectedBatch,\r\n    batches,\r\n    onRenewStockClick,\r\n    batchDeletable,\r\n    showRenewStockButtons,\r\n    createdRenewal,\r\n  } = props;\r\n  const [input, setInnput] = React.useState<string>('');\r\n  const { t } = useTranslation();\r\n  const [removedBatch, setRemovedBatch] = React.useState<\r\n    IInventoryBatchDto | undefined\r\n  >(undefined);\r\n  const [removeBatchOpen, setRemoveBatchOpen] = React.useState(false);\r\n  const dispatch = useDispatch();\r\n\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const onRemoveBatchClick = (batch: IInventoryBatchDto) => {\r\n    setRemoveBatchOpen(true);\r\n    setRemovedBatch(batch);\r\n  };\r\n  const handleRemoveBatch = (batch: IInventoryBatchDto) => {\r\n    new Promise<IResponseType>((resolve, reject) => {\r\n      return OtherServicesApi.deleteInventoryBatch(batch)\r\n        .then(response => {\r\n          const messages: IResponseType = GetResponseMessages(\r\n            response,\r\n            t(translations.Success) as string,\r\n          );\r\n          setRemoveBatchOpen(false);\r\n          if (messages.ErrorMessages.length > 0) {\r\n            dispatch(\r\n              appSettingsActions.addNotification({\r\n                variant: 'success',\r\n                message: messages.ErrorMessages[0],\r\n              }),\r\n            );\r\n          }\r\n          if (messages.SuccessMessages.length > 0) {\r\n            dispatch(\r\n              appSettingsActions.addNotification({\r\n                variant: 'success',\r\n                message: messages.SuccessMessages[0],\r\n              }),\r\n            );\r\n          }\r\n          resolve(messages);\r\n        })\r\n        .catch(error => {\r\n          console.log('status error', error);\r\n          let err = t(translations.Failed) as string;\r\n          reject(err);\r\n        })\r\n        .finally(() => {\r\n          setRemoveBatchOpen(false);\r\n          setRemovedBatch(undefined);\r\n        });\r\n    });\r\n  };\r\n  const availableBatches = useAsyncGetWthEffect<IInventoryBatchDto[]>(\r\n    async () =>\r\n      loadInventoryBatchesData(\r\n        BatchesByServiceTypeFilter(\r\n          serviceTypeId,\r\n          showRenewStockButtons ? undefined : true,\r\n        ),\r\n      )(input, undefined).then(res => res.value),\r\n    batches,\r\n    [input, serviceTypeId, selectedBatch, removedBatch, createdRenewal],\r\n  );\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <Menu\r\n        id=\"simple-menu\"\r\n        anchorEl={anchorEl}\r\n        keepMounted\r\n        open={anchorEl !== null}\r\n        onClose={onClose}\r\n        //   PaperProps={{ style: { height: '400px' } }}\r\n      >\r\n        <ListItem key=\"lists-title\">\r\n          <Body size=\"small\" bold={true}>\r\n            {t(translations.InventoryBatches)}\r\n          </Body>\r\n        </ListItem>\r\n        <ListItem key=\"lists-search\" value=\"search\">\r\n          <TextControlField\r\n            placeholder={t(translations.SearchFilter)}\r\n            size=\"small\"\r\n            startIcon={\r\n              <Icon icon=\"search\" color=\"filters\" colorExtend=\"light\" />\r\n            }\r\n            value={input || ''}\r\n            aria-label={t(translations.SearchFilter)}\r\n            inputProps={{ 'aria-label': t(translations.SearchFilter) }}\r\n            onChange={e => setInnput(e.target.value)}\r\n            autoFocus\r\n            fullWidth\r\n          />\r\n        </ListItem>\r\n        <MenuList\r\n          variant=\"menu\"\r\n          key=\"lists-menu-items\"\r\n          style={{ maxHeight: `${42 * 5}px`, overflowY: 'auto' }}\r\n        >\r\n          {!!availableBatches && availableBatches.length > 0 ? (\r\n            availableBatches.map(a => (\r\n              <ListItem\r\n                button\r\n                key={a.Id}\r\n                selected={a.Id === selectedBatch?.Id}\r\n                onClick={e => !!onBatchClick && onBatchClick(a)}\r\n              >\r\n                <ListItemText>\r\n                  <Body size=\"small\" style={{ cursor: 'pointer' }}>\r\n                    {convertInventoryBatchName(a.Id, a.Name, a.Inventory)}\r\n                  </Body>\r\n                </ListItemText>\r\n                {a.Id !== selectedBatch?.Id && batchDeletable && (\r\n                  <ListItemSecondaryAction>\r\n                    <IconButton\r\n                      variant=\"text\"\r\n                      aria-label=\"delete\"\r\n                      onClick={() => onRemoveBatchClick(a)}\r\n                    >\r\n                      <Icon icon=\"trash\" color=\"black\" colorExtend=\"light\" />\r\n                    </IconButton>\r\n                  </ListItemSecondaryAction>\r\n                )}\r\n                {showRenewStockButtons && (\r\n                  <ListItemSecondaryAction>\r\n                    <IconButton\r\n                      variant=\"text\"\r\n                      aria-label=\"delete\"\r\n                      onClick={() =>\r\n                        onRenewStockClick && onRenewStockClick(a.Id)\r\n                      }\r\n                    >\r\n                      <Tooltip\r\n                        arrow\r\n                        title={t(translations.RenewStock) as string}\r\n                        style={{ cursor: 'pointer', zIndex: 1 }}\r\n                      >\r\n                        <span>\r\n                          <Icon\r\n                            icon=\"barcode\"\r\n                            color=\"black\"\r\n                            colorExtend=\"light\"\r\n                          />\r\n                        </span>\r\n                      </Tooltip>\r\n                    </IconButton>\r\n                  </ListItemSecondaryAction>\r\n                )}\r\n              </ListItem>\r\n            ))\r\n          ) : (\r\n            <ListItem>\r\n              <Body size=\"small\" bold={true}>\r\n                {t(translations.InventoryBatch_notFound)}\r\n              </Body>\r\n            </ListItem>\r\n          )}\r\n        </MenuList>\r\n        {isAdmin && (\r\n          <ListItem key=\"manage-lists\" value=\"action\">\r\n            <Box style={{ display: 'flex', gap: 8 }}>\r\n              <Button\r\n                variant=\"white\"\r\n                size=\"small\"\r\n                fullWidth={true}\r\n                aria-label=\"create batch\"\r\n                startIcon={<Icon icon=\"plus\" />}\r\n                onClick={() => addNewBatchClick()}\r\n              >\r\n                {t(translations.AddNewBatch)}\r\n              </Button>\r\n              {showRenewStockButtons && !!onRenewStockClick && (\r\n                <Button\r\n                  variant=\"white\"\r\n                  size=\"small\"\r\n                  fullWidth={true}\r\n                  aria-label=\"create batch\"\r\n                  startIcon={<Icon icon=\"barcode\" />}\r\n                  onClick={() => onRenewStockClick()}\r\n                >\r\n                  {t(translations.RenewStock)}\r\n                </Button>\r\n              )}\r\n            </Box>\r\n          </ListItem>\r\n        )}\r\n      </Menu>\r\n      <DialogConfirm\r\n        isOpen={removeBatchOpen}\r\n        title={t(translations.DeleteBatchInventory_title)}\r\n        //processing={props.processing}\r\n        body={t(translations.DeleteBatchInventory_message)}\r\n        confirmButtonLabel={t(translations.Delete)}\r\n        cancelButtonLabel={t(translations.Cancel)}\r\n        onConfirm={e => !!removedBatch && handleRemoveBatch(removedBatch)}\r\n        onCancel={() => {\r\n          setRemoveBatchOpen(false);\r\n          setRemovedBatch(undefined);\r\n        }}\r\n        maxWidth=\"md\"\r\n      />\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { RadioProps as MuiRadioProps, styled } from '@material-ui/core';\r\nimport { Radio as MuiRadio } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nexport interface RadioProps extends MuiRadioProps {\r\n  danger?: boolean;\r\n  label?: string;\r\n}\r\n\r\nexport default function Radio(props: RadioProps) {\r\n  const { color, danger, label, size = 'medium', ...other } = props;\r\n  const RadioIconUnchecked = styled('span')(({ theme, ...other }) => ({\r\n    borderRadius: '1000px',\r\n    width: 20,\r\n    height: 20,\r\n    backgroundColor: bookitColors.base.white,\r\n    border:\r\n      danger || color === 'secondary'\r\n        ? `1px solid ${bookitColors.danger.borders}`\r\n        : `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n    'input:hover ~ &': {\r\n      border:\r\n        danger || color === 'secondary'\r\n          ? `1px solid ${bookitColors.danger.borders}`\r\n          : props.disabled\r\n          ? `1px solid ${bookitColors.grayscale.grayBorders}`\r\n          : `1px solid ${bookitColors.primary.borders}`,\r\n    },\r\n    'input:disabled ~ &': {\r\n      //boxShadow: 'none',\r\n      background:\r\n        danger || color === 'secondary'\r\n          ? bookitColors.danger.bgHover\r\n          : bookitColors.grayscale.graybgComponents,\r\n    },\r\n  }));\r\n  const RadioIconChecked = styled(RadioIconUnchecked)(({ theme }) => ({\r\n    backgroundColor:\r\n      danger || color === 'secondary'\r\n        ? bookitColors.danger.components\r\n        : bookitColors.primary.components,\r\n    border: 'none',\r\n    '&:before': {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      width: 20,\r\n      height: 20,\r\n      backgroundImage: 'radial-gradient(#fff,#fff 16%,transparent 25%)',\r\n      content: '\"\"',\r\n    },\r\n    'input:hover ~ &': {\r\n      backgroundColor:\r\n        danger || color === 'secondary'\r\n          ? bookitColors.danger.regular\r\n          : bookitColors.primary.regular,\r\n      border: 'none',\r\n    },\r\n    'input:disabled ~ &': {\r\n      background:\r\n        danger || color === 'secondary'\r\n          ? bookitColors.danger.disabled\r\n          : bookitColors.grayscale.grayBorders,\r\n    },\r\n  }));\r\n  return (\r\n    <MuiRadio\r\n      key={props.key}\r\n      icon={<RadioIconUnchecked />}\r\n      checkedIcon={<RadioIconChecked />}\r\n      color={danger ? 'secondary' : color === 'default' ? 'primary' : color}\r\n      size={size}\r\n      inputProps={{ 'aria-label': !!label ? label : 'decorative radio' }}\r\n      {...other}\r\n    />\r\n  );\r\n}\r\n","import { FormControl, FormLabel, styled } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { FieldHookConfig } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { buttonM } from 'styles/typography/bookitTypography';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\n\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n  color: theme.palette.common.blackRegular,\r\n  ...buttonM,\r\n  '&[class*=\"Mui-focused\"]': {\r\n    color: theme.palette.common.blackRegular,\r\n  },\r\n}));\r\nexport const FormParagraph = ({\r\n  label,\r\n  html,\r\n  ...props\r\n}: FieldHookConfig<string> & IFieldProps) => {\r\n  return (\r\n    <FormControl variant=\"outlined\" fullWidth={true}>\r\n      <StyledFormLabel>\r\n        {label}\r\n        {props.info && <InfoIcon title={props.info} />}\r\n      </StyledFormLabel>\r\n      <span>{html}</span>\r\n    </FormControl>\r\n  );\r\n};\r\n","/**\r\n *\r\n * CatRateTypePicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ICatRateTypeFilterDto } from 'api/odata/generated/entities/ICatRateTypeFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface CatRateTypeProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {\r\n  /**\r\n   * Set this to \"true\" if only \"Manual\" types need to be displayed\r\n   *\r\n   */\r\n  manual?: boolean;\r\n  bySystemSetting?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/CatRateTypeFilter';\r\nconst systemUrl = url + '/WithSystemSetting';\r\nexport const initCatRateTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst getLoadData = (manual: boolean, bysSystemSetting?: boolean) => (\r\n  searchTerm: string | null,\r\n): Promise<Entity<number>[]> => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n\r\n  const predicates: Condition<ICatRateTypeFilterDto>[] = [\r\n    new Condition<ICatRateTypeFilterDto>('Active', ODataOperators.Equals, true),\r\n  ];\r\n  if (manual) {\r\n    predicates.push(\r\n      new Condition<ICatRateTypeFilterDto>(\r\n        'Manual',\r\n        ODataOperators.Equals,\r\n        true,\r\n      ),\r\n    );\r\n  }\r\n  params.$filter = new ODataFilterBuilder<ICatRateTypeFilterDto>({\r\n    predicates: predicates,\r\n    stringColumns: ['Name'],\r\n    stringSearch: searchTerm ?? undefined,\r\n  }).toString();\r\n\r\n  return httpClient\r\n    .get(bysSystemSetting ? systemUrl : url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function CatRateTypePicker({\r\n  manual,\r\n  bySystemSetting,\r\n  ...props\r\n}: CatRateTypeProps) {\r\n  const loadData = React.useCallback(\r\n    (search: string | null) =>\r\n      getLoadData(manual === true, bySystemSetting)(search),\r\n    [bySystemSetting, manual],\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'catRateTypeId'}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { selectImageExist } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\ntype RecordType = Record<string, any>;\r\nconst ImageRenderer: Renderer<CellProps<RecordType>> = ({ value, row }) => {\r\n  const imageExist = useSelector(state => selectImageExist(state, value));\r\n  return (\r\n    <>\r\n      <Tooltip title={row.original.Name} arrow>\r\n        <span>\r\n          <img\r\n            src={getAssetImageThumbSrc(value, 'thumbSmall', imageExist)}\r\n            alt=\"\"\r\n          />\r\n        </span>\r\n      </Tooltip>\r\n    </>\r\n  );\r\n};\r\nexport default ImageRenderer;\r\n","/**\r\n *\r\n * MultiSelectBasicPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\n\r\nexport interface BaseURLMultiPickerProps<T>\r\n  extends Omit<AutocompleteMultiPickerProps<T>, 'loadData'> {\r\n  url: string;\r\n  queryfilter?: string | undefined;\r\n}\r\n\r\nexport function BaseURLMultiPicker<T>(props: BaseURLMultiPickerProps<T>) {\r\n  const { url, queryfilter, ...other } = props;\r\n  const loadData = async (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $top: number; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n      $top: 100,\r\n    };\r\n    const predicates: string[] = [];\r\n    if (queryfilter !== undefined && queryfilter !== '') {\r\n      predicates.push(queryfilter);\r\n    }\r\n\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n    }).toString();\r\n\r\n    const response = await httpClient.get(url, params);\r\n    return response.value;\r\n  };\r\n  return <AutocompleteMultiPicker loadData={loadData} {...other} />;\r\n}\r\n","import { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { IAsset } from 'app/pages/AssetPopUp/IAsset';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nconst ServiceIdRenderer: Renderer<CellProps<IAsset>> = ({ value, row }) => {\r\n  const { allowedToEdit } = useAdminPermissions();\r\n  const { t } = useTranslation();\r\n  const hrefPath = React.useMemo(() => {\r\n    if (row.original.ServiceType === 'Offline') {\r\n      return {\r\n        path: '/offlineServicetype.aspx',\r\n        search: { ID: row.original.ServiceId, back: 'myassets' },\r\n      };\r\n    } else if (row.original.ServiceType === 'Sample') {\r\n      return {\r\n        path: '/SampleType.aspx',\r\n        search: { id: row.original.ServiceId, back: 'myassets' },\r\n      };\r\n    } else {\r\n      return {\r\n        path: '/NewResource.aspx',\r\n        search: { Edit: row.original.ServiceId, back: 'myassets' },\r\n      };\r\n    }\r\n  }, [row.original.ServiceId, row.original.ServiceType]);\r\n  return allowedToEdit(row.original) ? (\r\n    <Tooltip title={t(translations.EditSettings) as string} arrow>\r\n      <span>\r\n        <Link href={hrefPath} target={'_blank'}>\r\n          {value}\r\n        </Link>\r\n      </span>\r\n    </Tooltip>\r\n  ) : (\r\n    // <Button\r\n    //   variant=\"text\"\r\n    //   size=\"small\"\r\n    //   title={t(translations.EditSettings) as string}\r\n    //   href={`/NewResource.aspx?Edit=${row.original.ServiceId}&back=myassets`}\r\n    // >\r\n    //   {value}\r\n    // </Button>\r\n    <>{value}</>\r\n  );\r\n};\r\nexport const useServiceIdAction = () => {\r\n  const { allowedToEdit } = useAdminPermissions();\r\n  return React.useCallback(\r\n    row => {\r\n      if (!allowedToEdit(row.original)) return;\r\n      const hrefPath = (() => {\r\n        if (row.original.ServiceType === 'Offline') {\r\n          return {\r\n            path: '/offlineServicetype.aspx',\r\n            search: { ID: row.original.ServiceId, back: 'myassets' },\r\n          };\r\n        } else if (row.original.ServiceType === 'Sample') {\r\n          return {\r\n            path: '/SampleType.aspx',\r\n            search: { id: row.original.ServiceId, back: 'myassets' },\r\n          };\r\n        } else {\r\n          return {\r\n            path: '/NewResource.aspx',\r\n            search: { Edit: row.original.ServiceId, back: 'myassets' },\r\n          };\r\n        }\r\n      })();\r\n      window.open(toRootedURL(hrefPath.path, hrefPath.search), '_blank');\r\n    },\r\n    [allowedToEdit],\r\n  );\r\n};\r\nexport default ServiceIdRenderer;\r\n","import { getSingleOnlineServiceType } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\nconst OperationTypeIdRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n}: {\r\n  value: number | null;\r\n}) => {\r\n  const { t } = useTranslation();\r\n  if (value === null || value === undefined) {\r\n    return <>{t(translations.NA)}</>;\r\n  } else {\r\n    return <>{getSingleOnlineServiceType(value).Name}</>;\r\n  }\r\n};\r\n\r\nexport default OperationTypeIdRenderer;\r\n","import { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { selectImageExist } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { CellProps, Renderer } from 'react-table';\r\n\r\ntype RecordType = Record<string, any>;\r\nconst AssetImageRenderer: Renderer<CellProps<RecordType>> = ({\r\n  value,\r\n  row,\r\n}) => {\r\n  const imageExist = useSelector(state => selectImageExist(state, value));\r\n  const openAsset = useOpenAssetPopUp();\r\n  const open = () => {\r\n    openAsset({ id: row.original.Id });\r\n  };\r\n  return (\r\n    <>\r\n      <Tooltip title={row.original.Name} arrow>\r\n        <span style={{ cursor: 'pointer' }} onClick={open}>\r\n          <img\r\n            src={getAssetImageThumbSrc(value, 'thumbSmall', imageExist)}\r\n            alt=\"\"\r\n          />\r\n        </span>\r\n      </Tooltip>\r\n    </>\r\n  );\r\n};\r\nexport default AssetImageRenderer;\r\n","/**\r\n * Internal ServiceRequest Statuses enum. Generated from Bookit.Data.Enums.InternalServiceRequestStatus\r\n */\r\nexport enum InternalServiceRequestStatuses {\r\n  Draft = 0,\r\n\r\n  WaitingForQuote = 1,\r\n\r\n  QuoteSendToUser = 2,\r\n\r\n  QuoteApproved = 3,\r\n\r\n  Completed = 5,\r\n\r\n  Cancelled = 6,\r\n\r\n  InProcess = 7,\r\n\r\n  ReturnedToUser = 8,\r\n\r\n  Pending = 9,\r\n\r\n  Started = 10,\r\n\r\n  Skipped = 11,\r\n}\r\n\r\nexport type InternalServiceRequestStatusesUnion = keyof typeof InternalServiceRequestStatuses;\r\n","import { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { ReservationDetailsProps } from '../ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from '../ReservationDetails/Details/slice/types';\r\n\r\nexport const reservationsPrimaryAction: PrimaryActionDynamic<{\r\n  Id: number;\r\n}> = (openPanel, row, toggle, user, useSidePanel) => {\r\n  const params = {\r\n    id: String(row.original.Id),\r\n    un: user?.Id,\r\n  } as ReservationQueryStringParameters;\r\n  openPanel({\r\n    renderPageType: RenderPageType.ReservationDetails,\r\n    renderPageProps: {\r\n      useSidePanel: true,\r\n      queryParams: params,\r\n    } as ReservationDetailsProps,\r\n    useSidePanel: useSidePanel,\r\n    expanded: false,\r\n    isCover: useSidePanel,\r\n  });\r\n};\r\n\r\nexport default reservationsPrimaryAction;\r\n","/**\r\n *\r\n * OtherServiceDetailsPage\r\n *\r\n */\r\nimport { OfflineServiceQueryStringParameters } from '../Details/slice/types';\r\nimport { RouteComponentProps, useLocation } from 'react-router-dom';\r\nimport { OtherServiceDetails } from '../Details';\r\nimport { getParams } from './getQueryStringParameter';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport * as React from 'react';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\n\r\nexport interface OtherServiceDetailsPageProps<\r\n  Params extends {\r\n    [K in keyof OfflineServiceQueryStringParameters]?: string | undefined;\r\n  } = {}\r\n> extends RouteComponentProps<Params> {}\r\nexport function OtherServiceDetailsPage(props: OtherServiceDetailsPageProps) {\r\n  const location = useLocation();\r\n  const params = new URLSearchParams(location.search);\r\n  const queryProps = getParams(params, props);\r\n  return <OtherServiceDetails useSidePanel={false} queryParams={queryProps} />;\r\n}\r\nexport function OtherServiceEditLink(props: {\r\n  id: number;\r\n  useSidePanel: boolean;\r\n  service?: IOtherServices;\r\n  openPanelWithCover?: (state: SidePanelOpenState) => void;\r\n}) {\r\n  const { openPanel } = useSidePanelState();\r\n  const handleOfflineServiceClick = React.useCallback(() => {\r\n    let otherProps = {\r\n      initialService: props.service,\r\n      queryParams: {\r\n        id: '' + props.id ?? -1,\r\n      },\r\n      useSidePanel: true,\r\n    };\r\n    const panelProps = {\r\n      renderPageType: RenderPageType.OtherServiceDetails,\r\n      renderPageProps: otherProps,\r\n      expanded: false,\r\n      useSidePanel: props.useSidePanel,\r\n      isCover: props.useSidePanel,\r\n    } as SidePanelOpenState;\r\n    !!props.openPanelWithCover\r\n      ? props.openPanelWithCover(panelProps)\r\n      : openPanel(panelProps);\r\n  }, [openPanel, props]);\r\n  return (\r\n    <Button\r\n      variant=\"text\"\r\n      size=\"small\"\r\n      onClick={() => handleOfflineServiceClick()}\r\n    >\r\n      {props.id}\r\n    </Button>\r\n  );\r\n}\r\n","/**\r\n *\r\n * ServiceFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { OnlineServiceSinglePicker } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\n\r\nexport const ServiceFilter = (props: IFilterComponentProps) => {\r\n  const handleChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  // OnlineServiceSinglePicker operates on arrays, while ServiceFilter is a single selection picker\r\n  const arrayValue =\r\n    (props.value as Entity<number> | undefined) === undefined\r\n      ? undefined\r\n      : Array.isArray(props.value) // check if the value already is an array before wrapping it yet in another array to avoid nested arrays [[{...}]]\r\n      ? props.value\r\n      : [props.value];\r\n\r\n  return (\r\n    <OnlineServiceSinglePicker\r\n      onChange={handleChange}\r\n      value={arrayValue}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      additionalItem={props.additionalItem as IServiceFilterDto}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default ServiceFilter;\r\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M128 41.522C91.867.049 43.399-.377 11.818.076 5.26.17 0 5.516 0 12.075v23.609c0 6.641 5.393 12.037 12.034 12C39.464 47.528 104 52.257 104 104v128H68c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h36v128c0 51.494-62.335 55.801-92.092 55.985C5.314 464.026 0 469.39 0 475.984v23.943c0 6.558 5.258 11.903 11.815 11.999 31.535.46 80.027.054 116.185-41.448 36.132 41.473 84.601 41.899 116.182 41.446 6.558-.094 11.818-5.44 11.818-11.999v-23.608c0-6.641-5.393-12.037-12.034-12C216.538 464.47 152 459.731 152 408V280h36c6.627 0 12-5.373 12-12v-24c0-6.627-5.373-12-12-12h-36V104c0-51.514 62.301-55.805 92.092-55.985C250.686 47.975 256 42.61 256 36.016V12.073C256 5.515 250.742.17 244.185.074 212.65-.386 164.157.02 128 41.522z\"\n});\n\nfunction SvgICursor(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    viewBox: \"0 0 256 512\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgICursor);\nexport default __webpack_public_path__ + \"static/media/I-cursor.1deb019e.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"\n});\n\nfunction SvgCheck(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    viewBox: \"0 0 512 512\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgCheck);\nexport default __webpack_public_path__ + \"static/media/check.53b599c1.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"\n});\n\nfunction SvgTimes(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    viewBox: \"0 0 352 512\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgTimes);\nexport default __webpack_public_path__ + \"static/media/times.c578e4ea.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"\n});\n\nfunction SvgChevronDown(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    viewBox: \"0 0 448 512\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgChevronDown);\nexport default __webpack_public_path__ + \"static/media/chevron-down.bc213772.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\"\n});\n\nfunction SvgChevronUp(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    viewBox: \"0 0 448 512\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgChevronUp);\nexport default __webpack_public_path__ + \"static/media/chevron-up.6f3cb9a5.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M254.812 101.975C254.631 79.9568 249.072 58.0916 235.287 41.7913C221.503 25.491 199.402 14.6276 176.498 13.7931C176.015 13.7753 175.529 13.7647 175.043 13.754C175.078 13.8393 175.117 13.928 175.153 14.0168C176.008 16.1937 171.833 20.4446 168.227 20.4446C166.118 20.4446 162.902 19.2372 161.961 18.669V18.6299C161.56 20.1017 160.969 21.515 160.204 22.8346C156.775 28.7794 150.658 31.7128 146.271 29.6708C145.611 30.6083 144.851 31.8442 144.166 32.938C147.52 35.47 150.201 39.2344 150.201 43.0094C150.201 43.4604 150.183 43.9363 150.154 44.4299C153.076 46.8092 155.305 54.7286 154.769 58.1449C154.491 58.4684 154.173 58.7548 153.821 58.9972C154.333 62.5485 155.458 70.3612 156.04 71.3911C156.693 72.5453 175.035 101.36 176.512 103.562C178.887 103.31 181.127 105.252 181.532 107.994C181.958 110.803 180.325 113.381 177.882 113.754C175.44 114.127 173.111 112.149 172.685 109.34C172.55 108.477 172.616 107.595 172.877 106.762C172.816 106.765 172.754 106.765 172.693 106.762C171.226 105.718 160.499 92.1838 155.405 85.7027C159.182 94.0837 163.598 103.793 164.609 106.19C166.938 106.293 169.015 108.346 169.441 111.162C169.917 114.28 168.163 117.131 165.536 117.533C162.909 117.934 160.374 115.732 159.902 112.614C159.715 111.437 159.861 110.232 160.325 109.134C160.176 109.098 160.027 109.066 159.87 109.02C157.293 106.914 141.699 86.5621 138.269 80.8623C134.134 89.428 130.023 96.0049 127.893 96.5021C121.202 98.0753 101.23 80.0988 97.9713 74.0901L93.5588 79.9639L67.8115 60.6095C50.9958 73.9729 36.9276 89.95 32.7636 108.481C25.8733 138.752 45.4509 175.766 73.9741 205.32C102.433 234.874 139.899 256.963 169.87 249.558C199.842 242.154 222.362 205.32 236.139 175.766C249.917 146.213 255.053 123.939 254.812 101.975Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M137.421 29.9265C139.085 27.4892 140.604 24.9564 141.972 22.341C141.92 21.3134 141.982 20.2832 142.156 19.2692C138.564 20.4529 134.908 21.8225 131.187 23.378L134.283 25.7076L128.958 32.8101C131.755 30.9635 134.283 29.8626 136.342 29.8626C136.702 29.8615 137.063 29.8828 137.421 29.9265Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M115.387 192.514L113.694 194.045L109.938 189.805C108.529 189.494 107.076 189.438 105.646 189.638L111.081 191.903L119.644 201.137C119.547 199.488 119.121 197.875 118.39 196.394C117.659 194.912 116.638 193.593 115.387 192.514Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M105.203 167.975L108.128 170.979L96.6547 110.8L92.3594 111.62L103.399 169.591C104.248 168.82 104.919 168.209 105.203 167.975Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.92 199.084C99.92 199.084 103.75 190.426 104.389 189.109L110.573 191.687C110.996 190.501 111.358 189.464 111.638 188.654C111.638 188.654 64.9609 185.671 57.8398 185.671L59.2846 192.024C59.2846 192.024 99.7035 210.8 103.072 211.762C103.072 211.762 104.755 207.373 106.672 202.273L99.92 199.084Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M120.936 202.504L192.565 147.662L188.629 142.512L116.506 197.735L120.936 202.504Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.9202 199.084C99.9202 199.084 102.799 192.571 103.981 189.986C102.02 190.541 100.228 191.573 98.7624 192.99C97.2973 194.407 96.2055 196.164 95.5844 198.106C94.9634 200.047 94.8324 202.113 95.2031 204.117C95.5739 206.122 96.4348 208.003 97.7092 209.594C98.9835 211.185 100.632 212.435 102.507 213.234C104.381 214.033 106.425 214.355 108.454 214.171C110.484 213.988 112.436 213.305 114.138 212.183C115.839 211.061 117.237 209.535 118.206 207.742L99.9202 199.084Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M162.431 16.1689C162.431 16.2438 162.431 16.3187 162.409 16.3935C162.413 16.3115 162.42 16.2367 162.431 16.1689Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M98.287 73.6427L64.084 47.9351\",\n  stroke: \"#EDF0F3\",\n  strokeWidth: 7,\n  strokeMiterlimit: 10\n});\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M129.576 31.9791L95.373 6.27502\",\n  stroke: \"#EDF0F3\",\n  strokeWidth: 7,\n  strokeMiterlimit: 10\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.6113 48.9968C103.13 48.9968 105.983 46.1429 105.983 42.6223C105.983 39.1018 103.13 36.2478 99.6113 36.2478C96.0921 36.2478 93.2393 39.1018 93.2393 42.6223C93.2393 46.1429 96.0921 48.9968 99.6113 48.9968Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M110.694 50.5636L110.823 50.4067L110.694 50.5636Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M108.319 53.5575L108.483 53.3472L108.319 53.5575Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M105.529 57.2997L105.753 56.9872L105.529 57.2997Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M106.537 55.9189C106.58 55.8654 106.619 55.8084 106.662 55.7513C106.619 55.8084 106.594 55.8654 106.537 55.9189Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M107.681 54.3912L107.887 54.1213L107.681 54.3912Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref18 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M114.574 46.0115L114.625 45.9534L114.574 46.0115Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref19 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M107.066 55.2116C107.134 55.1192 107.201 55.0234 107.272 54.931C107.201 55.0234 107.134 55.1192 107.066 55.2116Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref20 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M97.5244 73.0176C97.5288 73.041 97.5348 73.0641 97.5426 73.0866C97.5348 73.0641 97.5288 73.041 97.5244 73.0176Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref21 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M104.95 58.1272C105.035 58.0065 105.121 57.8822 105.209 57.7721C105.121 57.8857 105.035 58.0065 104.95 58.1272Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref22 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M97.8154 70.9294C97.8651 70.7661 97.9148 70.5992 97.9716 70.4287C97.9148 70.5992 97.8651 70.7661 97.8154 70.9294Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref23 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M97.5168 72.4067C97.5168 72.5346 97.499 72.6589 97.499 72.7619C97.499 72.6589 97.5061 72.5346 97.5168 72.4067Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref24 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M97.7802 71.0574C97.7482 71.1746 97.7198 71.2882 97.6914 71.4125C97.7198 71.2882 97.7482 71.1746 97.7802 71.0574Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref25 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M97.656 71.558C97.6312 71.6574 97.6134 71.7533 97.5957 71.8492C97.6134 71.7533 97.6312 71.6574 97.656 71.558Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref26 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M97.5667 72.002C97.5667 72.0978 97.5419 72.1902 97.5312 72.2825C97.5419 72.1902 97.5525 72.0907 97.5667 72.002Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref27 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M111.351 49.7644L111.465 49.6254L111.351 49.7644Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref28 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.7852 66.3804L100.016 65.9507L99.7852 66.3804Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref29 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M98.4688 69.1289C98.522 68.9975 98.5788 68.8697 98.6356 68.7383C98.5788 68.8697 98.522 68.9975 98.4688 69.1289Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref30 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M98.7236 68.5395L98.9544 68.0424L98.7236 68.5395Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref31 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.416 67.0905C99.4941 66.9378 99.5722 66.7887 99.6503 66.6324C99.5722 66.7887 99.4941 66.9378 99.416 67.0905Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref32 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.0078 67.9215C99.1037 67.7156 99.2066 67.506 99.3131 67.293C99.2066 67.506 99.1037 67.7156 99.0078 67.9215Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref33 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M98.0107 70.315C98.0569 70.1765 98.1066 70.0345 98.1634 69.8925C98.1066 70.0416 98.0746 70.1836 98.0107 70.315Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref34 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M98.2344 69.7078C98.2805 69.587 98.3302 69.4628 98.3799 69.3527C98.3302 69.4628 98.2805 69.6048 98.2344 69.7078Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref35 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M101.582 63.2445L101.855 62.7935L101.582 63.2445Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref36 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M103.065 60.8971C103.225 60.6521 103.388 60.407 103.555 60.1584C103.399 60.407 103.225 60.6521 103.065 60.8971Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref37 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M102.064 62.4596L102.334 62.0299L102.064 62.4596Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref38 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M102.558 61.682L102.845 61.2345L102.558 61.682Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref39 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M103.808 59.782L104.092 59.3665L103.808 59.782Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref40 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M100.162 65.6985C100.244 65.5493 100.329 65.3966 100.418 65.2439C100.329 65.3788 100.244 65.5315 100.162 65.6985Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref41 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M100.56 64.9882C100.687 64.768 100.815 64.5443 100.95 64.317C100.812 64.5301 100.684 64.7538 100.56 64.9882Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref42 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M101.397 63.5428C101.28 63.7346 101.17 63.9264 101.042 64.1146C101.17 63.9228 101.269 63.7346 101.397 63.5428Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref43 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M104.383 58.951L104.642 58.5746L104.383 58.951Z\",\n  fill: \"#EDF0F3\"\n});\n\nvar _ref44 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M93.5981 105.828C91.5357 105.828 77.8118 104.002 77.1622 104.002C76.5126 104.002 74.9258 104.414 74.9258 105.476C74.9258 109.07 86.47 112.252 98.1952 112.252C109.92 112.252 93.5981 105.828 93.5981 105.828Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref45 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M55.1565 234.849C79.8789 234.849 99.9204 214.8 99.9204 190.067C99.9204 165.335 79.8789 145.286 55.1565 145.286C30.4341 145.286 10.3926 165.335 10.3926 190.067C10.3926 214.8 30.4341 234.849 55.1565 234.849Z\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 16,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref46 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M214.844 234.849C239.566 234.849 259.608 214.8 259.608 190.067C259.608 165.335 239.566 145.286 214.844 145.286C190.122 145.286 170.08 165.335 170.08 190.067C170.08 214.8 190.122 234.849 214.844 234.849Z\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 16,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref47 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M215.543 184.731L174.878 110.426L171.431 112.314L212.096 186.619L215.543 184.731Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref48 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M192.568 144.377H97.499V147.083H192.568V144.377Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref49 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M99.5344 142.226L52.2168 187.194L55.537 190.69L102.855 145.723L99.5344 142.226Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref50 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M105.203 167.975C104.099 168.934 97.1729 175.39 97.1729 175.39L113.694 194.045L116.747 191.271L110.258 173.16L105.203 167.975Z\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref51 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M155.412 85.6814C160.506 92.1624 171.234 105.696 172.7 106.74C172.762 106.744 172.823 106.744 172.885 106.74C172.624 107.574 172.558 108.456 172.693 109.319C173.119 112.128 175.448 114.102 177.89 113.733C180.332 113.364 181.965 110.782 181.539 107.973C181.121 105.231 178.895 103.289 176.52 103.541C175.043 101.339 156.701 72.5239 156.048 71.3698C155.466 70.3434 154.34 62.5129 153.829 58.9758\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref52 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M150.155 44.4229C153.076 46.8022 155.306 54.7215 154.769 58.1378C153.066 60.1692 149.058 60.9362 146.782 60.8297\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref53 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M144.181 32.9486C147.532 35.4807 150.198 39.245 150.198 43.02C150.198 47.2815 148.778 53.4359 146.63 60.0661\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref54 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M138.267 80.8234C134.135 89.4316 130.024 96.005 127.894 96.5022C120.602 98.2175 97.5176 76.6968 97.5176 72.7762C97.5176 64.6545 124.852 29.8556 136.36 29.8556C136.716 29.8574 137.072 29.8811 137.425 29.9266\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref55 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M139.931 34.22C140.932 34.8557 141.968 35.3138 142.753 35.2854C143.296 34.4544 145 31.4997 146.281 29.6886\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref56 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M141.972 22.3409C140.604 24.957 139.084 27.491 137.421 29.93\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref57 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M141.162 40.7898C139.215 35.8543 136.552 31.2329 133.257 27.0748\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 4,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref58 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M98.8057 72.3392C104.358 74.4132 121.482 72.4848 133.967 69.7539\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 4,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref59 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M142.21 24.1841C141.888 22.6167 141.861 21.003 142.129 19.4254\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref60 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M162.43 16.1689C162.171 18.5259 161.416 20.8013 160.215 22.8453C156.665 29.0245 150.179 31.9685 145.767 29.4187C144.928 28.9315 144.202 28.2718 143.637 27.4833\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref61 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M143.158 13.7647C143.513 11.634 145.778 5.84897 149.211 4.05203C153.016 2.05267 155.405 3.40925 158.068 3.40925C160.46 3.40925 162.359 2.24444 164.997 2.4078C168.423 2.62087 168.852 6.01588 169.388 7.62461C170.098 9.75536 173.577 9.96844 175.171 14.0169C176.026 16.1938 171.852 20.4447 168.245 20.4447C166.137 20.4447 162.92 19.2372 161.98 18.669C162.178 17.8406 162.335 17.0026 162.448 16.1583C161.174 16.1583 153.286 14.578 152.643 14.6135C152.001 14.649 149.644 17.0426 149.427 17.5433C148.458 17.3803 147.5 17.1621 146.555 16.8899\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref62 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M143.989 19.7344C143.836 19.757 143.681 19.7688 143.527 19.7699C143.019 19.77 142.519 19.6417 142.074 19.3969C141.629 19.152 141.253 18.7987 140.981 18.3696C140.709 17.9405 140.55 17.4496 140.519 16.9425C140.487 16.4354 140.584 15.9285 140.801 15.4689C141.017 15.0094 141.346 14.612 141.758 14.3138C142.169 14.0156 142.649 13.8262 143.153 13.7632C143.657 13.7001 144.168 13.7655 144.64 13.9533C145.112 14.1411 145.529 14.4451 145.852 14.8372\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref63 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M146.374 50.4849C147.286 52.8287 147.847 54.9488 147.914 56.4652C146.661 58.4965 133.449 63.3795 130.768 62.9889C126.864 58.4965 122.174 37.2848 130.293 34.0034C130.737 33.8235 131.209 33.7191 131.688 33.6945\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref64 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M131.798 62.964C133.157 66.7994 136.544 76.8353 137.648 79.687C138.869 82.8476 157.052 106.677 159.852 108.981C160.009 109.028 160.158 109.059 160.307 109.095C159.844 110.193 159.697 111.398 159.884 112.575C160.357 115.693 162.881 117.902 165.518 117.494C168.156 117.085 169.909 114.241 169.423 111.123C168.997 108.324 166.92 106.272 164.592 106.151C162.817 101.953 150.623 75.3544 149.657 72.691C148.791 70.3187 146.796 61.3979 146.175 57.7756\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref65 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M104.39 189.109C103.751 190.426 99.9209 199.084 99.9209 199.084L122.463 209.738L124.177 205.988L111.092 191.9L104.39 189.109Z\",\n  stroke: \"#0B1B2D\",\n  strokeWidth: 2.5,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref66 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M55.1563 196.208C58.5461 196.208 61.294 193.459 61.294 190.067C61.294 186.676 58.5461 183.927 55.1563 183.927C51.7665 183.927 49.0186 186.676 49.0186 190.067C49.0186 193.459 51.7665 196.208 55.1563 196.208Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref67 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M214.844 196.208C218.234 196.208 220.982 193.459 220.982 190.067C220.982 186.676 218.234 183.927 214.844 183.927C211.454 183.927 208.706 186.676 208.706 190.067C208.706 193.459 211.454 196.208 214.844 196.208Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref68 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M127.893 96.5021C120.871 98.1534 99.2171 78.2699 97.6125 73.2875C94.091 76.4517 86.9629 85.5607 86.9629 95.419C86.9629 109.837 115.919 132.384 126.398 139.455C124.375 144.693 104.336 187.727 103.679 189.751C105.241 191.04 109.931 192.788 111.677 192.788C121.326 185.064 148.166 144.135 148.628 140.19C149.008 136.898 133.289 106.549 127.999 96.4524C127.965 96.4716 127.93 96.4882 127.893 96.5021Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref69 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M131.06 93.5227C129.782 95.2451 128.685 96.314 127.865 96.5022C126.58 96.8041 124.805 96.385 122.753 95.4652C117.485 105.071 126.626 133.229 126.626 133.229C126.626 133.229 106.009 165.628 104.674 167.744C104.674 169.52 107.237 172.652 109.686 174.101C114.255 172.325 159.615 130.175 161.823 120.076C159.324 116.372 138.362 98.395 131.06 93.5227Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref70 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M160.012 113.158L157.013 114.223L158.032 117.089L161.429 115.881C160.74 115.104 160.253 114.168 160.012 113.158Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref71 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M181.539 107.987C181.573 108.229 181.593 108.474 181.6 108.718L186.701 106.907L185.682 104.052L180.733 105.81C181.147 106.473 181.421 107.214 181.539 107.987Z\",\n  fill: \"#0B1B2D\"\n});\n\nvar _ref72 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M173.537 111.581C173.1 110.9 172.812 110.133 172.692 109.333C172.661 109.113 172.639 108.893 172.629 108.676L169.143 109.915C169.499 110.912 169.607 111.981 169.459 113.03L173.537 111.581Z\",\n  fill: \"#0B1B2D\"\n});\n\nfunction SvgNotavailable(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    width: 270,\n    height: 251,\n    viewBox: \"0 0 270 251\",\n    fill: \"none\",\n    xmlns: \"http://www.w3.org/2000/svg\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33, _ref34, _ref35, _ref36, _ref37, _ref38, _ref39, _ref40, _ref41, _ref42, _ref43, _ref44, _ref45, _ref46, _ref47, _ref48, _ref49, _ref50, _ref51, _ref52, _ref53, _ref54, _ref55, _ref56, _ref57, _ref58, _ref59, _ref60, _ref61, _ref62, _ref63, _ref64, _ref65, _ref66, _ref67, _ref68, _ref69, _ref70, _ref71, _ref72);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgNotavailable);\nexport default __webpack_public_path__ + \"static/media/notavailable.274e4f98.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M269.97 117.824C269.034 86.0372 248.314 53.7649 220.257 41.9969C192.152 30.2847 156.785 39.0662 121.652 39.3596C117.209 39.398 112.769 39.2967 108.358 39.1221L105.381 41.3052L100.697 44.449L99.9987 39.1675L100.159 38.7169L99.6075 38.6854C101.668 44.8332 99.1045 53.9431 99.1045 57.4291C99.0922 58.0934 98.8572 58.7342 98.4373 59.249L98.9717 58.8997L99.2337 57.1322L99.8974 52.3083L100.317 49.8073L103.572 52.0813L109.412 60.4052L110.408 62.4661C118.791 67.9397 126.127 81.4963 126.127 83.7108C126.127 84.2104 125.624 84.9893 124.778 85.9324C125.854 87.3296 129.948 93.3482 130.563 94.7174C131.894 93.5822 174.631 57.754 175.333 57.2685C176.035 56.7829 177.251 56.8214 177.726 57.1427C178.111 57.3954 178.391 57.7806 178.511 58.2255C178.632 58.6703 178.585 59.1439 178.379 59.5564C178.002 60.255 172.689 64.9287 172.689 64.9287C173.122 65.4667 175.34 71.0905 172.5 73.7312C170.569 75.5301 168.379 76.1274 166.272 75.0166C164.875 76.5256 131.475 113.44 125.648 113.44C124.569 113.44 122.431 111.914 119.996 109.626L121.516 111.477C122.057 118.313 121.935 123.21 121.167 124.248C116.769 130.109 85.3034 134.828 72.2639 125.484C71.2544 124.765 70.4195 121.247 69.9724 116.098C63.4404 112.717 59.619 109.612 59.144 104.047C58.8436 100.394 62.8222 91.1231 63.4544 90.1974C62.5846 89.6141 61.9664 89.0936 61.7288 88.6849C60.2722 86.2224 67.7648 72.7776 76.5987 65.9522L76.3507 67.042C77.3167 64.64 78.4598 62.3131 79.7704 60.0804C76.7664 58.1941 74.8802 55.6477 74.8802 51.8892C74.8802 48.8851 76.5254 43.4325 77.5803 37.3825C58.9379 36.4848 42.1014 36.9354 29.3762 44.2289C7.06262 56.9855 -2.65854 90.7109 0.621436 119.637C3.84203 148.629 20.0009 172.923 34.8149 197.458C49.6324 222.05 62.9828 246.934 85.1742 260.683C107.425 274.501 138.457 277.254 164.571 267.358C190.629 257.462 211.825 234.918 231.851 207.976C251.936 181.003 270.851 149.677 269.97 117.824Z\",\n  fill: \"#EDF0F4\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M70.0039 93.6626L70.2484 93.7954C70.2484 93.6591 70.2728 93.5194 70.2868 93.3832L70.21 93.7534L70.0039 93.6626Z\",\n  fill: \"#EDF0F4\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M83.4032 61.7675L89.3414 62.3439L94.05 61.5859L95.0979 60.8663C93.108 61.6577 90.9902 62.0791 88.8489 62.1099C85.1218 62.1099 81.992 61.303 79.6517 59.8324L80.0429 60.3075L83.4032 61.7675Z\",\n  fill: \"#EDF0F4\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M72.2778 124.786C72.5049 129.365 72.2778 302.83 72.2778 302.83H84.3812L102.894 188.834\",\n  fill: \"#081829\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M63.4858 89.9844C62.8536 90.903 58.875 100.184 59.1754 103.838C59.6365 109.427 63.4719 112.518 70.0318 115.91\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M76.6407 65.7461C67.8067 72.5715 60.3142 86.0058 61.7673 88.4789C62.4659 89.6351 66.1091 91.6959 70.2624 93.5682\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M110.251 12.3689C113.192 16.7527 114.278 22.9948 112.72 29.3696C110.918 36.7399 106.056 42.3288 100.453 44.3163\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M121.558 110.779C122.099 117.614 121.977 122.512 121.208 123.549C116.814 129.41 85.3488 134.13 72.3058 124.786C68.5263 122.082 67.164 80.2388 79.6901 59.8149\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M100.048 49.4929C104.051 51.1836 107.495 55.8677 110.394 62.1098\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M72.2778 302.83V311.154H100.708V306.452L84.3813 302.83\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M100.708 301.345V311.154H130.483V307.339L112.371 301.345\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M124.604 85.4784C125.152 86.0652 129.931 93.0339 130.598 94.5219C131.929 93.3867 174.666 57.555 175.368 57.0694C176.07 56.5839 177.286 56.6258 177.761 56.9472C178.146 57.1992 178.425 57.5838 178.546 58.0281C178.666 58.4723 178.619 58.9453 178.414 59.3574C178.037 60.056 172.724 64.7297 172.724 64.7297C173.157 65.2711 175.372 70.8949 172.535 73.5357C170.6 75.3346 168.414 75.9319 166.304 74.8176C164.907 76.3301 131.509 113.241 125.683 113.241C122.986 113.241 113.733 103.751 109.566 96.6003\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M95.0735 69.7526C95.0735 81.2797 104.155 97.3477 107.299 97.3477C110.443 97.3477 126.162 85.8207 126.162 83.0262C126.162 80.2318 113.936 59.6228 103.457 59.6228C99.2651 59.6228 95.0735 64.1638 95.0735 69.7526Z\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M94.0291 23.6478C100.051 23.6932 110.984 11.8798 110.984 11.4222C110.984 10.3743 109.126 4.83777 98.343 4.83777C90.6408 4.83777 78.5199 10.231 78.5199 27.9443C78.5199 37.0646 74.9535 46.8068 74.9535 51.208C74.9535 57.8972 80.3468 62.1133 88.8593 62.1133C92.9707 62.1133 99.1534 60.0873 99.1534 56.7619C99.1534 51.8996 104.141 36.1006 94.6124 32.6599\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M95.7092 32.1779C95.1397 32.5493 94.475 32.7483 93.795 32.7508C91.6188 32.7508 89.8549 30.7108 89.8549 28.1923C89.8549 25.6738 91.6188 23.6514 93.795 23.6514C94.2013 23.651 94.6044 23.7219 94.9861 23.861\",\n  stroke: \"#081829\",\n  strokeWidth: 2.5,\n  strokeMiterlimit: 10,\n  strokeLinecap: \"round\"\n});\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M255.17 0H186.005V51.1313H255.17V0Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref18 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M220.586 124.639C236.849 124.639 250.032 111.455 250.032 95.1925C250.032 78.9297 236.849 65.7461 220.586 65.7461C204.323 65.7461 191.139 78.9297 191.139 95.1925C191.139 111.455 204.323 124.639 220.586 124.639Z\",\n  fill: \"#E0E5EC\"\n});\n\nvar _ref19 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M72.2778 124.786C73.3406 125.325 74.3706 125.927 75.3622 126.588L79.6412 128.642L80.235 130.885L104.48 186.745L102.908 188.841\",\n  fill: \"#081829\"\n});\n\nvar _ref20 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M121.208 123.549C117.247 128.831 91.301 133.183 76.6581 127.154L110.635 206.977L100.708 301.345H112.371C112.371 301.345 135.076 219.489 135.076 215.884C135.076 212.28 121.208 123.549 121.208 123.549Z\",\n  fill: \"#081829\"\n});\n\nfunction SvgNotAllowed(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    width: 270,\n    height: 313,\n    viewBox: \"0 0 270 313\",\n    fill: \"none\",\n    xmlns: \"http://www.w3.org/2000/svg\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgNotAllowed);\nexport default __webpack_public_path__ + \"static/media/notAllowed.57f975c6.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M16 0H4C1.79086 0 0 1.79086 0 4V16C0 18.2091 1.79086 20 4 20H16C18.2091 20 20 18.2091 20 16V4C20 1.79086 18.2091 0 16 0Z\",\n  fill: \"#0086C9\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M8.12927 14.179L4.3376 10.3873C4.1098 10.1595 4.1098 9.7902 4.3376 9.56238L5.16253 8.73742C5.39033 8.5096 5.7597 8.5096 5.9875 8.73742L8.54175 11.2916L14.0127 5.82075C14.2405 5.59295 14.6098 5.59295 14.8376 5.82075L15.6626 6.64571C15.8904 6.87351 15.8904 7.24285 15.6626 7.47067L8.95423 14.179C8.72641 14.4068 8.35706 14.4068 8.12927 14.179Z\",\n  fill: \"white\"\n});\n\nfunction SvgChecked(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    width: 20,\n    height: 20,\n    viewBox: \"0 0 20 20\",\n    fill: \"none\",\n    xmlns: \"http://www.w3.org/2000/svg\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgChecked);\nexport default __webpack_public_path__ + \"static/media/checked.b5d24de9.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M4 0.5H16C17.933 0.5 19.5 2.067 19.5 4V16C19.5 17.933 17.933 19.5 16 19.5H4C2.067 19.5 0.5 17.933 0.5 16V4C0.5 2.067 2.067 0.5 4 0.5Z\",\n  fill: \"white\",\n  stroke: \"#CDD5DF\"\n});\n\nfunction SvgUnchecked(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    width: 20,\n    height: 20,\n    viewBox: \"0 0 20 20\",\n    fill: \"none\",\n    xmlns: \"http://www.w3.org/2000/svg\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgUnchecked);\nexport default __webpack_public_path__ + \"static/media/unchecked.bc2fa9d4.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M16 0H4C1.79086 0 0 1.79086 0 4V16C0 18.2091 1.79086 20 4 20H16C18.2091 20 20 18.2091 20 16V4C20 1.79086 18.2091 0 16 0Z\",\n  fill: \"#0086C9\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n  d: \"M15.3571 8.75H4.64286C4.14983 8.75 3.75 9.12318 3.75 9.58333V10.4167C3.75 10.8768 4.14983 11.25 4.64286 11.25H15.3571C15.8502 11.25 16.25 10.8768 16.25 10.4167V9.58333C16.25 9.12318 15.8502 8.75 15.3571 8.75Z\",\n  fill: \"white\"\n});\n\nfunction SvgUndeterminate(_ref, svgRef) {\n  var title = _ref.title,\n      titleId = _ref.titleId,\n      props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    width: 20,\n    height: 20,\n    viewBox: \"0 0 20 20\",\n    fill: \"none\",\n    xmlns: \"http://www.w3.org/2000/svg\",\n    ref: svgRef,\n    \"aria-labelledby\": titleId\n  }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n    id: titleId\n  }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgUndeterminate);\nexport default __webpack_public_path__ + \"static/media/undeterminate.f42039b4.svg\";\nexport { ForwardRef as ReactComponent };","import { SvgIcon } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { ReactComponent as IcursorIcon } from './I-cursor.svg';\r\nimport { ReactComponent as CheckIcon } from './check.svg';\r\nimport { ReactComponent as TimesIcon } from './times.svg';\r\nimport { ReactComponent as ChevronDownIcon } from './chevron-down.svg';\r\nimport { ReactComponent as ChevronUpIcon } from './chevron-up.svg';\r\nimport { ReactComponent as NotAvailableIcon } from './notavailable.svg';\r\nimport { ReactComponent as NotAllowedIcon } from './notAllowed.svg';\r\n\r\nimport { ReactComponent as CheckedIcon } from './checked.svg';\r\nimport { ReactComponent as UncheckedIcon } from './unchecked.svg';\r\nimport { ReactComponent as UndeterminateIcon } from './undeterminate.svg';\r\n\r\nexport function Search(props) {\r\n  return (\r\n    <SvgIcon viewBox=\"0 0 24 16\" {...props}>\r\n      <path\r\n        d=\"M14.4842 12.861L11.8881 10.2649C11.771 10.1477 11.6121 10.0826 11.4455 10.0826H11.021C11.7397 9.16346 12.1667 8.00732 12.1667 6.74963C12.1667 3.75774 9.74251 1.3335 6.75061 1.3335C3.75872 1.3335 1.33447 3.75774 1.33447 6.74963C1.33447 9.74153 3.75872 12.1658 6.75061 12.1658C8.0083 12.1658 9.16444 11.7387 10.0836 11.0201V11.4445C10.0836 11.6111 10.1487 11.77 10.2659 11.8872L12.862 14.4833C13.1068 14.728 13.5026 14.728 13.7447 14.4833L14.4816 13.7463C14.7264 13.5016 14.7264 13.1058 14.4842 12.861ZM6.75061 10.0826C4.90964 10.0826 3.4176 8.5932 3.4176 6.74963C3.4176 4.90867 4.90704 3.41663 6.75061 3.41663C8.59158 3.41663 10.0836 4.90606 10.0836 6.74963C10.0836 8.5906 8.59418 10.0826 6.75061 10.0826Z\"\r\n        fill=\"#98A4B1\"\r\n      />\r\n    </SvgIcon>\r\n  );\r\n}\r\nexport function ICursor(props) {\r\n  return <SvgIcon viewBox=\"0 0 256 512\" component={IcursorIcon} {...props} />;\r\n}\r\nexport function Check(props) {\r\n  return <SvgIcon viewBox=\"0 0 512 512\" component={CheckIcon} {...props} />;\r\n}\r\nexport function Times(props) {\r\n  return <SvgIcon viewBox=\"0 0 352 512\" component={TimesIcon} {...props} />;\r\n}\r\nexport function ChevronDown(props) {\r\n  return (\r\n    <SvgIcon viewBox=\"0 0 448 512\" component={ChevronDownIcon} {...props} />\r\n  );\r\n}\r\nexport function ChevronUp(props) {\r\n  return <SvgIcon viewBox=\"0 0 448 512\" component={ChevronUpIcon} {...props} />;\r\n}\r\nexport function TableHeaderIcon(props) {\r\n  return <SvgIcon viewBox=\"0 0 448 512\" component={ChevronUpIcon} {...props} />;\r\n}\r\nexport function NotAvailableSVG(props) {\r\n  return (\r\n    <SvgIcon\r\n      viewBox=\"0 0 270 251\"\r\n      width=\"270\"\r\n      height=\"251\"\r\n      fontSize=\"inherit\"\r\n      htmlColor=\"#FFFFFF\"\r\n      component={NotAvailableIcon}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n\r\nexport function NotAllowedSVG(props) {\r\n  return (\r\n    <SvgIcon\r\n      viewBox=\"0 0 270 313\"\r\n      width=\"270\"\r\n      height=\"313\"\r\n      fontSize=\"inherit\"\r\n      htmlColor=\"#FFFFFF\"\r\n      component={NotAllowedIcon}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\nexport function Checked(props) {\r\n  return <SvgIcon component={CheckedIcon} {...props} />;\r\n}\r\nexport function Unchecked(props) {\r\n  return <SvgIcon component={UncheckedIcon} {...props} />;\r\n}\r\nexport function Indeterminate(props) {\r\n  return <SvgIcon component={UndeterminateIcon} {...props} />;\r\n}\r\n","/**\r\n *\r\n * RoomTSPicker\r\n *\r\n */\r\n\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePickerProps,\r\n  AutocompletePicker,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface RoomTSPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<string>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/RoomFilter';\r\nexport const initRoomTSData = (id: string) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n    $skip: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n    $select: 'Id,Name',\r\n    $skip: 0,\r\n    $top: 1,\r\n  };\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n};\r\n\r\n/* const loadData = (searchTerm: string | null) => {\r\n  const params: {\r\n    $orderby: string;\r\n    $filter?: string;\r\n    $select: string;\r\n    $top: number;\r\n  } = {\r\n    $orderby: 'Name asc',\r\n    $select: 'Id,Name',\r\n    $top: 1000,\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<string>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<string>[]);\r\n}; */\r\n\r\nconst loadData = getAutoCompleteLoadDataFn<Entity<string>>({ url });\r\n\r\nexport function RoomTSPicker(props: RoomTSPickerProps) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'roomId'}\r\n      placeholder={t(translations.AllUsers)}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RoomTSFilter\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { RoomTSPicker } from 'app/components/pickers/AutocompletePickers/RoomTSPicker';\r\n\r\nexport const RoomTSFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<string> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <RoomTSPicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<string> | undefined | null}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default RoomTSFilter;\r\n","/**\r\n *\r\n * TrainingProgramPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { TrainingProgramAssetsDto } from 'app/pages/TrainingWaitingListPage/Actions/AddToWaitingList';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity, Identifiable } from 'types/common';\r\nimport { IApplyGlobalServiceGroupFilter } from 'types/IApplyGlobalServiceGroupFilter';\r\n\r\nexport interface TrainingProgramsMultiPickerProps\r\n  extends Omit<AutocompleteMultiPickerProps<number>, 'loadData'>,\r\n    IApplyGlobalServiceGroupFilter {\r\n  ServiceGroupId?: number;\r\n}\r\nconst url = '/api/odata/v4/TrainingProgramsFilter';\r\nexport const initTrainingProgramMultiData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const ids = initval.split('|').map(v => parseInt(v));\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id in (' + ids.map(v => \"'\" + v + \"'\").join(',') + '))',\r\n      $select: 'Id,Name,ServiceGroupId',\r\n      $skip: 0,\r\n      $top: ids.length,\r\n    };\r\n\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport function withServiceGroupFilter(\r\n  globalServiceGroupFilter?: Identifiable<number>[],\r\n) {\r\n  return (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string; $select: string } = {\r\n      $orderby: 'Name asc',\r\n      $select: 'Id,Name,ServiceGroupId',\r\n    };\r\n\r\n    params.$filter = new ODataFilterBuilder<TrainingProgramAssetsDto>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm === null ? undefined : searchTerm,\r\n      globalServiceGroupFilter:\r\n        !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n          ? [\r\n              new Condition<TrainingProgramAssetsDto>(\r\n                'ServiceGroupId',\r\n                ODataOperators.Includes,\r\n                globalServiceGroupFilter.map(f => f.Id),\r\n              ),\r\n            ]\r\n          : [],\r\n    }).toString();\r\n\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  };\r\n}\r\nexport function TrainingProgramsMultiPicker(\r\n  props: TrainingProgramsMultiPickerProps,\r\n) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const loadData = withServiceGroupFilter(\r\n    props.applyGlobalServiceGroupFilter\r\n      ? globalServiceGroupFilter || []\r\n      : props.ServiceGroupId !== undefined\r\n      ? [{ Id: props.ServiceGroupId }]\r\n      : undefined,\r\n  );\r\n\r\n  return (\r\n    <AutocompleteMultiPicker\r\n      loadData={loadData}\r\n      mini={props.mini ? true : undefined}\r\n      ariaLabel=\"Service Search\"\r\n      id={props.id || 'trainingprogramId'}\r\n      size={props.size}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { TrainingProgramsMultiPicker } from 'app/components/pickers/MultiSelectPickers/TrainingProgramsMultiPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport const TrainingProgramsMultiFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number>[]) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <TrainingProgramsMultiPicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number>[]}\r\n      isOpen={false}\r\n      placeholder={t(translations.AllValues)}\r\n      size=\"small\"\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { CampusPickerFilter } from 'app/components/BasicTable/Filters';\r\nimport { DatesRangeFilter } from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport {\r\n  arrayToQueryString,\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  getDefaultFilterDatePeriod,\r\n  getNumberEntityArray,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  GetStringOrUndefined,\r\n  initMultiPickerValue,\r\n  initPickerValue,\r\n  presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initCampusData } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport { IsAssetFieldEnabled } from 'types/AppSettings';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { initRoomTSData } from 'app/components/pickers/AutocompletePickers/RoomTSPicker';\r\nimport RoomTSFilter from 'app/components/BasicTable/Filters/RoomTSFilter';\r\nimport { TrainingProgramsMultiFilter } from 'app/components/BasicTable/Filters/TrainingProgramsMultiFilter';\r\nimport { initTrainingProgramMultiData } from 'app/components/pickers/MultiSelectPickers/TrainingProgramsMultiPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport { IsEntityType } from 'app/components/BasicTable/BasicFilter/AppliedFilterComponent';\r\nimport { TrainingState } from 'enums/TrainingState';\r\nimport UserFilter from 'app/components/BasicTable/Filters/UserFilter';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\n\r\n//SG=&eqid=1&campus=&building=&room=&defaultSGids=AllCores&nextonly=false&period=5&Start=2021-11-01T00%3A00%3A00&End=2021-12-01T00%3A00%3A00&sSortCol_0=AssetId\r\nexport const GetFilters: GetPageFilters<ITrainingSessionsRow> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const result: IFilterSettings<ITrainingSessionsRow>[] = [\r\n    {\r\n      fieldName: 'ServiceId',\r\n      displayName: t(translations.TrainingProgram),\r\n      operator: ODataOperators.Includes,\r\n      queryStringSerializer: arrayToQueryString('eqid'),\r\n      value: getNumberEntityArray(params, 'eqid'),\r\n      component: TrainingProgramsMultiFilter,\r\n      initData: initMultiPickerValue(initTrainingProgramMultiData),\r\n      urlKey: 'eqid',\r\n    },\r\n    {\r\n      fieldName: 'StartDate',\r\n      displayName: t(translations.CustomDatePeriods),\r\n      operator: ODataOperators.Between,\r\n      component: DatesRangeFilter,\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'start',\r\n        'end',\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'start', 'end', params),\r\n      urlKey: 'period',\r\n    },\r\n    // hidden filter on the task https://prog4biz.atlassian.net/browse/BKT-8217, due to no relevant to the data source,\r\n    // because a source is return only next sessions\r\n    // {\r\n    //   fieldName: 'HasNextSession',\r\n    //   displayName: t(translations.HasNextSession),\r\n    //   operator: ODataOperators.Equals,\r\n    //   component: BooleanPickerFilter,\r\n    //   queryStringSerializer: 'HNS',\r\n    //   value: GetBooleanEntity(\r\n    //     GetBooleanOrUndefined(GetRawValue(params, 'HNS')),\r\n    //     t,\r\n    //   ),\r\n    //   customFilter(value, settings) {\r\n    //     if (IsEntityType(value) && value.Id === true) {\r\n    //       return new Condition(\r\n    //         settings.fieldName,\r\n    //         settings.operator,\r\n    //         value,\r\n    //       ).toString();\r\n    //     }\r\n    //   },\r\n    //   notNullable: true,\r\n    // },\r\n    {\r\n      fieldName: 'TrainingState',\r\n      displayName: t(translations.ShowOnlyWithAvailability),\r\n      operator: ODataOperators.Includes,\r\n      component: BooleanPickerFilter,\r\n      queryStringSerializer: 'OWF',\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'OWF')),\r\n        t,\r\n      ),\r\n      customFilter(value, settings) {\r\n        if (IsEntityType(value) && value.Id === true) {\r\n          return new Condition(settings.fieldName, settings.operator, [\r\n            TrainingState.Available,\r\n            TrainingState.UnderMinimum,\r\n          ]).toString();\r\n        }\r\n      },\r\n      urlKey: 'OWF',\r\n    },\r\n    {\r\n      fieldName: 'IsUpcoming',\r\n      displayName: t(translations.UpcomingSessionsOnly),\r\n      operator: ODataOperators.Equals,\r\n      component: BooleanPickerFilter,\r\n      queryStringSerializer: 'upcoming',\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'upcoming')),\r\n        t,\r\n      ),\r\n      customFilter(value, settings) {\r\n        if (IsEntityType(value) && value.Id === true) {\r\n          return new Condition(\r\n            settings.fieldName,\r\n            settings.operator,\r\n            value,\r\n            settings.fieldName1,\r\n          ).toString();\r\n        }\r\n      },\r\n      urlKey: 'upcoming',\r\n    },\r\n    {\r\n      fieldName: 'Trainer',\r\n      displayName: t(translations.TrainerName),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'trainer',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'trainer')),\r\n      ),\r\n      component: UserFilter,\r\n      initData: initPickerValue(initUserData),\r\n    },\r\n  ];\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Building)) {\r\n    result.push({\r\n      fieldName: 'BuildingId',\r\n      displayName: t(translations.Building),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'building',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'building')),\r\n      ),\r\n      initData: initPickerValue(initBuildingData),\r\n      component: BuildingPickerFilter,\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Room)) {\r\n    result.push({\r\n      fieldName: 'Room',\r\n      displayName: t(translations.Room),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'room',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'room')),\r\n      ),\r\n      initData: initPickerValue(initRoomTSData),\r\n      component: RoomTSFilter,\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Campus)) {\r\n    result.push({\r\n      fieldName: 'CampusId',\r\n      displayName: t(translations.Campus),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'campus',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'campus')),\r\n      ),\r\n      initData: initPickerValue(initCampusData),\r\n      component: CampusPickerFilter,\r\n    });\r\n  }\r\n  return result;\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { IRequestTypeFilterDto } from 'api/odata/generated/entities/IRequestTypeFilterDto';\r\n\r\nexport interface ActiveSampleTypesPickerProps\r\n  extends Omit<AutocompletePickerProps<IRequestTypeFilterDto>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ActiveSampleTypesFilter';\r\n\r\nexport const initActiveSampleTypesData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nconst loadData = (\r\n  predicates: (string | Condition<IRequestTypeFilterDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<IRequestTypeFilterDto>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'ServiceGroupId',\r\n      'HideProjects',\r\n      'ProjectIsRequired',\r\n    ],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IRequestTypeFilterDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n\r\nexport const loadActiveSampleTypes = loadData;\r\n\r\nexport function ActiveSampleTypesPicker(props: ActiveSampleTypesPickerProps) {\r\n  const globalServiceGroupFilter = useSelector(selectGlobalServiceGroupFilter);\r\n  const innerLoadData = loadData(\r\n    props.predicates,\r\n    globalServiceGroupFilter || [],\r\n  );\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'ActiveSampleTypesId'}\r\n      loadData={innerLoadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface RelevantBudgetPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {\r\n  userGroupId: string;\r\n  userName: string;\r\n  serviceId?: number;\r\n  fundingTypeId?: number;\r\n}\r\n\r\nconst url = '/api/odata/v4/BudgetFilter';\r\n\r\nexport const RelevantBudgetPicker = (props: RelevantBudgetPickerProps) => {\r\n  const loadData = (searchTerm: string | null) => {\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select?: string;\r\n      userGroupId?: string;\r\n      userName?: string;\r\n      serviceId?: number;\r\n      $top?: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $select: 'Id,Name,IsDefault,FundingTypeId,PurchaseOrderOptionId',\r\n      $top: 200,\r\n    };\r\n    params.userGroupId = props.userGroupId;\r\n    params.userName = props.userName;\r\n    params.serviceId = props.serviceId;\r\n    if (searchTerm !== null || props.fundingTypeId !== undefined) {\r\n      params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n        predicates:\r\n          props.fundingTypeId !== undefined\r\n            ? [\r\n                `${new Condition<IBudgetFilterDto>(\r\n                  'FundingTypeId',\r\n                  ODataOperators.Equals,\r\n                  props.fundingTypeId,\r\n                ).toString()}`,\r\n              ]\r\n            : [],\r\n        stringColumns: ['Name'],\r\n        stringSearch: searchTerm,\r\n      }).toString();\r\n    }\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  };\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      {...props}\r\n      id={props.id || 'reservationbudgetId'}\r\n    />\r\n  );\r\n};\r\nexport const DefaultBudget = (\r\n  userGroupId: string | null,\r\n  userName: string,\r\n  selectedBudget: Entity<number> | null,\r\n  serviceId?: number,\r\n  fundingTypeId?: number,\r\n): Promise<Entity<number> | null> => {\r\n  return new Promise((resolve, reject) => {\r\n    (async () => {\r\n      try {\r\n        const params: {\r\n          $orderby: string;\r\n          $filter?: string;\r\n          $select?: string;\r\n          userGroupId?: string;\r\n          userName?: string;\r\n          serviceId?: number;\r\n        } = {\r\n          $orderby: 'Name asc',\r\n          $select: 'Id,Name,IsDefault,FundingTypeId,PurchaseOrderOptionId',\r\n        };\r\n        params.userGroupId = userGroupId ?? undefined;\r\n        params.userName = userName;\r\n        params.serviceId = serviceId;\r\n\r\n        let budgets = await httpClient\r\n          .get(url, params)\r\n          .then(response => response.value as Entity<number>[]);\r\n        if (!!budgets && budgets.length > 0) {\r\n          let filtered =\r\n            fundingTypeId !== undefined\r\n              ? budgets.filter(\r\n                  f => (f as IBudgetFilterDto).FundingTypeId === fundingTypeId,\r\n                )\r\n              : budgets;\r\n          if (selectedBudget !== null) {\r\n            if (filtered.some(f => f.Id === selectedBudget.Id)) {\r\n              resolve(selectedBudget);\r\n            } else {\r\n              if (filtered.length === 1) {\r\n                resolve(filtered[0]);\r\n              } else {\r\n                let defaults = filtered.filter(\r\n                  f => (f as IBudgetFilterDto).IsDefault === true,\r\n                );\r\n                if (!!defaults && defaults.length > 0) {\r\n                  resolve(defaults[0]);\r\n                } else {\r\n                  resolve(null);\r\n                }\r\n              }\r\n            }\r\n          } else {\r\n            if (filtered.length === 1) {\r\n              resolve(filtered[0]);\r\n            } else {\r\n              let defaults = filtered.filter(\r\n                f => (f as IBudgetFilterDto).IsDefault === true,\r\n              );\r\n              if (!!defaults && defaults.length > 0) {\r\n                resolve(defaults[0]);\r\n              } else {\r\n                resolve(null);\r\n              }\r\n            }\r\n          }\r\n        } else {\r\n          resolve(null);\r\n        }\r\n      } catch {\r\n        resolve(null);\r\n      }\r\n    })();\r\n  });\r\n};\r\n","import * as React from 'react';\r\nimport { Box, Grid } from '@material-ui/core';\r\nimport { ServiceRequestsApi } from 'api/ServiceRequestsApi';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport {\r\n  ActiveSampleTypesPicker,\r\n  initActiveSampleTypesData,\r\n} from 'app/components/pickers/AutocompletePickers/ActiveSampleTypesPicker';\r\nimport {\r\n  DefaultBudget,\r\n  RelevantBudgetPicker,\r\n} from 'app/components/pickers/AutocompletePickers/RelevantBudgetPicker';\r\nimport { UserPicker } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { Alert, Skeleton } from '@material-ui/lab';\r\nimport {\r\n  convertAuthToIUserFilterDto,\r\n  IUserFilterDto,\r\n} from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { IRequestTypeFilterDto } from 'api/odata/generated/entities/IRequestTypeFilterDto';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IIsAdminOfParams } from 'types/AuthenticatedUser';\r\nimport { ServiceRequestDetailsProps } from 'app/pages/Samples/RequestSamplesPage';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { Roles } from 'app/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport {\r\n  FundingTypeIdPicker,\r\n  getSingleInvoiceFundingType,\r\n} from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\n\r\nexport interface CreateNewRequestParams {\r\n  isOpen: boolean;\r\n  setOpen: (val: boolean) => void;\r\n  serviceId?: number;\r\n  error?: string;\r\n}\r\nexport const CreateNewRequest = ({\r\n  isOpen,\r\n  setOpen,\r\n  serviceId,\r\n  ...props\r\n}: CreateNewRequestParams) => {\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const [error, setError] = React.useState<string | undefined>(props.error);\r\n  const [chosenUser, setChosenUser] = useState<IUserFilterDto | null>(\r\n    authenticatedUser !== undefined\r\n      ? convertAuthToIUserFilterDto(authenticatedUser)\r\n      : null,\r\n  );\r\n  const [chosenFundingType, setFundingType] = React.useState<Entity<\r\n    number\r\n  > | null>(null);\r\n  const [chosenPurchaseOrder, setPurchaseOrder] = React.useState<string | null>(\r\n    null,\r\n  );\r\n  const [chosenBudget, setChosenBudget] = useAsyncExtendedState<Entity<\r\n    number\r\n  > | null>(null);\r\n  const [busy, setBusy] = useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const globalSettings = useGlobalSettingsHook();\r\n  const [service, setService] = useAsyncExtendedState<Entity<number> | null>(\r\n    null,\r\n  );\r\n\r\n  const [getServiceRequest, getService] = usePromise(\r\n    React.useCallback((serviceId?: number) => {\r\n      return initActiveSampleTypesData(serviceId?.toString()).then(d => d[0]);\r\n    }, []),\r\n  );\r\n  const isAdmin = React.useMemo(() => {\r\n    return (\r\n      authenticatedUser !== undefined &&\r\n      authenticatedUser.IsAdminOf({\r\n        ServiceTypeId: ServiceType.Sample,\r\n        ServiceId: service?.Id,\r\n        ServiceGroupId: (service as IRequestTypeFilterDto)?.ServiceGroupId,\r\n      } as IIsAdminOfParams)\r\n    );\r\n  }, [authenticatedUser, service]);\r\n\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      authenticatedUser !== undefined &&\r\n      (authenticatedUser.Roles.includes(Roles.CalendarOnly) ||\r\n        authenticatedUser.Roles.includes(Roles.Readonly) ||\r\n        authenticatedUser.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [authenticatedUser]);\r\n\r\n  const showProject = React.useMemo(() => {\r\n    return (\r\n      service !== null &&\r\n      service !== undefined &&\r\n      IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n      ((IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n        (service as IRequestTypeFilterDto).HideProjects === false &&\r\n        ((service as IRequestTypeFilterDto).ProjectIsRequired !== false ||\r\n          isAdmin)) ||\r\n        !IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents))\r\n    );\r\n  }, [appSettings, isAdmin, service]);\r\n  const fundingTypeVisible = React.useMemo(() => {\r\n    return (\r\n      IsBudgetFieldEnabled(appSettings, BudgetFields.FundingType) &&\r\n      IsBudgetFieldEnabled(appSettings, BudgetFields.PurchaseOrderOption) &&\r\n      showProject\r\n    );\r\n  }, [appSettings, showProject]);\r\n  const purchaseOrderLength = React.useMemo(() => {\r\n    return globalSettings.purchaseOrderLengthSetting ?? 0;\r\n  }, [globalSettings.purchaseOrderLengthSetting]);\r\n\r\n  const purchaseOrderVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      ((chosenBudget as IBudgetFilterDto)?.PurchaseOrderOptionId ??\r\n        PurchaseOrderOptions.Hidden) !== PurchaseOrderOptions.Hidden\r\n    );\r\n  }, [chosenBudget, globalSettings.purchaseOrderBudgetEnabled]);\r\n  const purchaseOrderRequired = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      (chosenBudget as IBudgetFilterDto)?.PurchaseOrderOptionId ===\r\n        PurchaseOrderOptions.Mandatory &&\r\n      chosenPurchaseOrder === null\r\n    );\r\n  }, [\r\n    chosenBudget,\r\n    chosenPurchaseOrder,\r\n    globalSettings.purchaseOrderBudgetEnabled,\r\n  ]);\r\n  const purchaseLengthInvalid = React.useMemo(() => {\r\n    return (\r\n      purchaseOrderVisible &&\r\n      (purchaseOrderRequired ||\r\n        (!purchaseOrderRequired && (chosenPurchaseOrder?.length ?? 0) > 0)) &&\r\n      (chosenPurchaseOrder?.length ?? 0) < purchaseOrderLength\r\n    );\r\n  }, [\r\n    chosenPurchaseOrder?.length,\r\n    purchaseOrderLength,\r\n    purchaseOrderRequired,\r\n    purchaseOrderVisible,\r\n  ]);\r\n  const projectIsRequired = React.useMemo(() => {\r\n    return (\r\n      service !== null &&\r\n      service !== undefined &&\r\n      IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n      (chosenBudget === null || chosenBudget === undefined) &&\r\n      ((IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n        (service as IRequestTypeFilterDto).HideProjects === false &&\r\n        (service as IRequestTypeFilterDto).ProjectIsRequired === null) ||\r\n        !IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents))\r\n    );\r\n  }, [appSettings, chosenBudget, service]);\r\n  const onUserChange = React.useCallback(\r\n    (value: IUserFilterDto | null) => {\r\n      if (showProject) {\r\n        if (value === null || value === undefined) {\r\n          setChosenBudget(null);\r\n        } else {\r\n          setChosenBudget(\r\n            DefaultBudget(\r\n              value.UserGroupId,\r\n              value.Id,\r\n              chosenBudget,\r\n              service?.Id,\r\n              chosenFundingType?.Id ?? undefined,\r\n            ),\r\n          );\r\n        }\r\n      }\r\n      setChosenUser(value);\r\n    },\r\n    [\r\n      chosenBudget,\r\n      chosenFundingType,\r\n      service?.Id,\r\n      setChosenBudget,\r\n      showProject,\r\n    ],\r\n  );\r\n  React.useEffect(() => {\r\n    if (\r\n      fundingTypeVisible &&\r\n      chosenBudget !== null &&\r\n      chosenFundingType === null\r\n    ) {\r\n      setFundingType(\r\n        getSingleInvoiceFundingType(\r\n          (chosenBudget as IBudgetFilterDto).FundingTypeId ?? 0,\r\n        ),\r\n      );\r\n    }\r\n  }, [chosenBudget, chosenFundingType, fundingTypeVisible]);\r\n  React.useEffect(() => {\r\n    if (projectIsRequired && chosenUser !== null) {\r\n      setChosenBudget(\r\n        DefaultBudget(\r\n          chosenUser.UserGroupId,\r\n          chosenUser.Id,\r\n          null,\r\n          service?.Id,\r\n          chosenFundingType?.Id ?? undefined,\r\n        ),\r\n      );\r\n    }\r\n  }, [\r\n    chosenFundingType,\r\n    chosenUser,\r\n    projectIsRequired,\r\n    service?.Id,\r\n    setChosenBudget,\r\n  ]);\r\n  React.useEffect(() => {\r\n    if (\r\n      getServiceRequest.status !== 'pending' &&\r\n      getServiceRequest.status !== 'resolved'\r\n    ) {\r\n      setService(getService(serviceId));\r\n    }\r\n  }, [serviceId, getService, setService, getServiceRequest.status]);\r\n\r\n  return (\r\n    // TODO: switch to DialogForm with proper form schema & validation\r\n    <DialogConfirm\r\n      isOpen={isOpen}\r\n      onCancel={() => setOpen(false)}\r\n      onConfirm={e => {\r\n        e.preventDefault();\r\n        setBusy(true);\r\n        setError(undefined);\r\n        //let user = chosenUser; //(isAdmin && chosenUser) || authenticatedUser;\r\n        if (service && chosenUser) {\r\n          ServiceRequestsApi.AddRequest(\r\n            service?.Id,\r\n            chosenBudget === null ? 0 : chosenBudget.Id,\r\n            chosenUser?.Id,\r\n            chosenUser?.UserGroupId ?? undefined,\r\n            chosenFundingType?.Id ?? null,\r\n            chosenPurchaseOrder,\r\n          )\r\n            .then(response => {\r\n              setBusy(false);\r\n              if (response.ErrorMessages.length > 0) {\r\n                response.ErrorMessages.forEach(errmsg =>\r\n                  dispatch(\r\n                    actions.addNotification({\r\n                      variant: 'error',\r\n                      message: errmsg,\r\n                    }),\r\n                  ),\r\n                );\r\n              }\r\n              if (response.SuccessMessages.length > 0) {\r\n                const id = tryParseInt(response.SuccessMessages[0]);\r\n                if (id === undefined) {\r\n                  console.error(\r\n                    'Invalid service request id returned from the server',\r\n                    response,\r\n                  );\r\n                  dispatch(\r\n                    actions.addNotification({\r\n                      variant: 'error',\r\n                      message: `${t(\r\n                        translations.Requests_Created_Failure,\r\n                      )}. (invalid service request id returned from the server).`,\r\n                    }),\r\n                  );\r\n                } else {\r\n                  dispatch(\r\n                    actions.addNotification({\r\n                      variant: 'success',\r\n                      message: t(translations.Requests_Created_Success),\r\n                    }),\r\n                  );\r\n                  setOpen(false);\r\n                  const propsSide: ServiceRequestDetailsProps = {\r\n                    id: id,\r\n                    useSidePanel: true,\r\n                  };\r\n                  dispatch(layoutActions.setRefreshTable(true));\r\n                  dispatch(\r\n                    layoutActions.openSidePanel({\r\n                      type: RenderPageType.ServiceRequestDetails,\r\n                      props: propsSide,\r\n                      expanded: true,\r\n                    }),\r\n                  );\r\n                  setService(null);\r\n                  setChosenBudget(null);\r\n                  //dispatch(push(GetServiceRequestDetailsPath(id)));\r\n                }\r\n              }\r\n            })\r\n            .catch(err => {\r\n              setBusy(false);\r\n              console.error(err);\r\n            });\r\n        }\r\n      }}\r\n      disabled={\r\n        isReadOnlyUser ||\r\n        !service ||\r\n        (showProject && projectIsRequired && chosenBudget === null) ||\r\n        (fundingTypeVisible &&\r\n          projectIsRequired &&\r\n          chosenFundingType === null) ||\r\n        (purchaseOrderVisible && purchaseLengthInvalid) ||\r\n        busy\r\n      }\r\n      body={\r\n        <Box>\r\n          <Box mt={2}>\r\n            <Grid container direction=\"column\" spacing={2}>\r\n              {error !== undefined && (\r\n                <Grid item xs={12}>\r\n                  <Alert color=\"error\">{error}</Alert>{' '}\r\n                </Grid>\r\n              )}\r\n              <Grid item xs={12}>\r\n                {getServiceRequest.status === 'pending' ? (\r\n                  <Skeleton height={48} variant=\"rect\" />\r\n                ) : (\r\n                  <ActiveSampleTypesPicker\r\n                    variant=\"filled\"\r\n                    fullWidth\r\n                    value={service as IRequestTypeFilterDto}\r\n                    onChange={val => {\r\n                      setService(val);\r\n                      setChosenBudget(null);\r\n                    }}\r\n                    label={t(translations.RequiredLabServiceLabel)}\r\n                  />\r\n                )}\r\n              </Grid>\r\n              <Grid item xs={12}>\r\n                <UserPicker\r\n                  variant=\"filled\"\r\n                  fullWidth\r\n                  value={chosenUser as IUserFilterDto}\r\n                  defaultValue={\r\n                    !!authenticatedUser\r\n                      ? convertAuthToIUserFilterDto(authenticatedUser)\r\n                      : null\r\n                  }\r\n                  onChange={onUserChange}\r\n                  selectArray={[\r\n                    'Id',\r\n                    'Name',\r\n                    'UserGroupId',\r\n                    'UserGroups',\r\n                    'Budgets',\r\n                    'IsAdminPanel',\r\n                    'IsEquipmentAdmin',\r\n                    'IsGroupAdmin',\r\n                    'IsLabTech',\r\n                    //'Groups',\r\n                    'Services',\r\n                  ]}\r\n                  disabled={!isAdmin}\r\n                  label={t(translations.PleaseSelectUser)}\r\n                  placeholder={t(translations.PleaseSelectUser)}\r\n                />\r\n              </Grid>\r\n              {fundingTypeVisible && (\r\n                <Grid item xs={12}>\r\n                  <FundingTypeIdPicker\r\n                    name=\"FundingType\"\r\n                    label={t(translations.FundingType)}\r\n                    variant=\"filled\"\r\n                    value={chosenFundingType}\r\n                    error={Boolean(\r\n                      fundingTypeVisible &&\r\n                        chosenFundingType === null &&\r\n                        projectIsRequired,\r\n                    )}\r\n                    helperText={\r\n                      fundingTypeVisible &&\r\n                      chosenFundingType === null &&\r\n                      projectIsRequired\r\n                        ? t(translations.FundingTypeRequired)\r\n                        : undefined\r\n                    }\r\n                    onChange={value => {\r\n                      setFundingType(value);\r\n                      if (\r\n                        value?.Id !==\r\n                        (chosenBudget as IBudgetFilterDto)?.FundingTypeId\r\n                      ) {\r\n                        setChosenBudget(null);\r\n                      }\r\n                    }}\r\n                    fullWidth\r\n                  />\r\n                </Grid>\r\n              )}\r\n\r\n              {showProject && (\r\n                <Grid item xs={12}>\r\n                  <RelevantBudgetPicker\r\n                    variant=\"filled\"\r\n                    fullWidth\r\n                    value={chosenBudget}\r\n                    userGroupId={chosenUser?.UserGroupId ?? ''}\r\n                    userName={chosenUser?.Id || ''}\r\n                    serviceId={service?.Id || 0}\r\n                    onChange={val => setChosenBudget(val)}\r\n                    label={t(translations.PleaseSelectABudgetNumber)}\r\n                    placeholder={t(translations.PleaseSelectABudgetNumber)}\r\n                    error={Boolean(projectIsRequired && chosenBudget === null)}\r\n                    helperText={\r\n                      projectIsRequired && chosenBudget === null\r\n                        ? t(translations.BudgetIsRequired)\r\n                        : undefined\r\n                    }\r\n                    fundingTypeId={chosenFundingType?.Id}\r\n                    disabled={!!!service}\r\n                  />\r\n                </Grid>\r\n              )}\r\n              {purchaseOrderVisible && (\r\n                <Grid item xs={12}>\r\n                  <BaseTextField\r\n                    id=\"requestPurchaseOrder\"\r\n                    name=\"PurchaseOrder\"\r\n                    label={t(translations.PurchaseOrder)}\r\n                    fullWidth\r\n                    variant=\"filled\"\r\n                    error={Boolean(\r\n                      purchaseLengthInvalid || purchaseOrderRequired,\r\n                    )}\r\n                    helperText={\r\n                      purchaseLengthInvalid\r\n                        ? (t(\r\n                            translations.Reservation_Error_ShortPurchaseOrderLength,\r\n                          ) as string).replace(\r\n                            '{0}',\r\n                            purchaseOrderLength.toString(),\r\n                          )\r\n                        : purchaseOrderRequired\r\n                        ? t(\r\n                            translations.Reservation_Error_PurchaseOrderRequired,\r\n                          )\r\n                        : undefined\r\n                    }\r\n                    onChange={ev => {\r\n                      let val = ev.target.value;\r\n                      setPurchaseOrder(val === '' ? null : val);\r\n                    }}\r\n                    value={chosenPurchaseOrder ?? ''}\r\n                  />\r\n                </Grid>\r\n              )}\r\n            </Grid>\r\n          </Box>\r\n        </Box>\r\n      }\r\n      title={t(translations.ServiceRequests_Ordering)}\r\n    />\r\n  );\r\n};\r\n","import { Theme } from '@material-ui/core';\r\nimport Popper, { PopperProps } from '@material-ui/core/Popper';\r\nimport * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface SidePanelRootProps {\r\n  children: React.ReactNode;\r\n  className?: string;\r\n}\r\nexport const SidePanelRoot = React.forwardRef(\r\n  ({ className, children }: SidePanelRootProps, ref: any) => (\r\n    <div ref={ref} className={className}>\r\n      {children}\r\n    </div>\r\n  ),\r\n);\r\nexport const SidePanelPopper = styled(\r\n  ({\r\n    sidePanelWidth,\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    sidePanelWidth: number;\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & PopperProps) => <Popper {...other}>{children}</Popper>,\r\n)`\r\n  &.sidePanelPopper {\r\n    z-index: ${props => props.theme.zIndex.modal};\r\n    height: 100dvh;\r\n    border-left: 1px solid ${bookitColors.grayscale.grayBorders};\r\n    &.rootopen {\r\n      width: 100%;\r\n      transform: unset;\r\n      &.mobileroot {\r\n        padding-top: 0px;\r\n      }\r\n    }\r\n    &.rootclose {\r\n      width: 100vw;\r\n      &.mobileroot {\r\n        inset-block: 50px auto;\r\n        height: calc(100% - 50px);\r\n        padding-top: 0px;\r\n      }\r\n    }\r\n    @media (max-width: ${props => props.theme.breakpoints.values.md}px) {\r\n      &.rootclose {\r\n        width: 100%;\r\n        min-width: 600px;\r\n      }\r\n    }\r\n    @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n      &.rootclose {\r\n        width: 100%;\r\n        min-width: 370px;\r\n      }\r\n    }\r\n    @media (min-width: ${props => props.theme.breakpoints.values.md}px) {\r\n      &.rootclose {\r\n        width: ${props => props.sidePanelWidth}px;\r\n      }\r\n    }\r\n    & .paper {\r\n      background: ${bookitColors.base.white};\r\n      border-radius: 0;\r\n      max-height: 100dvh;\r\n      height: auto;\r\n      margin: 0;\r\n      box-shadow: unset;\r\n    }\r\n    @media (max-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n      & .paper {\r\n        max-width: 100%;\r\n      }\r\n    }\r\n  }\r\n`;\r\n","import { useTheme } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nimport { SidePanelRenderer } from './SidePanelRenderer';\r\nimport { PageTypeProps, RenderPageType } from '../../slice/type';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from '../../slice';\r\nimport { SidePanelPopper, SidePanelRoot } from './wrappers';\r\n\r\nexport interface SidePanelPopupProps {\r\n  renderPageType?: RenderPageType;\r\n  renderPageProps?: PageTypeProps;\r\n  sidePanelOpen: boolean;\r\n  sidePanelExpanded: boolean;\r\n  sidePanelWidth: number;\r\n}\r\n\r\nexport const SidePanelPopup = (props: SidePanelPopupProps) => {\r\n  const { checkIsMobile } = useIsMobile();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const isMobile = checkIsMobile();\r\n  const {\r\n    renderPageType,\r\n    renderPageProps,\r\n    sidePanelOpen,\r\n    sidePanelExpanded,\r\n    sidePanelWidth,\r\n  } = props;\r\n  const elementRef = React.useRef<HTMLDivElement>(null);\r\n  const closeSidePanel = React.useCallback(() => {\r\n    dispatch(actions.resetSidePanel());\r\n  }, [actions, dispatch]);\r\n  // manually trigger rerender using a useless usState hook\r\n  // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n  const countState = React.useState(0);\r\n  React.useEffect(() => {\r\n    countState[1](c => c + 1);\r\n    // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [elementRef.current]);\r\n  const theme = useTheme();\r\n  return (\r\n    <SidePanelRoot\r\n      ref={elementRef}\r\n      className={clsx(isMobile ? 'sidePanelMobileRoot' : 'sidePanelRoot', {\r\n        sidePanelRootExpanded: sidePanelExpanded && !isMobile,\r\n        sidePanelRootCollapsed: !sidePanelExpanded && sidePanelOpen,\r\n      })}\r\n    >\r\n      <React.Fragment>\r\n        {isMobile ? (\r\n          // <Slide\r\n          //   direction={'down'}\r\n          //   in={sidePanelOpen}\r\n          //   ref={elementRef}\r\n          //   mountOnEnter\r\n          //   unmountOnExit\r\n          //   timeout={{\r\n          //     appear: 100,\r\n          //     enter: 50,\r\n          //     exit: 100,\r\n          //   }}\r\n          // >\r\n          //   <Backdrop\r\n          //     className={'sidePanelBackdrop'}\r\n          //     open={isMobile && sidePanelOpen}\r\n          //     id=\"backdropPanel\"\r\n          //     invisible={!isMobile}\r\n          //     onClick={ev => {\r\n          //       if (ev.currentTarget.id === (ev.target as any).id && isMobile) {\r\n          //         closeSidePanel();\r\n          //       } else {\r\n          //         //ev.preventDefault();\r\n          //       }\r\n          //     }}\r\n          //   >\r\n          <React.Fragment>\r\n            <div\r\n              id=\"backdropPanel\"\r\n              className={clsx('backdrop', { backdropOpen: sidePanelOpen })}\r\n              onClick={ev => {\r\n                if (ev.currentTarget.id === (ev.target as any).id && isMobile) {\r\n                  closeSidePanel();\r\n                } else {\r\n                  //ev.preventDefault();\r\n                }\r\n              }}\r\n            ></div>\r\n            <SidePanelPopper\r\n              theme={theme}\r\n              open={sidePanelOpen || false}\r\n              sidePanelWidth={sidePanelWidth}\r\n              anchorEl={elementRef.current}\r\n              disablePortal\r\n              placement={isMobile ? 'right-start' : 'top-end'}\r\n              transition\r\n              className={clsx('sidePanelPopper', {\r\n                rootopen: sidePanelExpanded,\r\n                rootclose: !sidePanelExpanded,\r\n                mobileroot: isMobile,\r\n              })}\r\n              modifiers={{\r\n                keepTogether: { enabled: true },\r\n                preventOverflow: {\r\n                  enabled: true,\r\n                  // altAxis: true,\r\n                  // altBoundary: true,\r\n                  // tether: false,\r\n                  // rootBoundary: 'document',\r\n                  boundariesElement: `${\r\n                    !sidePanelExpanded || isMobile ? 'viewport' : 'window'\r\n                  }`, //scrollParent, window, viewport\r\n                  padding: 0,\r\n                },\r\n                flip: { enabled: false },\r\n              }}\r\n            >\r\n              <div className={'paper'}>\r\n                <React.Fragment>\r\n                  {renderPageType !== undefined &&\r\n                    renderPageProps !== undefined && (\r\n                      <SidePanelRenderer\r\n                        renderPageType={renderPageType}\r\n                        renderPageProps={renderPageProps}\r\n                      />\r\n                    )}\r\n                </React.Fragment>\r\n              </div>\r\n            </SidePanelPopper>\r\n          </React.Fragment>\r\n        ) : (\r\n          //   </Backdrop>\r\n          // </Slide>\r\n          <SidePanelPopper\r\n            open={sidePanelOpen || false}\r\n            theme={theme}\r\n            sidePanelWidth={sidePanelWidth}\r\n            anchorEl={elementRef.current}\r\n            disablePortal\r\n            placement={'left-start'}\r\n            transition\r\n            className={clsx('sidePanelPopper', {\r\n              rootopen: sidePanelExpanded,\r\n              rootclose: !sidePanelExpanded,\r\n              mobileroot: isMobile,\r\n            })}\r\n            modifiers={{\r\n              keepTogether: { enabled: true },\r\n              preventOverflow: {\r\n                enabled: true,\r\n                // altAxis: true,\r\n                // altBoundary: true,\r\n                // tether: false,\r\n                // rootBoundary: 'document',\r\n                boundariesElement: 'window', //scrollParent, window, viewport\r\n                padding: 0,\r\n              },\r\n              flip: { enabled: false },\r\n              // offset: {\r\n              //   offset: '0,-10',\r\n              // },\r\n            }}\r\n          >\r\n            <div className={'paper'}>\r\n              <React.Fragment>\r\n                {renderPageType !== undefined && renderPageProps ? (\r\n                  <SidePanelRenderer\r\n                    renderPageType={renderPageType}\r\n                    renderPageProps={renderPageProps}\r\n                  />\r\n                ) : (\r\n                  <div style={{ height: '99%', maxHeight: '99vh' }}></div>\r\n                )}\r\n              </React.Fragment>\r\n            </div>\r\n          </SidePanelPopper>\r\n        )}\r\n      </React.Fragment>\r\n      {/* )} */}\r\n    </SidePanelRoot>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectPageType,\r\n  selectPageTypeProps,\r\n  selectSidePanelOpen,\r\n} from '../../slice/selectors';\r\nimport { PageTypeProps, RenderPageType } from '../../slice/type';\r\nimport { SidePanelPopup } from './SidePanelPopup';\r\n\r\nexport interface SidePanelProps {\r\n  renderPageType?: RenderPageType;\r\n  renderPageProps?: PageTypeProps;\r\n}\r\n\r\nexport function SidePanel(props: SidePanelProps) {\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const renderPageType = useSelector(selectPageType);\r\n  const renderPageProps = useSelector(selectPageTypeProps);\r\n\r\n  return (\r\n    <SidePanelPopup\r\n      renderPageProps={renderPageProps}\r\n      renderPageType={renderPageType}\r\n      sidePanelOpen={sidePanelOpen}\r\n      sidePanelExpanded={sidePanelExpanded}\r\n      sidePanelWidth={SIDE_PANEL_WIDTH}\r\n    />\r\n  );\r\n}\r\n","import {\r\n  FilledInput as MuiFiledInput,\r\n  FilledInputClassKey,\r\n  //InputBase,\r\n  //InputBaseClassKey,\r\n  InputBaseProps,\r\n  //InputClassKey,\r\n  StandardProps,\r\n} from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FilledInputProps\r\n  extends StandardProps<InputBaseProps, FilledInputClassKey> {\r\n  className?: string;\r\n  fullWidth?: boolean;\r\n  multiline?: boolean;\r\n  noBorder?: boolean;\r\n  disableUnderline?: boolean;\r\n}\r\nexport const FilledInput = React.forwardRef<\r\n  React.HTMLAttributes<HTMLDivElement>,\r\n  FilledInputProps\r\n>(function FilledInput(props, ref) {\r\n  const {\r\n    className,\r\n    fullWidth = false,\r\n    inputComponent = 'input',\r\n    multiline = false,\r\n    type = 'text',\r\n    ...rest\r\n  } = props;\r\n  return (\r\n    <MuiFiledInput\r\n      fullWidth={fullWidth}\r\n      inputComponent={inputComponent}\r\n      className={clsx(className, 'filled')}\r\n      disableUnderline={false}\r\n      multiline={multiline}\r\n      ref={ref}\r\n      type={type}\r\n      {...rest}\r\n    />\r\n  );\r\n});\r\nexport default FilledInput;\r\n","import { httpClient } from './HttpClient';\r\n\r\nexport const TermsOfUseAgreementApi = {\r\n  getTermsOfUseAgreement: () => {\r\n    const url = '/api/odata/v4/TermsOfUseAgreement';\r\n    return httpClient.get(url);\r\n  },\r\n  agreeTermsOfUseAgreement: (versionId: number) => {\r\n    const url = '/api/odata/v4/TermsOfUseAgreement/AcceptAgreement';\r\n    const data = { versionId: versionId };\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import * as Excel from 'exceljs';\r\nimport fileDownload from 'js-file-download';\r\n\r\nexport interface ColumnTemplate {\r\n  key: string;\r\n  name: string;\r\n  customData?: (v: any) => string;\r\n}\r\n\r\nexport class ExportToExcel {\r\n  book: Excel.Workbook;\r\n  sheet: Excel.Worksheet;\r\n  constructor(sheetName: string) {\r\n    this.book = new Excel.Workbook();\r\n    this.sheet = this.book.addWorksheet(sheetName);\r\n  }\r\n  public AddWorkBook(): Excel.Workbook {\r\n    return new Excel.Workbook();\r\n  }\r\n  public AddWorkSheet(\r\n    workBook: Excel.Workbook,\r\n    sheetName: string,\r\n  ): Excel.Worksheet {\r\n    return workBook.addWorksheet(sheetName);\r\n  }\r\n  public SetWorkSheetHeader(columns: string[], workSheet?: Excel.Worksheet) {\r\n    const sheet: Excel.Worksheet =\r\n      workSheet !== undefined ? workSheet : this.sheet;\r\n    sheet.columns = columns.map(e => ({\r\n      header: e,\r\n      key: e,\r\n      width: 30,\r\n    }));\r\n  }\r\n  public InitWorksheetHeader(n: number, workSheet?: Excel.Worksheet) {\r\n    const sheet: Excel.Worksheet =\r\n      workSheet !== undefined ? workSheet : this.sheet;\r\n    var columns: { key: string; width: number }[] = [];\r\n    for (let i = 0; i < n; i++) {\r\n      columns.push({\r\n        key: i.toString(),\r\n        width: 30,\r\n      });\r\n    }\r\n    sheet.columns = columns;\r\n  }\r\n  public AddWorkSheetHeader(columns: string[], workSheet?: Excel.Worksheet) {\r\n    const sheet: Excel.Worksheet =\r\n      workSheet !== undefined ? workSheet : this.sheet;\r\n    sheet.addRow(columns);\r\n  }\r\n  public AddWorkSheetRow(workSheet?: Excel.Worksheet) {\r\n    const sheet: Excel.Worksheet =\r\n      workSheet !== undefined ? workSheet : this.sheet;\r\n    sheet.addRow('');\r\n  }\r\n  public AddWorkSheetData<T>(\r\n    data: T[],\r\n    columns?: ColumnTemplate[],\r\n    workSheet?: Excel.Worksheet,\r\n  ) {\r\n    const sheet: Excel.Worksheet =\r\n      workSheet !== undefined ? workSheet : this.sheet;\r\n    if (data.length > 0) {\r\n      // Add header\r\n      if (columns !== undefined) {\r\n        const columnNames = this.GetObjectNames(data[0], columns);\r\n        this.AddWorkSheetHeader(columnNames, workSheet);\r\n      }\r\n      // Add rows\r\n      data.forEach(e => {\r\n        sheet.addRow(this.GetObjectValues(e, columns));\r\n      });\r\n    }\r\n  }\r\n  public SetWorkSheetData<T>(\r\n    data: T[],\r\n    columns?: ColumnTemplate[],\r\n    workSheet?: Excel.Worksheet,\r\n  ) {\r\n    if (data.length > 0) {\r\n      // Add header\r\n      const columnNames = this.GetObjectNames(data[0], columns);\r\n      this.SetWorkSheetHeader(columnNames, workSheet);\r\n      // Add rows\r\n      this.AddWorkSheetData<T>(data, columns, workSheet);\r\n    }\r\n  }\r\n  public async ExportToExcel(\r\n    fileName: string,\r\n    workBook?: Excel.Workbook,\r\n  ): Promise<any> {\r\n    const book: Excel.Workbook = workBook !== undefined ? workBook : this.book;\r\n    try {\r\n      return await book.xlsx\r\n        .writeBuffer()\r\n        .then(buffer => {\r\n          fileDownload(buffer, fileName + '.xlsx');\r\n        })\r\n        .catch(err => {\r\n          throw err;\r\n        });\r\n    } catch (err) {\r\n      throw err;\r\n    }\r\n  }\r\n  public GetObjectNames(obj: {}, columns?: ColumnTemplate[]): string[] {\r\n    var result: string[];\r\n    if (columns !== undefined) {\r\n      result = columns.map(e => e.name);\r\n    } else {\r\n      result = Object.keys(obj).map(function (key) {\r\n        return key;\r\n      });\r\n    }\r\n    return result;\r\n  }\r\n  public GetObjectValues(obj: {}, columns?: ColumnTemplate[]) {\r\n    var result: {}[];\r\n    if (columns !== undefined) {\r\n      result = columns.map(function (column) {\r\n        if (column.customData !== undefined) {\r\n          return column.customData(obj[column.key]);\r\n        } else {\r\n          return obj[column.key];\r\n        }\r\n      });\r\n    } else {\r\n      result = Object.keys(obj).map(function (key) {\r\n        return obj[key];\r\n      });\r\n    }\r\n    return result;\r\n  }\r\n}\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { getIgnoredSearch, toURLSearchParams } from './withSavedHistory';\r\nimport { SAVEDVIEW_SEARCH_KEY } from 'app/components/BasicTable/BasicFilter/SavedListsDropDown';\r\n\r\n/**\r\n * Converts applied filters to search string\r\n * @param items applied filters\r\n * @param search current search\r\n * @param reservedQueryStringParameterNames reserved search params\r\n * @returns search\r\n */\r\nexport function getNextFilter<TRow>(\r\n  items: IFilterSettings<TRow>[],\r\n  search: string,\r\n  reservedQueryStringParameterNames?: string[],\r\n) {\r\n  // preserve the saved view value in addition to the reservedQueryStringParameterNames in order to preserve the selected saved view\r\n  const ignore = [\r\n    ...(reservedQueryStringParameterNames ?? []),\r\n    SAVEDVIEW_SEARCH_KEY,\r\n  ];\r\n\r\n  const currentSearch = getIgnoredSearch(search, ignore);\r\n  const filterSearch = toURLSearchParams<TRow>(items);\r\n\r\n  for (const key of filterSearch.keys()) {\r\n    const filterValue = filterSearch.get(key);\r\n    if (filterValue !== null) {\r\n      currentSearch.set(key, filterValue);\r\n    }\r\n  }\r\n  return currentSearch;\r\n}\r\n","import {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nconst url = '/api/odata/v4/InvoiceStatus';\r\nexport interface InvoiceStatusPickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url'> {}\r\n\r\nexport const InvoiceStatusPicker = (props: InvoiceStatusPickerProps) => {\r\n  return (\r\n    <BaseURLPicker url={url} {...props} id={props.id || 'invoiceStatusId'} />\r\n  );\r\n};\r\n","import MenuIcon from '@material-ui/icons/Menu';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\n\r\nexport const OpenMenuButton = ({\r\n  iconSize,\r\n}: {\r\n  iconSize?: 'medium' | 'small';\r\n}) => {\r\n  const { toggle } = useExpandedSideBarState();\r\n  return (\r\n    <IconButton\r\n      edge=\"start\"\r\n      variant=\"textGray\"\r\n      aria-label=\"open drawer\"\r\n      size={iconSize || 'medium'}\r\n      onClick={() => {\r\n        toggle();\r\n      }}\r\n    >\r\n      <MenuIcon />\r\n    </IconButton>\r\n  );\r\n};\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { UserProfileLink } from '../../components/UserProfileLink';\r\n\r\nconst UserRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n  row,\r\n}) => {\r\n  if (value === null || value === undefined) {\r\n    return <></>;\r\n  }\r\n  return <UserProfileLink UserId={row.original.UserId} DisplayName={value} />;\r\n};\r\nexport default UserRenderer;\r\n","import {\r\n  List,\r\n  ListItem,\r\n  ListItemIcon,\r\n  ListItemText,\r\n  ListSubheader,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { TFunctionKeys } from 'i18next';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  getViewLength,\r\n  getViewType,\r\n  viewLengthOptions,\r\n  ViewLengths,\r\n  viewTypeOptions,\r\n  ViewTypes,\r\n} from '../../slice/types';\r\n\r\nexport interface ViewTypeLengthDropDownProps {\r\n  viewType: ViewTypes;\r\n  viewLength: ViewLengths;\r\n  onTypeLengthChange: (\r\n    type: ViewTypes,\r\n    length: ViewLengths,\r\n    value?: Date,\r\n  ) => void;\r\n  size?: 'small' | 'large' | 'medium';\r\n  /**\r\n   * Limit display to a subset of possible options. E.g. options={['day', 'week']} to show only day/week options without the month\r\n   */\r\n  lengthOptions?: Array<ViewLengths>;\r\n  /**\r\n   * Optional show only icons on mobile\r\n   */\r\n  compact?: boolean;\r\n  disabled?: boolean;\r\n  haideCalendarViewType?: boolean;\r\n  twoDaysEnabled?: boolean;\r\n  customDaysEnabled?: boolean;\r\n  customDays?: number;\r\n  customTimelineDays?: number;\r\n  customCalendarDays?: number;\r\n}\r\n\r\nexport function ViewTypeLengthDropDown(props: ViewTypeLengthDropDownProps) {\r\n  const {\r\n    viewType,\r\n    viewLength,\r\n    onTypeLengthChange,\r\n    lengthOptions = ['day', 'week', 'month'],\r\n    compact,\r\n    size = 'medium',\r\n    disabled,\r\n    haideCalendarViewType,\r\n    customDays,\r\n    customTimelineDays,\r\n    customCalendarDays,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const titletext = React.useMemo(() => {\r\n    if (compact) {\r\n      return t(getViewLength(viewLength)?.shortName as TFunctionKeys).replace(\r\n        '{0}',\r\n        !!customDays ? customDays.toString() : '',\r\n      );\r\n    } else {\r\n      return `${t(getViewType(viewType)?.Name as TFunctionKeys)} by ${t(\r\n        getViewLength(viewLength)?.Name as TFunctionKeys,\r\n      ).replace('{0}', !!customDays ? customDays.toString() : '')}`;\r\n    }\r\n  }, [compact, customDays, t, viewLength, viewType]);\r\n  const itemText = React.useCallback(\r\n    (type: Entity<ViewTypes>, length: Entity<ViewLengths>) => {\r\n      if (type.Id === 'calendar') {\r\n        if (length.Id === 'customPeriod') {\r\n          if (!!customCalendarDays && customCalendarDays > 0) {\r\n            return t(length.Name as TFunctionKeys).replace(\r\n              '{0}',\r\n              customCalendarDays.toString(),\r\n            );\r\n          } else {\r\n            return 'Custom';\r\n          }\r\n        } else {\r\n          return t(length.Name as TFunctionKeys);\r\n        }\r\n      } else {\r\n        if (length.Id === 'customdays') {\r\n          return t(length.Name as TFunctionKeys).replace(\r\n            '{0}',\r\n            !!customDays ? customDays.toString() : '',\r\n          );\r\n        } else if (length.Id === 'customPeriod') {\r\n          if (!!customTimelineDays && customTimelineDays > 0) {\r\n            return t(length.Name as TFunctionKeys).replace(\r\n              '{0}',\r\n              customTimelineDays.toString(),\r\n            );\r\n          } else {\r\n            return 'Custom';\r\n          }\r\n        } else {\r\n          return t(length.Name as TFunctionKeys);\r\n        }\r\n      }\r\n    },\r\n    [customCalendarDays, customDays, customTimelineDays, t],\r\n  );\r\n  const handleChange = (\r\n    type: Entity<ViewTypes> | null,\r\n    length: Entity<ViewLengths> | null,\r\n  ) => {\r\n    if (type === null || length === null) {\r\n      return;\r\n    }\r\n    onTypeLengthChange(\r\n      type.Id,\r\n      length.Id,\r\n      length.Id === 'customdays' ? newDate() : undefined,\r\n    );\r\n  };\r\n\r\n  return (\r\n    <DropDown\r\n      variant=\"white\"\r\n      size={size}\r\n      disabled={disabled}\r\n      menuProps={{\r\n        anchorOrigin: {\r\n          vertical: 'bottom',\r\n          horizontal: 'left',\r\n        },\r\n        transformOrigin: {\r\n          vertical: 'top',\r\n          horizontal: 'left',\r\n        },\r\n        getContentAnchorEl: null,\r\n      }}\r\n      startIcon={\r\n        <Icon icon={viewType === 'calendar' ? 'calendar' : 'list-timeline'} />\r\n      }\r\n      addChevron\r\n      menuChildren={onClose => [\r\n        ...viewTypeOptions\r\n          .filter(\r\n            f =>\r\n              !haideCalendarViewType ||\r\n              (haideCalendarViewType === true && f.Id === 'timeline'),\r\n          )\r\n          .map((vt, index) => {\r\n            return (\r\n              <List\r\n                style={{ minWidth: 240 }}\r\n                disablePadding\r\n                key={vt.Id}\r\n                subheader={\r\n                  <ListSubheader>\r\n                    <Body\r\n                      style={{ textTransform: 'uppercase' }}\r\n                      color=\"secondary\"\r\n                      size=\"small\"\r\n                    >\r\n                      {t(vt.Name as TFunctionKeys)}\r\n                    </Body>\r\n                  </ListSubheader>\r\n                }\r\n              >\r\n                {viewLengthOptions\r\n                  .filter(f => {\r\n                    if (compact) {\r\n                      return vt.Id === 'timeline'\r\n                        ? f.Id !== 'month' &&\r\n                            f.Id !== 'customdays' &&\r\n                            lengthOptions.includes(f.Id)\r\n                        : f.Id !== 'twodays' &&\r\n                            f.Id !== 'customdays' &&\r\n                            f.Id !== 'quarter' &&\r\n                            f.Id !== 'year' &&\r\n                            lengthOptions.includes(f.Id);\r\n                    } else {\r\n                      return vt.Id === 'timeline'\r\n                        ? lengthOptions.includes(f.Id)\r\n                        : f.Id !== 'customdays' &&\r\n                            f.Id !== 'twodays' &&\r\n                            f.Id !== 'quarter' &&\r\n                            f.Id !== 'year' &&\r\n                            lengthOptions.includes(f.Id);\r\n                    }\r\n                  })\r\n                  .map(vl => {\r\n                    return (\r\n                      <ListItem\r\n                        key={vl.Id}\r\n                        button\r\n                        selected={vt.Id === viewType && vl.Id === viewLength}\r\n                        onClick={() => {\r\n                          handleChange(vt, vl);\r\n                          onClose();\r\n                        }}\r\n                      >\r\n                        <ListItemIcon>\r\n                          <Icon\r\n                            color=\"primary\"\r\n                            colorExtend=\"main\"\r\n                            icon={\r\n                              vl.Icon ??\r\n                              vt.Icon ??\r\n                              (vt.Id === 'calendar'\r\n                                ? 'calendar'\r\n                                : 'list-timeline')\r\n                            }\r\n                          />\r\n                        </ListItemIcon>\r\n                        <ListItemText primary={itemText(vt, vl)} />\r\n                      </ListItem>\r\n                    );\r\n                  })}\r\n              </List>\r\n            );\r\n          }),\r\n      ]}\r\n    >\r\n      {titletext}\r\n    </DropDown>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { MenuItem } from '@material-ui/core';\r\n\r\nexport interface ExportToPDFProps {\r\n  onClick: () => void;\r\n}\r\n\r\nexport function ExportToPDF(props: ExportToPDFProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  return (\r\n    <MenuItem onClick={props.onClick} title={t(translations.ExportToPDF)}>\r\n      <Icon icon={'file-pdf'} />\r\n      {t(translations.ExportToPDF)}\r\n    </MenuItem>\r\n  );\r\n}\r\n","/**\r\n *\r\n * DatePickerFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IFilterComponentProps } from 'app/components/BasicTable/Filters/IFilterComponentProps';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\n\r\n/**\r\n * Date picker to be used as a BasicTable filter component\r\n */\r\nexport const DatePickerFilter = (props: IFilterComponentProps) => {\r\n  const [value, setValue] = React.useState<MaterialUiPickersDate | null>(\r\n    props.value,\r\n  );\r\n  const handleOnChange = (value: MaterialUiPickersDate | null) => {\r\n    props.onChange(value == null ? null : new CustomDate(value, 'date'));\r\n    setValue(value);\r\n  };\r\n\r\n  return (\r\n    <BookitDatePicker\r\n      ariaLabel={props.label || 'Date Filter'}\r\n      id={props.id}\r\n      size=\"small\"\r\n      value={value}\r\n      onChange={handleOnChange}\r\n      inputVariant=\"standard\"\r\n      clearable={true}\r\n    />\r\n  );\r\n};\r\n\r\nexport default DatePickerFilter;\r\n","/**\r\n *\r\n * TextFieldFilter\r\n *\r\n */\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { debounce } from 'lodash';\r\n\r\nexport const TextFieldFilter = (props: IFilterComponentProps) => {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const [value, setValue] = React.useState<string>(props.value);\r\n  const onChange = React.useCallback(value => props.onChange(value), [props]);\r\n  const debouncedOnChange = React.useMemo(() => debounce(onChange, 250), [\r\n    onChange,\r\n  ]);\r\n  const handleChange: React.ChangeEventHandler<\r\n    HTMLInputElement | HTMLTextAreaElement\r\n  > = event => {\r\n    setValue(event.target.value);\r\n    debouncedOnChange(event.target.value);\r\n  };\r\n\r\n  const { t } = useTranslation();\r\n  return (\r\n    <TextControlField\r\n      value={value || ''}\r\n      type=\"text\"\r\n      onChange={handleChange}\r\n      size=\"small\"\r\n      autoFocus={true}\r\n      placeholder={t(translations.AllValues)}\r\n      inputProps={{ 'aria-label': props.label }}\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default TextFieldFilter;\r\n","import { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { SavedViewSelected } from '../SavedViewsPage/SavedViewPage/slice/types';\r\n\r\nexport function MyListFilter(search: string, selectedView: SavedViewSelected) {\r\n  const result = isEmptyOrWhitespace(search)\r\n    ? new URLSearchParams()\r\n    : new URLSearchParams(search);\r\n  result.set('eid', selectedView.ids || '');\r\n  const res = result.toString();\r\n  return isEmptyOrWhitespace(res) ? undefined : res;\r\n}\r\n","import { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { IDocumentsDirectoryRow } from './IDocumentsDirectoryRow';\r\nimport React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function DocumentsTable<\r\n  TProps extends Omit<\r\n    BasicTableProps<IDocumentsDirectoryRow>,\r\n    'api' | 'additionalColumns' | 'searchColumns' | 'screenName'\r\n  >\r\n>({ initialState, rowActions, screenId, serviceGroups, ...props }: TProps) {\r\n  const { t } = useTranslation();\r\n  const newProps = React.useMemo(() => {\r\n    const p = { ...props };\r\n    Reflect.deleteProperty(p, 'api');\r\n    return p;\r\n  }, [props]);\r\n  const url = '/api/odata/v4/Documents';\r\n  return (\r\n    <>\r\n      <BasicTable\r\n        api={url}\r\n        screenId={ScreensId.Documents}\r\n        initialState={initialState}\r\n        rowActions={rowActions}\r\n        additionalColumns={[\r\n          'Id',\r\n          'IsAdmin',\r\n          'AssetId',\r\n          'ServiceGroupId',\r\n          'FileUpdateTime',\r\n        ]}\r\n        searchColumns={[\r\n          'FileName',\r\n          'Title',\r\n          'Description',\r\n          'DocumentType',\r\n          'FileType',\r\n          'AssetName',\r\n          'ServiceGroup',\r\n        ]}\r\n        screenName={t(translations.menu_Documents)}\r\n        serviceGroups={serviceGroups}\r\n        {...(newProps as TProps)}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { H3 } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport React from 'react';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\n\r\nexport interface NoTableDataProps {\r\n  id?: string;\r\n  shortView?: boolean;\r\n}\r\nexport function NoTableData(props: NoTableDataProps) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <FlexRowDiv id={props.id}>\r\n      <Box textAlign=\"center\" style={{ paddingBlock: '48px' }}>\r\n        {props.shortView ? (\r\n          <React.Fragment>\r\n            <BasicTypography variant={'boldM'}>\r\n              {t(translations.dash_EmptyWidgetTitle) as string}\r\n            </BasicTypography>\r\n            <BasicTypography variant={'boldS'}>\r\n              {t(translations.dash_EmptyWidgetBody) as string}\r\n            </BasicTypography>\r\n          </React.Fragment>\r\n        ) : (\r\n          <React.Fragment>\r\n            <H3>{t(translations.dash_EmptyWidgetTitle) as string}</H3>\r\n            <H4>{t(translations.dash_EmptyWidgetBody) as string}</H4>\r\n          </React.Fragment>\r\n        )}\r\n      </Box>\r\n    </FlexRowDiv>\r\n  );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Alert, AlertProps } from '@material-ui/lab';\r\n\r\nexport interface TableErrorProps extends Pick<AlertProps, 'id'> {}\r\nexport function TableError(props: TableErrorProps) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <Alert severity=\"error\" {...props}>\r\n      {t(translations.LoadingFailed)}\r\n    </Alert>\r\n  );\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { Description } from 'app/components/Description';\r\nimport { BooleanRender } from '../../components/BooleanRender';\r\n\r\n/**\r\n * Type of the record to reference. Record<string, any> will work for all cases, but can be substituted for specific type if needed.\r\n */\r\ntype recordType = Record<string, any>;\r\nconst DefaultRenderer: Renderer<CellProps<recordType>> = props => {\r\n  const value = props.value;\r\n  if (value === null || value === undefined) {\r\n    return null;\r\n  } else if (typeof value === 'string') {\r\n    return <Description value={value} width=\"medium\" />;\r\n  } else if (typeof value === 'boolean') {\r\n    return BooleanRender(props);\r\n  }\r\n  //TODO: add default renderers for other common types here\r\n  else {\r\n    return <>{String(value)}</>;\r\n  }\r\n};\r\nexport default DefaultRenderer;\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { IDocumentsDirectoryRow } from './IDocumentsDirectoryRow';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\nimport FileNameRenderer from 'app/components/BasicTable/CellRenderers/FileNameRenderer';\r\n\r\nconst Available = val => {\r\n  if (val === true) {\r\n    return translations.StaffUsersFiles;\r\n  }\r\n  if (val === false) {\r\n    return translations.StaffOnlyFiles;\r\n  }\r\n  return translations.PublicFiles;\r\n};\r\n\r\nexport const getColumns = (\r\n  t: TFunction,\r\n  appSettings?: AppSettings,\r\n  globalSettings?: GlobalSettings,\r\n): Column<IDocumentsDirectoryRow>[] => {\r\n  return [\r\n    {\r\n      Header: t(translations.FileName) as string,\r\n      accessor: 'FileName',\r\n      //check if the link should be avalibale or not\r\n      //logick not finale\r\n      Cell: FileNameRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.Title) as string,\r\n      accessor: 'Title',\r\n    },\r\n    {\r\n      Header: t(translations.Description) as string,\r\n      accessor: 'Description',\r\n    },\r\n    {\r\n      Header: t(translations.DocumentType) as string,\r\n      accessor: 'DocumentType',\r\n    },\r\n    {\r\n      Header: t(translations.FileType) as string,\r\n      accessor: 'FileType',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceGroup) as string,\r\n      accessor: 'ServiceGroup',\r\n    },\r\n    {\r\n      Header: t(translations.AssetName) as string,\r\n      accessor: 'AssetName',\r\n      Cell: AssetRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.AvailableToUsers) as string,\r\n      accessor: 'AvailableToUsers',\r\n\r\n      Cell: ({ row }) => <>{t(Available(row.original.AvailableToUsers))}</>,\r\n    },\r\n  ];\r\n};\r\n","import { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { DownloadFileButon } from 'app/components/DownloadFileButton';\r\n\r\ntype RecordType = Record<string, any>;\r\nconst FileNameRenderer: Renderer<CellProps<RecordType>> = ({ value, row }) => {\r\n  const { allowedToEdit } = useAdminPermissions();\r\n  return (\r\n    <>\r\n      {row.original.AvailableToUsers === false &&\r\n      !allowedToEdit({\r\n        ServiceGroupId: row.original.ServiceGroupId,\r\n        ServiceType: row.original.ServiceTypeId,\r\n        ServiceId: row.original.ServiceId,\r\n      }) ? (\r\n        <>{value}</>\r\n      ) : (\r\n        <DownloadFileButon id={row.original.Id} name={value} />\r\n      )}\r\n    </>\r\n  );\r\n};\r\nexport default FileNameRenderer;\r\n","import { TFunction } from 'i18next';\r\nimport { Column } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport DateTimeRenderer from 'app/components/BasicTable/CellRenderers/DateTimeRenderer';\r\nimport { translations } from 'locales/translations';\r\nimport UsedSlotsRenderer from 'app/components/BasicTable/CellRenderers/UsedSlotsRenderer';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\nimport TrainingStateRenderer from 'app/components/BasicTable/CellRenderers/TrainingStateRenderer';\r\n\r\ntype RowType = ITrainingSessionsRow;\r\nexport const getColumns = (\r\n  t: TFunction,\r\n  appSettings?: AppSettings,\r\n  globalSettings?: GlobalSettings,\r\n): Column<RowType>[] => {\r\n  return [\r\n    {\r\n      Header: t(translations.Signups) as string,\r\n      accessor: 'TrainingState',\r\n      Cell: TrainingStateRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.TrainingResource) as string,\r\n      accessor: 'AssetName',\r\n      Cell: AssetRenderer,\r\n    },\r\n    // {\r\n    //   Header: t(translations.NextAvailableSession) as string,\r\n    //   accessor: 'NextSession',\r\n    //   Cell: NextSessionRenderer,\r\n    // },\r\n    // {\r\n    //   Header: t(translations.AllUpcomingSessions) as string,\r\n    //   accessor: 'AllUpcomingSessions',\r\n    //   Cell: AllUpcomingSessionsAssetRenderer,\r\n    // },\r\n    {\r\n      Header: t(translations.DurationH) as string,\r\n      accessor: 'Duration',\r\n    },\r\n    {\r\n      Header: t(translations.Campus) as string,\r\n      accessor: 'Campus',\r\n    },\r\n    {\r\n      Header: t(translations.Building) as string,\r\n      accessor: 'Building',\r\n    },\r\n    {\r\n      Header: t(translations.Room) as string,\r\n      accessor: 'Room',\r\n    },\r\n    {\r\n      Header: t(translations.MinimumAttendance) as string,\r\n      accessor: 'MinAttendance',\r\n    },\r\n    {\r\n      Header: t(translations.MaximumAttendance) as string,\r\n      accessor: 'MaxAttendance',\r\n    },\r\n    {\r\n      Header: t(translations.TotalUsedSlots) as string,\r\n      accessor: 'TotalUsedSlots',\r\n      Cell: UsedSlotsRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.RemainedSlots) as string,\r\n      accessor: 'RemainedSlots',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceGroup) as string,\r\n      accessor: 'ServiceGroup',\r\n    },\r\n    {\r\n      Header: t(translations.HashSymbol) as string,\r\n      accessor: 'Id',\r\n    },\r\n    {\r\n      Header: t(translations.Remarks) as string,\r\n      accessor: 'Remarks',\r\n    },\r\n    {\r\n      Header: t(translations.StartTime) as string,\r\n      accessor: 'StartDate',\r\n      Cell: DateTimeRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.EndTime) as string,\r\n      accessor: 'EndDate',\r\n      Cell: DateTimeRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.TrainerName) as string,\r\n      accessor: 'TrainerName',\r\n    },\r\n  ];\r\n};\r\n","import { ExternalLink } from 'app/components/ExternalLink';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { ITrainingSessionsRow } from 'app/pages/TrainingSessionsPage/ITrainingSessionsRow';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\ntype RecordType = ITrainingSessionsRow;\r\nconst UsedSlotsRenderer: Renderer<CellProps<RecordType>> = ({\r\n  value,\r\n  row: { original },\r\n}) => {\r\n  const { newDate } = useSystemDate();\r\n  return (\r\n    <ExternalLink\r\n      href={{\r\n        path: '/reservations',\r\n        search: {\r\n          period: 'CustomDate',\r\n          st: dateUtils.formatQueryStringDate(\r\n            dateUtils.dateOrStringToDate(original.StartDate ?? newDate()),\r\n          ),\r\n          et: dateUtils.formatQueryStringDate(\r\n            dateUtils.dateOrStringToDate(original.EndDate ?? newDate()),\r\n          ),\r\n          eid: original.ServiceId,\r\n          TrainingSignUp: true,\r\n        },\r\n      }}\r\n    >\r\n      {value}\r\n    </ExternalLink>\r\n  );\r\n};\r\nexport default UsedSlotsRenderer;\r\n","import { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { ITrainingSessionsRow } from 'app/pages/TrainingSessionsPage/ITrainingSessionsRow';\r\nimport { ReservationLinkAction } from 'app/pages/TrainingSessionsPage/RowActions/ReservationLink';\r\nimport React from 'react';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\ntype RecordType = ITrainingSessionsRow;\r\nconst TrainingStateRenderer: Renderer<CellProps<RecordType>> = ({\r\n  value,\r\n  row,\r\n}) => {\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  const hasNextSession =\r\n    getOffsetDate(row.original.StartDate) > dateUtils.truncateTime(newDate());\r\n  return (\r\n    <React.Fragment>\r\n      <ReservationLinkAction\r\n        Id={row.original.Id}\r\n        HasNextSession={hasNextSession}\r\n        TrainingState={row.original.TrainingState}\r\n        hasReservation={row.original.hasReservation}\r\n        myReservationId={row.original.myReservationId}\r\n        ServiceId={row.original.ServiceId}\r\n        NextSession={row.original.NextSession}\r\n        EndDate={row.original.EndDate}\r\n        StartDate={row.original.StartDate}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n};\r\nexport default TrainingStateRenderer;\r\n","import { SizeProp } from '@fortawesome/fontawesome-svg-core';\r\nimport { Box } from '@material-ui/core';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport useSidePanelState, {\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { TrainingState } from 'enums/TrainingState';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { buildURL } from 'utils/url-utils';\r\n\r\nexport interface ReservationLinkProps {\r\n  Id: number | null;\r\n  HasNextSession: boolean;\r\n  TrainingState: number;\r\n  hasReservation: boolean;\r\n  myReservationId: number | null;\r\n  ServiceId: number | null;\r\n  NextSession: Date | null;\r\n  EndDate: Date | null;\r\n  StartDate: Date | null;\r\n  iconsize?: SizeProp;\r\n  asLinkRendered?: boolean;\r\n}\r\nexport const ReservationLinkAction = React.forwardRef<\r\n  any,\r\n  ReservationLinkProps\r\n>(function ReservationLinkAction(props, ref) {\r\n  const { t } = useTranslation();\r\n  const { openPanel } = useSidePanelState();\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const isMobile = DetectIsMobile();\r\n  const readOnlyUser = IsReadOnlyUser(user);\r\n  //const item = props.row;\r\n  //const hasSession = props.HasNextSession;\r\n\r\n  const state = props.TrainingState as TrainingState;\r\n  const params = (props.hasReservation\r\n    ? {\r\n        id: String(props.myReservationId),\r\n      }\r\n    : {\r\n        selectedIds: String(props.ServiceId),\r\n        tsid: String(props.Id),\r\n        Start: dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(props.StartDate ?? new Date()),\r\n        ),\r\n        End: dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(props.EndDate ?? new Date()),\r\n        ),\r\n        un: user?.Id,\r\n      }) as ReservationQueryStringParameters;\r\n\r\n  const url = buildURL('/reservations/details', params);\r\n  return props.HasNextSession && !readOnlyUser ? (\r\n    <Link\r\n      ref={ref}\r\n      href={props.asLinkRendered ? url : ''}\r\n      onClick={\r\n        props.asLinkRendered\r\n          ? undefined\r\n          : () =>\r\n              openPanel({\r\n                renderPageType: RenderPageType.ReservationDetails,\r\n                renderPageProps: {\r\n                  queryParams: params,\r\n                  useSidePanel: true,\r\n                } as ReservationDetailsProps,\r\n                expanded: false,\r\n                useSidePanel: false,\r\n                isCover: false,\r\n              } as SidePanelOpenState)\r\n      }\r\n      aria-label=\"Session Indicator\"\r\n    >\r\n      <Tooltip\r\n        ref={ref}\r\n        title={\r\n          state === TrainingState.SignedUp\r\n            ? (t(translations.TrainingSessions_Calendar_SignedUp) as string)\r\n            : state === TrainingState.UnderMinimum\r\n            ? (t(translations.TrainingSessions_Calendar_UnderMinimum) as string)\r\n            : state === TrainingState.Maximum\r\n            ? (t(translations.TrainingSessions_Calendar_Maximum) as string)\r\n            : (t(translations.TrainingSessions_Calendar_Available) as string)\r\n        }\r\n        arrow\r\n      >\r\n        <Box display=\"flex\" justifyContent=\"center\">\r\n          <Icon\r\n            size={isMobile ? undefined : props.iconsize || '2x'}\r\n            color={\r\n              state === TrainingState.SignedUp\r\n                ? 'success'\r\n                : state === TrainingState.UnderMinimum\r\n                ? 'primary'\r\n                : state === TrainingState.Maximum\r\n                ? 'danger'\r\n                : 'primary'\r\n            }\r\n            icon={\r\n              state === TrainingState.SignedUp\r\n                ? isMobile\r\n                  ? 'calendar-check'\r\n                  : ['fad', 'calendar-check']\r\n                : state === TrainingState.UnderMinimum\r\n                ? isMobile\r\n                  ? 'calendar-exclamation'\r\n                  : ['fad', 'calendar-exclamation']\r\n                : state === TrainingState.Maximum\r\n                ? isMobile\r\n                  ? 'calendar-times'\r\n                  : ['fad', 'calendar-times']\r\n                : isMobile\r\n                ? 'calendar-plus'\r\n                : ['fad', 'calendar-plus']\r\n            }\r\n          />\r\n        </Box>\r\n      </Tooltip>\r\n    </Link>\r\n  ) : (\r\n    <React.Fragment>{'N/A'}</React.Fragment>\r\n  );\r\n});\r\n","import React from 'react';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ITrainingSessionsRow } from './ITrainingSessionsRow';\r\nimport { translations } from 'locales/translations';\r\n\r\ntype RowType = ITrainingSessionsRow;\r\n\r\nexport function TrainingSessionsTable<\r\n  TProps extends Omit<\r\n    BasicTableProps<RowType>,\r\n    'api' | 'additionalColumns' | 'searchColumns' | 'screenName'\r\n  >\r\n>({\r\n  initialState,\r\n  rowActions,\r\n  serviceGroups,\r\n  savedListSettings,\r\n  ...props\r\n}: TProps) {\r\n  const { t } = useTranslation();\r\n  const newProps = React.useMemo(() => {\r\n    const p = { ...props };\r\n    Reflect.deleteProperty(p, 'api');\r\n    return p;\r\n  }, [props]);\r\n  const url = '/api/odata/v4/TrainingSessions';\r\n  return (\r\n    <>\r\n      <BasicTable\r\n        api={url}\r\n        initialState={initialState}\r\n        additionalColumns={[\r\n          'Id',\r\n          'AssetId',\r\n          'ServiceId',\r\n          'HasNextSession',\r\n          'hasReservation',\r\n          'myReservationId',\r\n          'TrainingState',\r\n          'EndDate',\r\n          'StartDate',\r\n          'ServiceGroupId',\r\n          'RoomId',\r\n        ]}\r\n        rowActions={rowActions}\r\n        useRowSelect={true}\r\n        searchColumns={[\r\n          'cast(Id,Edm.String)',\r\n          'AssetName',\r\n          'ServiceGroup',\r\n          'Campus',\r\n          'Building',\r\n          'Room',\r\n          'Remarks',\r\n        ]}\r\n        screenName={t(translations.AllTrainingSessions)}\r\n        serviceGroups={serviceGroups}\r\n        savedListSettings={{\r\n          enableSavedLists: true,\r\n          savedListRelatedPickerName: 'ServiceId',\r\n          savedListSerializedKey: 'eqid',\r\n        }}\r\n        {...(newProps as TProps)}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getColumns } from './Columns';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\n\r\nexport function ArticlesTable<\r\n  TProps extends Omit<\r\n    BasicTableProps<IArticleDto>,\r\n    'api' | 'additionalColumns' | 'searchColumns' | 'columns' | 'screenName'\r\n  > & {\r\n    useSidePanel?: boolean;\r\n    openPanel?: (state: SidePanelOpenState) => void;\r\n  }\r\n>({\r\n  initialState,\r\n  rowActions,\r\n  screenId,\r\n  serviceGroups,\r\n  predicates,\r\n  useSidePanel,\r\n  openPanel,\r\n  ...props\r\n}: TProps) {\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const columns = React.useMemo(\r\n    () =>\r\n      getColumns(t, authenticatedUser, globalSettings, useSidePanel, openPanel),\r\n    [authenticatedUser, globalSettings, openPanel, t, useSidePanel],\r\n  );\r\n  // add custom global service grups filter since the Article is connected to the service groups through Assets property and does not have ServiceGroupId property used in the basic table filtering\r\n  const globalServiceGroupsFilter = React.useMemo(\r\n    () =>\r\n      serviceGroups !== undefined && serviceGroups.length > 0\r\n        ? [\r\n            `Assets/any(a: a/Availability/Id eq ${\r\n              AvailabilityTypes.ServiceGroup\r\n            } and a/ServiceGroupId in (${serviceGroups\r\n              .map(f => f.Id)\r\n              .join(',')}))`,\r\n          ]\r\n        : undefined,\r\n    [serviceGroups],\r\n  );\r\n  const newPredicates = React.useMemo(() => {\r\n    if (predicates !== undefined && predicates.length > 0) {\r\n      const externalPredicates = predicates\r\n        .map(p => p.toString())\r\n        .filter(r => r !== undefined) as string[];\r\n      if (globalServiceGroupsFilter !== undefined) {\r\n        globalServiceGroupsFilter.push(...externalPredicates);\r\n        return globalServiceGroupsFilter;\r\n      } else {\r\n        return externalPredicates;\r\n      }\r\n    } else return globalServiceGroupsFilter;\r\n  }, [globalServiceGroupsFilter, predicates]);\r\n  const newProps = React.useMemo(() => {\r\n    const p = { ...props };\r\n    Reflect.deleteProperty(p, 'api');\r\n    Reflect.deleteProperty(p, 'columns');\r\n    return p;\r\n  }, [props]);\r\n  const url = '/api/odata/v4/articles';\r\n  return (\r\n    <>\r\n      <BasicTable\r\n        api={url}\r\n        screenId={ScreensId.Articles}\r\n        initialState={initialState}\r\n        columns={columns}\r\n        rowActions={rowActions}\r\n        // fetch all of the columns as the row will be used in displaying article details inside the sidepanel without additional data fetch\r\n        additionalColumns={[\r\n          'Id',\r\n          'Title',\r\n          'Abstract',\r\n          'ExternalId',\r\n          'ExternalIdSource',\r\n          'Year',\r\n          'Authors',\r\n          'Doi',\r\n          'ISSN',\r\n          'Journal',\r\n          'ORCIDs',\r\n          //'ArticleContributionLevelId',\r\n          'Assets',\r\n          'RelatedUser',\r\n          'CreatedByMe',\r\n          'EnteredBy',\r\n        ]}\r\n        searchColumns={[\r\n          'cast(Id,Edm.String)',\r\n          'Title',\r\n          // 'Abstract',\r\n          // 'ExternalId',\r\n          // 'ExternalIdSource',\r\n          // 'cast(Year,Edm.String)',\r\n          s => `Authors/any(a:contains(a, ${s}))`,\r\n          // 'Doi',\r\n          // 'ISSN',\r\n          'Journal',\r\n          //'ORCIDs',\r\n          //'ArticleContributionLevelId',\r\n          //'Assets',\r\n          s => `Assets/any(a:contains(a/Name, ${s}))`,\r\n          'ExternalIdSource',\r\n        ]}\r\n        screenName={t(translations.Publications)}\r\n        serviceGroups={serviceGroups}\r\n        predicates={newPredicates}\r\n        {...(newProps as TProps)}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PrimaryActionDynamic } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { ArticleDetailsProps } from './ArticleDetails';\r\n\r\nexport const articlePrimaryAction: PrimaryActionDynamic<IArticleDto> = (\r\n  openPanel,\r\n  row,\r\n  toggle,\r\n  user,\r\n  useSidePanel,\r\n) => {\r\n  openPanel({\r\n    renderPageType: RenderPageType.Article,\r\n    renderPageProps: {\r\n      value: row.original,\r\n      Id: row.original.Id,\r\n      externalId: row.original.ExternalId,\r\n      externalIdSource: row.original.ExternalIdSource,\r\n      useSidePanel: true,\r\n    } as ArticleDetailsProps,\r\n    useSidePanel: useSidePanel,\r\n    expanded: false,\r\n    isCover: useSidePanel,\r\n  });\r\n};\r\n\r\nexport default articlePrimaryAction;\r\n","import { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function WorkOrdersTable<\r\n  TProps extends Omit<\r\n    BasicTableProps<IWorkOrderDetailsDto>,\r\n    | 'api'\r\n    | 'additionalColumns'\r\n    | 'searchColumns'\r\n    | 'screenName'\r\n    | 'expandedColumns'\r\n    | 'savedListSettings'\r\n  >\r\n>({ initialState, rowActions, serviceGroups, ...props }: TProps) {\r\n  const { t } = useTranslation();\r\n  const newProps = React.useMemo(() => {\r\n    const p = { ...props };\r\n    Reflect.deleteProperty(p, 'api');\r\n    Reflect.deleteProperty(p, 'expandedColumns');\r\n    Reflect.deleteProperty(p, 'savedListSettings');\r\n    return p;\r\n  }, [props]);\r\n  const url = '/api/odata/v4/WorkOrders';\r\n  return (\r\n    <>\r\n      <BasicTable\r\n        screenName={t(translations.menu_AllWorkOrders)}\r\n        api={url}\r\n        initialState={initialState}\r\n        rowActions={rowActions}\r\n        expandedColumns={['AssignedUsers']}\r\n        additionalColumns={[\r\n          'Id',\r\n          'AssetId',\r\n          'AssetCatId',\r\n          'AssetCatGroupId',\r\n          'AlertTypeId',\r\n          'OfflineEventEnd',\r\n          //'StatusId',\r\n          'IsClosed',\r\n          //'UserTicket',\r\n          'InstrumentWasDown',\r\n          'ReportedByDisplayName',\r\n          'RecurringGroupId',\r\n          'RecurringAssetId',\r\n          'StaffOnly',\r\n          'EventStart',\r\n          'EventEnd',\r\n          'ServiceGroupId',\r\n          'ServiceId',\r\n          'ShowOnCalibrationHistory',\r\n          'NotEditable',\r\n        ]}\r\n        searchColumns={[\r\n          'cast(Id,Edm.String)',\r\n          'AssetName',\r\n          'ServiceGroup',\r\n          'AlertDescription',\r\n          'AlertTitle',\r\n          'StatusName',\r\n          'AlertType',\r\n          'ReportedBy',\r\n        ]}\r\n        serviceGroups={serviceGroups}\r\n        savedListSettings={{\r\n          enableSavedLists: true,\r\n          savedListRelatedPickerName: 'AssetId',\r\n          savedListSerializedKey: 'aid',\r\n          listViewbyAsset: true,\r\n        }}\r\n        {...(newProps as TProps)}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Body } from '../Typography';\r\n\r\nexport interface ScannerViewProps {\r\n  description?: React.ReactNode;\r\n  Input?: React.ReactNode;\r\n}\r\n\r\nconst StyledScanView = styled('div')(({ theme }) => ({\r\n  '&.scanner-root': {\r\n    width: '100%',\r\n    minHeight: '144px',\r\n    height: 'auto',\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n    padding: '24px',\r\n    gap: 8,\r\n    background: theme.palette.common.white,\r\n    border: '1px solid #026AA2',\r\n    boxShadow: '0px 0px 0px 4px #E2F6FF',\r\n    borderRadius: 8,\r\n    '& .scanner-icon': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n      gap: 8.75,\r\n    },\r\n    '& .scanner-input': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'center',\r\n      width: '100%',\r\n      paddingInline: '16px',\r\n      gap: 8,\r\n      [theme.breakpoints.down('sm')]: {\r\n        paddingInline: '0',\r\n      },\r\n    },\r\n    '&.selectRoot': {\r\n      padding: theme.spacing(2),\r\n    },\r\n    '&.selectTitle': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '8px 8px',\r\n      justifyContent: 'space-between',\r\n      width: '100%',\r\n      '&>label': {\r\n        width: '100%',\r\n        textAlign: 'center',\r\n      },\r\n    },\r\n  },\r\n}));\r\nexport function ScannerView(props: ScannerViewProps) {\r\n  const theme = useTheme();\r\n  const { t } = useTranslation();\r\n  return (\r\n    <StyledScanView className={'scanner-root'} theme={theme}>\r\n      <div className={'scanner-icon'}>\r\n        <Icon icon=\"barcode\" size=\"3x\" />\r\n      </div>\r\n      <Body color=\"secondary\">\r\n        {props.description || t(translations.BarcodeScannViewDescription)}\r\n      </Body>\r\n      {props.Input && (\r\n        <div className={'scanner-input'}>\r\n          <Body color=\"secondary\">{'or'}</Body>\r\n          {props.Input}\r\n        </div>\r\n      )}\r\n    </StyledScanView>\r\n  );\r\n}\r\n","import { EndUsageData } from 'app/components/EndUsageConfirm';\r\nimport { AssetBarcodeScanParameters } from 'app/pages/AssetsInventory/Details/slice/types';\r\nimport { CancelToken } from 'axios';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nconst url = '/api/odata/v4/AssetDetails';\r\nconst publicUrl = '/api/odata/v4/PublicAsset';\r\nexport const AssetDetailsApi = {\r\n  getAssetById: (\r\n    id: number | undefined,\r\n    serviceId: number | undefined,\r\n    columns: string[],\r\n    expandable: string[],\r\n    cancel?: CancelToken,\r\n    isAuthenticated?: boolean,\r\n  ) => {\r\n    const params: {\r\n      $select: string;\r\n      serviceId: number;\r\n      $expand?: string;\r\n    } = {\r\n      $select: columns.join(','),\r\n      serviceId: serviceId ?? -1,\r\n    };\r\n    let expand = columns.filter(c => expandable.includes(c));\r\n    if (expand && expand.length) {\r\n      params.$expand = expand\r\n        // articles need 2 level expand which don't fit into the column propName\r\n        .map(f => (f === 'Articles' ? 'Articles($expand=Assets)' : f))\r\n        .join(',');\r\n    }\r\n    const sourceUrl = isAuthenticated\r\n      ? url + '(' + (id ?? -1) + ')'\r\n      : publicUrl + '/' + (id ?? -1);\r\n    return httpClient.get(sourceUrl, params, cancel);\r\n  },\r\n  endUsage: (id: number, data: EndUsageData): Promise<IResponseType> => {\r\n    const params = {\r\n      id: id,\r\n      remarks: data.remarks ?? '',\r\n      sids:\r\n        data.services.map(s => s.service?.Id + ':' + s.quantity).join(',') ??\r\n        '',\r\n    };\r\n    return httpClient.post(url + '/EndUsage', params);\r\n  },\r\n  downloadImages: (assetIds: string): Promise<any> => {\r\n    const downUrl = `api/AssetImages/Selected?selectedIds=${assetIds}`;\r\n    return httpClient.get(downUrl);\r\n  },\r\n  scanBarcode: (payload: AssetBarcodeScanParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    return httpClient.post(`${url}/BarcodeScan`, data);\r\n  },\r\n  logNoRoomAccess: (payload: number) => {\r\n    const data = {\r\n      roomId: payload,\r\n    };\r\n    return httpClient.post(`${url}/LogNoRoomAccess`, data);\r\n  },\r\n};\r\n","/**\r\n *\r\n * QuizDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IQuizSubmissionDto } from 'api/odata/generated/entities/IQuizSubmissionDto';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { Box, Grid } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport parse from 'html-react-parser';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { push } from 'connected-react-router';\r\nimport { ParseFormFieldEnums } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface QuizDetailsProps extends SidePanelContentProps {\r\n  id: string;\r\n}\r\n\r\nexport function QuizDetails(props: QuizDetailsProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const { id, useSidePanel } = props;\r\n  const quizSubmissionId = +id;\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const isMobile = DetectIsMobile();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const fetchData = async (id: number) =>\r\n    httpClient\r\n      .get<IQuizSubmissionDto>(\r\n        `/api/odata/v4/quizsubmissions(${id})?$expand=UserTraining($select=Id,EquipmentName,TrainingLevelName,EquipmentId)`,\r\n      )\r\n      .then(value => {\r\n        ParseFormFieldEnums(value.CustomForm.FormFields);\r\n        return value;\r\n      });\r\n  const [fetchDataPromiseState, fetchDataPromise] = usePromise(fetchData);\r\n  const [state, setState] = useAsyncExtendedState<\r\n    IQuizSubmissionDto | undefined\r\n  >(undefined);\r\n  useEffectOnMount(() => {\r\n    setState(fetchDataPromise(quizSubmissionId));\r\n    return () => {};\r\n  });\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  useEffect(() => {\r\n    if (fetchDataPromiseState.error !== undefined) {\r\n      dispatch(\r\n        actions.addNotification({\r\n          message: 'Error',\r\n          key: 'QuizDetailsDataLoad',\r\n          variant: 'error',\r\n        }),\r\n      );\r\n    }\r\n  }, [actions, dispatch, fetchDataPromiseState.error]);\r\n  const success = React.useMemo(() => state?.UserTraining !== null, [\r\n    state?.UserTraining,\r\n  ]);\r\n\r\n  const backToQuizess = () => {\r\n    if (useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n      dispatch(push(`/quizzes`));\r\n    } else {\r\n      dispatch(push(`/quizzes`));\r\n    }\r\n  };\r\n  const pageActions = [\r\n    () => (\r\n      <React.Fragment>\r\n        <Button\r\n          size={isMobile || !sidePanelExpanded ? 'small' : 'medium'}\r\n          startIcon={<Icon icon=\"arrow-left\" />}\r\n          onClick={backToQuizess}\r\n        >\r\n          {t(translations.BackToQuizzes)}\r\n        </Button>\r\n      </React.Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n  return (\r\n    <PageWrapper\r\n      useSidePanel={useSidePanel}\r\n      pageName={\r\n        !useSidePanel || sidePanelExpanded\r\n          ? (t(translations.Quiz) as string)\r\n          : undefined\r\n      }\r\n      titlePage={state?.CustomForm.Name}\r\n      children={\r\n        !!fetchDataPromiseState.status &&\r\n        fetchDataPromiseState.status !== 'pending' &&\r\n        !!state ? (\r\n          <Box component=\"div\" marginTop={3}>\r\n            <StyledFormFieldsContainer>\r\n              <FormLeftSection>\r\n                <FormFieldsSection>\r\n                  <Grid container direction=\"column\" spacing={2}>\r\n                    <Grid item key=\"score\">\r\n                      <Body bold={true}>\r\n                        {(t(translations.QuizzYourScoreIsXoutofY) as string)\r\n                          .replace('{0}', (state?.Score ?? 0).toString())\r\n                          .replace('{1}', (state?.MaxScore ?? 0).toString())}\r\n                      </Body>\r\n                    </Grid>\r\n                    {success ? (\r\n                      <Grid item key=\"score-succs\">\r\n                        <Box\r\n                          component=\"span\"\r\n                          style={{\r\n                            display: 'flex',\r\n                            gap: 16,\r\n                            flexDirection: 'column',\r\n                          }}\r\n                        >\r\n                          <Box\r\n                            component=\"span\"\r\n                            style={{\r\n                              display: 'flex',\r\n                              gap: 8,\r\n                              flexDirection: 'row',\r\n                              alignItems: 'center',\r\n                            }}\r\n                          >\r\n                            {t(\r\n                              translations.CongratulationsYouHavePassedTheQuiz,\r\n                            )}\r\n                          </Box>\r\n                          {state?.UserTraining?.EquipmentName && (\r\n                            <Box\r\n                              component=\"span\"\r\n                              style={{\r\n                                display: 'flex',\r\n                                gap: 8,\r\n                                flexDirection: 'row',\r\n                                alignItems: 'center',\r\n                              }}\r\n                            >\r\n                              <span>{`${t(\r\n                                translations.YouAreNowCertified,\r\n                              )} on ${t(translations.Equipment)}: `}</span>\r\n                              <Link\r\n                                href={`/Assets/Details.aspx?EquipmentId=${state?.UserTraining?.EquipmentId}`}\r\n                                target=\"_blank\"\r\n                              >\r\n                                {state?.UserTraining?.EquipmentName}\r\n                              </Link>\r\n                              <span>\r\n                                {state?.UserTraining?.TrainingLevelName\r\n                                  ? ` with ${t(translations.Level)}: ${\r\n                                      state?.UserTraining?.TrainingLevelName\r\n                                    }`\r\n                                  : ''}\r\n                              </span>\r\n                            </Box>\r\n                          )}\r\n                          {state?.CustomForm?.QuizSuccessTestMessage && (\r\n                            <Box>\r\n                              {parse(\r\n                                state.CustomForm.QuizSuccessTestMessage || '',\r\n                              )}\r\n                            </Box>\r\n                          )}\r\n                        </Box>\r\n                      </Grid>\r\n                    ) : (\r\n                      <Grid item key=\"score-err\">\r\n                        <Body bold={true}>\r\n                          {t(translations.SorryThisDidNotWorkSoWell)}\r\n                        </Body>\r\n                        {state?.CustomForm?.QuizFailureTestMessage && (\r\n                          <Box>\r\n                            {parse(\r\n                              state.CustomForm.QuizFailureTestMessage || '',\r\n                            )}\r\n                          </Box>\r\n                        )}\r\n                      </Grid>\r\n                    )}\r\n                  </Grid>\r\n                </FormFieldsSection>\r\n              </FormLeftSection>\r\n            </StyledFormFieldsContainer>\r\n          </Box>\r\n        ) : (\r\n          <React.Fragment>\r\n            <Box component=\"div\">\r\n              <Progress\r\n                inProgress={fetchDataPromiseState.status === 'pending'}\r\n                size={80}\r\n              />\r\n            </Box>\r\n          </React.Fragment>\r\n        )\r\n      }\r\n      leftActions={pageActions}\r\n      closable={true}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetCatGroupPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IWorkOrderTypeStatusDto } from 'api/odata/generated/entities/IWorkOrderTypeStatusDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nexport interface IWorkOrderTypeStatusParamsPicker {\r\n  typeId?: number;\r\n  onlyNew?: boolean;\r\n}\r\nexport interface WorkOrderTypeStatusPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'>,\r\n    IWorkOrderTypeStatusParamsPicker {}\r\n\r\nconst url = '/api/odata/v4/WorkOrderStatus';\r\nexport const initWOTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Order asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        'Id,Name,Order,New,Closed,StatusId,WorkOrderTypeId,StatusName,Status',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport function withParamsFilter(\r\n  typeId: number | undefined,\r\n  onlyNew: boolean | undefined,\r\n) {\r\n  if (typeId === undefined) {\r\n    return (searchTerm: string | null) =>\r\n      new Promise<Entity<number>[]>((resolve, reject) => {\r\n        resolve([] as Entity<number>[]);\r\n      });\r\n  } else {\r\n    return (searchTerm: string | null) => {\r\n      const params: { $orderby: string; $filter?: string; $select?: string } = {\r\n        $orderby: 'Order asc',\r\n        $select:\r\n          'Id,Name,Order,New,Closed,StatusId,WorkOrderTypeId,StatusName,Status',\r\n      };\r\n      const predicates: (string | Condition<IWorkOrderTypeStatusDto>)[] = [];\r\n      predicates.push(\r\n        new Condition('WorkOrderTypeId', ODataOperators.Equals, typeId),\r\n      );\r\n      if (onlyNew !== undefined) {\r\n        predicates.push(new Condition('New', ODataOperators.Equals, true));\r\n      }\r\n      params.$filter = new ODataFilterBuilder<IWorkOrderTypeStatusDto>({\r\n        predicates: predicates,\r\n        stringColumns: ['Name'],\r\n        stringSearch: searchTerm === null ? undefined : searchTerm,\r\n        globalServiceGroupFilter: [],\r\n      }).toString();\r\n      return httpClient\r\n        .get(url, params)\r\n        .then(\r\n          response =>\r\n            (response.value as IWorkOrderTypeStatusDto[]) as Entity<number>[],\r\n        );\r\n    };\r\n  }\r\n}\r\nexport function WorkOrderTypeStatusPicker(\r\n  props: WorkOrderTypeStatusPickerProps,\r\n) {\r\n  const loadData = withParamsFilter(props.typeId, props.onlyNew);\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'workordertypestatusId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport interface OpenTimelineProps<TRow> {\r\n  rows: TRow[];\r\n  getEquipmentIds: (rows: TRow[]) => number[];\r\n}\r\n\r\nexport function OpenTimeline<TRow>({\r\n  rows,\r\n  getEquipmentIds,\r\n}: OpenTimelineProps<TRow>) {\r\n  const { t } = useTranslation();\r\n\r\n  const link = React.useMemo(() => {\r\n    return `/Timeline.aspx?${toQueryString({\r\n      services: getEquipmentIds(rows).join(','),\r\n      //openToBook: true,\r\n    })}`;\r\n  }, [getEquipmentIds, rows]);\r\n  return (\r\n    <Button variant=\"white\" size=\"small\" href={link} target=\"_blank\">\r\n      {t(translations.Timeline)}\r\n    </Button>\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  all,\r\n  call,\r\n  put,\r\n  select,\r\n  takeLatest,\r\n  takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { samplePlatesActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { TableFilterBuilder } from 'app/components/BasicTable/TableFilterBuilder';\r\nimport { selectSamplePlatesTableState } from './selectors';\r\nimport { getExportParameters, buildURL } from 'utils/url-utils';\r\nimport { AxiosError } from 'axios';\r\nimport {\r\n  IBulkSamplePlateCreate,\r\n  ISamplePlateCreate,\r\n  SamplePlatesTableState,\r\n} from './types';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { openExportLink } from 'utils/url-utils';\r\n\r\nconst baseUrl = `/api/odata/v4/SamplePlates`;\r\nexport function getLoadDataParams(currentTableState: SamplePlatesTableState) {\r\n  return {\r\n    $count: true,\r\n    $top: currentTableState.pageSize,\r\n    $skip:\r\n      (currentTableState.pageIndex ?? 0) * (currentTableState.pageSize ?? 5),\r\n    $orderby:\r\n      currentTableState.sortBy\r\n        ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n        .join(',') || undefined,\r\n    $select: currentTableState.visibleColumns?.join(','),\r\n    $filter: TableFilterBuilder(\r\n      currentTableState.customFilters as Array<\r\n        IFilterSettings<ISamplePlateDto>\r\n      >,\r\n      currentTableState.globalFilter,\r\n      currentTableState.serviceGroups?.length !== 0\r\n        ? currentTableState.serviceGroups\r\n        : undefined,\r\n      [\r\n        'Id',\r\n        'ServiceGroupName',\r\n        'RoomName',\r\n        'LocationTypeName',\r\n        'LocationName',\r\n        'SamplePlateTypeName',\r\n      ],\r\n    ),\r\n  };\r\n}\r\nfunction* doGet(action: PayloadAction<SamplePlatesTableState>) {\r\n  try {\r\n    const currentTableState = action.payload;\r\n    const someResult = yield call(\r\n      httpClient.get,\r\n      baseUrl,\r\n      getLoadDataParams(currentTableState),\r\n    );\r\n    yield put(actions.get_Success(someResult));\r\n  } catch (error) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.errormessage),\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.get_Error(Error));\r\n  }\r\n\r\n  try {\r\n    const plateTypes = yield call(\r\n      httpClient.get,\r\n      '/api/odata/v4/SamplePlateTypes',\r\n    );\r\n    yield put(actions.getPlateTypes_Success(plateTypes.value));\r\n  } catch (error) {\r\n    console.error(error);\r\n  }\r\n}\r\nfunction* doExport(action: PayloadAction) {\r\n  try {\r\n    const tableState = yield select(selectSamplePlatesTableState);\r\n\r\n    const tableParams = getLoadDataParams({\r\n      ...tableState,\r\n    });\r\n    const entitySetURl = '/api/odata/v4/sampleplates';\r\n    var params = getExportParameters(tableParams);\r\n    const url = buildURL(entitySetURl, params);\r\n    yield call(openExportLink, url);\r\n  } catch (error) {\r\n    console.error('doExport failed', error);\r\n  }\r\n}\r\n\r\nfunction* doRefresh(action: PayloadAction) {\r\n  const tableState = yield select(selectSamplePlatesTableState);\r\n  yield put(actions.get(tableState));\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction<ISamplePlateCreate>) {\r\n  const samplePlateId = action.payload.SamplePlateType?.Id ?? null;\r\n  if (samplePlateId === null) {\r\n    yield put(actions.create_Error('SamplePlateId is required'));\r\n    return;\r\n  }\r\n  const httpPayload: Partial<ISamplePlateDto> = {\r\n    Id: action.payload.Id ?? '',\r\n    RoomId: action.payload.Room?.Id ?? null,\r\n    LocationId: action.payload.Location?.Id ?? null,\r\n    SamplePlateTypeId: samplePlateId,\r\n    ServiceGroupId: action.payload.ServiceGroup?.Id ?? null,\r\n    Active: action.payload.Active ?? true,\r\n    IsRack: action.payload.IsRack ?? false,\r\n  };\r\n  try {\r\n    const someResult = yield call(httpClient.post, baseUrl, httpPayload);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.Success),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.create_Success(someResult));\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'SamplePlatesCreate',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.create_Error(Error));\r\n  }\r\n}\r\n\r\nfunction genratePlatesFromBulk(\r\n  item: IBulkSamplePlateCreate,\r\n): ISamplePlateCreate[] {\r\n  if (item.LastId === undefined) {\r\n    throw new Error('LastId is required');\r\n  }\r\n  const firstId = item.FirstId;\r\n  if (firstId === undefined) {\r\n    throw new Error('FirstId is required');\r\n  }\r\n  const n = item.LastId - firstId + 1;\r\n  const d = Math.floor(Math.log10(item.LastId)) + 1;\r\n  var result = [...Array(n).keys()]\r\n    .map(i => firstId + i)\r\n    .map(i => i.toString().padStart(d, '0'))\r\n    .map(id => ({\r\n      Id: `${item.Prefix}${id}`,\r\n      Room: item.Room,\r\n      Location: item.Location,\r\n      SamplePlateType: item.SamplePlateType,\r\n      ServiceGroup: item.ServiceGroup,\r\n      Active: item.Active,\r\n      IsRack: item.IsRack,\r\n    }));\r\n  return result;\r\n}\r\n\r\nfunction* doBulkCreate(action: PayloadAction<IBulkSamplePlateCreate>) {\r\n  const plates = genratePlatesFromBulk(action.payload);\r\n  const errors: string[] = [];\r\n  let successCount = 0;\r\n\r\n  for (let index = 0; index < plates.length; index++) {\r\n    const plate = plates[index];\r\n\r\n    const samplePlateId = plate.SamplePlateType?.Id ?? null;\r\n    if (samplePlateId === null) {\r\n      yield put(actions.create_Error('SamplePlateId is required'));\r\n      return;\r\n    }\r\n\r\n    const httpPayload: Partial<ISamplePlateDto> = {\r\n      Id: plate.Id ?? '',\r\n      RoomId: plate.Room?.Id ?? null,\r\n      LocationId: plate.Location?.Id ?? null,\r\n      SamplePlateTypeId: samplePlateId,\r\n      ServiceGroupId: plate.ServiceGroup?.Id ?? null,\r\n      Active: plate.Active ?? true,\r\n      IsRack: plate.IsRack ?? false,\r\n    };\r\n    try {\r\n      yield call(httpClient.post, baseUrl, httpPayload);\r\n      successCount++;\r\n    } catch (error: unknown) {\r\n      const message =\r\n        (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n        ((error as AxiosError)?.response?.status === 403\r\n          ? i18next.t(translations.Forbidden)\r\n          : undefined);\r\n      if (message !== undefined) {\r\n        errors.push(message);\r\n      }\r\n    } finally {\r\n      yield put(actions.bulkCreate_SetProgress((100 * index) / plates.length));\r\n    }\r\n  }\r\n  if (errors.length > 0) {\r\n    for (const error of errors) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'SamplePlatesCreate',\r\n          message: error,\r\n          variant: 'error',\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.create_Error(Error));\r\n  }\r\n  if (successCount > 0) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.Success),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.bulkCreate_Success());\r\n  }\r\n}\r\n\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    original: ISamplePlateDto;\r\n    current: Partial<ISamplePlateCreate>;\r\n  }>,\r\n) {\r\n  const current = action.payload.current;\r\n  const samplePlateId = current.SamplePlateType?.Id ?? null;\r\n  if (samplePlateId === null) {\r\n    yield put(actions.create_Error('SamplePlateId is required'));\r\n    return;\r\n  }\r\n  const httpPayload: Partial<ISamplePlateDto> = {\r\n    Id: current.Id ?? '',\r\n    RoomId: current.Room?.Id ?? null,\r\n    LocationId: current.Location?.Id ?? null,\r\n    SamplePlateTypeId: samplePlateId,\r\n    ServiceGroupId: current.ServiceGroup?.Id ?? null,\r\n    LocationName: null,\r\n    RoomName: null,\r\n    SamplePlateTypeName: null,\r\n    ServiceGroupName: null,\r\n    Active: current.Active ?? true,\r\n    IsRack: current.IsRack ?? false,\r\n  };\r\n  try {\r\n    const someResult = yield call(\r\n      httpClient.patch,\r\n      `${baseUrl}('${action.payload.original.Id}')`,\r\n      httpPayload,\r\n    );\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.Success),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.update_Success(someResult));\r\n  } catch (error) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.errormessage),\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.update_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doDelete(action: PayloadAction<string>) {\r\n  const messageKey = 'SamplePlatesDelete';\r\n  try {\r\n    const someResult = yield call(\r\n      httpClient.delete,\r\n      `${baseUrl}('${action.payload}')`,\r\n    );\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: messageKey,\r\n        message: i18next.t(translations.Success),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(actions.delete_Success(someResult));\r\n  } catch (error) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: messageKey,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.delete_Error(Error));\r\n  }\r\n}\r\nfunction* doDeactivatePlates(action: PayloadAction<ISamplePlateDto[]>) {\r\n  const messageKey = 'SamplePlatesDelete';\r\n  try {\r\n    const payload: Pick<ISamplePlateDto, 'Active'> = { Active: false };\r\n    yield all(\r\n      action.payload\r\n        .map(samplePlate => `${baseUrl}('${samplePlate.Id}')`)\r\n        .map(url => call(httpClient.patch, url, payload)),\r\n    );\r\n    yield put(actions.deactivatePlates_Success());\r\n  } catch (error) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: messageKey,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.deactivatePlates_Error());\r\n  }\r\n}\r\n\r\nfunction* doDeletePlates(action: PayloadAction<ISamplePlateDto[]>) {\r\n  const messageKey = 'SamplePlatesDelete';\r\n  try {\r\n    yield all(\r\n      action.payload\r\n        .map(samplePlate => `${baseUrl}('${samplePlate.Id}')`)\r\n        .map(url => call(httpClient.delete, url)),\r\n    );\r\n    yield put(actions.deletePlates_Success());\r\n  } catch (error) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: messageKey,\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.deletePlates_Error());\r\n  }\r\n}\r\n\r\nexport function* samplePlatesSaga() {\r\n  yield takeLatest(actions.get.type, doGet);\r\n  yield takeLatest(actions.create.type, doCreate);\r\n  yield takeLatest(actions.create_Success.type, doRefresh);\r\n  yield takeLatest(actions.bulkCreate.type, doBulkCreate);\r\n  yield takeLatest(actions.bulkCreate_Success.type, doRefresh);\r\n  yield takeLatest(actions.update.type, doUpdate);\r\n  yield takeLatest(actions.update_Success.type, doRefresh);\r\n  yield takeLatest(actions.delete.type, doDelete);\r\n  yield takeLatest(actions.delete_Success.type, doRefresh);\r\n  yield takeLeading(actions.deactivatePlates.type, doDeactivatePlates);\r\n  yield takeLatest(actions.deactivatePlates_Success.type, doRefresh);\r\n  yield takeLeading(actions.deletePlates.type, doDeletePlates);\r\n  yield takeLatest(actions.deletePlates_Success.type, doRefresh);\r\n  yield takeLeading(actions.export, doExport);\r\n}\r\n","import { extractErrorMessages } from 'api/utils';\r\nimport { AxiosError } from 'axios';\r\n//import fileDownload from 'js-file-download';\r\nimport { ExportImportActions } from '.';\r\nimport { ImportData, ImportResult } from './Types';\r\n\r\nexport interface ImportFileResult {\r\n  resultData?: any | undefined;\r\n  resultFileName?: string | undefined;\r\n  importResult: ImportResult;\r\n  errorMessage?: string | undefined;\r\n  NewRecordsImported: number;\r\n  ExistingRecordsUpdated: number;\r\n  ImportErrors: number;\r\n  SystemErrorMessage?: string | null;\r\n}\r\n\r\nasync function ParseResultBlob(\r\n  data: Blob,\r\n): Promise<{ file: Blob | undefined; obj: any | undefined }> {\r\n  const size = data.size;\r\n  const jsonBlobSize = data.slice(size - 4, size);\r\n  const jsonBlobSizeText = await jsonBlobSize.text();\r\n  const l = parseInt(jsonBlobSizeText);\r\n  const jsonBlob = data.slice(size - l - 4, size - 4);\r\n  const s = await jsonBlob.text();\r\n  const obj = JSON.parse(s);\r\n  return {\r\n    file: size - l - 4 > 0 ? data.slice(0, size - l - 4) : undefined,\r\n    obj: obj,\r\n  };\r\n}\r\nexport async function GenericImport(\r\n  file: File | undefined,\r\n  data?: ImportData,\r\n  url?: string,\r\n): Promise<ImportFileResult | undefined> {\r\n  var res: ImportFileResult | undefined = undefined;\r\n  try {\r\n    if (file !== undefined) {\r\n      const response = await ExportImportActions.Import(\r\n        url ?? '/api/GenericImport/Import',\r\n        file,\r\n        data,\r\n      );\r\n      if (response.data !== undefined && response.data.size > 0) {\r\n        const cd = response.headers['content-disposition'];\r\n        const filename =\r\n          cd !== undefined ? cd.split('filename=')[1] : 'ImportResult.xlsx';\r\n        const data = await ParseResultBlob(response.data);\r\n        res = {\r\n          resultData: data.file,\r\n          resultFileName: filename,\r\n          importResult: data.obj.Result as ImportResult,\r\n          NewRecordsImported: data.obj.InsertedRows,\r\n          ExistingRecordsUpdated: data.obj.UpdatedRows,\r\n          ImportErrors: data.obj.Errors,\r\n          SystemErrorMessage: data.obj.SystemErrorMessage,\r\n        };\r\n      } else {\r\n        res = {\r\n          importResult: ImportResult.failed,\r\n          NewRecordsImported: 0,\r\n          ExistingRecordsUpdated: 0,\r\n          ImportErrors: 0,\r\n        };\r\n      }\r\n    } else {\r\n      return Promise.resolve(res);\r\n    }\r\n  } catch (error: unknown) {\r\n    let testmsg = extractErrorMessages(error);\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      testmsg;\r\n    res = {\r\n      importResult: ImportResult.failed,\r\n      errorMessage: message ?? (error as AxiosError)?.message,\r\n      NewRecordsImported: 0,\r\n      ExistingRecordsUpdated: 0,\r\n      ImportErrors: 0,\r\n    };\r\n  }\r\n  return Promise.resolve(res);\r\n}\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport DecimalRenderer from 'app/components/BasicTable/CellRenderers/DecimalRenderer';\r\nimport ServiceIdRenderer from 'app/components/BasicTable/CellRenderers/EquipmentIdRenderer';\r\nimport OperationTypeIdRenderer from 'app/components/BasicTable/CellRenderers/OperationTypeIdRenderer';\r\nimport { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { ColumnWithDep } from 'app/components/BasicTable/types/ColumnWithDeps';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { ExternalLink, Link } from 'app/components/ExternalLink';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { IMyAssetsRow } from './IMyAssetsRow';\r\nimport AssetImageRenderer from 'app/components/BasicTable/CellRenderers/AssetImageRenderer';\r\nimport { RegionLink } from '../Regions/RegionLink';\r\n\r\nexport function getColumns(\r\n  t: TFunction,\r\n  user: AuthenticatedUser | undefined,\r\n  appSettings: AppSettings | null,\r\n  settings: GlobalSettings | null,\r\n) {\r\n  const suppliersLabel = tryParseBool(\r\n    settings?.GetString(AllowedSettings.RequireSupplierExternalId),\r\n  )\r\n    ? t(translations.ExternalCompany)\r\n    : t(translations.SupplierExternalId);\r\n  const isAdmin = user?.Roles.includes(Roles.Administrators);\r\n  const res: ColumnWithDep<IMyAssetsRow>[] = [\r\n    {\r\n      Header: t(translations.HashSymbol) as string,\r\n      accessor: 'Id',\r\n      Cell: ServiceIdRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.Active) as string,\r\n      accessor: 'Active',\r\n      Cell: ({ value }) => <BooleanRender value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.Image) as string,\r\n      accessor: 'ImageName',\r\n      Cell: AssetImageRenderer,\r\n      notShowTitle: true,\r\n    },\r\n    {\r\n      Header: t(translations.Asset) as string,\r\n      accessor: 'Name',\r\n      Cell: ({ value, row }) => {\r\n        return (\r\n          <AssetLink\r\n            id={row.original.Id}\r\n            title={value + t(translations.ShowAssetFull)}\r\n          >\r\n            {value}\r\n          </AssetLink>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Created) as string,\r\n      accessor: 'AssetRecordDate',\r\n      Cell: ({ value }) => <DateTimeLabel value={value as Date} />,\r\n    },\r\n    {\r\n      Header: t(translations.LifeDate) as string,\r\n      accessor: 'LifeDate',\r\n      Cell: ({ value }) => <DateTimeLabel value={value as Date} />,\r\n    },\r\n    {\r\n      Header: t(translations.Status) as string,\r\n      accessor: 'Status',\r\n      Cell: ({ value, row }) => {\r\n        let color = 'black';\r\n        let backgroundColor = 'white';\r\n        switch (row.original.StatusId) {\r\n          case 1:\r\n            color = bookitColors.success.dark;\r\n            backgroundColor = bookitColors.success.background;\r\n            break;\r\n          case 2:\r\n            color = bookitColors.warning.dark;\r\n            backgroundColor = bookitColors.warning.background;\r\n            break;\r\n          case 3:\r\n            color = bookitColors.danger.dark;\r\n            backgroundColor = bookitColors.danger.background;\r\n            break;\r\n          default:\r\n            color = 'black';\r\n            backgroundColor = 'white';\r\n        }\r\n        return (\r\n          <>\r\n            <span\r\n              style={{\r\n                color: `${color}`,\r\n                backgroundColor: `${backgroundColor}`,\r\n                borderRadius: 8,\r\n                padding: 6,\r\n              }}\r\n            >\r\n              {value}\r\n            </span>\r\n          </>\r\n        );\r\n      },\r\n      deps: ['StatusId'],\r\n    },\r\n    {\r\n      Header: t(translations.InstrumentCat) as string,\r\n      accessor: 'InstrumentCatName',\r\n    },\r\n    {\r\n      Header: t(translations.OperationType) as string,\r\n      accessor: 'OperationTypeID',\r\n      Cell: OperationTypeIdRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.Availability) as string,\r\n      accessor: 'AvailabilityTypeName',\r\n    },\r\n    {\r\n      Header: t(translations.AssetCatName) as string,\r\n      accessor: 'AssetCatName',\r\n    },\r\n    {\r\n      Header: t(translations.AssetCatGroupName) as string,\r\n      accessor: 'AssetCatGroupName',\r\n    },\r\n    {\r\n      Header: t(translations.AssetType2Counter) as string,\r\n      accessor: 'Type2Counter',\r\n    },\r\n    {\r\n      Header: t(translations.AccountingId) as string,\r\n      accessor: 'AccountingId',\r\n    },\r\n    {\r\n      Header: t(translations.Overdue) as string,\r\n      accessor: 'Overdue',\r\n    },\r\n    {\r\n      Header: t(translations.DueToday) as string,\r\n      accessor: 'DueToday',\r\n    },\r\n    {\r\n      Header: t(translations.ShortDescriptionOfInstrument) as string,\r\n      accessor: 'ShortDescription',\r\n    },\r\n    {\r\n      Header: t(translations.Description) as string,\r\n      accessor: 'Description',\r\n      Cell: DescriptionCell({ width: 'medium' }),\r\n    },\r\n    {\r\n      Header: t(translations.Campus) as string,\r\n      accessor: 'Campus',\r\n    },\r\n    {\r\n      Header: t(translations.Building) as string,\r\n      accessor: 'Building',\r\n      Cell: ({ value, row }) => {\r\n        if (row.original.AreaMapId === null) {\r\n          return <>{value}</>;\r\n        } else {\r\n          return (\r\n            <>\r\n              <Link\r\n                href={`/Maps/Areas/Details.aspx?id=${row.original.AreaMapId}`}\r\n                target=\"_blank\"\r\n              >\r\n                {value}\r\n              </Link>\r\n            </>\r\n          );\r\n        }\r\n      },\r\n      deps: ['AreaMapId'],\r\n    },\r\n    {\r\n      Header: t(translations.Room) as string,\r\n      accessor: 'Room',\r\n      Cell: ({ value, row }) => {\r\n        if (row.original.RoomMapId === null) {\r\n          return <>{value}</>;\r\n        } else {\r\n          return (\r\n            <>\r\n              <Link\r\n                href={`/Maps/Room.aspx?id=${row.original.RoomId}`}\r\n                target=\"_blank\"\r\n              >\r\n                {value}\r\n              </Link>\r\n            </>\r\n          );\r\n        }\r\n      },\r\n      deps: ['RoomId', 'RoomMapId'],\r\n    },\r\n    {\r\n      Header: t(translations.CoreName) as string,\r\n      accessor: 'ServiceGroupName',\r\n      Cell: ({ value, row }) => {\r\n        if (row.original.ServiceGroupAssetId === null) {\r\n          return <>{value}</>;\r\n        } else {\r\n          return (\r\n            <>\r\n              <ExternalLink\r\n                href=\"\"\r\n                to={{\r\n                  path: 'Assets/Details',\r\n                  search: { id: row.original.ServiceGroupAssetId },\r\n                }}\r\n              >\r\n                {value}\r\n              </ExternalLink>\r\n            </>\r\n          );\r\n        }\r\n      },\r\n      deps: ['ServiceGroupAssetId'],\r\n    },\r\n    {\r\n      Header: t(translations.OtherNames) as string,\r\n      accessor: 'OtherNames',\r\n    },\r\n    {\r\n      Header: t(translations.Brand) as string,\r\n      accessor: 'Brand',\r\n    },\r\n    {\r\n      Header: t(translations.Raac) as string,\r\n      accessor: 'Raac',\r\n      Cell: ({ value }) => <BooleanRender value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.ApprovalRequired) as string,\r\n      accessor: 'ApprovalRequired',\r\n      Cell: ({ value }) => <BooleanRender value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.MainSpecRange) as string,\r\n      accessor: 'MainSpecRange',\r\n    },\r\n    {\r\n      Header: t(translations.WebLink) as string,\r\n      accessor: 'WebLink',\r\n    },\r\n    {\r\n      Header: t(translations.BrandCode) as string,\r\n      accessor: 'BrandCode',\r\n    },\r\n    {\r\n      Header: t(translations.InternalCode) as string,\r\n      accessor: 'InternalCode',\r\n    },\r\n    {\r\n      Header: t(translations.Rank) as string,\r\n      accessor: 'Rank',\r\n    },\r\n    {\r\n      Header: t(translations.ElectricalSpecs) as string,\r\n      accessor: 'ElectricalSpecs',\r\n    },\r\n    {\r\n      Header: t(translations.FunctionalCharacteristics) as string,\r\n      accessor: 'FunctionalCharacteristics',\r\n    },\r\n    {\r\n      Header: t(translations.Inventory) as string,\r\n      accessor: 'inventory',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL0) as string,\r\n      accessor: 'ExtraDDL0Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL1) as string,\r\n      accessor: 'ExtraDDL1Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL2) as string,\r\n      accessor: 'ExtraDDL2Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL3) as string,\r\n      accessor: 'ExtraDDL3Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL4) as string,\r\n      accessor: 'ExtraDDL4Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL5) as string,\r\n      accessor: 'ExtraDDL5Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL6) as string,\r\n      accessor: 'ExtraDDL6Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL7) as string,\r\n      accessor: 'ExtraDDL7Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL8) as string,\r\n      accessor: 'ExtraDDL8Value',\r\n      Cell: ({ value, original }) => !!value && <>{original.ExtraDDL8Value}</>,\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL9) as string,\r\n      accessor: 'ExtraDDL9Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL10) as string,\r\n      accessor: 'ExtraDDL10Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL11) as string,\r\n      accessor: 'ExtraDDL11Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL12) as string,\r\n      accessor: 'ExtraDDL12Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL13) as string,\r\n      accessor: 'ExtraDDL13Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL14) as string,\r\n      accessor: 'ExtraDDL14Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraDDL15) as string,\r\n      accessor: 'ExtraDDL15Value',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText0) as string,\r\n      accessor: 'ExtraText0',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText1) as string,\r\n      accessor: 'ExtraText1',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText2) as string,\r\n      accessor: 'ExtraText2',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText3) as string,\r\n      accessor: 'ExtraText3',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText4) as string,\r\n      accessor: 'ExtraText4',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText5) as string,\r\n      accessor: 'ExtraText5',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText6) as string,\r\n      accessor: 'ExtraText6',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText7) as string,\r\n      accessor: 'ExtraText7',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText8) as string,\r\n      accessor: 'ExtraText8',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText9) as string,\r\n      accessor: 'ExtraText9',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText10) as string,\r\n      accessor: 'ExtraText10',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText11) as string,\r\n      accessor: 'ExtraText11',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText12) as string,\r\n      accessor: 'ExtraText12',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText13) as string,\r\n      accessor: 'ExtraText13',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText14) as string,\r\n      accessor: 'ExtraText14',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraText15) as string,\r\n      accessor: 'ExtraText15',\r\n    },\r\n    {\r\n      accessor: 'ExtraDate0',\r\n      Header: t(translations.Asset_ExtraDate0) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate1',\r\n      Header: t(translations.Asset_ExtraDate1) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate2',\r\n      Header: t(translations.Asset_ExtraDate2) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate3',\r\n      Header: t(translations.Asset_ExtraDate3) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate4',\r\n      Header: t(translations.Asset_ExtraDate4) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate5',\r\n      Header: t(translations.Asset_ExtraDate5) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate6',\r\n      Header: t(translations.Asset_ExtraDate6) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate7',\r\n      Header: t(translations.Asset_ExtraDate7) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate8',\r\n      Header: t(translations.Asset_ExtraDate8) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'ExtraDate9',\r\n      Header: t(translations.Asset_ExtraDate9) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    /*{\r\n          Header: t(translations.Asset_ExtraInt0) as string,\r\n          accessor: 'ExtraInt0',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraInt1) as string,\r\n          accessor: 'ExtraInt1',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraInt2) as string,\r\n          accessor: 'ExtraInt2',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraInt3) as string,\r\n          accessor: 'ExtraInt3',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraInt4) as string,\r\n          accessor: 'ExtraInt4',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraDec0) as string,\r\n          accessor: 'ExtraDec0',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraDec1) as string,\r\n          accessor: 'ExtraDec1',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraDec2) as string,\r\n          accessor: 'ExtraDec2',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraDec3) as string,\r\n          accessor: 'ExtraDec3',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraDec4) as string,\r\n          accessor: 'ExtraDec4',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraBool0) as string,\r\n          accessor: 'ExtraBool0',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraBool1) as string,\r\n          accessor: 'ExtraBool1',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraBool2) as string,\r\n          accessor: 'ExtraBool2',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraBool3) as string,\r\n          accessor: 'ExtraBool3',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraBool4) as string,\r\n          accessor: 'ExtraBool4',\r\n        },*/\r\n    {\r\n      Header: t(translations.Asset_ExtraUrl0) as string,\r\n      accessor: 'ExtraUrl0',\r\n    },\r\n    {\r\n      Header: t(translations.Asset_ExtraUrl1) as string,\r\n      accessor: 'ExtraUrl1',\r\n    },\r\n    /*{\r\n          Header: t(translations.Asset_ExtraUrl2) as string,\r\n          accessor: 'ExtraUrl2',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraUrl3) as string,\r\n          accessor: 'ExtraUrl3',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraUrl4) as string,\r\n          accessor: 'ExtraUrl4',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraRichText0) as string,\r\n          accessor: 'ExtraRichText0',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraRichText1) as string,\r\n          accessor: 'ExtraRichText1',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraRichText2) as string,\r\n          accessor: 'ExtraRichText2',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraRichText3) as string,\r\n          accessor: 'ExtraRichText3',\r\n        },\r\n        {\r\n          Header: t(translations.Asset_ExtraRichText4) as string,\r\n          accessor: 'ExtraRichText4',\r\n        },*/\r\n    {\r\n      Header: t(translations.NickName) as string,\r\n      accessor: 'NickName',\r\n    },\r\n    {\r\n      Header: t(translations.PurchaseOrder) as string,\r\n      accessor: 'POnumber',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceContract) as string,\r\n      accessor: 'ServiceContract',\r\n    },\r\n    {\r\n      Header: t(translations.GasSource) as string,\r\n      accessor: 'GasSource',\r\n    },\r\n    {\r\n      Header: t(translations.ModelNumber) as string,\r\n      accessor: 'ModelNumber',\r\n    },\r\n    {\r\n      Header: t(translations.Accessories) as string,\r\n      accessor: 'AccessoriesText',\r\n    },\r\n    {\r\n      Header: t(translations.SGA_Public) as string,\r\n      accessor: 'Public',\r\n      Cell: ({ value }) => <BooleanRender value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.LocationName) as string,\r\n      accessor: 'LocationName',\r\n    },\r\n    {\r\n      Header: t(translations.SubLocationName) as string,\r\n      accessor: 'SubLocationName',\r\n    },\r\n    {\r\n      Header: t(translations.UnderOriginalWarranty) as string,\r\n      accessor: 'CanViewWarrantyEndDate',\r\n      Cell: ({ value, row }) => {\r\n        if (\r\n          settings?.GetBooleanByKey(\r\n            AllowedSettings.WarrantyEndDateVisibleAllUsers,\r\n          )\r\n        ) {\r\n          return <BooleanRender value={value} />;\r\n        } else {\r\n          let canview =\r\n            user !== undefined &&\r\n            (user.Roles.includes(Roles.Administrators) ||\r\n              user.Roles.includes(Roles.InstrumentEventsAdmin) ||\r\n              (user.Roles.includes(Roles.GroupAdministrators) &&\r\n                user.HasAdminGroupPermissions(\r\n                  row.original.ServiceGroupId ?? undefined,\r\n                )));\r\n          return <BooleanRender value={canview} />;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.ExportLicense) as string,\r\n      accessor: 'ExportLicense',\r\n      Cell: ({ value }) => <BooleanRender value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.Tags) as string,\r\n      accessor: 'TagsText',\r\n    },\r\n    {\r\n      Header: t(translations.EquipmentExperts) as string,\r\n      accessor: 'ExpertsText',\r\n    },\r\n    {\r\n      Header: t(translations.ContactsPersonForEquipment) as string,\r\n      accessor: 'ContactsText',\r\n    },\r\n    {\r\n      Header: suppliersLabel,\r\n      accessor: 'SuppliersText',\r\n    },\r\n    {\r\n      Header: t(translations.AssemblyParent) as string,\r\n      accessor: 'AssemblyParent',\r\n    },\r\n    {\r\n      Header: t(translations.AssemblyChilds) as string,\r\n      accessor: 'AssemblyChilds',\r\n    },\r\n    {\r\n      Header: t(translations.BookAppVersion) as string,\r\n      accessor: 'BookAppVersion',\r\n    },\r\n    {\r\n      Header: t(translations.BookAppVersionUpdateDate) as string,\r\n      accessor: 'BookAppVersionUpdateDate',\r\n      Cell: ({ value }) => <DateTimeLabel value={value as Date} />,\r\n    },\r\n    {\r\n      Header: t(translations.LateTime) as string,\r\n      accessor: 'LateTime',\r\n      Cell: DecimalRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.EarlyLeaveTime) as string,\r\n      accessor: 'EarlyLeaveTime',\r\n      Cell: DecimalRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.EarlyStartAllowedMinutes) as string,\r\n      accessor: 'EarlyStartAllowed',\r\n      Cell: DecimalRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.Model) as string,\r\n      accessor: 'Model',\r\n    },\r\n  ];\r\n\r\n  if (IsModuleEnabled(appSettings, KnownModules.EquipmentAssemblies)) {\r\n    res.push({\r\n      Header: t(translations.InstrumentType) as string,\r\n      accessor: 'InstrumentType',\r\n    });\r\n  }\r\n  if (IsModuleEnabled(appSettings, KnownModules.LocationTracking)) {\r\n    res.push({\r\n      Header: t(translations.LocationUpdatedAt) as string,\r\n      accessor: 'LocationUpdatedAt',\r\n      Cell: ({ value }) => <DateTimeLabel value={value as Date} />,\r\n    });\r\n  }\r\n  if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n    res.push({\r\n      Header: t(translations.Division) as string,\r\n      accessor: 'DivisionName',\r\n      Cell: ({ value, row }) => {\r\n        if (row.original.DivisionAssetId === null) {\r\n          return <>{value}</>;\r\n        } else {\r\n          return (\r\n            <>\r\n              <AssetLink id={row.original.DivisionAssetId}>{value}</AssetLink>\r\n            </>\r\n          );\r\n        }\r\n      },\r\n      deps: ['DivisionAssetId'],\r\n    });\r\n    res.push({\r\n      Header: t(translations.Region) as string,\r\n      accessor: 'RegionName',\r\n      Cell: ({ value, row }) => {\r\n        if (isAdmin) {\r\n          if (!row.original.RegionId || row.original.RegionId === null) {\r\n            return <>{t(translations.NA)}</>;\r\n          } else {\r\n            return (\r\n              <RegionLink\r\n                id={row.original.RegionId}\r\n                initialModel={{\r\n                  Id: row.original.RegionId,\r\n                  Name: row.original.RegionName ?? value,\r\n                }}\r\n                useSidePanel={true}\r\n              >\r\n                {value}\r\n              </RegionLink>\r\n            );\r\n          }\r\n        } else {\r\n          return <>{value ?? t(translations.NA)}</>;\r\n        }\r\n      },\r\n    });\r\n  }\r\n\r\n  return res;\r\n}\r\n","/**\r\n *\r\n * ServiceTypeEnumFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { ServiceTypeEnumPicker } from 'app/components/pickers/StaticOptionsPickers/ServiceTypeEnumPicker';\r\n\r\nexport const ServiceTypeEnumFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <ServiceTypeEnumPicker\r\n      onChange={handleOnChange}\r\n      value={props.value as Entity<number> | undefined}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      additionalItem={props.additionalItem as Entity<number> | undefined}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default ServiceTypeEnumFilter;\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport interface CloneEquipmentSettingsProps<TRow> {\r\n  rows: TRow[];\r\n  getEquipmentIds: (rows: TRow[]) => number[];\r\n}\r\n\r\nexport function CloneEquipmentSettings<TRow>({\r\n  rows,\r\n  getEquipmentIds,\r\n}: CloneEquipmentSettingsProps<TRow>) {\r\n  const { t } = useTranslation();\r\n\r\n  const link = React.useMemo(() => {\r\n    return `/CloneEquipmentSettings.aspx?${toQueryString({\r\n      target: getEquipmentIds(rows).join(','),\r\n    })}`;\r\n  }, [getEquipmentIds, rows]);\r\n  return (\r\n    <Button variant=\"white\" size=\"small\" href={link} target=\"_blank\">\r\n      {t(translations.menu_CloneEquipmentSettings)}\r\n    </Button>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetPickerFilter\r\n *\r\n */\r\nimport { AssetPicker } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\n\r\nexport const AssetPickerFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <AssetPicker\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      onChange={handleOnChange}\r\n      value={props.value as IAssetDto | undefined}\r\n      size=\"small\"\r\n    />\r\n  );\r\n};\r\nexport default AssetPickerFilter;\r\n","import { Link } from 'app/components/ExternalLink';\r\nimport { Roles } from 'app/slice/types';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { Column } from 'react-table';\r\nimport DurationRenderer from 'app/components/BasicTable/CellRenderers/DurationRenderer';\r\n//import DurationHoursRenderer from 'app/components/BasicTable/CellRenderers/DurationHoursRenderer';\r\nimport AssetRenderer from 'app/components/BasicTable/CellRenderers/AssetRenderer';\r\nimport BookedByRenderer from 'app/components/BasicTable/CellRenderers/BookedByRenderer';\r\nimport BooleanRenderer from 'app/components/BasicTable/CellRenderers/BooleanRenderer';\r\nimport { Fragment } from 'react';\r\nimport { Guid } from 'guid-typescript';\r\nimport { DateLabel } from 'app/components/DateLabel.tsx';\r\nimport { roundTwoPlacesAfterDecimalPoint } from 'utils/number-utils';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { ReservationLink } from '../Actions/GlobalSelectedActions/OpenReservation';\r\nimport React from 'react';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { ReferenceType } from 'enums/ReferenceType';\r\n\r\nexport function getColumns(\r\n  t: TFunction,\r\n  user: IAuthenticatedUser | undefined,\r\n  settings: GlobalSettings,\r\n  allowedToView: (row: IReservationHistoryDto) => boolean,\r\n  useSidePanel?: boolean,\r\n  openSidePanel?: (state: SidePanelOpenState) => void,\r\n) {\r\n  if (user === undefined) {\r\n    return [];\r\n  }\r\n\r\n  const result: Column<IReservationHistoryDto>[] = [\r\n    {\r\n      Header: t(translations.Id) as string,\r\n      accessor: 'Id',\r\n      Cell: ({ value, row: { original } }) =>\r\n        allowedToView(original) ? (\r\n          <React.Fragment>\r\n            {useSidePanel && openSidePanel ? (\r\n              <ReservationLink\r\n                id={value}\r\n                openPanelWithCover={openSidePanel}\r\n                useSidePanel={useSidePanel}\r\n              >\r\n                {value}\r\n              </ReservationLink>\r\n            ) : (\r\n              <ReservationLink id={value}>{value}</ReservationLink>\r\n            )}\r\n          </React.Fragment>\r\n        ) : (\r\n          <React.Fragment>{value}</React.Fragment>\r\n        ),\r\n    },\r\n    {\r\n      Header: t(translations.EquipmentName) as string,\r\n      accessor: 'EquipmentName',\r\n      Cell: AssetRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.AvailabilityType) as string,\r\n      accessor: 'AvailabilityType',\r\n    },\r\n    {\r\n      Header: t(translations.StartTime) as string,\r\n      accessor: 'StartTime',\r\n      Cell: ({ value }) => <DateTimeLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.EndTime) as string,\r\n      accessor: 'EndTime',\r\n      Cell: ({ value }) => <DateTimeLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.Status) as string,\r\n      accessor: 'Status',\r\n    },\r\n    {\r\n      Header: t(translations.DurationH) as string,\r\n      accessor: 'DurationH',\r\n      Cell: ({ value }) => {\r\n        if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} </>;\r\n        return <></>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.DurationT) as string,\r\n      accessor: 'DurationT',\r\n      Cell: DurationRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.AccService) as string,\r\n      accessor: 'AccService',\r\n    },\r\n    {\r\n      Header: t(translations.RecordDate) as string,\r\n      accessor: 'RecordDate',\r\n      Cell: ({ value }) => <DateTimeLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetNumber) as string,\r\n      accessor: 'BudgetNumber',\r\n    },\r\n    {\r\n      Header: t(translations.CancelledBefore) as string,\r\n      accessor: 'CancelledBefore',\r\n      Cell: DurationRenderer,\r\n      /*       Cell: ({ value }) =>\r\n        value === undefined\r\n          ? 'N/A'\r\n          : dateUtils.HoursMinutesSecondsFormat(value), */\r\n    },\r\n    {\r\n      Header: t(translations.BudgetTaskName) as string,\r\n      accessor: 'BudgetTaskName',\r\n    },\r\n    {\r\n      Header: t(translations.UserGroup) as string,\r\n      accessor: 'ADGroupDisplayName',\r\n      Cell: ({ value, row }) => {\r\n        if (user.Roles.includes(Roles.Administrators)) {\r\n          return (\r\n            <>\r\n              <Link\r\n                title={t(translations.ADGroup)}\r\n                target=\"_blank\"\r\n                href={'/AllowedAdGroup.aspx?ID=' + row.original.ADGroup}\r\n              >\r\n                {value}\r\n              </Link>\r\n            </>\r\n          );\r\n        } else {\r\n          return <> {value} </>;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.BookedBy) as string,\r\n      accessor: 'BookedBy',\r\n      Cell: BookedByRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetExperiment) as string,\r\n      accessor: 'BudgetExperimentName',\r\n    },\r\n    {\r\n      Header: t(translations.Remarks) as string,\r\n      accessor: 'Remarks',\r\n      // Cell: DescriptonCell({ width: 30 }),\r\n    },\r\n    {\r\n      Header: t(translations.NumberOfUsages) as string,\r\n      accessor: 'NumberOfUsages',\r\n    },\r\n    {\r\n      Header: t(translations.LastModifiedAt) as string,\r\n      accessor: 'LastModifiedAt',\r\n      Cell: ({ value }) => <DateTimeLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.WorkflowBookingName) as string,\r\n      accessor: 'WorkflowBookingName',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceGroup) as string,\r\n      accessor: 'ServiceGroup',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetInternalId) as string,\r\n      accessor: 'BudgetInternalId',\r\n    },\r\n    {\r\n      Header: t(translations.RemainingDurationD) as string,\r\n      accessor: 'RemainingDurationD',\r\n    },\r\n    {\r\n      Header: t(translations.BookedById) as string,\r\n      accessor: 'BookedById',\r\n    },\r\n    {\r\n      Header: t(translations.FullDayReservation) as string,\r\n      accessor: 'FullDayReservation',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.ADGroup) as string,\r\n      accessor: 'ADGroup',\r\n    },\r\n    {\r\n      Header: t(translations.Tutoring) as string,\r\n      accessor: 'Tutoring',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.UserEmail) as string,\r\n      accessor: 'UserEmail',\r\n    },\r\n    {\r\n      Header: t(translations.Loanable) as string,\r\n      accessor: 'Loanable',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.TrainingSignUp) as string,\r\n      accessor: 'TrainingSignUp',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetRemarks) as string,\r\n      accessor: 'BudgetRemarks',\r\n    },\r\n    {\r\n      Header: t(translations.UserGroupMail) as string,\r\n      accessor: 'UserGroupMail',\r\n    },\r\n    {\r\n      Header: t(translations.InsertedBy) as string,\r\n      accessor: 'InsertedBy',\r\n    },\r\n    {\r\n      Header: t(translations.LastUpdateAdmin) as string,\r\n      accessor: 'LastUpdateAdmin',\r\n    },\r\n    {\r\n      Header: t(translations.DivisionDescription) as string,\r\n      accessor: 'DivisionDescription',\r\n    },\r\n    {\r\n      Header: t(translations.Division) as string,\r\n      accessor: 'Division',\r\n    },\r\n    {\r\n      Header: t(translations.AssetId) as string,\r\n      accessor: 'AssetId',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetFund) as string,\r\n      accessor: 'BudgetFund',\r\n    },\r\n    {\r\n      Header: t(translations.AssetInternalCode) as string,\r\n      accessor: 'AssetInternalCode',\r\n    },\r\n    {\r\n      Header: t(translations.AssetRoom) as string,\r\n      accessor: 'AssetRoom',\r\n    },\r\n    {\r\n      Header: t(translations.AssetDescription) as string,\r\n      accessor: 'AssetDescription',\r\n    },\r\n    {\r\n      Header: t(translations.AssetModel) as string,\r\n      accessor: 'AssetModel',\r\n    },\r\n    {\r\n      Header: t(translations.AssetModelNumber) as string,\r\n      accessor: 'AssetModelNumber',\r\n    },\r\n    {\r\n      Header: t(translations.TotalReservations) as string,\r\n      accessor: 'TotalReservations',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceType) as string,\r\n      accessor: 'ServiceType',\r\n    },\r\n    {\r\n      Header: t(translations.Institute) as string,\r\n      accessor: 'Institute',\r\n    },\r\n    {\r\n      Header: t(translations.InstituteType) as string,\r\n      accessor: 'InstituteType',\r\n    },\r\n    {\r\n      Header: t(translations.Department) as string,\r\n      accessor: 'Department',\r\n    },\r\n    {\r\n      Header: t(translations.Units) as string,\r\n      accessor: 'Units',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetInitialCost) as string,\r\n      accessor: 'BudgetInitialCost',\r\n      Cell: ({ value }) => {\r\n        if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} </>;\r\n        return <></>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.BudgetLeader) as string,\r\n      accessor: 'BudgetLeader',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetExternalUpdatedAt) as string,\r\n      accessor: 'BudgetExternalUpdatedAt',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetExternalEndDate) as string,\r\n      accessor: 'BudgetExternalEndDate',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetIsOnline) as string,\r\n      accessor: 'BudgetIsOnline',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetEndDate) as string,\r\n      accessor: 'BudgetEndDate',\r\n      Cell: ({ value }) => <DateTimeLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetStartDate) as string,\r\n      accessor: 'BudgetStartDate',\r\n      Cell: ({ value }) => <DateTimeLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetHideExperiments) as string,\r\n      accessor: 'BudgetHideExperiments',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetManager) as string,\r\n      accessor: 'BudgetManager',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetSubsProfCostCenter) as string,\r\n      accessor: 'BudgetSubsProfCostCenter',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetSubsProfProjectNumber) as string,\r\n      accessor: 'BudgetSubsProfProjectNumber',\r\n    },\r\n    {\r\n      Header: t(translations.FacilityProject) as string,\r\n      accessor: 'FacilityProject',\r\n    },\r\n    {\r\n      Header: t(translations.AssetCampus) as string,\r\n      accessor: 'AssetCampus',\r\n    },\r\n    {\r\n      Header: t(translations.PartialAttendanceStart) as string,\r\n      accessor: 'PartialAttendanceStart',\r\n    },\r\n    {\r\n      Header: t(translations.PartialAttendanceEnd) as string,\r\n      accessor: 'PartialAttendanceEnd',\r\n    },\r\n    {\r\n      Header: t(translations.BudgetSubsProfActivity) as string,\r\n      accessor: 'BudgetSubsProfActivity',\r\n    },\r\n    {\r\n      Header: t(translations.PartialAttendanceDuration) as string,\r\n      accessor: 'PartialAttendanceDuration',\r\n    },\r\n    {\r\n      Header: t(translations.AssetCategory) as string,\r\n      accessor: 'AssetCategory',\r\n    },\r\n    {\r\n      Header: t(translations.AssetCategoryGroup) as string,\r\n      accessor: 'AssetCategoryGroup',\r\n    },\r\n    {\r\n      Header: t(translations.PartialAttendance) as string,\r\n      accessor: 'PartialAttendance',\r\n      Cell: BooleanRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetHardLimit) as string,\r\n      accessor: 'BudgetHardLimit',\r\n      Cell: ({ value }) => {\r\n        if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} </>;\r\n        return <></>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.BudgetSoftLimit) as string,\r\n      accessor: 'BudgetSoftLimit',\r\n      Cell: ({ value }) => {\r\n        if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} </>;\r\n        return <></>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.BudgetAmount) as string,\r\n      accessor: 'BudgetAmount',\r\n      Cell: ({ value }) => {\r\n        if (value) return <> {roundTwoPlacesAfterDecimalPoint(value)} </>;\r\n        return <></>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.AssetBuilding) as string,\r\n      accessor: 'AssetBuilding',\r\n    },\r\n    {\r\n      Header: t(translations.StaffUser) as string,\r\n      accessor: 'StaffUser',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceActivityCode) as string,\r\n      accessor: 'ServiceActivityCode',\r\n    },\r\n    {\r\n      Header: t(translations.AssetBrandCode) as string,\r\n      accessor: 'AssetBrandCode',\r\n    },\r\n    {\r\n      Header: t(translations.Year) as string,\r\n      accessor: 'Year',\r\n    },\r\n    {\r\n      Header: t(translations.Month) as string,\r\n      accessor: 'Month',\r\n    },\r\n    {\r\n      Header: t(translations.WeekNumber) as string,\r\n      accessor: 'WeekNumber',\r\n    },\r\n    {\r\n      Header: t(translations.UserDiscipline) as string,\r\n      accessor: 'UserDiscipline',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceGroupAdminEmail) as string,\r\n      accessor: 'ServiceGroupAdminEmail',\r\n    },\r\n    {\r\n      Header: t(translations.CollaboratorUsers) as string,\r\n      accessor: 'CollaboratorUsers',\r\n      Cell: ({ value }) => {\r\n        if (value) {\r\n          let result = value.map(item => {\r\n            return (\r\n              <Fragment key={`CollaboratorUser_${Guid.create()}`}>\r\n                <span>{item}</span>\r\n                <br />\r\n              </Fragment>\r\n            );\r\n          });\r\n          if (result) return <>{result}</>;\r\n        }\r\n        return t(translations.NA) as string;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.BudgetBudget) as string,\r\n      accessor: 'BudgetBudget',\r\n    },\r\n    {\r\n      Header: t(translations.StartDate) as string,\r\n      accessor: 'StartDate',\r\n      Cell: ({ value }) => <DateLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.EndDate) as string,\r\n      accessor: 'EndDate',\r\n      Cell: ({ value }) => <DateLabel value={value} />,\r\n    },\r\n    {\r\n      Header: t(translations.BudgetPercent) as string,\r\n      accessor: 'BudgetPercent',\r\n    },\r\n    {\r\n      Header: t(translations.Charges) as string,\r\n      accessor: 'Charges',\r\n      Cell: ({ value, row }) =>\r\n        !!value && value !== null ? (\r\n          <Link\r\n            title={t(translations.Charges)}\r\n            target=\"_blank\"\r\n            href={toRootedURL('/Charges', {\r\n              refType: ReferenceType.Reservation as number,\r\n              refId: row.original.Id,\r\n            })}\r\n          >\r\n            {roundTwoPlacesAfterDecimalPoint(value)}\r\n          </Link>\r\n        ) : null,\r\n    },\r\n  ];\r\n  return result;\r\n}\r\n","import { CellProps, Renderer } from 'react-table';\r\nimport { UserProfileLink } from '../../components/UserProfileLink';\r\n\r\ntype RecordType = Record<string, any>;\r\nconst BookedByRenderer: Renderer<CellProps<RecordType>> = ({ value, row }) => {\r\n  if (value === null || value === undefined) {\r\n    return <></>;\r\n  }\r\n  return (\r\n    <UserProfileLink UserId={row.original.BookedById} DisplayName={value} />\r\n  );\r\n};\r\nexport default BookedByRenderer;\r\n","import { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { BasicTable, BasicTableProps } from 'app/components/BasicTable';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function ReservationHistoryTable<\r\n  TProps extends Omit<\r\n    BasicTableProps<IReservationHistoryDto>,\r\n    | 'api'\r\n    | 'additionalColumns'\r\n    | 'searchColumns'\r\n    | 'screenName'\r\n    | 'expandedColumns'\r\n  >,\r\n>({\r\n  initialState,\r\n  rowActions,\r\n  serviceGroups,\r\n  savedListSettings,\r\n  ...props\r\n}: TProps) {\r\n  const { t } = useTranslation();\r\n  const newProps = React.useMemo(() => {\r\n    const p = { ...props };\r\n    Reflect.deleteProperty(p, 'api');\r\n    return p;\r\n  }, [props]);\r\n  const addColumns = React.useMemo<(keyof IReservationHistoryDto)[]>(() => {\r\n    const cols: (keyof IReservationHistoryDto)[] = [\r\n      'Id',\r\n      'AssetId',\r\n      'ServiceGroupId',\r\n      'LastUpdateAdminId',\r\n      'InsertedById',\r\n      'AvailabilityTypeId',\r\n      'SessionId',\r\n      'AssetCatId',\r\n      'AssetGroupId',\r\n      'BudgetId',\r\n      'BudgetExperimentId',\r\n      'BookedById',\r\n      'BudgetExperimentId',\r\n      'EquipmentId',\r\n      'InstituteTypeId',\r\n      'DepartmentId',\r\n      'InstituteId',\r\n      'AssetCampusId',\r\n      'StaffUserId',\r\n      'AssetRoomId',\r\n      'AssetBuildingId',\r\n      'UserDisciplineId',\r\n      'TopAssemblyReservationId',\r\n      'ServiceRequestIds',\r\n      'RowsRequestIds',\r\n    ];\r\n    return cols;\r\n  }, []);\r\n  const url = '/api/odata/v4/ReservationHistory';\r\n  return (\r\n    <>\r\n      <BasicTable\r\n        api={url}\r\n        screenName={t(translations.menu_ReservationsHistory)}\r\n        useExport={true}\r\n        initialState={initialState}\r\n        useRowSelect={true}\r\n        rowActions={rowActions}\r\n        additionalColumns={addColumns}\r\n        searchColumns={[\r\n          'cast(Id,Edm.String)',\r\n          'EquipmentName',\r\n          'BudgetNumber',\r\n          'Remarks',\r\n          'AccService',\r\n          'BookedBy',\r\n          'ServiceGroup',\r\n          'AvailabilityType',\r\n        ]}\r\n        serviceGroups={serviceGroups}\r\n        importLink=\"/ReservationImport.aspx\"\r\n        savedListSettings={{\r\n          enableSavedLists: true,\r\n          savedListRelatedPickerName: 'EquipmentId',\r\n          savedListSerializedKey: 'eid',\r\n        }}\r\n        {...(newProps as TProps)}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Comments } from 'app/components/Comments';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Renderer } from 'react-table';\r\nimport { IInvoiceBatchesDto } from './IInvoiceBatchesDto';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { intersection } from 'lodash';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nexport interface InvoiceBatchesCommentsProps {\r\n  batchId: number;\r\n}\r\n\r\nexport const InvoiceBatchesComments = (props: InvoiceBatchesCommentsProps) => {\r\n  const { t } = useTranslation();\r\n  const User: AuthenticatedUser | undefined = useSelector(\r\n    selectAuthenticatedUser,\r\n  );\r\n\r\n  //PERMISSIONS\r\n  const roles: number[] | undefined = User?.Roles;\r\n\r\n  const allowedRoles: Roles[] = [\r\n    Roles.Administrators,\r\n    Roles.GroupAdministrators,\r\n    Roles.FinAdmin,\r\n    Roles.CustomRole,\r\n  ];\r\n\r\n  const adminRoles: Roles[] = [Roles.Administrators, Roles.GroupAdministrators];\r\n\r\n  const isAdmin: boolean = intersection(roles, adminRoles).length > 0;\r\n  const hasPermissions: boolean = intersection(roles, allowedRoles).length > 0;\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  return (\r\n    <PageWrapper\r\n      disableExpandToggle\r\n      titlePage={`Batch #${props.batchId} ${\r\n        t(translations.CommentsCount) as string\r\n      }`}\r\n      useSidePanel\r\n      closable\r\n    >\r\n      <Box p={2}>\r\n        <Comments\r\n          isAdmin={isAdmin}\r\n          cannotComment={!hasPermissions}\r\n          commentType={CommentReferenceTypes.batches}\r\n          referenceId={props.batchId}\r\n          onCommentAdded={onCommentAdded}\r\n        />\r\n      </Box>\r\n    </PageWrapper>\r\n  );\r\n};\r\n\r\nexport const InvoiceBatchesCommentsRenderer: Renderer<IInvoiceBatchesDto> = ({\r\n  value,\r\n  row: { original },\r\n}) => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const User: AuthenticatedUser | undefined = useSelector(\r\n    selectAuthenticatedUser,\r\n  );\r\n\r\n  //PERMISSIONS\r\n  const roles: number[] | undefined = User?.Roles;\r\n\r\n  const allowedRoles: Roles[] = [\r\n    Roles.Administrators,\r\n    Roles.GroupAdministrators,\r\n    Roles.FinAdmin,\r\n    Roles.CustomRole,\r\n  ];\r\n  const hasPermissions: boolean = intersection(roles, allowedRoles).length > 0;\r\n  const onClick = () => {\r\n    dispatch(\r\n      actions.openSidePanel({\r\n        type: RenderPageType.InvoiceBatchesComments,\r\n        props: { batchId: original.Id },\r\n      }),\r\n    );\r\n  };\r\n  if (!hasPermissions) return <>{value}</>;\r\n  return <Link onClick={onClick}>{value}</Link>;\r\n};\r\n","import { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { OtherServiceDetailsPageProps } from '.';\r\nimport { OfflineServiceQueryStringParameters } from '../Details/slice/types';\r\n\r\nexport const getParams = (\r\n  params: URLSearchParams,\r\n  props: OtherServiceDetailsPageProps,\r\n): OfflineServiceQueryStringParameters => {\r\n  return {\r\n    id:\r\n      props.match.params['ID'] ||\r\n      (GetRawValue(params, 'ID') ?? undefined) ||\r\n      props.match.params['Id'] ||\r\n      (GetRawValue(params, 'Id') ?? undefined) ||\r\n      props.match.params['id'] ||\r\n      (GetRawValue(params, 'id') ?? undefined),\r\n    ipid:\r\n      props.match.params['ipid'] || (GetRawValue(params, 'ipid') ?? undefined),\r\n    servicedate:\r\n      props.match.params['servicedate'] ||\r\n      (GetRawValue(params, 'servicedate') ?? undefined),\r\n\r\n    user:\r\n      props.match.params['user'] || (GetRawValue(params, 'user') ?? undefined),\r\n    bid: props.match.params['bid'] || (GetRawValue(params, 'bid') ?? undefined),\r\n    remarks:\r\n      props.match.params['remarks'] ||\r\n      (GetRawValue(params, 'remarks') ?? undefined),\r\n    be: props.match.params['be'] || (GetRawValue(params, 'be') ?? undefined),\r\n    ecid:\r\n      props.match.params['ecid'] || (GetRawValue(params, 'ecid') ?? undefined),\r\n    po: props.match.params['po'] || (GetRawValue(params, 'po') ?? undefined),\r\n    reference:\r\n      props.match.params['ref'] || (GetRawValue(params, 'ref') ?? undefined),\r\n    factor:\r\n      props.match.params['factor'] ||\r\n      (GetRawValue(params, 'factor') ?? undefined),\r\n    amount:\r\n      props.match.params['amount'] ||\r\n      (GetRawValue(params, 'amount') ?? undefined),\r\n    adg: props.match.params['adg'] || (GetRawValue(params, 'adg') ?? undefined),\r\n    stid:\r\n      props.match.params['stid'] || (GetRawValue(params, 'stid') ?? undefined),\r\n    ReservationId:\r\n      props.match.params['ReservationId'] ||\r\n      (GetRawValue(params, 'ReservationId') ?? undefined),\r\n    UsageId:\r\n      props.match.params['UsageId'] ||\r\n      (GetRawValue(params, 'UsageId') ?? undefined),\r\n    batchId:\r\n      props.match.params['batchId'] ||\r\n      (GetRawValue(params, 'batchId') ?? undefined),\r\n  };\r\n};\r\n","import { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { translations } from 'locales/translations';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport {\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  getNumberEntityArray,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  GetStringOrUndefined,\r\n  initPickerValue,\r\n  URLSearchParamsCI,\r\n  arrayToQueryString,\r\n  initMultiExPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initProjectData } from 'app/components/pickers/AutocompletePickers/ProjectPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport { initInstituteData } from 'app/components/pickers/AutocompletePickers/InstitutePicker';\r\nimport InstituteFilter from 'app/components/BasicTable/Filters/InstituteFilter';\r\nimport InstituteTypeFilter from 'app/components/BasicTable/Filters/InstituteTypeFilter';\r\nimport { initInstituteTypeData } from 'app/components/pickers/AutocompletePickers/InstituteTypePicker';\r\nimport DepartmentFilter from 'app/components/BasicTable/Filters/DepartmentFilter';\r\nimport { initDepartmentData } from 'app/components/pickers/AutocompletePickers/DepartmentPicker';\r\nimport { initUserGroupData } from 'app/components/pickers/AutocompletePickers/UserGroupPicker';\r\nimport UserGroupFilter from 'app/components/BasicTable/Filters/UserGroupFIlter';\r\nimport { initServiceGroupsMultiData } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { ServiceGroupsFilter } from 'app/components/BasicTable/Filters/ServiceGroupsFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { BudgetByUserGroupFilter } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { ProjectFilter } from 'app/components/BasicTable/Filters/ProjectFilter';\r\n\r\nexport const GetFilters: GetPageFilters<IInvoiceBudgetBalanceDto> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParamsCI(search);\r\n  const result: IFilterSettings<IInvoiceBudgetBalanceDto>[] = [];\r\n  // Project\r\n  if (IsModuleEnabled(appSettings, KnownModules.Budgets)) {\r\n    result.push({\r\n      fieldName: 'BudgetId',\r\n      displayName: t(translations.BudgetNumber),\r\n      operator: ODataOperators.Equals,\r\n      // value: getDefaultFilterValue('bid', params),\r\n      queryStringSerializer: 'bid',\r\n      initData: initPickerValue(initProjectData),\r\n      value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'bid'))),\r\n      component: ProjectFilter,\r\n      dependencyProp: ['UserGroupId'],\r\n      filterPredicates: BudgetByUserGroupFilter,\r\n    });\r\n  }\r\n  // Online/ offline projects: (online only/ offline only/ All= default)\r\n  result.push({\r\n    fieldName: 'BudgetOnline',\r\n    displayName: t(translations.BudgetIsOnline),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'BudgetIsOnline',\r\n    value: GetBooleanEntity(\r\n      GetBooleanOrUndefined(GetRawValue(params, 'BudgetIsOnline')),\r\n      t,\r\n    ),\r\n    component: BooleanPickerFilter,\r\n  });\r\n  // Has Balance/ Estimated charges (yes/no/ all, default= all) - is this generating a performance issue (same question as above)\r\n  result.push({\r\n    fieldName: 'HasBalanceOrEstimatedCharges',\r\n    displayName: t(translations.HasBalanceOrEstimatedCharges),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'HasBalanceOrEstimatedCharges',\r\n    value: GetBooleanEntity(\r\n      GetBooleanOrUndefined(\r\n        GetRawValue(params, 'HasBalanceOrEstimatedCharges'),\r\n      ),\r\n      t,\r\n    ),\r\n    component: BooleanPickerFilter,\r\n  });\r\n  // User group- as per the project user group.\r\n  result.push({\r\n    fieldName: 'UserGroupId',\r\n    displayName: t(translations.UserGroup),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(GetStringOrUndefined(GetRawValue(params, 'adg'))),\r\n    component: UserGroupFilter,\r\n    queryStringSerializer: 'adg',\r\n    initData: initPickerValue(initUserGroupData),\r\n  });\r\n  // Department- as per the project user group.\r\n  result.push({\r\n    id: 'DepartmentId',\r\n    fieldName: 'DepartmentId',\r\n    queryStringSerializer: 'DepartmentId',\r\n    displayName: t(translations.Department),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'DepartmentId')),\r\n    ),\r\n    initData: initPickerValue(initDepartmentData),\r\n    component: DepartmentFilter,\r\n  });\r\n  // Institute- as per the project user group.\r\n  result.push({\r\n    fieldName: 'InstituteId', // connected to Company\r\n    displayName: t(translations.Company),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'InstituteId',\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'InstituteId')),\r\n    ),\r\n    initData: initPickerValue(initInstituteData),\r\n    component: InstituteFilter,\r\n  });\r\n  // Institute Type -as per the project user group.\r\n\r\n  result.push({\r\n    fieldName: 'InstituteTypeId', // Company Type\r\n    displayName: t(translations.InstituteType),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'InstituteTypeId',\r\n    value: GetPartialEntity(\r\n      GetNumberOrUndefined(GetRawValue(params, 'InstituteTypeId')),\r\n    ),\r\n    initData: initPickerValue(initInstituteTypeData),\r\n    component: InstituteTypeFilter,\r\n  });\r\n  // Only Active (yes/ no, default= yes)\r\n  result.push({\r\n    fieldName: 'BudgetActive',\r\n    displayName: t(translations.Active),\r\n    operator: ODataOperators.Equals,\r\n    queryStringSerializer: 'Active',\r\n    value: GetBooleanEntity(\r\n      GetBooleanOrUndefined(GetRawValue(params, 'Active')),\r\n      t,\r\n    ),\r\n    component: BooleanPickerFilter,\r\n  });\r\n  result.push({\r\n    fieldName: 'ServiceGroupId',\r\n    displayName: t(translations.ServiceGroups),\r\n    operator: ODataOperators.Includes,\r\n    queryStringSerializer: arrayToQueryString('ServiceGroupId'),\r\n    value: getNumberEntityArray(params, 'ServiceGroupId'),\r\n    initData: initMultiExPickerValue(initServiceGroupsMultiData),\r\n    component: ServiceGroupsFilter,\r\n    urlKey: 'ServiceGroupId',\r\n  });\r\n  return result;\r\n};\r\n","import { CircularProgress } from '@material-ui/core';\r\nimport { FrontendLayout_MainContent_ID } from 'app/Layout/FrontendLayout';\r\nimport Infinite, {\r\n  Props as InfiniteProps,\r\n} from 'react-infinite-scroll-component';\r\n\r\nexport interface InfiniteScrollProps\r\n  extends Pick<\r\n    InfiniteProps,\r\n    | 'children'\r\n    | 'next'\r\n    | 'hasMore'\r\n    | 'dataLength'\r\n    | 'className'\r\n    | 'style'\r\n    | 'hasChildren'\r\n    | 'scrollableTarget'\r\n    | 'scrollThreshold'\r\n  > {}\r\n\r\nexport const InfiniteScroll = ({\r\n  children,\r\n  style,\r\n  className,\r\n  scrollableTarget = FrontendLayout_MainContent_ID,\r\n  ...props\r\n}: InfiniteScrollProps) => {\r\n  return (\r\n    <Infinite\r\n      loader={\r\n        <h4 style={{ display: 'flex', justifyContent: 'center' }}>\r\n          <CircularProgress size={30} />\r\n        </h4>\r\n      }\r\n      className={className}\r\n      scrollableTarget={scrollableTarget}\r\n      style={\r\n        style ??\r\n        (className !== undefined\r\n          ? undefined\r\n          : {\r\n              overflow: 'hidden',\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 16,\r\n            })\r\n      }\r\n      {...props}\r\n    >\r\n      {children}\r\n    </Infinite>\r\n  );\r\n};\r\n","export enum JoinStatusEnum {\r\n  Undefined = 0,\r\n  Approved = 1,\r\n  Pending = 2,\r\n  Disapproved = 3,\r\n}\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { RegionDetailsProps } from 'app/pages/Regions/RegionsDetailsPage/Details';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { CellProps, Renderer } from 'react-table';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nconst RegionRenderer: Renderer<CellProps<Record<string, any>>> = ({\r\n  value,\r\n  row,\r\n}) => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const User: AuthenticatedUser | undefined = useSelector(\r\n    selectAuthenticatedUser,\r\n  );\r\n  return !!User && User.isAdmin() ? (\r\n    <Button\r\n      variant=\"text\"\r\n      size=\"small\"\r\n      onClick={() =>\r\n        dispatch(\r\n          actions.openSidePanel({\r\n            type: RenderPageType.RegionDetails,\r\n            props: {\r\n              useSidePanel: true,\r\n              id: '' + row.original.Id,\r\n              initialModel: row.original,\r\n            } as RegionDetailsProps,\r\n          }),\r\n        )\r\n      }\r\n    >\r\n      {value}\r\n    </Button>\r\n  ) : (\r\n    <>{value}</>\r\n  );\r\n};\r\nexport default RegionRenderer;\r\n","import * as React from 'react';\r\nimport clsx from 'clsx';\r\n\r\n/**\r\n * EventContent props\r\n */\r\nexport interface EventContentProps {\r\n  /**\r\n   * Background color of the event (instrument color)\r\n   */\r\n  backgroundColor?: string;\r\n  /**\r\n   * Width of the container\r\n   */\r\n  containerWidth: string;\r\n  /**\r\n   * Width in pixels of the event container element (e.g. event length * time scale)\r\n   */\r\n  height: number;\r\n  /**\r\n   * Header content\r\n   */\r\n  header?: React.ReactNode;\r\n  /**\r\n   * Body content\r\n   */\r\n  body?: React.ReactNode;\r\n  /**\r\n   * Readonly\r\n   */\r\n  readonly?: boolean;\r\n  /**\r\n   * calculated top position of the event content on calendar week/unit view\r\n   */\r\n  offsetTopHeight?: number;\r\n  notClickable?: boolean;\r\n}\r\n\r\n/**\r\n * Provides a layout of event element\r\n * @param props props\r\n * @returns Event Content\r\n */\r\nexport function EventContent(props: EventContentProps) {\r\n  // overrides .dhx_cal_event .dhx_title height property from dhtmlxscheduler_material.css\r\n  const EVENT_TITLE_HEIGHT = 34;\r\n  return (\r\n    <>\r\n      {/* this one is in the dhtmlx's demo/docs, but this element does not appear much */}\r\n      {!props.readonly && (\r\n        <div className=\"dhx_event_move dhx_header\">&nbsp;</div>\r\n      )}\r\n      {/* drag handle on the event title */}\r\n      {props.header !== undefined && (\r\n        <div\r\n          className={clsx(\r\n            {\r\n              dhx_event_move: !props.readonly,\r\n              dhx_event_click: !props.notClickable,\r\n            },\r\n            'dhx_title',\r\n          )}\r\n          style={{\r\n            width: props.containerWidth,\r\n            backgroundColor: props.backgroundColor,\r\n            height: EVENT_TITLE_HEIGHT,\r\n          }}\r\n        >\r\n          {props.header}\r\n        </div>\r\n      )}\r\n      <div\r\n        className={clsx(\r\n          {\r\n            dhx_event_move: !props.readonly,\r\n            dhx_event_click: !props.notClickable,\r\n          },\r\n          'dhx_body',\r\n        )}\r\n        style={{\r\n          height:\r\n            props.height -\r\n            (props.header === undefined ? 0 : EVENT_TITLE_HEIGHT),\r\n          position: 'absolute',\r\n          top:\r\n            (props.offsetTopHeight ?? 0) === 0\r\n              ? 'unset'\r\n              : props.offsetTopHeight ?? 0,\r\n        }}\r\n      >\r\n        {props.body}\r\n      </div>\r\n      {/* resize handle on the bottom of the event */}\r\n      {!props.readonly && (\r\n        <div\r\n          // dhx_event_resize must be the first className of the resize handle\r\n          className=\"dhx_event_resize dhx_footer\"\r\n          style={{\r\n            width: props.containerWidth,\r\n          }}\r\n        ></div>\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import { dateUtils } from 'utils/date-utils';\r\n\r\n/**\r\n * Shared funciton used in scheduler to format time labels\r\n * @param d date\r\n * @returns string representation of the time part\r\n */\r\nexport const formatSchedulerTime = (d: Date) => dateUtils.format(d, 'p');\r\n\r\n/**\r\n * Shared funciton used in scheduler to format time labels\r\n * @param d date\r\n * @returns string representation of the time part\r\n */\r\nexport const formatSchedulerDateTime = (d: Date) => dateUtils.format(d, 'Pp');\r\n","import * as React from 'react';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { formatSchedulerTime } from '../../utils/formatSchedulerTime';\r\n\r\n/**\r\n * Event header props\r\n */\r\nexport interface EventHeaderProps {\r\n  event: ISchedulerEvent;\r\n}\r\n\r\n/**\r\n * Event header element\r\n * @param props props\r\n * @returns Event header\r\n */\r\nexport function EventHeader(props: EventHeaderProps) {\r\n  return (\r\n    <>\r\n      <div>\r\n        {formatSchedulerTime(props.event.start_date)}\r\n        {' - '}\r\n        {formatSchedulerTime(props.event.end_date)}\r\n      </div>\r\n      <div>{props.event.service_name}</div>\r\n    </>\r\n  );\r\n}\r\n","import { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { Icon, IconProps } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TrainingState, TrainingStateUnion } from 'enums/TrainingState';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\n\r\nexport interface TrainingSessionStatusProps extends Omit<IconProps, 'icon'> {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionStatus({\r\n  event,\r\n  size,\r\n  className,\r\n}: TrainingSessionStatusProps) {\r\n  const training = event.original as ITrainingSessionSlotDto;\r\n  const stateid = training.TrainingState;\r\n  if (stateid === undefined) {\r\n    return null;\r\n  }\r\n  const state = TrainingState[stateid] as TrainingStateUnion;\r\n  switch (state) {\r\n    case 'SignedUp':\r\n      return <Icon icon=\"calendar-check\" size={size} className={className} />;\r\n    // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_SignedUp\") %>');\r\n    case 'UnderMinimum':\r\n      return (\r\n        <Icon icon=\"calendar-exclamation\" size={size} className={className} />\r\n      );\r\n    // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_UnderMinimum\") %>');\r\n    case 'Available':\r\n      return <Icon icon=\"calendar-plus\" size={size} className={className} />;\r\n    // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_Available\") %>');\r\n    case 'Maximum':\r\n      return <Icon icon=\"calendar-times\" size={size} className={className} />;\r\n    // icon = icon.replace(\":title\", '<%= Bookit.CustomResourceProviderFactory.GetJsString(\"TrainingSessions_Calendar_Maximum\") %>');\r\n    default:\r\n      assertExhaustive(state);\r\n  }\r\n}\r\n","import { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventContent, EventContentProps } from './EventContent';\r\nimport { EventHeader } from './EventHeader';\r\nimport { TrainingSessionStatus } from './TrainingSessionStatus';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\n\r\nexport interface TrainingSessionEventContentProps extends EventContentProps {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionEventConent(\r\n  props: TrainingSessionEventContentProps,\r\n) {\r\n  return (\r\n    <EventContent\r\n      containerWidth={props.containerWidth}\r\n      height={props.height}\r\n      backgroundColor={\r\n        (props.event.original as ICalendarReservationDto)?.EquipmentColor ||\r\n        undefined\r\n      }\r\n      header={<TrainingSessionEventHeader event={props.event} />}\r\n      body={<TrainingSessionEventBody event={props.event} />}\r\n      readonly\r\n      offsetTopHeight={props.offsetTopHeight}\r\n      notClickable={props.notClickable}\r\n    />\r\n  );\r\n}\r\nexport interface TrainingSessionEventHeaderProps {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionEventHeader(\r\n  props: TrainingSessionEventHeaderProps,\r\n) {\r\n  return (\r\n    <>\r\n      <TrainingSessionStatus\r\n        size=\"2x\"\r\n        className=\"dhx_training_status\"\r\n        event={props.event}\r\n        // {...props}\r\n      />\r\n      <EventHeader event={props.event} />\r\n    </>\r\n  );\r\n}\r\n\r\nexport interface TrainingSessionEventBodyProps {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function TrainingSessionEventBody(props: TrainingSessionEventBodyProps) {\r\n  const dto = props.event.original as ITrainingSessionSlotDto;\r\n  return (\r\n    <>\r\n      <Icon icon=\"dumbbell\" />\r\n      {dto.TrainerName != null && (\r\n        <>\r\n          &ensp;\r\n          {dto.TrainerName}\r\n        </>\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { Icon, IconProps } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n  ReservationStatus,\r\n  ReservationStatusUnion,\r\n} from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\n// import { getReservationIconName } from './getReservationIconName';\r\n\r\nexport interface ReservationStatusContentProps extends Omit<IconProps, 'icon'> {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function ReservationStatusIcon({\r\n  event,\r\n  ...props\r\n}: ReservationStatusContentProps) {\r\n  const reservation = event.original as ICalendarReservationDto;\r\n  const statusId = reservation.StatusId;\r\n  if (statusId === undefined) {\r\n    return null;\r\n  }\r\n  if (statusId === null) {\r\n    return null;\r\n  }\r\n  const reservationStatus = ReservationStatus[\r\n    statusId\r\n  ] as ReservationStatusUnion;\r\n  switch (reservationStatus) {\r\n    case 'Pending':\r\n    case 'PendingCoord':\r\n      return <Icon icon={['far', 'comment-question']} {...props} />;\r\n    case 'Draft':\r\n      return <Icon icon={['far', 'circle-exclamation']} {...props} />;\r\n    case 'Approved':\r\n      if (reservation.Tutoring) {\r\n        return <Icon icon={['far', 'circle-check']} {...props} />;\r\n      }\r\n      return null;\r\n    case 'Cancelled':\r\n    case 'AllStatus':\r\n    case 'CancelledByAdmin':\r\n    case 'Done':\r\n    case 'NotDone':\r\n    case 'DoneWOBooking':\r\n    case 'ApprovedOnce':\r\n    case 'Tentative':\r\n      return null;\r\n    default:\r\n      assertExhaustive(reservationStatus);\r\n  }\r\n  // const iconName =  getReservationIconName(\r\n  //   ReservationStatus[statusid] as ReservationStatusUnion,\r\n  //   reservation.Tutoring,\r\n  // );\r\n\r\n  // if (iconName === undefined) {\r\n  //   return null;\r\n  // }\r\n\r\n  // return <Icon icon={['far', iconName]} {...props} />;\r\n}\r\n","import * as React from 'react';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventContent, EventContentProps } from './EventContent';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ReservationStatusIcon } from './ReservationStatusIcon';\r\nexport interface ReservationEventContentProps extends EventContentProps {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function ReservationEventConent(props: ReservationEventContentProps) {\r\n  const x = props.event.original as ICalendarReservationDto;\r\n\r\n  return (\r\n    <EventContent\r\n      containerWidth={props.containerWidth}\r\n      backgroundColor={x?.EquipmentColor || undefined}\r\n      body={<ReservationEventBody event={props.event} body={props.body} />}\r\n      height={props.height}\r\n      //todo: add ediability conditaionally based on premissions/etc.\r\n      readonly={props.readonly}\r\n      offsetTopHeight={props.offsetTopHeight}\r\n      notClickable={props.notClickable}\r\n    />\r\n  );\r\n}\r\nexport interface ReservationEventBodyProps {\r\n  event: ISchedulerEvent;\r\n  body: React.ReactNode;\r\n}\r\nexport function ReservationEventBody(props: ReservationEventBodyProps) {\r\n  const dto = props.event.original as ICalendarReservationDto;\r\n  return !!dto && !!dto.Restricted && dto.Restricted === true ? (\r\n    <span>{''}</span>\r\n  ) : (\r\n    <span\r\n      style={{\r\n        display: 'flex',\r\n        flexWrap: 'wrap',\r\n        alignItems: 'center',\r\n        columnGap: 8,\r\n        rowGap: 4,\r\n      }}\r\n    >\r\n      {!!dto && !!dto.StatusId && <ReservationStatusIcon event={props.event} />}\r\n      {props.body}\r\n    </span>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventContent, EventContentProps } from './EventContent';\r\nimport { EventHeader } from './EventHeader';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nexport interface OfflineEventContentProps extends EventContentProps {\r\n  event: ISchedulerEvent;\r\n}\r\nexport function OfflineEventConent(props: OfflineEventContentProps) {\r\n  return (\r\n    <EventContent\r\n      containerWidth={props.containerWidth}\r\n      backgroundColor={\r\n        (props.event.original as ICalendarReservationDto)?.EquipmentColor ||\r\n        undefined\r\n      }\r\n      header={<EventHeader event={props.event} />}\r\n      body={props.body}\r\n      height={props.height}\r\n      readonly={props.readonly}\r\n      offsetTopHeight={props.offsetTopHeight}\r\n      notClickable={props.notClickable}\r\n    />\r\n  );\r\n}\r\n","import * as ReactDOMServer from 'react-dom/server';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { BookitThemeSettings } from 'styles/theme';\r\nimport { SimplePaletteColorOptions } from '@material-ui/core/styles/createPalette';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { TrainingSessionEventConent } from './TrainingSessionEventConent';\r\nimport { ReservationEventConent } from './ReservationEventContent';\r\nimport { EventType } from '../../slice/types';\r\nimport { EventContentProps } from './EventContent';\r\nimport { OfflineEventConent } from './OfflineEventContent';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ISchedulerState } from '../../types/ISchedulerState';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\n/**\r\n * Render fundtion that is used by the scheduler to build event's contents\r\n * see https://docs.dhtmlx.com/scheduler/api__scheduler_renderevent.html for more details\r\n * @param container Container DOM element of the rendered event\r\n * @param ev Event object\r\n * @param width Event width provided by the scheduler\r\n * @param height Event height provided by the scheduler\r\n * @param header_content Event header content\r\n * @param body_content Event body content\r\n * @returns true\r\n */\r\nexport const renderEvent = (scheduler: DHTMLX.SchedulerStatic) => (\r\n  container: HTMLDivElement,\r\n  ev: ISchedulerEvent,\r\n  width: number,\r\n  height: number,\r\n  header_content: string,\r\n  body_content: string,\r\n) => {\r\n  try {\r\n    var container_width = container.style.width; // e.g. \"105px\"\r\n    // set background color on the event container instead of setting it on each child separately\r\n    const backgroundColor = getBackgroundColor({\r\n      type: ev.type,\r\n      color:\r\n        (ev.original as ICalendarReservationDto)?.EquipmentColor ?? ev.color,\r\n    });\r\n    if (backgroundColor !== undefined) {\r\n      container.style.backgroundColor = backgroundColor;\r\n    }\r\n    const topEventHeight = getSlotsFromEvent(\r\n      ev.start_date,\r\n      ev.end_date,\r\n      scheduler.config.scroll_hour,\r\n    );\r\n    // get original full event obj instead of the cloned one\r\n    // start/end on ev might be set to start/end of the day for multi day events get cloned\r\n    const originalEvent: ISchedulerEvent = scheduler.getEvent(ev.id);\r\n\r\n    // get a render function for each event type type\r\n    const RenderFC = RenderEvent(originalEvent.type);\r\n\r\n    const state: ISchedulerState = scheduler.getState();\r\n\r\n    const readonly =\r\n      originalEvent.readonly ||\r\n      // set event to be readonly (disables drag/resize) when the start/end is outside of the time period shown on the timeline\r\n      // this prevents cpu crunch done by the scheduler in onBeforeDrag event handler for long (multi day/year) reservations\r\n      // this prevents dragging multi day event in day calendar when no feedback is provided regarding start/end of the event\r\n      originalEvent.start_date < state.min_date ||\r\n      originalEvent.end_date > state.max_date;\r\n    const notClickable = originalEvent.notClickable;\r\n    // render an html and shove it into event container\r\n    container.innerHTML = ReactDOMServer.renderToStaticMarkup(\r\n      <RenderFC\r\n        containerWidth={container_width}\r\n        event={originalEvent}\r\n        header={header_content}\r\n        body={HTMLReactParser(body_content)}\r\n        height={height - topEventHeight}\r\n        readonly={readonly}\r\n        notClickable={notClickable}\r\n        offsetTopHeight={topEventHeight}\r\n      />,\r\n    );\r\n  } catch (error) {\r\n    console.error(error);\r\n    return false;\r\n  }\r\n  // true - the scheduler displays a custom form\r\n  return true;\r\n};\r\nconst getSlotsFromEvent = (\r\n  start: Date,\r\n  end: Date,\r\n  scroll_hour: number,\r\n): number => {\r\n  let duration = dateUtils.intervalToDuration({\r\n    start: start,\r\n    end: end,\r\n  });\r\n  if (\r\n    start.getHours() < 8 &&\r\n    end > new Date(new Date(start).setHours(10)) &&\r\n    ((duration?.hours ?? 0) > 3 || (duration?.days ?? 0) > 0)\r\n  ) {\r\n    //let totalSlotsHeight = 44 * 24;\r\n    let eithSlotsHeight = 44 * scroll_hour;\r\n    let startHeight = ((start.getHours() * 60 + start.getMinutes()) / 60) * 44;\r\n    // let endHeight = ((end.getHours() * 60 + end.getMinutes()) / 60) * 44;\r\n    // if (endHeight <= eithSlotsHeight + 88) {\r\n    //   startHeight = startHeight - (eithSlotsHeight + 88 - endHeight);\r\n    // }\r\n    // let calHeight = document?.querySelector('.dhx_cal_data')?.clientHeight;\r\n    // let shiftHeight =\r\n    //   totalSlotsHeight - (calHeight ?? 0) - (totalSlotsHeight - eventHeight);\r\n    //return Math.floor(shiftHeight);\r\n    return Math.floor(eithSlotsHeight - startHeight);\r\n  }\r\n  return 0;\r\n};\r\n\r\nconst getBackgroundColor = ({\r\n  type,\r\n  color,\r\n}: Pick<ISchedulerEvent, 'type' | 'color'>): string | undefined => {\r\n  const trainingSessionBackgroundColor = '#99dcfa';\r\n  const defaultColor =\r\n    (BookitThemeSettings.palette?.primary as SimplePaletteColorOptions)?.main ??\r\n    bookitColors.primary.regular;\r\n  // new events won't have any type\r\n  if (type === undefined) {\r\n    return defaultColor;\r\n  }\r\n  switch (type) {\r\n    case 'offline':\r\n      return undefined;\r\n    case 'reservation':\r\n      // todo: set different color for approved/pending/etc.\r\n      return color ?? defaultColor;\r\n    case 'trainingsession':\r\n      return trainingSessionBackgroundColor;\r\n    default:\r\n      assertExhaustive(type);\r\n  }\r\n};\r\n\r\ninterface RenderEventProps extends EventContentProps {\r\n  event: ISchedulerEvent;\r\n}\r\n\r\nfunction RenderEvent(eventType?: EventType): React.FC<RenderEventProps> {\r\n  if (eventType === undefined) {\r\n    return ReservationEventConent;\r\n  }\r\n  switch (eventType) {\r\n    case 'trainingsession':\r\n      return TrainingSessionEventConent;\r\n    case 'reservation':\r\n      return ReservationEventConent;\r\n    case 'offline':\r\n      return OfflineEventConent;\r\n    default:\r\n      assertExhaustive(eventType);\r\n  }\r\n}\r\n","import { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport produce from 'immer';\r\nimport { chain } from 'lodash';\r\nimport { AppSettings, IsAssetImageExist } from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport {\r\n  ISchedulerAssetCatSection,\r\n  ISchedulerSection,\r\n  ISchedulerServiceSection,\r\n} from './types/ISchedulerSection';\r\n\r\nexport interface fooProps {\r\n  services: IServiceFilterDto[] | undefined;\r\n  appSettings: AppSettings | null;\r\n  groupBy?: TimelineGroupByUnion;\r\n}\r\n\r\nexport function prepareSchedulerSections(props: fooProps): ISchedulerSection[] {\r\n  if (props.services === undefined || props.services.length === 0) {\r\n    return [{ label: '', type: 'empty' }];\r\n  }\r\n  const r1 = props.services.map(setImageName(props.appSettings));\r\n  const groupByOption = props.groupBy ?? 'NoTimelineGrouped';\r\n  switch (groupByOption) {\r\n    case 'GroupByAssemblyPart':\r\n      return groupAssemblyParts(r1);\r\n    case 'GroupByAssetCat':\r\n      return groupAssetCats(r1);\r\n    case 'NoTimelineGrouped':\r\n      return r1.map(mapServiceToSection);\r\n    default:\r\n      assertExhaustive(groupByOption);\r\n  }\r\n}\r\nfunction mapServiceToSection(\r\n  service: IServiceFilterDto,\r\n): ISchedulerServiceSection {\r\n  return {\r\n    type: 'service',\r\n    key: service.Id,\r\n    label: service.Name,\r\n    data: service,\r\n  };\r\n}\r\n\r\nexport function groupAssetCats(\r\n  services: Array<IServiceFilterDto>,\r\n): ISchedulerSection[] {\r\n  const result = chain(services)\r\n    .groupBy(service =>\r\n      JSON.stringify({ Id: service.AssetCatId, Name: service.AssetCatName }),\r\n    )\r\n    .map((value, key) => {\r\n      const assetCat: Entity<number> = JSON.parse(key);\r\n      const section: ISchedulerAssetCatSection = {\r\n        key: `assetCat_${assetCat.Id}`,\r\n        label: assetCat.Name,\r\n        open: true,\r\n        type: 'assetCat',\r\n        children: value.map(mapServiceToSection),\r\n      };\r\n      return section;\r\n    })\r\n    .value();\r\n  return result;\r\n}\r\n/**\r\n * Groups services by their respective assembly configuration\r\n * @param services\r\n * @returns\r\n */\r\nexport function groupAssemblyParts(\r\n  services: Array<IServiceFilterDto>,\r\n): ISchedulerSection[] {\r\n  const sections: ISchedulerServiceSection[] = services.map(item => ({\r\n    type: 'service',\r\n    key: item.Id,\r\n    label: item.Name,\r\n    open: false,\r\n    data: { ...item },\r\n  }));\r\n\r\n  const result = sections.reduce(\r\n    (accumulator, currentValue, currentIndex, array) => {\r\n      const parent =\r\n        array.find(f => f.key === currentValue.data.AssemblyId) ??\r\n        array.find(f => f.key === currentValue.data.TopAssemblyId);\r\n\r\n      if (parent !== undefined) {\r\n        accumulator.splice(accumulator.indexOf(currentValue), 1);\r\n        if (parent.children === undefined) {\r\n          parent.children = [];\r\n        }\r\n        parent.children?.push(currentValue);\r\n      }\r\n      return accumulator;\r\n    },\r\n    [...sections],\r\n  );\r\n\r\n  return result;\r\n}\r\n\r\nfunction setImageName(appSettings: AppSettings | null | undefined) {\r\n  return produce((service: IServiceFilterDto) => {\r\n    service.ImageName =\r\n      getAssetImageThumbSrc(\r\n        service.ImageName || null,\r\n        'thumbSmall',\r\n        IsAssetImageExist(\r\n          appSettings ?? null,\r\n          service.ImageName || null,\r\n          'thumbSmall',\r\n        ),\r\n      ) ?? null;\r\n  });\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ISchedulerService } from './slice/types';\r\nimport { orderBy } from 'lodash';\r\nimport {\r\n  ISchedulerSection,\r\n  ISchedulerServiceSection,\r\n} from './types/ISchedulerSection';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { prepareSchedulerSections } from './servicesToSections';\r\nimport { AppSettings } from 'types/AppSettings';\r\n\r\n/**\r\n * The \"services\" server list name\r\n */\r\nexport const scheduler_services_collection_name = 'services';\r\n/**\r\n * Sets the Services server list\r\n * @param scheduler scheduler instance\r\n * @param services services\r\n */\r\nexport function setServerList(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n  services: ISchedulerService[] = [],\r\n  appSettings: AppSettings | null,\r\n  groupBy?: TimelineGroupByUnion,\r\n) {\r\n  const sections = prepareSchedulerSections({\r\n    appSettings: appSettings,\r\n    groupBy: groupBy ?? 'NoTimelineGrouped',\r\n    services: services,\r\n  });\r\n  // order the services so that they will show up sorted in the timeline/unit\r\n  const orderedServerListData = orderBy(sections ?? [], f => f.label);\r\n  // set the scheduler's server list\r\n  scheduler.serverList(\r\n    scheduler_services_collection_name,\r\n    orderedServerListData,\r\n  );\r\n}\r\n\r\n/**\r\n * Retrieves the Services stored in scheduler's server list.\r\n * @param scheduler\r\n * @returns\r\n */\r\nexport function getServerList(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n): Array<ISchedulerSection> {\r\n  const serverList = scheduler?.serverList(\r\n    scheduler_services_collection_name,\r\n  ) as Array<ISchedulerSection>;\r\n  const result = serverList.filter(\r\n    f => (f as ISchedulerSection).type === 'service',\r\n  ) as Array<ISchedulerServiceSection>;\r\n  return result;\r\n}\r\n\r\n/**\r\n * Updates the Services stored in scheduler's server list.\r\n * @param scheduler\r\n * @param services\r\n */\r\nexport function updateServerList(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n  services: Array<ISchedulerService> = [],\r\n  appSettings: AppSettings | null,\r\n  groupBy?: TimelineGroupByUnion,\r\n) {\r\n  const sections = prepareSchedulerSections({\r\n    appSettings: appSettings,\r\n    services: services,\r\n    groupBy: groupBy,\r\n  });\r\n\r\n  scheduler.updateCollection(scheduler_services_collection_name, sections);\r\n}\r\n\r\n/**\r\n * Retrieves a single Service details (if there's any) stored in the scheduler's server list\r\n * @param scheduler\r\n * @param serviceId\r\n * @returns\r\n */\r\nexport function getServerListService(scheduler, serviceId: number | undefined) {\r\n  const services = getServerList(scheduler);\r\n  const service =\r\n    serviceId === undefined\r\n      ? undefined\r\n      : (services?.find(\r\n          f => f.type === 'service' && f.key === serviceId,\r\n        ) as ISchedulerServiceSection);\r\n  return service?.data;\r\n}\r\n","import * as ReactDOMServer from 'react-dom/server';\r\nimport { SimplePaletteColorOptions } from '@material-ui/core/styles/createPalette';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { BookitThemeSettings } from 'styles/theme';\r\nimport { isMobile } from 'react-device-detect';\r\nimport {\r\n  ISchedulerSection,\r\n  ISchedulerServiceSection,\r\n} from './types/ISchedulerSection';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\n/**\r\n * Renders static html for service column/header\r\n * @param params\r\n * @returns\r\n */\r\nexport function scheduleServiceTemplate(params: ISchedulerSection) {\r\n  const type = params.type;\r\n\r\n  switch (type) {\r\n    case 'service':\r\n      const component = TimelineServiceContent(params);\r\n      const html = ReactDOMServer.renderToStaticMarkup(component);\r\n      const foo = html.replace(\r\n        '<img',\r\n        '<img onError=\"this.style.opacity=\\'0\\';this.onError=null;\" ',\r\n      );\r\n      return foo;\r\n    case 'assetCat':\r\n      return params.label;\r\n    case 'empty':\r\n      return '';\r\n    default:\r\n      assertExhaustive(type);\r\n  }\r\n}\r\n\r\nexport const scheduleServiceContainerClassName = 'schedule_service_label';\r\nexport const scheduleServicePadding = 'schedule_service_label_padding';\r\nexport const scheduleServicePaddingMobile =\r\n  'schedule_service_label_mobile_padding';\r\nexport const scheduleImageClassName = 'schedule_service_image';\r\nexport const scheduleServiceIdAttributeName = 'data-equipment-id';\r\nexport const scheduleServiceLabelText = 'schedule_service_label_text';\r\nexport const scheduleServiceLabelTextMobile =\r\n  'schedule_service_label_text_mobile';\r\n/**\r\n * Used to render service content on timeline column & unit header\r\n * @param props props containing the service details\r\n * @returns scheduler service label content\r\n */\r\nexport function TimelineServiceContent(props: ISchedulerServiceSection) {\r\n  const mobileView = isMobile || window.innerWidth < 600;\r\n  try {\r\n    if (props.data === undefined) {\r\n      return <></>;\r\n    }\r\n    if (props.key === undefined) {\r\n      return <></>;\r\n    }\r\n    const backgroundColor =\r\n      props.data.Color ??\r\n      (BookitThemeSettings.palette?.primary as SimplePaletteColorOptions)?.main;\r\n\r\n    const style: React.CSSProperties = {\r\n      backgroundColor: backgroundColor,\r\n    };\r\n    const containerProps = {\r\n      className: `${scheduleServiceContainerClassName} ${\r\n        mobileView ? scheduleServicePaddingMobile : scheduleServicePadding\r\n      }`,\r\n    };\r\n    containerProps[scheduleServiceIdAttributeName] = props.data?.Id;\r\n    const imageProps = {\r\n      className: scheduleImageClassName,\r\n    };\r\n    imageProps[scheduleServiceIdAttributeName] = props.data?.Id;\r\n    const labelTextProps = {\r\n      className: mobileView\r\n        ? scheduleServiceLabelTextMobile\r\n        : scheduleServiceLabelText,\r\n    };\r\n\r\n    /**\r\n     * imageName is populated with the ImagePath in the following file\r\n     * @see src\\app\\pages\\CalendarPage\\Scheduler\\index.tsx\r\n     * @todo use the raw ImageName on IServiceFilterDto object and calculated required image path here\r\n     */\r\n    // Asset image is set in\r\n    const src = props.data.ImageName ?? '';\r\n    return (\r\n      <>\r\n        <span className=\"schedule_service_container\">\r\n          {!isMobile && (\r\n            <span {...imageProps}>\r\n              {src === undefined || src.indexOf('Default') > 0 ? (\r\n                <Icon icon=\"microscope\" />\r\n              ) : (\r\n                <img src={src} alt=\"\" />\r\n              )}\r\n            </span>\r\n          )}\r\n\r\n          <div {...containerProps} style={style} title={props.label}>\r\n            <span {...labelTextProps}>{props.label}</span>\r\n          </div>\r\n        </span>\r\n      </>\r\n    );\r\n  } catch (error) {\r\n    console.error(error);\r\n    return <></>;\r\n  }\r\n}\r\n","import { ISchedulerEvent } from '../types/ISchedulerEvent';\r\n\r\n/**\r\n * Custom compare function that controls events order on the timeline:\r\n * 1. Earlier events must appear first - this controls the cascading/overlapping display.\r\n * 2. Training sessions must appear on top with signups below\r\n * This function is ultimately plugged as an argument into events.sort after which the events are arranged on the timeline to accomodate for overlapping, row height, etc.\r\n * @param a event\r\n * @param b event\r\n * @returns 1 | -1 | 0\r\n */\r\nexport function timelineEventsSortIteratee(\r\n  a: ISchedulerEvent,\r\n  b: ISchedulerEvent,\r\n): 1 | -1 | 0 {\r\n  return (\r\n    // dates sort must appear first for proper arrangement of overlaps\r\n    compareFn(a, b, event => event.start_date.valueOf()) ??\r\n    // only later same date/time events are arranged so that training session will be on top\r\n    compareFn(a, b, event => (event.type === 'trainingsession' ? -1 : 1)) ??\r\n    // fallback to event id to ensure stable sorting\r\n    compareFn(a, b, event => event.id) ??\r\n    0\r\n  );\r\n}\r\n\r\nfunction compareFn<T>(\r\n  a: ISchedulerEvent,\r\n  b: ISchedulerEvent,\r\n  accessor: (c: ISchedulerEvent) => T,\r\n) {\r\n  const valueA = accessor(a);\r\n  const valueB = accessor(b);\r\n  if (valueA === valueB) {\r\n    return undefined;\r\n  } else if (valueA < valueB) {\r\n    return -1;\r\n  } else {\r\n    return 1;\r\n  }\r\n}\r\n","import { H3 } from 'app/components/Typography';\r\nimport { H4 } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport function NoServices() {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <FlexRowDiv>\r\n      <Box textAlign=\"center\" style={{ marginTop: '5%' }}>\r\n        <H3>{t(translations.NothingToShowForThisScheduler_Title)}</H3>\r\n        <H4>{t(translations.NothingToShowForThisScheduler_Message)}</H4>\r\n      </Box>\r\n    </FlexRowDiv>\r\n  );\r\n}\r\n","// https://github.com/OliverJAsh/fp-ts-react-hooks/blob/master/src/index.ts\r\n\r\nimport * as A from 'fp-ts/lib/Array';\r\nimport { Eq, fromEquals, strictEqual } from 'fp-ts/lib/Eq';\r\n//import * as O from 'fp-ts/lib/Option';\r\nimport * as ReadonlyArray from 'fp-ts/lib/ReadonlyArray';\r\nimport * as Record from 'fp-ts/lib/Record';\r\nimport * as React from 'react';\r\nimport {\r\n  useCustomCompareCallback,\r\n  useCustomCompareEffect,\r\n  useCustomCompareMemo,\r\n} from 'use-custom-compare';\r\n\r\nconst eqStrict = fromEquals(strictEqual);\r\n\r\nexport const eq: Eq<unknown> = fromEquals((a, b) =>\r\n  Array.isArray(a) && Array.isArray(b)\r\n    ? eqArray.equals(a, b)\r\n    : eqStrict.equals(a, b),\r\n);\r\n\r\n//const eqOption = O.getEq(eq);\r\nconst eqArray = A.getEq(eq);\r\n\r\nconst eqDependencies = ReadonlyArray.getEq(eq);\r\n\r\nconst eqProps = Record.getEq(eq);\r\n\r\nexport const useCallback: typeof React.useCallback = (fn, dependencies) =>\r\n  useCustomCompareCallback(\r\n    fn,\r\n    dependencies !== undefined ? dependencies : [],\r\n    eqDependencies.equals,\r\n  );\r\n\r\nexport const useEffect: typeof React.useEffect = (fn, dependencies) =>\r\n  useCustomCompareEffect(\r\n    fn,\r\n    dependencies !== undefined ? dependencies : [],\r\n    eqDependencies.equals,\r\n  );\r\n\r\nexport const useMemo: typeof React.useMemo = (fn, dependencies) =>\r\n  useCustomCompareMemo(\r\n    fn,\r\n    dependencies !== undefined ? dependencies : [],\r\n    eqDependencies.equals,\r\n  );\r\n\r\nexport const memo = <P extends object>(Component: React.FC<P>) =>\r\n  React.memo(Component, eqProps.equals);\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport * as React from 'react';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventType } from '../../slice/types';\r\nimport {\r\n  formatSchedulerDateTime,\r\n  formatSchedulerTime,\r\n} from '../../utils/formatSchedulerTime';\r\nimport { ReservationStatusIcon } from './ReservationStatusIcon';\r\nimport { TrainingSessionStatus } from './TrainingSessionStatus';\r\n\r\n/**\r\n * Event Timeline Content props\r\n */\r\nexport interface EventTimelineContentProps {\r\n  event: ISchedulerEvent;\r\n  viewType: 'calendar' | 'timeline' | 'unit';\r\n  body?: string;\r\n  isMobile: boolean;\r\n}\r\n\r\n/**\r\n * Event timeline content element\r\n * @param props props\r\n * @returns Event timeline content\r\n */\r\nexport function EventTimelineContent(props: EventTimelineContentProps) {\r\n  // get a render function for each event type type\r\n  const RenderFC = RenderEvent(\r\n    props.viewType,\r\n    props.isMobile,\r\n    props.event.type,\r\n    props.body,\r\n  );\r\n  return (\r\n    <>\r\n      <RenderFC {...props} />\r\n    </>\r\n  );\r\n}\r\n\r\nfunction RenderEvent(\r\n  viewType: 'calendar' | 'timeline' | 'unit',\r\n  isMobile: boolean,\r\n  eventType?: EventType,\r\n  body?: string,\r\n): React.FC<EventTimelineContentProps> {\r\n  if (eventType === undefined) {\r\n    return ReservationEventConent;\r\n  }\r\n  switch (eventType) {\r\n    case 'trainingsession':\r\n      return TrainingSessionEventConent;\r\n    case 'reservation':\r\n      return ReservationEventConent;\r\n    case 'offline':\r\n      return OfflineEventConent;\r\n    default:\r\n      assertExhaustive(eventType);\r\n  }\r\n}\r\nfunction OfflineEventConent(props: EventTimelineContentProps) {\r\n  const offline = props.event.original as ICalendarReservationDto;\r\n\r\n  return (\r\n    <span\r\n      style={{\r\n        display: 'flex',\r\n        alignItems: 'center',\r\n        justifyContent: 'center',\r\n      }}\r\n    >\r\n      <span\r\n        style={{\r\n          color: '#4B5565',\r\n          fontWeight: 'bold',\r\n        }}\r\n      >\r\n        {formatSchedulerDateTime(props.event.start_date)}\r\n        {' - '}\r\n        {props.event.end_date === null ||\r\n        props.event.end_date === undefined ||\r\n        props.event.end_date.getTime() >\r\n          dateUtils.addYears(props.event.start_date, 5).getTime() ? (\r\n          <Icon icon={['fad', 'infinity']} size=\"xl\" />\r\n        ) : (\r\n          formatSchedulerDateTime(props.event.end_date)\r\n        )}\r\n      </span>\r\n      &ensp;\r\n      {offline.Remarks != null && offline.Remarks !== undefined && (\r\n        <span\r\n          style={{\r\n            color: '#4B5565',\r\n          }}\r\n        >\r\n          {HTMLReactParser(offline.Remarks)}\r\n        </span>\r\n      )}\r\n    </span>\r\n  );\r\n}\r\nfunction TrainingSessionEventConent(props: EventTimelineContentProps) {\r\n  const training = props.event.original as ITrainingSessionSlotDto;\r\n\r\n  return (\r\n    <span\r\n      style={{\r\n        display: 'inline-flex',\r\n        alignItems: 'flex-start',\r\n        justifyContent: 'start',\r\n        flexWrap: 'wrap', //props.viewType === 'calendar' ? 'wrap' : 'nowrap',\r\n        gap: props.viewType === 'calendar' ? 8 : 4,\r\n      }}\r\n    >\r\n      <TrainingSessionStatus className=\"dhx_training_status\" {...props} />\r\n      <p>\r\n        {formatSchedulerTime(props.event.start_date)}\r\n        {' - '}\r\n        {formatSchedulerTime(props.event.end_date)}\r\n      </p>\r\n      <Icon icon=\"dumbbell\" />\r\n      {training.TrainerName != null && <p>{training.TrainerName}</p>}\r\n    </span>\r\n  );\r\n}\r\nfunction ReservationEventConent(props: EventTimelineContentProps) {\r\n  const reservation = props.event.original as ICalendarReservationDto;\r\n  //   const timelineTempl =\r\n  //     \"<span>{{formatDate StartTime 'h:mm a'}} - {{formatDate EndTime 'h:mm a'}}</span>\";\r\n  //   let compileTempl = compileHandlebarsTemplate<ICalendarReservationDto>(\r\n  //     timelineTempl,\r\n  //   );\r\n  //   let resTempl = compileTempl?.(reservation);\r\n  const bodyContent = !!props.body ? (\r\n    HTMLReactParser(props.body)\r\n  ) : (\r\n    <span>\r\n      {formatSchedulerTime(props.event.start_date)}\r\n      {' - '}\r\n      {formatSchedulerTime(props.event.end_date)}\r\n    </span>\r\n  );\r\n  return !!reservation && reservation.Restricted ? (\r\n    <span>{''}</span>\r\n  ) : (\r\n    <span\r\n      style={{\r\n        display: 'inline-flex',\r\n        alignItems: 'flex-start',\r\n        justifyContent: 'start',\r\n        flexWrap: 'wrap', //props.viewType === 'calendar' ? 'wrap' : 'nowrap',\r\n        gap: props.viewType === 'calendar' ? 8 : 4,\r\n      }}\r\n    >\r\n      {!!reservation && !!reservation.StatusId && (\r\n        <ReservationStatusIcon event={props.event} />\r\n      )}\r\n      {bodyContent}\r\n      {/* &ensp;\r\n      <span>\r\n        {formatSchedulerTime(props.event.start_date)}\r\n        {' - '}\r\n        {formatSchedulerTime(props.event.end_date)}\r\n      </span> */}\r\n    </span>\r\n  );\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { getLogger } from 'loglevel';\r\nimport ReactDOMServer from 'react-dom/server';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { EventTimelineContent } from '../EventRender/EventTimelineContent';\r\n\r\nconst log = getLogger('Scheduler - event_text');\r\nexport function event_text(\r\n  viewType: 'calendar' | 'timeline' | 'unit',\r\n  isMobile: boolean,\r\n  SchedulerReservationBodyTemplate?: Handlebars.TemplateDelegate<\r\n    ICalendarReservationDto\r\n  >,\r\n): (start: Date, end: Date, event: ISchedulerEvent) => string {\r\n  return function (start: Date, end: Date, event: ISchedulerEvent) {\r\n    try {\r\n      switch (viewType) {\r\n        case 'timeline':\r\n          const body =\r\n            event.type === 'reservation'\r\n              ? SchedulerReservationBodyTemplate?.(\r\n                  event.original as ICalendarReservationDto,\r\n                ) ?? ''\r\n              : undefined;\r\n          const result = timeline_event_text({\r\n            viewType,\r\n            isMobile,\r\n            body,\r\n            event,\r\n          });\r\n          return result;\r\n        case 'calendar':\r\n        case 'unit':\r\n          try {\r\n            switch (event.type) {\r\n              case 'reservation':\r\n                const reservation = event.original as ICalendarReservationDto;\r\n                const r = SchedulerReservationBodyTemplate?.(reservation) ?? '';\r\n                return r;\r\n              default:\r\n                return '';\r\n            }\r\n          } catch (error) {\r\n            log.error('error in event_text', event, error);\r\n            return '';\r\n          }\r\n        default:\r\n          return '';\r\n      }\r\n    } catch (error) {\r\n      log.error('error in event_text', event, error);\r\n      return '';\r\n    }\r\n  };\r\n}\r\n\r\nexport function timeline_event_text(props: {\r\n  viewType: 'calendar' | 'timeline' | 'unit';\r\n  isMobile;\r\n  body?: string;\r\n  event: ISchedulerEvent;\r\n}): string {\r\n  try {\r\n    return ReactDOMServer.renderToStaticMarkup(\r\n      <EventTimelineContent\r\n        event={props.event}\r\n        body={props.body}\r\n        viewType={props.viewType}\r\n        isMobile={props.isMobile}\r\n      />,\r\n    );\r\n  } catch (error) {\r\n    log.error('error in event_text', props.event, error);\r\n    return '';\r\n  }\r\n}\r\n","import { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nexport interface TooltipLineProps {\r\n  label: string;\r\n  value: string | number | JSX.Element | JSX.Element[] | null | undefined;\r\n}\r\nexport function TooltipLine({ label: lablel, value }: TooltipLineProps) {\r\n  if (value === undefined) {\r\n    return null;\r\n  }\r\n  if (value === null) {\r\n    return null;\r\n  }\r\n  if (typeof value === 'string' && isEmptyOrWhitespace(value)) {\r\n    return null;\r\n  }\r\n  return (\r\n    <div>\r\n      <b>{lablel}</b>:&nbsp;\r\n      <span>{value}</span>\r\n    </div>\r\n  );\r\n}\r\n","import BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { ITrainingSessionSlotDto } from 'api/odata/generated/entities/ITrainingSessionSlotDto';\r\nimport { TrainingState, TrainingStateUnion } from 'enums/TrainingState';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { formatSchedulerDateTime } from '../../../utils/formatSchedulerTime';\r\nimport { SchedulerEventTooltipProps } from '../SchedulerEventTooltipProps';\r\nimport { TooltipLine } from '../TooltipLine';\r\n\r\nexport function TrainingSessionTooltip(props: SchedulerEventTooltipProps) {\r\n  const dto = props.event.original as ITrainingSessionSlotDto;\r\n  const statusTextLocalizationKey = statusTextKey(dto.TrainingState);\r\n  const footerTextLocalizationKey = statusClickTextKey(dto.TrainingState);\r\n  const available = (dto.Attendees ?? 0) < (dto.MaxAttendees ?? 0);\r\n  return (\r\n    <>\r\n      <TooltipLine\r\n        label={i18next.t(translations.Start)}\r\n        value={formatSchedulerDateTime(props.event.start_date)}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.End)}\r\n        value={formatSchedulerDateTime(props.event.end_date)}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Service)}\r\n        value={props.event.service_name}\r\n      />\r\n      <BasicTypography>\r\n        {i18next.t(translations.TrainingSession)}\r\n      </BasicTypography>\r\n      {statusTextLocalizationKey !== undefined && available && (\r\n        <BasicTypography>\r\n          {i18next.t(statusTextLocalizationKey)}\r\n        </BasicTypography>\r\n      )}\r\n      <TooltipLine\r\n        label={i18next.t(translations.Trainer)}\r\n        value={dto.TrainerName}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Campus)}\r\n        value={dto.CampusName}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Building)}\r\n        value={dto.BuildingName}\r\n      />\r\n      <TooltipLine label={i18next.t(translations.Room)} value={dto.RoomName} />\r\n      <TooltipLine\r\n        label={i18next.t(translations.TrainingSignedUp)}\r\n        value={dto.Attendees}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.MinAttendees)}\r\n        value={dto.MinAttendees}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.MaxAttendees)}\r\n        value={dto.MaxAttendees}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Remarks)}\r\n        value={dto.Remarks === null ? null : HTMLReactParser(dto.Remarks)}\r\n      />\r\n      {footerTextLocalizationKey !== undefined && (\r\n        <BasicTypography>\r\n          {i18next.t(footerTextLocalizationKey)}\r\n        </BasicTypography>\r\n      )}\r\n    </>\r\n  );\r\n}\r\n\r\nconst statusTextKey = (stateid: number) => {\r\n  const state = TrainingState[stateid] as TrainingStateUnion;\r\n  try {\r\n    switch (state) {\r\n      case 'SignedUp':\r\n        return translations.TrainingSessions_Calendar_SignedUp;\r\n      case 'UnderMinimum':\r\n        return translations.TrainingSessions_Calendar_UnderMinimum;\r\n      case 'Available':\r\n        return translations.TrainingSessions_Calendar_Available;\r\n      case 'Maximum':\r\n        return translations.TrainingSessions_Calendar_Maximum;\r\n      default:\r\n        assertExhaustive(state);\r\n    }\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n};\r\n\r\nconst statusClickTextKey = (stateid: number) => {\r\n  const state = TrainingState[stateid] as TrainingStateUnion;\r\n  try {\r\n    switch (state) {\r\n      case 'SignedUp':\r\n        return translations.TrainingSessions_Calendar_ClickToView;\r\n      case 'UnderMinimum':\r\n        return translations.TrainingSessions_Calendar_ClickToSignUp;\r\n      case 'Available':\r\n        return translations.TrainingSessions_Calendar_ClickToSignUp;\r\n      case 'Maximum':\r\n        return translations.TrainingSessions_Calendar_ClickToSignUp;\r\n      default:\r\n        assertExhaustive(state);\r\n    }\r\n  } catch (error) {\r\n    return undefined;\r\n  }\r\n};\r\n","import { IWorkingHoursDto } from 'api/odata/generated/entities/IWorkingHoursDto';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nimport { formatSchedulerDateTime } from '../../../utils/formatSchedulerTime';\r\nimport { SchedulerEventTooltipProps } from '../SchedulerEventTooltipProps';\r\nimport { TooltipLine } from '../TooltipLine';\r\n\r\nexport function OfflineTooltip(props: SchedulerEventTooltipProps) {\r\n  let remarks =\r\n    (props.event.original as IWorkingHoursDto).Remarks === null\r\n      ? null\r\n      : (props.event.original as IWorkingHoursDto).Remarks;\r\n  return (\r\n    <>\r\n      <TooltipLine\r\n        label={i18next.t(translations.Service)}\r\n        value={props.event.service_name}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.User)}\r\n        value={props.event.user_name}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Start)}\r\n        value={formatSchedulerDateTime(props.event.start_date)}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.End)}\r\n        value={formatSchedulerDateTime(props.event.end_date)}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Reason)}\r\n        value={(props.event.original as IWorkingHoursDto).ReasonTypeName}\r\n      />\r\n      <TooltipLine\r\n        label={i18next.t(translations.Remarks)}\r\n        value={remarks === null ? null : HTMLReactParser(remarks)}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { Body } from 'app/components/Typography';\r\nimport { ReservationStatus } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport HTMLReactParser from 'html-react-parser';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ReservationStatusIcon } from '../../EventRender/ReservationStatusIcon';\r\nimport { SchedulerEventTooltipProps } from '../SchedulerEventTooltipProps';\r\n\r\nexport function ReservationTooltip(props: SchedulerEventTooltipProps) {\r\n  const dto = props.event.original as ICalendarReservationDto;\r\n  const statusTextLocalizationKey = statusTextKey(dto);\r\n  const reservationHtml = !!props.reservationTooltipTemplate\r\n    ? props.reservationTooltipTemplate(props.event.original)\r\n    : undefined;\r\n  if (!dto || dto.Restricted || dto.StatusId == null) {\r\n    return <>{''}</>;\r\n  }\r\n\r\n  return (\r\n    <>\r\n      {!!!!dto && !!dto.StatusId && (\r\n        <div\r\n          style={{\r\n            display: 'flex',\r\n            gap: 8,\r\n          }}\r\n        >\r\n          <ReservationStatusIcon size=\"xl\" event={props.event} />\r\n          {statusTextLocalizationKey !== undefined && (\r\n            <Body size=\"small\" bold={true}>\r\n              {i18next.t(statusTextLocalizationKey)}\r\n            </Body>\r\n          )}\r\n        </div>\r\n      )}\r\n      {reservationHtml !== undefined && (\r\n        <div>{HTMLReactParser(reservationHtml)}</div>\r\n      )}\r\n      {props.IncludeCustomFormInSchedulerReservationTooltip &&\r\n        dto.CustomForm !== undefined && (\r\n          <>\r\n            {dto.CustomForm.map(item => (\r\n              <p>\r\n                {item.Text}: <strong>{stripHtml(item.Value)}</strong>\r\n              </p>\r\n            ))}\r\n          </>\r\n        )}\r\n    </>\r\n  );\r\n}\r\nconst statusTextKey = (dto?: ICalendarReservationDto) => {\r\n  const statusId = dto?.StatusId;\r\n  if (statusId === undefined) {\r\n    return undefined;\r\n  }\r\n  if (statusId === null) {\r\n    return undefined;\r\n  }\r\n  const state = statusId as ReservationStatus;\r\n  if (\r\n    state === ReservationStatus.Pending ||\r\n    state === ReservationStatus.PendingCoord\r\n  ) {\r\n    return translations.ReservationPendingApproval;\r\n  } else if (state === ReservationStatus.Draft) {\r\n    return translations.DraftReservationStatus;\r\n  } else if (state === ReservationStatus.Approved && dto?.Tutoring === true) {\r\n    return translations.ApprovedByStaff;\r\n  } else {\r\n    return undefined;\r\n  }\r\n};\r\n\r\n/**\r\n * strips html tags from the input. todo: replace with a proper implementation, e.g. string-strip-html\r\n * @param s\r\n * @returns\r\n */\r\nfunction stripHtml(s: string | null | undefined): string | null | undefined {\r\n  if (s == null || s === undefined) {\r\n    return s;\r\n  }\r\n  return s.replace(/<[^>]+(>|$)/g, ' ');\r\n}\r\n","import * as ReactDOMServer from 'react-dom/server';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { ISchedulerEvent } from '../../types/ISchedulerEvent';\r\nimport { SchedulerEventTooltipProps } from './SchedulerEventTooltipProps';\r\nimport { TrainingSessionTooltip } from './TrainingSessionTooltip';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { OfflineTooltip } from './OfflineTooltip';\r\nimport { EventType } from '../../slice/types';\r\nimport { ReservationTooltip } from './ReservationTooltip';\r\nimport React from 'react';\r\n\r\n// tooltip template funciton signature\r\ntype ToolTipTextFn = (start: Date, end: Date, e: any) => string | boolean;\r\n\r\nconst log = getLogger('tooltip_text');\r\n/**\r\n * Customizing event tooltip template - https://docs.dhtmlx.com/scheduler/api__scheduler_tooltip_text_template.html\r\n * @param scheduler scheduler instance\r\n * @returns HTML generating function\r\n */\r\nexport function tooltip_text(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n  reservationTooltipTemplate,\r\n  includeCustomFormInSchedulerReservationTooltip: boolean | undefined,\r\n): ToolTipTextFn {\r\n  try {\r\n    const result = tooltip_text_fn(\r\n      scheduler,\r\n      reservationTooltipTemplate,\r\n      includeCustomFormInSchedulerReservationTooltip,\r\n    );\r\n    log.debug(result);\r\n    return result;\r\n  } catch (error) {\r\n    log.error('Error compiling tooltip template', error);\r\n    return () => '';\r\n  }\r\n}\r\n\r\n/**\r\n * This function is called by the scheduler to get the tooltip\r\n * @returns tooltip text thmls\r\n */\r\nfunction tooltip_text_fn(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n  reservationTooltipTemplate: HandlebarsTemplateDelegate,\r\n  includeCustomFormInSchedulerReservationTooltip: boolean | undefined,\r\n): ToolTipTextFn {\r\n  return (start: Date, end: Date, event: ISchedulerEvent) => {\r\n    const HIDE_TOOLTIP = false;\r\n    const schedulerEvent: ISchedulerEvent = scheduler.getEvent(event.id);\r\n    const type = schedulerEvent.type;\r\n    if (type === undefined) {\r\n      return HIDE_TOOLTIP;\r\n    }\r\n    try {\r\n      const TooltipElement = SchedulerEventTooltip(\r\n        type,\r\n        reservationTooltipTemplate,\r\n      );\r\n      if (TooltipElement === undefined) {\r\n        return HIDE_TOOLTIP;\r\n      }\r\n      const tooltipElementProps = GetSchedulerEventTooltipProps(\r\n        start,\r\n        end,\r\n        event,\r\n        reservationTooltipTemplate,\r\n        includeCustomFormInSchedulerReservationTooltip,\r\n      );\r\n      if (tooltipElementProps === undefined) {\r\n        return HIDE_TOOLTIP;\r\n      }\r\n      const html = ReactDOMServer.renderToStaticMarkup(\r\n        React.createElement(TooltipElement, tooltipElementProps),\r\n      );\r\n      return html;\r\n    } catch (error) {\r\n      log.error(error);\r\n      return HIDE_TOOLTIP;\r\n    }\r\n  };\r\n}\r\n\r\nfunction GetSchedulerEventTooltipProps(\r\n  start: Date,\r\n  end: Date,\r\n  event: ISchedulerEvent,\r\n  reservationTooltipTemplate: HandlebarsTemplateDelegate,\r\n  includeCustomFormInSchedulerReservationTooltip: boolean | undefined,\r\n): SchedulerEventTooltipProps | undefined {\r\n  if (event.type === undefined) {\r\n    return undefined;\r\n  }\r\n  switch (event.type) {\r\n    case 'offline':\r\n    case 'trainingsession':\r\n      return {\r\n        start,\r\n        end,\r\n        event: event,\r\n        IncludeCustomFormInSchedulerReservationTooltip: includeCustomFormInSchedulerReservationTooltip,\r\n      };\r\n\r\n    case 'reservation':\r\n      return {\r\n        start,\r\n        end,\r\n        event: event,\r\n        reservationTooltipTemplate: reservationTooltipTemplate,\r\n        IncludeCustomFormInSchedulerReservationTooltip: includeCustomFormInSchedulerReservationTooltip,\r\n      };\r\n    default:\r\n      assertExhaustive(event.type);\r\n  }\r\n}\r\n\r\nfunction SchedulerEventTooltip(\r\n  type: EventType,\r\n  reservationTooltipTemplate?: HandlebarsTemplateDelegate,\r\n): React.FC<SchedulerEventTooltipProps> | undefined {\r\n  switch (type) {\r\n    case 'offline':\r\n      return OfflineTooltip;\r\n    case 'trainingsession':\r\n      return TrainingSessionTooltip;\r\n    case 'reservation':\r\n      if (reservationTooltipTemplate === undefined) {\r\n        return undefined;\r\n      }\r\n      return ReservationTooltip;\r\n    default:\r\n      assertExhaustive(type);\r\n  }\r\n}\r\n","import * as React from 'react';\r\nimport { useDebugEffect } from './useDebugEffect';\r\n\r\n/**\r\n * Similar to React.useEffect but skips first callback and fires only for subsequent dependencies changes\r\n * @param callback useEffectCallback\r\n * @param deps dependencies\r\n */\r\nexport const useDidUpdate = (\r\n  callback: React.EffectCallback,\r\n  deps?: React.DependencyList,\r\n) => {\r\n  const hasMount = React.useRef(false);\r\n\r\n  React.useEffect(() => {\r\n    if (hasMount.current) {\r\n      callback();\r\n    } else {\r\n      hasMount.current = true;\r\n    }\r\n    // no need to include the callback in dependencies since it's mutation does not really matter as long as the correct dependencies are used\r\n    // deps are passed as is (unchanged) for the React.useEffect to track their changes\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, deps);\r\n};\r\nexport const useDidUpdateDebug = (\r\n  callback: React.EffectCallback,\r\n  deps?: React.DependencyList,\r\n) => {\r\n  const hasMount = React.useRef(false);\r\n\r\n  useDebugEffect(\r\n    () => {\r\n      if (hasMount.current) {\r\n        callback();\r\n      } else {\r\n        hasMount.current = true;\r\n      }\r\n    },\r\n    [callback, deps],\r\n    Object.entries(deps ?? {}).map(f => f[0]),\r\n  );\r\n};\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ScrollPosition } from './slice/types';\r\n\r\n/**\r\n * Updates the view and preserves scroll position on the timeline.\r\n * Rerenders entire scheduler including scales, headers, etc.\r\n * @param scheduler scheduler instance\r\n */\r\nexport function updateView(\r\n  scheduler?: DHTMLX.SchedulerStatic,\r\n  currentPosition?: ScrollPosition,\r\n  forceUpdate?: boolean,\r\n) {\r\n  const currentView = scheduler?.getView();\r\n  if (forceUpdate === true) {\r\n    scheduler?.updateView();\r\n    // updateView causes the mark_now to disappear (inside of the reset_scales fn) for some reason.\r\n    // _mark_now is used here to reset the current time (mark_now) marking\r\n    try {\r\n      (scheduler as any)?._mark_now();\r\n    } catch (error) {}\r\n  }\r\n  if (currentPosition !== undefined) {\r\n    currentView.scrollTo(currentPosition);\r\n  }\r\n}\r\n","import * as React from 'react';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\n\r\nexport function deleteTempReservations(\r\n  schedulerRef: React.MutableRefObject<DHTMLX.SchedulerStatic | undefined>,\r\n  id?: string | number | undefined,\r\n) {\r\n  try {\r\n    schedulerRef?.current\r\n      ?.getEvents()\r\n      ?.filter(f => f.type === undefined)\r\n      // new events generally have int id and id parameter here can be either int or string\r\n      ?.filter(f => String(f.id) !== String(id))\r\n      ?.forEach(f => schedulerRef?.current?.deleteEvent(f.id));\r\n  } catch (error) {\r\n    //noop\r\n  }\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ISchedulerState } from './types/ISchedulerState';\r\nimport { ISchedulerEvent } from './types/ISchedulerEvent';\r\n\r\n/**\r\n * Resets currently shown events to their original positions.\r\n * @param scheduler scheduler instance\r\n * @param event created/updated event\r\n */\r\nexport function resetEventEdits(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n  event: ISchedulerEvent,\r\n) {\r\n  const state: ISchedulerState = scheduler.getState();\r\n  const x = scheduler\r\n    .getEvents(state.min_date, state.max_date)\r\n    .filter((f: ISchedulerEvent) => f.id !== event.id)\r\n    .filter((f: ISchedulerEvent) => f.original?.StartTime !== undefined)\r\n    .filter((f: ISchedulerEvent) => f.original?.EndTime !== undefined)\r\n    .filter((f: ISchedulerEvent) => {\r\n      const dd =\r\n        dateUtils.formatISO(f.end_date) !== f.original.EndTime ||\r\n        dateUtils.formatISO(f.start_date) !== f.original.StartTime;\r\n      return dd;\r\n    });\r\n\r\n  x.forEach((f: ISchedulerEvent) => {\r\n    f.start_date = dateUtils.parseISO(f.original.StartTime);\r\n    f.end_date = dateUtils.parseISO(f.original.EndTime);\r\n    scheduler.updateEvent(String(f.id));\r\n  });\r\n}\r\n","export function findParentTarget(\r\n  event: MouseEvent,\r\n  selectors: string[],\r\n): Element | null {\r\n  // check if the click target is a DOM element so that the closest method is available\r\n  if (!(event.target instanceof Element)) {\r\n    return null;\r\n  }\r\n  if (!event.target.closest) {\r\n    return null;\r\n  }\r\n  for (const selector of selectors) {\r\n    try {\r\n      const container = event.target.closest(selector);\r\n      if (container !== null) {\r\n        return container;\r\n      }\r\n    } catch (error) {\r\n      console.log(error);\r\n    }\r\n  }\r\n  return null;\r\n}\r\n","import { IEditEvent } from './slice/types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { omit } from 'lodash';\r\nimport { ISchedulerEvent } from './types/ISchedulerEvent';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\n\r\n/**\r\n * Transforms the scheduler event to common form:\r\n * * dates are converted to timestamps (string)\r\n * * assembly part reservations are redirected to top assembly reservations\r\n * @param event internal scheduler's event\r\n * @returns event consumable by the reservation details components\r\n */\r\nexport const transformToSerializableEvent = (\r\n  event: ISchedulerEvent,\r\n): IEditEvent => {\r\n  const TopAssemblyReservationId = (event.original as ICalendarReservationDto)\r\n    .TopAssemblyReservationId;\r\n  /**\r\n   * Clicking on the assembly part reservation should open the top assembly reservation\r\n   */\r\n  const reservation_id = TopAssemblyReservationId ?? event.reservation_id;\r\n  const result = {\r\n    ...omit(event, 'start_date', 'end_date'),\r\n    ...{\r\n      start_date: dateUtils.formatISO(event.start_date),\r\n      end_date: dateUtils.formatISO(event.end_date),\r\n      reservation_id: reservation_id,\r\n    },\r\n  };\r\n  return result;\r\n};\r\n","// https://docs.dhtmlx.com/scheduler/pdf.html\r\n// Include the https://export.dhtmlx.com/scheduler/api.js file on the page to enable the online export service\r\n\r\nfunction defaults(obj, std) {\r\n  for (var key in std) if (!obj[key]) obj[key] = std[key];\r\n  return obj;\r\n}\r\nfunction getElementSizes(element, scheduler) {\r\n  var sizes = { x: 0, y: 0 };\r\n  element = scheduler._els[element];\r\n  if (element && element[0]) {\r\n    sizes.x = element[0].scrollWidth;\r\n    sizes.y = element[0].scrollHeight;\r\n  } else {\r\n    sizes.x = 0;\r\n    sizes.y = 0;\r\n  }\r\n  return sizes;\r\n}\r\nexport function add_export_methods(scheduler) {\r\n  scheduler.exportToPDF = function (config) {\r\n    config = defaults(config || {}, {\r\n      name: 'calendar.pdf',\r\n      format: 'A4',\r\n      orientation: 'landscape',\r\n      dpi: 96,\r\n      zoom: 1,\r\n      rtl: scheduler.config.rtl,\r\n    });\r\n    config.html = this._export_html(config);\r\n    config.mode = this.getState().mode;\r\n    this._send_to_export(config, 'pdf');\r\n  };\r\n\r\n  scheduler.exportToPNG = function (config) {\r\n    config = defaults(config || {}, {\r\n      name: 'calendar.png',\r\n      format: 'A4',\r\n      orientation: 'landscape',\r\n      dpi: 96,\r\n      zoom: 1,\r\n      rtl: scheduler.config.rtl,\r\n    });\r\n    config.html = this._export_html(config);\r\n    config.mode = this.getState().mode;\r\n    this._send_to_export(config, 'png');\r\n  };\r\n\r\n  scheduler.exportToICal = function (config) {\r\n    config = defaults(config || {}, {\r\n      name: 'calendar.ical',\r\n      data: this._serialize_plain(null, config),\r\n    });\r\n    this._send_to_export(config, 'ical');\r\n  };\r\n\r\n  scheduler.exportToExcel = function (config) {\r\n    config = defaults(config || {}, {\r\n      name: 'calendar.xlsx',\r\n      title: 'Events',\r\n      data: this._serialize_plain(this.templates.xml_format, config),\r\n      columns: this._serialize_columns(),\r\n    });\r\n    this._send_to_export(config, 'excel');\r\n  };\r\n\r\n  /*scheduler._ajax_to_export = function (data, type, callback) {\r\n    delete data.callback;\r\n    var url = data.server || 'https://export.dhtmlx.com/scheduler';\r\n\r\n    dhtmlxAjax.post(\r\n      url,\r\n      'type=' +\r\n        type +\r\n        '&store=1&data=' +\r\n        encodeURIComponent(JSON.stringify(data)),\r\n      function (loader) {\r\n        var fail = loader.xmlDoc.status > 400;\r\n        var info = null;\r\n\r\n        if (!fail) {\r\n          try {\r\n            info = JSON.parse(loader.xmlDoc.responseText);\r\n          } catch (e) {}\r\n        }\r\n        callback(info);\r\n      },\r\n    );\r\n  };*/\r\n\r\n  scheduler._plain_export_copy = function (source, format) {\r\n    var target = { start_date: null, end_date: null, $text: null };\r\n    for (var key in source) target[key] = source[key];\r\n\r\n    target.start_date = format(target.start_date);\r\n    target.end_date = format(target.end_date);\r\n    target.$text = this.templates.event_text(\r\n      source.start_date,\r\n      source.end_date,\r\n      source,\r\n    );\r\n\r\n    return target;\r\n  };\r\n\r\n  scheduler._serialize_plain = function (format, config) {\r\n    format = format || scheduler.date.date_to_str('%Y%m%dT%H%i%s', true);\r\n\r\n    var events;\r\n    if (config && config.start && config.end)\r\n      events = scheduler.getEvents(config.start, config.end);\r\n    else events = scheduler.getEvents();\r\n\r\n    var data = [{}];\r\n    for (var i = 0; i < events.length; i++)\r\n      data[i] = this._plain_export_copy(events[i], format);\r\n\r\n    return data;\r\n  };\r\n\r\n  scheduler._serialize_columns = function () {\r\n    return [\r\n      { id: 'start_date', header: 'Start Date', width: 30 },\r\n      { id: 'end_date', header: 'End Date', width: 30 },\r\n      { id: '$text', header: 'Text', width: 100 },\r\n    ];\r\n  };\r\n\r\n  scheduler._send_to_export = function (data, type) {\r\n    if (!data.version) {\r\n      data.version = scheduler.version;\r\n    }\r\n\r\n    if (!data.skin) {\r\n      data.skin = scheduler.skin;\r\n    }\r\n\r\n    if (data.callback)\r\n      return scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n    var form = this._create_hidden_form();\r\n\r\n    form.firstChild.action =\r\n      data.server || 'https://export.dhtmlx.com/scheduler';\r\n    form.firstChild.childNodes[0].value = JSON.stringify(data);\r\n    form.firstChild.childNodes[1].value = type;\r\n    form.firstChild.submit();\r\n  };\r\n\r\n  scheduler._create_hidden_form = function () {\r\n    if (!this._hidden_export_form) {\r\n      var t = (this._hidden_export_form = document.createElement('div'));\r\n      t.style.display = 'none';\r\n      t.innerHTML =\r\n        \"<form method='POST' target='_blank'><input type='text' name='data'><input type='hidden' name='type' value=''></form>\";\r\n      document.body.appendChild(t);\r\n    }\r\n    return this._hidden_export_form;\r\n  };\r\n\r\n  scheduler._get_export_size = function (\r\n    format,\r\n    orientation,\r\n    zoom,\r\n    dpi,\r\n    header,\r\n    footer,\r\n    scales,\r\n  ) {\r\n    dpi = parseInt(dpi) / 25.4 || 4;\r\n\r\n    var sizes = {\r\n      A5: { x: 148, y: 210 },\r\n      A4: { x: 210, y: 297 },\r\n      A3: { x: 297, y: 420 },\r\n      A2: { x: 420, y: 594 },\r\n      A1: { x: 594, y: 841 },\r\n      A0: { x: 841, y: 1189 },\r\n    };\r\n\r\n    var dataX = getElementSizes('dhx_cal_data', this).x;\r\n    var dataY = getElementSizes('dhx_cal_data', this).y;\r\n    var headY = getElementSizes('dhx_cal_header', this).y;\r\n    var multY = getElementSizes('dhx_multi_day', this).y;\r\n\r\n    var cSize = {\r\n      x: 0,\r\n      y: dataY + headY + multY,\r\n    };\r\n\r\n    if (format === 'full') {\r\n      cSize.x = dataX;\r\n    } else {\r\n      cSize.x = Math.floor(\r\n        (orientation === 'landscape' ? sizes[format].y : sizes[format].x) * dpi,\r\n      );\r\n    }\r\n\r\n    if (scales) {\r\n      cSize.x *= parseFloat(scales.x) || 1;\r\n      cSize.y *= parseFloat(scales.y) || 1;\r\n    }\r\n\r\n    return cSize;\r\n  };\r\n\r\n  function getTimeline() {\r\n    var mode = scheduler.getState().mode;\r\n    if (scheduler.matrix && scheduler.matrix[mode]) {\r\n      return scheduler.matrix[mode];\r\n    }\r\n    return null;\r\n  }\r\n\r\n  function getInitialSizes() {\r\n    var smartRendering = undefined,\r\n      scrollable = undefined;\r\n\r\n    var timeline = getTimeline();\r\n    if (timeline) {\r\n      scrollable = timeline.scrollable;\r\n      smartRendering = timeline.smart_rendering;\r\n    }\r\n\r\n    return {\r\n      nav_height: scheduler.xy.nav_height,\r\n      scroll_width: scheduler.xy.scroll_width,\r\n      style_width: scheduler._obj.style.width,\r\n      style_height: scheduler._obj.style.height,\r\n      timeline_scrollable: scrollable,\r\n      timeline_smart_rendering: smartRendering,\r\n    };\r\n  }\r\n\r\n  function setExportSizes(size, initialSizes) {\r\n    scheduler._obj.style.width = size.x + 'px';\r\n    scheduler._obj.style.height = size.y + 'px';\r\n\r\n    scheduler.xy.nav_height = 0;\r\n    scheduler.xy.scroll_width = 0;\r\n\r\n    var timeline = getTimeline();\r\n    if (\r\n      initialSizes.timeline_scrollable ||\r\n      initialSizes.timeline_smart_rendering\r\n    ) {\r\n      timeline.scrollable = false;\r\n      timeline.smart_rendering = false;\r\n    }\r\n  }\r\n\r\n  function setInitialSizes(initialSizes) {\r\n    scheduler.xy.scroll_width = initialSizes.scroll_width;\r\n    scheduler.xy.nav_height = initialSizes.nav_height;\r\n    scheduler._obj.style.width = initialSizes.style_width;\r\n    scheduler._obj.style.height = initialSizes.style_height;\r\n\r\n    var timeline = getTimeline();\r\n    if (\r\n      initialSizes.timeline_scrollable ||\r\n      initialSizes.timeline_smart_rendering\r\n    ) {\r\n      timeline.scrollable = initialSizes.timeline_scrollable;\r\n      timeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n    }\r\n  }\r\n\r\n  scheduler._export_html = function (obj) {\r\n    var initialSizes = getInitialSizes();\r\n    var size = scheduler._get_export_size(\r\n      obj.format,\r\n      obj.orientation,\r\n      obj.zoom,\r\n      obj.dpi,\r\n      obj.header,\r\n      obj.footer,\r\n      obj.scales,\r\n    );\r\n\r\n    var html = '';\r\n    try {\r\n      setExportSizes(size, initialSizes);\r\n      scheduler.setCurrentView();\r\n      html = scheduler._obj.innerHTML;\r\n    } catch (e) {\r\n      console.error(e);\r\n    } finally {\r\n      setInitialSizes(initialSizes);\r\n      scheduler.setCurrentView();\r\n    }\r\n\r\n    return html;\r\n  };\r\n}\r\n","import { SchedulerStatic } from 'dhtmlx-scheduler';\r\nimport { useDispatch } from 'react-redux';\r\nimport { usePrintPDFSlice } from '../slice';\r\nimport React, { useCallback } from 'react';\r\nimport { PrintToPDFPopup } from '../Components/PrintToPDFPopup';\r\nimport { add_export_methods } from './ExportMethods';\r\n\r\nexport interface PrintSchedulerToPDFProps {\r\n  title: string;\r\n  print: boolean;\r\n  printTitle: string;\r\n  saveMarkedSections?: boolean;\r\n  scheduler?: SchedulerStatic;\r\n  close: () => void;\r\n}\r\nexport function PrintSchedulerToPDF(props: PrintSchedulerToPDFProps) {\r\n  const dispatch = useDispatch();\r\n  const { actions } = usePrintPDFSlice();\r\n  const handleSubmit = useCallback(() => {\r\n    add_export_methods(props.scheduler);\r\n    props.scheduler?.exportToPDF({\r\n      name: props.printTitle + '.pdf',\r\n      format: 'A4',\r\n      orientation: 'landscape',\r\n      zoom: 1,\r\n      header: `<h1>${props.printTitle}</h1> <style>${styles}</style>`,\r\n      //footer: '<h4>Bottom line</h4>',\r\n    });\r\n    dispatch(actions.setPrinting(false));\r\n    props.close();\r\n  }, [actions, dispatch, props]);\r\n  return (\r\n    <>\r\n      {props.print && (\r\n        <PrintToPDFPopup\r\n          title={props.title}\r\n          show={props.print}\r\n          items={[]}\r\n          fullWidth={false}\r\n          onClose={() => {\r\n            props.close();\r\n          }}\r\n          onSubmit={handleSubmit}\r\n        />\r\n      )}\r\n    </>\r\n  );\r\n}\r\nconst styles = `.dhx_timeline_label_column {\r\n  justify-content: left;\r\n}\r\n.dhx_cal_navline div {\r\n  position: relative;\r\n}\r\n\r\n.medium_lines_section {\r\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAQCAYAAABk1z2tAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3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0QzA2MkY2NDMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MTk5QTdFMzc5NDQ5MTFFMUI3MUNFNjc0QzA2MkY2NDMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Z9pN0AAAAhUlEQVR42uyUSwrAMAhE1cP0/ufpZWy6KI2hxOIYGkrcJQPDw88w3bWRrb15G11Vjc7MIb38d/25B+FB1noxDEFWgI/+LWAY8gSMdNLzF6RrGaP3/AUd7WhIydg/5Eg8f/66e95OCgqEdvLNkdDMkDLraC//lYMrB3+Xg+jODs/BbP0QYAB+HaheBAg0CAAAAABJRU5ErkJggg==);\r\n}\r\n\r\n.dhx_cal_event .dhx_body,\r\n.dhx_cal_event .dhx_footer,\r\n.dhx_cal_event .dhx_header,\r\n.dhx_cal_event .dhx_title {\r\n  background-color: initial;\r\n  padding: 3px 5px 0px 5px;\r\n}\r\n\r\n.dhx_title .dhx_training_status {\r\n  float: right;\r\n  margin: 0px 4px;\r\n}\r\n\r\n.dhx_title > * {\r\n  overflow: hidden;\r\n  text-overflow: ellipsis;\r\n  white-space: nowrap;\r\n}\r\n\r\n.dhx_cal_event .dhx_event_move {\r\n  cursor: pointer;\r\n}\r\n.dhx_cal_event_line,\r\n.dhx_cal_event .dhx_body,\r\n.dhx_cal_event.dhx_cal_select_menu .dhx_body {\r\n  font-weight: normal;\r\n}\r\n.dhx_scale_holder .dhx_cal_event .dhx_body {\r\n  overflow: hidden;\r\n}\r\n.scheduler_tooltip {\r\n  max-width: 350px;\r\n}\r\n.dhx_cal_event_line p,\r\n.scheduler_tooltip p {\r\n  margin: 0;\r\n  overflow: hidden;\r\n  text-overflow: ellipsis;\r\n  white-space: nowrap;\r\n}\r\n.scheduler_tooltip div span p {\r\n  margin: 0;\r\n  white-space: pre-wrap;\r\n}\r\n.dhx_cal_event .dhx_body p {\r\n  white-space: break-spaces;\r\n  margin: 0;\r\n  margin-right: 1%;\r\n}\r\n.dhx_cal_event_line {\r\n  padding: 0 0 1px 6px;\r\n}\r\n.dhx_cal_event {\r\n  z-index: 2;\r\n}\r\n\r\n.dhx_cal_event .dhx_title:not(.dhx_event_move) {\r\n  cursor: initial;\r\n}\r\n\r\n.dhx_timeline_label_column .schedule_service_label {\r\n  justify-content: start;\r\n  align-self: center;\r\n}\r\n.dhx_scale_bar .schedule_service_container {\r\n  flex-wrap: wrap-reverse;\r\n}\r\n.dhx_cal_header div.schedule_service_label {\r\n  box-sizing: border-box;\r\n}\r\n.dhx_matrix_scell.item .dhx_scell_name {\r\n  padding-left: 0px;\r\n}\r\n.schedule_service_container {\r\n  box-sizing: border-box;\r\n\r\n  display: flex;\r\n  flex-direction: column;\r\n  align-items: flex-start;\r\n  flex-direction: row;\r\n  padding: 0px;\r\n  gap: 10px;\r\n  height: 38px;\r\n  flex: none;\r\n  order: 0;\r\n  align-self: stretch;\r\n  flex-grow: 0;\r\n}\r\n.schedule_service_image {\r\n  display: flex;\r\n  flex-direction: column;\r\n  justify-content: center;\r\n  align-items: center;\r\n  padding: 0px;\r\n  gap: 10px;\r\n\r\n  width: 64px;\r\n  height: 38px;\r\n\r\n  background: #eef2f6;\r\n  border-radius: 4px;\r\n  cursor: pointer;\r\n  flex: none;\r\n  order: 1;\r\n  flex-grow: 0;\r\n}\r\n.schedule_service_image svg {\r\n  align-self: center;\r\n}\r\n.schedule_service_image img {\r\n  max-height: 38px;\r\n  height: auto;\r\n  width: auto;\r\n}\r\n.dhx_scheduler_day_unit .schedule_service_image {\r\n  width: 24px;\r\n  height: 24px;\r\n}\r\n.dhx_scheduler_day_unit .schedule_service_image img {\r\n  max-height: 24px;\r\n  max-width: 24px;\r\n  height: inherit;\r\n}\r\n.dhx_scheduler_day_unit .schedule_service_image svg {\r\n  align-self: center;\r\n  justify-self: center;\r\n}\r\n.dhx_scheduler_day_unit .dhx_scale_bar .schedule_service_container {\r\n  gap: 6px;\r\n  flex-wrap: nowrap;\r\n}\r\n.schedule_service_label {\r\n  display: flex;\r\n  flex-direction: row;\r\n  align-items: center;\r\n  gap: 4px;\r\n\r\n  height: 24px;\r\n\r\n  border-radius: 4px;\r\n\r\n  flex: none;\r\n  order: 2;\r\n  flex-grow: 0;\r\n  line-height: initial;\r\n  color: white;\r\n  cursor: pointer;\r\n\r\n  max-width: min(100%, 26ch);\r\n}\r\n.schedule_service_label_padding {\r\n  padding: 3px 8px;\r\n}\r\n.schedule_service_label_mobile_padding {\r\n  padding: 2px 2px;\r\n}\r\n.schedule_service_label_text_mobile {\r\n  overflow: hidden;\r\n  text-overflow: ellipsis;\r\n  width: 12ch;\r\n  display: -webkit-box;\r\n  -webkit-line-clamp: 2;\r\n  -webkit-box-orient: vertical;\r\n  text-transform: none;\r\n  font-style: normal;\r\n  font-weight: normal;\r\n  font-size: 12px;\r\n  line-height: 141%;\r\n  -webkit-letter-spacing: 0.1px;\r\n  -moz-letter-spacing: 0.1px;\r\n  -ms-letter-spacing: 0.1px;\r\n  letter-spacing: 0.1px;\r\n  font-family: 'Lato', sans-serif;\r\n}\r\n.schedule_service_label_text {\r\n  overflow: hidden;\r\n  white-space: nowrap;\r\n  text-overflow: ellipsis;\r\n\r\n  text-transform: none;\r\n  font-style: normal;\r\n  font-weight: normal;\r\n  font-size: 14px;\r\n  line-height: 141%;\r\n  -webkit-letter-spacing: 0.1px;\r\n  -moz-letter-spacing: 0.1px;\r\n  -ms-letter-spacing: 0.1px;\r\n  letter-spacing: 0.1px;\r\n  font-family: 'Lato', sans-serif;\r\n}\r\n\r\n.dhx_timeline_scale_header.dhx_timeline_second_scale {\r\n  width: 300px !important;\r\n  height: 30px !important;\r\n}\r\n.dhx_cal_header div .dhx_scale_bar.dhx_second_scale_bar {\r\n  border-left: 1px solid #e0e0e0;\r\n  text-align: left;\r\n  padding-left: 3px;\r\n}\r\n.dhx_timeline_second_scale.dhx_timeline_scale_header {\r\n  height: 60px !important;\r\n}\r\n.dhx_cal_mobile .dhx_timeline_second_scale.dhx_timeline_scale_header {\r\n  height: 70px !important;\r\n  width: 100px !important;\r\n}\r\n\r\n.GroupByAssemblyPart .dhx_matrix_cell,\r\n.GroupByAssemblyPart .dhx_matrix_scell {\r\n  overflow: hidden;\r\n  text-align: center;\r\n  vertical-align: middle;\r\n  border-bottom: 1px solid #e0e0e0;\r\n  border-right: 1px solid #e0e0e0;\r\n}\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder,\r\n.GroupByAssemblyPart .dhx_data_table.folder .dhx_matrix_cell {\r\n  border-right: 1px solid #e0e0e0;\r\n  border-bottom: 1px solid #e0e0e0;\r\n}\r\n\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder,\r\n.GroupByAssemblyPart .dhx_data_table.folder .dhx_matrix_cell,\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder.opened .dhx_scell_expand::after,\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder.closed .dhx_scell_expand::after {\r\n  background-color: #fff; \r\n}\r\n\r\n.GroupByAssemblyPart .dhx_matrix_scell.folder,\r\n.GroupByAssemblyPart .dhx_data_table.folder .dhx_matrix_cell {\r\n  cursor: auto;\r\n}\r\n\r\n.GroupByAssemblyPart .dhx_scell_expand::after,\r\n.GroupByAssemblyPart .dhx_scell_level {\r\n  cursor: pointer;\r\n}\r\n`;\r\n","import * as React from 'react';\r\nimport * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport 'dhtmlx-scheduler/dhtmlxscheduler_material.css';\r\nimport clsx from 'clsx';\r\nimport './scheduler.css';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n  IChangeViewModePayload,\r\n  IEditEvent,\r\n  INewEvent,\r\n  ISchedulerService,\r\n  IViewState,\r\n  RestrictDuration,\r\n  ViewLengths,\r\n  ViewModes,\r\n  ViewTypes,\r\n} from './slice/types';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { assign, isEqual } from 'lodash';\r\nimport {\r\n  adjustToTimeSlot,\r\n  getSchedulerViewMode,\r\n  getSchedulerViewType,\r\n  getViewEndDate,\r\n  getViewStartDate,\r\n  MatchUnitSlotToEnd,\r\n  parseViewMode,\r\n} from './utils';\r\nimport {\r\n  serializeSchedulerDate,\r\n  serializeSchedulerDateOrUndefined,\r\n} from './utils/formatSchedulerDateOrUndefined';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IEquipmentTimeSlot } from 'api/odata/generated/complexTypes/IEquipmentTimeSlot';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { MouseEventHandler } from 'hoist-non-react-statics/node_modules/@types/react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectExportToPDF,\r\n  selectIncludeCustomFormInSchedulerReservationTooltip,\r\n  selectSchedulerLoadingEvents,\r\n  selectSchedulerReservationBodyTemplate,\r\n  selectSchedulerReservationTooltipTemplate,\r\n  selectSchedulerTempEvents,\r\n  selectSchedulerViewCustomStart,\r\n  selectTimelineGroupBy,\r\n  selectWithReservationsOnly,\r\n} from './slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nimport {\r\n  allowedToViewAlert,\r\n  IsReadOnlyUser,\r\n} from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectUseAmPm,\r\n} from 'app/slice/selectors';\r\nimport { ISchedulerState } from './types/ISchedulerState';\r\nimport { IMarkedTimespan as IMarkedTimeSpan } from './types/IMarkedTimespan';\r\nimport { renderEvent } from './components/EventRender';\r\nimport { ISchedulerEvent } from './types/ISchedulerEvent';\r\nimport { adjustMonthTimelineLength } from './utils/adjustMonthTimelineLength';\r\nimport { createTimelineView } from './createTimelineView';\r\nimport { createUnitsView } from './createUnitsView';\r\nimport { RestrictDurationUnitTypes } from 'enums/RestrictDurationUnitTypes';\r\nimport { syncSchedulerEvents } from './utils/syncSchedulerEvents';\r\nimport { useSchedulerSlice } from './slice';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { ISchedulerParseEvent } from './types/ISchedulerParseEvent';\r\nimport { scheduleServiceContainerClassName } from './renderServiceLabel';\r\nimport { NoServices } from './components/NoServices';\r\nimport { useLocation } from 'react-router-dom';\r\nimport {\r\n  GetNumberOrUndefined,\r\n  GetRawValue,\r\n  getSplitNumberArray,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { EmptySlotAdminClick } from 'enums/EmptySlotAdminClick';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { initOnlineServicesData } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { useCallback } from 'app/hooks/useComparedHooks';\r\nimport { event_text } from './components/event_text';\r\nimport { tooltip_text } from './components/Tooltips';\r\nimport { CombinedSchedulerTRow } from '../Filter';\r\nimport { ICalendarReservationDto } from 'api/odata/generated/entities/ICalendarReservationDto';\r\nimport { translations } from 'locales/translations';\r\nimport { useDidUpdate } from 'app/hooks/useDidUpdate';\r\nimport { TableRowsSkeleton } from 'app/components/BasicTable/components/TableSkeleton';\r\nimport { updateView } from './updateView';\r\nimport { deleteTempReservations } from './deleteTempReservations';\r\nimport { resetEventEdits } from './resetEventEdits';\r\nimport {\r\n  getServerListService,\r\n  setServerList,\r\n  updateServerList,\r\n} from './serverListUtils';\r\nimport { applyForceFullDayReservations } from './utils/applyForceFullDayReservations';\r\nimport { ISchedulerNewEvent } from './types/ISchedulerNewEvent';\r\nimport { adjustSchedulerEventTimes } from './utils/adjustSchedulerEventTimes';\r\nimport { getEvent } from './utils/getEvent';\r\nimport { getServiceIdFromServiceClickEvent } from './getServiceIdFromServiceClickEvent';\r\nimport { findParentTarget } from './findParentTarget';\r\nimport { transformToSerializableEvent } from './transformToSerializableEvent';\r\nimport { PrintSchedulerToPDF } from 'app/components/PrintToPDF/Scheduler';\r\nimport { SchedulerPeriod } from './types/SchedulerPeriod';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\n\r\nexport interface ViewModeChangeArgs {\r\n  previous?: IViewState;\r\n  current: IViewState;\r\n}\r\nexport type ViewModeChangeHandler = (args: IChangeViewModePayload) => void;\r\nexport type SchedulerEventCreateHandler = (args: INewEvent) => void;\r\nexport type SchedulerEventEditHandler = ValueChangeHandler<\r\n  ISchedulerParseEvent\r\n>;\r\nexport interface SchedulerProps {\r\n  onDataUpdated: (s: string, ev: any, id: any) => void;\r\n  events?: ISchedulerParseEvent[];\r\n  nonWorkingHours?: IEquipmentTimeSlot[];\r\n  services?: ISchedulerService[];\r\n  viewType: ViewTypes;\r\n  viewLength: ViewLengths;\r\n  presetPosition: SchedulerDatePositionUnion | null;\r\n  search: string;\r\n  date: Timestamp;\r\n  onViewModeChange?: ViewModeChangeHandler;\r\n  onEdit?: SchedulerEventEditHandler;\r\n  setFilterValue?: (id: string, value: FilterValueType) => void;\r\n  onFilterChange?: (items: IFilterSettings<CombinedSchedulerTRow>[]) => void;\r\n  appliedFilters?: IFilterSettings<CombinedSchedulerTRow>[];\r\n  /**\r\n   * Handles create new reservation.\r\n   * Must be Memoized.\r\n   */\r\n  onCreate?: SchedulerEventCreateHandler;\r\n  hight?: string;\r\n  reservationEditEvents: Array<IEditEvent>;\r\n  defaultDuration?: number;\r\n  customDays?: number;\r\n  customDaysEnabled?: boolean;\r\n  twoDaysEnabled?: boolean;\r\n  handleViewTypeLengthChange?: (\r\n    type: ViewTypes,\r\n    length: ViewLengths,\r\n    value?: Date,\r\n    noChangeLocation?: boolean,\r\n  ) => void;\r\n  noChangeLocation?: boolean;\r\n  zoomEnabled?: boolean;\r\n}\r\n\r\nconst NEW_EVENT_TEXT = 'New event';\r\nexport const scheduler_services_collection_name = 'services';\r\nconst log = getLogger('Scheduler');\r\n\r\nexport default function Scheduler({\r\n  viewLength,\r\n  date,\r\n  events,\r\n  nonWorkingHours,\r\n  services,\r\n  onCreate,\r\n  onEdit,\r\n  setFilterValue,\r\n  onFilterChange,\r\n  appliedFilters,\r\n  reservationEditEvents,\r\n  customDays,\r\n  customDaysEnabled,\r\n  twoDaysEnabled,\r\n  handleViewTypeLengthChange,\r\n  noChangeLocation,\r\n  zoomEnabled = false,\r\n  ...props\r\n}: SchedulerProps) {\r\n  const { t } = useTranslation();\r\n  /** Reference to DHTMLX Scheduler instance */\r\n  const schedulerRef = React.useRef<DHTMLX.SchedulerStatic>();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useSchedulerSlice();\r\n  const location = useLocation();\r\n  const { actions: globalActions } = useAppSettingsSlice();\r\n  /** Reference to Scheduler container DOM element */\r\n  const schedulerContainer = React.useRef<HTMLDivElement>(null);\r\n  const isMobile = DetectIsMobile();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n  const viewType = getSchedulerViewType(props.viewType, viewLength, isMobile);\r\n  const viewMode = getSchedulerViewMode(props.viewType, viewLength, isMobile);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const hasCustomStart = useSelector(selectSchedulerViewCustomStart);\r\n  const compiledSchedulerReservationBodyTemplate = useSelector(\r\n    selectSchedulerReservationBodyTemplate,\r\n  );\r\n  const IncludeCustomFormInSchedulerReservationTooltip = useSelector(\r\n    selectIncludeCustomFormInSchedulerReservationTooltip,\r\n  );\r\n  const useAmPm = useSelector(selectUseAmPm);\r\n  const compiledSchedulerReservationTooltipTemplate = useSelector(\r\n    selectSchedulerReservationTooltipTemplate,\r\n  );\r\n  const openAsset = useOpenAssetPopUp();\r\n  const permissionsError: string = t(\r\n    translations.role_err_Permissions,\r\n  ) as string;\r\n  const { newDate } = useSystemDate();\r\n\r\n  const defaultDuration = React.useMemo(() => {\r\n    if (services !== undefined && services.length > 0) {\r\n      const result =\r\n        (services.map(f => f.DefaultDuration).sort((a, b) => a - b)[0] || 1) *\r\n        60;\r\n      return result;\r\n    }\r\n    return 60;\r\n  }, [services]);\r\n  const restrictTimeSlots = React.useMemo(() => {\r\n    if (\r\n      services !== undefined &&\r\n      services.length === 1 &&\r\n      services[0].RestrictReservationToTimeSlots\r\n    ) {\r\n      return services[0].WorkingHours;\r\n    }\r\n    return [];\r\n  }, [services]);\r\n  const minDuration = React.useMemo(() => {\r\n    if (services !== undefined && services.length > 0) {\r\n      const result =\r\n        (services.map(f => f.MinOrderHours).sort((a, b) => a - b)[0] || 0) * 60;\r\n      return result;\r\n    }\r\n    return 0;\r\n  }, [services]);\r\n  const forceFullDayReservations = React.useMemo(\r\n    () => services?.some(service => service.ForceFullDayReservations),\r\n    [services],\r\n  );\r\n\r\n  const restrictDuration = React.useMemo(() => {\r\n    if (services !== undefined && services.length > 0) {\r\n      if (\r\n        services.some(\r\n          f =>\r\n            (f.RestrictDurationUnitType ?? 0) > 0 &&\r\n            (f.RestrictDurationUnitsAmount ?? 0) > 0,\r\n        )\r\n      ) {\r\n        return services\r\n          .filter(\r\n            f =>\r\n              (f.RestrictDurationUnitType ?? 0) > 0 &&\r\n              (f.RestrictDurationUnitsAmount ?? 0) > 0,\r\n          )\r\n          .map(f => {\r\n            return {\r\n              durationType: (f.RestrictDurationUnitType ??\r\n                0) as RestrictDurationUnitTypes,\r\n              durationAmount: f.RestrictDurationUnitsAmount ?? 0,\r\n            };\r\n          })[0] as RestrictDuration;\r\n      }\r\n    }\r\n    return undefined;\r\n  }, [services]);\r\n\r\n  const tempReservations = useSelector(selectSchedulerTempEvents);\r\n\r\n  React.useEffect(() => {\r\n    deleteTempReservations(schedulerRef, tempReservations?.id);\r\n  }, [tempReservations]);\r\n\r\n  const handleClick = useCallback(\r\n    (id: string, e: any) => {\r\n      log.debug('handleClick', id, e);\r\n      const event: ISchedulerEvent = schedulerRef?.current?.getEvent(id);\r\n      if (event === undefined) {\r\n        return;\r\n      }\r\n      if (event.type === undefined) {\r\n        return;\r\n      }\r\n      if (IsReadOnlyUser(authenticatedUser)) {\r\n        dispatch(\r\n          globalActions.addNotification({\r\n            key: 'permissionError',\r\n            message: permissionsError,\r\n            variant: 'error',\r\n            closable: true,\r\n            autoHideDuration: 3000,\r\n          }),\r\n        );\r\n        return;\r\n      }\r\n      if (\r\n        event.type === 'reservation' &&\r\n        (event.original as ICalendarReservationDto).Restricted === true\r\n      ) {\r\n        return;\r\n      }\r\n      // check permissions to disable alert edit\r\n      if (event.alert_id !== undefined) {\r\n        if (\r\n          !allowedToViewAlert(authenticatedUser, {\r\n            ReportedBy: '',\r\n            ServiceGroupId: event.original.ServiceGroupId,\r\n            ServiceId: event.original.EquipmentId,\r\n            ServiceTypeId: 1,\r\n          })\r\n        ) {\r\n          return false;\r\n        }\r\n      }\r\n\r\n      if (!!event) {\r\n        let transformedEvent = transformToSerializableEvent(event);\r\n        deleteTempReservations(schedulerRef);\r\n        onEdit?.(transformedEvent);\r\n      }\r\n      return false;\r\n    },\r\n    [authenticatedUser, dispatch, globalActions, onEdit, permissionsError],\r\n  );\r\n  const scheduler = schedulerRef.current;\r\n  React.useEffect(() => {\r\n    scheduler?.attachEvent('onClick', handleClick, {});\r\n\r\n    // cleanup\r\n    return () => {\r\n      scheduler?.detachEvent('onClick');\r\n    };\r\n  }, [handleClick, scheduler]);\r\n\r\n  const handleBeforeDrag = React.useCallback(\r\n    (id: string, mode: 'move' | 'resize' | 'create', e: MouseEventHandler) => {\r\n      log.debug('handleBeforeDrag', id, mode, e);\r\n      switch (mode) {\r\n        case 'create':\r\n          console.log('create call: ' + id);\r\n          return true;\r\n        case 'move':\r\n        case 'resize':\r\n          const event: ISchedulerEvent = getEvent(scheduler, id);\r\n          if (event.readonly === true) {\r\n            return false;\r\n          }\r\n          return true;\r\n        default:\r\n          assertExhaustive(mode);\r\n      }\r\n    },\r\n    [scheduler],\r\n  );\r\n  React.useEffect(() => {\r\n    const eventName = 'onBeforeDrag';\r\n    if (scheduler !== undefined) {\r\n      scheduler.detachEvent(eventName);\r\n      scheduler.attachEvent(eventName, handleBeforeDrag, {});\r\n    }\r\n  }, [handleBeforeDrag, scheduler]);\r\n\r\n  /**\r\n   * @see https://docs.dhtmlx.com/scheduler/api__scheduler_onbeforeeventchanged_event.html\r\n   */\r\n  const handleBeforeEventChange = React.useCallback(\r\n    (\r\n      ev: ISchedulerEvent,\r\n      e: MouseEventHandler,\r\n      is_new: boolean,\r\n      original: any,\r\n    ) => {\r\n      log.debug('handleBeforeEventChange', ev, e, is_new, original);\r\n      if (IsReadOnlyUser(authenticatedUser)) {\r\n        dispatch(\r\n          globalActions.addNotification({\r\n            key: 'permissionError',\r\n            message: permissionsError,\r\n            variant: 'error',\r\n            closable: true,\r\n            autoHideDuration: 3000,\r\n          }),\r\n        );\r\n        return false;\r\n      }\r\n      // allow all changes to new events\r\n      if (is_new || (original as any).text === NEW_EVENT_TEXT) {\r\n        if (forceFullDayReservations === true) {\r\n          assign(\r\n            ev,\r\n            applyForceFullDayReservations(\r\n              {\r\n                start: ev.start_date,\r\n                end: ev.end_date,\r\n              },\r\n              forceFullDayReservations,\r\n            ),\r\n          );\r\n          return true;\r\n          // force the selected duration to fixed time slot defined in service as RestrictDurationUnitType - m/h/d,\r\n          // so total duration will be equal RestrictDurationUnitsAmount;\r\n        } else if (restrictDuration !== undefined) {\r\n          const new_end = MatchUnitSlotToEnd(\r\n            dateUtils.formatISO(ev.start_date),\r\n            dateUtils.formatISO(ev.end_date),\r\n            restrictDuration.durationType,\r\n            restrictDuration.durationAmount,\r\n          );\r\n          ev.end_date = new_end;\r\n          return true;\r\n        } else if (restrictTimeSlots.length > 0) {\r\n          let newSlot = adjustToTimeSlot(\r\n            ev.start_date,\r\n            ev.end_date,\r\n            restrictTimeSlots,\r\n            minDuration,\r\n          );\r\n          ev.start_date = newSlot.start;\r\n          ev.end_date = newSlot.end;\r\n        }\r\n        return true;\r\n      }\r\n      // prevent service change - will be implemented later on\r\n      const serviceChanged = !is_new && ev.service_id !== original.service_id;\r\n      if (serviceChanged) {\r\n        return false;\r\n      }\r\n\r\n      if (is_new || (ev as any).text === NEW_EVENT_TEXT) {\r\n        // set defaultDuration - not sure if need to do some thing in this case\r\n        // - we have a server side correction related to default / min / max durations.\r\n        // To do: check if need to include this code on event selection\r\n        // comented by Ariel Malov on 05/11/2023\r\n        // // if (props.defaultDuration !== undefined && props.defaultDuration > 0) {\r\n        // //   ev.end_date = dateUtils.addMinutes(\r\n        // //     ev.start_date,\r\n        // //     props.defaultDuration,\r\n        // //   );\r\n        // //   schedulerRef?.current?.updateEvent(ev.id?.toString());\r\n        // //   return true;\r\n        // //   // force the provided duration when user gets to place fixed length duration reservation from the service run\r\n        // // } else\r\n        // moved to the section  if (is_new || (original as any).text === NEW_EVENT_TEXT)\r\n        // the above rows didn't run because a 'if' belove - always true.\r\n        // if (forceFullDayReservations === true) {\r\n        //   assign(\r\n        //     ev,\r\n        //     applyForceFullDayReservations(\r\n        //       {\r\n        //         start: ev.start_date,\r\n        //         end: ev.end_date,\r\n        //       },\r\n        //       forceFullDayReservations,\r\n        //     ),\r\n        //   );\r\n        //   return true;\r\n        //   // force the selected duration to fixed time slot defined in service as RestrictDurationUnitType - m/h/d,\r\n        //   // so total duration will be equal RestrictDurationUnitsAmount;\r\n        // } else if (restrictDuration !== undefined) {\r\n        //   const new_end = MatchUnitSlotToEnd(\r\n        //     dateUtils.formatISO(ev.start_date),\r\n        //     dateUtils.formatISO(ev.end_date),\r\n        //     restrictDuration.durationType,\r\n        //     restrictDuration.durationAmount,\r\n        //   );\r\n        //   ev.end_date = new_end;\r\n        //   return true;\r\n        // }\r\n        // return true;\r\n      }\r\n      return true;\r\n    },\r\n    [\r\n      authenticatedUser,\r\n      dispatch,\r\n      forceFullDayReservations,\r\n      globalActions,\r\n      minDuration,\r\n      permissionsError,\r\n      restrictDuration,\r\n      restrictTimeSlots,\r\n    ],\r\n  );\r\n  React.useEffect(() => {\r\n    const eventName = 'onBeforeEventChanged';\r\n    if (\r\n      scheduler !== undefined &&\r\n      services !== undefined &&\r\n      services.length > 0\r\n    ) {\r\n      scheduler.detachEvent(eventName);\r\n      scheduler.attachEvent(eventName, handleBeforeEventChange, {});\r\n    }\r\n    // cleanup\r\n    return () => {\r\n      scheduler?.detachEvent(eventName);\r\n    };\r\n  }, [handleBeforeEventChange, scheduler, services]);\r\n\r\n  const onEmptyClick = 'onEmptyClick';\r\n  const handleEmptyClick = React.useCallback(\r\n    (date: Date, event: MouseEvent) => {\r\n      try {\r\n        log.debug(onEmptyClick, date, event);\r\n        if (scheduler === undefined) {\r\n          log.debug(`${onEmptyClick} - scheduler is undefined. Exiting.`);\r\n          return;\r\n        }\r\n        // check if the click target is a DOM element so that the closest method is available\r\n        const target = event.target;\r\n        if (target instanceof Element) {\r\n          if (target.closest('.dhx_scell_level') !== null) {\r\n            return true;\r\n          }\r\n          // check if the click target is a service label rendered in the timeline section\r\n          const containerClassName = `.${scheduleServiceContainerClassName}`;\r\n          let serviceContainer = target.closest(containerClassName);\r\n          if (serviceContainer !== null) {\r\n            return false;\r\n          }\r\n        }\r\n        if (IsReadOnlyUser(authenticatedUser)) {\r\n          dispatch(\r\n            globalActions.addNotification({\r\n              key: 'permissionError',\r\n              message: permissionsError,\r\n              variant: 'error',\r\n              closable: true,\r\n              autoHideDuration: 3000,\r\n            }),\r\n          );\r\n          return false;\r\n        }\r\n        var newExisted = scheduler\r\n          .getEvents()\r\n          .filter(f => !!f.text && f.text === NEW_EVENT_TEXT);\r\n        if (newExisted.length > 0) {\r\n          return false;\r\n        }\r\n        let action_data = scheduler?.getActionData(event);\r\n\r\n        // verify that the empty click was done inside the calendar/timeline area\r\n        // this event is also raised when instrument column is clicked on the timeline in which case the date the date is equal to timeline start date\r\n        const state: ISchedulerState = scheduler?.getState();\r\n        const clickedInsideVisiblePeriod =\r\n          date.getTime() > state.min_date.getTime() &&\r\n          date.getTime() < state.max_date.getTime();\r\n        if (!clickedInsideVisiblePeriod) {\r\n          return false;\r\n        }\r\n\r\n        // get the instrument data - relevant for timeline/unit mode\r\n        // in this case the event is created on specific instrument\r\n        const serviceId: number | undefined = action_data.section;\r\n        const service = getServerListService(scheduler, serviceId);\r\n\r\n        // get the default duration for the instrument if the event placed directly on timeline/unit view\r\n        const duration =\r\n          props.defaultDuration !== undefined\r\n            ? props.defaultDuration\r\n            : service !== undefined\r\n            ? service.DefaultDuration * 60\r\n            : defaultDuration;\r\n        let eventDate = dateUtils.truncateSeconds(action_data.date);\r\n        let period: SchedulerPeriod = {\r\n          start_date: eventDate,\r\n          end_date: scheduler.date.add(eventDate, duration, 'minute'),\r\n        };\r\n        if (restrictDuration !== undefined) {\r\n          const new_end = MatchUnitSlotToEnd(\r\n            dateUtils.formatISO(period.start_date),\r\n            dateUtils.formatISO(period.end_date),\r\n            restrictDuration.durationType,\r\n            restrictDuration.durationAmount,\r\n          );\r\n          period.end_date = new_end;\r\n        }\r\n        if (restrictTimeSlots.length > 0) {\r\n          let newSlot = adjustToTimeSlot(\r\n            period.start_date,\r\n            period.end_date,\r\n            restrictTimeSlots,\r\n            minDuration,\r\n          );\r\n          period.start_date = newSlot.start;\r\n          period.end_date = newSlot.end;\r\n        }\r\n        const new_event: ISchedulerNewEvent = {\r\n          ...adjustSchedulerEventTimes(\r\n            period,\r\n            service?.ForceFullDayReservations ?? forceFullDayReservations,\r\n          ),\r\n          service_id: serviceId,\r\n          text: NEW_EVENT_TEXT,\r\n        };\r\n\r\n        scheduler?.addEvent(new_event);\r\n        log.debug(onEmptyClick, new_event);\r\n      } catch (error) {\r\n        log.error(onEmptyClick, error);\r\n      }\r\n    },\r\n    [\r\n      authenticatedUser,\r\n      defaultDuration,\r\n      dispatch,\r\n      forceFullDayReservations,\r\n      globalActions,\r\n      minDuration,\r\n      permissionsError,\r\n      props.defaultDuration,\r\n      restrictDuration,\r\n      restrictTimeSlots,\r\n      scheduler,\r\n    ],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    scheduler?.detachEvent(onEmptyClick);\r\n    scheduler?.attachEvent(onEmptyClick, handleEmptyClick, {});\r\n    return () => {\r\n      scheduler?.detachEvent(onEmptyClick);\r\n    };\r\n  }, [handleEmptyClick, scheduler]);\r\n\r\n  /**\r\n   * Attach non memoized events\r\n   * @returns scheduler instance\r\n   */\r\n  const initSchedulerEvents = () => {\r\n    const scheduler: DHTMLX.SchedulerStatic | undefined = schedulerRef.current;\r\n    if (scheduler === undefined) {\r\n      return;\r\n    }\r\n    const onDataUpdated = props.onDataUpdated;\r\n    const attachEventSettings = {};\r\n\r\n    scheduler.attachEvent(\r\n      'onEventCreated',\r\n      (id: number, e: MouseEventHandler) => {\r\n        log.debug('onEventCreated', id, e);\r\n        return true;\r\n      },\r\n      attachEventSettings,\r\n    );\r\n\r\n    scheduler.attachEvent(\r\n      'onEventAdded',\r\n      (id: number, event: ISchedulerEvent) => {\r\n        log.debug('onEventAdded', id, event);\r\n        if (IsReadOnlyUser(authenticatedUser)) {\r\n          dispatch(\r\n            globalActions.addNotification({\r\n              key: 'permissionError',\r\n              message: permissionsError,\r\n              variant: 'error',\r\n              closable: true,\r\n              autoHideDuration: 3000,\r\n            }),\r\n          );\r\n          return false;\r\n        }\r\n        // clear previously created events other than the latest one\r\n        deleteTempReservations(schedulerRef, id);\r\n        resetEventEdits(scheduler, event);\r\n        dispatch(actions.getEmptySlotAdminClick());\r\n        const service = getServerListService(scheduler, event.service_id);\r\n        const serviceId =\r\n          service?.AssemblyId ?? service?.Id ?? event.service_id;\r\n\r\n        onCreate?.({\r\n          id: id,\r\n          start_date: dateUtils.formatISO(event.start_date),\r\n          end_date: dateUtils.formatISO(event.end_date),\r\n          service_id: serviceId,\r\n          alert_type: event.alert_type,\r\n          defaultMulti: event.defaultMulti,\r\n        });\r\n      },\r\n      attachEventSettings,\r\n    );\r\n\r\n    // onBeforeViewChange is triggered on init, on section change, etc.\r\n    scheduler.attachEvent(\r\n      'onBeforeViewChange',\r\n      function (\r\n        old_mode: ViewModes | undefined,\r\n        old_date: Date | undefined,\r\n        mode: ViewModes,\r\n        date: Date,\r\n      ) {\r\n        log.debug('onBeforeViewChange', { old_mode, old_date, mode, date });\r\n        // silence lame events fired after section change\r\n        if (\r\n          isEqual(\r\n            {\r\n              viewMode: old_mode,\r\n              date: serializeSchedulerDateOrUndefined(old_date),\r\n            },\r\n            {\r\n              viewMode: mode,\r\n              date: serializeSchedulerDate(date),\r\n            },\r\n          )\r\n        ) {\r\n          return true;\r\n        }\r\n\r\n        const prev =\r\n          old_mode === undefined ? undefined : parseViewMode(old_mode);\r\n        const prevViewState: IViewState | undefined =\r\n          prev === undefined\r\n            ? undefined\r\n            : {\r\n                preset: props.presetPosition,\r\n                viewType: prev.viewType,\r\n                viewLength: prev.viewLength,\r\n                date: serializeSchedulerDate(date),\r\n                search: props.search,\r\n              };\r\n        const currentViewState: IViewState = {\r\n          preset: null,\r\n          search: props.search,\r\n          ...parseViewMode(mode),\r\n          date: serializeSchedulerDate(date),\r\n        };\r\n\r\n        const x = (f?: IViewState) => ({\r\n          viewLength: f?.viewLength,\r\n          date: f?.date,\r\n        });\r\n        if (\r\n          prevViewState === undefined ||\r\n          isEqual(x(currentViewState), x(prevViewState))\r\n        ) {\r\n          currentViewState.preset = props.presetPosition;\r\n        }\r\n\r\n        // adjust timeline length\r\n        adjustMonthTimelineLength(mode, date, scheduler);\r\n\r\n        return true;\r\n      },\r\n      attachEventSettings,\r\n    );\r\n\r\n    // sync view mode state in scheduler -> react state\r\n    // is called on date/period change + on after init\r\n    scheduler.attachEvent(\r\n      'onViewChange',\r\n      function (new_viewMode, new_date, b) {\r\n        log.debug('onViewChange', {\r\n          new_viewMode,\r\n          new_date,\r\n          viewType,\r\n          viewLength,\r\n        });\r\n      },\r\n      attachEventSettings,\r\n    );\r\n\r\n    scheduler.attachEvent(\r\n      'onDblClick',\r\n      (id, event) => {\r\n        log.debug('onDblClick', { id, event });\r\n        // just disable double click - edit is triggered on the single click\r\n        return false;\r\n      },\r\n      attachEventSettings,\r\n    );\r\n    scheduler.attachEvent(\r\n      'onBeforeEventCreated',\r\n      event => {\r\n        log.debug('onBeforeEventCreated', event);\r\n        return true;\r\n      },\r\n      attachEventSettings,\r\n    );\r\n\r\n    // onEventChanged is fired immediately after an event is changed on the scheduler, for example - by dragging it over\r\n    scheduler.attachEvent(\r\n      'onEventChanged',\r\n      (id, event: ISchedulerEvent) => {\r\n        log.debug('onEventChanged', id, event);\r\n        if (IsReadOnlyUser(authenticatedUser)) {\r\n          dispatch(\r\n            globalActions.addNotification({\r\n              key: 'permissionError',\r\n              message: permissionsError,\r\n              variant: 'error',\r\n              closable: true,\r\n              autoHideDuration: 3000,\r\n            }),\r\n          );\r\n          return false;\r\n        }\r\n        resetEventEdits(scheduler, event);\r\n        // either an existing reservation can be edited or a \"new event\" can be moved on the timeline while the sidePanel is still open\r\n        const changeNewReservation = event.type === undefined;\r\n        if (!changeNewReservation) {\r\n          // if existing reservation is edited - drop any \"new events\"\r\n          deleteTempReservations(schedulerRef);\r\n          // and open the edit sidePanel for through onEdit callback\r\n          onEdit?.({\r\n            ...event,\r\n            ...{\r\n              start_date: dateUtils.formatISO(event.start_date),\r\n              end_date: dateUtils.formatISO(event.end_date),\r\n            },\r\n          });\r\n          return true;\r\n        } else {\r\n          // open create reservation sidePanel or adjust time if already opened\r\n          onCreate?.({\r\n            id: id,\r\n            start_date: dateUtils.formatISO(event.start_date),\r\n            end_date: dateUtils.formatISO(event.end_date),\r\n            service_id: event.service_id,\r\n          });\r\n        }\r\n\r\n        return false;\r\n      },\r\n      attachEventSettings,\r\n    );\r\n    scheduler.attachEvent(\r\n      'onEventDeleted',\r\n      (id, ev) => {\r\n        log.debug('onEventDeleted', { id, ev });\r\n        if (onDataUpdated) {\r\n          onDataUpdated('delete', ev, id);\r\n        }\r\n      },\r\n      attachEventSettings,\r\n    );\r\n    scheduler.attachEvent(\r\n      'onTemplatesReady',\r\n      () => {\r\n        scheduler.templates.event_bar_date = (\r\n          start: Date,\r\n          end: Date,\r\n          event: ISchedulerEvent,\r\n        ) => {\r\n          return `• ${dateUtils.format(\r\n            start,\r\n            dateUtils.DateIOFormats.fullTime,\r\n          )} - ${dateUtils.format(end, dateUtils.DateIOFormats.fullTime)}`;\r\n        };\r\n      },\r\n      attachEventSettings,\r\n    );\r\n  };\r\n  React.useEffect(() => {\r\n    // wait for both scheduler and the services to be initialized\r\n    // the services will be needed in the openToBookMode for the default reservation duration\r\n    if (!!scheduler && services !== undefined) {\r\n      const params = new URLSearchParams(location.search);\r\n      let openToBook = GetRawValue(params, 'openToBook') === 'true';\r\n      let openToReport = GetRawValue(params, 'openToReport') === 'true';\r\n      let serviceIds = GetRawValue(params, 'eid') ?? undefined;\r\n      let alertType = GetNumberOrUndefined(\r\n        GetRawValue(params, 'aType') ?? undefined,\r\n      );\r\n      let defaultMulti = GetRawValue(params, 'defaultMulti') === 'true';\r\n      if (\r\n        (openToBook === true || openToReport === true) &&\r\n        serviceIds !== undefined &&\r\n        services !== undefined &&\r\n        services.length > 0\r\n      ) {\r\n        initOnlineServicesData(serviceIds, 'reserved').then(result => {\r\n          !!setFilterValue && setFilterValue('service', result);\r\n          dispatch(actions.getServices_Success(result as IServiceFilterDto[]));\r\n          dispatch(\r\n            actions.updateEmptySlotSettings(\r\n              openToReport\r\n                ? EmptySlotAdminClick.DownTimeOnly\r\n                : EmptySlotAdminClick.ReservationsOnly,\r\n            ),\r\n          );\r\n        });\r\n        if (isMobile) {\r\n          dispatch(\r\n            globalActions.addNotification({\r\n              key: 'ClickToReserve',\r\n              message: 'Click to reserve (or click, hold and drag)',\r\n              variant: 'info',\r\n              closable: true,\r\n              autoHideDuration: 5000,\r\n            }),\r\n          );\r\n        } else {\r\n          let duration =\r\n            props.defaultDuration !== undefined\r\n              ? props.defaultDuration\r\n              : defaultDuration;\r\n          let initDate = dateUtils.truncateSeconds(newDate());\r\n          let event = {\r\n            start_date: initDate,\r\n            end_date: scheduler.date.add(initDate, duration || 60, 'minute'),\r\n            service_id: getSplitNumberArray(serviceIds || ''),\r\n            alert_type: alertType,\r\n            defaultMulti,\r\n          };\r\n          scheduler.addEventNow(event);\r\n        }\r\n\r\n        const currentSearch = new URLSearchParams();\r\n        [...params.keys()].forEach(key => {\r\n          if (\r\n            key !== 'openToBook' &&\r\n            key !== 'openToReport' &&\r\n            key !== 'aType' &&\r\n            key !== 'defaultMulti'\r\n          ) {\r\n            const val = params.get(key);\r\n            if (val !== null) {\r\n              currentSearch.set(key, val);\r\n            }\r\n          }\r\n        });\r\n        dispatch(\r\n          routerActions.replace({\r\n            pathname: location.pathname,\r\n            search: currentSearch.toString(),\r\n          }),\r\n        );\r\n      }\r\n    }\r\n  }, [\r\n    actions,\r\n    appliedFilters,\r\n    defaultDuration,\r\n    dispatch,\r\n    globalActions,\r\n    isMobile,\r\n    location.pathname,\r\n    location.search,\r\n    newDate,\r\n    onFilterChange,\r\n    props.defaultDuration,\r\n    scheduler,\r\n    services,\r\n    setFilterValue,\r\n  ]);\r\n  /**\r\n   * Main initialization\r\n   */\r\n  useEffectOnMount(() => {\r\n    schedulerRef.current = DHTMLX.Scheduler.getSchedulerInstance();\r\n    const scheduler = schedulerRef.current;\r\n    if (scheduler !== undefined && schedulerContainer.current !== undefined) {\r\n      scheduler.skin = 'material';\r\n      scheduler.locale.labels.timeline_tab = 'Timeline';\r\n      scheduler.locale.labels.calendar_tab = 'Calendar';\r\n      scheduler.locale.labels.section_custom = 'Section';\r\n      // native header can't be removed by removing div.dhx_cal_navline since scheduler creates it anyway\r\n      // display:none hides native navline\r\n      // scheduler.xy.nav_height = 0 - adjusts the heights\r\n      scheduler.xy.nav_height = 0;\r\n\r\n      scheduler.plugins({\r\n        limit: true,\r\n        all_timed: true,\r\n        timeline: true,\r\n        treetimeline: true,\r\n        daytimeline: true,\r\n        tooltip: true,\r\n        units: true,\r\n        multiselect: true,\r\n      });\r\n\r\n      const configOptions: Partial<DHTMLX.SchedulerConfigOptions> = {\r\n        // show multi day events inside the scheduler body instead of showing as full day events on top\r\n        all_timed: true,\r\n        multi_day: true,\r\n        details_on_create: false,\r\n        details_on_dblclick: false,\r\n        start_on_monday: tryGetStartOnMonday(),\r\n        // disable internal edit on event create\r\n        edit_on_create: false,\r\n        hour_date: '%g:%i %A',\r\n        mark_now: true,\r\n        now_date: newDate(),\r\n        time_step: 15,\r\n        //auto_end_date: true,\r\n        //event_duration: 120,\r\n        touch: true,\r\n        touch_drag: 500,\r\n        // sets a timeout (in milliseconds) that wraps the updateView and setCurrentView calls (that cause re-drawing of the scheduler)\r\n        // https://docs.dhtmlx.com/scheduler/api__scheduler_delay_render_config.html\r\n        // setting delay_render to be > 0 results in timeline (both tree and matrix) not render e.g. blank view\r\n        delay_render: 0,\r\n        // disable dragging event by it's body element since it's handled in the readonly/move\r\n        drag_event_body: false,\r\n        // scroll by default to 08:00 on calendar\r\n        scroll_hour: 8, // newDate().getHours(), //8,\r\n        // prevents check limit cpu crunch on open end offline hours/alerts\r\n        check_limits: false,\r\n      };\r\n\r\n      Object.assign(scheduler.config, configOptions);\r\n      log.info('scheduler.config', scheduler.config);\r\n      // reduce from default 70 to 40 in order to reduce precious horizontal space on mobile\r\n      scheduler.xy.scale_width = isMobile ? 40 : 70;\r\n      // this should be large enough to contain 2 text lines on mobile otherwise one is sufficient\r\n      scheduler.xy.scale_height = isMobile ? 35 : 30;\r\n\r\n      scheduler.config.hour_size_px = 44;\r\n      // reduces default min height from 40px to 22px (half an hour height)\r\n      scheduler.xy.min_event_height = scheduler.config.hour_size_px / 2;\r\n\r\n      // cast is needed since the scheduler renderEvent is typed incompletely. According to definition it has 2 arguments, but in reality it's got 6 - see renderEvent\r\n      scheduler.renderEvent = renderEvent(scheduler) as (\r\n        container: HTMLElement,\r\n        event: any,\r\n      ) => boolean;\r\n\r\n      Object.assign(scheduler.templates, {\r\n        // parse function to match system settings\r\n        parse_date: date => dateUtils.parseISO(date),\r\n        tooltip_text: tooltip_text(\r\n          scheduler,\r\n          compiledSchedulerReservationTooltipTemplate,\r\n          IncludeCustomFormInSchedulerReservationTooltip,\r\n        ),\r\n        event_class: function (start: Date, end: Date, event: ISchedulerEvent) {\r\n          const eventType = event.type;\r\n          if (eventType === 'offline') {\r\n            return 'event_offline';\r\n          } else {\r\n            if (event.id === scheduler.getState().select_id) {\r\n              return 'selected';\r\n            }\r\n          }\r\n        },\r\n        // sets the calendar event text content\r\n        event_text: event_text(\r\n          viewType,\r\n          isMobile,\r\n          compiledSchedulerReservationBodyTemplate,\r\n        ),\r\n        // todo: set the timeline event text content - this will require rework of timeline display/or separate template since currently the timeline events won't fit the multiline text\r\n        event_bar_text: event_text(\r\n          viewType,\r\n          isMobile,\r\n          compiledSchedulerReservationBodyTemplate,\r\n        ),\r\n        week_scale_date: function (date) {\r\n          const text = isMobile\r\n            ? // Mon 12 with line break\r\n              dateUtils.format(date, 'EEE') +\r\n              '<br/>' +\r\n              dateUtils.format(date, 'dd')\r\n            : // Mon, 12 Jan\r\n              dateUtils.format(date, 'EEE, d LLL');\r\n\r\n          return text;\r\n        },\r\n        unit_scale_text: function (key, label, unit, date) {\r\n          return 'AAAAAAAAAAAA';\r\n        },\r\n        hour_scale: function (date) {\r\n          // no am/pm indicator was found on the date-fns locale\r\n          // removes minutes :00 manually in order to preserve precious horizontal space on mobile\r\n          return useAmPm\r\n            ? isMobile\r\n              ? dateUtils.format(date, 'HH')?.replace(':00', '')\r\n              : dateUtils.format(date, 'hh aaa')\r\n            : isMobile\r\n            ? dateUtils.format(date, 'p')?.replace(':00', '')\r\n            : dateUtils.format(date, 'p');\r\n        },\r\n        // work date class\r\n        week_date_class: function (date, today) {\r\n          return `week_date_${dateUtils.formatISO(date, {\r\n            format: 'basic',\r\n            representation: 'date',\r\n          })}`;\r\n        },\r\n      });\r\n\r\n      // attaches constant events\r\n      initSchedulerEvents();\r\n\r\n      // serverList is needed to be able to change the \"sections\" in the lifecycle of the scheduler component\r\n      // changes in the scheduler.sections is ignored by the scheduler\r\n      setServerList(\r\n        scheduler,\r\n        services,\r\n        appSettings,\r\n        schedulerSectionsGroupByField,\r\n      );\r\n\r\n      // create all of the views like weekly calendar, daily calendar (unit) etc.\r\n      createTimelineView(\r\n        scheduler,\r\n        isMobile,\r\n        customDays || 2,\r\n        useAmPm,\r\n        hasCustomStart,\r\n      );\r\n      createUnitsView(scheduler);\r\n\r\n      // initializes the scheduler\r\n      scheduler.init(\r\n        schedulerContainer.current as HTMLElement,\r\n        getViewStartDate(viewLength, date, hasCustomStart),\r\n        viewMode,\r\n      );\r\n    }\r\n    return () => {\r\n      schedulerRef.current && schedulerRef.current.destructor();\r\n    };\r\n\r\n    /**\r\n     * try to get the monday/sunday week start\r\n     * dateUtils.CurrentLocale() might return undefined if it was not initialized properly before this call, e.g. in test\r\n     * @returns\r\n     */\r\n    function tryGetStartOnMonday(): boolean | undefined {\r\n      try {\r\n        return dateUtils.CurrentLocale()?.options?.weekStartsOn === 1;\r\n      } catch (error) {\r\n        return true;\r\n      }\r\n    }\r\n  });\r\n\r\n  const handleServiceLabelClick = React.useCallback(\r\n    (event: MouseEvent, serviceId: number) => {\r\n      // open the asset details\r\n      openAsset({\r\n        serviceId: serviceId,\r\n        serviceType: 'Online',\r\n      });\r\n    },\r\n    [openAsset],\r\n  );\r\n\r\n  /**\r\n   * Handles click inside the scheduler.\r\n   * Clicking on an asset label/image should open asset side panel\r\n   */\r\n  const handleSchedulerClick = React.useCallback(\r\n    (event: MouseEvent) => {\r\n      log.debug('handleSchedulerClick', event);\r\n\r\n      const isTimelineColumnCellClick =\r\n        findParentTarget(event, ['.dhx_matrix_scell']) !== null;\r\n      if (isTimelineColumnCellClick) {\r\n        const serviceId = getServiceIdFromServiceClickEvent(event);\r\n        if (serviceId !== undefined) {\r\n          handleServiceLabelClick(event, serviceId);\r\n          // prevent further event propagation if it's already handled\r\n          event.preventDefault();\r\n          event.stopPropagation();\r\n          return false;\r\n        }\r\n      }\r\n    },\r\n    [handleServiceLabelClick],\r\n  );\r\n  React.useEffect(() => {\r\n    const dom = schedulerContainer.current;\r\n    dom?.addEventListener('click', handleSchedulerClick, { capture: true });\r\n    return () => {\r\n      dom?.removeEventListener('click', handleSchedulerClick);\r\n    };\r\n  }, [handleSchedulerClick]);\r\n\r\n  /**\r\n   * Handles zoom in / out for timeline view only.\r\n   * currently  commented to develop later\r\n   */\r\n  // const handleZoomWhell = React.useCallback(\r\n  //   (event: WheelEvent) => {\r\n  //    if (!zoomEnabled) {\r\n  //      return;\r\n  //    }\r\n  //     let delta = 0;\r\n  //     if (!!(event as any).wheelDelta) {\r\n  //       /* IE/Opera. */\r\n  //       delta = (event as any).wheelDelta / 120;\r\n  //     } else if (event.detail) {\r\n  //       /* Mozilla case. */\r\n  //       // In Mozilla, sign of delta is different than in IE.\r\n  //       // Also, delta is multiple of 3.\r\n  //       delta = -event.detail / 3;\r\n  //     } else if (event.deltaY) {\r\n  //       delta = -event.deltaY / 3;\r\n  //     }\r\n  //     if (!(viewType === 'timeline' && !!schedulerRef.current && !!scheduler))\r\n  //       return;\r\n  //     const target = event.target;\r\n\r\n  //     if (!(target instanceof Element)) {\r\n  //       return;\r\n  //     }\r\n  //     let dataContainer = target.closest('.dhx_timeline_data_wrapper');\r\n  //     if (dataContainer === null) {\r\n  //       return;\r\n  //     }\r\n  //     let state = scheduler?.getActionData(event);\r\n  //     if (!state || !state.date) {\r\n  //       return;\r\n  //     }\r\n\r\n  //     if (delta) {\r\n  //       const zoomFriction = 5;\r\n  //       let scale = 0;\r\n  //       if (delta < 0) {\r\n  //         scale = 1 - delta / zoomFriction;\r\n  //       } else {\r\n  //         scale = 1 / (1 + delta / zoomFriction);\r\n  //       }\r\n  //       let pointer = getPointer(\r\n  //         {\r\n  //           x: event.clientX,\r\n  //           y: event.clientY,\r\n  //         },\r\n  //         dataContainer,\r\n  //         scheduler,\r\n  //       );\r\n  //       let timeline = scheduler?.matrix[viewMode];\r\n  //       let currentMode = parseViewMode(scheduler?.getState().mode);\r\n  //       let newLength = currentMode.viewLength;\r\n  //       if (false) {\r\n  //         //currentMode.viewLength === 'week'\r\n  //         //let pointerDate = timeline.dateFromPos(pointer.x);\r\n\r\n  //         const hour = 24;\r\n  //         const divider = 4;\r\n  //         const minStep = 4;\r\n  //         const maxStep = 8;\r\n  //         const column_width = 36;\r\n  //         //const left = timeline.posFromDate(state.date);\r\n  //         const top = timeline.getSectionTop(state.section);\r\n  //         const position = {\r\n  //           left: pointer.x + (pointer.x - pointer.x * scale) / 2, //Math.ceil(left / 2),\r\n  //           top: top / 2, //pointer.y - (pointer.y / 2) * scale, //Math.ceil(top / 2),\r\n  //         } as LeftTop;\r\n  //         // const position = {\r\n  //         //   date: pointerDate,\r\n  //         //   section: state.section,\r\n  //         // } as DateSection;\r\n  //         // const position = timeline.resolvePosition({\r\n  //         //   top: e.y,\r\n  //         //   left: e.x,\r\n  //         // });\r\n  //         // zoom in\r\n  //         if (delta > 0) {\r\n  //           if (currentStep === 0) {\r\n  //             timeline.x_step = hour / (divider + scale);\r\n  //             timeline.x_size = (divider + scale) * 7;\r\n  //             timeline.x_length = (divider + scale) * 7;\r\n  //             timeline.column_width =\r\n  //               timeline.column_width +\r\n  //               (timeline.column_width - timeline.column_width * scale); //column_width * scale;\r\n  //             setCurrentPosition(position);\r\n  //             setCurrentStep(divider + 1);\r\n  //             setZoomed(true);\r\n\r\n  //             // timeline.scrollTo(position.date, position.section);\r\n  //             // scheduler.setCurrentView(position.date);\r\n  //           } else {\r\n  //             timeline.x_step =\r\n  //               currentStep < maxStep\r\n  //                 ? hour / (currentStep + scale)\r\n  //                 : timeline.x_step;\r\n  //             timeline.x_size =\r\n  //               currentStep < maxStep\r\n  //                 ? (currentStep + scale) * 7\r\n  //                 : timeline.x_size;\r\n  //             timeline.x_length =\r\n  //               currentStep < maxStep\r\n  //                 ? (currentStep + scale) * 7\r\n  //                 : timeline.x_length;\r\n  //             timeline.column_width =\r\n  //               currentStep < maxStep\r\n  //                 ? timeline.column_width +\r\n  //                   (timeline.column_width - timeline.column_width * scale)\r\n  //                 : timeline.column_width;\r\n  //             if (currentStep < maxStep) {\r\n  //               setCurrentStep(prev => prev + 1);\r\n  //               setCurrentPosition(position);\r\n  //               setZoomed(true);\r\n\r\n  //               // scheduler.setCurrentView(position.date);\r\n  //               // timeline.scrollTo(position.date, position.section);\r\n  //             }\r\n  //           }\r\n  //         }\r\n  //         // zoom out\r\n  //         else {\r\n  //           if (currentStep >= minStep) {\r\n  //             timeline.x_step =\r\n  //               currentStep > minStep\r\n  //                 ? hour / (currentStep - 1)\r\n  //                 : timeline.x_step;\r\n  //             timeline.x_size =\r\n  //               currentStep > minStep ? (currentStep - 1) * 7 : timeline.x_size;\r\n  //             timeline.x_length =\r\n  //               currentStep > minStep\r\n  //                 ? (currentStep - 1) * 7\r\n  //                 : timeline.x_length;\r\n  //             timeline.column_width =\r\n  //               currentStep > minStep\r\n  //                 ? timeline.column_width / 1.5\r\n  //                 : column_width;\r\n  //             if (currentStep > minStep) {\r\n  //               setCurrentStep(prev => prev - 1);\r\n  //               setCurrentPosition(position);\r\n  //               setZoomed(true);\r\n  //             }\r\n  //           }\r\n  //         }\r\n  //         console.log('week_timeline', timeline);\r\n  //       } else {\r\n  //         if (event.deltaY < 0) {\r\n  //           newLength = getPrevViewLength(\r\n  //             currentMode.viewLength,\r\n  //             customDaysEnabled,\r\n  //             twoDaysEnabled,\r\n  //           );\r\n  //         } else {\r\n  //           newLength = getNextViewLength(\r\n  //             currentMode.viewLength,\r\n  //             customDaysEnabled,\r\n  //             twoDaysEnabled,\r\n  //           );\r\n  //         }\r\n  //         if (newLength !== currentMode.viewLength) {\r\n  //           !!handleViewTypeLengthChange &&\r\n  //             handleViewTypeLengthChange(\r\n  //               viewType,\r\n  //               newLength,\r\n  //               getViewStartDate(newLength, state.date, hasCustomStart),\r\n  //               noChangeLocation,\r\n  //             );\r\n  //         }\r\n  //       }\r\n  //       event.preventDefault();\r\n  //     }\r\n  //   },\r\n  //   [\r\n  //     currentStep,\r\n  //     customDaysEnabled,\r\n  //     handleViewTypeLengthChange,\r\n  //     hasCustomStart,\r\n  //     noChangeLocation,\r\n  //     scheduler,\r\n  //     twoDaysEnabled,\r\n  //     viewMode,\r\n  //     viewType,\r\n  //   ],\r\n  //    zoomEnabled,\r\n  // );\r\n  /**\r\n   * Bind to scheduler dom in order to handle click on instrument label/image in the timeline\r\n   */\r\n\r\n  // todo: find the source of services array reference change\r\n  // prevent unnecessary useEffect invocations when services array reference changes for whatever reason\r\n  const stringifiedServices = React.useMemo(\r\n    () => (services === undefined ? undefined : JSON.stringify(services)),\r\n    [services],\r\n  );\r\n  const parsedServices = React.useMemo(\r\n    () =>\r\n      stringifiedServices === undefined\r\n        ? undefined\r\n        : JSON.parse(stringifiedServices),\r\n    [stringifiedServices],\r\n  );\r\n  const schedulerSectionsGroupByField = useSelector(selectTimelineGroupBy);\r\n  /**\r\n   * Sync props.services -> scheduler\r\n   */\r\n  React.useEffect(() => {\r\n    if (parsedServices !== undefined) {\r\n      const scheduler = schedulerRef.current;\r\n      if (scheduler !== undefined) {\r\n        // if (sections?.length === 0) {\r\n        //   sections.push({ label: '' });\r\n        // }\r\n        // todo: update grouping on unit->timeline transition\r\n        updateServerList(\r\n          scheduler,\r\n          services,\r\n          appSettings,\r\n          schedulerSectionsGroupByField,\r\n        );\r\n\r\n        /**\r\n         * units view does not update the service column on it's own after the updateCollection call\r\n         * unlike the timeline which manages to reflect the changes immediately on it's own without any help\r\n         * calendar view does not need any changes at all since it does not show separate services\r\n         */\r\n        if (viewType === 'unit') {\r\n          updateView(schedulerRef.current);\r\n        }\r\n      }\r\n    }\r\n  }, [\r\n    appSettings,\r\n    parsedServices,\r\n    schedulerSectionsGroupByField,\r\n    services,\r\n    viewType,\r\n  ]);\r\n\r\n  /**\r\n   * Sync props.events -> scheduler\r\n   */\r\n  React.useEffect(() => {\r\n    // return early on initial render\r\n    if (events !== undefined) {\r\n      syncSchedulerEvents(schedulerRef?.current, events);\r\n    }\r\n  }, [scheduler, events]);\r\n\r\n  /**\r\n   * non working hours (gaps between the working hours) need to be tracked separately due to the lack of getMarkedTimespans similar to getEvents on the scheduler API\r\n   * todo: find a better way to clear/sync non working hours into the scheduler. Currently shown marked timespans might be queryable through the DOM API.\r\n   */\r\n  const nonWorkingHoursRef = React.useRef<Array<IMarkedTimeSpan>>([]);\r\n  React.useEffect(() => {\r\n    // return early on initial render\r\n    if (nonWorkingHours !== undefined) {\r\n      const state: ISchedulerState = schedulerRef?.current?.getState();\r\n      // https://docs.dhtmlx.com/scheduler/api__scheduler_addmarkedtimespan.html\r\n      const getUnits = item => {\r\n        switch (viewType) {\r\n          case 'unit':\r\n          case 'timeline':\r\n            return {\r\n              [viewMode]: item.EquipmentId,\r\n            };\r\n          case 'calendar':\r\n            return undefined;\r\n\r\n          default:\r\n            assertExhaustive(viewType);\r\n        }\r\n      };\r\n      const timeSpans = nonWorkingHoursRef.current.reduce<{\r\n        removed: IMarkedTimeSpan[];\r\n        current: IMarkedTimeSpan[];\r\n      }>(\r\n        (prev, item) => {\r\n          const match =\r\n            item.start_date < state.max_date && item.end_date > state.min_date;\r\n          (match ? prev.removed : prev.current).push(item);\r\n          return prev;\r\n        },\r\n        {\r\n          removed: [],\r\n          current: [],\r\n        },\r\n      );\r\n      timeSpans.removed.forEach(item => {\r\n        schedulerRef?.current?.deleteMarkedTimespan(String(item.id));\r\n        return item;\r\n      });\r\n\r\n      const highlights = nonWorkingHours\r\n        ?.map(item => {\r\n          const timeSpan = {\r\n            type: 'dhx_time_block',\r\n            css: 'fat_lines_section',\r\n            start_date: dateUtils.parseISO(item.Start),\r\n            end_date: dateUtils.parseISO(item.End),\r\n            sections: getUnits(item),\r\n          };\r\n          var spanId = schedulerRef.current?.addMarkedTimespan(timeSpan);\r\n          if (spanId === undefined) {\r\n            return undefined;\r\n          }\r\n          const r: IMarkedTimeSpan = {\r\n            id: spanId,\r\n            start_date: timeSpan.start_date,\r\n            end_date: timeSpan.end_date,\r\n          };\r\n          return r;\r\n        })\r\n        .filter(item => item !== undefined);\r\n      nonWorkingHoursRef.current = [\r\n        ...timeSpans.current,\r\n        ...(highlights as IMarkedTimeSpan[]),\r\n      ];\r\n\r\n      // updateView here is needed since addMarkedTimespan above is not rendered immediately on the scheduler\r\n      updateView(schedulerRef.current, undefined, true);\r\n    }\r\n    if (viewMode === 'day_timeline' && !!date) {\r\n      let startdate = dateUtils.parseISO(date);\r\n      const hourSet =\r\n        dateUtils.getHours(startdate) < 8 ? dateUtils.getHours(startdate) : 8;\r\n      schedulerRef?.current\r\n        ?.getView()\r\n        ?.scrollTo(\r\n          dateUtils.addHours(dateUtils.startOfDay(startdate), hourSet),\r\n        );\r\n    }\r\n  }, [date, nonWorkingHours, viewMode, viewType]);\r\n\r\n  /**\r\n   * Sync current view props from props to scheduler instance\r\n   * useDidUpdate is used here to skip first fire since the scheduler is already initialized with the current view props during initial mount, so nothing needs to be done in this case.\r\n   */\r\n  useDidUpdate(() => {\r\n    const scheduler = schedulerRef.current;\r\n    if (scheduler === undefined) {\r\n      return;\r\n    }\r\n\r\n    // TODO: remove following block? looks like the viewType parameter is redundant and resetting the calendar/timeline event text templates with subsequent updateView call just wastes the resources\r\n    // TODO: clearly separate of calendar/timeline templates (if it will be possible to untangle the event_text mess)\r\n    scheduler.templates.event_text = event_text(\r\n      viewType,\r\n      isMobile,\r\n      compiledSchedulerReservationBodyTemplate,\r\n    );\r\n    scheduler.templates.event_bar_text = event_text(\r\n      viewType,\r\n      isMobile,\r\n      compiledSchedulerReservationBodyTemplate,\r\n    );\r\n    const d = dateUtils.parseISO(date);\r\n    scheduler.config.now_date = d;\r\n    // is this needed to update view to apply updates in event_text & event_bar_text ?\r\n    updateView(scheduler);\r\n\r\n    scheduler.setCurrentView(\r\n      getViewStartDate(viewLength, date, hasCustomStart),\r\n      viewMode,\r\n    );\r\n    // scroll to 08:00 on daily timeline\r\n    if (viewMode === 'day_timeline') {\r\n      const hourSet = dateUtils.getHours(d) < 8 ? dateUtils.getHours(d) : 8;\r\n      scheduler\r\n        .getView()\r\n        ?.scrollTo(dateUtils.addHours(dateUtils.startOfDay(d), hourSet));\r\n    }\r\n    if (viewMode === 'twodays_timeline') {\r\n      let timeline = scheduler.matrix[viewMode];\r\n      timeline.setRange(\r\n        getViewStartDate(viewLength, date, hasCustomStart),\r\n        getViewEndDate(viewLength, date, undefined, hasCustomStart),\r\n      );\r\n    }\r\n    if (viewMode === 'customdays_timeline') {\r\n      let timeline = scheduler.matrix[viewMode];\r\n      timeline.setRange(\r\n        getViewStartDate(viewLength, date, hasCustomStart),\r\n        getViewEndDate(viewLength, date, customDays, hasCustomStart),\r\n      );\r\n    }\r\n    if (hasCustomStart) {\r\n      const d = dateUtils.parseISO(date);\r\n      if (\r\n        viewMode === 'month_timeline' ||\r\n        viewMode === 'week_timeline' ||\r\n        viewMode === 'quarter_timeline' ||\r\n        viewMode === 'year_timeline' ||\r\n        viewMode === 'week' ||\r\n        viewMode === 'month'\r\n      ) {\r\n        let timeline = scheduler.matrix[viewMode];\r\n        let newStart = getViewStartDate(viewLength, date, hasCustomStart);\r\n        let newEnd = getViewEndDate(\r\n          viewLength,\r\n          date,\r\n          customDays,\r\n          hasCustomStart,\r\n        );\r\n\r\n        if (viewMode === 'week_timeline') {\r\n          scheduler.date['week_timeline_start'] = () => newStart;\r\n          scheduler.date['get_week_timeline_end'] = () => newEnd;\r\n        } else if (viewMode === 'week') {\r\n          scheduler.date['week_start'] = () => newStart ?? d;\r\n        } else if (viewMode === 'month') {\r\n          scheduler.date.month_start = () => newStart ?? d;\r\n        } else {\r\n          timeline.setRange(newStart, newEnd);\r\n        }\r\n      }\r\n    }\r\n  }, [\r\n    compiledSchedulerReservationBodyTemplate,\r\n    customDays,\r\n    date,\r\n    hasCustomStart,\r\n    isMobile,\r\n    viewLength,\r\n    viewMode,\r\n    viewType,\r\n  ]);\r\n\r\n  const withReservationsOnly = useSelector(selectWithReservationsOnly);\r\n  const loadingEvents = useSelector(selectSchedulerLoadingEvents);\r\n  const showProgress = withReservationsOnly === true && loadingEvents === true;\r\n  const showNoDataPlaceholder = services?.length === 0 && !showProgress;\r\n  const hideCalData = showNoDataPlaceholder || showProgress;\r\n  const print = useSelector(selectExportToPDF);\r\n  const handleClosePrintToPDF = React.useCallback(() => {\r\n    dispatch(actions.resetExportToPDF());\r\n  }, [actions, dispatch]);\r\n  const getTitle = React.useCallback(\r\n    (viewType: ViewTypes): string => {\r\n      switch (viewType) {\r\n        case 'calendar':\r\n          return t(translations.Calendar);\r\n        case 'timeline':\r\n          return t(translations.Timeline);\r\n        default:\r\n          assertExhaustive(viewType);\r\n      }\r\n    },\r\n    [t],\r\n  );\r\n  return (\r\n    <>\r\n      <PrintSchedulerToPDF\r\n        title={''}\r\n        print={print !== undefined ? print : false}\r\n        printTitle={getTitle(props.viewType)}\r\n        scheduler={schedulerRef.current}\r\n        close={handleClosePrintToPDF}\r\n      ></PrintSchedulerToPDF>\r\n      <div\r\n        ref={schedulerContainer}\r\n        style={{ width: '100%', height: props.hight ?? '100%' }}\r\n        id=\"scheduler_here\"\r\n        className={clsx(schedulerSectionsGroupByField, {\r\n          dhx_cal_container: isMobile,\r\n        })}\r\n      >\r\n        {/* \r\n        native header can't be removed by removing div.dhx_cal_navline since scheduler creates it anyway\r\n        display:none hides native navline\r\n        scheduler.xy.nav_height = 0 - adjusts the heights\r\n      */}\r\n        <div className=\"dhx_cal_navline\" style={{ display: 'none' }}></div>\r\n        <div className=\"dhx_cal_header\"></div>\r\n        {showNoDataPlaceholder && <NoServices />}\r\n        {showProgress && <TableRowsSkeleton isCards={false} isMobile={false} />}\r\n        {/* hide the calendar data without unmounting it since it's content is handled by the dhtmlx scheduler */}\r\n        <div\r\n          className=\"dhx_cal_data\"\r\n          style={{ visibility: hideCalData ? 'hidden' : 'visible' }}\r\n        ></div>\r\n      </div>\r\n    </>\r\n  );\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { ISchedulerEvent } from '../types/ISchedulerEvent';\r\n\r\n/**\r\n * Retrieves scheduler event by it's id\r\n * @param scheduler\r\n * @param id\r\n * @returns\r\n */\r\nexport function getEvent(\r\n  scheduler: DHTMLX.SchedulerStatic | undefined,\r\n  id: string,\r\n): ISchedulerEvent {\r\n  return scheduler?.getEvent(id);\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport function adjustMonthTimelineLength(\r\n  mode: any,\r\n  date: any,\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n) {\r\n  if (mode === 'month_timeline') {\r\n    if (date !== undefined) {\r\n      var year = date.getFullYear();\r\n      var month = date.getMonth() + 1;\r\n      var d = new Date(year, month, 0);\r\n      scheduler.matrix[mode].x_size = d.getDate();\r\n      scheduler.matrix[mode].x_length = d.getDate();\r\n      //scheduler.date['timeline_start'] = scheduler.date.month_start;\r\n      //scheduler.date.\r\n    }\r\n  } else if (mode === 'quarter_timeline') {\r\n    if (date !== undefined) {\r\n      let qst = dateUtils.startOfQuarter(date);\r\n      let qet = dateUtils.endOfQuarter(date);\r\n      let offsetStart =\r\n        dateUtils.startOfWeek(qst) < qst\r\n          ? dateUtils.startOfWeek(qst).getDay()\r\n          : 0;\r\n\r\n      let weeks = Math.round(dateUtils.getWeekDiff(qst, qet));\r\n      scheduler.matrix[mode].x_size = weeks;\r\n      scheduler.matrix[mode].x_length = weeks;\r\n      scheduler.matrix[mode].x_start = offsetStart;\r\n    }\r\n  }\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { timelineColumnWidth } from './utils';\r\nimport { scheduler_services_collection_name } from './serverListUtils';\r\nimport { scheduleServiceTemplate } from './renderServiceLabel';\r\nimport { ISchedulerServiceSection } from './types/ISchedulerSection';\r\nimport { timelineEventsSortIteratee } from './utils/timelineEventsSortIteratee';\r\n\r\ninterface ITimelineColumn {\r\n  name?: string;\r\n  css?: string;\r\n  label?: string;\r\n  width: number;\r\n  template: (params: ISchedulerServiceSection) => string;\r\n}\r\n\r\nexport function createTimelineView(\r\n  scheduler: DHTMLX.SchedulerStatic,\r\n  isMobile: boolean,\r\n  customDays: number,\r\n  useAmPm?: boolean,\r\n  hasCustomStart?: boolean,\r\n) {\r\n  const columns: ITimelineColumn[] = [\r\n    {\r\n      label: '',\r\n      width: timelineColumnWidth(isMobile),\r\n      template: scheduleServiceTemplate,\r\n    },\r\n  ];\r\n\r\n  const s = {\r\n    y_unit: scheduler.serverList(scheduler_services_collection_name),\r\n    y_property: 'service_id',\r\n    column_width: 70,\r\n    scrollable: true,\r\n    render: 'tree',\r\n    event_min_dy: isMobile ? 20 : 38,\r\n    columns: columns,\r\n    sort: timelineEventsSortIteratee,\r\n  };\r\n\r\n  scheduler.createTimelineView({\r\n    name: 'day_timeline',\r\n    x_unit: 'minute',\r\n    x_date: ' ',\r\n    x_start: 0,\r\n    x_step: 15,\r\n    x_size: 24 * 4,\r\n    x_length: 24 * 4,\r\n    second_scale: {\r\n      x_unit: 'hour',\r\n      x_date: useAmPm ? '%h %A' : '%H:%i',\r\n    },\r\n    ...{\r\n      ...s,\r\n      column_width: 20,\r\n    },\r\n  });\r\n  scheduler.createTimelineView({\r\n    name: 'twodays_timeline',\r\n    x_unit: 'hour',\r\n    x_date: useAmPm ? '%h %A' : '%H:%i', //'%H:%i',\r\n    x_start: 0,\r\n    x_step: 24 / 6,\r\n    x_size: (24 / 6) * 2,\r\n    x_length: (24 / 6) * 2,\r\n    second_scale: {\r\n      x_unit: 'day',\r\n      x_date: '%D, %j %M', // date format which should be used for second scale, \"July 01\"\r\n    },\r\n    ...s,\r\n  });\r\n  scheduler.createTimelineView({\r\n    name: 'customdays_timeline',\r\n    x_unit: customDays < 28 ? 'hour' : 'day',\r\n    x_date:\r\n      customDays < 7\r\n        ? useAmPm\r\n          ? '%h %A'\r\n          : '%H:%i'\r\n        : customDays < 28\r\n        ? ' '\r\n        : '%d',\r\n    x_start: 0,\r\n    x_step: customDays < 7 ? 24 / 6 : customDays < 28 ? 24 / 4 : 1,\r\n    x_size:\r\n      customDays < 7 ? (24 / 6) * customDays : customDays < 28 ? 4 * 7 : 31,\r\n    x_length:\r\n      customDays < 7 ? (24 / 6) * customDays : customDays < 28 ? 4 * 7 : 31,\r\n    second_scale: {\r\n      x_unit: customDays < 7 ? 'day' : customDays < 28 ? 'day' : 'week',\r\n      x_date:\r\n        customDays < 7\r\n          ? '%D, %j %M'\r\n          : customDays < 28\r\n          ? '%D, %j %M'\r\n          : '%M, W %W', // date format which should be used for second scale, \"July 01\"\r\n    },\r\n    ...s,\r\n  });\r\n  scheduler.createTimelineView({\r\n    name: 'week_timeline',\r\n    x_unit: 'hour',\r\n    x_date: ' ',\r\n    x_step: 24 / 4,\r\n    x_size: 4 * 7,\r\n    x_start: 0,\r\n    x_length: 4 * 7,\r\n    second_scale: {\r\n      x_unit: 'day',\r\n      x_date: '%D, %j %M', // date format which should be used for second scale, \"July 01\"\r\n    },\r\n    ...{\r\n      ...s,\r\n      column_width: 36,\r\n    },\r\n  });\r\n\r\n  // https://docs.dhtmlx.com/scheduler/custom_views.html\r\n  // sets the week_timeline period to match the week date falls into: week start -> week end according to scheduler's settings\r\n  scheduler.date.week_timeline_start = date =>\r\n    hasCustomStart ? date : scheduler.date.week_start(date);\r\n  scheduler.date.get_week_timeline_end = start_date =>\r\n    scheduler.date.add(start_date, 7, 'day');\r\n\r\n  scheduler.createTimelineView({\r\n    name: 'month_timeline',\r\n    x_unit: 'day',\r\n    x_date: '%j',\r\n    x_step: 1,\r\n    x_size: 31,\r\n    x_start: 0,\r\n    x_length: 31,\r\n\r\n    second_scale: {\r\n      x_unit: 'week',\r\n      x_date: '%M, W %W', // date format which should be used for second scale, \"July 01\"\r\n    },\r\n    // sections of the view (titles of Y-Axis)\r\n    ...{\r\n      ...s,\r\n      column_width: 36,\r\n    },\r\n  });\r\n  scheduler.date['timeline_start'] = scheduler.date.month_start;\r\n  scheduler.createTimelineView({\r\n    name: 'quarter_timeline',\r\n    x_unit: 'week',\r\n    x_date: '%M, W %W',\r\n    x_step: 1,\r\n    x_size: 15,\r\n    x_start: 0,\r\n    x_length: 14,\r\n    second_scale: {\r\n      x_unit: 'month',\r\n      x_date: '%F', // date format which should be used for second scale, \"July 01\"\r\n    },\r\n    // sections of the view (titles of Y-Axis)\r\n    ...{\r\n      ...s,\r\n      column_width: 70,\r\n    },\r\n  });\r\n  scheduler.createTimelineView({\r\n    name: 'year_timeline',\r\n    x_unit: 'month',\r\n    x_date: '%M',\r\n    x_step: 1,\r\n    x_size: 12,\r\n    x_start: 0,\r\n    x_length: 12,\r\n    second_scale: {\r\n      x_unit: 'year',\r\n      x_date: '%Y',\r\n    },\r\n    // sections of the view (titles of Y-Axis)\r\n    ...{\r\n      ...s,\r\n      column_width: 70,\r\n    },\r\n  });\r\n  return;\r\n}\r\n","import * as DHTMLX from 'dhtmlx-scheduler';\r\nimport { scheduler_services_collection_name } from './serverListUtils';\r\nimport { scheduleServiceTemplate } from './renderServiceLabel';\r\n\r\nexport function createUnitsView(scheduler: DHTMLX.SchedulerStatic) {\r\n  const sharedSettings = {\r\n    property: 'service_id',\r\n    y_property: 'service_id',\r\n    list: scheduler.serverList(scheduler_services_collection_name),\r\n  };\r\n  const unitsName = 'day_unit';\r\n  scheduler.createUnitsView({\r\n    ...sharedSettings,\r\n    name: unitsName,\r\n    days: 1,\r\n    xy: {\r\n      scale_height: 70,\r\n    },\r\n  });\r\n  // sets the render template for unit header\r\n  // https://docs.dhtmlx.com/scheduler/api__scheduler_%7Bunitsname%7D_scale_text_template.html\r\n  scheduler.templates[`${unitsName}_scale_text`] = function (\r\n    _key,\r\n    _label,\r\n    unit,\r\n    _date,\r\n  ) {\r\n    return scheduleServiceTemplate(unit);\r\n  };\r\n}\r\n","import {\r\n  scheduleImageClassName,\r\n  scheduleServiceContainerClassName,\r\n  scheduleServiceIdAttributeName,\r\n} from './renderServiceLabel';\r\nimport { findParentTarget } from './findParentTarget';\r\n\r\n/**\r\n * Locates the service label container click and extracts service id from the click event\r\n * @param event scheduler click event\r\n * @returns service id if present\r\n */\r\nexport function getServiceIdFromServiceClickEvent(event: MouseEvent) {\r\n  // check if the click target is a service label rendered in the timeline section\r\n  const containerClassName = `.${scheduleServiceContainerClassName}`;\r\n  const imageClassName = `.${scheduleImageClassName}`;\r\n  var serviceContainer = findParentTarget(event, [\r\n    containerClassName,\r\n    imageClassName,\r\n  ]);\r\n  if (serviceContainer === null) {\r\n    return undefined;\r\n  }\r\n\r\n  var serviceIdAttributeValue = serviceContainer.getAttribute(\r\n    scheduleServiceIdAttributeName,\r\n  );\r\n  if (serviceIdAttributeValue === null) {\r\n    return undefined;\r\n  }\r\n\r\n  var serviceId = parseInt(serviceIdAttributeValue);\r\n  if (isNaN(serviceId)) {\r\n    return undefined;\r\n  } else {\r\n    return serviceId;\r\n  }\r\n}\r\n","import {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { Entity } from 'types/common';\r\n\r\nconst url = '/api/odata/v4/InvoiceTemplateFilter';\r\nexport interface InvoiceTemplatePickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url'> {}\r\n\r\nexport const InvoiceTemplatePicker = (props: InvoiceTemplatePickerProps) => {\r\n  return (\r\n    <BaseURLPicker url={url} {...props} id={props.id || 'InvoiceTemplateId'} />\r\n  );\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { InvoiceDetailActions as actions } from '.';\r\n\r\nexport function* doGetInvoice(action: PayloadAction<number>) {\r\n  yield put(actions.setLoading(true));\r\n  try {\r\n    const invoice = yield call(\r\n      httpClient.get,\r\n      '/api/odata/v4/InvoiceDetails(' + action.payload + ')',\r\n      {\r\n        $expand: 'ServiceGroups',\r\n      },\r\n    );\r\n    yield put(actions.setInvoice(invoice));\r\n    yield put(actions.setLoading(false));\r\n  } catch {\r\n    yield put(actions.notFound());\r\n  }\r\n}\r\n\r\nexport function* InvoiceDetailsSaga() {\r\n  yield takeLatest(actions.getInvoice.type, doGetInvoice);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { IInvoice } from '../ReadOnly/IInvoice';\r\nimport { InvoiceDetailsSaga } from './saga';\r\nimport { InvoiceDetailsState } from './type';\r\n\r\nexport const initialState: InvoiceDetailsState = {\r\n  loading: false,\r\n  notFound: false,\r\n  invoice: null,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'InvoiceDetails',\r\n  initialState,\r\n  reducers: {\r\n    setLoading(state, action: PayloadAction<boolean>) {\r\n      state.loading = action.payload;\r\n    },\r\n    notFound(state, action: PayloadAction) {\r\n      state.notFound = true;\r\n    },\r\n    setFilters(state, action: PayloadAction<Record<string, any> | undefined>) {\r\n      state.filters = action.payload;\r\n    },\r\n    setInvoice(state, action: PayloadAction<IInvoice>) {\r\n      state.invoice = action.payload;\r\n    },\r\n    getInvoice(state, action: PayloadAction<number>) {},\r\n    reset(state, action: PayloadAction) {\r\n      state.filters = undefined;\r\n      state.notFound = false;\r\n      state.loading = false;\r\n      state.invoice = null;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: InvoiceDetailActions } = slice;\r\n\r\nexport const useInvoiceDetailsSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: InvoiceDetailsSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => {\r\n  return state.InvoiceDetails || initialState;\r\n};\r\n\r\nexport const selectLoading = createSelector(\r\n  [selectSlice],\r\n  state => state.loading,\r\n);\r\nexport const selectNotFound = createSelector(\r\n  [selectSlice],\r\n  state => state.notFound,\r\n);\r\nexport const selectActiveFilters = createSelector(\r\n  [selectSlice],\r\n  state => state.filters,\r\n);\r\nexport const selectInvoice = createSelector(\r\n  [selectSlice],\r\n  state => state.invoice,\r\n);\r\n","import { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useMemo } from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { useAbsolute } from 'utils/url-utils';\r\nimport { selectInvoice } from '../Slice/selector';\r\nimport { Comments } from 'app/components/Comments';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\n\r\nexport const InvoiceComments = () => {\r\n  const invoice = useSelector(selectInvoice);\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const isAdmin = useMemo(() => {\r\n    return authenticatedUser?.Roles.includes(Roles.Administrators);\r\n  }, [authenticatedUser]);\r\n  const referenceId = invoice?.Id;\r\n  const link = useAbsolute(`Invoices/Details/${referenceId}`);\r\n  if (isAdmin === undefined || referenceId === undefined) {\r\n    return null;\r\n  }\r\n  return (\r\n    <Comments\r\n      commentType={CommentReferenceTypes.Invoice}\r\n      referenceId={referenceId}\r\n      isAdmin={isAdmin}\r\n      link={link}\r\n      onCommentAdded={onCommentAdded}\r\n    />\r\n  );\r\n};\r\n","import { makeStyles } from '@material-ui/core';\r\n\r\nexport const useStyles = makeStyles(theme => ({\r\n  base: {\r\n    border: `solid 1px ${theme.palette.divider}`,\r\n    borderRadius: '6px',\r\n    padding: 'inherit',\r\n    display: 'flex',\r\n    justifyContent: 'flex-start',\r\n    alignItems: 'center',\r\n    gap: '10px',\r\n  },\r\n}));\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BasicDialog } from 'app/components/BasicDialog';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { InvoiceStatuses } from 'enums/InvoiceStatuses';\r\nimport { Form, Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport { uniqueId } from 'lodash';\r\nimport { useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectInvoice } from '../Slice/selector';\r\nimport { useStyles } from './styles';\r\nimport * as yup from 'yup';\r\nimport { removeHtml } from 'utils/string-utils';\r\nimport { CommentsApi } from 'api/CommentsApi';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { InvoiceDetailsUrl } from '..';\r\nimport { useInvoiceDetailsSlice } from '../Slice';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { Body } from 'app/components/Typography';\r\n\r\nexport const InvoiceInReview = () => {\r\n  const invoice = useSelector(selectInvoice);\r\n  const { actions } = useInvoiceDetailsSlice();\r\n  const { actions: notifActions } = useAppSettingsSlice();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const dispatch = useDispatch();\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const [open, setOpen] = useState(false);\r\n  const submitForm = useRef<any>();\r\n  if (!invoice || invoice.StatusId !== InvoiceStatuses.SentToReview)\r\n    return <></>;\r\n  const admin =\r\n    authenticatedUser?.Roles.includes(Roles.Administrators) ||\r\n    (authenticatedUser?.Roles.includes(Roles.GroupAdministrators) &&\r\n      authenticatedUser.UserGroups.some(g => g.Id === invoice.UserGroupId));\r\n  const schema: yup.SchemaOf<{ Text: string }> = yup.object({\r\n    Text: yup\r\n      .string()\r\n      .test({\r\n        name: 'not empty p',\r\n        test: s => s !== undefined && removeHtml(s).trim() !== '',\r\n        message: 'Text is required',\r\n      })\r\n      .required(),\r\n  });\r\n\r\n  return (\r\n    <Box className={classes.base}>\r\n      <Body>{t(translations.InvoiceInReviewMessage)}</Body>\r\n      {admin && (\r\n        <>\r\n          <Button\r\n            onClick={() => {\r\n              httpClient\r\n                .post(InvoiceDetailsUrl + '/UpdateStatus', {\r\n                  status: InvoiceStatuses.ReviewApproved,\r\n                  id: invoice.Id,\r\n                })\r\n                .then(() => {\r\n                  dispatch(actions.getInvoice(invoice.Id));\r\n                  dispatch(\r\n                    notifActions.addNotification({\r\n                      variant: 'success',\r\n                      message: t(translations.InvoiceApprovedMsg),\r\n                    }),\r\n                  );\r\n                })\r\n                .catch(e => console.log(e));\r\n            }}\r\n            size=\"small\"\r\n            variant=\"white\"\r\n          >\r\n            {t(translations.Approve)}\r\n          </Button>\r\n          <Button onClick={() => setOpen(true)} size=\"small\" variant=\"danger\">\r\n            {t(translations.Reject)}\r\n          </Button>\r\n          <BasicDialog\r\n            title={t(translations.EnterInvoiceRejectReason)}\r\n            body={\r\n              <Formik\r\n                initialValues={{ Text: undefined }}\r\n                onSubmit={value => {\r\n                  CommentsApi.SendComment(\r\n                    CommentReferenceTypes.Invoice,\r\n                    invoice.Id,\r\n                    {\r\n                      Text:\r\n                        t(translations.InvoiceRejectReasonPrefix) + value.Text,\r\n                    },\r\n                  )\r\n                    .then(() => {\r\n                      httpClient\r\n                        .post(InvoiceDetailsUrl + '/UpdateStatus', {\r\n                          status: InvoiceStatuses.ReviewRejected,\r\n                          id: invoice.Id,\r\n                        })\r\n                        .then(() => {\r\n                          dispatch(actions.getInvoice(invoice.Id));\r\n                        })\r\n                        .catch(e => console.log(e));\r\n                    })\r\n                    .catch(console.error);\r\n                  setOpen(false);\r\n                }}\r\n                validationSchema={schema}\r\n              >\r\n                {formik => {\r\n                  submitForm.current = formik.submitForm;\r\n                  return (\r\n                    <Form onSubmit={formik.handleSubmit}>\r\n                      <FormRow fullRow>\r\n                        <FormRichTextField fullWidth autoFocus name=\"Text\" />\r\n                      </FormRow>\r\n                    </Form>\r\n                  );\r\n                }}\r\n              </Formik>\r\n            }\r\n            id={uniqueId()}\r\n            isopen={open}\r\n            onClose={() => setOpen(false)}\r\n            onCancel={() => setOpen(false)}\r\n            leftActions={[\r\n              () => (\r\n                <Button onClick={() => submitForm.current()}>\r\n                  {t(translations.Reject)}\r\n                </Button>\r\n              ),\r\n            ]}\r\n            rightActions={[\r\n              () => (\r\n                <Button onClick={() => setOpen(false)}>\r\n                  {t(translations.Cancel)}\r\n                </Button>\r\n              ),\r\n            ]}\r\n          />\r\n        </>\r\n      )}\r\n    </Box>\r\n  );\r\n};\r\n","import { makeStyles, Theme } from '@material-ui/core';\r\n\r\nexport const useStyles = makeStyles((theme: Theme) => ({\r\n  base: {\r\n    paddingInline: theme.spacing(2),\r\n  },\r\n}));\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { RichTextEditor } from 'app/components/RichTextEditor';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useStyles } from '../ReadOnly/styles';\r\nimport { selectInvoice } from '../Slice/selector';\r\nconst url = '/api/odata/v4/InvoiceDetails';\r\nexport const InvoiceRemarks = () => {\r\n  const classes = useStyles();\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n\r\n  const invoice = useSelector(selectInvoice);\r\n  const [remarks, setRemarks] = useState(invoice?.Remarks);\r\n  if (!invoice) return null;\r\n  const updateRemarks = () => {\r\n    httpClient\r\n      .patch(url + '(' + invoice.Id + ')', { Remarks: remarks })\r\n      .then(() =>\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'success',\r\n            message: t(translations.UpdatedOK),\r\n          }),\r\n        ),\r\n      )\r\n      .catch(e =>\r\n        dispatch(\r\n          actions.addNotification({\r\n            variant: 'error',\r\n            message: t(translations.UpdateFailed),\r\n          }),\r\n        ),\r\n      );\r\n  };\r\n  return (\r\n    <Box padding={3} component=\"div\" className={classes.base}>\r\n      <Body bold={true}>{t(translations.Remarks)}</Body>\r\n      <RichTextEditor onChange={setRemarks} value={remarks} />\r\n      <br />\r\n      <Button onClick={updateRemarks}>{t(translations.Update)}</Button>\r\n    </Box>\r\n  );\r\n};\r\n","import { Grid } from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React, { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectInvoice } from '../Slice/selector';\r\nimport { getRows } from './Rows';\r\nimport { useStyles } from './styles';\r\n\r\nexport interface InvoiceReadOnlyProps {\r\n  id: number;\r\n  openChangeStatus?: () => void;\r\n  openChangeInvoiceTemplate?: () => void;\r\n}\r\nexport const ReadOnlyDetails = (props: InvoiceReadOnlyProps) => {\r\n  const { id, openChangeStatus, openChangeInvoiceTemplate } = props;\r\n  const { t } = useTranslation();\r\n  const invoice = useSelector(selectInvoice);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const rows = useMemo(\r\n    () => getRows(t, settings, openChangeStatus, openChangeInvoiceTemplate),\r\n    [openChangeStatus, openChangeInvoiceTemplate, settings, t],\r\n  );\r\n  const classes = useStyles();\r\n\r\n  if (!invoice) {\r\n    return <>{t(translations.InvoiceNotFound).replace('{0}', id.toString())}</>;\r\n  }\r\n\r\n  return (\r\n    <Box component=\"div\" className={classes.base}>\r\n      <Grid\r\n        container\r\n        direction=\"row\"\r\n        justify=\"space-between\"\r\n        spacing={2}\r\n        wrap=\"wrap\"\r\n      >\r\n        {rows.map(r => {\r\n          const cell = r.Cell ?? (({ value }) => <>{value}</>);\r\n          const val = cell({ original: invoice, value: invoice[r.accessor] });\r\n          if (val) {\r\n            const header =\r\n              typeof r.Header === 'string'\r\n                ? () => (\r\n                    <Body size=\"small\" bold={true}>\r\n                      {r.Header}\r\n                    </Body>\r\n                  )\r\n                : r.Header;\r\n            return (\r\n              <Grid item key={r.accessor} xs={12} sm={4}>\r\n                <Grid\r\n                  container\r\n                  justify=\"center\"\r\n                  alignItems=\"center\"\r\n                  wrap=\"wrap\"\r\n                >\r\n                  {header && (\r\n                    <Grid item xs={6}>\r\n                      {header({\r\n                        original: invoice,\r\n                        value: invoice[r.accessor],\r\n                      })}\r\n                    </Grid>\r\n                  )}\r\n                  <Grid item xs={6}>\r\n                    {val}\r\n                  </Grid>\r\n                </Grid>\r\n              </Grid>\r\n            );\r\n          }\r\n          return undefined;\r\n        })}\r\n      </Grid>\r\n    </Box>\r\n  );\r\n};\r\n","import { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { DetailRowRenderer } from 'types/DetailRow';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { IInvoice } from './IInvoice';\r\n\r\nexport const getRows = (\r\n  t: TFunction,\r\n  settings: GlobalSettings,\r\n  openChangeStatus?: () => void,\r\n  openChangeInvoiceTemplate?: () => void,\r\n) => {\r\n  const currency = settings.GetString(AllowedSettings.ISOCurrencySymbol);\r\n  const res: DetailRowRenderer<IInvoice>[] = [\r\n    {\r\n      Header: t(translations.InvoiceId),\r\n      accessor: 'Id',\r\n    },\r\n    {\r\n      accessor: 'Amount',\r\n      Header: t(translations.Amount),\r\n      Cell: ({ value }) => <>{currency + (value ?? 0).toFixed(2)}</>,\r\n    },\r\n    {\r\n      accessor: 'Balance',\r\n      Header: t(translations.InvoiceBalance),\r\n      Cell: ({ value }) => <>{currency + (value ?? 0).toFixed(2)}</>,\r\n    },\r\n    {\r\n      accessor: 'ServiceGroups',\r\n      Header: t(translations.ServiceGroup),\r\n      Cell: ({ value }) => (\r\n        <Tooltip\r\n          title={\r\n            <ul>\r\n              {value.map(v => (\r\n                <li key={v.Id}>{v.Name}</li>\r\n              ))}\r\n            </ul>\r\n          }\r\n          arrow\r\n        >\r\n          <span>\r\n            {value\r\n              .slice(0, 3)\r\n              .map(v => v.Name)\r\n              .join(',')}\r\n            {value.length > 3 && <span>, {value.length - 3} more</span>}\r\n          </span>\r\n        </Tooltip>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'UserGroup',\r\n      Header: t(translations.UserGroup),\r\n      Cell: attrib => (\r\n        <>{!!attrib.original.UserGroupId ? attrib.value : t(translations.NA)}</>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'BudgetNumber',\r\n      Header: t(translations.BudgetNumber),\r\n      Cell: attrib => (\r\n        <>{!!attrib.original.BudgetId ? attrib.value : t(translations.NA)}</>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'StatusName',\r\n      Header: () => (\r\n        <>\r\n          {' '}\r\n          {t(translations.Status)}{' '}\r\n          {!!openChangeStatus ? (\r\n            <Icon icon=\"pencil\" onClick={openChangeStatus} />\r\n          ) : undefined}\r\n        </>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'CreatedBy',\r\n      Header: t(translations.CreatedBy),\r\n    },\r\n    {\r\n      accessor: 'CreatedAt',\r\n      Header: t(translations.CreatedAt),\r\n      Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)}</>,\r\n    },\r\n    {\r\n      accessor: 'InvoiceTemplateName',\r\n      Header: () => (\r\n        <>\r\n          {' '}\r\n          {t(translations.InvoiceTemplate)}{' '}\r\n          {!!openChangeInvoiceTemplate ? (\r\n            <Icon icon=\"pencil\" onClick={openChangeInvoiceTemplate} />\r\n          ) : undefined}\r\n        </>\r\n      ),\r\n      Cell: attrib => (\r\n        <>\r\n          {!!attrib.original.InvoiceTemplateId\r\n            ? attrib.value\r\n            : `Invoice #${attrib.original.Id} is missing a template`}\r\n        </>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'Start',\r\n      Header: t(translations.Period),\r\n      Cell: ({ original }) => (\r\n        <>\r\n          {dateUtils.shortDateFormat(original.Start)} -{' '}\r\n          {dateUtils.shortDateFormat(\r\n            dateUtils.addDays(dateUtils.dateOrStringToDate(original.End), -1),\r\n          )}\r\n        </>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'LastSentToBilling',\r\n      Header: t(translations.LastSentToBilling),\r\n      Cell: ({ value }) => (\r\n        <>\r\n          {!!value ? dateUtils.shortDateTimeFormat(value) : t(translations.NA)}\r\n        </>\r\n      ),\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport UserRenderer from 'app/components/BasicTable/CellRenderers/UserRenderer';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { PriceSheetBy } from 'enums/enums';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport {\r\n  AppSettings,\r\n  IsBudgetFieldEnabled,\r\n  IsModuleEnabled,\r\n} from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { IInvoiceRow } from './IInvoicRow';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { InvoiceRowReferenceLinks } from 'app/components/InvoiceRowReferenceLinks';\r\n\r\nconst hasSubRows = row => {\r\n  return !!row.original.Rows && row.original.Rows.length > 1;\r\n};\r\n\r\nexport const getColumns = (\r\n  t: TFunction,\r\n  settings: GlobalSettings,\r\n  appsettings: AppSettings | null,\r\n  openEdit?: (id: number) => void,\r\n  useSidePanel?: boolean,\r\n) => {\r\n  const currency = settings.GetString(AllowedSettings.ISOCurrencySymbol);\r\n  const cols: (Column<IInvoiceRow> & { invisible?: boolean })[] = [\r\n    {\r\n      accessor: 'Id',\r\n      Header: t(translations.HashSymbol) as string,\r\n      Cell: ({ value }) => {\r\n        return !openEdit ? (\r\n          <>{value}</>\r\n        ) : (\r\n          <MuiLink onClick={() => openEdit(value)}>{value}</MuiLink>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      accessor: 'BudgetCat',\r\n      Header: t(translations.BudgetCat) as string,\r\n      invisible:\r\n        !IsModuleEnabled(appsettings, KnownModules.BudgetCats) &&\r\n        settings.TryGet('PriceSheetBy') !== null &&\r\n        parseInt(\r\n          settings.TryGet('PriceSheetBy') ??\r\n            PriceSheetBy.InstrumentsAndServices.toString(),\r\n        ) === PriceSheetBy.InstrumentsAndServices,\r\n    },\r\n    {\r\n      accessor: 'Budget',\r\n      Header: t(translations.Budget) as string,\r\n      invisible: !IsModuleEnabled(appsettings, KnownModules.Budgets),\r\n    },\r\n    {\r\n      Header: t(translations.PurchaseOrder) as string,\r\n      accessor: 'PurchaseOrder',\r\n    },\r\n    {\r\n      accessor: 'Task',\r\n      Header: t(translations.Task) as string,\r\n      invisible: !IsModuleEnabled(appsettings, KnownModules.BudgetExperiments),\r\n    },\r\n    {\r\n      accessor: 'Experiment',\r\n      Header: t(translations.Experiment) as string,\r\n      invisible: !IsModuleEnabled(appsettings, KnownModules.BudgetExperiments),\r\n    },\r\n    {\r\n      accessor: 'User',\r\n      Header: t(translations.User) as string,\r\n      Cell: UserRenderer,\r\n    },\r\n    {\r\n      accessor: 'InstrumentCat',\r\n      Header: t(translations.InstrumentCat) as string,\r\n      invisible:\r\n        parseInt(\r\n          settings.TryGet('PriceSheetBy') ??\r\n            PriceSheetBy.InstrumentsAndServices.toString(),\r\n        ) === PriceSheetBy.InstrumentsAndServices,\r\n    },\r\n    {\r\n      accessor: 'EquipmentService',\r\n      Header: t(translations.EquipmentService) as string,\r\n    },\r\n    /*     {\r\n      accessor: 'OnlineService',\r\n      Header: t(translations.EquipmentService) as string,\r\n      Cell: ({ row }) => {\r\n        const vals = [\r\n          row.original.OnlineService,\r\n          row.original.SampleService,\r\n          row.original.OfflineServiceType,\r\n          row.original.AccService,\r\n          row.original.SubscriptionName,\r\n        ];\r\n        if (\r\n          !!row.original.ServiceRequestMilestoneChargeId &&\r\n          !row.original.OfflineServiceType\r\n        ) {\r\n          vals.push(t(translations.Charges) as string);\r\n        }\r\n        return vals.filter(v => !!v).join(' - ');\r\n      },\r\n    }, */\r\n    {\r\n      accessor: 'Date',\r\n      Header: t(translations.Date) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'CatRateType',\r\n      Header: t(translations.FeeType) as string,\r\n      Cell: ({ row, value }) => {\r\n        if (hasSubRows(row)) return <>{t(translations.Mixed)}</>;\r\n        return (\r\n          <>\r\n            {value +\r\n              (!!row.original.TimeSlotType\r\n                ? '(' + row.original.TimeSlotType + ')'\r\n                : '')}\r\n          </>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      accessor: 'Quantity',\r\n      Header: t(translations.Quantity) as string,\r\n      Cell: ({ row, value }) => {\r\n        if (hasSubRows(row)) return <>{t(translations.Mixed)}</>;\r\n        return <>{value}</>;\r\n      },\r\n    },\r\n    {\r\n      accessor: 'Units',\r\n      Header: t(translations.Units) as string,\r\n      Cell: ({ row, value }) => {\r\n        if (hasSubRows(row)) return <>{t(translations.Mixed)}</>;\r\n        return <>{value}</>;\r\n      },\r\n    },\r\n    {\r\n      accessor: 'BaseRate',\r\n      Header: t(translations.BaseRate) as string,\r\n      Cell: ({ value, row }) => {\r\n        if (hasSubRows(row)) return <>{t(translations.Mixed)}</>;\r\n        return <>{currency + (value ?? 0).toFixed(2)}</>;\r\n      },\r\n    },\r\n    {\r\n      accessor: 'SubsProfPercentage',\r\n      Header: t(translations.SubsProfPercentage) as string,\r\n      Cell: ({ value, row }) => {\r\n        if (hasSubRows(row)) {\r\n          return t(translations.Mixed);\r\n        } else if (value === null || value === undefined) {\r\n          return t(translations.NA);\r\n        } else {\r\n          return value.toFixed(2) + '%';\r\n        }\r\n      },\r\n      invisible: !IsBudgetFieldEnabled(appsettings, BudgetFields.SubsidyProfit),\r\n    },\r\n    {\r\n      accessor: 'ActualRate',\r\n      Header: t(translations.ActualRate) as string,\r\n      Cell: ({ value, row }) => {\r\n        if (hasSubRows(row)) return <>{t(translations.Mixed)}</>;\r\n        return <>{currency + (value ?? 0).toFixed(2)}</>;\r\n      },\r\n      invisible: !IsBudgetFieldEnabled(appsettings, BudgetFields.SubsidyProfit),\r\n    },\r\n    {\r\n      accessor: 'Amount',\r\n      Header: t(translations.Amount) as string,\r\n      Cell: ({ value }) => <>{currency + (value ?? 0).toFixed(2)}</>,\r\n    },\r\n    {\r\n      accessor: 'InsertedAt',\r\n      Header: (\r\n        <Tooltip title={t(translations.RelevantToManualCharges)}>\r\n          <span>{t(translations.InsertedAt)}</span>\r\n        </Tooltip>\r\n      ),\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'InsertedBy',\r\n      Header: (\r\n        <Tooltip title={t(translations.RelevantToManualCharges)}>\r\n          <span>{t(translations.InsertedBy)}</span>\r\n        </Tooltip>\r\n      ),\r\n      Cell: ({ value, row }) => {\r\n        if (value && row.original.InsertedBy) {\r\n          return (\r\n            <>\r\n              <UserProfileLink\r\n                UserId={`${row.original.InsertedBy}`}\r\n                DisplayName={`${row.original.InsertedByDisplay}`}\r\n              />\r\n            </>\r\n          );\r\n        }\r\n        return <>{value}</>;\r\n      },\r\n    },\r\n    {\r\n      accessor: 'ServiceGroupName',\r\n      Header: (\r\n        <Tooltip title={t(translations.RelevantToManualCharges)}>\r\n          <span>{t(translations.ServiceGroup)}</span>\r\n        </Tooltip>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'ReservationId',\r\n      Header: t(translations.Reference) as string,\r\n      // Cell:  InvoiceRowReferenceRenderer,\r\n      Cell: ({ value, row }) => (\r\n        <InvoiceRowReferenceLinks\r\n          OfflineServiceId={row.original.OfflineServiceId ?? null}\r\n          ReservationId={row.original.ReservationId ?? null}\r\n          ServiceRequestId={row.original.ServiceRequestId ?? null}\r\n          SubscriptionId={row.original.SubscriptionId ?? null}\r\n          UsageId={row.original.UsageId ?? null}\r\n          useSidePanel={useSidePanel ?? false}\r\n        />\r\n      ),\r\n    },\r\n    {\r\n      Header: t(translations.Remarks) as string,\r\n      accessor: 'Remarks',\r\n      Cell: DescriptionCell({ width: 'medium' }),\r\n    },\r\n  ];\r\n  return cols.filter(v => !v.invisible) as Column<IInvoiceRow>[];\r\n};\r\n","import { SampleTypePicker } from 'app/components/pickers/AutocompletePickers/SampleTypePicker.index';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\n\r\nexport function SampleTypeFilter(props: IFilterComponentProps) {\r\n  const handleOnChange = (value: Entity<number> | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <SampleTypePicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      placeholder={t(translations.AllValues)}\r\n      isOpen={props.open}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      size=\"small\"\r\n    />\r\n  );\r\n}\r\n","import { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { SampleTypeFilter } from 'app/components/BasicTable/Filters/SampleTypeFilter';\r\nimport ServiceFilter from 'app/components/BasicTable/Filters/ServiceFilter';\r\nimport ServiceGroupFilter from 'app/components/BasicTable/Filters/ServiceGroupFilter';\r\nimport ServiceTypeFilter from 'app/components/BasicTable/Filters/ServiceTypeFilter';\r\nimport UserFilter from 'app/components/BasicTable/Filters/UserFilter';\r\nimport {\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  getDefaultFilterDatePeriod,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  GetStringOrUndefined,\r\n  initExPickerValue,\r\n  initPickerValue,\r\n  presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { initSampleTypeData } from 'app/components/pickers/AutocompletePickers/SampleTypePicker.index';\r\nimport { initServiceTypeData } from 'app/components/pickers/AutocompletePickers/ServiceTypePicker';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { initOnlineServicesData } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { initServiceGroupsData } from 'app/components/pickers/ServiceGroupPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IInvoiceRow } from './Details/IInvoicRow';\r\n\r\nexport const GetFilters: GetPageFilters<IInvoiceRow> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const res: IFilterSettings<IInvoiceRow>[] = [\r\n    {\r\n      displayName: t(translations.ServiceGroup),\r\n      queryStringSerializer: 'sgid',\r\n      fieldName: 'ServiceGroupId',\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'sgid')),\r\n      ),\r\n      component: ServiceGroupFilter,\r\n      initData: initExPickerValue(initServiceGroupsData),\r\n    },\r\n    {\r\n      fieldName: 'OnlineServiceId',\r\n      queryStringSerializer: 'osid',\r\n      displayName: t(translations.OnlineService),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'osid')),\r\n      ),\r\n      component: ServiceFilter,\r\n      initData: initPickerValue(initOnlineServicesData),\r\n    },\r\n    {\r\n      fieldName: 'OfflineServiceTypeId',\r\n      queryStringSerializer: 'ostid',\r\n      displayName: t(translations.OfflineServiceType),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'ostid')),\r\n      ),\r\n      component: ServiceTypeFilter,\r\n      initData: initPickerValue(initServiceTypeData),\r\n    },\r\n    {\r\n      fieldName: 'SampleServiceId',\r\n      queryStringSerializer: 'ssid',\r\n      displayName: t(translations.SampleType),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'ssid')),\r\n      ),\r\n      component: SampleTypeFilter,\r\n      initData: initPickerValue(initSampleTypeData),\r\n    },\r\n    {\r\n      fieldName: 'UserId',\r\n      queryStringSerializer: 'user',\r\n      displayName: t(translations.User),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'user')),\r\n      ),\r\n      component: UserFilter,\r\n      initData: initPickerValue(initUserData),\r\n    },\r\n    {\r\n      fieldName: 'Date',\r\n      displayName: t(translations.RG_DatePeriod),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      urlKey: 'period',\r\n    },\r\n    {\r\n      fieldName: 'Amount',\r\n      displayName: t(translations.ShowZeroAmountRows),\r\n      queryStringSerializer: 'showZeroAmountRows',\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'showZeroAmountRows')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n      customFilter: (value, setting) => {\r\n        if (!!value && value['Id'] === true) {\r\n          return 'true';\r\n        }\r\n        return new Condition(\r\n          setting.fieldName,\r\n          ODataOperators.NotEquals,\r\n          0,\r\n        ).toString();\r\n      },\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { toQueryString } from 'utils/url-utils';\r\n\r\nexport const getDefaultFilter = () => {\r\n  const result = toQueryString({\r\n    showZeroAmountRows: false,\r\n  });\r\n  return result;\r\n};\r\n","import * as React from 'react';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { IInvoiceRow } from './IInvoicRow';\r\n// import { UnconfigurableTable } from '../UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from '../Filter';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport {\r\n  RowActionsMenu,\r\n  RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IPathAndQuery } from 'utils/url-utils';\r\nimport { BudgetPicker } from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { BasicTable } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { selectInvoice } from '../../Slice/selector';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { getDefaultFilter } from './getDefaultFilters';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\n\r\nexport interface InvoiceDetailsTableProps {\r\n  isSidePanel?: boolean;\r\n  id: number;\r\n  setFilters?: (\r\n    appliedFilters: IFilterSettings<IInvoiceRow>[] | undefined,\r\n  ) => void;\r\n  OpenEditRow?: (rowId: number) => void;\r\n}\r\nconst url = '/api/odata/v4/InvoiceRows';\r\nconst groupedUrl = '/api/odata/v4/GroupedInvoiceRows';\r\nexport const DetailsTable = ({\r\n  isSidePanel,\r\n  id,\r\n  setFilters,\r\n  OpenEditRow,\r\n}: InvoiceDetailsTableProps) => {\r\n  const TTable = useMemo(\r\n    () =>\r\n      filterHandler<IInvoiceRow, {}>(BasicTable, GetFilters, {\r\n        isSidePanel,\r\n        setFilters,\r\n        getDefaultFilter,\r\n        reservedQueryStringParameterNames: ['id', 'invoiceId'],\r\n      }),\r\n    [isSidePanel, setFilters],\r\n  );\r\n  const invoice = useSelector(selectInvoice);\r\n  const [budget, setBudget] = React.useState<Entity<number> | null>(null);\r\n\r\n  // const rowActions: CellRenderer<IInvoiceRow>[] = [\r\n  //   !!OpenEditRow\r\n  //     ? ({ row: { original } }) => (\r\n  //         <ReactActions\r\n  //           id=\"invoiceRow_RowsActions\"\r\n  //           items={[\r\n  //             <IconButton\r\n  //               variant=\"ghost\"\r\n  //               size=\"small\"\r\n  //               shape=\"square\"\r\n  //               onClick={() => OpenEditRow(original.Id)}\r\n  //             >\r\n  //               <Tooltip title={t(translations.EditInvoiceLine)}>\r\n  //                 <Icon icon=\"pencil\" />\r\n  //               </Tooltip>\r\n  //             </IconButton>,\r\n  //           ]}\r\n  //         />\r\n  //       )\r\n  //     : undefined,\r\n  // ].filter(v => !!v) as CellRenderer<IInvoiceRow>[];\r\n  const { t } = useTranslation();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const columns = useMemo(() => {\r\n    return getColumns(t, settings, appSettings, OpenEditRow, isSidePanel);\r\n  }, [OpenEditRow, appSettings, isSidePanel, settings, t]);\r\n  const rowActions: CellRenderer<IInvoiceRow>[] = useMemo<\r\n    CellRenderer<IInvoiceRow>[]\r\n  >(\r\n    () => [\r\n      ({ row }) => {\r\n        const items: RowActionsProps[] = [];\r\n        if (!!OpenEditRow) {\r\n          items.push({\r\n            onClick: () => {\r\n              OpenEditRow(row.original.Id);\r\n            },\r\n            text: t(translations.Edit) as string,\r\n            title: t(translations.EditInvoiceLine) as string,\r\n            icon: 'pencil-alt',\r\n          } as RowActionsProps);\r\n        }\r\n\r\n        if (items.length > 0) {\r\n          return (\r\n            <RowActionsMenu\r\n              id={`invoiceRow_RowsActions${row.original.Id}`}\r\n              items={items}\r\n            />\r\n          );\r\n        } else {\r\n          return undefined;\r\n        }\r\n      },\r\n    ],\r\n    [OpenEditRow, t],\r\n  );\r\n  const selectedRowActions: SelectedRowsActionRenderer<IInvoiceRow>[] = useMemo(\r\n    () => [\r\n      (rows, onRefresh) => (\r\n        <SelectedRowsActionIconButton\r\n          rows={rows}\r\n          onRefresh={onRefresh}\r\n          title={t(translations.DeletInvoiceRows)}\r\n          confirm\r\n          validConfirm\r\n          confirmTitle={t(translations.ConfirmDeleting)}\r\n          confirmBody={t(translations.deleteInvoiceConfirmMessage)}\r\n          confirmButtonLabel={t(translations.Delete)}\r\n          action={async () =>\r\n            await httpClient.post(url + '/DeleteMany', {\r\n              invoiceId: id,\r\n              ids: rows.map(v => v.Id),\r\n            })\r\n          }\r\n        />\r\n      ),\r\n      (rows, onRefresh, toggleAll) => (\r\n        <SelectedRowsActionIconButton\r\n          rows={rows}\r\n          onRefresh={onRefresh}\r\n          title={\r\n            invoice?.StatusId === 4\r\n              ? t(translations.InvoicePaid)\r\n              : t(translations.EditBudgetInvoiceRows)\r\n          }\r\n          text={t(translations.EditBudgetInvoiceRows)}\r\n          disabled={invoice?.StatusId === 4}\r\n          confirm\r\n          confirmBody={\r\n            <BudgetPicker\r\n              label={t(translations.PleaseSelectABudgetNumber)}\r\n              value={budget as IBudgetFilterDto}\r\n              onChange={val => setBudget(val)}\r\n              variant=\"filled\"\r\n              fullWidth\r\n              predicates={[\r\n                invoice?.UserGroupId\r\n                  ? new Condition(\r\n                      'UserGroupId',\r\n                      ODataOperators.Equals,\r\n                      invoice.UserGroupId,\r\n                    )\r\n                  : '',\r\n                new Condition('Active', ODataOperators.Equals, true),\r\n                invoice?.ServiceGroups\r\n                  ? '(' +\r\n                    new Condition(\r\n                      'ServiceGroupServicesAllowed',\r\n                      ODataOperators.Equals,\r\n                      true,\r\n                    ).toString() +\r\n                    ' or ' +\r\n                    new Condition(\r\n                      'ServiceGroupIds',\r\n                      ODataOperators.AnyIn,\r\n                      invoice.ServiceGroups,\r\n                    ).toString() +\r\n                    ')'\r\n                  : '',\r\n              ]}\r\n            />\r\n          }\r\n          confirmTitle={\r\n            <>\r\n              {t(translations.EditBudgetInvoiceRows)}&nbsp;\r\n              <Tooltip\r\n                title={t(translations.EditBudgetInvoiceRows_info) as string}\r\n              >\r\n                <Icon color=\"filters\" colorExtend=\"light\" icon=\"info-circle\" />\r\n              </Tooltip>\r\n            </>\r\n          }\r\n          confirmButtonLabel={t(translations.Change)}\r\n          validConfirm={!!budget}\r\n          action={async () => {\r\n            setBudget(null);\r\n            toggleAll(false);\r\n            return await httpClient.post(url + '/UpdateBudget', {\r\n              invoiceId: id,\r\n              ids: rows.map(v => v.Id),\r\n              budgetId: budget?.Id ?? 0,\r\n            });\r\n          }}\r\n        />\r\n      ),\r\n    ],\r\n    [budget, id, invoice, t],\r\n  );\r\n  /**\r\n   * Each row in the table should have a unique Id including the parent and sub rows.\r\n   * InvoiceId (Id) can be used on subrows as they are unique, for parent grouped row the grouping key can be used as a unique id provided the goruping is done on exact the same columns\r\n   */\r\n  const getRowId = React.useCallback(\r\n    (row: IInvoiceRow) =>\r\n      row.Rows !== undefined && row.Rows.length > 1\r\n        ? [\r\n            row.ReferenceId,\r\n            row.User,\r\n            row.UserId,\r\n            row.OnlineService,\r\n            row.OnlineServiceId,\r\n            row.SampleService,\r\n            row.SampleServiceId,\r\n            row.SubscriptionId,\r\n            row.SubscriptionName,\r\n          ].join('.')\r\n        : String(row.Id),\r\n    [],\r\n  );\r\n  const [isGrouped, setIsGrouped] = React.useState(false);\r\n  const api: IPathAndQuery = isGrouped\r\n    ? {\r\n        path: groupedUrl,\r\n        search: {\r\n          Id: id,\r\n          $expand:\r\n            'Rows($select=' +\r\n            [\r\n              ...columns\r\n                ?.filter(c => typeof c.accessor === 'string')\r\n                ?.filter(c => c.accessor !== undefined)\r\n                ?.map(c => c.accessor as keyof IInvoiceRow),\r\n              ...[\r\n                'UserId',\r\n                'SampleService',\r\n                'OfflineServiceType',\r\n                'AccService',\r\n                'SubscriptionName',\r\n                'ServiceRequestMilestoneChargeId',\r\n                'TimeSlotType',\r\n                'ReservationId',\r\n                'OfflineServiceId',\r\n                'ServiceRequestId',\r\n                'UsageId',\r\n                'SubscriptionId',\r\n              ],\r\n            ].join(',') +\r\n            ')',\r\n        },\r\n      }\r\n    : {\r\n        path: url,\r\n        search: {\r\n          Id: id,\r\n        },\r\n      };\r\n\r\n  return (\r\n    <TTable\r\n      screenId={ScreensId.InvoiceCharges}\r\n      api={api}\r\n      columns={columns}\r\n      screenName={t(translations.menu_InvoiceCharges)}\r\n      serviceGroups={[]}\r\n      getRowId={getRowId}\r\n      rowActions={rowActions.length > 0 ? rowActions : undefined}\r\n      selectedRowsActions={selectedRowActions}\r\n      pageActions={[\r\n        () => (\r\n          <ReactActions\r\n            id=\"charges_top_buttons\"\r\n            items={[\r\n              <React.Fragment key=\"group_by_reference\">\r\n                <Button\r\n                  onClick={() => setIsGrouped(v => !v)}\r\n                  title={t(translations.GroupByReferenceDescription)}\r\n                  variant=\"ghost\"\r\n                  size=\"small\"\r\n                >\r\n                  {isGrouped\r\n                    ? t(translations.DoNotGroupByReference)\r\n                    : t(translations.GroupByReference)}\r\n                </Button>\r\n              </React.Fragment>,\r\n            ]}\r\n          />\r\n        ),\r\n      ]}\r\n      additionalColumns={[\r\n        'UserId',\r\n        'SampleService',\r\n        'OfflineServiceType',\r\n        'AccService',\r\n        'SubscriptionName',\r\n        'ServiceRequestMilestoneChargeId',\r\n        'TimeSlotType',\r\n        'ReservationId',\r\n        'OfflineServiceId',\r\n        'ServiceRequestId',\r\n        'UsageId',\r\n        'SubscriptionId',\r\n        'InsertedByDisplay',\r\n      ]}\r\n      useRowSelect\r\n      searchColumns={[\r\n        'Budget',\r\n        'OnlineService',\r\n        'OfflineServiceType',\r\n        'SampleService',\r\n        'CatRateType',\r\n        'TimeSlotType',\r\n        'User',\r\n        'cast(ReservationId,Edm.String)',\r\n        'cast(UsageId,Edm.String)',\r\n        'cast(OfflineServiceId,Edm.String)',\r\n        'cast(ServiceRequestId,Edm.String)',\r\n        'cast(Id,Edm.String)',\r\n      ]}\r\n    />\r\n  );\r\n};\r\n","import { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from './Filter';\r\nimport { IInvoiceHistory } from './IInvoiceHistory';\r\n\r\nexport interface InvoiceHistoryProps {\r\n  invoiceId: number;\r\n}\r\nexport const InvoiceHistory = ({ invoiceId }: InvoiceHistoryProps) => {\r\n  const { t } = useTranslation();\r\n  const columns = useMemo(() => getColumns(t), [t]);\r\n  const url = '/api/odata/v4/InvoiceHistory';\r\n  return (\r\n    <TTable\r\n      api={{ path: url, search: { invoiceId } }}\r\n      screenName={t(translations.History)}\r\n      columns={columns}\r\n      serviceGroups={[]}\r\n      additionalColumns={['Id']}\r\n      searchColumns={[\r\n        'FieldName',\r\n        'OldValue',\r\n        'cast(InvoiceId,Edm.String)',\r\n        'NewValue',\r\n        'DisplayName',\r\n      ]}\r\n    />\r\n  );\r\n};\r\n\r\nconst TTable = filterHandler<IInvoiceHistory, {}>(\r\n  UnconfigurableTable,\r\n  GetFilters,\r\n  {\r\n    isSidePanel: true,\r\n  },\r\n);\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IInvoiceHistory } from './IInvoiceHistory';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n  const res: Column<IInvoiceHistory>[] = [\r\n    {\r\n      accessor: 'InvoiceId',\r\n      Header: t(translations.HashSymbol) as string,\r\n    },\r\n    {\r\n      accessor: 'FieldName',\r\n      Header: t(translations.Field) as string,\r\n    },\r\n    {\r\n      accessor: 'OldValue',\r\n      Header: t(translations.OldValue) as string,\r\n    },\r\n    {\r\n      accessor: 'NewValue',\r\n      Header: t(translations.NewValue) as string,\r\n    },\r\n    {\r\n      accessor: 'DisplayName',\r\n      Header: t(translations.User) as string,\r\n    },\r\n    {\r\n      accessor: 'UpdatedAt',\r\n      Header: t(translations.Date) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport {\r\n  getDefaultFilterDatePeriod,\r\n  GetNumberOrUndefined,\r\n  GetRawValue,\r\n  presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IInvoiceHistory } from './IInvoiceHistory';\r\n\r\nexport const GetFilters: GetPageFilters<IInvoiceHistory> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const res: IFilterSettings<IInvoiceHistory>[] = [\r\n    {\r\n      fieldName: 'UpdatedAt',\r\n      displayName: t(translations.Period),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      urlKey: 'period',\r\n    },\r\n    {\r\n      fieldName: 'InvoiceId',\r\n      queryStringSerializer: 'rowId',\r\n      displayName: t(translations.InvoiceId),\r\n      operator: ODataOperators.Equals,\r\n      value: GetNumberOrUndefined(GetRawValue(params, 'rowId')),\r\n      component: NumberFieldFilter,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './columns';\r\nimport { GetFilters } from './Filter';\r\nimport { IPayHistory } from './IPayHistory';\r\n\r\nexport interface InvoicePayHistoryProps {\r\n  invoiceId: number;\r\n}\r\nexport const PayHistory = ({ invoiceId }: InvoicePayHistoryProps) => {\r\n  const { t } = useTranslation();\r\n  const columns = useMemo(() => getColumns(t), [t]);\r\n  const url = '/api/odata/v4/InvoicePayHistory';\r\n  return (\r\n    <TTable\r\n      api={{ path: url, search: { invoiceId } }}\r\n      screenName={t(translations.History)}\r\n      columns={columns}\r\n      serviceGroups={[]}\r\n      additionalColumns={['Id']}\r\n      searchColumns={[\r\n        'FieldName',\r\n        'OldValue',\r\n        'NewValue',\r\n        'DisplayName',\r\n        'cast(InvoicePaymentId,Edm.String)',\r\n      ]}\r\n    />\r\n  );\r\n};\r\n\r\nconst TTable = filterHandler<IPayHistory, {}>(UnconfigurableTable, GetFilters, {\r\n  isSidePanel: true,\r\n});\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { parse } from 'app/components/CommentsContainer/commentParser';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IPayHistory } from './IPayHistory';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n  const res: Column<IPayHistory>[] = [\r\n    {\r\n      accessor: 'InvoicePaymentId',\r\n      Header: t(translations.HashSymbol) as string,\r\n    },\r\n    {\r\n      accessor: 'FieldName',\r\n      Header: t(translations.Field) as string,\r\n    },\r\n    {\r\n      accessor: 'OldValue',\r\n      Header: t(translations.OldValue) as string,\r\n      Cell: ({ value }) => {\r\n        if (!value) return <></>;\r\n        return <span style={{ display: 'flex' }}> {parse(value)}</span>;\r\n      },\r\n    },\r\n    {\r\n      accessor: 'NewValue',\r\n      Header: t(translations.NewValue) as string,\r\n      Cell: ({ value }) => {\r\n        if (!value) return <></>;\r\n        return <span style={{ display: 'flex' }}> {parse(value)}</span>;\r\n      },\r\n    },\r\n    {\r\n      accessor: 'DisplayName',\r\n      Header: t(translations.User) as string,\r\n    },\r\n    {\r\n      accessor: 'UpdatedAt',\r\n      Header: t(translations.Date) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport {\r\n  getDefaultFilterDatePeriod,\r\n  GetNumberOrUndefined,\r\n  GetRawValue,\r\n  presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IPayHistory } from './IPayHistory';\r\n\r\nexport const GetFilters: GetPageFilters<IPayHistory> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const res: IFilterSettings<IPayHistory>[] = [\r\n    {\r\n      fieldName: 'UpdatedAt',\r\n      displayName: t(translations.Period),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      urlKey: 'period',\r\n    },\r\n    {\r\n      fieldName: 'InvoicePaymentId',\r\n      queryStringSerializer: 'payId',\r\n      displayName: t(translations.InvoiceRowId),\r\n      operator: ODataOperators.Equals,\r\n      value: GetNumberOrUndefined(GetRawValue(params, 'payId')),\r\n      component: NumberFieldFilter,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport {\r\n  RowActionsMenu,\r\n  RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { IInvoicePayment } from './IInvoicePayment';\r\n\r\nexport interface PaymentTableProps {\r\n  invoiceId: number;\r\n  isSidePanel: boolean;\r\n  pageActions?: PageActionRenderer[];\r\n  openEditPayment?: (payId: number) => void;\r\n}\r\nconst url = '/api/odata/v4/InvoicePayments';\r\nexport const PaymentTable = ({\r\n  invoiceId,\r\n  pageActions,\r\n  openEditPayment,\r\n}: PaymentTableProps) => {\r\n  const { t } = useTranslation();\r\n  const columns = useMemo(() => getColumns(t, openEditPayment), [\r\n    openEditPayment,\r\n    t,\r\n  ]);\r\n  const rowActions: CellRenderer<IInvoicePayment>[] = useMemo<\r\n    CellRenderer<IInvoicePayment>[]\r\n  >(\r\n    () => [\r\n      ({ row }) => {\r\n        const items: RowActionsProps[] = [];\r\n        if (!!openEditPayment) {\r\n          items.push({\r\n            onClick: () => {\r\n              openEditPayment(row.original.Id);\r\n            },\r\n            text: t(translations.Edit) as string,\r\n            title: t(translations.EditInvoicePayment) as string,\r\n            icon: 'pencil-alt',\r\n          } as RowActionsProps);\r\n        }\r\n\r\n        if (items.length > 0) {\r\n          return (\r\n            <RowActionsMenu\r\n              id={`invoiceRow_RowsActions${row.original.Id}`}\r\n              items={items}\r\n            />\r\n          );\r\n        } else {\r\n          return undefined;\r\n        }\r\n      },\r\n    ],\r\n    [openEditPayment, t],\r\n  );\r\n  const selectedRowActions: SelectedRowsActionRenderer<\r\n    IInvoicePayment\r\n  >[] = useMemo(\r\n    () => [\r\n      (rows, onRefresh) => (\r\n        <SelectedRowsActionIconButton\r\n          title={t(translations.Delete)}\r\n          confirm\r\n          validConfirm\r\n          confirmBody={t(translations.PaymentDeleteConfirm)}\r\n          cancelButtonLabel={t(translations.No)}\r\n          confirmButtonLabel={t(translations.Yes)}\r\n          onRefresh={onRefresh}\r\n          rows={rows}\r\n          action={async () => {\r\n            try {\r\n              await httpClient.post(url + '/DeleteMany', {\r\n                invoiceId,\r\n                ids: rows.map(v => v.Id),\r\n              });\r\n              return {\r\n                SuccessMessages: [t(translations.PaymentsDelete_success)],\r\n                ErrorMessages: [],\r\n                WarningMessages: [],\r\n              };\r\n            } catch {\r\n              return {\r\n                SuccessMessages: [],\r\n                WarningMessages: [],\r\n                ErrorMessages: [t(translations.PaymentsDelete_err)],\r\n              };\r\n            }\r\n          }}\r\n        />\r\n      ),\r\n    ],\r\n    [invoiceId, t],\r\n  );\r\n  return (\r\n    <UnconfigurableTable\r\n      screenName={t(translations.menu_InvoicePayments)}\r\n      columns={columns}\r\n      pageActions={pageActions}\r\n      api={{ path: url, search: { invoiceId } }}\r\n      serviceGroups={[]}\r\n      selectedRowsActions={selectedRowActions}\r\n      useRowSelect\r\n      rowActions={rowActions.length > 0 ? rowActions : undefined}\r\n      searchColumns={[\r\n        'CreatedByDN',\r\n        'CreatedBy',\r\n        'PaymentMethodName',\r\n        'Remarks',\r\n        'Reference',\r\n      ]}\r\n      additionalColumns={['CreatedBy']}\r\n      exportNotConfigurable={true}\r\n    />\r\n  );\r\n};\r\n","import parse from 'html-react-parser';\r\nimport DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IInvoicePayment } from './IInvoicePayment';\r\nimport { Link as MuiLink } from '@material-ui/core';\r\n\r\nexport const getColumns = (t: TFunction, openEdit?: (id: number) => void) => {\r\n  const res: Column<IInvoicePayment>[] = [\r\n    {\r\n      accessor: 'Id',\r\n      Header: t(translations.HashSymbol) as string,\r\n      Cell: ({ value }) => {\r\n        return !openEdit ? (\r\n          <>{value}</>\r\n        ) : (\r\n          <MuiLink onClick={() => openEdit(value)}>{value}</MuiLink>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      accessor: 'Date',\r\n      Header: t(translations.Date) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'Amount',\r\n      Header: t(translations.Amount) as string,\r\n      Cell: ({ value }) => <>{value.toFixed(2)}</>,\r\n    },\r\n    {\r\n      accessor: 'PaymentMethodName',\r\n      Header: t(translations.PaymentMethod) as string,\r\n    },\r\n    {\r\n      accessor: 'CreatedByDN',\r\n      Header: t(translations.CreatedBy) as string,\r\n      Cell: ({ row: { original }, value }) => (\r\n        <Link\r\n          href={'userprofile.aspx?id=' + original.CreatedBy}\r\n          target=\"_blank\"\r\n        >\r\n          {value}\r\n        </Link>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'CreatedAt',\r\n      Header: t(translations.CreatedAt) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      accessor: 'Remarks',\r\n      Header: t(translations.Remarks) as string,\r\n      Cell: ({ value }) => (!!value ? <>{parse(value)}</> : <></>),\r\n    },\r\n    {\r\n      accessor: 'Reference',\r\n      Header: t(translations.Reference) as string,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { translations } from 'locales/translations';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UnconfigurableTable } from '../../../../components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { getColumns } from './Columns';\r\nimport { GetFilters } from './Filter';\r\nimport { IRowHistory } from './IRowHistory';\r\n\r\nexport interface InvoiceRowHistoryProps {\r\n  invoiceId: number;\r\n}\r\nexport const RowHistory = ({ invoiceId }: InvoiceRowHistoryProps) => {\r\n  const { t } = useTranslation();\r\n  const columns = useMemo(() => getColumns(t), [t]);\r\n  const url = '/api/odata/v4/InvoiceRowHistory';\r\n  return (\r\n    <TTable\r\n      api={{ path: url, search: { invoiceId } }}\r\n      screenName={t(translations.History)}\r\n      columns={columns}\r\n      serviceGroups={[]}\r\n      additionalColumns={['Id']}\r\n      searchColumns={[\r\n        'FieldName',\r\n        'OldValue',\r\n        'cast(InvoiceRowId,Edm.String)',\r\n        'NewValue',\r\n        'DisplayName',\r\n      ]}\r\n    />\r\n  );\r\n};\r\n\r\nconst TTable = filterHandler<IRowHistory, {}>(UnconfigurableTable, GetFilters, {\r\n  isSidePanel: true,\r\n});\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IRowHistory } from './IRowHistory';\r\n\r\nexport const getColumns = (t: TFunction) => {\r\n  const res: Column<IRowHistory>[] = [\r\n    {\r\n      accessor: 'InvoiceRowId',\r\n      Header: t(translations.HashSymbol) as string,\r\n    },\r\n    {\r\n      accessor: 'FieldName',\r\n      Header: t(translations.Field) as string,\r\n    },\r\n    {\r\n      accessor: 'OldValue',\r\n      Header: t(translations.OldValue) as string,\r\n    },\r\n    {\r\n      accessor: 'NewValue',\r\n      Header: t(translations.NewValue) as string,\r\n    },\r\n    {\r\n      accessor: 'DisplayName',\r\n      Header: t(translations.User) as string,\r\n    },\r\n    {\r\n      accessor: 'UpdatedAt',\r\n      Header: t(translations.Date) as string,\r\n      Cell: DateRenderer,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\nimport {\r\n  getDefaultFilterDatePeriod,\r\n  GetNumberOrUndefined,\r\n  GetRawValue,\r\n  presetDatesRangeToQueryString,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IRowHistory } from './IRowHistory';\r\n\r\nexport const GetFilters: GetPageFilters<IRowHistory> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const res: IFilterSettings<IRowHistory>[] = [\r\n    {\r\n      fieldName: 'UpdatedAt',\r\n      displayName: t(translations.Period),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      component: DatesRangeFilter,\r\n      urlKey: 'period',\r\n    },\r\n    {\r\n      fieldName: 'InvoiceRowId',\r\n      queryStringSerializer: 'rowId',\r\n      displayName: t(translations.InvoiceRowId),\r\n      operator: ODataOperators.Equals,\r\n      value: GetNumberOrUndefined(GetRawValue(params, 'rowId')),\r\n      component: NumberFieldFilter,\r\n    },\r\n  ];\r\n  return res;\r\n};\r\n","import { Dialog, DialogActions, DialogContent } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { NotFoundPage } from 'app/pages/NotFoundPage';\r\nimport { InvoiceStatusPicker } from 'app/components/pickers/AutocompletePickers/InvoiceStatusPicker';\r\nimport { InvoiceTemplatePicker } from 'app/components/pickers/AutocompletePickers/InvoiceTemplatePicker';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useResponseModel } from 'app/hooks/useResponseModel';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n  selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useMemo, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { buildURL, openExportLink, toRootedURL } from 'utils/url-utils';\r\nimport { ChargeProps } from '../AddChargePage';\r\nimport { PaymentProps } from '../AddPaymentPage';\r\nimport { InvoiceComments } from './InvoiceComments';\r\nimport { InvoiceInReview } from './InvoiceInReview';\r\nimport { InvoiceRemarks } from './InvoiceRemarks';\r\nimport { ReadOnlyDetails } from './ReadOnly';\r\nimport { useInvoiceDetailsSlice } from './Slice';\r\nimport {\r\n  selectActiveFilters,\r\n  selectInvoice,\r\n  selectLoading,\r\n  selectNotFound,\r\n} from './Slice/selector';\r\nimport { DetailsTable } from './Tables/Details';\r\nimport { IInvoiceRow } from './Tables/Details/IInvoicRow';\r\nimport { InvoiceHistory } from './Tables/InvoiceHistory';\r\nimport { PayHistory } from './Tables/PayHistory';\r\nimport { PaymentTable } from './Tables/Payments';\r\nimport { RowHistory } from './Tables/RowHistory';\r\nimport { InvoiceIdMultiPicker } from 'app/components/pickers/AutocompletePickers/InvoiceIdMultiPicker';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nconst url = '/api/odata/v4/InvoiceDetails';\r\nexport interface InvoiceDetailsProps extends CoverProps, SidePanelContentProps {\r\n  id: number;\r\n}\r\nexport const InvoiceDetails = ({\r\n  id,\r\n  useSidePanel,\r\n  closeCover,\r\n  isCover,\r\n}: InvoiceDetailsProps) => {\r\n  const { t } = useTranslation();\r\n  const loading = useSelector(selectLoading);\r\n  const notFound = useSelector(selectNotFound);\r\n  const filters = useSelector(selectActiveFilters);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useInvoiceDetailsSlice();\r\n  const { actions: appActions } = useAppSettingsSlice();\r\n  const invoice = useSelector(selectInvoice);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const response = useResponseModel();\r\n  const [deleteInvoiceOpen, setDeleteInvoiceOpen] = useState(false);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const allowedFees = settings.GetString(AllowedSettings.AllowedFeeTypes);\r\n  const isChargesAllowed = allowedFees && allowedFees.trim() !== '';\r\n  useEffectOnMount(() => {\r\n    dispatch(actions.reset());\r\n    dispatch(actions.getInvoice(id));\r\n  });\r\n  const pagelink = useMemo(\r\n    () => buildURL(`${publicUrl}Invoices/Details/${id}`, filters ?? {}),\r\n    [filters, id, publicUrl],\r\n  );\r\n  const setfilterCallback = useCallback(\r\n    (v: IFilterSettings<IInvoiceRow>[] | undefined) => {\r\n      const res = {};\r\n      if (!!v) {\r\n        toURLSearchParams(v).forEach((val, name) => {\r\n          res[name] = val;\r\n        });\r\n      }\r\n      dispatch(actions.setFilters(!v || v.length === 0 ? undefined : res));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const [invoiceHistoryOpen, setInvoiceHistoryOpen] = useState(false);\r\n  const [rowHistoryOpen, setRowHistoryOpen] = useState(false);\r\n  const [payHistoryOpen, setPayHistoryOpen] = useState(false);\r\n  const [updateStatusOpen, setUpdateStatusOpen] = useState(false);\r\n  const [updateInvoiceTemplateOpen, setUpdateInvoiceTemplateOpen] = useState(\r\n    false,\r\n  );\r\n  const [updateInvoiceIdsOpen, setUpdateInvoiceIdsOpen] = useState(false);\r\n  // const [cover, setCover] = useState<ReactNode>();\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState();\r\n  const openNewCharge = useCallback(\r\n    (chargProps: ChargeProps) => {\r\n      openPanel({\r\n        renderPageType: RenderPageType.AddCharge,\r\n        renderPageProps: chargProps,\r\n        expanded: false,\r\n        useSidePanel: true,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n      // if (isSidePanel) {\r\n      //   setCover(\r\n      //     <AddCharge\r\n      //       closeCover={() => setCover(undefined)}\r\n      //       isCover\r\n      //       {...props}\r\n      //     />,\r\n      //   );\r\n      // } else {\r\n      //   dispatch(\r\n      //     layoutActions.openSidePanel({\r\n      //       type: RenderPageType.AddCharge,\r\n      //       props,\r\n      //     }),\r\n      //   );\r\n      // }\r\n    },\r\n    [openPanel, useSidePanel],\r\n  );\r\n  const openNewPayment = useCallback(\r\n    (paymentProps: PaymentProps) => {\r\n      openPanel({\r\n        renderPageType: RenderPageType.AddPayment,\r\n        renderPageProps: Object.assign({}, paymentProps, {\r\n          userGroupId: invoice?.UserGroupId,\r\n        }),\r\n        expanded: false,\r\n        useSidePanel: true,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n      // if (isSidePanel) {\r\n      //   setCover(\r\n      //     <AddPayment\r\n      //       closeCover={() => setCover(undefined)}\r\n      //       isCover\r\n      //       userGroupId={invoice?.UserGroupId}\r\n      //       {...props}\r\n      //     />,\r\n      //   );\r\n      // } else {\r\n      //   dispatch(\r\n      //     layoutActions.openSidePanel({\r\n      //       type: RenderPageType.AddPayment,\r\n      //       props,\r\n      //     }),\r\n      //   );\r\n      // }\r\n    },\r\n    [invoice?.UserGroupId, openPanel, useSidePanel],\r\n  );\r\n  const deletable = useMemo(() => !!invoice && !invoice.LastSentToBilling, [\r\n    invoice,\r\n  ]);\r\n  const [newStatus, setNewStatus] = useState<Entity<number> | null>(null);\r\n  const [invoiceTemplate, setInvoiceTemplate] = useState<Entity<number> | null>(\r\n    null,\r\n  );\r\n  const [invoiceIds, setInvoiceIds] = useState<Entity<number>[] | undefined>(\r\n    undefined,\r\n  );\r\n\r\n  const deleteInvoice = useCallback(() => {\r\n    if (deletable) {\r\n      httpClient\r\n        .delete<IResponseType>(url + '(' + id + ')')\r\n        .then((v: any) => {\r\n          const value = v as IResponseType;\r\n          if (value.ErrorMessages.length > 0) {\r\n            response(value);\r\n          } else {\r\n            if (useSidePanel) {\r\n              closePanel({\r\n                useSidePanel: true,\r\n                isCover: isCover,\r\n              } as SidePanelCloseState);\r\n            } else {\r\n              dispatch(appActions.navigate(toRootedURL('/Billing')));\r\n            }\r\n          }\r\n        })\r\n        .catch(e => console.warn(e));\r\n    }\r\n  }, [\r\n    appActions,\r\n    closePanel,\r\n    deletable,\r\n    dispatch,\r\n    id,\r\n    isCover,\r\n    response,\r\n    useSidePanel,\r\n  ]);\r\n  const updateStatus = useCallback(\r\n    (status: number) => {\r\n      httpClient\r\n        .post(url + '/UpdateStatus', {\r\n          status,\r\n          id,\r\n        })\r\n        .then(() => {\r\n          dispatch(actions.getInvoice(id));\r\n        })\r\n        .catch(e => console.log(e));\r\n    },\r\n    [actions, dispatch, id],\r\n  );\r\n\r\n  const updateInvoiceTemplate = useCallback(\r\n    (invoiceTemplateId: number) => {\r\n      httpClient\r\n        .post(url + '/UpdateInvoiceTemplate', {\r\n          invoiceTemplateId,\r\n          id,\r\n        })\r\n        .then(() => {\r\n          dispatch(actions.getInvoice(id));\r\n        })\r\n        .catch(e => console.log(e));\r\n    },\r\n    [actions, dispatch, id],\r\n  );\r\n\r\n  const handlePreview = () => {\r\n    if (!!invoiceIds) {\r\n      const ids: string = invoiceIds.map(item => item.Id).join(',');\r\n      var params = {\r\n        ids: ids,\r\n      };\r\n      //BillingController->InvoiceExportPDFs - [Route(\"api/Billing/Invoices/InvoiceExportPDFs\")]\r\n      const url = buildURL('api/Billing/Invoices/InvoiceExportPDFs', params);\r\n      openExportLink(url);\r\n      setInvoiceIds([]);\r\n    }\r\n  };\r\n\r\n  const topButtons: ActionRenderer[] = useMemo(\r\n    () => [\r\n      () => {\r\n        if (!isChargesAllowed) return undefined;\r\n        return (\r\n          <TopActionButton\r\n            icon=\"plus\"\r\n            title={t(translations.AddACharge) as string}\r\n            text={t(translations.AddCharge) as string}\r\n            startIcon=\"plus\"\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            shape=\"square\"\r\n            onClick={() =>\r\n              openNewCharge({\r\n                invoiceId: id,\r\n                budget:\r\n                  invoice && invoice.BudgetId\r\n                    ? { Id: invoice.BudgetId, Name: invoice.BudgetNumber }\r\n                    : null,\r\n                serviceGroup:\r\n                  authenticatedUser?.Roles?.includes(\r\n                    Roles.ServiceGroupBudgetsAdmin,\r\n                  ) && authenticatedUser.AdminServiceGroups.length === 1\r\n                    ? authenticatedUser.AdminServiceGroups[0]\r\n                    : null,\r\n                serviceGroupPredicate:\r\n                  invoice &&\r\n                  invoice.ServiceGroups &&\r\n                  invoice.ServiceGroups.length > 0\r\n                    ? [\r\n                        new Condition(\r\n                          'Id',\r\n                          ODataOperators.Includes,\r\n                          invoice.ServiceGroups,\r\n                        ),\r\n                      ]\r\n                    : undefined,\r\n              })\r\n            }\r\n          />\r\n        );\r\n      },\r\n      () => {\r\n        return (\r\n          <TopActionButton\r\n            title={t(translations.EditInvoiceStatus)}\r\n            text={t(translations.EditInvoiceStatus)}\r\n            icon=\"pencil\"\r\n            startIcon=\"pencil\"\r\n            size=\"small\"\r\n            onClick={() => setUpdateStatusOpen(true)}\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n          />\r\n        );\r\n      },\r\n      () => {\r\n        return (\r\n          <TopActionButton\r\n            title={t(translations.EditInvoiceTemplate)}\r\n            text={t(translations.EditInvoiceTemplate)}\r\n            icon=\"pencil\"\r\n            startIcon=\"pencil\"\r\n            size=\"small\"\r\n            onClick={() => setUpdateInvoiceTemplateOpen(true)}\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n          />\r\n        );\r\n      },\r\n      () => {\r\n        return (\r\n          <TopActionButton\r\n            text={t(translations.Delete)}\r\n            title={\r\n              deletable\r\n                ? t(translations.Delete)\r\n                : t(translations.CantDeleteInvoice)\r\n            }\r\n            onClick={() => setDeleteInvoiceOpen(true)}\r\n            icon=\"trash\"\r\n            startIcon=\"trash\"\r\n            disabled={!deletable}\r\n            size=\"small\"\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n          />\r\n        );\r\n      },\r\n      () => {\r\n        return (\r\n          <TopActionButton\r\n            title={t(translations.InvoiceHistory)}\r\n            text={t(translations.InvoiceHistory)}\r\n            icon=\"history\"\r\n            startIcon=\"history\"\r\n            size=\"small\"\r\n            onClick={() => setInvoiceHistoryOpen(true)}\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n          />\r\n        );\r\n      },\r\n      () => {\r\n        return (\r\n          <TopActionButton\r\n            title={t(translations.InvoiceRowsHistory)}\r\n            text={t(translations.InvoiceRowsHistory)}\r\n            icon=\"rectangle-vertical-history\"\r\n            startIcon=\"rectangle-vertical-history\"\r\n            size=\"small\"\r\n            onClick={() => setRowHistoryOpen(true)}\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n          />\r\n        );\r\n      },\r\n      () => {\r\n        return (\r\n          <TopActionButton\r\n            title={t(translations.Preview)}\r\n            text={t(translations.Preview)}\r\n            icon=\"link\"\r\n            startIcon=\"save\"\r\n            size=\"small\"\r\n            onClick={() => {\r\n              let invoiceIdEntity: Entity<number> = {\r\n                Id: id,\r\n                Name: id.toString(),\r\n              };\r\n              !!invoiceIdEntity\r\n                ? setInvoiceIds([invoiceIdEntity])\r\n                : setInvoiceIds([]);\r\n              setUpdateInvoiceIdsOpen(true);\r\n            }}\r\n            variant=\"ghost\"\r\n            shape=\"square\"\r\n          />\r\n        );\r\n      },\r\n    ],\r\n    [\r\n      authenticatedUser,\r\n      isChargesAllowed,\r\n      deletable,\r\n      id,\r\n      invoice,\r\n      openNewCharge,\r\n      t,\r\n    ],\r\n  );\r\n  const paymentPageActions: PageActionRenderer[] = useMemo(\r\n    () => [\r\n      () => (\r\n        <TopActionButton\r\n          icon=\"plus\"\r\n          title={t(translations.AddPayment) as string}\r\n          text={t(translations.AddPayment) as string}\r\n          startIcon=\"plus\"\r\n          onClick={() =>\r\n            openNewPayment({\r\n              invoiceId: id,\r\n              budget:\r\n                invoice && invoice.BudgetId\r\n                  ? { Id: invoice.BudgetId, Name: invoice.BudgetNumber }\r\n                  : null,\r\n              serviceGroup: null,\r\n              serviceGroupPredicate:\r\n                invoice &&\r\n                invoice.ServiceGroups &&\r\n                invoice.ServiceGroups.length > 0\r\n                  ? [\r\n                      new Condition(\r\n                        'Id',\r\n                        ODataOperators.Includes,\r\n                        invoice.ServiceGroups,\r\n                      ),\r\n                    ]\r\n                  : undefined,\r\n            })\r\n          }\r\n        />\r\n      ),\r\n      () => (\r\n        <ReactActions\r\n          id=\"paymentTableActions\"\r\n          items={[\r\n            <TopActionButton\r\n              icon=\"history\"\r\n              title={t(translations.PaymentModificationsHistory) as string}\r\n              text={t(translations.PaymentModificationsHistory) as string}\r\n              startIcon=\"history\"\r\n              onClick={() => setPayHistoryOpen(true)}\r\n              variant=\"ghost\"\r\n              shape=\"square\"\r\n              size=\"small\"\r\n            />,\r\n          ]}\r\n        />\r\n      ),\r\n    ],\r\n    [id, invoice, openNewPayment, t],\r\n  );\r\n  if (notFound) {\r\n    return <NotFoundPage />;\r\n  }\r\n  return (\r\n    <PageWrapper\r\n      pageLink={pagelink}\r\n      useSidePanel={useSidePanel}\r\n      loading={loading}\r\n      pageName={\r\n        <Link href=\"Invoices/Default.aspx\">{t(translations.Invoices)}</Link>\r\n      }\r\n      titlePage={`${t(translations.Invoices)} #${id}`}\r\n      closable\r\n      disableExpandToggle\r\n      rightTopActions={topButtons}\r\n      cover={cover}\r\n      closeCover={!isCover ? onCloseCover : closeCover}\r\n      isCover={isCover}\r\n      coverClosed={coverClosed}\r\n      children={\r\n        <Box p={2} width={'100%'}>\r\n          <InvoiceInReview />\r\n          <ReadOnlyDetails\r\n            id={id}\r\n            openChangeStatus={() => setUpdateStatusOpen(true)}\r\n            openChangeInvoiceTemplate={() => setUpdateInvoiceTemplateOpen(true)}\r\n          />\r\n          <DetailsTable\r\n            id={id}\r\n            isSidePanel={useSidePanel}\r\n            setFilters={setfilterCallback}\r\n            OpenEditRow={rowId =>\r\n              openNewCharge({\r\n                invoiceId: id,\r\n                rowId: rowId,\r\n                budget: null,\r\n                serviceGroup: null,\r\n              })\r\n            }\r\n          />\r\n          <PaymentTable\r\n            pageActions={paymentPageActions}\r\n            invoiceId={id}\r\n            isSidePanel={useSidePanel}\r\n            openEditPayment={PayId => {\r\n              openNewPayment({\r\n                invoiceId: id,\r\n                paymentId: PayId,\r\n                budget: null,\r\n                serviceGroup: null,\r\n              });\r\n            }}\r\n          />\r\n          <InvoiceComments />\r\n          <InvoiceRemarks />\r\n          <Dialog open={invoiceHistoryOpen} maxWidth=\"md\" disableEnforceFocus>\r\n            <DialogContent>\r\n              <InvoiceHistory invoiceId={id} />\r\n            </DialogContent>\r\n            <DialogActions>\r\n              <Button onClick={() => setInvoiceHistoryOpen(false)}>\r\n                {t(translations.Done)}\r\n              </Button>\r\n            </DialogActions>\r\n          </Dialog>\r\n          <Dialog open={rowHistoryOpen} maxWidth=\"md\" disableEnforceFocus>\r\n            <DialogContent>\r\n              <RowHistory invoiceId={id} />\r\n            </DialogContent>\r\n            <DialogActions>\r\n              <Button onClick={() => setRowHistoryOpen(false)}>\r\n                {t(translations.Done)}\r\n              </Button>\r\n            </DialogActions>\r\n          </Dialog>\r\n          <Dialog open={payHistoryOpen} maxWidth=\"md\" disableEnforceFocus>\r\n            <DialogContent>\r\n              <PayHistory invoiceId={id} />\r\n            </DialogContent>\r\n            <DialogActions>\r\n              <Button onClick={() => setPayHistoryOpen(false)}>\r\n                {t(translations.Done)}\r\n              </Button>\r\n            </DialogActions>\r\n          </Dialog>\r\n          <DialogConfirm\r\n            title={t(translations.EditInvoiceStatus)}\r\n            body={\r\n              <InvoiceStatusPicker\r\n                variant=\"filled\"\r\n                fullWidth\r\n                value={newStatus}\r\n                onChange={v => setNewStatus(v)}\r\n              />\r\n            }\r\n            confirmButtonLabel={t(translations.UpdateInvoiceStatus)}\r\n            onConfirm={() => {\r\n              updateStatus(newStatus?.Id ?? -1);\r\n              setUpdateStatusOpen(false);\r\n            }}\r\n            disabled={!newStatus}\r\n            onCancel={() => setUpdateStatusOpen(false)}\r\n            isOpen={updateStatusOpen}\r\n          />\r\n          <DialogConfirm\r\n            title={t(translations.EditInvoiceTemplate)}\r\n            body={\r\n              <InvoiceTemplatePicker\r\n                variant=\"filled\"\r\n                fullWidth\r\n                value={invoiceTemplate}\r\n                onChange={v => setInvoiceTemplate(v)}\r\n              />\r\n            }\r\n            confirmButtonLabel={t(translations.UpdateInvoiceTemplate)}\r\n            onConfirm={() => {\r\n              updateInvoiceTemplate(invoiceTemplate?.Id ?? -1);\r\n              setUpdateInvoiceTemplateOpen(false);\r\n            }}\r\n            disabled={!invoiceTemplate}\r\n            onCancel={() => setUpdateInvoiceTemplateOpen(false)}\r\n            isOpen={updateInvoiceTemplateOpen}\r\n          />\r\n          <DialogConfirm\r\n            title={t(translations.Invoice)}\r\n            body={\r\n              <InvoiceIdMultiPicker\r\n                variant=\"filled\"\r\n                fullWidth\r\n                placeholder={t(translations.AllValues)}\r\n                value={invoiceIds}\r\n                onChange={v => setInvoiceIds(v)}\r\n              />\r\n            }\r\n            confirmButtonLabel={t(translations.Preview)}\r\n            onConfirm={() => {\r\n              handlePreview();\r\n              setUpdateInvoiceIdsOpen(false);\r\n            }}\r\n            onClose={() => setInvoiceIds([])}\r\n            disabled={\r\n              invoiceIds === null ||\r\n              invoiceIds === undefined ||\r\n              invoiceIds.length === 0\r\n            }\r\n            onCancel={() => {\r\n              setUpdateInvoiceIdsOpen(false);\r\n              setInvoiceIds([]);\r\n            }}\r\n            isOpen={updateInvoiceIdsOpen}\r\n          />\r\n          <DialogConfirm\r\n            isOpen={deleteInvoiceOpen}\r\n            body={t(translations.InvoiceDeleteConfirmationMessage)}\r\n            onConfirm={deleteInvoice}\r\n            onCancel={() => setDeleteInvoiceOpen(false)}\r\n            disabled={!deletable}\r\n          />\r\n        </Box>\r\n      }\r\n    />\r\n  );\r\n};\r\n\r\nexport const InvoiceDetailsUrl = url;\r\n","import { Box, MenuItem } from '@material-ui/core';\r\nimport { IWorkOrderTypeStatusDto } from 'api/odata/generated/entities/IWorkOrderTypeStatusDto';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\nexport interface CloseWorkOrderButtonProps extends ButtonProps {\r\n  text: string;\r\n  closedStatuses: IWorkOrderTypeStatusDto[];\r\n  handleClose: (e: any, status: IWorkOrderTypeStatusDto) => void;\r\n  body?: string;\r\n}\r\nexport interface ReopenOrderButtonProps extends ButtonProps {\r\n  text: string;\r\n  handleOpen: (e: any) => void;\r\n}\r\nexport interface DeleteButtonProps extends ButtonProps {\r\n  text: string;\r\n  handleDelete: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: SaveFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function ReopenOrderButton({\r\n  text,\r\n  handleOpen,\r\n  ...props\r\n}: ReopenOrderButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={e => handleOpen(e)}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\nexport function DeleteOrderButton({\r\n  text,\r\n  handleDelete,\r\n  ...props\r\n}: DeleteButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={e => handleDelete(e)}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\n\r\nexport function CloseWorkOrderButton({\r\n  text,\r\n  closedStatuses,\r\n  handleClose,\r\n  ...props\r\n}: CloseWorkOrderButtonProps) {\r\n  //PROPS\r\n  const { t } = useTranslation();\r\n\r\n  //STATES\r\n  const [open, setOpen] = React.useState(false);\r\n  const [closedStatus, setClosedStatus] = React.useState<\r\n    IWorkOrderTypeStatusDto | undefined\r\n  >(undefined);\r\n  const useOpen = React.useMemo(() => {\r\n    return open;\r\n  }, [open]);\r\n  //RENDER\r\n  return (\r\n    <React.Fragment>\r\n      {closedStatuses.length === 1 ? (\r\n        <Button\r\n          {...props}\r\n          onClick={() => {\r\n            setOpen(true);\r\n            setClosedStatus(closedStatuses[0]);\r\n          }}\r\n        >\r\n          {text}\r\n        </Button>\r\n      ) : (\r\n        <DropDown\r\n          menuChildren={() =>\r\n            closedStatuses.map(s => (\r\n              <Box key={s.StatusId}>\r\n                <MenuItem\r\n                  onClick={() => {\r\n                    setOpen(true);\r\n                    setClosedStatus(s);\r\n                  }}\r\n                >\r\n                  {s.Name}\r\n                </MenuItem>\r\n              </Box>\r\n            ))\r\n          }\r\n          menuProps={{\r\n            anchorOrigin: {\r\n              vertical: 'top',\r\n              horizontal: 'center',\r\n            },\r\n            transformOrigin: {\r\n              vertical: 'bottom',\r\n              horizontal: 'center',\r\n            },\r\n          }}\r\n          addChevron\r\n          {...props}\r\n        >\r\n          {text}\r\n        </DropDown>\r\n      )}\r\n      {useOpen && (\r\n        <DialogConfirm\r\n          isOpen={useOpen}\r\n          title={t(translations.CloseEvent)}\r\n          processing={props.processing}\r\n          body={props.body}\r\n          confirmButtonLabel={t(translations.Save)}\r\n          cancelButtonLabel={t(translations.Cancel)}\r\n          onConfirm={e => {\r\n            if (!!closedStatus) {\r\n              handleClose(e, closedStatus);\r\n            }\r\n          }}\r\n          onCancel={() => {\r\n            setClosedStatus(undefined);\r\n            setOpen(false);\r\n          }}\r\n          onClose={() => {\r\n            setClosedStatus(undefined);\r\n            setOpen(false);\r\n          }}\r\n          maxWidth=\"md\"\r\n        />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { WorkOrderTypePicker } from '../pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\n\r\nexport const FormWorkOrderTypePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IWorkOrderTypeDto | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<IWorkOrderTypeDto | null>(props);\r\n  return (\r\n    <>\r\n      <WorkOrderTypePicker\r\n        name={props.name}\r\n        variant=\"filled\"\r\n        disableClearable={props.disableClearable}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        disabled={props.disabled}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        predicates={props.predicates}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  IWorkOrderTypeStatusParamsPicker,\r\n  WorkOrderTypeStatusPicker,\r\n} from '../pickers/AutocompletePickers/WorkOrderTypeStatusPicker';\r\n\r\nexport const FormWorkOrderTypeStatusPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  IWorkOrderTypeStatusParamsPicker) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <WorkOrderTypeStatusPicker\r\n        typeId={props.typeId}\r\n        onlyNew={props.onlyNew}\r\n        info={props.info}\r\n        name={props.name}\r\n        variant=\"filled\"\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { RemindBeforePicker } from '../pickers/StaticOptionsPickers/RemindBeforePicker';\r\n\r\nexport const FormRemindBeforePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <RemindBeforePicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        disableClearable\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * SymptomCodesPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ISymptomCodeDto } from 'api/odata/generated/entities/ISymptomCodeDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nexport interface ISymptomCodesParamsPicker {\r\n  AssetCats?: number[];\r\n}\r\nexport interface SymptomCodesPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'>,\r\n    ISymptomCodesParamsPicker {}\r\n\r\nconst url = '/api/odata/v4/SymptomCodes';\r\nexport const initSymptomCodesData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: `Id,Name,Active,AssetCatId,AssetCatName`,\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport function withParamsFilter(AssetCats: number[] | undefined) {\r\n  if (!AssetCats || AssetCats.length < 1) {\r\n    return (searchTerm: string | null) =>\r\n      new Promise<Entity<number>[]>((resolve, reject) => {\r\n        resolve([] as Entity<number>[]);\r\n      });\r\n  }\r\n  return (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string; $select?: string } = {\r\n      $orderby: 'Name asc',\r\n      $select: 'Id,Name,Active,AssetCatId,AssetCatName',\r\n    };\r\n    const predicates: (string | Condition<ISymptomCodeDto>)[] = [];\r\n    if (AssetCats !== undefined && AssetCats.length > 0) {\r\n      AssetCats.forEach(a =>\r\n        predicates.push(new Condition('AssetCatId', ODataOperators.Equals, a)),\r\n      );\r\n    }\r\n    params.$filter = new ODataFilterBuilder<ISymptomCodeDto>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm === null ? undefined : searchTerm,\r\n      globalServiceGroupFilter: [],\r\n    }).toString();\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(\r\n        response => (response.value as ISymptomCodeDto[]) as Entity<number>[],\r\n      );\r\n  };\r\n}\r\nexport function SymptomCodesPicker(props: SymptomCodesPickerProps) {\r\n  const loadData = withParamsFilter(props.AssetCats);\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'symptomcodesId'}\r\n      loadData={loadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * FormSymptomCodesPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  ISymptomCodesParamsPicker,\r\n  SymptomCodesPicker,\r\n} from '../pickers/AutocompletePickers/SymptomCodesPicker';\r\n\r\nexport const FormSymptomCodesPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  ISymptomCodesParamsPicker) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <SymptomCodesPicker\r\n        AssetCats={props.AssetCats}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * SymptomCodesPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IRepairCodeDto } from 'api/odata/generated/entities/IRepairCodeDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\nexport interface IRepairCodesParamsPicker {\r\n  AssetCatIds?: number[];\r\n}\r\nexport interface RepairCodesPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'>,\r\n    IRepairCodesParamsPicker {}\r\n\r\nconst url = '/api/odata/v4/RepairCodes';\r\nexport const initRepairCodesData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: `Id,Name,Active,AssetCatId,AssetCatName`,\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport function withParamsFilter(AssetCatIds: number[] | undefined) {\r\n  return (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string; $select?: string } = {\r\n      $orderby: 'Name asc',\r\n      $select: 'Id,Name,Active,AssetCatId,AssetCatName',\r\n    };\r\n    const predicates: (string | Condition<IRepairCodeDto>)[] = [];\r\n    if (AssetCatIds !== undefined && AssetCatIds.length > 0) {\r\n      predicates.push(\r\n        AssetCatIds.map(ac =>\r\n          new Condition('AssetCatId', ODataOperators.Equals, ac).toString(),\r\n        ).join(' or '),\r\n      );\r\n    }\r\n    params.$filter = new ODataFilterBuilder<IRepairCodeDto>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm === null ? undefined : searchTerm,\r\n      globalServiceGroupFilter: [],\r\n    }).toString();\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(\r\n        response => (response.value as IRepairCodeDto[]) as Entity<number>[],\r\n      );\r\n  };\r\n}\r\nexport function RepairCodesPicker(props: RepairCodesPickerProps) {\r\n  const loadData = withParamsFilter(props.AssetCatIds);\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'repaircodesId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * FormRepairCodesPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  IRepairCodesParamsPicker,\r\n  RepairCodesPicker,\r\n} from '../pickers/AutocompletePickers/RepairCodesPicker';\r\n\r\nexport const FormRepairCodesPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  IRepairCodesParamsPicker) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <RepairCodesPicker\r\n        AssetCatIds={props.AssetCatIds}\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * SymptomCodesPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\n\r\nimport * as React from 'react';\r\n\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ReasonTypePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/ReasonType';\r\nexport const initReasonTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: `Id,Name`,\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nconst loadData = (searchTerm: string | null) => {\r\n  const params: { $orderby: string; $filter?: string } = {\r\n    $orderby: 'Name asc',\r\n  };\r\n  if (searchTerm !== null) {\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: [],\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm,\r\n    }).toString();\r\n  }\r\n\r\n  return httpClient\r\n    .get(url, params)\r\n    .then(response => response.value as Entity<number>[]);\r\n};\r\nexport function ReasonTypePicker(props: ReasonTypePickerProps) {\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      loadData={loadData}\r\n      id={props.id || 'reasontypeId'}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { ReasonTypePicker } from '../pickers/AutocompletePickers/ReasonTypePicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormReasonTypePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <ReasonTypePicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        disableClearable\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { Body } from 'app/components/Typography';\r\nimport { ReservationEditButton } from 'app/components/ReservationEditButton';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { WorkOrderReadonlyState } from '../slice/types';\r\nimport styled from 'styled-components';\r\n\r\nexport interface CreationDetailsProps {\r\n  details: WorkOrderReadonlyState;\r\n}\r\n\r\nexport function CreationDetails(props: CreationDetailsProps) {\r\n  const { details } = props;\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const { t } = useTranslation();\r\n  return (\r\n    <React.Fragment>\r\n      <DetailsWrapper className={'readonly-root'}>\r\n        <Body bold={true}>{t(translations.WorkOrderAdvancedDetails)}</Body>\r\n        <div className={'readonly-content'}>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.ReportedBy)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {details.ReportedByDisplayName}\r\n            </Body>\r\n          </div>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.ReportedDate)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {dateUtils.longDateTimeFormat(details.CreateDate)}\r\n            </Body>\r\n          </div>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.LastUpdated)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {dateUtils.longDateTimeFormat(details.LastUpdated) ?? 'N/A'}\r\n            </Body>\r\n          </div>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.AlertType)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {details.AlertType ?? 'N/A'}\r\n            </Body>\r\n          </div>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.EventTypeStatus)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {details.StatusName ?? 'N/A'}\r\n            </Body>\r\n          </div>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.ClosedAt)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {dateUtils.longDateTimeFormat(details.DoneDate) ||\r\n                t(translations.WorkStillInProgress)}\r\n            </Body>\r\n          </div>\r\n          <div className={'readonly-row'}>\r\n            <Body size=\"small\">{t(translations.ClosedBy)}</Body>\r\n            <Body size=\"small\" bold={true}>\r\n              {details.DoneBy ?? 'N/A'}\r\n            </Body>\r\n          </div>\r\n          {details.Reservation !== null && (\r\n            <div className={'readonly-row'}>\r\n              <Body size=\"small\">{t(translations.Reservation)}</Body>\r\n              <ReservationEditButton\r\n                reservationId={details.Reservation}\r\n                variant=\"text\"\r\n              >\r\n                {`# ${details.Reservation}`}\r\n              </ReservationEditButton>\r\n            </div>\r\n          )}\r\n          {globalSettings.GetBooleanByKey(AllowedSettings.AssetCatEnabled) &&\r\n            !isNullOrUndefined(details.AssetCatName) && (\r\n              <div className={'readonly-row'}>\r\n                <Body size=\"small\">{t(translations.AssetCatName)}</Body>\r\n                <Body size=\"small\" bold={true}>{`${details.AssetCatName} - ${\r\n                  details.InternalServiceAvaliable\r\n                    ? t(translations.InternalServiceAvaliable)\r\n                    : ''\r\n                }`}</Body>\r\n              </div>\r\n            )}\r\n        </div>\r\n      </DetailsWrapper>\r\n    </React.Fragment>\r\n  );\r\n}\r\nconst DetailsWrapper = styled.div`\r\n  &.readonly-root {\r\n    display: flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    grid-gap: 4px;\r\n    padding: 0;\r\n    width: 100%;\r\n  }\r\n  & .readonly-content {\r\n    display: flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    grid-gap: 16px;\r\n    padding: 16px 0px;\r\n    width: 100%;\r\n  }\r\n  & .readonly-row {\r\n    display: flex;\r\n    flex-direction: row;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    padding: 0;\r\n    width: inherit;\r\n  }\r\n`;\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { FormLabelText } from 'app/components/Forms/FormLabelText';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nexport interface FormUnlimitedDowntimeProps {\r\n  onClick: () => void;\r\n}\r\nexport function FormUnlimitedDowntime(props: FormUnlimitedDowntimeProps) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <FormLabelText\r\n      name=\"FormUnlimitedDowntime\"\r\n      label={t(translations.UnlimitedDowntime)}\r\n      text={\r\n        <Box\r\n          width=\"100%\"\r\n          display=\"flex\"\r\n          flexDirection=\"row\"\r\n          alignItems=\"center\"\r\n          justifyContent=\"space-between\"\r\n          paddingLeft=\"4px\"\r\n        >\r\n          <Icon icon={['fad', 'infinity']} size=\"2x\" />\r\n          <Button variant=\"main\" size=\"small\" onClick={props.onClick}>\r\n            {t(translations.EndDowntime)}\r\n          </Button>\r\n        </Box>\r\n      }\r\n    />\r\n  );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport {\r\n  BaseURLPicker,\r\n  BaseURLPickerProps,\r\n} from 'app/components/BasicPickers/BaseURLPicker';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nexport interface CustomFormPickerProps\r\n  extends Omit<BaseURLPickerProps<Entity<number>>, 'url' | 'queryfilter'> {\r\n  formType: CustomFormTypeEnum;\r\n  referenceId?: number;\r\n  filter?: string;\r\n}\r\n\r\nexport const initCustomFormData = (\r\n  initval: string | undefined,\r\n  type: CustomFormTypeEnum,\r\n) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const url = `/api/odata/v4/CustomForm(${type})`;\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,FormFields,ServiceGroups,Active,Type',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nexport function AlertFormFilter(\r\n  alertTypeId: number,\r\n  assetCatId: number,\r\n): string | undefined {\r\n  let filter = `(WorkOrderFormMatrices/any(m: m/AlertTypeId eq ${quoteODataValue(\r\n    alertTypeId,\r\n  )} and m/AssetCatId eq ${assetCatId}))`;\r\n  return filter;\r\n}\r\nexport function CustomFormPicker(props: CustomFormPickerProps) {\r\n  const { filter, formType } = props;\r\n  const url = `/api/odata/v4/CustomForm(${formType})`;\r\n  return (\r\n    <BaseURLPicker\r\n      url={url}\r\n      filter={filter}\r\n      {...props}\r\n      id={props.id || 'customformId'}\r\n    />\r\n  );\r\n}\r\n","import { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { CustomFormPicker } from '../pickers/AutocompletePickers/CustomFormPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormCustomFormPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps & { formType: CustomFormTypeEnum }) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <CustomFormPicker\r\n        name={props.name}\r\n        filter={props.filter}\r\n        formType={props.formType}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { CommentsApi } from 'api/CommentsApi';\r\nimport {\r\n  ConvertNewToComment,\r\n  IComment,\r\n  NewComment,\r\n} from 'app/components/CommentsContainer/IComment';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { WorkOrderDetailsState } from '../slice/types';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentsContainer } from 'app/components/CommentsContainer';\r\nimport { translations } from 'locales/translations';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { Portal } from '@material-ui/core';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { selectCreatedOrders, selectSaveNewComments } from '../slice/selectors';\r\nimport { useWorkOrderSlice } from '../slice';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\r\n\r\nexport interface WorkOrderCommentsProps {\r\n  isAdmin?: boolean;\r\n  order: WorkOrderDetailsState;\r\n  disabled?: boolean;\r\n  commentsFormRef: React.MutableRefObject<any>;\r\n  isEdit?: boolean;\r\n  user?: AuthenticatedUser;\r\n  sectionTitle?: React.ReactNode;\r\n}\r\n\r\nexport const WorkOrderComments = (props: WorkOrderCommentsProps) => {\r\n  const {\r\n    order,\r\n    isAdmin,\r\n    disabled,\r\n    commentsFormRef,\r\n    isEdit,\r\n    user,\r\n    sectionTitle,\r\n  } = props;\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const dispatch = useDispatch();\r\n  const { actions: workOrderActions } = useWorkOrderSlice();\r\n  const doSaveComments = useSelector(selectSaveNewComments);\r\n  const createdOrders = useSelector(selectCreatedOrders);\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const [changed, setchanged] = React.useState(false);\r\n  const [newSavedComments, setNewSavedComments] = React.useState<NewComment[]>(\r\n    [],\r\n  );\r\n  const [newComments, setNewComments] = React.useState<IComment[]>([]);\r\n  const comments = useAsyncGetWthEffect<IComment[]>(\r\n    () => CommentsApi.GetComments(CommentReferenceTypes.Alerts, order.Id),\r\n    [],\r\n    [changed],\r\n  );\r\n  const saveComments = async (\r\n    comments: NewComment[],\r\n    referenceIds: number[],\r\n  ): Promise<any> => {\r\n    var result = await Promise.all(\r\n      comments.map(async item => {\r\n        referenceIds.map(refId => {\r\n          try {\r\n            return CommentsApi.SendComment(\r\n              CommentReferenceTypes.Alerts,\r\n              refId,\r\n              item,\r\n            );\r\n          } catch {\r\n            return item;\r\n          }\r\n        });\r\n      }),\r\n    );\r\n    return result;\r\n  };\r\n  const bindSubmitComment = React.useCallback(\r\n    submitForm => {\r\n      commentsFormRef.current = submitForm;\r\n    },\r\n    [commentsFormRef],\r\n  );\r\n  React.useEffect(() => {\r\n    if (doSaveComments === true && createdOrders.length > 0) {\r\n      saveComments(newSavedComments, createdOrders);\r\n      dispatch(workOrderActions.setSaveNewComments(undefined));\r\n      dispatch(workOrderActions.setOrderNumbers([]));\r\n    }\r\n  }, [\r\n    createdOrders,\r\n    dispatch,\r\n    doSaveComments,\r\n    newSavedComments,\r\n    workOrderActions,\r\n  ]);\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  React.useEffect(() => {\r\n    dispatch(\r\n      largeFileActions.setCommentProperties({\r\n        commentType: CommentReferenceTypes.Alerts,\r\n        referenceId: order.Id,\r\n      }),\r\n    );\r\n  }, [dispatch, largeFileActions, order.Id]);\r\n\r\n  const portalRef = React.useRef(null);\r\n  return (\r\n    <React.Fragment>\r\n      <div ref={portalRef} style={{ width: '100%' }} />\r\n      <Portal container={portalRef.current}>\r\n        <CommentsContainer\r\n          disabled={disabled}\r\n          Comments={isEdit ? comments : newComments}\r\n          sectionTitle={sectionTitle}\r\n          bindSubmitComment={bindSubmitComment}\r\n          onSubmit={c => {\r\n            if (!disabled) {\r\n              if (isEdit) {\r\n                CommentsApi.SendComment(\r\n                  CommentReferenceTypes.Alerts,\r\n                  order.Id,\r\n                  c,\r\n                )\r\n                  .then(res => onCommentAdded?.(res))\r\n                  .finally(() => setchanged(prev => !prev));\r\n              } else {\r\n                setNewSavedComments(() => [...newSavedComments, c]);\r\n                setNewComments(() => [\r\n                  ...newComments,\r\n                  ConvertNewToComment(c, newComments.length + 1, newDate(), {\r\n                    Id: user?.Id || '',\r\n                    Name: user?.Name || '',\r\n                  }),\r\n                ]);\r\n              }\r\n            }\r\n          }}\r\n          isAdmin={isAdmin}\r\n          withMentions\r\n          pageName={t(translations.menu_EditWorkOrder)}\r\n          referenceName={order.Id.toString()}\r\n          linkUrl={buildURL(`${publicUrl}workorders/details/${order.Id}`, {})}\r\n          emailType={'Alert'}\r\n        />\r\n      </Portal>\r\n    </React.Fragment>\r\n  );\r\n};\r\n","import Box from '@material-ui/core/Box';\r\nimport Grid from '@material-ui/core/Grid';\r\nimport Popover from '@material-ui/core/Popover';\r\nimport { IAssetDto } from 'api/odata/generated/entities/IAssetDto';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  bindPopover,\r\n  bindTrigger,\r\n  usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as React from 'react';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { AssetsFilterForCalibrationWorkOrder } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { AssetPicker } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport { Divider } from '@material-ui/core';\r\nimport {\r\n  filteredWorkOrderTypes,\r\n  initWOTypeData,\r\n  WorkOrderTypePicker,\r\n} from 'app/components/pickers/AutocompletePickers/WorkOrderTypePicker';\r\nimport {\r\n  WorkOrderPicker,\r\n  WorkOrdersCalibrationFilter,\r\n} from 'app/components/pickers/AutocompletePickers/WorkOrdersPicker';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\n\r\nexport interface AddCalibrationWorkOrderProps {\r\n  saveLinkedOrders: (order: IWorkOrderDetailsDto) => void;\r\n  workOrederTypeId?: number;\r\n  workOrederIds?: number[];\r\n  showProcessing?: boolean;\r\n}\r\n\r\nexport function AddCalibrationWorkOrder(props: AddCalibrationWorkOrderProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const {\r\n    workOrederIds,\r\n    workOrederTypeId,\r\n    saveLinkedOrders,\r\n    showProcessing,\r\n  } = props;\r\n  const [asset, setAsset] = useAsyncExtendedState<IAssetDto | null>(null);\r\n\r\n  const [workOrder, setWorkOrder] = React.useState<IWorkOrderDetailsDto | null>(\r\n    null,\r\n  );\r\n  const [\r\n    workOrderType,\r\n    setWorkOrderType,\r\n  ] = useAsyncExtendedState<IWorkOrderTypeDto | null>(null);\r\n\r\n  const popupState = usePopupState({\r\n    variant: 'popover',\r\n    popupId: 'workOrderTypeSelection',\r\n  });\r\n  const fetchWorkOrderType = async (woId?: number) =>\r\n    initWOTypeData(woId === undefined ? undefined : '' + woId).then(\r\n      data => (data[0] as IWorkOrderTypeDto) ?? null,\r\n    );\r\n  useEffectOnMount(() => {\r\n    if (workOrederTypeId) {\r\n      setWorkOrderType(fetchWorkOrderType(workOrederTypeId));\r\n    }\r\n    return () => {};\r\n  });\r\n  const handleAssetChange = React.useCallback(\r\n    (value: IAssetDto | null) => {\r\n      setAsset(value);\r\n    },\r\n    [setAsset],\r\n  );\r\n  const handleWorkTypeChange = React.useCallback(\r\n    (value: IWorkOrderTypeDto | null) => {\r\n      setWorkOrderType(value);\r\n    },\r\n    [setWorkOrderType],\r\n  );\r\n  const handleWorkOrderChange = React.useCallback(\r\n    (value: IWorkOrderDetailsDto | null) => {\r\n      setWorkOrder(value);\r\n    },\r\n    [],\r\n  );\r\n  const handleSaveLinked = (value: IWorkOrderDetailsDto | null) => {\r\n    if (value !== null) {\r\n      saveLinkedOrders(value);\r\n      popupState.close();\r\n    }\r\n  };\r\n  return (\r\n    <div>\r\n      <TopActionButton\r\n        text={t(translations.LinkWorkOrder) as string}\r\n        title={'Add link to another work order'}\r\n        icon=\"link\"\r\n        startIcon=\"link\"\r\n        size=\"small\"\r\n        variant=\"white\"\r\n        endIcon=\"chevron-down\"\r\n        css={{ marginLeft: '8px' }}\r\n        disabled={showProcessing === true}\r\n        noChangeOnMobile={true}\r\n        {...bindTrigger(popupState)}\r\n      />\r\n      <Popover\r\n        {...bindPopover(popupState)}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'center',\r\n        }}\r\n        transformOrigin={{\r\n          vertical: 'top',\r\n          horizontal: 'center',\r\n        }}\r\n        disableAutoFocus\r\n        PaperProps={{ style: { width: '360px' } }}\r\n      >\r\n        <div style={{ padding: 16 }}>\r\n          {/* <StyledFormFieldsContainer>\r\n              <FormLeftSection>\r\n                <FormFieldsSection>\r\n                    \r\n                </FormFieldsSection>\r\n                </FormLeftSection>\r\n                </StyledFormFieldsContainer> */}\r\n          <Grid container spacing={2} wrap=\"nowrap\" direction=\"column\">\r\n            <Grid item key=\"title-content\">\r\n              <Box display=\"row\" justifyContent=\"space-between\">\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.AddCalibrationReference)}\r\n                </Body>\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  aria-label=\"close\"\r\n                  size=\"xs\"\r\n                  style={{ position: 'absolute', right: 8, top: 8 }}\r\n                  onClick={() => {\r\n                    popupState.close();\r\n                    setAsset(null);\r\n                    setWorkOrderType(null);\r\n                  }}\r\n                >\r\n                  <Icon icon=\"times\" />\r\n                </IconButton>\r\n              </Box>\r\n            </Grid>\r\n            <Divider variant=\"fullWidth\" />\r\n            <Grid item key=\"workordertype-picker\">\r\n              <WorkOrderTypePicker\r\n                predicates={filteredWorkOrderTypes(\r\n                  asset !== null ? [asset] : [],\r\n                  undefined,\r\n                  undefined,\r\n                )}\r\n                name={'workOrderTypeFilter'}\r\n                variant=\"filled\"\r\n                placeholder={t(translations.PleaseSelectAnAlertType)}\r\n                label={t(translations.AlertType)}\r\n                onChange={value => {\r\n                  handleWorkTypeChange(value as IWorkOrderTypeDto);\r\n                }}\r\n                fullWidth={true}\r\n                id=\"wotype-id\"\r\n                value={workOrderType}\r\n              />\r\n            </Grid>\r\n            <Grid item key=\"asset-picker\">\r\n              <AssetPicker\r\n                predicates={AssetsFilterForCalibrationWorkOrder(\r\n                  workOrderType ?? undefined,\r\n                  [],\r\n                )}\r\n                key=\"assetKey\"\r\n                restrictByAvType=\"serviceRelated\"\r\n                onChange={value => {\r\n                  handleAssetChange(value);\r\n                }}\r\n                placeholder={t(translations.QuickWorkOrderPleaseSelectAssets)}\r\n                fullWidth={true}\r\n                name=\"assets\"\r\n                variant=\"filled\"\r\n                id=\"asset-id\"\r\n                showOnlyActiveAssets={true}\r\n                label={t(translations.Asset)}\r\n                value={asset || undefined}\r\n              />\r\n            </Grid>\r\n\r\n            <Grid item key=\"workorder-picker\">\r\n              <WorkOrderPicker\r\n                name={'workOrderName'}\r\n                variant=\"filled\"\r\n                placeholder={t(translations.PleaseSelectACalibration)}\r\n                label={t(translations.Alerts)}\r\n                onChange={value => {\r\n                  handleWorkOrderChange(value);\r\n                }}\r\n                predicates={WorkOrdersCalibrationFilter(\r\n                  asset?.Id,\r\n                  workOrderType?.Id,\r\n                  workOrederIds,\r\n                )}\r\n                fullWidth={true}\r\n                id=\"wo-id\"\r\n              />\r\n            </Grid>\r\n            <Divider variant=\"fullWidth\" />\r\n            <Grid item key=\"save-button\">\r\n              <Button\r\n                variant=\"main\"\r\n                size=\"small\"\r\n                disabled={workOrder === null}\r\n                onClick={() => handleSaveLinked(workOrder)}\r\n              >\r\n                {t(translations.LinkWorkOrder)}\r\n              </Button>\r\n            </Grid>\r\n          </Grid>\r\n        </div>\r\n      </Popover>\r\n    </div>\r\n  );\r\n}\r\n","import { IconProp } from 'app/AllIcons';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\n\r\nexport interface HoverLinkedItemProps {\r\n  linked: Entity<number>;\r\n  children: React.ReactChild;\r\n  onHoverClick?: (linked: Entity<number>) => void;\r\n  useHoverButton?: boolean;\r\n  hoverIcon?: IconProp;\r\n}\r\n\r\nexport function HoverLinkedItem(props: HoverLinkedItemProps) {\r\n  const { linked, children, useHoverButton, onHoverClick, hoverIcon } = props;\r\n\r\n  const [hover, setHover] = React.useState(false);\r\n  return (\r\n    <span\r\n      style={{ display: 'flex' }}\r\n      onMouseEnter={() => setHover(true)}\r\n      onMouseLeave={() => setHover(false)}\r\n    >\r\n      {children}\r\n      {useHoverButton && hover && (\r\n        <IconButton\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          onClick={() => !!onHoverClick && onHoverClick(linked)}\r\n        >\r\n          <Icon icon={hoverIcon ?? 'times'} />\r\n        </IconButton>\r\n      )}\r\n    </span>\r\n  );\r\n}\r\n","import Collapse from '@material-ui/core/Collapse';\r\nimport List from '@material-ui/core/List';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Entity } from 'types/common';\r\nimport * as React from 'react';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\r\nimport { Box, LinearProgress, ListItem, ListItemText } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { HoverLinkedItem } from './HoverLinkItem';\r\nimport { translations } from 'locales/translations';\r\nimport { Body } from 'app/components/Typography';\r\nimport { useTranslation } from 'react-i18next';\r\nimport cliTruncate from 'cli-truncate';\r\n\r\nexport interface LinkedList extends Entity<number> {\r\n  Id: number;\r\n  Name: string;\r\n  ParentId: number;\r\n  Linked: LinkedList[];\r\n}\r\nexport interface WorkOrderLinksCollapsedProps {\r\n  links: LinkedList[];\r\n  hoverIcon?: IconProp;\r\n  onHoverClick?: (linked: LinkedList) => void;\r\n  onItemClcik?: (linked: Entity<number>) => void;\r\n}\r\n\r\nexport function WorkOrderLinksCollapsed(props: WorkOrderLinksCollapsedProps) {\r\n  const { links, hoverIcon, onHoverClick, onItemClcik } = props;\r\n  const { t } = useTranslation();\r\n  return (\r\n    <List\r\n      component=\"div\"\r\n      dense\r\n      disablePadding\r\n      style={{ width: '100%' }}\r\n      subheader={<Body bold={true}>{t(translations.AllLinkedWorkOrders)}</Body>}\r\n    >\r\n      {links.map(link => (\r\n        <HoverLinkedCollapsedItems\r\n          linked={link}\r\n          key={link.Id}\r\n          hoverIcon={hoverIcon}\r\n          onHoverClick={onHoverClick}\r\n          onItemClcik={onItemClcik}\r\n        />\r\n      ))}\r\n    </List>\r\n  );\r\n}\r\nexport interface HoverLinkedItemsProps {\r\n  linked: LinkedList;\r\n  onHoverClick?: (linked: LinkedList) => void;\r\n  onItemClcik?: (linked: Entity<number>) => void;\r\n  hoverIcon?: IconProp;\r\n}\r\n\r\nexport function HoverLinkedCollapsedItems(props: HoverLinkedItemsProps) {\r\n  const { linked, onHoverClick, onItemClcik, hoverIcon } = props;\r\n\r\n  const [open, setOpen] = React.useState(false);\r\n  return linked.Linked.length > 0 ? (\r\n    <React.Fragment>\r\n      <ListItem\r\n        dense\r\n        onClick={() => setOpen(!open)}\r\n        style={{ cursor: 'pointer' }}\r\n        disableGutters\r\n      >\r\n        <ListItemIcon>\r\n          {<Icon icon=\"square\" fontSize=\"8px\" transform={{ rotate: 45 }} />}\r\n        </ListItemIcon>\r\n        <ListItemText>\r\n          {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n        </ListItemText>\r\n        <ListItemIcon>\r\n          {<Icon icon={open ? 'chevron-up' : 'chevron-down'} />}\r\n        </ListItemIcon>\r\n      </ListItem>\r\n      <Collapse\r\n        in={open}\r\n        timeout=\"auto\"\r\n        unmountOnExit\r\n        style={{ marginLeft: 8 }}\r\n      >\r\n        {/* <Divider /> */}\r\n        <List component=\"div\" className=\"childRoot\" dense disablePadding>\r\n          {linked.Linked.map((item, index) => (\r\n            <HoverLinkedItems\r\n              key={index}\r\n              linked={item}\r\n              onHoverClick={onHoverClick}\r\n              onItemClcik={onItemClcik}\r\n              hoverIcon={hoverIcon}\r\n            />\r\n          ))}\r\n        </List>\r\n      </Collapse>\r\n    </React.Fragment>\r\n  ) : (\r\n    <ListItem disableGutters dense>\r\n      <ListItemIcon style={{ justifyContent: 'end' }}>\r\n        {<Icon icon=\"circle\" fontSize=\"8px\" color=\"primary\" />}\r\n      </ListItemIcon>\r\n      <HoverLinkedItem\r\n        linked={linked}\r\n        hoverIcon={hoverIcon}\r\n        useHoverButton={true}\r\n        onHoverClick={item => !!onHoverClick && onHoverClick(linked)}\r\n      >\r\n        <Button\r\n          variant=\"text\"\r\n          size=\"small\"\r\n          onClick={() => !!onItemClcik && onItemClcik(linked)}\r\n        >\r\n          {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n        </Button>\r\n      </HoverLinkedItem>\r\n    </ListItem>\r\n  );\r\n}\r\n\r\nexport function HoverLinkedItems(props: HoverLinkedItemsProps) {\r\n  const { linked, onHoverClick, onItemClcik, hoverIcon } = props;\r\n\r\n  return linked.Linked.length > 0 ? (\r\n    <React.Fragment>\r\n      <ListItem disableGutters dense>\r\n        <ListItemIcon style={{ justifyContent: 'end' }}>\r\n          {<Icon icon=\"square\" fontSize=\"8px\" transform={{ rotate: 45 }} />}\r\n        </ListItemIcon>\r\n        <HoverLinkedItem\r\n          linked={linked}\r\n          hoverIcon={hoverIcon}\r\n          useHoverButton={true}\r\n          onHoverClick={item => !!onHoverClick && onHoverClick(linked)}\r\n        >\r\n          <Button\r\n            variant=\"text\"\r\n            size=\"small\"\r\n            onClick={() => !!onItemClcik && onItemClcik(linked)}\r\n          >\r\n            {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n          </Button>\r\n        </HoverLinkedItem>\r\n      </ListItem>\r\n      <List\r\n        component=\"div\"\r\n        className=\"childRoot\"\r\n        dense\r\n        disablePadding\r\n        style={{ marginLeft: 8 }}\r\n      >\r\n        {linked.Linked.map((item, index) => (\r\n          <HoverLinkedItems\r\n            key={index}\r\n            linked={item}\r\n            onHoverClick={onHoverClick}\r\n            onItemClcik={onItemClcik}\r\n            hoverIcon={hoverIcon}\r\n          />\r\n        ))}\r\n      </List>\r\n    </React.Fragment>\r\n  ) : (\r\n    <ListItem disableGutters dense>\r\n      <ListItemIcon style={{ justifyContent: 'end' }}>\r\n        {<Icon icon=\"circle\" fontSize=\"8px\" color=\"primary\" />}\r\n      </ListItemIcon>\r\n      <HoverLinkedItem\r\n        linked={linked}\r\n        hoverIcon={hoverIcon}\r\n        useHoverButton={true}\r\n        onHoverClick={item => !!onHoverClick && onHoverClick(linked)}\r\n      >\r\n        <Button\r\n          variant=\"text\"\r\n          size=\"small\"\r\n          onClick={() => !!onItemClcik && onItemClcik(linked)}\r\n        >\r\n          {cliTruncate(linked.Name, 32, { position: 'middle' })}\r\n        </Button>\r\n      </HoverLinkedItem>\r\n    </ListItem>\r\n  );\r\n}\r\nexport interface WorkOrderLinksProps {\r\n  links: LinkedList[];\r\n  hoverIcon?: IconProp;\r\n  onHoverClick?: (linked: LinkedList) => void;\r\n  onItemClcik?: (linked: Entity<number>) => void;\r\n  showProcessing?: boolean;\r\n}\r\nconst getLength = (link: LinkedList) => {\r\n  let count = link.Linked.length;\r\n  if (link.Linked.length > 0) {\r\n    link.Linked.forEach(item => {\r\n      count += getLength(item);\r\n    });\r\n  }\r\n  return count;\r\n};\r\nexport function WorkOrderLinks(props: WorkOrderLinksProps) {\r\n  const { links, hoverIcon, onHoverClick, onItemClcik, showProcessing } = props;\r\n  const { t } = useTranslation();\r\n  const [open, setOpen] = React.useState(true);\r\n  const countLinks = React.useMemo(() => {\r\n    let count = links.length;\r\n    if (links.length > 0) {\r\n      links.forEach(item => {\r\n        count += getLength(item);\r\n      });\r\n    }\r\n    return count;\r\n  }, [links]);\r\n  return (\r\n    <List component=\"div\" dense disablePadding style={{ width: '100%' }}>\r\n      <React.Fragment>\r\n        <ListItem\r\n          onClick={() => setOpen(!open)}\r\n          style={{ cursor: 'pointer' }}\r\n          disableGutters\r\n        >\r\n          <ListItemText>\r\n            {\r\n              <Body bold={true}>\r\n                {t(translations.LinkedWorkOrders).replace(\r\n                  '{0}',\r\n                  countLinks.toString(),\r\n                )}\r\n              </Body>\r\n            }\r\n          </ListItemText>\r\n          <ListItemIcon>\r\n            {<Icon icon={open ? 'chevron-up' : 'chevron-down'} />}\r\n          </ListItemIcon>\r\n        </ListItem>\r\n        {showProcessing && (\r\n          <Box style={{ width: '100%' }}>\r\n            <LinearProgress variant=\"query\" color=\"primary\" />\r\n          </Box>\r\n        )}\r\n        <Collapse\r\n          in={open}\r\n          timeout=\"auto\"\r\n          unmountOnExit\r\n          style={{ marginLeft: 8 }}\r\n        >\r\n          {/* <Divider /> */}\r\n          <List component=\"div\" className=\"childRoot\" dense disablePadding>\r\n            {links.map((item, index) => (\r\n              <HoverLinkedItems\r\n                key={index}\r\n                linked={item}\r\n                onHoverClick={onHoverClick}\r\n                onItemClcik={onItemClcik}\r\n                hoverIcon={hoverIcon}\r\n              />\r\n            ))}\r\n          </List>\r\n        </Collapse>\r\n      </React.Fragment>\r\n    </List>\r\n  );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport {\r\n  getAlertStart,\r\n  WorkOrderDetailsState,\r\n  WorkOrderReadonlyState,\r\n} from '../slice/types';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { FormWorkOrderTypePicker } from 'app/components/Forms/FormWorkOrderTypePicker';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormWorkOrderTypeStatusPicker } from 'app/components/Forms/FormWorkOrderTypeStatusPicker';\r\nimport { FormRemindBeforePicker } from 'app/components/Forms/FormRemindBeforePicker';\r\nimport { FormSymptomCodesPicker } from 'app/components/Forms/FormSymptomCodesPicker';\r\nimport { FormRepairCodesPicker } from 'app/components/Forms/FormRepairCodesPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport {\r\n  FieldHandler,\r\n  FormListener,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport {\r\n  IAssetDto,\r\n  mapAssetsToServiceFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { FormReasonTypePicker } from 'app/components/Forms/FormReasonTypePicker';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { FormAdminUsersPicker } from 'app/components/Forms/FormAdminUserPicker';\r\nimport { getWorkOrdersShema } from './validationSchema';\r\nimport { AssetsFilterForWorkOrder } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { dateUtils, WeekStartsOn } from 'utils/date-utils';\r\nimport { initReasonTypeData } from 'app/components/pickers/AutocompletePickers/ReasonTypePicker';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectSystemFirstDayOfWeek } from 'app/slice/selectors';\r\nimport { GetAutoCreateTitle } from 'types/IRepetitiveDto';\r\nimport { getSingleReminder } from 'app/components/pickers/StaticOptionsPickers/RemindBeforePicker';\r\nimport { Entity } from 'types/common';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { RepetitiveControl } from 'app/components/Forms/FormRepetitive/RepetitiveControl';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { CreationDetails } from '../CreationDetails';\r\nimport { FormUnlimitedDowntime } from './FormUnlimitedDowntime';\r\nimport { CustomFormControl } from '../../../../../components/CustomForm/CusomFormControl';\r\nimport { CustomFormTypeEnum } from 'enums/CustomFormType';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FormCustomFormPicker } from 'app/components/Forms/FormCustomFormPicker';\r\nimport { AlertFormFilter } from 'app/components/pickers/AutocompletePickers/CustomFormPicker';\r\nimport { WorkOrderComments } from './WorkOrderComments';\r\nimport { isEmpty } from 'lodash';\r\nimport { RepetitiveFor } from 'app/components/Forms/FormRepetitive/slice/types';\r\n\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { WorkOrderDetailsProps } from '..';\r\nimport { useWorkOrderSlice } from '../slice';\r\n\r\nimport {\r\n  selectDowntimeOverlaps,\r\n  selectFieldHandler,\r\n  selectLinksProcessing,\r\n  selectOfflineEventEnd,\r\n  selectOfflineEventStart,\r\n  selectSavedLinkedOrders,\r\n} from '../slice/selectors';\r\nimport produce from 'immer';\r\nimport {\r\n  AdminServicesFilter,\r\n  initAssigneeAdminUsers,\r\n} from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { AddCalibrationWorkOrder } from './WorkOrderLinks/AddCalibrationWorkOrder';\r\nimport { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { LinkedList, WorkOrderLinks } from './WorkOrderLinks/WorkOrderLinks';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { WorkOrderApi } from 'api/WorkOrderApi';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\nimport { IndexNode } from 'app/components/Forms/FormsLayout/StyledForm';\r\nimport { Body, Caption } from 'app/components/Typography';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface WorkOrderFormProps {\r\n  onSubmit: (\r\n    item: WorkOrderDetailsState,\r\n    subFormFiles: IFormFileValue[],\r\n    staffFormFiles: IFormFileValue[],\r\n  ) => void;\r\n  initialValues: WorkOrderDetailsState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isEdit: boolean;\r\n  repetitiveFormRef: React.MutableRefObject<any>;\r\n  workOrderTypeFormRef: React.MutableRefObject<any>;\r\n  workOrderStaffFormRef: React.MutableRefObject<any>;\r\n  readonlyDetails?: WorkOrderReadonlyState;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  handleTypeChange: (type: IWorkOrderTypeDto | undefined) => void;\r\n  canView?: boolean;\r\n  commentsFormRef: React.MutableRefObject<any>;\r\n  onAssetClicked?: (asset: Entity<number>) => void;\r\n  onLinkedClick?: (linked: Entity<number>) => void;\r\n  expanded: boolean;\r\n  formRef: React.MutableRefObject<FormikProps<WorkOrderDetailsState> | null>;\r\n  setWorkOrderOfflineStartChangedValue: React.Dispatch<\r\n    React.SetStateAction<Date | string | null | undefined>\r\n  >;\r\n  setWorkOrderOfflineEndChangedValue: React.Dispatch<\r\n    React.SetStateAction<Date | string | null | undefined>\r\n  >;\r\n  useSidePanel?: boolean;\r\n  pageLink?: string;\r\n  showShortView?: boolean;\r\n  isCover?: boolean;\r\n  bringUp?: boolean;\r\n}\r\n\r\nexport const WorkOrderForm = React.memo(function WorkOrderForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isEdit,\r\n  isAdmin,\r\n  user,\r\n  handleTypeChange,\r\n  repetitiveFormRef,\r\n  workOrderTypeFormRef,\r\n  workOrderStaffFormRef,\r\n  readonlyDetails,\r\n  canView,\r\n  commentsFormRef,\r\n  setWorkOrderOfflineStartChangedValue,\r\n  setWorkOrderOfflineEndChangedValue,\r\n  onAssetClicked,\r\n  expanded,\r\n  formRef,\r\n  onLinkedClick,\r\n  useSidePanel,\r\n  pageLink,\r\n  showShortView,\r\n  isCover,\r\n  bringUp,\r\n}: WorkOrderFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { actions: workOrderActions } = useWorkOrderSlice();\r\n  // const [addToLinked, setAddToLinked] = React.useState<Entity<number> | null>(\r\n  //   null,\r\n  // );\r\n  const readonly = !isAdmin && isEdit;\r\n  const firstDayOfWeek = useSelector(selectSystemFirstDayOfWeek);\r\n  const fieldHandler = useSelector(selectFieldHandler);\r\n  const savedLinkedOrders = useSelector(selectSavedLinkedOrders);\r\n  const linksProcessing = useSelector(selectLinksProcessing);\r\n  const overlaps = useSelector(selectDowntimeOverlaps);\r\n  // const linkedCalibrationsChanged = useSelector(selectCalibrationsChanged);\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value, originalSubFormFiles, originalStaffFormFiles);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(workOrderActions.resetValueHandler());\r\n  };\r\n  const [unlimitedDowntime, setUnlimitedDowntime] = React.useState<boolean>(\r\n    isEdit &&\r\n      initialValues.OfflineEventEnd !== null &&\r\n      initialValues.OfflineEventEnd !== undefined &&\r\n      dateUtils\r\n        .dateOrStringToDate(initialValues.OfflineEventEnd)\r\n        .getFullYear() === 9999,\r\n  );\r\n  const [typeChanged, setTypeChanged] = React.useState<boolean>(false);\r\n  const [downTimeChanged, setDownTimeChanged] = React.useState<boolean>(false);\r\n  const [allIsValid, setAllIsValid] = React.useState<boolean>(true);\r\n  const [remindBeforeChanged, setRemindBeforeChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [originalSubFormFiles, setOriginalSubFormFiles] = React.useState<\r\n    IFormFileValue[]\r\n  >([]);\r\n  const [originalStaffFormFiles, setOriginalStaffFormFiles] = React.useState<\r\n    IFormFileValue[]\r\n  >([]);\r\n  const linkedWorkOrders = useAsyncGetWthEffect<LinkedList[]>(\r\n    //WorkOrderApi.getLinkedToCalibration(initialValues.Id),\r\n    async (): Promise<LinkedList[]> => {\r\n      if (isEdit) {\r\n        if (linksProcessing === true) {\r\n          return new Promise<LinkedList[]>(resolve => {\r\n            resolve(linkedWorkOrders);\r\n          });\r\n        } else {\r\n          return WorkOrderApi.getLinkedToCalibration(initialValues.Id).then(\r\n            res => {\r\n              return res.Links as LinkedList[];\r\n            },\r\n          );\r\n        }\r\n      } else {\r\n        return new Promise<LinkedList[]>(resolve => {\r\n          resolve(\r\n            savedLinkedOrders.map(f => {\r\n              return {\r\n                Id: f.Id,\r\n                Name: `#${f.Id}: ${f.AssetName} - ${f.Name}`,\r\n                ParentId: -1,\r\n                Linked: [],\r\n              };\r\n            }),\r\n          );\r\n        });\r\n      }\r\n    },\r\n    [],\r\n    [savedLinkedOrders, linksProcessing],\r\n  );\r\n  const { newDate } = useSystemDate();\r\n  const updateFormValues = (\r\n    original: IFormValueDto[],\r\n    coming: IFormValueDto[],\r\n    alertId: number | null,\r\n    typeId: number | null,\r\n  ) => {\r\n    const result = coming.map(v => {\r\n      let orn = original.find(o => o.FormFieldId === v.FormFieldId);\r\n      if (!!orn) {\r\n        return Object.assign({}, orn, {\r\n          Value: v.Value,\r\n          AlertId: alertId,\r\n          AlertTypeId: typeId,\r\n        });\r\n      } else {\r\n        return Object.assign(v, {\r\n          AlertId: alertId,\r\n          AlertTypeId: typeId,\r\n        });\r\n      }\r\n    });\r\n    //console.log('form values:', result);\r\n    return result;\r\n  };\r\n  const workOrderSchema = React.useMemo(() => {\r\n    return getWorkOrdersShema(t);\r\n  }, [t]);\r\n  const handleFormChange = React.useCallback(\r\n    (values: WorkOrderDetailsState, isValid, dirty, setValue) => {\r\n      if (typeChanged) {\r\n        let type = values.WorkOrderType as IWorkOrderTypeDto;\r\n        handleTypeChange(type);\r\n        if (!!type) {\r\n          if (type.DefaultSubject !== null) {\r\n            setValue('AlertTitle', type.DefaultSubject, false);\r\n          }\r\n          if (initialValues.ToDown) {\r\n            setValue('Downtime', true, false);\r\n            setValue('OfflineEventStart', newDate(), true);\r\n            (async () => {\r\n              try {\r\n                let id = type.DowntimeReasonTypeId ?? 3; // - Unexpected Malfunction\r\n                const reason = await initReasonTypeData(id.toString());\r\n                if (!!reason && reason.length > 0) {\r\n                  setValue('ReasonType', reason[0], false);\r\n                }\r\n              } catch {}\r\n            })();\r\n          } else if (type.DowntimeDuration !== null) {\r\n            setValue('Downtime', true, false);\r\n            if (values.EventStart !== null) {\r\n              let endTime = dateUtils.addHours(\r\n                dateUtils.dateOrStringToDate(values.EventStart),\r\n                type.DowntimeDuration,\r\n              );\r\n              setValue('OfflineEventStart', values.EventStart, false);\r\n              setValue('OfflineEventEnd', endTime, false);\r\n              if (type.DowntimeReasonTypeId != null) {\r\n                (async () => {\r\n                  try {\r\n                    let id = type.DowntimeReasonTypeId ?? 0;\r\n                    const reason = await initReasonTypeData(id.toString());\r\n                    if (!!reason && reason.length > 0) {\r\n                      setValue('ReasonType', reason[0], false);\r\n                    }\r\n                  } catch {}\r\n                })();\r\n              }\r\n            }\r\n          } else {\r\n            setValue('Downtime', false, false);\r\n          }\r\n          setValue(\r\n            'AutoCreateTitle',\r\n            GetAutoCreateTitle(\r\n              type,\r\n              values.EventStart,\r\n              firstDayOfWeek as WeekStartsOn,\r\n            ),\r\n            false,\r\n          );\r\n          if (type.DefaultRemaindBefore !== null) {\r\n            let remb = getSingleReminder(type.DefaultRemaindBefore);\r\n            if (!!remb) {\r\n              setValue('RemindBefore', remb, false);\r\n              setValue('AlertStart', getAlertStart(remb.Id, values.EventStart));\r\n            }\r\n          }\r\n          let assignee: Entity<string>[] = [];\r\n          if (type.AssignedUsers.length > 0) {\r\n            assignee.concat(type.AssignedUsers);\r\n          }\r\n          if (type.AssignedToCreator && !!user) {\r\n            assignee.push({\r\n              Id: user.Id,\r\n              Name: user.FormatedName || user.Id,\r\n            });\r\n          }\r\n          (async () => {\r\n            try {\r\n              let assets = values.Assets as IAssetDto[]; // - Unexpected Malfunction\r\n              const users = await initAssigneeAdminUsers(\r\n                type,\r\n                mapAssetsToServiceFilterDto(assets),\r\n              );\r\n              assignee.concat(users);\r\n              if (assignee.length > 0) {\r\n                setValue('AssignUsers', assignee, false);\r\n              }\r\n            } catch {}\r\n          })();\r\n        }\r\n        setTypeChanged(false);\r\n      }\r\n      if (downTimeChanged) {\r\n        if (values.Downtime) {\r\n          setValue('OfflineEventStart', newDate(), true);\r\n        }\r\n        setDownTimeChanged(false);\r\n      }\r\n      if (remindBeforeChanged) {\r\n        setValue(\r\n          'AlertStart',\r\n          getAlertStart(values.RemindBefore?.Id ?? 0, values.EventStart),\r\n        );\r\n        setRemindBeforeChanged(false);\r\n      }\r\n    },\r\n    [\r\n      downTimeChanged,\r\n      firstDayOfWeek,\r\n      handleTypeChange,\r\n      initialValues.ToDown,\r\n      newDate,\r\n      remindBeforeChanged,\r\n      typeChanged,\r\n      user,\r\n    ],\r\n  );\r\n  React.useEffect(() => {\r\n    if (formRef.current) {\r\n      formRef.current.validateForm();\r\n    }\r\n  }, [formRef]);\r\n  const validateForms = React.useCallback((isValid: boolean) => {\r\n    setAllIsValid(isValid);\r\n  }, []);\r\n  const changeLinkedOrders = React.useCallback(\r\n    (\r\n      orders: IWorkOrderDetailsDto[],\r\n      operation: 'add' | 'remove' | 'update',\r\n    ) => {\r\n      if (operation === 'add') {\r\n        let addedOrders = orders.filter(\r\n          f => !savedLinkedOrders.some(s => s.Id === f.Id),\r\n        );\r\n        dispatch(\r\n          workOrderActions.setSavedLinkedOrders([\r\n            ...savedLinkedOrders,\r\n            ...addedOrders,\r\n          ]),\r\n        );\r\n      }\r\n      if (operation === 'remove') {\r\n        let removedOrders = savedLinkedOrders.filter(f => {\r\n          return !orders.some(a => a.Id === f.Id);\r\n        });\r\n        dispatch(workOrderActions.setSavedLinkedOrders(removedOrders));\r\n      }\r\n      if (operation === 'update') {\r\n        dispatch(\r\n          workOrderActions.setSavedLinkedOrders(\r\n            savedLinkedOrders.map(f => {\r\n              let order = orders.find(s => s.Id === f.Id);\r\n              if (!!order && order !== null) {\r\n                return Object.assign({}, f, order);\r\n              } else {\r\n                return f;\r\n              }\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n    },\r\n    [dispatch, savedLinkedOrders, workOrderActions],\r\n  );\r\n  const removeCalibrationOrder = React.useCallback(\r\n    (linked: LinkedList) => {\r\n      dispatch(\r\n        workOrderActions.removeLinkedCalibration({\r\n          id: linked.ParentId,\r\n          link: linked.Id,\r\n        }),\r\n      );\r\n    },\r\n    [dispatch, workOrderActions],\r\n  );\r\n  const addCalibrationOrder = React.useCallback(\r\n    (linked: Entity<number>) => {\r\n      dispatch(\r\n        workOrderActions.addLinkedCalibration({\r\n          id: initialValues.Id,\r\n          link: linked.Id,\r\n        }),\r\n      );\r\n    },\r\n    [dispatch, initialValues.Id, workOrderActions],\r\n  );\r\n  const handleOfflineEventStartChange = (v: any) => {\r\n    dispatch(\r\n      workOrderActions.setOfflineEventStart(\r\n        dateUtils.tryParse(v) === null\r\n          ? undefined\r\n          : dateUtils.formatQueryStringDate(v),\r\n      ),\r\n    );\r\n  };\r\n  const handleOfflineEventEndChange = (v: any) => {\r\n    dispatch(\r\n      workOrderActions.setOfflineEventEnd(\r\n        // dateUtils.tryFormatIso(dateUtils.tryParse(v)) ?? undefined,\r\n        dateUtils.tryParse(v) === null\r\n          ? undefined\r\n          : dateUtils.formatQueryStringDate(v),\r\n      ),\r\n    );\r\n  };\r\n  const OfflineEventStart = useSelector(selectOfflineEventStart);\r\n  const OfflineEventEnd = useSelector(selectOfflineEventEnd);\r\n  const warningMessages: IndexNode[] = React.useMemo(() => {\r\n    let nodes: IndexNode[] = [];\r\n    if (!!overlaps && overlaps.length > 0) {\r\n      nodes.push({\r\n        index: 'overlapsLinks',\r\n        node: (\r\n          <div\r\n            style={{\r\n              display: 'flex',\r\n              flexDirection: 'column',\r\n              gap: 8,\r\n            }}\r\n          >\r\n            <Body size=\"small\" bold={true}>\r\n              {t(translations.InstrumentHasOverlappingDowntimeEvents) as string}\r\n            </Body>\r\n            <Caption>\r\n              {t(translations.ShowAllDowntimeEventsOn) as string}\r\n            </Caption>\r\n            <div\r\n              style={{\r\n                display: 'flex',\r\n                alignSelf: 'stretch',\r\n                gap: 8,\r\n              }}\r\n            >\r\n              <Button\r\n                size={'small'}\r\n                href={`/workorders?aid=${overlaps\r\n                  .filter(f => f.AssetId !== -1)\r\n                  .map(f => f.AssetId)\r\n                  .join(',')}&downTime=2`}\r\n                aria-label=\"work orders\"\r\n                target=\"_blank\"\r\n              >\r\n                {t(translations.menu_WorkOrders) as string}\r\n              </Button>\r\n              <CalendarButton\r\n                size=\"small\"\r\n                variant=\"white\"\r\n                equipments={overlaps\r\n                  .filter(f => f.ServiceId !== -1)\r\n                  .map(f => f.ServiceId)}\r\n              >\r\n                {t(translations.Calendar) as string}\r\n              </CalendarButton>\r\n            </div>\r\n\r\n            {/* <Link\r\n              href={`/schedule/calendar/?eid=${overlaps\r\n                .filter(f => f.ServiceId !== -1)\r\n                .map(f => f.ServiceId)\r\n                .join(',')}`}\r\n              aria-label=\"calendar\"\r\n              target=\"_blank\"\r\n            >\r\n              {t(translations.Calendar) as string}\r\n            </Link> */}\r\n          </div>\r\n        ),\r\n        variant: 'outlined',\r\n      });\r\n    }\r\n    return nodes;\r\n  }, [overlaps, t]);\r\n  // React.useEffect(() => {\r\n  //   if (linkedCalibrationsChanged === true) {\r\n  //     dispatch(workOrderActions.setCalibrationChanged(undefined));\r\n  //   }\r\n  // }, [dispatch, linkedCalibrationsChanged, workOrderActions]);\r\n  React.useEffect(() => {\r\n    if (\r\n      isEdit &&\r\n      !!initialValues.OfflineEventStart &&\r\n      initialValues.OfflineEventStart !== null\r\n    ) {\r\n      dispatch(workOrderActions.checkDowntimeOverlaps(initialValues.Id));\r\n    }\r\n  }, [\r\n    bringUp,\r\n    dispatch,\r\n    initialValues.Id,\r\n    initialValues.OfflineEventStart,\r\n    isEdit,\r\n    workOrderActions,\r\n  ]);\r\n  React.useEffect(() => {\r\n    formRef.current?.setValues(\r\n      produce(v => {\r\n        if (OfflineEventStart !== undefined) {\r\n          v.OfflineEventStart = dateUtils.parseISOOrNull(OfflineEventStart);\r\n        }\r\n        if (OfflineEventEnd !== undefined) {\r\n          v.OfflineEventEnd = dateUtils.parseISOOrNull(OfflineEventEnd);\r\n        }\r\n      }),\r\n    );\r\n  }, [OfflineEventStart, OfflineEventEnd, formRef]);\r\n\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={workOrderSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        isInitialValid={false}\r\n        validateOnChange={true}\r\n        innerRef={formRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          if (allIsValid) {\r\n            formikHelpers.validateForm(values).then(responseErrors => {\r\n              if (!isEmpty(responseErrors)) {\r\n                formikHelpers.setSubmitting(false);\r\n                console.debug('errors', responseErrors);\r\n              } else {\r\n                console.debug('submitting', values);\r\n                formikHelpers.setSubmitting(true);\r\n                handleSubmit(values);\r\n              }\r\n            });\r\n          } else {\r\n            formikHelpers.setSubmitting(false);\r\n          }\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Work order errors', formik.errors);\r\n          }\r\n          return (\r\n            <>\r\n              <StyledForm onSubmit={formik.handleSubmit} isCover={isCover}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['WorkOrderType', 'Downtime', 'RemindBefore']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={resetFieldHandler}\r\n                />\r\n                <FormLeftSection\r\n                  isCover={isCover}\r\n                  info={\r\n                    (formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                      .NotEditable === true && formik.values.IsClosed === true\r\n                      ? (t(translations.LockedClosedRecord) as string)\r\n                      : undefined\r\n                  }\r\n                  warningNodes={warningMessages}\r\n                >\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.EventDetails) as string}\r\n                  >\r\n                    <FormRow isCover={isCover} fullRow={true}>\r\n                      <FormAssetsPicker\r\n                        predicates={AssetsFilterForWorkOrder(\r\n                          (formik.values.WorkOrderType as IWorkOrderTypeDto) ??\r\n                            undefined,\r\n                        )}\r\n                        name=\"Assets\"\r\n                        label={t(translations.Asset) as string}\r\n                        placeholder={t(translations.PleaseSelectAsset)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          isEdit ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        onChipClick={onAssetClicked}\r\n                        //onChange={() => setAssetChanged(true)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n\r\n                    <FormRow isCover={isCover}>\r\n                      <FormTextField\r\n                        name=\"AlertTitle\"\r\n                        label={t(translations.AlertName)}\r\n                        placeholder={t(translations.AlertName)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        autoComplete=\"on\"\r\n                        id=\"AlertTitleId\"\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow isCover={isCover} fullRow={true}>\r\n                      <FormAdminUsersPicker\r\n                        name=\"AssignUsers\"\r\n                        label={t(translations.AssignedUsers)}\r\n                        placeholder={t(translations.PleaseSelectAnAssigneeUser)}\r\n                        predicates={AdminServicesFilter(\r\n                          mapAssetsToServiceFilterDto(\r\n                            formik.values.Assets as IAssetDto[],\r\n                          ),\r\n                        )}\r\n                        multiple={true}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow\r\n                      isCover={isCover}\r\n                      hide={\r\n                        initialValues.WorkOrderType !== null &&\r\n                        initialValues.ToDown === false\r\n                      }\r\n                    >\r\n                      <FormWorkOrderTypePicker\r\n                        name=\"WorkOrderType\"\r\n                        disableClearable\r\n                        label={t(translations.AlertType)}\r\n                        placeholder={t(translations.PleaseSelectAnAlertType)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          isEdit ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        onChange={() => setTypeChanged(true)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow isCover={isCover} hide={!isEdit}>\r\n                      <FormWorkOrderTypeStatusPicker\r\n                        name=\"WorkOrderTypeStatus\"\r\n                        typeId={formik.values.WorkOrderType?.Id}\r\n                        label={t(translations.EventTypeStatus)}\r\n                        placeholder={t(\r\n                          translations.PleaseSelectAnAlertTypeStatus,\r\n                        )}\r\n                        info=\"Just for test\"\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        //onChange={() => setStatusChanged(true)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow\r\n                      isCover={isCover}\r\n                      hide={\r\n                        formik.values.WorkOrderType === null ||\r\n                        (formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                          .ReportSymptoms !== true\r\n                      }\r\n                    >\r\n                      <FormSymptomCodesPicker\r\n                        name=\"SymptomCodes\"\r\n                        AssetCats={\r\n                          formik.values.Assets.length > 0\r\n                            ? formik.values.Assets.filter(\r\n                                f =>\r\n                                  !isNullOrUndefined(\r\n                                    (f as IAssetDto).AssetCatId,\r\n                                  ),\r\n                              ).map(\r\n                                asset => (asset as IAssetDto).AssetCatId ?? 0,\r\n                              )\r\n                            : undefined\r\n                        }\r\n                        label={t(translations.SymptomCodes)}\r\n                        placeholder={t(\r\n                          translations.PleaseSelectAnAlertSymptomCode,\r\n                        )}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow\r\n                      isCover={isCover}\r\n                      hide={\r\n                        !(\r\n                          isEdit &&\r\n                          formik.values.WorkOrderType !== null &&\r\n                          (formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .RepairCodesEnabled\r\n                        )\r\n                      }\r\n                    >\r\n                      <FormRepairCodesPicker\r\n                        name=\"RepairCodes\"\r\n                        AssetCatIds={\r\n                          formik.values.Assets.length > 0\r\n                            ? formik.values.Assets.filter(\r\n                                f =>\r\n                                  !isNullOrUndefined(\r\n                                    (f as IAssetDto).AssetCatId,\r\n                                  ),\r\n                              ).map(\r\n                                asset => (asset as IAssetDto).AssetCatId ?? 0,\r\n                              )\r\n                            : undefined\r\n                        }\r\n                        label={t(translations.RepairCodes)}\r\n                        placeholder={t(\r\n                          translations.PleaseSelectAnAlertRepairCode,\r\n                        )}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow isCover={isCover}>\r\n                      <FormBookitDateTimePicker\r\n                        name=\"EventStart\"\r\n                        // label={t(translations.EventDueDate)}\r\n                        label={t(translations.EventDueDateTimeLabel)}\r\n                        labelInline={true}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow isCover={isCover}>\r\n                      <FormRemindBeforePicker\r\n                        name=\"RemindBefore\"\r\n                        label={t(translations.RemindMeBefore)}\r\n                        info={t(translations.RemindMeBefore_Description)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        onChange={() => setRemindBeforeChanged(true)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow\r\n                      isCover={isCover}\r\n                      hide={!(formik.values.RemindBefore?.Id === 6)}\r\n                    >\r\n                      <FormBookitDateTimePicker\r\n                        name=\"AlertStart\"\r\n                        // label={t(translations.AlertStart)}\r\n                        label={t(translations.AlertStartTimeLabel)}\r\n                        labelInline={true}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                  {formik.values.Assets.length > 0 &&\r\n                    (formik.values.Assets as IAssetDto[])[0].ServiceTypeId ===\r\n                      ServiceType.Online &&\r\n                    ((isEdit &&\r\n                      (isAdmin || initialValues.OfflineEventStart !== null)) ||\r\n                      (!isEdit && isAdmin)) && (\r\n                      <FormFieldsSection\r\n                        withTopSeparator={formik.values.Downtime}\r\n                        withBottomSeparator={\r\n                          formik.values.Downtime && !expanded\r\n                        }\r\n                      >\r\n                        <FormRow isCover={isCover} fullRow>\r\n                          <FormSwitch\r\n                            boldLebel\r\n                            name=\"Downtime\"\r\n                            label={t(translations.Downtime)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              readonly ||\r\n                              ((formik.values\r\n                                .WorkOrderType as IWorkOrderTypeDto)\r\n                                .NotEditable === true &&\r\n                                formik.values.IsClosed === true)\r\n                            }\r\n                            onChange={() => setDownTimeChanged(true)}\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow\r\n                          isCover={isCover}\r\n                          hide={!formik.values.Downtime}\r\n                          fullRow\r\n                        >\r\n                          <FormReasonTypePicker\r\n                            name=\"ReasonType\"\r\n                            label={t(translations.Reason)}\r\n                            placeholder={t(\r\n                              translations.PleaseSelectAReasonType,\r\n                            )}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              readonly ||\r\n                              ((formik.values\r\n                                .WorkOrderType as IWorkOrderTypeDto)\r\n                                .NotEditable === true &&\r\n                                formik.values.IsClosed === true)\r\n                            }\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow\r\n                          isCover={isCover}\r\n                          hide={!formik.values.Downtime}\r\n                        >\r\n                          <FormBookitDateTimePicker\r\n                            name=\"OfflineEventStart\"\r\n                            id=\"offlineStartId\"\r\n                            // label={t(translations.OfflineEventStart)}\r\n                            label={t(translations.OfflineEventStartLabel)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              readonly ||\r\n                              ((formik.values\r\n                                .WorkOrderType as IWorkOrderTypeDto)\r\n                                .NotEditable === true &&\r\n                                formik.values.IsClosed === true)\r\n                            }\r\n                            onChange={handleOfflineEventStartChange}\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow\r\n                          isCover={isCover}\r\n                          hide={!formik.values.Downtime || unlimitedDowntime}\r\n                        >\r\n                          <FormBookitDateTimePicker\r\n                            name=\"OfflineEventEnd\"\r\n                            id=\"offlineEndId\"\r\n                            // label={t(translations.OfflineEventEnd)}\r\n                            label={t(translations.OfflineEventEndLabel)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              readonly ||\r\n                              ((formik.values\r\n                                .WorkOrderType as IWorkOrderTypeDto)\r\n                                .NotEditable === true &&\r\n                                formik.values.IsClosed === true)\r\n                            }\r\n                            onChange={handleOfflineEventEndChange}\r\n                            maskIfEmpty={false}\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow\r\n                          isCover={isCover}\r\n                          hide={!formik.values.Downtime || !unlimitedDowntime}\r\n                        >\r\n                          <FormUnlimitedDowntime\r\n                            onClick={() => {\r\n                              formik.setFieldValue(\r\n                                'OfflineEventEnd',\r\n                                dateUtils.formatISO(newDate()),\r\n                              );\r\n                              setUnlimitedDowntime(false);\r\n                            }}\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow\r\n                          isCover={isCover}\r\n                          hide={!formik.values.Downtime}\r\n                          fullRow\r\n                        >\r\n                          <FormRichTextField\r\n                            name=\"OfflineRemarks\"\r\n                            placeholder={t(\r\n                              translations.OfflineRemarksPlaceholder,\r\n                            )}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              readonly ||\r\n                              ((formik.values\r\n                                .WorkOrderType as IWorkOrderTypeDto)\r\n                                .NotEditable === true &&\r\n                                formik.values.IsClosed === true)\r\n                            }\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                        {/* <FormRow isCover={isCover} hide={!formik.values.Downtime || !isEdit}>\r\n                            <FormDowntimeLinks\r\n                              OfflineStart={\r\n                                formik.values.OfflineEventStart === null ||\r\n                                formik.values.OfflineEventStart === undefined\r\n                                  ? undefined\r\n                                  : dateUtils.dateOrStringToDate(\r\n                                      formik.values.OfflineEventStart,\r\n                                    )\r\n                              }\r\n                              OfflineEnd={\r\n                                formik.values.OfflineEventEnd === null ||\r\n                                formik.values.OfflineEventEnd === undefined\r\n                                  ? undefined\r\n                                  : dateUtils.dateOrStringToDate(\r\n                                      formik.values.OfflineEventEnd,\r\n                                    )\r\n                              }\r\n                              ServiceId={\r\n                                (formik.values.Assets[0] as IAssetDto)\r\n                                  .ServiceId ?? undefined\r\n                              }\r\n                              isAdmin={isAdmin}\r\n                            />\r\n                          </FormRow> */}\r\n                      </FormFieldsSection>\r\n                    )}\r\n                  {formik.values.WorkOrderType !== null &&\r\n                    (formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                      .CustomFormId !== null && (\r\n                      <CustomFormControl\r\n                        CustomFormId={\r\n                          (formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .CustomFormId ?? 0\r\n                        }\r\n                        isAdmin={isAdmin}\r\n                        values={formik.values.SubmissionFormValues}\r\n                        FormType={CustomFormTypeEnum.AlertType}\r\n                        submitFormRef={workOrderTypeFormRef}\r\n                        formIsValid={validateForms}\r\n                        formName={t(translations.SubmissionFormDetails)}\r\n                        readonly={formik.isSubmitting || readonly}\r\n                        // withSeparator={true}\r\n                        saveFormValues={(\r\n                          values: IFormValueDto[],\r\n                          files: IFormFileValue[],\r\n                          originalFiles: IFormFileValue[],\r\n                        ) => {\r\n                          formik.setFieldValue(\r\n                            'SubmissionFormValues',\r\n                            updateFormValues(\r\n                              formik.values.SubmissionFormValues,\r\n                              values,\r\n                              formik.values.Id > 0 ? formik.values.Id : null,\r\n                              formik.values.WorkOrderType?.Id || null,\r\n                            ),\r\n                            false,\r\n                          );\r\n                          formik.setFieldValue(\r\n                            'SubmissionFormFiles',\r\n                            files,\r\n                            false,\r\n                          );\r\n                          setOriginalSubFormFiles(originalFiles);\r\n                        }}\r\n                      />\r\n                    )}\r\n                </FormLeftSection>\r\n                <FormRightSection isCover={isCover}>\r\n                  {!isEdit && (\r\n                    <RepetitiveControl\r\n                      // withSeparator={showShortView}\r\n                      startDate={dateUtils.dateOrStringToDate(\r\n                        formik.values.EventStart,\r\n                      )}\r\n                      submitFormRef={repetitiveFormRef}\r\n                      title={t(translations.RecurringEvents) as string}\r\n                      type={RepetitiveFor.WorkOrder}\r\n                    />\r\n                  )}\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.Description) as string}\r\n                    // withSeparator={showShortView}\r\n                  >\r\n                    <FormRow isCover={isCover}>\r\n                      <FormRichTextField\r\n                        name=\"Description\"\r\n                        placeholder={t(translations.Description)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          readonly ||\r\n                          ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                            .NotEditable === true &&\r\n                            formik.values.IsClosed === true)\r\n                        }\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n\r\n                  <FormFieldsSection>\r\n                    <WorkOrderComments\r\n                      commentsFormRef={commentsFormRef}\r\n                      isEdit={isEdit}\r\n                      user={user}\r\n                      order={formik.values}\r\n                      isAdmin={isAdmin}\r\n                      disabled={\r\n                        (readonly &&\r\n                          !(user?.Id === formik.values.ReportedBy)) ||\r\n                        ((formik.values.WorkOrderType as IWorkOrderTypeDto)\r\n                          .NotEditable === true &&\r\n                          formik.values.IsClosed === true)\r\n                      }\r\n                    />\r\n                  </FormFieldsSection>\r\n\r\n                  {isEdit && formik.values.HasAletForm && (\r\n                    <React.Fragment>\r\n                      <FormFieldsSection\r\n                        // withSeparator={true}\r\n                        titleSection={t(translations.StaffFilledForm)}\r\n                      >\r\n                        <FormRow isCover={isCover}>\r\n                          <FormCustomFormPicker\r\n                            formType={CustomFormTypeEnum.Alert}\r\n                            name=\"StuffCustomForm\"\r\n                            placeholder={t(translations.PleaseSelectCustomForm)}\r\n                            disabled={\r\n                              formik.isSubmitting ||\r\n                              readonly ||\r\n                              ((formik.values\r\n                                .WorkOrderType as IWorkOrderTypeDto)\r\n                                .NotEditable === true &&\r\n                                formik.values.IsClosed === true)\r\n                            }\r\n                            filter={AlertFormFilter(\r\n                              formik.values.WorkOrderType?.Id || 0,\r\n                              (formik.values.Assets[0] as IAssetDto)\r\n                                .AssetCatId || 0,\r\n                            )}\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                      </FormFieldsSection>\r\n                      {formik.values.StuffCustomForm !== null &&\r\n                        formik.values.StuffCustomForm.Id !== 0 && (\r\n                          <CustomFormControl\r\n                            CustomFormId={formik.values.StuffCustomForm.Id ?? 0}\r\n                            readonly={readonly}\r\n                            isAdmin={isAdmin}\r\n                            values={formik.values.StaffFormValues}\r\n                            FormType={CustomFormTypeEnum.Alert}\r\n                            submitFormRef={workOrderStaffFormRef}\r\n                            formIsValid={validateForms}\r\n                            saveFormValues={(\r\n                              values: IFormValueDto[],\r\n                              files: IFormFileValue[],\r\n                              originalFiles: IFormFileValue[],\r\n                            ) => {\r\n                              formik.setFieldValue(\r\n                                'StaffFormValues',\r\n                                updateFormValues(\r\n                                  formik.values.StaffFormValues,\r\n                                  values,\r\n                                  formik.values.Id > 0\r\n                                    ? formik.values.Id\r\n                                    : null,\r\n                                  null,\r\n                                ),\r\n                                false,\r\n                              );\r\n                              formik.setFieldValue(\r\n                                'StaffFormFiles',\r\n                                files,\r\n                                false,\r\n                              );\r\n                              setOriginalStaffFormFiles(originalFiles);\r\n                            }}\r\n                          />\r\n                        )}\r\n                    </React.Fragment>\r\n                  )}\r\n\r\n                  {readonlyDetails !== undefined && isEdit && expanded && (\r\n                    <FormFieldsSection withBottomSeparator withTopSeparator>\r\n                      <CreationDetails details={readonlyDetails} />\r\n                    </FormFieldsSection>\r\n                  )}\r\n                  {(isEdit\r\n                    ? !!linkedWorkOrders && linkedWorkOrders.length > 0\r\n                    : savedLinkedOrders.length > 0) && (\r\n                    <WorkOrderLinks\r\n                      links={\r\n                        isEdit\r\n                          ? linkedWorkOrders\r\n                          : savedLinkedOrders.map(f => {\r\n                              return {\r\n                                Id: f.Id,\r\n                                Name: `${f.AssetName} - ${f.Name}`,\r\n                                ParentId: -1,\r\n                                Linked: [],\r\n                              };\r\n                            })\r\n                      }\r\n                      onHoverClick={item => {\r\n                        isEdit\r\n                          ? removeCalibrationOrder(item)\r\n                          : changeLinkedOrders(\r\n                              [\r\n                                (item as Entity<\r\n                                  number\r\n                                >) as IWorkOrderDetailsDto,\r\n                              ],\r\n                              'remove',\r\n                            );\r\n                      }}\r\n                      onItemClcik={item => {\r\n                        isEdit\r\n                          ? dispatch(\r\n                              actions.openSidePanel({\r\n                                type: RenderPageType.WorkOrderDetails,\r\n                                props: {\r\n                                  queryParams: { id: '' + item.Id },\r\n                                  useSidePanel: true,\r\n                                  continueTo: {\r\n                                    pageType: useSidePanel\r\n                                      ? RenderPageType.WorkOrderDetails\r\n                                      : undefined,\r\n                                    pageProps: useSidePanel\r\n                                      ? {\r\n                                          queryParams: {\r\n                                            id: '' + formik.values.Id,\r\n                                          },\r\n                                          useSidePanel: true,\r\n                                        }\r\n                                      : undefined,\r\n                                    continueToLink: useSidePanel\r\n                                      ? undefined\r\n                                      : pageLink,\r\n                                  },\r\n                                } as WorkOrderDetailsProps,\r\n                              }),\r\n                            )\r\n                          : !!onLinkedClick && onLinkedClick(item);\r\n                      }}\r\n                      showProcessing={linksProcessing}\r\n                    />\r\n                  )}\r\n                  {isAdmin &&\r\n                    formik.values.WorkOrderType !== null &&\r\n                    formik.values.Assets.length > 0 && (\r\n                      <FormRow isCover={isCover} fullRow={true}>\r\n                        <AddCalibrationWorkOrder\r\n                          showProcessing={linksProcessing}\r\n                          workOrederIds={\r\n                            isEdit\r\n                              ? [\r\n                                  ...linkedWorkOrders.map(f => f.Id),\r\n                                  ...[formik.values.Id],\r\n                                ]\r\n                              : savedLinkedOrders.map(f => f.Id)\r\n                          }\r\n                          saveLinkedOrders={value => {\r\n                            if (isEdit) {\r\n                              addCalibrationOrder({\r\n                                Id: value.Id,\r\n                                Name: value.Name,\r\n                              });\r\n                            } else {\r\n                              changeLinkedOrders([value], 'add');\r\n                            }\r\n                          }}\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                  {/* {readonlyDetails !== undefined &&\r\n                      readonlyDetails.LinkedAlerts.length > 0 &&\r\n                      isEdit && (\r\n                        <>\r\n                          {expanded ? (\r\n                            <FormFieldsSection\r\n                              titleSection={t(translations.LinkedTo)}\r\n                            >\r\n                              <>\r\n                                {readonlyDetails.LinkedAlerts.map((l, i) => {\r\n                                  return (\r\n                                    <HoverLinkedItem\r\n                                      linked={l}\r\n                                      key={l.Id + i}\r\n                                      useHoverButton={true}\r\n                                      onHoverClick={item =>\r\n                                        dispatch(\r\n                                          workOrderActions.removeFromLinked(\r\n                                            item.Id,\r\n                                          ),\r\n                                        )\r\n                                      }\r\n                                    >\r\n                                      <Button\r\n                                        variant=\"text\"\r\n                                        size=\"small\"\r\n                                        onClick={() =>\r\n                                          dispatch(\r\n                                            actions.openSidePanel({\r\n                                              type:\r\n                                                RenderPageType.WorkOrderDetails,\r\n                                              props: {\r\n                                                queryParams: { id: '' + l.Id },\r\n                                                useSidePanel: true,\r\n                                              } as WorkOrderDetailsProps,\r\n                                            }),\r\n                                          )\r\n                                        }\r\n                                      >\r\n                                        #{l.Id} - {l.Name}\r\n                                      </Button>\r\n                                    </HoverLinkedItem>\r\n                                  );\r\n                                })}\r\n                              </>\r\n                            </FormFieldsSection>\r\n                          ) : (\r\n                            <FormFieldsSection>\r\n                              <Button\r\n                                variant=\"text\"\r\n                                size=\"small\"\r\n                                onClick={() =>\r\n                                  dispatch(actions.setExpanded(true))\r\n                                }\r\n                              >\r\n                                {t(translations.LinkedWorkOrders).replace(\r\n                                  '{0}',\r\n                                  readonlyDetails.LinkedAlerts.length.toString(),\r\n                                )}\r\n                              </Button>\r\n                            </FormFieldsSection>\r\n                          )}\r\n                        </>\r\n                      )}\r\n                    {initialValues.RecurringAssetId &&\r\n                      isEdit &&\r\n                      isAdmin &&\r\n                      expanded && (\r\n                        <span style={{ display: 'flex' }}>\r\n                          <BaseURLPicker\r\n                            url=\"/api/odata/v4/workorders/GetAllowedWorkOrders\"\r\n                            queryfilter={new Condition(\r\n                              'Id',\r\n                              ODataOperators.Excludes,\r\n                              readonlyDetails?.LinkedAlerts ?? [],\r\n                            ).toString()}\r\n                            onChange={v => setAddToLinked(v)}\r\n                            value={addToLinked}\r\n                          />\r\n                          <Button\r\n                            disabled={!addToLinked}\r\n                            onClick={() =>\r\n                              dispatch(\r\n                                workOrderActions.addToLinked({\r\n                                  id: addToLinked!.Id,\r\n                                  link: initialValues.RecurringAssetId!,\r\n                                }),\r\n                              )\r\n                            }\r\n                          >\r\n                            Add to linked\r\n                          </Button>\r\n                        </span>\r\n                      )} */}\r\n                </FormRightSection>\r\n              </StyledForm>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import {\r\n  formFileSchema,\r\n  formValueSchema,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport {\r\n  EntityNumberSchema,\r\n  EntityStringSchema,\r\n} from 'app/components/Forms/Schemas';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport * as Yup from 'yup';\r\nimport { WorkOrderDetailsState } from '../slice/types';\r\n\r\nexport const getWorkOrdersShema = (\r\n  t: TFunction,\r\n): Yup.SchemaOf<WorkOrderDetailsState> => {\r\n  return Yup.object({\r\n    Id: Yup.number().notRequired().default(-1),\r\n    Assets: Yup.array()\r\n      .of(EntityNumberSchema)\r\n      .label(t(translations.Asset) as string)\r\n      .min(1)\r\n      .required(t(translations.err_AssetRequired)),\r\n    WorkOrderType: Yup.mixed()\r\n      .label(t(translations.AlertType) as string)\r\n      .required(t(translations.errEvent_Type_Required) as string)\r\n      .typeError(t(translations.errEvent_Type_Required) as string),\r\n    AlertTitle: Yup.string()\r\n      .label(t(translations.AlertName) as string)\r\n      .nullable(true)\r\n      .required(t(translations.err_AlertNameRequired) as string),\r\n    WorkOrderTypeStatus: Yup.mixed()\r\n      .label(t(translations.EventTypeStatus) as string)\r\n      .required(t(translations.errEvent_Type_Status_Required) as string),\r\n    EventStart: Yup.date()\r\n      .label(t(translations.EventDueDate) as string)\r\n      .default(dateUtils.dateOrStringToDate(new Date()))\r\n\r\n      .required(() => t(translations.err_EventDueDateRequired) as string),\r\n    EventEnd: Yup.date().notRequired().nullable(),\r\n    RemindBefore: Yup.mixed().label(t(translations.RemindMeBefore) as string),\r\n    AlertStart: Yup.date()\r\n      .label(t(translations.AlertStartTimeLabel) as string)\r\n      .nullable()\r\n      .when('RemindBefore', {\r\n        is: val => val.Id === 6,\r\n        then: Yup.date()\r\n          .label(t(translations.AlertStartTimeLabel) as string)\r\n          .default(\r\n            dateUtils.addDays(dateUtils.dateOrStringToDate(new Date()), -1),\r\n          )\r\n          .nullable()\r\n          .required(\r\n            `${t(translations.AlertStartTimeLabel) as string} is required.`,\r\n          )\r\n          .max(Yup.ref('EventStart')),\r\n      }),\r\n    SymptomCodes: Yup.array()\r\n      .of(EntityNumberSchema)\r\n      .label(t(translations.SymptomCodes) as string),\r\n\r\n    AssignUsers: Yup.array()\r\n      .of(EntityStringSchema)\r\n      .label(t(translations.AssignedUsers) as string),\r\n    RepairCodes: Yup.array()\r\n      .of(EntityNumberSchema)\r\n      .label(t(translations.RepairCodes) as string),\r\n    Description: Yup.string()\r\n      .label(t(translations.Description) as string)\r\n      .nullable(),\r\n    Downtime: Yup.boolean().label(t(translations.Downtime) as string),\r\n    OfflineEventStart: Yup.date()\r\n      .label(t(translations.OfflineEventStartLabel) as string)\r\n      .nullable()\r\n      .when('Downtime', {\r\n        is: check => check === true,\r\n        then: Yup.date()\r\n          .label(t(translations.OfflineEventStartLabel) as string)\r\n          .nullable()\r\n          .required(t(translations.OfflineEventStartRequired) as string),\r\n      }),\r\n    OfflineEventEnd: Yup.date()\r\n      .label(t(translations.OfflineEventEndLabel) as string)\r\n      .nullable()\r\n      .when('OfflineEventStart', {\r\n        is: start => start != null,\r\n        then: Yup.date()\r\n          .label(t(translations.OfflineEventEndLabel) as string)\r\n          .nullable()\r\n          .min(\r\n            Yup.ref('OfflineEventStart'),\r\n            t(translations.err_DownTimeEndGreaterThenStart) as string,\r\n          ),\r\n      }),\r\n    OfflineRemarks: Yup.string().nullable(),\r\n    ReasonType: Yup.mixed(),\r\n    ToDown: Yup.boolean().default(false),\r\n    AutoCreateTitle: Yup.string().nullable(true).notRequired(),\r\n    RecurringAssetId: Yup.number().nullable(true).notRequired().default(null),\r\n    RecurringGroupId: Yup.number().nullable(true).notRequired().default(null),\r\n    StaffFormValues: Yup.array().of(formValueSchema),\r\n    SubmissionFormValues: Yup.array().of(formValueSchema),\r\n    SubmissionFormFiles: Yup.array().of(formFileSchema),\r\n    StaffFormFiles: Yup.array().of(formFileSchema),\r\n    StuffCustomForm: Yup.mixed().nullable(true).notRequired().default(null),\r\n    HasAletForm: Yup.boolean().default(false),\r\n    IsClosed: Yup.boolean().default(false),\r\n    ClosedStatuses: Yup.array().of(EntityNumberSchema),\r\n    ReportedBy: Yup.string().nullable(true),\r\n    ShowOnCalibrationHistory: Yup.boolean().default(false),\r\n    NotEditable: Yup.boolean().default(false),\r\n    ReservationId: Yup.number().nullable(true).notRequired().default(null),\r\n  });\r\n};\r\n","import { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectExpandedSidePanel,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { useWorkOrderSlice } from './slice';\r\nimport {\r\n  selectCreateWorkOrder,\r\n  selectCreateWorkOrderCompleted,\r\n  selectCreateWorkOrderHasError,\r\n  selectCreateWorkOrderProcessing,\r\n  selectReadonlyWorkOrder,\r\n  selectReservationOfflineCompleted,\r\n  selectReservationOfflineData,\r\n  selectReservationOfflineProcessing,\r\n  selectSendEmailOnResOffline,\r\n  selectUpdateWorkOrder,\r\n  selectUpdateWorkOrderCompleted,\r\n  selectUpdateWorkOrderHasError,\r\n  selectUpdateWorkOrderProcessing,\r\n  selectWorkOrderProcessing,\r\n} from './slice/selectors';\r\nimport {\r\n  ContinueToState,\r\n  WorkOrderDetailsState,\r\n  WorkOrderGlobalState,\r\n  WorkOrderQueryStringParameters,\r\n} from './slice/types';\r\nimport * as React from 'react';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { push, routerActions } from 'connected-react-router';\r\nimport {\r\n  DeleteOrderButton,\r\n  ReopenOrderButton,\r\n  SaveFormButton,\r\n} from './Actions/WorkOrderActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { WorkOrderForm } from './WorkOrderForm';\r\nimport { Roles } from 'app/slice/types';\r\nimport {\r\n  IAssetDto,\r\n  mapAssetsToServiceTypeFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { selectRepetitiveData } from 'app/components/Forms/FormRepetitive/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IWorkOrderTypeDto } from 'api/odata/generated/entities/IWorkOrderTypeDto';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport Box from '@material-ui/core/Box';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IWorkOrderTypeStatusDto } from 'api/odata/generated/entities/IWorkOrderTypeStatusDto';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { WorkOrderApi as api } from 'api/WorkOrderApi';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ActionIconButton } from 'app/components/BasicButtons/ActionIconButton';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { RadioGroup } from 'app/components/RadioGroup';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport {\r\n  SwitchActionsProps,\r\n  SwitchTarget,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/SwitchActions';\r\nimport { FormikProps } from 'formik';\r\nimport { CalendarButton } from 'app/components/CalendarButton';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { FlexRowDiv } from 'app/components/basic/Wrappers/FlexWrappers/flexRow';\r\nimport { H3 } from 'app/components/Typography';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { MenuItem } from '@material-ui/core';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nexport type NotifyUsersRadioGroupOptionTypes =\r\n  | 'No'\r\n  | 'JustBookedUsers'\r\n  | 'AllAffectedUsers';\r\n\r\nexport type CancelAffectedReservationsRadioGroupOptionTypes = 'No' | 'Yes';\r\nexport type ContinueWOAction = 'list' | 'edit';\r\nexport interface WorkOrderDetailsProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  queryParams: WorkOrderQueryStringParameters;\r\n  useSwithButtons?: boolean;\r\n  continueTo?: ContinueToState;\r\n  onClose?: () => void;\r\n}\r\nexport function WorkOrderDetails(props: WorkOrderDetailsProps) {\r\n  const {\r\n    queryParams,\r\n    useSidePanel,\r\n    useSwithButtons,\r\n    continueTo,\r\n    closeCover,\r\n    isCover,\r\n  } = props;\r\n  const dispatch = useDispatch();\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const { actions } = useWorkOrderSlice();\r\n  const { actions: globalActions } = useAppSettingsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  /// Use Effect on Mount ///\r\n\r\n  /// Selectors ///\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const loading = useSelector(selectWorkOrderProcessing);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n  const repetitiveValues = useSelector(selectRepetitiveData);\r\n  const readonlyDetails = useSelector(selectReadonlyWorkOrder);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const sendOfflineEmail = useSelector(selectSendEmailOnResOffline);\r\n  const sendOfflineProcessing = useSelector(selectReservationOfflineProcessing);\r\n  const sendOfflineData = useSelector(selectReservationOfflineData);\r\n  const sendEmailCompleted = useSelector(selectReservationOfflineCompleted);\r\n  const createModel = useSelector(selectCreateWorkOrder, shallowEqual);\r\n  const editModel = useSelector(selectUpdateWorkOrder, shallowEqual);\r\n  const requestCreateCompleted = useSelector(selectCreateWorkOrderCompleted);\r\n  const requestUpdateCompleted = useSelector(selectUpdateWorkOrderCompleted);\r\n  const hasCreateProcessing = useSelector(selectCreateWorkOrderProcessing);\r\n  const hasUpdateUpdateProcessing = useSelector(\r\n    selectUpdateWorkOrderProcessing,\r\n  );\r\n  const hasCreateError = useSelector(selectCreateWorkOrderHasError);\r\n  const hasUpdateError = useSelector(selectUpdateWorkOrderHasError);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const globalSettings = useGlobalSettingsHook();\r\n  //cover\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(\r\n    () => {\r\n      if (edit) {\r\n        dispatch(actions.resetUpdateWorkOrderState());\r\n      } else {\r\n        dispatch(actions.resetCreateWorkOrderState());\r\n      }\r\n      dispatch(actions.resetReservationsOfflineState());\r\n      return true;\r\n    },\r\n    undefined,\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n\r\n  /// Local State ///\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [edit, setEdit] = React.useState<boolean | undefined>(false);\r\n  const innerFormRef = React.useRef<FormikProps<WorkOrderDetailsState> | null>(\r\n    null,\r\n  );\r\n  const [showConfirmRecurring, setShowConfirmRecurring] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [showDeleteRecurring, setShowDeleteRecurring] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [showSendEmail, setShowSendEmail] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [showCloseStatus, setShowCloseStatus] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [closedStatus, setClosedStatus] = React.useState<\r\n    IWorkOrderTypeStatusDto | undefined\r\n  >(undefined);\r\n  const [radioNotifyUsersValue, setRadioNotifyUsersValue] = React.useState<\r\n    NotifyUsersRadioGroupOptionTypes | undefined\r\n  >('JustBookedUsers');\r\n\r\n  const [\r\n    radioCancelAffectedReservationsValue,\r\n    setRadioCancelAffectedReservationsValue,\r\n  ] = React.useState<\r\n    CancelAffectedReservationsRadioGroupOptionTypes | undefined\r\n  >('No');\r\n\r\n  const [\r\n    workOrderOfflineStartChangedValue,\r\n    setWorkOrderOfflineStartChangedValue,\r\n  ] = React.useState<Date | string | null | undefined>();\r\n\r\n  const [\r\n    workOrderOfflineEndChangedValue,\r\n    setWorkOrderOfflineEndChangedValue,\r\n  ] = React.useState<Date | string | null | undefined>();\r\n\r\n  const [isCloseWorkOrderClicked, setIsCloseWorkOrderClicked] = React.useState<\r\n    boolean\r\n  >(false);\r\n\r\n  /// Memo variables ///\r\n  const hasProcessing = React.useMemo(() => {\r\n    return hasCreateProcessing || hasUpdateUpdateProcessing;\r\n  }, [hasCreateProcessing, hasUpdateUpdateProcessing]);\r\n\r\n  const hasError = React.useMemo(() => {\r\n    return hasCreateError || hasUpdateError;\r\n  }, [hasCreateError, hasUpdateError]);\r\n\r\n  const baseModel = React.useMemo(() => {\r\n    return createModel || editModel || undefined;\r\n  }, [createModel, editModel]);\r\n\r\n  const showShortView = React.useMemo(() => {\r\n    return isMobile || (useSidePanel && !sidePanelExpanded);\r\n  }, [isMobile, useSidePanel, sidePanelExpanded]);\r\n\r\n  const IsAdmin = React.useMemo(() => {\r\n    return (\r\n      User?.Roles?.includes(Roles.InstrumentEventsAdmin) ||\r\n      User?.IsAllGroupOrLabTechAdmin(\r\n        baseModel?.Assets.map(g => (g as IAssetDto).ServiceGroupId ?? 0),\r\n        mapAssetsToServiceTypeFilterDto(\r\n          (baseModel?.Assets === undefined\r\n            ? []\r\n            : baseModel?.Assets) as IAssetDto[],\r\n        ),\r\n      ) ||\r\n      User?.IsAllInstrumentEventsGroupPermissions(\r\n        baseModel?.Assets.map(g => (g as IAssetDto).ServiceGroupId ?? 0),\r\n      )\r\n    );\r\n  }, [User, baseModel]);\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      User !== undefined &&\r\n      (User.Roles.includes(Roles.CalendarOnly) ||\r\n        User.Roles.includes(Roles.Readonly) ||\r\n        User.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [User]);\r\n  const viewPermissions = React.useMemo(() => {\r\n    return (\r\n      !edit ||\r\n      (edit &&\r\n        (IsAdmin ||\r\n          (baseModel?.ReportedBy === (User?.Id || '') &&\r\n            !(baseModel?.WorkOrderType as IWorkOrderTypeDto).StaffOnly)))\r\n    );\r\n  }, [\r\n    IsAdmin,\r\n    User?.Id,\r\n    baseModel?.ReportedBy,\r\n    baseModel?.WorkOrderType,\r\n    edit,\r\n  ]);\r\n  const openAsset = useOpenAssetPopUp();\r\n  const repeat = React.useMemo(() => {\r\n    return (\r\n      edit &&\r\n      (!isNullOrUndefined<number>(baseModel?.RecurringAssetId) ||\r\n        !isNullOrUndefined<number>(baseModel?.RecurringGroupId))\r\n    );\r\n  }, [edit, baseModel]);\r\n\r\n  const [typeName, setTypeName] = React.useState<string | undefined>(\r\n    baseModel?.WorkOrderType?.Name,\r\n  );\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      if (\r\n        queryParams.id !== undefined &&\r\n        !isNaN(parseInt(queryParams.id || ''))\r\n      ) {\r\n        dispatch(actions.initUpdateWorkOrder(queryParams));\r\n      } else {\r\n        dispatch(actions.initWorkOrder(queryParams));\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actions, dispatch, firstLoad, globalSettings, queryParams]);\r\n  React.useEffect(() => {\r\n    setTypeName(\r\n      innerFormRef.current?.values.WorkOrderType?.Name ??\r\n        baseModel?.WorkOrderType?.Name,\r\n    );\r\n  }, [\r\n    baseModel?.WorkOrderType?.Name,\r\n    innerFormRef.current?.values.WorkOrderType?.Name,\r\n  ]);\r\n\r\n  const reservationSwithProps = React.useMemo(() => {\r\n    if (!edit && baseModel) {\r\n      let eqids = queryParams.eqid;\r\n      let start = queryParams.eStart || queryParams.offStart;\r\n      let end = queryParams.offEnd;\r\n      let defaultMulti = globalSettings.multipleInstrumentsEnabled;\r\n      if (!!baseModel) {\r\n        start = dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(baseModel.EventStart),\r\n        );\r\n        end =\r\n          baseModel.OfflineEventEnd !== null &&\r\n          baseModel.OfflineEventEnd !== undefined\r\n            ? dateUtils.formatQueryStringDate(\r\n                dateUtils.dateOrStringToDate(baseModel.OfflineEventEnd),\r\n              )\r\n            : undefined;\r\n        defaultMulti =\r\n          globalSettings.multipleInstrumentsEnabled &&\r\n          baseModel.Assets.length > 0;\r\n        eqids = (baseModel.Assets as IAssetDto[])\r\n          .map(f => f.ServiceId)\r\n          .filter(f => f !== undefined && f !== null)\r\n          .join(',');\r\n      }\r\n\r\n      let p = {\r\n        useSidePanel: true,\r\n        queryParams: {\r\n          selectedIds: eqids,\r\n          Start: start,\r\n          End: end,\r\n          defaultMulti: defaultMulti.toString(),\r\n          source: queryParams.source,\r\n        } as ReservationQueryStringParameters,\r\n        useSwitchButtons: useSwithButtons,\r\n      } as ReservationDetailsProps;\r\n      return p;\r\n    }\r\n    return undefined;\r\n  }, [\r\n    baseModel,\r\n    edit,\r\n    globalSettings.multipleInstrumentsEnabled,\r\n    queryParams.eStart,\r\n    queryParams.eqid,\r\n    queryParams.offEnd,\r\n    queryParams.offStart,\r\n    queryParams.source,\r\n    useSwithButtons,\r\n  ]);\r\n  /// Refs ///\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const repetitiveFormRef = React.useRef<any>(null);\r\n  const workOrderTypeFormRef = React.useRef<any>(null);\r\n  const workOrderStaffFormRef = React.useRef<any>(null);\r\n  const submitCommentRef = React.useRef<any>(null);\r\n\r\n  /// Handlers ///\r\n  const handleSaveClick = React.useCallback(\r\n    (e: any) => {\r\n      if (repeat) {\r\n        setShowConfirmRecurring(true);\r\n      } else {\r\n        handleSubmitForm(e);\r\n      }\r\n    },\r\n    [repeat],\r\n  );\r\n  const handleSubmitForm = (e: any) => {\r\n    if (workOrderTypeFormRef.current) {\r\n      workOrderTypeFormRef.current(e);\r\n    }\r\n    if (workOrderStaffFormRef.current) {\r\n      workOrderStaffFormRef.current(e);\r\n    }\r\n    if (repetitiveFormRef.current) {\r\n      repetitiveFormRef.current(e);\r\n    }\r\n    // if (submitCommentRef.current) {\r\n    //   submitCommentRef.current(e);\r\n    // }\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (\r\n      values: WorkOrderDetailsState,\r\n      subFormFiles: IFormFileValue[],\r\n      staffFormFiles: IFormFileValue[],\r\n    ) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateWorkOrder({\r\n            current: values,\r\n            original: baseModel,\r\n            originalSubFormFiles: subFormFiles,\r\n            originalStaffFormFiles: staffFormFiles,\r\n          }),\r\n        );\r\n      } else {\r\n        let value = {\r\n          workOrderDetails: values,\r\n          RepetitiveOptions: repetitiveValues,\r\n        } as WorkOrderGlobalState;\r\n        //console.log('data', value);\r\n        dispatch(actions.createWorkOrder(value));\r\n      }\r\n    },\r\n    [actions, baseModel, dispatch, edit, repetitiveValues],\r\n  );\r\n\r\n  const handleCancelClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      closePanel({\r\n        isCover: isCover,\r\n        useSidePanel: useSidePanel,\r\n        showConfirm: hasChanges,\r\n        onClose: () => {\r\n          if (edit) {\r\n            dispatch(actions.resetUpdateWorkOrderState());\r\n          } else {\r\n            dispatch(actions.resetCreateWorkOrderState());\r\n          }\r\n          dispatch(actions.resetReservationsOfflineState());\r\n        },\r\n      } as SidePanelCloseState);\r\n    } else {\r\n      dispatch(push('/workorders'));\r\n    }\r\n  }, [actions, closePanel, dispatch, edit, hasChanges, isCover, useSidePanel]);\r\n  const handleTypeChange = React.useCallback(\r\n    (orderType: IWorkOrderTypeDto | undefined) => {},\r\n    [],\r\n  );\r\n  //------ Confirm Repetitive Update/Delete handlers -------//\r\n  const handleUpdateAllRecurrent = (e: any) => {\r\n    dispatch(actions.setUpdateAllRecurrent(true));\r\n    handleSubmitForm(e);\r\n    setShowConfirmRecurring(false);\r\n  };\r\n  const handleUpdateJustOne = (e: any) => {\r\n    dispatch(actions.setUpdateAllRecurrent(false));\r\n    handleSubmitForm(e);\r\n    setShowConfirmRecurring(false);\r\n  };\r\n  const handleDeleteOrder = React.useCallback(\r\n    (action: boolean | null) => {\r\n      var payload = {\r\n        Id: baseModel?.Id || 0,\r\n        all: action,\r\n      };\r\n      api\r\n        .deleteOrders(payload)\r\n        .then(response => {\r\n          // const messages: IResponseType = GetResponseMessages(\r\n          //   response,\r\n          //   t(translations.Success) as string,\r\n          // );\r\n          //console.log(response);\r\n          handleCancelClick();\r\n          if (response.ErrorMessages.length > 0) {\r\n            dispatch(\r\n              globalActions.addNotification({\r\n                key: 'deleteOrderError',\r\n                message: t(\r\n                  translations.OnlyMainOrResourceWorkOrdersAdminCanDeleteCalibrationRecords,\r\n                ) as string,\r\n                variant: 'error',\r\n              }),\r\n            );\r\n          } else {\r\n            dispatch(\r\n              globalActions.addNotification({\r\n                key: 'deleteOrder',\r\n                message: 'Item deleted successfully',\r\n                variant: 'success',\r\n              }),\r\n            );\r\n          }\r\n          dispatch(layoutActions.setRefreshTable(true));\r\n        })\r\n        .catch(error => {\r\n          console.log('status error', error);\r\n          let err = t(translations.Failed) as string;\r\n          dispatch(\r\n            globalActions.addNotification({\r\n              variant: 'error',\r\n              message:\r\n                'Some thing went wrong. Item can not be deleted.: ' + !!err\r\n                  ? err\r\n                  : '',\r\n              key: 'deleteOrder',\r\n            }),\r\n          );\r\n        });\r\n    },\r\n    [baseModel, dispatch, globalActions, handleCancelClick, layoutActions, t],\r\n  );\r\n  //------ Send Emails on Reservation Downtime handlets ------//\r\n  const handleSendEmailClick = React.useCallback(() => {\r\n    if (sendOfflineData && sendOfflineData.length > 0) {\r\n      dispatch(\r\n        actions.sendReservationsOfflineEmail({\r\n          cancel: radioCancelAffectedReservationsValue === 'Yes' ? true : false,\r\n          deleted: false,\r\n          insert: !edit,\r\n          doNotNotifyUsers: radioNotifyUsersValue === 'No' ? true : false,\r\n          allAffectedUsers:\r\n            radioNotifyUsersValue === 'AllAffectedUsers' ? true : false,\r\n          reservationOffline: sendOfflineData,\r\n        }),\r\n      );\r\n    }\r\n    setIsCloseWorkOrderClicked(false);\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    edit,\r\n    radioCancelAffectedReservationsValue,\r\n    radioNotifyUsersValue,\r\n    sendOfflineData,\r\n  ]);\r\n  /*   const handleSendEmailWithCancel = React.useCallback(() => {\r\n    if (sendOfflineData && sendOfflineData.length > 0) {\r\n      dispatch(\r\n        actions.sendReservationsOfflineEmail({\r\n          cancel: true,\r\n          deleted: false,\r\n          insert: !edit,\r\n          reservationOffline: sendOfflineData,\r\n        }),\r\n      );\r\n    }\r\n  }, [actions, dispatch, edit, sendOfflineData]); */\r\n  const handleCancelSend = React.useCallback(() => {\r\n    dispatch(actions.resetReservationsOfflineState());\r\n    setIsCloseWorkOrderClicked(false);\r\n  }, [actions, dispatch]);\r\n  const handleCloseOrder = React.useCallback(\r\n    (event: any, status: IWorkOrderTypeStatusDto) => {\r\n      dispatch(\r\n        actions.setAnyValue({\r\n          fieldKey: 'WorkOrderTypeStatus',\r\n          fieldValue: status,\r\n        }),\r\n      );\r\n      //setChangedStatus(status);\r\n      handleSaveClick(event);\r\n      setIsCloseWorkOrderClicked(true);\r\n    },\r\n    [actions, dispatch, handleSaveClick],\r\n  );\r\n  const handleOpenOrder = React.useCallback(\r\n    (event: any) => {\r\n      api\r\n        .getNewWorkOrderStatus(baseModel?.WorkOrderType?.Id || 0)\r\n        .then(result => {\r\n          let res = result as IWorkOrderTypeStatusDto[];\r\n          if (res.length > 0) {\r\n            dispatch(\r\n              actions.setAnyValue({\r\n                fieldKey: 'WorkOrderTypeStatus',\r\n                fieldValue: res[0],\r\n              }),\r\n            );\r\n            //setChangedStatus(res[0]);\r\n            handleSaveClick(event);\r\n          }\r\n        });\r\n    },\r\n    [actions, baseModel?.WorkOrderType?.Id, dispatch, handleSaveClick],\r\n  );\r\n  const handleDeleteClick = React.useCallback(() => {\r\n    if (repeat) {\r\n      setShowDeleteRecurring(true);\r\n    } else {\r\n      handleDeleteOrder(null);\r\n    }\r\n  }, [handleDeleteOrder, repeat]);\r\n\r\n  const handleDeleteAllNext = (e: any) => {\r\n    handleDeleteOrder(false);\r\n    setShowDeleteRecurring(false);\r\n  };\r\n  const handleDeleteAll = (e: any) => {\r\n    handleDeleteOrder(true);\r\n    setShowDeleteRecurring(false);\r\n  };\r\n  const handleNotifyUsersChange = event => {\r\n    setRadioNotifyUsersValue(event);\r\n    console.log(radioNotifyUsersValue);\r\n  };\r\n\r\n  const handleCancelAffectedReservationsChange = event => {\r\n    setRadioCancelAffectedReservationsValue(event);\r\n    console.log(radioCancelAffectedReservationsValue);\r\n  };\r\n\r\n  const isChangedDowntimeShorter = (): boolean => {\r\n    let isChangedStartDowntimeShorter: boolean = true;\r\n    let isChangedEndDowntimeShorter: boolean = true;\r\n    if (\r\n      !!workOrderOfflineStartChangedValue &&\r\n      !!baseModel &&\r\n      !!baseModel.OfflineEventStart\r\n    ) {\r\n      isChangedStartDowntimeShorter =\r\n        dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(workOrderOfflineStartChangedValue ?? ''),\r\n        ) <\r\n        dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(baseModel?.OfflineEventStart ?? ''),\r\n        );\r\n    }\r\n    if (\r\n      !!workOrderOfflineEndChangedValue &&\r\n      !!baseModel &&\r\n      !!baseModel.OfflineEventEnd\r\n    ) {\r\n      isChangedEndDowntimeShorter =\r\n        dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(workOrderOfflineEndChangedValue ?? ''),\r\n        ) >\r\n        dateUtils.formatQueryStringDate(\r\n          dateUtils.dateOrStringToDate(baseModel?.OfflineEventEnd ?? ''),\r\n        );\r\n    }\r\n    //return workOrderOfflineStartChangedValue < OfflineEventStart || workOrderOfflineEndChangedValue > OfflineEventEnd\r\n    return isChangedStartDowntimeShorter && isChangedEndDowntimeShorter;\r\n  };\r\n\r\n  /// Use Effects ///\r\n  React.useEffect(() => {\r\n    let active = loading === false;\r\n    if (active) {\r\n      if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n        setEdit(true);\r\n      } else {\r\n        setEdit(false);\r\n      }\r\n      if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          if (sendOfflineEmail) {\r\n            setShowSendEmail(true);\r\n          } else {\r\n            setShowSendEmail(false);\r\n            handleCancelClick();\r\n          }\r\n        }\r\n      } else if (\r\n        requestCreateCompleted === false ||\r\n        requestUpdateCompleted === false\r\n      ) {\r\n        setRequestCompleted(false);\r\n        setBusy(false);\r\n      }\r\n      if (sendEmailCompleted) {\r\n        handleCancelClick();\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    baseModel,\r\n    handleCancelClick,\r\n    hasError,\r\n    queryParams,\r\n    loading,\r\n    requestCompleted,\r\n    requestCreateCompleted,\r\n    requestUpdateCompleted,\r\n    sendEmailCompleted,\r\n    sendOfflineEmail,\r\n  ]);\r\n  // To do: implement confirmSendEmails when downtime pass on existing reservation\r\n\r\n  const leftActions = React.useMemo(() => {\r\n    let actions = [\r\n      () => (\r\n        <React.Fragment>\r\n          <SaveFormButton\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"save\" />}\r\n            onClick={handleSaveClick}\r\n            disabled={busy || (baseModel?.NotEditable && baseModel?.IsClosed)}\r\n            processing={!requestCompleted && busy}\r\n            edit={edit || false}\r\n            text={t(translations.Save)}\r\n          />\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n    if (\r\n      edit &&\r\n      IsAdmin &&\r\n      baseModel &&\r\n      !baseModel.IsClosed &&\r\n      baseModel.ClosedStatuses.length > 0\r\n    ) {\r\n      actions.push(() => (\r\n        <React.Fragment>\r\n          {baseModel.ClosedStatuses.length === 1 ? (\r\n            <Button\r\n              variant=\"white\"\r\n              size=\"small\"\r\n              disabled={busy}\r\n              processing={!requestCompleted && busy}\r\n              onClick={() => {\r\n                setShowCloseStatus(true);\r\n                setClosedStatus(\r\n                  baseModel.ClosedStatuses[0] as IWorkOrderTypeStatusDto,\r\n                );\r\n              }}\r\n            >\r\n              {showShortView\r\n                ? t(translations.CloseIncident)\r\n                : t(translations.CloseEvent)}\r\n            </Button>\r\n          ) : (\r\n            <DropDown\r\n              variant=\"white\"\r\n              size=\"small\"\r\n              disabled={busy}\r\n              processing={!requestCompleted && busy}\r\n              menuChildren={() =>\r\n                (baseModel.ClosedStatuses as IWorkOrderTypeStatusDto[]).map(\r\n                  s => (\r\n                    <div key={s.StatusId}>\r\n                      <MenuItem\r\n                        onClick={() => {\r\n                          setShowCloseStatus(true);\r\n                          setClosedStatus(s);\r\n                        }}\r\n                      >\r\n                        {s.Name}\r\n                      </MenuItem>\r\n                    </div>\r\n                  ),\r\n                )\r\n              }\r\n              menuProps={{\r\n                anchorOrigin: {\r\n                  vertical: 'top',\r\n                  horizontal: 'center',\r\n                },\r\n                transformOrigin: {\r\n                  vertical: 'bottom',\r\n                  horizontal: 'center',\r\n                },\r\n              }}\r\n              addChevron\r\n            >\r\n              {showShortView\r\n                ? t(translations.CloseIncident)\r\n                : t(translations.CloseEvent)}\r\n            </DropDown>\r\n          )}\r\n        </React.Fragment>\r\n        // <CloseWorkOrderButton\r\n\r\n        //   handleClose={handleCloseOrder}\r\n\r\n        //   closedStatuses={baseModel.ClosedStatuses as IWorkOrderTypeStatusDto[]}\r\n        //   body={\r\n        //     (baseModel.ShowOnCalibrationHistory\r\n        //       ? t(translations.YouAreClosingCalibrationRecord) + ' '\r\n        //       : '') +\r\n        //     (baseModel.NotEditable\r\n        //       ? t(translations.RecordWillBeNotEditableAfterClosing)\r\n        //       : '')\r\n        //   }\r\n        // />\r\n      ));\r\n    }\r\n    if (edit && IsAdmin && baseModel && baseModel.IsClosed) {\r\n      actions.push(() => (\r\n        <ReopenOrderButton\r\n          size=\"small\"\r\n          variant=\"white\"\r\n          handleOpen={handleOpenOrder}\r\n          text={\r\n            showShortView\r\n              ? t(translations.ReopenIncident)\r\n              : t(translations.ReopenEvent)\r\n          }\r\n          disabled={(baseModel.IsClosed && baseModel.NotEditable) || busy}\r\n          processing={!requestCompleted && busy}\r\n        />\r\n      ));\r\n    }\r\n    if (edit && IsAdmin && baseModel) {\r\n      actions.push(() => (\r\n        <DeleteOrderButton\r\n          size=\"small\"\r\n          variant=\"ghost\"\r\n          handleDelete={handleDeleteClick}\r\n          text={\r\n            showShortView\r\n              ? t(translations.DeleteIncident)\r\n              : t(translations.DeleteEvent)\r\n          }\r\n          disabled={busy}\r\n          processing={!requestCompleted && busy}\r\n        />\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    IsAdmin,\r\n    baseModel,\r\n    busy,\r\n    edit,\r\n    handleDeleteClick,\r\n    handleOpenOrder,\r\n    handleSaveClick,\r\n    requestCompleted,\r\n    showShortView,\r\n    t,\r\n  ]);\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCancelClick}\r\n          >\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCancelClick, t]);\r\n\r\n  const topActions = React.useMemo(() => {\r\n    let actions = [] as ActionRenderer[];\r\n    if (edit) {\r\n      if (baseModel?.Downtime) {\r\n        if (IsAdmin) {\r\n          actions.push(() => (\r\n            <Button\r\n              variant=\"white\"\r\n              size=\"small\"\r\n              target=\"_blank\"\r\n              startIcon={<Icon icon=\"envelope\" />}\r\n              href={`/SendEmailToUsers?eid=${\r\n                (baseModel.Assets[0] as IAssetDto).ServiceId || ''\r\n              }&rf=${\r\n                !isNullOrUndefined(baseModel.OfflineEventStart)\r\n                  ? dateUtils.formatQueryStringDate(\r\n                      dateUtils.dateOrStringToDate(baseModel.OfflineEventStart),\r\n                    )\r\n                  : ''\r\n              }&rt=${\r\n                !isNullOrUndefined(baseModel.OfflineEventEnd)\r\n                  ? dateUtils.formatQueryStringDate(\r\n                      dateUtils.dateOrStringToDate(baseModel.OfflineEventEnd),\r\n                    )\r\n                  : ''\r\n              }`}\r\n            >\r\n              {showShortView\r\n                ? t(translations.SendCustomEmail_short)\r\n                : t(translations.SendCustomEmail)}\r\n            </Button>\r\n          ));\r\n        }\r\n        actions.push(() => (\r\n          <CalendarButton\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"calendar\" />}\r\n            variant=\"white\"\r\n            target={'_blank'}\r\n            start={\r\n              !isNullOrUndefined(baseModel.OfflineEventStart)\r\n                ? dateUtils.formatQueryStringDate(\r\n                    dateUtils.dateOrStringToDate(baseModel.OfflineEventStart),\r\n                  )\r\n                : ''\r\n            }\r\n            equipments={[\r\n              (baseModel.Assets[0] as IAssetDto)?.ServiceId ?? undefined,\r\n            ]}\r\n          >\r\n            {showShortView\r\n              ? t(translations.ViewCalendar_short)\r\n              : t(translations.ViewCalendar)}\r\n          </CalendarButton>\r\n        ));\r\n      }\r\n      if (!isNullOrUndefined(baseModel?.RecurringGroupId)) {\r\n        actions.push(() => (\r\n          <ActionIconButton\r\n            variant=\"white\"\r\n            size=\"small\"\r\n            title={t(translations.ShowAllRecurringEvents)}\r\n            shape=\"square\"\r\n            icon=\"th-list\"\r\n            target={'_blank'}\r\n            href={`/workorders?rid=${baseModel?.RecurringGroupId}`}\r\n          />\r\n        ));\r\n      }\r\n    }\r\n    return actions;\r\n  }, [IsAdmin, baseModel, edit, showShortView, t]);\r\n\r\n  const notifyUsersRadioGroupOptions = [\r\n    {\r\n      Id: 'No',\r\n      Name: t(translations.No),\r\n      Info: '',\r\n    },\r\n    {\r\n      Id: 'JustBookedUsers',\r\n      Name: t(translations.JustBookedUsers),\r\n      Info: '',\r\n    },\r\n    {\r\n      Id: 'AllAffectedUsers',\r\n      Name: t(translations.AllAffectedUsers),\r\n      Info: t(translations.AllAffectedUsers_info),\r\n    },\r\n  ];\r\n\r\n  const cancelAffectedReservationsRadioGroupOptions = [\r\n    {\r\n      Id: 'No',\r\n      Name: t(translations.No),\r\n      Info: '',\r\n    },\r\n    {\r\n      Id: 'Yes',\r\n      Name: t(translations.Yes),\r\n      Info: '',\r\n    },\r\n  ];\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={\r\n          edit\r\n            ? t(translations.menu_EditWorkOrder)\r\n            : t(translations.menu_AddNewWorkOrder)\r\n        }\r\n        titlePage={\r\n          baseModel\r\n            ? edit\r\n              ? ` ${typeName || ''} #${queryParams.id || 'N/A'}`\r\n              : ` ${t(translations.Add)} ${typeName || ''}`\r\n            : undefined\r\n        }\r\n        loading={loading}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || isCover}\r\n        useSwitchActions={!edit && IsAdmin && useSwithButtons}\r\n        switchState={\r\n          !!reservationSwithProps && !edit && useSwithButtons\r\n            ? ({\r\n                target: SwitchTarget.Reservation,\r\n                getProps: () => reservationSwithProps,\r\n              } as SwitchActionsProps)\r\n            : undefined\r\n        }\r\n        closeSidePanel={handleCancelClick}\r\n        leftTopActions={viewPermissions ? topActions : []}\r\n        pageLink={buildURL(publicUrl + 'workorders/details', props.queryParams)}\r\n        toPageLink={`workorders/details?${toQueryString(props.queryParams)}`}\r\n        leftActions={isReadOnlyUser || !viewPermissions ? [] : leftActions}\r\n        rightActions={isReadOnlyUser || !viewPermissions ? [] : rightActions}\r\n        cover={cover}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n        isCover={isCover}\r\n        coverClosed={coverClosed}\r\n        children={\r\n          baseModel !== undefined && !loading ? (\r\n            <React.Fragment>\r\n              {viewPermissions || isReadOnlyUser ? (\r\n                <WorkOrderForm\r\n                  isCover={isCover}\r\n                  initialValues={baseModel || ({} as WorkOrderDetailsState)}\r\n                  bindSubmitForm={bindSubmitForm}\r\n                  onSubmit={handleSubmit}\r\n                  isEdit={edit || false}\r\n                  handleTypeChange={handleTypeChange}\r\n                  repetitiveFormRef={repetitiveFormRef}\r\n                  workOrderTypeFormRef={workOrderTypeFormRef}\r\n                  workOrderStaffFormRef={workOrderStaffFormRef}\r\n                  formRef={innerFormRef}\r\n                  showShortView={showShortView}\r\n                  isAdmin={IsAdmin || false}\r\n                  bringUp={!!queryParams.Up}\r\n                  pageLink={buildURL(\r\n                    publicUrl + 'workorders/details',\r\n                    props.queryParams,\r\n                  )}\r\n                  useSidePanel={useSidePanel}\r\n                  onAssetClicked={e =>\r\n                    openAsset(\r\n                      { id: e.Id, useSidePanel: useSidePanel },\r\n                      openPanel,\r\n                    )\r\n                  }\r\n                  onLinkedClick={linked =>\r\n                    openPanel({\r\n                      renderPageType: RenderPageType.WorkOrderDetails,\r\n                      renderPageProps: {\r\n                        queryParams: {\r\n                          id: '' + linked.Id ?? -1,\r\n                        },\r\n                      },\r\n                      expanded: false,\r\n                      useSidePanel: useSidePanel,\r\n                      isCover: useSidePanel,\r\n                    } as SidePanelOpenState)\r\n                  }\r\n                  user={User}\r\n                  canView={viewPermissions}\r\n                  readonlyDetails={readonlyDetails}\r\n                  commentsFormRef={submitCommentRef}\r\n                  expanded={!showShortView}\r\n                  setWorkOrderOfflineStartChangedValue={\r\n                    setWorkOrderOfflineStartChangedValue\r\n                  }\r\n                  setWorkOrderOfflineEndChangedValue={\r\n                    setWorkOrderOfflineEndChangedValue\r\n                  }\r\n                />\r\n              ) : (\r\n                // <Redirect to={'/notallowed'} />\r\n                <FlexRowDiv\r\n                  style={{ alignSelf: 'center', justifySelf: 'center' }}\r\n                >\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      flexDirection: 'column',\r\n                      gap: 16,\r\n                      padding: 32,\r\n                    }}\r\n                  >\r\n                    <H3>\r\n                      {t(translations.WorkOrderRestrictedNotAllowed) as string}\r\n                    </H3>\r\n                    <Button\r\n                      variant=\"text\"\r\n                      size=\"medium\"\r\n                      startIcon={<Icon icon=\"times\" />}\r\n                      onClick={() => {\r\n                        if (!!continueTo) {\r\n                          if (!!continueTo.pageProps && !!continueTo.pageType) {\r\n                            dispatch(\r\n                              layoutActions.openSidePanel({\r\n                                type: continueTo.pageType,\r\n                                props: continueTo.pageProps,\r\n                              }),\r\n                            );\r\n                          } else if (!!continueTo.continueToLink) {\r\n                            dispatch(\r\n                              routerActions.push(continueTo.continueToLink),\r\n                            );\r\n                          } else {\r\n                            handleCancelClick();\r\n                          }\r\n                        } else {\r\n                          handleCancelClick();\r\n                        }\r\n                      }}\r\n                    >\r\n                      {t(translations.Continue)}\r\n                    </Button>\r\n                  </Box>\r\n                </FlexRowDiv>\r\n              )}\r\n            </React.Fragment>\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={loading} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        confirm={\r\n          requestCompleted && sendOfflineEmail ? (\r\n            <DialogConfirm\r\n              isOpen={showSendEmail || false}\r\n              title={\r\n                edit\r\n                  ? t(translations.UpdateDowntimeAdditionalActions)\r\n                  : t(translations.CreateDowntimeAdditionalActions)\r\n              }\r\n              processing={sendOfflineProcessing}\r\n              body={\r\n                <React.Fragment>\r\n                  <BasicTypography>\r\n                    {edit\r\n                      ? t(translations.TheDowntimePeriodHasChangedNotifyUsers)\r\n                      : t(translations.NotifyUsers)}\r\n                  </BasicTypography>\r\n                  <RadioGroup\r\n                    id=\"notifyUsersRadioGroupID\"\r\n                    name=\"notifyUsersRadioGroup\"\r\n                    options={notifyUsersRadioGroupOptions}\r\n                    value={radioNotifyUsersValue}\r\n                    row={false}\r\n                    onChange={handleNotifyUsersChange}\r\n                  />\r\n                  {isChangedDowntimeShorter() &&\r\n                    isCloseWorkOrderClicked === false && (\r\n                      <React.Fragment>\r\n                        <BasicTypography>\r\n                          {t(translations.CancelAffectedReservations)}\r\n                        </BasicTypography>\r\n                        <RadioGroup\r\n                          id=\"cancelAffectedReservationsRadioGroupID\"\r\n                          name=\"cancelAffectedReservationsRadioGroup\"\r\n                          options={cancelAffectedReservationsRadioGroupOptions}\r\n                          value={radioCancelAffectedReservationsValue}\r\n                          row={false}\r\n                          onChange={handleCancelAffectedReservationsChange}\r\n                        />\r\n                      </React.Fragment>\r\n                    )}\r\n                </React.Fragment>\r\n              }\r\n              confirmButtonLabel={\r\n                edit\r\n                  ? t(translations.UpdateDowntime)\r\n                  : t(translations.CreateDowntime)\r\n              }\r\n              cancelButtonLabel={t(translations.Cancel)}\r\n              onConfirm={handleSendEmailClick}\r\n              onCancel={handleCancelSend}\r\n              maxWidth=\"md\"\r\n              /* actions={[\r\n                () => (\r\n                  <ActionButton\r\n                    text={t(translations.ConfirmSendDowntimeEmailsCancelOkBtn)}\r\n                    variant=\"main\"\r\n                    processing={sendOfflineProcessing}\r\n                    onClick={handleSendEmailWithCancel}\r\n                  />\r\n                ),\r\n              ]} */\r\n            />\r\n          ) : showConfirmRecurring ? (\r\n            <DialogConfirm\r\n              isOpen={showConfirmRecurring}\r\n              title={t(translations.UpdateRecurringEventsTitle)}\r\n              processing={hasProcessing}\r\n              body={t(translations.EventRepeatConfirmationMessage)}\r\n              confirmButtonLabel={t(translations.JustThisOne)}\r\n              onConfirm={handleUpdateJustOne}\r\n              maxWidth=\"md\"\r\n              onCancel={() => {\r\n                setShowConfirmRecurring(false);\r\n              }}\r\n              actions={[\r\n                () => (\r\n                  <ActionButton\r\n                    text={t(translations.UpdateAllRecurringEvents)}\r\n                    variant=\"main\"\r\n                    onClick={handleUpdateAllRecurrent}\r\n                  />\r\n                ),\r\n              ]}\r\n            />\r\n          ) : showDeleteRecurring ? (\r\n            <DialogConfirm\r\n              isOpen={showDeleteRecurring}\r\n              title={t(translations.DeleteRecurringEvents)}\r\n              body={t(translations.EventRepeatConfirmationMessage)}\r\n              confirmButtonLabel={t(translations.DeleteAllRecurringEvents)}\r\n              onConfirm={handleDeleteAll}\r\n              maxWidth=\"md\"\r\n              onCancel={() => {\r\n                setShowConfirmRecurring(false);\r\n              }}\r\n              actions={[\r\n                () => (\r\n                  <ActionButton\r\n                    text={t(translations.JustThisOne)}\r\n                    variant=\"main\"\r\n                    onClick={() => handleDeleteOrder(null)}\r\n                  />\r\n                ),\r\n                () => (\r\n                  <ActionButton\r\n                    text={t(translations.DeleteAllFutureRecurringEvents)}\r\n                    variant=\"main\"\r\n                    onClick={handleDeleteAllNext}\r\n                  />\r\n                ),\r\n              ]}\r\n            />\r\n          ) : showCloseStatus ? (\r\n            <DialogConfirm\r\n              isOpen={showCloseStatus}\r\n              title={t(translations.CloseEvent)}\r\n              processing={!requestCompleted && busy}\r\n              body={\r\n                (baseModel?.ShowOnCalibrationHistory\r\n                  ? t(translations.YouAreClosingCalibrationRecord) + ' '\r\n                  : '') +\r\n                (baseModel?.NotEditable\r\n                  ? t(translations.RecordWillBeNotEditableAfterClosing)\r\n                  : '')\r\n              }\r\n              confirmButtonLabel={t(translations.Save)}\r\n              cancelButtonLabel={t(translations.Cancel)}\r\n              onConfirm={e => {\r\n                if (!!closedStatus) {\r\n                  handleCloseOrder(e, closedStatus);\r\n                }\r\n              }}\r\n              onCancel={() => {\r\n                setClosedStatus(undefined);\r\n                setShowCloseStatus(false);\r\n              }}\r\n              onClose={() => {\r\n                setClosedStatus(undefined);\r\n                setShowCloseStatus(false);\r\n              }}\r\n              maxWidth=\"md\"\r\n            />\r\n          ) : (\r\n            <></>\r\n          )\r\n        }\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * ScreenToShowOnPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { ScreenToShowOn } from 'enums/ScreenToShowOn';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface ScreenToShowOnPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSingleScreenToShowOn = (val: number): Entity<number> => {\r\n  return enumToEntityArray(ScreenToShowOn).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const initScreenToShowOnData = (\r\n  initval: number | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([getSingleScreenToShowOn(initval)]);\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(ScreenToShowOn);\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function ScreenToShowOnPicker(props: ScreenToShowOnPickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * InvoiceStatusWithStaticOptionsPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { InvoiceStatuses } from 'enums/InvoiceStatuses';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface InvoiceStatusWithStaticOptionsPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const getSingleInvoiceStatusWithStaticOptions = (\r\n  val: number,\r\n): Entity<number> => {\r\n  return enumToEntityArray(InvoiceStatuses).filter(item => {\r\n    return item.Id === val;\r\n  })[0];\r\n};\r\n\r\nexport const initInvoiceStatusWithStaticOptionsData = (\r\n  initval: number | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([getSingleInvoiceStatusWithStaticOptions(initval)]);\r\n    });\r\n  }\r\n};\r\n\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(InvoiceStatuses);\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\n\r\nexport function InvoiceStatusWithStaticOptionsPicker(\r\n  props: InvoiceStatusWithStaticOptionsPickerProps,\r\n) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","import { getSingleScreenToShowOn } from 'app/components/pickers/StaticOptionsPickers/ScreenToShowOnPicker';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IBillingActionsDto } from '../../../BillingActionsPage/IBillingActionsDto';\r\nimport { getSingleInvoiceFundingType } from '../../../../../components/pickers/StaticOptionsPickers/FundingTypeIdPicker/index';\r\nimport { getSingleInvoiceStatusWithStaticOptions } from '../../../../../components/pickers/StaticOptionsPickers/InvoiceStatusWithStaticOptionsPicker/index';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { getSinglePaymentMethod } from 'app/components/pickers/StaticOptionsPickers/PaymentMethodEnumPicker';\r\nimport { IEmailRecipientTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailRecipientTypesDto';\r\nimport { IEmailAttachmentTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailAttachmentTypesDto';\r\nimport i18next from 'i18next';\r\n\r\n/* --- STATE --- */\r\nexport interface BillingActionsState {\r\n  createState: AsyncDataState<BillingActionsDetailsState>;\r\n  updateState: AsyncDataState<BillingActionsDetailsState>;\r\n  processing: boolean;\r\n}\r\n\r\nexport interface BillingActionsDetailsState {\r\n  Id: number;\r\n  OperationName: string | null;\r\n  ShowOn: Entity<number> | null; //Enum\r\n  FundingType: Entity<number> | null; //Enum\r\n  IsSendEmail: boolean;\r\n  IsSftpUpload: boolean;\r\n  EmailRecipientTypes: Entity<number>[];\r\n  SpecificEmailAddresses: string | null | undefined;\r\n  Body: string | null | undefined;\r\n  Subject: string | null | undefined;\r\n  EmailAttachmentTypes: Entity<number>[];\r\n  ChangeStatusTo: Entity<number> | null; //Enum\r\n  GeneratePayment: Entity<number> | null; //Enum\r\n}\r\n\r\nexport interface BillingActionsDetailsQStringParameters {\r\n  id?: string; //Id\r\n  opName?: string; //OperationName\r\n  showOn?: string; //ShowOn\r\n  fundingT?: string; //FundingType\r\n  isSendEmail?: string; //IsSendEmail\r\n  isSftpUpload?: string;\r\n  //emailRecTypes?: string;\r\n  specEmailAd?: string; //SpecificEmailAddresses\r\n  body?: string; //Body\r\n  sub?: string; //Subject\r\n  //emailAttTypes?: string;\r\n  chgStatTo?: string; //ChangeStatusTo\r\n  genPay?: string; //Generate Payment\r\n}\r\n\r\nexport interface BillingActionsDetailsResponse extends IResponseType {\r\n  Id?: number;\r\n}\r\n\r\nexport function ConvertModelToEntityBillingActionsDetails(\r\n  entity: IBillingActionsDto,\r\n): BillingActionsDetailsState | undefined {\r\n  if (!entity) {\r\n    return undefined;\r\n  } else {\r\n    return {\r\n      Id: entity.Id,\r\n      OperationName: entity.OperationName,\r\n      ShowOn: getSingleScreenToShowOn(entity.ShowOn),\r\n      FundingType: getSingleInvoiceFundingType(entity.FundingType),\r\n      IsSendEmail: entity.IsSendEmail ?? false,\r\n      IsSftpUpload: entity.IsSftpUpload ?? false,\r\n      SpecificEmailAddresses: entity.SpecificEmailAddresses,\r\n      Body: entity.Body,\r\n      Subject: entity.Subject,\r\n      EmailRecipientTypes: entity.EmailRecipientTypes.map(i => {\r\n        return {\r\n          Id: i.Id,\r\n          Name: i18next.t(i.Name) as string,\r\n        } as IEmailRecipientTypesDto;\r\n      }) as IEmailRecipientTypesDto[],\r\n      EmailAttachmentTypes: entity.EmailAttachmentTypes.map(i => {\r\n        return {\r\n          Id: i.Id,\r\n          Name: i18next.t(i.Name) as string,\r\n        } as IEmailAttachmentTypesDto;\r\n      }) as IEmailAttachmentTypesDto[],\r\n      ChangeStatusTo: getSingleInvoiceStatusWithStaticOptions(\r\n        entity.ChangeStatusTo,\r\n      ),\r\n      GeneratePayment: getSinglePaymentMethod(entity.GeneratePayment),\r\n    } as BillingActionsDetailsState;\r\n  }\r\n}\r\n\r\nexport function ConvertEntityToModelBillingActionsDetails(\r\n  model: BillingActionsDetailsState,\r\n  original: BillingActionsDetailsState | undefined,\r\n): IBillingActionsDto {\r\n  let entity = {\r\n    Id: original?.Id === undefined ? model.Id : original.Id,\r\n    OperationName: model.OperationName,\r\n    ShowOn: model.ShowOn?.Id,\r\n    FundingType: model.FundingType?.Id,\r\n    IsSendEmail: model.IsSendEmail ?? false,\r\n    IsSftpUpload: model.IsSftpUpload ?? false,\r\n    SpecificEmailAddresses: model.SpecificEmailAddresses,\r\n    Body: model.Body,\r\n    Subject: model.Subject,\r\n    EmailRecipientTypes: model.EmailRecipientTypes.map(i => {\r\n      return {\r\n        Id: i.Id,\r\n        Name: i18next.t(i.Name) as string,\r\n      } as IEmailRecipientTypesDto;\r\n    }) as IEmailRecipientTypesDto[],\r\n    EmailAttachmentTypes: model.EmailAttachmentTypes.map(i => {\r\n      return {\r\n        Id: i.Id,\r\n        Name: i18next.t(i.Name) as string,\r\n      } as IEmailAttachmentTypesDto;\r\n    }) as IEmailAttachmentTypesDto[],\r\n    ChangeStatusTo: model.ChangeStatusTo?.Id,\r\n    GeneratePayment: model.GeneratePayment?.Id,\r\n  } as IBillingActionsDto;\r\n  return entity;\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport {\r\n  BillingActionsDetailsQStringParameters,\r\n  BillingActionsDetailsResponse,\r\n  BillingActionsDetailsState,\r\n  ConvertEntityToModelBillingActionsDetails,\r\n  //ConvertNewBillingActionsDetailsToModel,\r\n} from './types';\r\nimport { BillingActionsApi } from '../../../../../../api/BillingActionsApi';\r\nimport { billingActionsDetailsActions as actions } from '.';\r\nimport { IBillingActionsDto } from '../../../BillingActionsPage/IBillingActionsDto';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { BillingActionsDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\n\r\nfunction* doInitCreate(\r\n  action: PayloadAction<BillingActionsDetailsQStringParameters>,\r\n) {\r\n  try {\r\n    const data = yield call(BillingActionsApi.initCreateData, action.payload);\r\n    yield put(actions.initBillingActionsDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initBillingActionsDetails_Error(error));\r\n  }\r\n}\r\n\r\nfunction* doInitUpdate(\r\n  action: PayloadAction<BillingActionsDetailsQStringParameters>,\r\n) {\r\n  try {\r\n    const data = yield call(BillingActionsApi.initUpdateData, action.payload);\r\n    yield put(actions.initUpdateBillingActionsDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initUpdateBillingActionsDetails_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction<BillingActionsDetailsState>) {\r\n  const httpPayloads: IBillingActionsDto = ConvertEntityToModelBillingActionsDetails(\r\n    action.payload,\r\n    undefined,\r\n  );\r\n  try {\r\n    const result = yield call(\r\n      BillingActionsApi.insertBillingActionsDetails,\r\n      httpPayloads,\r\n    );\r\n    let response: BillingActionsDetailsResponse = result as BillingActionsDetailsResponse;\r\n\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'billingActionsInsert',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'billingActionsInsert',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      if (response.Id) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'billingActionsInsert',\r\n            message: response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id,\r\n              created: true,\r\n              itemName: i18next.t(translations.WorkOrdersPageName),\r\n              detailsType: RenderPageType.AddBillingAction,\r\n              detailsTypeProps: {\r\n                queryParams: {\r\n                  id: '' + response.Id,\r\n                } as BillingActionsDetailsQStringParameters,\r\n                useSidePanel: true,\r\n              } as BillingActionsDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      } else {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'billingActionsInsertSuccess',\r\n            message: response.SuccessMessages[0],\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.createBillingActionsDetails_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'billingActionsInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createBillingActionsDetails_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: BillingActionsDetailsState;\r\n    original: BillingActionsDetailsState | undefined;\r\n  }>,\r\n) {\r\n  const httpPayloads: IBillingActionsDto = ConvertEntityToModelBillingActionsDetails(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n  try {\r\n    const results = yield call(\r\n      BillingActionsApi.updateBillingActionsDetails,\r\n      httpPayloads,\r\n    );\r\n    let response = results as BillingActionsDetailsResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'billingActionsUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'billingActionsUpdateWarn',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'billingActionsUpdate',\r\n          message: response.SuccessMessages[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: response.Id,\r\n            created: false,\r\n            itemName: i18next.t(translations.BillingActionsPageName),\r\n            detailsType: RenderPageType.AddBillingAction,\r\n            detailsTypeProps: {\r\n              queryParams: {\r\n                id: '' + response.Id,\r\n              } as BillingActionsDetailsQStringParameters,\r\n              useSidePanel: true,\r\n            } as BillingActionsDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateBillingActionsDetails_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'billingActionsUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateBillingActionsDetails_Error(Error));\r\n  }\r\n}\r\n\r\nexport function* billingActionsDetailsSaga() {\r\n  yield takeLatest(actions.initBillingActionsDetails.type, doInitCreate);\r\n  yield takeLatest(actions.initUpdateBillingActionsDetails.type, doInitUpdate);\r\n  yield takeLatest(actions.createBillingActionsDetails.type, doCreate);\r\n  yield takeLatest(actions.updateBillingActionsDetails.type, doUpdate);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IBillingActionsDto } from 'app/pages/BillingActions/BillingActionsPage/IBillingActionsDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { billingActionsDetailsSaga } from './saga';\r\nimport {\r\n  //BillingActionsDetailsGlobalState,\r\n  BillingActionsDetailsState,\r\n  BillingActionsDetailsQStringParameters,\r\n  BillingActionsState,\r\n  ConvertModelToEntityBillingActionsDetails,\r\n} from './types';\r\n\r\nexport const initialState: BillingActionsState = {\r\n  processing: false,\r\n  createState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  updateState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'billingActionsDetail',\r\n  initialState,\r\n  reducers: {\r\n    initBillingActionsDetails(\r\n      state,\r\n      action: PayloadAction<BillingActionsDetailsQStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUpdateBillingActionsDetails(\r\n      state,\r\n      action: PayloadAction<BillingActionsDetailsQStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initBillingActionsDetails_Success(\r\n      state,\r\n      action: PayloadAction<IBillingActionsDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.createState.data = ConvertModelToEntityBillingActionsDetails(\r\n        action.payload,\r\n      );\r\n    },\r\n    initUpdateBillingActionsDetails_Success(\r\n      state,\r\n      action: PayloadAction<IBillingActionsDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.updateState.data = ConvertModelToEntityBillingActionsDetails(\r\n        action.payload,\r\n      );\r\n    },\r\n    initBillingActionsDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    initUpdateBillingActionsDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    //====================================================================\r\n    resetUpdateBillingActionsDetailsState(state, action: PayloadAction) {\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    resetCreateBillingActionsDetailsState(state, action: PayloadAction) {\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    //====================================================================\r\n    updateBillingActionsDetails(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: BillingActionsDetailsState;\r\n        original: BillingActionsDetailsState | undefined;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateBillingActionsDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.hasErrors = action.payload.hasErrors;\r\n      state.updateState.completed = true;\r\n    },\r\n    updateBillingActionsDetails_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      state.updateState.hasErrors = true;\r\n    },\r\n    //====================================================================\r\n    createBillingActionsDetails(\r\n      state,\r\n      action: PayloadAction<BillingActionsDetailsState>,\r\n    ) {\r\n      state.createState.processing = true;\r\n      state.createState.completed = undefined;\r\n      state.createState.hasErrors = undefined;\r\n    },\r\n    createBillingActionsDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.createState.processing = false;\r\n      state.createState.hasErrors = action.payload.hasErrors;\r\n      state.createState.completed = true;\r\n    },\r\n    createBillingActionsDetails_Error(state, action: PayloadAction<any>) {\r\n      state.createState.processing = false;\r\n      state.createState.completed = true;\r\n      state.createState.hasErrors = true;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: billingActionsDetailsActions } = slice;\r\n\r\nexport const useBillingActionsDetailsSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: billingActionsDetailsSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.billingActionsDetail || initialState;\r\n\r\nexport const selectBillingActionsDetails = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n//====================================================================\r\nexport const selectCreateBillingActionsDetails = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.createState.data,\r\n);\r\n\r\nexport const selectCreateBillingActionsDetailsCompleted = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.createState.completed,\r\n);\r\n\r\nexport const selectCreateBillingActionsDetailsHasError = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.createState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUpdateBillingActionsDetails = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.updateState.data,\r\n);\r\n\r\nexport const selectUpdateBillingActionsDetailsCompleted = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.updateState.completed,\r\n);\r\nexport const selectUpdateBillingActionsDetailsHasError = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.updateState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectBillingActionsDetailsProcessing = createSelector(\r\n  [selectBillingActionsDetails],\r\n  state => state.processing,\r\n);\r\n","/**\r\n *\r\n * MultiSelectBasicPicker for EmailAttachmentTypePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport i18next from 'i18next';\r\nimport { IEmailAttachmentTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailAttachmentTypesDto';\r\n\r\nexport interface EATBaseURLMultiPickerProps<T>\r\n  extends Omit<AutocompleteMultiPickerProps<T>, 'loadData'> {\r\n  url: string;\r\n  queryfilter?: string | undefined;\r\n}\r\n\r\nexport function EATBaseURLMultiPicker<T>(props: EATBaseURLMultiPickerProps<T>) {\r\n  const { url, queryfilter, ...other } = props;\r\n  const loadData = async (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n    };\r\n    const predicates: string[] = [];\r\n    if (queryfilter !== undefined && queryfilter !== '') {\r\n      predicates.push(queryfilter);\r\n    }\r\n\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n    }).toString();\r\n\r\n    const response = await httpClient.get(url, params);\r\n    return response.value.map(i => {\r\n      return {\r\n        Id: i.Id,\r\n        Name: i18next.t(i.Name) as string,\r\n      } as IEmailAttachmentTypesDto;\r\n    });\r\n  };\r\n  return <AutocompleteMultiPicker loadData={loadData} {...other} />;\r\n}\r\n","/**\r\n *\r\n * EmailAttachmentTypePicker(multi)\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport i18next from 'i18next';\r\nimport { IEmailAttachmentTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailAttachmentTypesDto';\r\nimport { EATBaseURLMultiPicker } from './EATBaseURLMultiPicker';\r\n\r\nexport interface EmailAttachmentTypePickerProps {\r\n  value?: Entity<number>[] | null;\r\n  name?: string;\r\n  error?: boolean;\r\n  label?: string;\r\n  className?: string | undefined;\r\n  helperText?: string;\r\n  placeholder?: string | undefined;\r\n  // value: Entity<number>[];\r\n  defaultValue?: Entity<number>[];\r\n  onChange: (value: Entity<number>[]) => void;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  info?: string;\r\n  id?: string;\r\n  required?: boolean;\r\n  fullWidth?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/EmailAttachmentTypesFilter';\r\n\r\nexport const initEmailAttachmentTypesData = (\r\n  initval: string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient.get(url, params).then(\r\n      response =>\r\n        response.value.map(i => {\r\n          return {\r\n            Id: i.Id,\r\n            Name: i18next.t(i.Name) as string,\r\n          } as IEmailAttachmentTypesDto;\r\n        }) as Entity<number>[],\r\n    );\r\n  }\r\n};\r\n\r\nexport function EmailAttachmentTypePicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  ...props\r\n}: EmailAttachmentTypePickerProps) {\r\n  return (\r\n    <EATBaseURLMultiPicker\r\n      url={url}\r\n      queryfilter={``}\r\n      variant={variant}\r\n      onChange={onChange}\r\n      info={info}\r\n      id={id || 'users-filter'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={defaultValue ?? []}\r\n      label={label}\r\n      value={value ?? []}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * FormEmailAttachmentTypePicker(multi) AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { EmailAttachmentTypePicker } from '../pickers/MultiSelectPickers/EmailAttachmentTypePicker';\r\n\r\nexport const FormEmailAttachmentTypePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number>[] | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number>[] | null>(props);\r\n  return (\r\n    <>\r\n      <EmailAttachmentTypePicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * FormInvoiceStatusPicker AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { InvoiceStatusWithStaticOptionsPicker } from '../pickers/StaticOptionsPickers/InvoiceStatusWithStaticOptionsPicker';\r\n\r\nexport const FormInvoiceStatusPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <InvoiceStatusWithStaticOptionsPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * FormScreenToShowOnPicker AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { ScreenToShowOnPicker } from '../pickers/StaticOptionsPickers/ScreenToShowOnPicker';\r\n\r\nexport const FormScreenToShowOnPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <ScreenToShowOnPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * FormPaymentMethodEnumPicker AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { PaymentMethodEnumPicker } from '../pickers/StaticOptionsPickers/PaymentMethodEnumPicker';\r\n\r\nexport const FormPaymentMethodEnumPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <PaymentMethodEnumPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disabled={props.disabled}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * MultiSelectBasicPicker for EmailRecipientTypePicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  AutocompleteMultiPicker,\r\n  AutocompleteMultiPickerProps,\r\n} from 'app/components/BasicPickers/AutocompleteMultiPicker';\r\nimport { ODataFilterBuilder } from 'api/odata/ODataFilter';\r\nimport i18next from 'i18next';\r\nimport { IEmailRecipientTypesDto } from 'app/pages/BillingActions/BillingActionsPage/IEmailRecipientTypesDto';\r\n\r\nexport interface ERTBaseURLMultiPickerProps<T>\r\n  extends Omit<AutocompleteMultiPickerProps<T>, 'loadData'> {\r\n  url: string;\r\n  queryfilter?: string | undefined;\r\n}\r\n\r\nexport function ERTBaseURLMultiPicker<T>(props: ERTBaseURLMultiPickerProps<T>) {\r\n  const { url, queryfilter, ...other } = props;\r\n  const loadData = async (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n    };\r\n    const predicates: string[] = [];\r\n    if (queryfilter !== undefined && queryfilter !== '') {\r\n      predicates.push(queryfilter);\r\n    }\r\n\r\n    params.$filter = new ODataFilterBuilder<Entity<number>>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm !== null ? searchTerm : undefined,\r\n    }).toString();\r\n\r\n    const response = await httpClient.get(url, params);\r\n    return response.value.map(i => {\r\n      return {\r\n        Id: i.Id,\r\n        Name: i18next.t(i.Name) as string,\r\n      } as IEmailRecipientTypesDto;\r\n    });\r\n  };\r\n  return <AutocompleteMultiPicker loadData={loadData} {...other} />;\r\n}\r\n","/**\r\n *\r\n * EmailRecipientTypesPicker(multi)\r\n *\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { Entity } from 'types/common';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { ERTBaseURLMultiPicker } from './ERTBaseURLMultiPicker';\r\n\r\nexport interface EmailRecipientTypesPickerProps {\r\n  value?: Entity<number>[] | null;\r\n  name?: string;\r\n  error?: boolean;\r\n  label?: string;\r\n  className?: string | undefined;\r\n  helperText?: string;\r\n  placeholder?: string | undefined;\r\n  // value: Entity<number>[];\r\n  defaultValue?: Entity<number>[];\r\n  onChange: (value: Entity<number>[]) => void;\r\n  onBlur?: React.FocusEventHandler<HTMLDivElement>;\r\n  variant?: 'standard' | 'filled' | 'outlined';\r\n  info?: string;\r\n  id?: string;\r\n  required?: boolean;\r\n  fullWidth?: boolean;\r\n}\r\n\r\nconst url = '/api/odata/v4/EmailRecipientTypesFilter';\r\n\r\nexport const initEmailRecipientTypesData = (\r\n  initval: string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: new Condition('Id', ODataOperators.Equals, id).toString(),\r\n      $select: 'Id,Name',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\n\r\nexport function EmailRecipientTypesPicker({\r\n  label,\r\n  defaultValue,\r\n  placeholder,\r\n  className,\r\n  required,\r\n  helperText,\r\n  onChange,\r\n  variant,\r\n  info,\r\n  id,\r\n  value,\r\n  ...props\r\n}: EmailRecipientTypesPickerProps) {\r\n  return (\r\n    <ERTBaseURLMultiPicker\r\n      url={url}\r\n      queryfilter={``}\r\n      variant={variant}\r\n      onChange={onChange}\r\n      info={info}\r\n      id={id || 'users-filter'}\r\n      helperText={helperText}\r\n      required={required}\r\n      className={className}\r\n      onBlur={props.onBlur}\r\n      placeholder={placeholder}\r\n      defaultValue={defaultValue ?? []}\r\n      label={label}\r\n      value={value ?? []}\r\n      {...props}\r\n      error={props.error}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * FormEmailRecipientTypes(multi) AsyncPicker\r\n *\r\n */\r\n\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { EmailRecipientTypesPicker } from '../pickers/MultiSelectPickers/EmailRecipientTypesPicker';\r\n\r\nexport const FormEmailRecipientTypesPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number>[] | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number>[] | null>(props);\r\n  return (\r\n    <>\r\n      <EmailRecipientTypesPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        info={props.info}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { FormHelperText } from '@material-ui/core';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FormEmailAttachmentTypePicker } from 'app/components/Forms/FormEmailAttachmentTypePicker';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport { FormInvoiceStatusPicker } from 'app/components/Forms/FormInvoiceStatusPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormScreenToShowOnPicker } from 'app/components/Forms/FormScreenToShowOnPicker';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { BillingActionsDetailsState } from '../slice/types';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { FormPaymentMethodEnumPicker } from '../../../../../components/Forms/FormPaymentMethodEnumPicker';\r\nimport { FormEmailRecipientTypesPicker } from 'app/components/Forms/FormEmailRecipientTypesPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport i18next from 'i18next';\r\nimport { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport * as Yup from 'yup';\r\n\r\nexport interface BillingActionsFormProps {\r\n  initialValues: BillingActionsDetailsState;\r\n  onSubmit: (item: BillingActionsDetailsState) => void;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  bindSubmitForm: any;\r\n}\r\n\r\nexport const BillingActionsForm = React.memo(function BillingActionsForm({\r\n  initialValues,\r\n  onSubmit,\r\n  isEdit,\r\n  isAdmin,\r\n  bindSubmitForm,\r\n}: BillingActionsFormProps): JSX.Element {\r\n  //SETTINGS\r\n  const { t } = useTranslation();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const isSftpEnabled = IsModuleEnabled(\r\n    appSettings ?? null,\r\n    KnownModules.SAP_SFTP,\r\n  ) as boolean;\r\n  const budgetFieldFundingTypeEnabled:\r\n    | boolean\r\n    | undefined = IsBudgetFieldEnabled(\r\n    appSettings ?? null,\r\n    BudgetFields.FundingType,\r\n  );\r\n\r\n  //STATES\r\n  const [IsSendEmailChanged, setIsSendEmailChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [IsSftpUploadChanged, setIsSftpUploadChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  //FUNCTIONS\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n\r\n  const handleFormChange = React.useCallback(\r\n    (values: BillingActionsDetailsState, isValid, dirty, setValue) => {\r\n      if (IsSendEmailChanged) {\r\n        setValue('EmailRecipientTypes', [], false);\r\n        setValue('EmailAttachmentTypes', [], false);\r\n        setValue('SpecificEmailAddresses', '', false);\r\n        setValue('Subject', '', false);\r\n        setValue('Body', '', false);\r\n        setIsSendEmailChanged(false);\r\n      }\r\n      if (IsSftpUploadChanged) {\r\n        setValue('EmailRecipientTypes', [], false);\r\n        setValue('EmailAttachmentTypes', [], false);\r\n        setValue('SpecificEmailAddresses', '', false);\r\n        setValue('Subject', '', false);\r\n        setValue('Body', '', false);\r\n        setIsSftpUploadChanged(false);\r\n      }\r\n    },\r\n    [IsSendEmailChanged, IsSftpUploadChanged],\r\n  );\r\n\r\n  //VALIDATION SCHEMA for BillingActionsDetails Form\r\n  const isMultipleEmails = {\r\n    name: 'isMultipleEmails',\r\n    // eslint-disable-next-line no-template-curly-in-string\r\n    message: '${path} not all are a valid email',\r\n    test: async value => {\r\n      if (!value) return true;\r\n      let values = value.split(',');\r\n      //let values = value.replace(/\\s/g, '').split(',');\r\n      let res = await Promise.all(\r\n        values.map(\r\n          async v => (await Yup.string().email().isValid(v)) && v !== '',\r\n        ),\r\n      );\r\n      return res.every(v => !!v);\r\n    },\r\n  };\r\n\r\n  const billingActionsDetailsSchema: Yup.SchemaOf<BillingActionsDetailsState> = Yup.object(\r\n    {\r\n      Id: Yup.number().notRequired().default(-1),\r\n      OperationName: Yup.string()\r\n        .nullable()\r\n        .default('')\r\n        .required(i18next.t(translations.err_OperationNameRequired))\r\n        .label(i18next.t(translations.OperationName)),\r\n      ShowOn: Yup.mixed()\r\n        .label(i18next.t(translations.ShowOn))\r\n        .required(i18next.t(translations.err_ShowOn)),\r\n      FundingType: Yup.mixed()\r\n        .label(i18next.t(translations.FundingType))\r\n        .when(['YupFundingType'], {\r\n          is: () => budgetFieldFundingTypeEnabled === true,\r\n          then: schema =>\r\n            schema.required(i18next.t(translations.FundingTypeIsRequired)),\r\n          otherwise: schema => schema.notRequired(),\r\n        }),\r\n      ChangeStatusTo: Yup.mixed().label(i18next.t(translations.ChangeStatusTo)),\r\n      GeneratePayment: Yup.mixed().label(\r\n        i18next.t(translations.GeneratePayment),\r\n      ),\r\n      IsSendEmail: Yup.boolean()\r\n        .default(false)\r\n        .label(i18next.t(translations.IsSendEmail)),\r\n      IsSftpUpload: Yup.boolean()\r\n        .default(false)\r\n        .label(i18next.t(translations.IsSftpUpload)),\r\n      EmailRecipientTypes: Yup.array()\r\n        .of(EntityNumberSchema)\r\n        .label(i18next.t(translations.EmailRecipientTypes)),\r\n      SpecificEmailAddresses: Yup.string()\r\n        .nullable()\r\n        .test(isMultipleEmails)\r\n        .default('')\r\n        .label(i18next.t(translations.SpecificEmailAddresses))\r\n        .when(['EmailRecipientTypes', 'IsSendEmail'], {\r\n          is: (EmailRecipientTypes, IsSendEmail) =>\r\n            EmailRecipientTypes.length <= 0 && IsSendEmail === true,\r\n          then: schema => schema.required(i18next.t(translations.Required)),\r\n          otherwise: schema => schema.notRequired(),\r\n        }),\r\n      Body: Yup.string()\r\n        .nullable()\r\n        .notRequired()\r\n        .label(i18next.t(translations.Body)),\r\n      Subject: Yup.string()\r\n        .nullable()\r\n        //.required(i18next.t(translations.EmailSubject_RequiredField))\r\n        .label(i18next.t(translations.Subject)),\r\n      EmailAttachmentTypes: Yup.array()\r\n        .of(EntityNumberSchema)\r\n        .when(['IsSftpUpload'], {\r\n          is: IsSftpUpload => IsSftpUpload === true,\r\n          then: schema => schema.required(i18next.t(translations.Required)),\r\n          otherwise: schema => schema.notRequired(),\r\n        })\r\n        .label(i18next.t(translations.EmailAttachmentTypes)),\r\n    },\r\n  );\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <Formik\r\n        initialValues={initialValues}\r\n        validationSchema={billingActionsDetailsSchema}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('Submitting: ', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            //console.log('Billing Actions Details Errors: ', formik.errors);\r\n          }\r\n          return (\r\n            <>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['IsSendEmail']}\r\n                />\r\n                <FormLeftSection>\r\n                  <FormFieldsSection\r\n                    titleSection={\r\n                      t(translations.BillingActionDetails) as string\r\n                    }\r\n                  >\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        id=\"OperationNameID\"\r\n                        name=\"OperationName\"\r\n                        label={t(translations.OperationName)}\r\n                        placeholder={t(translations.OperationName)}\r\n                        disabled={formik.isSubmitting}\r\n                        info={t(translations.err_OperationNameUnique)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormScreenToShowOnPicker\r\n                        id=\"ShowOnID\"\r\n                        name=\"ShowOn\"\r\n                        label={t(translations.ShowOn)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow hide={!budgetFieldFundingTypeEnabled}>\r\n                      <FormFundingTypePicker\r\n                        id=\"FundingTypeID\"\r\n                        name=\"FundingType\"\r\n                        label={t(translations.FundingType)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormInvoiceStatusPicker\r\n                        id=\"ChangeStatusToID\"\r\n                        name=\"ChangeStatusTo\"\r\n                        label={t(translations.ChangeStatusTo)}\r\n                        placeholder={t(translations.AllInvoiceStatuses)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormPaymentMethodEnumPicker\r\n                        id=\"GeneratePaymentID\"\r\n                        name=\"GeneratePayment\"\r\n                        label={t(translations.GeneratePayment)}\r\n                        placeholder={t(translations.AllValues)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n                <FormRightSection>\r\n                  <FormFieldsSection>\r\n                    <FormRow fullRow>\r\n                      <FormSwitch\r\n                        id=\"IsSendEmailID\"\r\n                        boldLebel\r\n                        name=\"IsSendEmail\"\r\n                        label={t(translations.IsSendEmail)}\r\n                        disabled={formik.isSubmitting}\r\n                        onChange={() => setIsSendEmailChanged(true)}\r\n                      />\r\n                    </FormRow>\r\n                    {isSftpEnabled && (\r\n                      <FormRow fullRow>\r\n                        <FormSwitch\r\n                          id=\"IsSftpUpload\"\r\n                          boldLebel\r\n                          name=\"IsSftpUpload\"\r\n                          label={t(translations.IsSftpUpload)}\r\n                          disabled={formik.isSubmitting}\r\n                          onChange={() => setIsSftpUploadChanged(true)}\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    <FormRow hide={!formik.values.IsSendEmail}>\r\n                      <FormEmailRecipientTypesPicker\r\n                        id=\"EmailRecipientTypesID\"\r\n                        name=\"EmailRecipientTypes\"\r\n                        label={t(translations.EmailRecipientTypes)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow hide={!formik.values.IsSendEmail}>\r\n                      {/* to make it visible only if specific email is choosen */}\r\n                      <FormTextField\r\n                        id=\"SpecificEmailAddressesID\"\r\n                        name=\"SpecificEmailAddresses\"\r\n                        fullWidth\r\n                        label={t(translations.SpecificEmailAddresses)}\r\n                        disabled={formik.isSubmitting}\r\n                        info={t(\r\n                          translations.EnterEmailsSeparatedByCommaWithoutSpaces,\r\n                        )}\r\n                      />\r\n                      {!!formik.errors.Id && (\r\n                        <Box>\r\n                          <FormHelperText error>\r\n                            {formik.errors.Id}\r\n                          </FormHelperText>\r\n                        </Box>\r\n                      )}\r\n                    </FormRow>\r\n                    <FormRow\r\n                      hide={\r\n                        !formik.values.IsSendEmail &&\r\n                        !formik.values.IsSftpUpload\r\n                      }\r\n                    >\r\n                      <FormEmailAttachmentTypePicker\r\n                        id=\"EmailAttachmentTypesID\"\r\n                        name=\"EmailAttachmentTypes\"\r\n                        label={t(translations.EmailAttachmentTypes)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow hide={!formik.values.IsSendEmail}>\r\n                      <FormTextField\r\n                        id=\"SubjectID\"\r\n                        name=\"Subject\"\r\n                        fullWidth\r\n                        label={t(translations.Subject)}\r\n                        disabled={formik.isSubmitting}\r\n                        info={\r\n                          'You can use the following variables:' +\r\n                          ' {0} - Invoice Id,' +\r\n                          ' {1} - Invoice Start Date,' +\r\n                          ' {2} - Invoice End Date'\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow hide={!formik.values.IsSendEmail}>\r\n                      <FormRichTextField\r\n                        id=\"BodyID\"\r\n                        fullWidth\r\n                        name=\"Body\"\r\n                        label={t(translations.Body)}\r\n                        disabled={formik.isSubmitting}\r\n                        info={\r\n                          'Please mind using email supported HTML. The following attributes are supported:' +\r\n                          ' {0} - User E-mail Address Display Name,' +\r\n                          ' {1} - Invoice Start Date,' +\r\n                          ' {2} - Invoice End Date,' +\r\n                          ' {3} - Invoice Details Link,' +\r\n                          ' {4} - User Group Name'\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormRightSection>\r\n              </StyledForm>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","/**\r\n *\r\n * BillingActions_Actions\r\n *\r\n */\r\n\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: SaveFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  BillingActionsDetailsState,\r\n  BillingActionsDetailsQStringParameters,\r\n} from './slice/types';\r\nimport { useBillingActionsDetailsSlice } from './slice/index';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  selectBillingActionsDetailsProcessing,\r\n  selectCreateBillingActionsDetails,\r\n  selectCreateBillingActionsDetailsCompleted,\r\n  selectUpdateBillingActionsDetails,\r\n  selectUpdateBillingActionsDetailsCompleted,\r\n  //selectCreateBillingActionsDetailsHasError,\r\n  //selectUpdateBillingActionsDetailsHasError,\r\n} from './slice/selectors';\r\nimport { Fragment, useCallback, useEffect, useRef, useState } from 'react';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n  selectContinueToLink,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { push } from 'connected-react-router';\r\nimport Box from '@material-ui/core/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { BillingActionsForm } from './BillingActionsForm/index';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { SaveFormButton } from './Actions/BillingActions_Actions';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface BillingActionsDetailsProps extends SidePanelContentProps {\r\n  queryParams: BillingActionsDetailsQStringParameters;\r\n}\r\n\r\nexport function BillingActionsDetails(\r\n  props: BillingActionsDetailsProps,\r\n): JSX.Element {\r\n  //PROPS\r\n  const { queryParams, useSidePanel } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n\r\n  //PERMISSIONS\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const IsAdmin =\r\n    User !== undefined && User.Roles.includes(Roles.Administrators);\r\n\r\n  //SLICES\r\n  const { actions } = useBillingActionsDetailsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n  //SELECTORS\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  //====================================================================\r\n  const hasUnsavedChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const loading = useSelector(selectBillingActionsDetailsProcessing);\r\n  //====================================================================\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  //====================================================================\r\n  const requestCreateCompleted = useSelector(\r\n    selectCreateBillingActionsDetailsCompleted,\r\n  );\r\n  const requestUpdateCompleted = useSelector(\r\n    selectUpdateBillingActionsDetailsCompleted,\r\n  );\r\n  //====================================================================\r\n  //const hasCreateError = useSelector(selectCreateBillingActionsDetailsHasError);\r\n  //const hasUpdateError = useSelector(selectUpdateBillingActionsDetailsHasError);\r\n  //const hasError = hasCreateError || hasUpdateError;\r\n  //====================================================================\r\n  const createModel = useSelector(\r\n    selectCreateBillingActionsDetails,\r\n    shallowEqual,\r\n  );\r\n  const editModel = useSelector(\r\n    selectUpdateBillingActionsDetails,\r\n    shallowEqual,\r\n  );\r\n  const baseModel = createModel || editModel;\r\n  //====================================================================\r\n\r\n  //STATES\r\n  const [edit, setEdit] = useState<boolean>(false);\r\n  const [busy, setBusy] = useState<boolean>(false);\r\n  const [requestCompleted, setRequestCompleted] = useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n\r\n  //REF\r\n  const submitFormRef = useRef<any>(null);\r\n\r\n  //FUNCTIONS\r\n  const bindSubmitForm = useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n\r\n  const handleSaveClick = (e: any) => {\r\n    handleSubmitForm(e);\r\n  };\r\n\r\n  const handleSubmit = useCallback(\r\n    (values: BillingActionsDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateBillingActionsDetails({\r\n            current: values,\r\n            original: baseModel,\r\n          }),\r\n        );\r\n      } else {\r\n        let value = values as BillingActionsDetailsState;\r\n        console.debug('Data: ', value);\r\n        dispatch(actions.createBillingActionsDetails(values));\r\n      }\r\n    },\r\n    [actions, baseModel, dispatch, edit],\r\n  );\r\n\r\n  const handleCancelClick = useCallback(() => {\r\n    if (useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    } else {\r\n      dispatch(push('/BillingActions'));\r\n    }\r\n    if (edit) {\r\n      dispatch(actions.resetUpdateBillingActionsDetailsState());\r\n    } else {\r\n      dispatch(actions.resetCreateBillingActionsDetailsState());\r\n    }\r\n  }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n  const handleClose = () => {\r\n    if (hasUnsavedChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCancelClick();\r\n    }\r\n  };\r\n\r\n  //USE EFFECT ON MOUNT\r\n  useEffectOnMount(() => {\r\n    if (\r\n      queryParams.id !== undefined &&\r\n      !isNaN(parseInt(queryParams.id || ''))\r\n    ) {\r\n      dispatch(actions.initUpdateBillingActionsDetails(queryParams));\r\n    } else {\r\n      dispatch(actions.initBillingActionsDetails(queryParams));\r\n    }\r\n    setBusy(false);\r\n    setEdit(false);\r\n    setRequestCompleted(undefined);\r\n    return () => {};\r\n  });\r\n\r\n  //USE EFFECT\r\n  useEffect(() => {\r\n    let active = loading === false;\r\n    if (active) {\r\n      if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n        setEdit(true);\r\n      }\r\n      if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n      } else if (\r\n        requestCreateCompleted === false ||\r\n        requestUpdateCompleted === false\r\n      ) {\r\n        setRequestCompleted(false);\r\n        setBusy(false);\r\n      }\r\n      if (requestUpdateCompleted === true || requestCreateCompleted === true) {\r\n        handleCancelClick();\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    handleCancelClick,\r\n    loading,\r\n    queryParams.id,\r\n    requestCreateCompleted,\r\n    requestUpdateCompleted,\r\n  ]);\r\n\r\n  //USE EFFECT 2\r\n  useEffect(() => {\r\n    if (confirmApproved) {\r\n      if (edit) {\r\n        dispatch(actions.resetUpdateBillingActionsDetailsState());\r\n      } else {\r\n        dispatch(actions.resetCreateBillingActionsDetailsState());\r\n      }\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(layoutActions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(appSettingsActions.navigate(continueLink));\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n    return () => undefined;\r\n  }, [\r\n    actions,\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n  ]);\r\n\r\n  //LEFT ACTIONS\r\n  const leftActions = [\r\n    () => (\r\n      <Fragment>\r\n        <SaveFormButton\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"save\" />}\r\n          onClick={handleSaveClick}\r\n          disabled={busy}\r\n          processing={!requestCompleted && busy}\r\n          edit={edit}\r\n          text={t(translations.Save)}\r\n        />\r\n      </Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n\r\n  //RIGHT ACTIONS\r\n  const rightActions = [\r\n    () => (\r\n      <Fragment>\r\n        <Button\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={handleCancelClick}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <PageWrapper\r\n        id=\"billing_actions_details\"\r\n        pageName={\r\n          edit\r\n            ? t(translations.menu_EditAction)\r\n            : t(translations.menu_AddNewAction)\r\n        }\r\n        titlePage={\r\n          baseModel\r\n            ? edit\r\n              ? ` ${t(translations.EditAction)} #${queryParams.id || 'N/A'}`\r\n              : ` ${t(translations.AddNewAction)}`\r\n            : undefined\r\n        }\r\n        loading={loading}\r\n        useSidePanel={useSidePanel}\r\n        leftActions={leftActions}\r\n        rightActions={rightActions}\r\n        closable={true}\r\n        closeSidePanel={handleClose}\r\n        toPageLink={`BillingActions/details?${toQueryString(\r\n          props.queryParams,\r\n        )}`}\r\n        pageLink={buildURL(\r\n          publicUrl + 'BillingActions/details',\r\n          props.queryParams,\r\n        )}\r\n        children={\r\n          baseModel !== undefined && !loading ? (\r\n            <Fragment>\r\n              <BillingActionsForm\r\n                initialValues={baseModel || ({} as BillingActionsDetailsState)}\r\n                bindSubmitForm={bindSubmitForm}\r\n                onSubmit={handleSubmit}\r\n                isEdit={edit}\r\n                isAdmin={IsAdmin}\r\n              />\r\n            </Fragment>\r\n          ) : (\r\n            <Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={loading} size={80} />\r\n              </Box>\r\n            </Fragment>\r\n          )\r\n        }\r\n      />\r\n      {hasUnsavedChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport RegionFilter from 'app/components/BasicTable/Filters/RegionFilter';\r\nimport { ServiceGroupsFilter } from 'app/components/BasicTable/Filters/ServiceGroupsFilter';\r\nimport { SuperGroupFilter } from 'app/components/BasicTable/Filters/SuperGroupFilter';\r\nimport {\r\n  arrayToQueryString,\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  getNumberEntityArray,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  initExPickerValue,\r\n  initMultiExPickerValue,\r\n  initPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initRegionData } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\nimport { initSuperGroupData } from 'app/components/pickers/AutocompletePickers/SuperGroupPicker';\r\nimport { initServiceGroupsMultiData } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\nexport const GetFilters: GetPageFilters<ICoresDirectoryRow> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParams(search);\r\n  const isAdmin =\r\n    !!user &&\r\n    (user.Roles.includes(Roles.Administrators) ||\r\n      user.Roles.includes(Roles.GroupAdministrators));\r\n  const hasOwnedGroups =\r\n    !!user && user.AdminServiceGroups && user.AdminServiceGroups.length > 0;\r\n  const res: IFilterSettings<ICoresDirectoryRow>[] = [\r\n    {\r\n      fieldName: 'Id',\r\n      displayName: t(translations.ServiceGroup),\r\n      operator: ODataOperators.Includes,\r\n      queryStringSerializer: arrayToQueryString('sgids'),\r\n      value: getNumberEntityArray(params, 'sgids'),\r\n      initData: initMultiExPickerValue(initServiceGroupsMultiData),\r\n      component: ServiceGroupsFilter,\r\n      urlKey: 'sgids',\r\n    },\r\n  ];\r\n  if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n    res.push({\r\n      fieldName: 'DivisionId',\r\n      displayName: t(translations.Division),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'divisionId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'divisionId')),\r\n      ),\r\n      component: SuperGroupFilter,\r\n      initData: initPickerValue(initSuperGroupData),\r\n    });\r\n    res.push({\r\n      fieldName: 'RegionId',\r\n      displayName: t(translations.Region),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'regionid',\r\n      initData: initExPickerValue(initRegionData, undefined, 'base'),\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'regionid')),\r\n      ),\r\n      component: RegionFilter,\r\n      urlType: 'base',\r\n    });\r\n  }\r\n  if (hasOwnedGroups) {\r\n    res.push({\r\n      fieldName: 'OwnedByMe',\r\n      displayName: t(translations.OnlyMyCores),\r\n      queryStringSerializer: 'ownedbyme',\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'ownedbyme')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n    });\r\n  }\r\n  if (isAdmin) {\r\n    res.push({\r\n      fieldName: 'Active',\r\n      displayName: t(translations.Active),\r\n      queryStringSerializer: 'Active',\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'Active')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n    });\r\n  }\r\n  return res;\r\n};\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport const getDefaultFilter = (onlyMyCores: boolean) => {\r\n  const result = (user: IAuthenticatedUser) =>\r\n    toQueryString({\r\n      ownedbyme: onlyMyCores === true ? true : undefined,\r\n    });\r\n  return result;\r\n};\r\nexport function getRequiredFilter(search: string) {\r\n  const result = isEmptyOrWhitespace(search)\r\n    ? new URLSearchParams()\r\n    : new URLSearchParams(search);\r\n  if (\r\n    result.has('Active') === false ||\r\n    result.get('Active') === null ||\r\n    result.get('Active') === ''\r\n  ) {\r\n    result.set('Active', true.toString());\r\n  }\r\n  const res = result.toString();\r\n  return isEmptyOrWhitespace(res) ? undefined : res;\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { IPermissionLevelDto } from 'api/odata/generated/entities/IPermissionLevelDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface PermissionLevelPickerProps\r\n  extends Omit<AutocompletePickerProps<IPermissionLevelDto>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/PermissionLevelFilter';\r\nexport const initPermissionLevelData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IPermissionLevelDto>)[] | undefined,\r\n  globalServiceGroupFilter: Entity<number>[],\r\n) =>\r\n  getAutoCompleteLoadDataFn<IPermissionLevelDto>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name', 'ServiceGroupId'],\r\n    globalServiceGroupFilter:\r\n      !!globalServiceGroupFilter && globalServiceGroupFilter.length > 0\r\n        ? [\r\n            new Condition<IPermissionLevelDto>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              globalServiceGroupFilter.map(f => f.Id),\r\n            ),\r\n          ]\r\n        : [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\nexport const loadPermissionLevels = loadData;\r\nexport function PermissionLevelPicker(props: PermissionLevelPickerProps) {\r\n  const innerLoadData = loadData(props.predicates, []);\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'PermissionLevelPickerId'}\r\n      loadData={innerLoadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n// export function TrainingLevelFilter(\r\n//   equipments: IServiceFilterDto[],\r\n//   trainingLevelPermissionsEnabled,\r\n//   userPermissionsEnabled,\r\n// ): (string | Condition<ITrainingLevelFilterDto>)[] {\r\n//   const predicates: (string | Condition<ITrainingLevelFilterDto>)[] = [];\r\n//   if (!!equipments && equipments.length > 0) {\r\n//     if (trainingLevelPermissionsEnabled) {\r\n//       predicates.push(\r\n//         equipments\r\n//           .map(eq => {\r\n//             if (eq.UseServiceGroupTrainingLevels) {\r\n//               return `(ServiceGroupId eq null or ServiceGroupId eq ${quoteODataValue(\r\n//                 eq.ServiceGroupId,\r\n//               )})`;\r\n//             } else {\r\n//               return `LevelEquipments/any(g: g eq ${quoteODataValue(eq.Id)})`;\r\n//             }\r\n//           })\r\n//           .join(' or '),\r\n//       );\r\n//     } else if (userPermissionsEnabled) {\r\n//       // noop - clients could not select training level that was not part of user or group permissions on selected equipment they needed on uchicago\r\n//       // should be properly resolved in https://prog4biz.atlassian.net/browse/BKT-8190\r\n//     }\r\n//     if (predicates.length > 0) {\r\n//       return predicates;\r\n//     }\r\n//     return [];\r\n//   } else {\r\n//     return [];\r\n//   }\r\n// }\r\n","/**\r\n *\r\n * FormPermissionLevelPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IPermissionLevelDto } from 'api/odata/generated/entities/IPermissionLevelDto';\r\nimport { PermissionLevelPicker } from 'app/components/pickers/AutocompletePickers/PermissionLevelPicker';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\n\r\nexport const FormPermissionLevelPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<IPermissionLevelDto | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<IPermissionLevelDto | null>(props);\r\n  return (\r\n    <>\r\n      <PermissionLevelPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        predicates={props.predicates}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        disabled={props.disabled}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface TimeSlotTypePickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/TimeSlotTypeFilter';\r\nexport const initTimeSlotTypeData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<Entity<number>>)[] | undefined,\r\n) =>\r\n  getAutoCompleteLoadDataFn<Entity<number>>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: ['Id', 'Name'],\r\n  });\r\nexport const loadTimeSlotTypes = loadData;\r\nexport function TimeSlotTypePicker(props: TimeSlotTypePickerProps) {\r\n  const innerLoadData = loadData(props.predicates);\r\n  return (\r\n    <AutocompletePicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      id={props.id || 'TimeSlotTypePickerId'}\r\n      loadData={innerLoadData}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * FormTimeSlotTypePicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\nimport { Entity } from 'types/common';\r\nimport { TimeSlotTypePicker } from 'app/components/pickers/AutocompletePickers/TimeSlotTypePicker';\r\n\r\nexport const FormTimeSlotTypePicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <TimeSlotTypePicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        predicates={props.predicates}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        disabled={props.disabled}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { UserGroupMultiPicker } from 'app/components/pickers/AutocompletePickers/UserGroupMultiPicker';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { IFieldProps } from '../FormRender/IFormFieldSetting';\r\n\r\nexport const FormUserGroupsPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<string>[] | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<string>[] | null>(props);\r\n  return (\r\n    <UserGroupMultiPicker\r\n      name={props.name}\r\n      placeholder={props.placeholder}\r\n      label={label}\r\n      onChange={value => {\r\n        helpers.setValue(value, true);\r\n        if (props.onChange) {\r\n          props.onChange(value);\r\n        }\r\n      }}\r\n      onChipClick={props.onChipClick}\r\n      onBlur={field?.onBlur}\r\n      value={field.value ?? undefined}\r\n      error={meta?.error !== undefined}\r\n      variant=\"filled\"\r\n      helperText={meta.error}\r\n      fullWidth={props.fullWidth}\r\n      info={props.info}\r\n      queryfilter={\r\n        !!props.predicates\r\n          ? props.predicates.map(f => f.toString()).join(' and ')\r\n          : undefined\r\n      }\r\n      disabled={props.disabled}\r\n    />\r\n  );\r\n};\r\n","import { FormPermissionLevelPicker } from 'app/components/Forms/FormPermissionLevelPicker';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTimeSlotTypePicker } from 'app/components/Forms/FormTimeSlotTypePicker';\r\nimport { FormUserGroupsPicker } from 'app/components/Forms/FormUserGroupsPicker';\r\nimport { EntityStringSchema } from 'app/components/Forms/Schemas';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport * as yup from 'yup';\r\nimport { GroupPermissionsModel } from '.';\r\n\r\nexport interface UpdateGroupPermissionsFormProps {\r\n  groups: ICoresDirectoryRow[];\r\n  handleSubmitForm: (submit: any) => void;\r\n  onSubmit: (model: GroupPermissionsModel) => void;\r\n}\r\n\r\nexport function UpdateGroupPermissionsForm(\r\n  props: UpdateGroupPermissionsFormProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const schema: yup.SchemaOf<GroupPermissionsModel> = yup.object({\r\n    AdGroups: yup\r\n      .array()\r\n      .of(EntityStringSchema)\r\n      .label(t(translations.UserGroup) as string)\r\n      .min(1)\r\n      .required(t(translations.err_UserGroupRequired) as string),\r\n    PermissionLevel: yup\r\n      .mixed()\r\n      .label(t(translations.PermissionLevel) as string)\r\n      .required(t(translations.err_SelectPermissionLevelException) as string),\r\n    TimeSlotType: yup\r\n      .mixed()\r\n      .label(t(translations.TimeSlotType) as string)\r\n      .required(t(translations.err_TimeSlotTypeRequired) as string),\r\n  });\r\n  return (\r\n    <Formik\r\n      onSubmit={props.onSubmit}\r\n      initialValues={{\r\n        AdGroups: [],\r\n        PermissionLevel: undefined,\r\n        TimeSlotType: undefined,\r\n      }}\r\n      validationSchema={schema}\r\n    >\r\n      {formik => {\r\n        props.handleSubmitForm(formik.submitForm);\r\n        return (\r\n          <StyledForm>\r\n            <FormLeftSection>\r\n              <FormFieldsSection\r\n                titleSection={t(\r\n                  translations.SetPermissionsOnSelectedServiceGroups,\r\n                )}\r\n              >\r\n                <FormRow fullRow>\r\n                  <FormUserGroupsPicker\r\n                    name=\"AdGroups\"\r\n                    id=\"UserGroupId\"\r\n                    label={t(translations.UserGroup)}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormPermissionLevelPicker\r\n                    name=\"PermissionLevel\"\r\n                    id=\"permissionlvlId\"\r\n                    label={t(translations.PermissionLevel)}\r\n                    fullWidth\r\n                  />\r\n                </FormRow>\r\n                <FormRow fullRow>\r\n                  <FormTimeSlotTypePicker\r\n                    name=\"TimeSlotType\"\r\n                    id=\"tstId\"\r\n                    fullWidth\r\n                    label={t(translations.TimeSlotType)}\r\n                  />\r\n                </FormRow>\r\n              </FormFieldsSection>\r\n            </FormLeftSection>\r\n          </StyledForm>\r\n        );\r\n      }}\r\n    </Formik>\r\n  );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport * as React from 'react';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { translations } from 'locales/translations';\r\nimport { UpdateGroupPermissionsForm } from './UpdateGroupPermissions';\r\nimport { Entity } from 'types/common';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { ActionButton } from 'app/components/BasicButtons/ActionButton';\r\n\r\nexport interface UpdateUserGroupPermissionsProps {\r\n  rows: ICoresDirectoryRow[];\r\n  user?: AuthenticatedUser;\r\n}\r\nexport interface GroupPermissionsModel {\r\n  AdGroups: Entity<string>[];\r\n  PermissionLevel?: Entity<number>;\r\n  TimeSlotType?: Entity<number>;\r\n}\r\nexport interface GroupPermissionsUpdate {\r\n  ServiceGroups: string;\r\n  AdGroups: string;\r\n  PermissionLevelId: number;\r\n  TimeSlotTypeId: number;\r\n}\r\nexport function UpdateUserGroupPermissions(\r\n  props: UpdateUserGroupPermissionsProps,\r\n) {\r\n  const { rows } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const [updtPermissionOpen, setUpdtPermissionOpen] = React.useState(false);\r\n  const [submitted, setSubmitted] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const submitFormRef = React.useRef<any>();\r\n  const bindSubmitForm = React.useCallback(value => {\r\n    submitFormRef.current = value;\r\n  }, []);\r\n  const updatePermission = React.useCallback(\r\n    (model: GroupPermissionsModel, groups: ICoresDirectoryRow[]) => {\r\n      setSubmitted(true);\r\n      const params = {\r\n        ServiceGroups: groups.map(f => f.Id).join(','),\r\n        AdGroups: model.AdGroups.map(f => f.Id).join(','),\r\n        PermissionLevelId: model.PermissionLevel?.Id ?? -1,\r\n        TimeSlotTypeId: model.TimeSlotType?.Id ?? -1,\r\n      } as GroupPermissionsUpdate;\r\n      const url =\r\n        '/api/odata/v4/RestrictedUserPermissions/UpdateGroupPermissions';\r\n      httpClient\r\n        .post<IResponseType>(url, { params: params })\r\n        .then(v => {\r\n          setSubmitted(undefined);\r\n          if (v.ErrorMessages.length > 0) {\r\n            dispatch(\r\n              actions.addNotifications(\r\n                v.ErrorMessages.map(e => ({ message: e, variant: 'error' })),\r\n              ),\r\n            );\r\n          }\r\n          if (v.WarningMessages.length > 0) {\r\n            dispatch(\r\n              actions.addNotifications(\r\n                v.WarningMessages.map(e => ({\r\n                  message: e,\r\n                  variant: 'warning',\r\n                })),\r\n              ),\r\n            );\r\n          }\r\n          if (v.SuccessMessages.length > 0) {\r\n            dispatch(\r\n              actions.addNotifications(\r\n                v.SuccessMessages.map(e => ({\r\n                  message: e,\r\n                  variant: 'success',\r\n                })),\r\n              ),\r\n            );\r\n            setUpdtPermissionOpen(false);\r\n          }\r\n        })\r\n        .catch(e => {\r\n          console.error(e);\r\n          setSubmitted(undefined);\r\n        })\r\n        .finally(() => {\r\n          setSubmitted(undefined);\r\n        });\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  return (\r\n    <React.Fragment>\r\n      {updtPermissionOpen && (\r\n        <DialogConfirm\r\n          maxWidth=\"sm\"\r\n          isOpen={updtPermissionOpen}\r\n          onConfirm={() => submitFormRef.current()}\r\n          confirmButtonLabel={t(translations.CreateUpdateGroupPermissions)}\r\n          processing={submitted}\r\n          onCancel={() => {\r\n            setUpdtPermissionOpen(false);\r\n          }}\r\n          onClose={() => {\r\n            setUpdtPermissionOpen(false);\r\n          }}\r\n          body={\r\n            <div>\r\n              <UpdateGroupPermissionsForm\r\n                groups={rows}\r\n                handleSubmitForm={bindSubmitForm}\r\n                onSubmit={group => {\r\n                  updatePermission(group, rows);\r\n                }}\r\n              />\r\n            </div>\r\n          }\r\n        />\r\n      )}\r\n      <ActionButton\r\n        onClick={() => setUpdtPermissionOpen(true)}\r\n        title={t(translations.SetPermissionsOnSelectedServiceGroups)}\r\n        text={t(translations.SetPermissions) as string}\r\n        processing={submitted}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { GetResponseMessages } from 'app/pages/UsersPage/PageActions/Actions';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { UpdateUserGroupPermissions } from './UpdateUserGroupPermissions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { ExportImportActions } from 'app/components/PopupImportExport/Actions';\r\nimport fileDownload from 'js-file-download';\r\n\r\nconst SelectedActions = {\r\n  Delete: (rows: ICoresDirectoryRow[]): Promise<any> => {\r\n    const groupIds: number[] = rows.map(item => item.Id);\r\n    const data = { groupIds };\r\n    const url = '/api/odata/v4/ServiceGroups/DeleteGroups';\r\n    return httpClient.post(url, data);\r\n  },\r\n  Deactivate: (rows: ICoresDirectoryRow[]): Promise<any> => {\r\n    const groupIds: number[] = rows.map(item => item.Id);\r\n    const data = { groupIds };\r\n    const url = '/api/odata/v4/ServiceGroups/DeactivateGroups';\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\nexport function GetSelectedActions(\r\n  t: TFunction,\r\n  user?: AuthenticatedUser,\r\n): SelectedRowsActionRenderer<ICoresDirectoryRow>[] {\r\n  const { allowedToEditGroup } = useAdminPermissions();\r\n  const SelectedRowActions: SelectedRowsActionRenderer<\r\n    ICoresDirectoryRow\r\n  >[] = useMemo(\r\n    () => [\r\n      (rows, refresh) =>\r\n        rows.length > 0 &&\r\n        rows.every(allowedToEditGroup) && (\r\n          <SelectedRowsActionIconButton\r\n            key=\"export-forimport-cores\"\r\n            title={t(translations.ExportForImport)}\r\n            text={t(translations.ExportForImport)}\r\n            confirm={false}\r\n            //validConfirm={validUpdate}\r\n            rows={rows}\r\n            onRefresh={refresh}\r\n            variantButton=\"button\"\r\n            action={() =>\r\n              new Promise<IResponseType>(async (resolve, reject) => {\r\n                const selectedRows = rows.map(item => item.Id);\r\n                const res = await ExportImportActions.ExportForImport(\r\n                  ScreensId.CoresDirectory,\r\n                  selectedRows,\r\n                );\r\n                const cd = res.headers['content-disposition'];\r\n                const filename =\r\n                  cd !== undefined\r\n                    ? cd.split('filename=')[1]\r\n                    : 'ExportForImport_serviceGroups.xlsx';\r\n                fileDownload(res.data, filename);\r\n                let messages: IResponseType = {\r\n                  SuccessMessages: [],\r\n                  ErrorMessages: [],\r\n                  WarningMessages: [],\r\n                };\r\n                resolve(messages);\r\n              })\r\n            }\r\n          />\r\n        ),\r\n      (rows, onRefresh) =>\r\n        rows.length > 0 &&\r\n        rows.every(allowedToEditGroup) && (\r\n          <SelectedRowsActionIconButton\r\n            key=\"delete\"\r\n            text={t(translations.DeleteSelectedGroups)}\r\n            title={t(translations.DeleteSelectedGroups)}\r\n            confirm={true}\r\n            validConfirm={true}\r\n            confirmBody={\r\n              t(translations.SelectedServiceGroupsWillBeDeleted) as string\r\n            }\r\n            rows={rows}\r\n            confirmButtonLabel={t(translations.Delete)}\r\n            onRefresh={onRefresh}\r\n            variantButton=\"button\"\r\n            action={() =>\r\n              new Promise<IResponseType>((resolve, reject) => {\r\n                //here make request to DeleteOtherServices Action in Controller\r\n                return SelectedActions.Delete(rows)\r\n                  .then(response => {\r\n                    //GetResponseMessages is from UsersPage\r\n                    const messages: IResponseType = GetResponseMessages(\r\n                      response,\r\n                      t(translations.Success) as string,\r\n                    );\r\n                    resolve(messages);\r\n                  })\r\n                  .catch(error => {\r\n                    console.log('status error', error);\r\n                    let err = t(\r\n                      translations.err_ServiceGroupCanNotBeDeleted,\r\n                    ) as string;\r\n                    reject(err);\r\n                  });\r\n              })\r\n            }\r\n          />\r\n        ),\r\n      (rows, onRefresh) =>\r\n        rows.length > 0 &&\r\n        rows.every(allowedToEditGroup) && (\r\n          <SelectedRowsActionIconButton\r\n            key=\"deactivate\"\r\n            text={t(translations.DeactivateServiceGroup)}\r\n            title={t(translations.DeactivateServiceGroup)}\r\n            confirm={true}\r\n            validConfirm={true}\r\n            confirmBody={t(translations.ConfirmDeactivate) as string}\r\n            rows={rows}\r\n            confirmButtonLabel={t(translations.Deactivate)}\r\n            onRefresh={onRefresh}\r\n            variantButton=\"button\"\r\n            action={() =>\r\n              new Promise<IResponseType>((resolve, reject) => {\r\n                return SelectedActions.Deactivate(rows)\r\n                  .then(response => {\r\n                    const messages: IResponseType = GetResponseMessages(\r\n                      response,\r\n                      t(translations.Success) as string,\r\n                    );\r\n                    resolve(messages);\r\n                  })\r\n                  .catch(error => {\r\n                    console.log('status error', error);\r\n                    let err = t(\r\n                      translations.err_ServiceGroupCanNotBeDeactivated,\r\n                    ) as string;\r\n                    reject(err);\r\n                  });\r\n              })\r\n            }\r\n          />\r\n        ),\r\n      rows =>\r\n        rows.length > 0 &&\r\n        rows.every(allowedToEditGroup) && (\r\n          <UpdateUserGroupPermissions rows={rows} />\r\n        ),\r\n    ],\r\n    [allowedToEditGroup, t],\r\n  );\r\n  return SelectedRowActions;\r\n}\r\n","import { BasicTable } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { GetFilters } from './getFilters';\r\nimport * as React from 'react';\r\nimport { getColumns } from './Columns';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { IBasicTableState } from 'app/components/BasicTable/UnconfigurableTable/UnconfigurableTable';\r\nimport { translations } from 'locales/translations';\r\nimport { IdType, Row } from 'react-table';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport {\r\n  SelectedRowsActionExtRenderer,\r\n  SelectedRowsActionRenderer,\r\n} from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAppSettings,\r\n  selectGlobalServiceGroupFilter,\r\n  selectGlobalSettingBool,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { BookitChipWithInfo } from 'app/components/BasicChip';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TabsActionRenderer } from 'app/components/BasicTable/components/TabsToolbar/TabsActionRender';\r\nimport { Tab } from '@material-ui/core';\r\nimport { getDefaultFilter, getRequiredFilter } from './getDefaultFilters';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { selectHideNavigation } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport { ServiceGroupRegistrationStatus } from 'enums/ServiceGroupRegistrationStatus';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { URLSearchParamsCI } from 'app/components/BasicTable/types/FilterParam';\r\nimport { routerActions } from 'connected-react-router';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { Check } from 'app/components/BasicInputs/Check';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport FormControlLabel from 'app/components/Forms/FormControls/FormControlLabel';\r\nimport { Roles } from 'app/slice/types';\r\nimport { AdminActions } from 'app/components/Admin/AdminActions';\r\nimport { GetSelectedActions } from '../SelectedBulkActions/GetSelectedActions';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { PopupImportExport } from 'app/components/PopupImportExport';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { Body } from 'app/components/Typography';\r\nimport { useOpenAssetPopUp } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport htmlParse from 'html-react-parser';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\n// import { RowsCountPicker } from 'app/components/Dashboard/TableViewEdit/RowsCountPicker';\r\n\r\nexport interface CoreSelectionTableProps {\r\n  isSidePanel?: boolean;\r\n  authenticatedUser?: AuthenticatedUser;\r\n  closeSidePanel: () => void;\r\n  setFilters?: (\r\n    appliedFilters: IFilterSettings<ICoresDirectoryRow>[] | undefined,\r\n  ) => void;\r\n  updtFirstLogin: (val: boolean) => void;\r\n  updtOptOut: (val: boolean) => void;\r\n  //primaryAction?: (row: Row<ICoresDirectoryRow>) => void;\r\n  isRowSelectable: (row: Row<ICoresDirectoryRow>) => boolean;\r\n  redirectToDash: boolean;\r\n  isFirstLogin?: boolean;\r\n  optOutCoreSelection?: boolean;\r\n  openPanel: (state: SidePanelOpenState) => void;\r\n}\r\n\r\nexport function CoreSelectionTable(props: CoreSelectionTableProps) {\r\n  const {\r\n    isSidePanel,\r\n    setFilters,\r\n    authenticatedUser,\r\n    closeSidePanel,\r\n    updtFirstLogin,\r\n    updtOptOut,\r\n    //primaryAction,\r\n    isRowSelectable,\r\n    redirectToDash,\r\n    optOutCoreSelection,\r\n    openPanel,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: serviceGroupActions } = useAppSettingsSlice();\r\n  const hideNavigation = useSelector(selectHideNavigation);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const history = useHistory();\r\n  const location = useLocation();\r\n  const isMobile = DetectIsMobile();\r\n  //const publicUrl = useSelector(selectPublicUrl);\r\n  const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const [onlyMyCores, setOnlyMyCores] = React.useState(false);\r\n  const [tabNumber, setTubNumber] = React.useState(0);\r\n  const [showImportConfirm, setShowImportConfirm] = React.useState(false);\r\n  const { allowedToEditGroup } = useAdminPermissions();\r\n  const userHelp = settings.GetNullableByKey(\r\n    AllowedSettings.Help_ServiceGroupRegistration,\r\n  );\r\n  const [multiCoresSelectionMode, setMultiCoresselectionMode] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const skipCoreSelectionScreen = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.SkipCoreSelectionScreen),\r\n  );\r\n  const [selectedRowIds, setSelectedRowIds] = React.useState<\r\n    Record<IdType<number>, boolean>\r\n  >({});\r\n  const [loacalServiceGroups, setLoacalServiceGroups] = useAsyncExtendedState<\r\n    Entity<number>[]\r\n  >([]);\r\n  useEffectOnMount(() => {\r\n    dispatch(serviceGroupActions.loadGlobalServiceGroupFilter());\r\n  });\r\n  const openAsset = useOpenAssetPopUp();\r\n  React.useEffect(() => {\r\n    let obj = {};\r\n    if (!!savedServiceGroups && savedServiceGroups.length > 0) {\r\n      for (const key of savedServiceGroups) {\r\n        obj[key.Id] = true;\r\n      }\r\n      setMultiCoresselectionMode(savedServiceGroups.length > 1);\r\n      setLoacalServiceGroups(savedServiceGroups);\r\n    }\r\n    setSelectedRowIds(obj);\r\n  }, [savedServiceGroups, setLoacalServiceGroups]);\r\n\r\n  const showMyCoresOptions = React.useMemo(() => {\r\n    return (\r\n      !!authenticatedUser &&\r\n      !!authenticatedUser.AdminServiceGroups &&\r\n      authenticatedUser.AdminServiceGroups.length > 0\r\n    );\r\n  }, [authenticatedUser]);\r\n  const handleRemoveGroup = React.useCallback(\r\n    (value: Entity<number>) => {\r\n      setLoacalServiceGroups(oldGroups => {\r\n        let newGroups = oldGroups.filter(group => group.Id !== value.Id);\r\n        return newGroups;\r\n      });\r\n      // if (loacalServiceGroups) {\r\n      //   let newGroups = loacalServiceGroups.filter(\r\n      //     group => group.Id !== value.Id,\r\n      //   );\r\n\r\n      //   //dispatch(actions.saveGlobalServiceGroupFilter(newGroups || []));\r\n      // }\r\n    },\r\n    [setLoacalServiceGroups],\r\n  );\r\n  const handleRowsServiceGroupsChange = React.useCallback(\r\n    (rows: Row<ICoresDirectoryRow>[], selected: boolean) => {\r\n      let selectable = rows.map(f => {\r\n        return {\r\n          Id: f.original.Id,\r\n          Name: f.original.Name,\r\n        } as Entity<number>;\r\n      });\r\n      if (selected) {\r\n        setLoacalServiceGroups([\r\n          ...loacalServiceGroups,\r\n          ...selectable.filter(\r\n            f => !loacalServiceGroups.some(s => s.Id === f.Id),\r\n          ),\r\n        ]);\r\n      } else {\r\n        setLoacalServiceGroups([\r\n          ...loacalServiceGroups.filter(\r\n            f => !selectable.some(s => s.Id === f.Id),\r\n          ),\r\n        ]);\r\n      }\r\n\r\n      //dispatch(actions.saveGlobalServiceGroupFilter(selectable || []));\r\n    },\r\n    [loacalServiceGroups, setLoacalServiceGroups],\r\n  );\r\n  const handleServiceGroupsChange = React.useCallback(\r\n    (value: Entity<number>[] | []) => {\r\n      dispatch(actions.saveGlobalServiceGroupFilter(value || []));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n\r\n  const handleSingleGroupChange = React.useCallback(\r\n    (value: Entity<number>, added: boolean) => {\r\n      if (added) {\r\n        if (loacalServiceGroups.length + 1 > 1) {\r\n          setMultiCoresselectionMode(true);\r\n        }\r\n        setLoacalServiceGroups(oldGroups => [...oldGroups, value]);\r\n        // dispatch(\r\n        //   actions.saveGlobalServiceGroupFilter(\r\n        //     !!savedServiceGroups ? [...savedServiceGroups, value] : [value],\r\n        //   ),\r\n        // );\r\n      } else {\r\n        if (loacalServiceGroups.length - 1 < 2) {\r\n          setMultiCoresselectionMode(false);\r\n        }\r\n        handleRemoveGroup(value);\r\n      }\r\n    },\r\n    [handleRemoveGroup, loacalServiceGroups.length, setLoacalServiceGroups],\r\n  );\r\n  const onSelectChange = React.useCallback(\r\n    (row: ICoresDirectoryRow, checked: boolean) => {\r\n      handleSingleGroupChange(\r\n        {\r\n          Id: row.Id,\r\n          Name: row.Name,\r\n        } as Entity<number>,\r\n        checked,\r\n      );\r\n    },\r\n    [handleSingleGroupChange],\r\n  );\r\n  const primaryAction = React.useCallback(\r\n    (row: Row<ICoresDirectoryRow>) => {\r\n      //dispatch(layoutActions.setUpSnackBarIndex(true));\r\n      let canSwitch = isRowSelectable(row);\r\n      if (!multiCoresSelectionMode) {\r\n        if (canSwitch) {\r\n          // handleRowsServiceGroupsChange([row]);\r\n          if (hideNavigation) {\r\n            handleServiceGroupsChange([\r\n              {\r\n                Id: row.original.Id,\r\n                Name: row.original.Name,\r\n              } as Entity<number>,\r\n            ]);\r\n            updtFirstLogin(false);\r\n            dispatch(layoutActions.setHideNavigation(false));\r\n            history.push('/dashboards/core/' + row.original.Id);\r\n          } else if (isSidePanel) {\r\n            handleServiceGroupsChange([\r\n              {\r\n                Id: row.original.Id,\r\n                Name: row.original.Name,\r\n              } as Entity<number>,\r\n            ]);\r\n            if (redirectToDash) {\r\n              dispatch(layoutActions.resetSidePanel());\r\n              history.push('/dashboards/core/' + row.original.Id);\r\n            } else {\r\n              dispatch(layoutActions.resetSidePanel());\r\n            }\r\n          } else {\r\n            handleServiceGroupsChange([\r\n              {\r\n                Id: row.original.Id,\r\n                Name: row.original.Name,\r\n              } as Entity<number>,\r\n            ]);\r\n            if (redirectToDash) {\r\n              history.push('/dashboards/core/' + row.original.Id);\r\n            }\r\n          }\r\n        } else {\r\n          if (row.original.CanRequestAccess) {\r\n            if (hideNavigation) {\r\n              updtFirstLogin(false);\r\n              setTimeout(() => {\r\n                window.open(\r\n                  toRootedURL(\r\n                    `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n                  ),\r\n                  '_blank',\r\n                );\r\n                dispatch(layoutActions.setHideNavigation(false));\r\n              }, 20);\r\n            } else if (isSidePanel) {\r\n              window.open(\r\n                toRootedURL(\r\n                  `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n                ),\r\n                '_blank',\r\n              );\r\n              dispatch(layoutActions.resetSidePanel());\r\n            } else {\r\n              window.open(\r\n                toRootedURL(\r\n                  `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n                ),\r\n                '_blank',\r\n              );\r\n            }\r\n          } else {\r\n            dispatch(\r\n              actions.addNotification({\r\n                key: 'coreSelection_error',\r\n                message: (t(\r\n                  translations.OnSelectNotRegisteredCore_error,\r\n                ) as string).replace('{0}', row.original.Name),\r\n                variant: 'error',\r\n                autoHideDuration: 10000,\r\n              }),\r\n            );\r\n          }\r\n        }\r\n      } else {\r\n        if (canSwitch) {\r\n          handleSingleGroupChange(\r\n            {\r\n              Id: row.original.Id,\r\n              Name: row.original.Name,\r\n            } as Entity<number>,\r\n            !row.isSelected,\r\n          );\r\n          row.toggleRowSelected(!row.isSelected);\r\n        } else {\r\n          if (row.original.CanRequestAccess) {\r\n            if (hideNavigation) {\r\n              updtFirstLogin(false);\r\n              dispatch(layoutActions.setHideNavigation(false));\r\n              setTimeout(() => {\r\n                window.open(\r\n                  toRootedURL(\r\n                    `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n                  ),\r\n                  '_blank',\r\n                );\r\n              }, 20);\r\n            } else if (isSidePanel) {\r\n              window.open(\r\n                toRootedURL(\r\n                  `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n                ),\r\n                '_blank',\r\n              );\r\n              dispatch(layoutActions.resetSidePanel());\r\n            } else {\r\n              window.open(\r\n                toRootedURL(\r\n                  `/ServiceGroupRegister.aspx?sgid=${row.original.Id}`,\r\n                ),\r\n                '_blank',\r\n              );\r\n            }\r\n          } else {\r\n            dispatch(\r\n              actions.addNotification({\r\n                key: 'coreSelection_error',\r\n                message: (t(\r\n                  translations.OnSelectNotRegisteredCore_error,\r\n                ) as string).replace('{0}', row.original.Name),\r\n                variant: 'error',\r\n                autoHideDuration: 10000,\r\n              }),\r\n            );\r\n          }\r\n        }\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      handleServiceGroupsChange,\r\n      handleSingleGroupChange,\r\n      hideNavigation,\r\n      history,\r\n      isRowSelectable,\r\n      isSidePanel,\r\n      layoutActions,\r\n      multiCoresSelectionMode,\r\n      redirectToDash,\r\n      t,\r\n      updtFirstLogin,\r\n    ],\r\n  );\r\n  const primaryMultipleAction = React.useCallback(() => {\r\n    handleServiceGroupsChange(loacalServiceGroups);\r\n    if (hideNavigation) {\r\n      updtFirstLogin(false);\r\n      dispatch(layoutActions.setHideNavigation(false));\r\n      history.push('/systemdash');\r\n    } else if (isSidePanel) {\r\n      if (redirectToDash) {\r\n        history.push('/systemdash');\r\n      }\r\n      updtFirstLogin(false);\r\n      dispatch(layoutActions.resetSidePanel());\r\n    } else {\r\n      // if (redirectToDash) {\r\n      //   history.push('/systemdash');\r\n      // }\r\n      updtFirstLogin(false);\r\n      history.push('/systemdash');\r\n    }\r\n  }, [\r\n    dispatch,\r\n    handleServiceGroupsChange,\r\n    hideNavigation,\r\n    history,\r\n    isSidePanel,\r\n    layoutActions,\r\n    loacalServiceGroups,\r\n    redirectToDash,\r\n    updtFirstLogin,\r\n  ]);\r\n\r\n  const TTable = React.useMemo(\r\n    () =>\r\n      filterHandler<ICoresDirectoryRow, {}>(BasicTable, GetFilters, {\r\n        isSidePanel: isSidePanel,\r\n        setFilters: setFilters,\r\n        reservedQueryStringParameterNames: ['ownedbyme'],\r\n        getDefaultFilter: getDefaultFilter(onlyMyCores),\r\n        getRequiredFilter: getRequiredFilter,\r\n      }),\r\n    [isSidePanel, onlyMyCores, setFilters],\r\n  );\r\n\r\n  const columns = React.useMemo(() => {\r\n    return getColumns(\r\n      t,\r\n      isRowSelectable,\r\n      authenticatedUser,\r\n      settings,\r\n      appSettings,\r\n      isSidePanel,\r\n    );\r\n  }, [\r\n    appSettings,\r\n    authenticatedUser,\r\n    isRowSelectable,\r\n    isSidePanel,\r\n    settings,\r\n    t,\r\n  ]);\r\n\r\n  const rowActions: CellRenderer<ICoresDirectoryRow>[] = React.useMemo<\r\n    CellRenderer<ICoresDirectoryRow>[]\r\n  >(() => {\r\n    let actions: CellRenderer<ICoresDirectoryRow>[] = [];\r\n\r\n    actions.push(({ row }) => {\r\n      // let canSwitch = isRowSelectable(row);\r\n      let canRequestAccess = row.original.CanRequestAccess;\r\n      if (canRequestAccess) {\r\n        return (\r\n          <Button\r\n            size=\"small\"\r\n            variant=\"main\"\r\n            onClick={() => {\r\n              primaryAction(row);\r\n            }}\r\n          >\r\n            {t(translations.RequestAccess)}\r\n          </Button>\r\n        );\r\n      } else if (isRowSelectable(row)) {\r\n        return (\r\n          <Button\r\n            size=\"small\"\r\n            variant=\"white\"\r\n            onClick={() => {\r\n              primaryAction(row);\r\n            }}\r\n          >\r\n            {row.isSelected\r\n              ? t(translations.DeSelectServiceGroup)\r\n              : t(translations.SelectServiceGroup)}\r\n          </Button>\r\n        );\r\n      } else if (\r\n        row.original.ApprovalStatusId ===\r\n        (ServiceGroupRegistrationStatus.Pending as number)\r\n      ) {\r\n        return (\r\n          <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>\r\n            <Icon icon=\"hourglass-half\" />\r\n            <Body size=\"small\" color=\"secondary\">\r\n              {t(\r\n                translations[\r\n                  ServiceGroupRegistrationStatus[\r\n                    row.original.ApprovalStatusId ?? 0\r\n                  ]\r\n                ],\r\n              )}\r\n            </Body>\r\n          </div>\r\n        );\r\n      } else {\r\n        return <span></span>;\r\n      }\r\n    });\r\n    actions.push(({ row }) => {\r\n      let canSwitch = isRowSelectable(row);\r\n      let canRequestAccess = row.original.CanRequestAccess;\r\n      if (canRequestAccess || canSwitch) {\r\n        return (\r\n          <Button\r\n            size=\"small\"\r\n            variant=\"text\"\r\n            onClick={() => {\r\n              const id = row.original.AssetId ?? undefined;\r\n              if (id !== undefined) {\r\n                openAsset(\r\n                  {\r\n                    id: id,\r\n                    useSidePanel: isSidePanel,\r\n                  },\r\n                  openPanel,\r\n                );\r\n              }\r\n            }}\r\n          >\r\n            {t(translations.ViewServiceGroupDetails)}\r\n          </Button>\r\n        );\r\n      } else {\r\n        return <span></span>;\r\n      }\r\n    });\r\n    return actions;\r\n  }, [isRowSelectable, isSidePanel, openAsset, openPanel, primaryAction, t]);\r\n\r\n  const selectedRowActions: SelectedRowsActionExtRenderer<\r\n    ICoresDirectoryRow\r\n  >[] = React.useMemo(() => {\r\n    let actions: SelectedRowsActionExtRenderer<ICoresDirectoryRow>[] =\r\n      loacalServiceGroups.length > 0\r\n        ? loacalServiceGroups.map(\r\n            sg => (\r\n              _selectedRows,\r\n              _rows,\r\n              _onRefresh,\r\n              _toggleAll,\r\n              toggleSingle,\r\n            ) => (\r\n              <BookitChipWithInfo\r\n                info={\r\n                  _rows.filter(f => f.id === sg.Id.toString()).length > 0\r\n                    ? undefined\r\n                    : t(translations.DeleteSelectedCard_info)\r\n                }\r\n                onDelete={() => {\r\n                  handleRemoveGroup(sg);\r\n                  _rows\r\n                    .filter(f => f.id === sg.Id.toString())\r\n                    .forEach(f => {\r\n                      f.toggleRowSelected(false);\r\n                    });\r\n                  // toggleSingle(sg.Id.toString(), false);\r\n                }}\r\n                disabled={\r\n                  !(_rows.filter(f => f.id === sg.Id.toString()).length > 0)\r\n                }\r\n                variant=\"default\"\r\n                customsize={isMobile ? 'small' : 'medium'}\r\n                label={sg.Name}\r\n                customwidth={isMobile ? 100 : 180}\r\n                custombgcolor={bookitColors.primary.disabled}\r\n                customcolor={bookitColors.grayscale.blackComponents}\r\n                customiconcolor={bookitColors.grayscale.blackComponents}\r\n                shape=\"circle\"\r\n                key={`selected_${sg.Id}`}\r\n              />\r\n            ),\r\n          )\r\n        : [];\r\n    return actions;\r\n  }, [handleRemoveGroup, isMobile, loacalServiceGroups, t]);\r\n\r\n  const tabLeftActions: TabsActionRenderer<\r\n    ICoresDirectoryRow\r\n  >[] = React.useMemo(() => {\r\n    return [\r\n      (count, _rows) => (\r\n        <Tab\r\n          key={0}\r\n          value={0}\r\n          label={(t(translations.AllCores) as string) + ` (${count})`}\r\n          onClick={() => {\r\n            setOnlyMyCores(false);\r\n            setTubNumber(0);\r\n            if (!isSidePanel && location.search.indexOf('ownedbyme') !== -1) {\r\n              const originalSearch = new URLSearchParamsCI(location.search);\r\n              originalSearch.delete('ownedbyme');\r\n              dispatch(\r\n                routerActions.replace({\r\n                  pathname: location.pathname,\r\n                  search: originalSearch.toString(),\r\n                }),\r\n              );\r\n            }\r\n          }}\r\n        />\r\n      ),\r\n      (_count, rows) => (\r\n        <Tab\r\n          key={1}\r\n          value={1}\r\n          label={\r\n            (t(translations.MyCores) as string) +\r\n            ` (${rows.filter(f => f.original.OwnedByMe === true).length})`\r\n          }\r\n          onClick={() => {\r\n            setOnlyMyCores(true);\r\n            setTubNumber(1);\r\n          }}\r\n        />\r\n      ),\r\n    ];\r\n  }, [dispatch, isSidePanel, location.pathname, location.search, t]);\r\n\r\n  const tabRightActions: TabsActionRenderer<\r\n    ICoresDirectoryRow\r\n  >[] = React.useMemo(() => {\r\n    return hideNavigation\r\n      ? [\r\n          (_count, _rows) => (\r\n            <FormControlLabel\r\n              label={t(translations.DontShowThisAgain) as string}\r\n              control={\r\n                <Check\r\n                  name=\"optOutCoreSelect\"\r\n                  color=\"primary\"\r\n                  id=\"optOutCoreSelect\"\r\n                  onChange={(_ev, checked) => {\r\n                    updtOptOut(checked);\r\n                    if (checked) {\r\n                      dispatch(\r\n                        actions.addNotification({\r\n                          key: 'coreSelection_optOut',\r\n                          message: t(\r\n                            translations.CoreSelectionOptOut_info,\r\n                          ) as string,\r\n                          variant: 'info',\r\n                          autoHideDuration: 3000,\r\n                          closable: true,\r\n                        }),\r\n                      );\r\n                    }\r\n                  }}\r\n                  checked={optOutCoreSelection}\r\n                />\r\n              }\r\n            />\r\n          ),\r\n        ]\r\n      : [];\r\n  }, [actions, dispatch, hideNavigation, optOutCoreSelection, t, updtOptOut]);\r\n\r\n  const selectedBulkActions: SelectedRowsActionRenderer<\r\n    ICoresDirectoryRow\r\n  >[] = GetSelectedActions(t, authenticatedUser);\r\n  const allowedToUseBulkActions = React.useMemo(() => {\r\n    return (\r\n      !isSidePanel &&\r\n      !!authenticatedUser &&\r\n      authenticatedUser.Roles.includes(Roles.GroupAdministrators) &&\r\n      loacalServiceGroups.every(allowedToEditGroup)\r\n    );\r\n  }, [allowedToEditGroup, authenticatedUser, isSidePanel, loacalServiceGroups]);\r\n  const useFloatingActions = React.useMemo(() => {\r\n    return multiCoresSelectionMode\r\n      ? loacalServiceGroups.length > 0 || skipCoreSelectionScreen\r\n      : loacalServiceGroups.length > 1;\r\n  }, [\r\n    loacalServiceGroups.length,\r\n    multiCoresSelectionMode,\r\n    skipCoreSelectionScreen,\r\n  ]);\r\n  const url = '/api/odata/v4/servicegroups';\r\n  const initialState: IBasicTableState<ICoresDirectoryRow> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Name', desc: false }],\r\n      selectedRowIds: selectedRowIds,\r\n      pageIndex: 0,\r\n      pageSize: 200,\r\n    }),\r\n    [selectedRowIds],\r\n  );\r\n\r\n  const pageActions: PageActionRenderer[] = React.useMemo(() => {\r\n    let acts: PageActionRenderer[] = [];\r\n    if (\r\n      !isMobile &&\r\n      !!authenticatedUser &&\r\n      authenticatedUser.Roles.includes(Roles.Administrators)\r\n    ) {\r\n      acts.push(() => (\r\n        <TopActionButton\r\n          text={t(translations.CreateNew) as string}\r\n          icon=\"plus\"\r\n          startIcon=\"plus\"\r\n          size=\"small\"\r\n          variant={'main'}\r\n          href={toRootedURL(`/newgroup.aspx`)}\r\n          target=\"_blank\"\r\n        />\r\n      ));\r\n    }\r\n    if (isSidePanel) {\r\n      acts.push(() => (\r\n        <IconButton\r\n          variant=\"ghost\"\r\n          aria-label=\"close\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          disabled={\r\n            !(loacalServiceGroups.length > 0 || skipCoreSelectionScreen)\r\n          }\r\n          onClick={() => {\r\n            handleServiceGroupsChange(loacalServiceGroups);\r\n            if (hideNavigation) {\r\n              updtFirstLogin(false);\r\n              history.push('/systemdash');\r\n            } else if (isSidePanel) {\r\n              if (redirectToDash) {\r\n                history.push('/systemdash');\r\n              }\r\n              closeSidePanel();\r\n            } else {\r\n              history.push('/systemdash');\r\n              updtFirstLogin(false);\r\n            }\r\n          }}\r\n          title={\r\n            !(loacalServiceGroups.length > 0 || skipCoreSelectionScreen)\r\n              ? t(translations.SelectDeffServiceGroups)\r\n              : t(translations.CloseSidePanel)\r\n          }\r\n        >\r\n          <Icon\r\n            icon=\"times\"\r\n            size=\"lg\"\r\n            color=\"default\"\r\n            colorExtend=\"textHover\"\r\n          />\r\n        </IconButton>\r\n      ));\r\n    } else {\r\n      if (\r\n        !isMobile &&\r\n        !!authenticatedUser &&\r\n        (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n          authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n      ) {\r\n        acts.push(() => (\r\n          <AdminActions\r\n            id={`core_settings`}\r\n            icon={'cog'}\r\n            menuTab=\"Cores\"\r\n            title={t(translations.CoresTabSetting)}\r\n          />\r\n        ));\r\n      }\r\n    }\r\n    return acts;\r\n  }, [\r\n    authenticatedUser,\r\n    closeSidePanel,\r\n    handleServiceGroupsChange,\r\n    hideNavigation,\r\n    history,\r\n    isMobile,\r\n    isSidePanel,\r\n    loacalServiceGroups,\r\n    redirectToDash,\r\n    skipCoreSelectionScreen,\r\n    t,\r\n    updtFirstLogin,\r\n  ]);\r\n  // const detailsRowActions: CellRenderer<\r\n  //   ICoresDirectoryRow\r\n  // >[] = GetDetailsRowActions(t, isRowSelectable, openPanel, isSidePanel);\r\n  const addColumns = React.useMemo(() => {\r\n    const adds: (keyof ICoresDirectoryRow)[] = [\r\n      'Id',\r\n      'AssetId',\r\n      'CanRequestAccess',\r\n      'UserRegistrationEnabled',\r\n      'ApprovalStatusId',\r\n      'Private',\r\n      'DivisionId',\r\n      'OwnedByMe',\r\n      'AdminsTotal',\r\n      'LabTechTotal',\r\n      'RegionId',\r\n    ];\r\n    if (\r\n      !!authenticatedUser &&\r\n      (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n        authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n    ) {\r\n      adds.push('AdminsTotal');\r\n      adds.push('LabTechTotal');\r\n    }\r\n    return adds;\r\n  }, [authenticatedUser]);\r\n  const ImportHandler = React.useCallback(() => {\r\n    setShowImportConfirm(true);\r\n  }, []);\r\n\r\n  const handleImportClose = React.useCallback(() => {\r\n    setShowImportConfirm(false);\r\n  }, []);\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <PopupImportExport\r\n        title={t(translations.Import)}\r\n        show={showImportConfirm}\r\n        screenId={ScreensId.CoresDirectory}\r\n        close={handleImportClose}\r\n      />\r\n      <TTable\r\n        screenId={ScreensId.CoresDirectory}\r\n        api={url}\r\n        useConfigurable={!hideNavigation}\r\n        useExport={!hideNavigation}\r\n        columns={columns}\r\n        screenName={t(translations.menu_CoreSelection)}\r\n        serviceGroups={[]}\r\n        topAlertMessage={\r\n          userHelp !== null\r\n            ? {\r\n                type: 'info',\r\n                closable: true,\r\n                children: htmlParse(userHelp),\r\n                variant: 'outlined',\r\n              }\r\n            : undefined\r\n        }\r\n        inlineRowActions={rowActions.length > 0 ? rowActions : undefined}\r\n        //rowActions={detailsRowActions}\r\n        selectedRowsActions={\r\n          allowedToUseBulkActions ? selectedBulkActions : undefined\r\n        }\r\n        initialState={initialState}\r\n        useImportLink={\r\n          !isMobile &&\r\n          !!authenticatedUser &&\r\n          (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n            authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n        }\r\n        importHandler={ImportHandler}\r\n        isRowSelectable={isRowSelectable}\r\n        isContentEditable={row => {\r\n          return (\r\n            (row.original.CanRequestAccess &&\r\n              (row.original.ApprovalStatusId === null ||\r\n                row.original.ApprovalStatusId === undefined) &&\r\n              row.original.ApprovalStatusId !==\r\n                ServiceGroupRegistrationStatus.Rejected) ||\r\n            row.original.ApprovalStatusId ===\r\n              ServiceGroupRegistrationStatus.Pending\r\n          );\r\n        }}\r\n        hideMenuOnMobile={isSidePanel}\r\n        // viewCardsCheck={multiCoresSelectionMode || isMobile}\r\n        viewCardsCheck={true}\r\n        onSelectedChange={onSelectChange}\r\n        // onSelectedRowsChange={rows => {\r\n        //   handleServiceGroupsChange(\r\n        //     rows.map(f => {\r\n        //       return {\r\n        //         Id: f.Id,\r\n        //         Name: f.Name,\r\n        //       } as Entity<number>;\r\n        //     }),\r\n        //   );\r\n        // }}\r\n        imageSrcKey=\"ImageName\"\r\n        titleKey=\"Name\"\r\n        allowCards={true}\r\n        primaryAction={(row, _toggleAllRowsSelected) => {\r\n          primaryAction(row);\r\n        }}\r\n        useCardsByDefault={true}\r\n        floatingTabSettings={{\r\n          useFloatingActions: useFloatingActions,\r\n          selectedFloatingActions: selectedRowActions,\r\n          buttonFloatingActions: [\r\n            _rows => (\r\n              <Button\r\n                size={isMobile ? 'small' : 'medium'}\r\n                onClick={() => primaryMultipleAction()}\r\n              >\r\n                {isMobile ? 'Continue' : 'Continue with Selected'}\r\n              </Button>\r\n            ),\r\n          ],\r\n          useSidePanel: isSidePanel,\r\n        }}\r\n        pageActions={pageActions}\r\n        additionalColumns={addColumns}\r\n        useRowSelect={true}\r\n        preventInnerClicks\r\n        searchColumns={['Name', 'Description']}\r\n        tabSectionSettings={{\r\n          useTabsSection: true,\r\n          leftTabs: showMyCoresOptions ? tabLeftActions : undefined,\r\n          selectedTabValue: tabNumber,\r\n          defaultMultiMode: multiCoresSelectionMode === true,\r\n          getMultiMode: value => setMultiCoresselectionMode(value),\r\n          showClear: !multiCoresSelectionMode && skipCoreSelectionScreen,\r\n          onAllRowsSelected: handleRowsServiceGroupsChange,\r\n          rightTabActions: tabRightActions,\r\n        }}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column, Row } from 'react-table';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\n\r\nimport ImageRenderer from 'app/components/BasicTable/CellRenderers/ImageRenderer';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { BooleanRender } from 'app/components/BasicTable/components/BooleanRender';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { RegionLink } from 'app/pages/Regions/RegionLink';\r\nimport { AppSettings, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\n\r\nexport const getColumns = (\r\n  t: TFunction,\r\n  isRowSelectable: (row: Row<ICoresDirectoryRow>) => boolean,\r\n  user: AuthenticatedUser | undefined,\r\n  settings: GlobalSettings | null,\r\n  appSettings: AppSettings | null,\r\n  useSidePanel?: boolean,\r\n) => {\r\n  const isAdmin = !!user && user.Roles.includes(Roles.Administrators);\r\n  const isGroupAdmin = !!user && user.Roles.includes(Roles.GroupAdministrators);\r\n  const cols: (Column<ICoresDirectoryRow> & { invisible?: boolean })[] = [\r\n    {\r\n      Header: t(translations.Name) as string,\r\n      accessor: 'Name',\r\n      Cell: ({ value, row }) => {\r\n        const id = row.original.AssetId ?? undefined;\r\n        if (id !== undefined) {\r\n          return (\r\n            //isRowSelectable(row) ? (\r\n            <AssetLink id={id} useSidePanel={useSidePanel}>\r\n              {value}\r\n            </AssetLink>\r\n          );\r\n        } else {\r\n          return <>{value}</>;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Image) as string,\r\n      accessor: 'ImageName',\r\n      Cell: ImageRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.Description) as string,\r\n      accessor: 'Description',\r\n      Cell: DescriptionCell({ width: 'long' }),\r\n    },\r\n  ];\r\n  if (isAdmin || isGroupAdmin) {\r\n    cols.push({\r\n      Header: t(translations.HashSymbol) as string,\r\n      accessor: 'Id',\r\n      Cell: ({ value, row }) => {\r\n        if (row.original.OwnedByMe) {\r\n          return (\r\n            <ExternalLink\r\n              href={toRootedURL(`/newgroup.aspx?Edit=${row.original.Id}`)}\r\n            >\r\n              {value}\r\n            </ExternalLink>\r\n          );\r\n        } else {\r\n          return <>{value}</>;\r\n        }\r\n      },\r\n    });\r\n    cols.push({\r\n      Header: t(translations.Active) as string,\r\n      accessor: 'Active',\r\n      Cell: ({ value }) => <BooleanRender value={value} />,\r\n    });\r\n    cols.push({\r\n      Header: t(translations.AdminEmail) as string,\r\n      accessor: 'AdminEmail',\r\n    });\r\n    if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n      cols.push({\r\n        Header: t(translations.Division) as string,\r\n        accessor: 'DivisionName',\r\n        Cell: ({ value, row }) => {\r\n          if (isAdmin) {\r\n            if (!row.original.DivisionId || row.original.DivisionId === null) {\r\n              return <>{t(translations.NA)}</>;\r\n            } else {\r\n              return (\r\n                <>\r\n                  <ExternalLink\r\n                    href={toRootedURL(\r\n                      `/newsupergroup.aspx?edit=${row.original.DivisionId}`,\r\n                    )}\r\n                  >\r\n                    {value}\r\n                  </ExternalLink>\r\n                </>\r\n              );\r\n            }\r\n          } else {\r\n            return <>{value ?? t(translations.NA)}</>;\r\n          }\r\n        },\r\n      });\r\n      cols.push({\r\n        Header: t(translations.Region) as string,\r\n        accessor: 'RegionName',\r\n        Cell: ({ value, row }) => {\r\n          if (isAdmin) {\r\n            if (!row.original.RegionId || row.original.RegionId === null) {\r\n              return <>{t(translations.NA)}</>;\r\n            } else {\r\n              return (\r\n                <RegionLink\r\n                  id={row.original.RegionId}\r\n                  initialModel={{\r\n                    Id: row.original.RegionId,\r\n                    Name: row.original.RegionName ?? value,\r\n                  }}\r\n                  useSidePanel={true}\r\n                >\r\n                  {value}\r\n                </RegionLink>\r\n              );\r\n            }\r\n          } else {\r\n            return <>{value ?? t(translations.NA)}</>;\r\n          }\r\n        },\r\n      });\r\n    }\r\n    cols.push({\r\n      Header: t(translations.OnlineServicesCount) as string,\r\n      accessor: 'OnlineServicesCount',\r\n      Cell: ({ value }) =>\r\n        !!value && value !== null ? <>{value}</> : <>{t(translations.NA)}</>,\r\n    });\r\n    cols.push({\r\n      Header: t(translations.OfflineServicesCount) as string,\r\n      accessor: 'OfflineServicesCount',\r\n      Cell: ({ value }) =>\r\n        !!value && value !== null ? <>{value}</> : <>{t(translations.NA)}</>,\r\n    });\r\n    cols.push({\r\n      Header: t(translations.RequestTypesCount) as string,\r\n      accessor: 'RequestTypesCount',\r\n      Cell: ({ value }) =>\r\n        !!value && value !== null ? <>{value}</> : <>{t(translations.NA)}</>,\r\n    });\r\n    if (\r\n      tryParseBool(\r\n        settings?.GetString(AllowedSettings.LimitServiceGroupLicenses),\r\n      ) === true\r\n    ) {\r\n      cols.push({\r\n        Header: t(translations.ServiceGroupAdminsLimit) as string,\r\n        accessor: 'AdminsLimit',\r\n        Cell: ({ value, row }) => {\r\n          return (\r\n            <span style={{ display: 'inline-flex', alignItems: 'center' }}>\r\n              {`${row.original.AdminsTotal}  / `}\r\n              {value === undefined || value === null || value === 0 ? (\r\n                <span style={{ fontSize: 24 }}>&#8734;</span>\r\n              ) : (\r\n                value\r\n              )}\r\n            </span>\r\n          );\r\n        },\r\n      });\r\n      cols.push({\r\n        Header: t(translations.LabTechsLimit) as string,\r\n        accessor: 'LabTechLimit',\r\n        Cell: ({ value, row }) => {\r\n          return (\r\n            <span style={{ display: 'inline-flex', alignItems: 'center' }}>\r\n              {`${row.original.LabTechTotal}  / `}\r\n              {value === undefined || value === null || value === 0 ? (\r\n                <span style={{ fontSize: 24 }}>&#8734;</span>\r\n              ) : (\r\n                value\r\n              )}\r\n            </span>\r\n          );\r\n        },\r\n      });\r\n    }\r\n  }\r\n  return cols.filter(v => !v.invisible) as Column<ICoresDirectoryRow>[];\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer } from 'utils/redux-injectors';\r\n// import { coreSelectionSaga } from './saga';\r\nimport { CoreSelectionState } from './types';\r\n\r\nexport const initialState: CoreSelectionState = {\r\n  filters: undefined,\r\n  loading: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'coreSelection',\r\n  initialState,\r\n  reducers: {\r\n    setFilters(state, action: PayloadAction<Record<string, any> | undefined>) {\r\n      state.filters = action.payload;\r\n    },\r\n    setLoading(state, action: PayloadAction<boolean>) {\r\n      state.loading = action.payload;\r\n    },\r\n    reset(state, action: PayloadAction) {\r\n      state.filters = undefined;\r\n      state.loading = undefined;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: coreSelectionActions } = slice;\r\n\r\nexport const useCoreSelectionSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  // useInjectSaga({ key: slice.name, saga: coreSelectionSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useCoreSelectionSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.coreSelection || initialState;\r\n\r\nexport const selectCoreSelection = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectCoreSelectionLoading = createSelector(\r\n  [selectCoreSelection],\r\n  state => state.loading,\r\n);\r\n\r\nexport const selectCoreSelectionFilters = createSelector(\r\n  [selectCoreSelection],\r\n  state => state.filters,\r\n);\r\n","import {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\n//import { selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n////import { useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { CoreSelectionTable } from './Table/CoreSelectionTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ICoresDirectoryRow } from 'types/ICoresDirectoryRow';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useCoreSelectionSlice } from './slice';\r\nimport { selectCoreSelectionFilters } from './slice/selectors';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n  selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport { selectHideNavigation } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Row } from 'react-table';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { ServiceGroupRegistrationStatus } from 'enums/ServiceGroupRegistrationStatus';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport interface CoreSelectionProps extends SidePanelContentProps, CoverProps {}\r\n\r\nexport function CoreSelection(props: CoreSelectionProps) {\r\n  const { useSidePanel, isCover, closeCover } = props;\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const { t } = useTranslation();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const noDashboardRedirectByClick =\r\n    settings.GetBoolean(\r\n      AllowedSettings[AllowedSettings.NoDashboardRedirectOnCoreSelection],\r\n    ) === true;\r\n  const redirectToDash = React.useMemo(() => {\r\n    return (\r\n      window.location.pathname.indexOf('/dashboards/core/') >= 0 ||\r\n      window.location.pathname.indexOf('/systemdash') >= 0 ||\r\n      !noDashboardRedirectByClick\r\n    );\r\n  }, [noDashboardRedirectByClick]);\r\n\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const filters = useSelector(selectCoreSelectionFilters);\r\n  const hideNavigation = useSelector(selectHideNavigation);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useCoreSelectionSlice();\r\n  // const openAsset = useOpenAssetPopUp();\r\n  // const history = useHistory();\r\n  // const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const {\r\n    cover,\r\n    closePanel,\r\n    openPanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState();\r\n  const {\r\n    savedEnabled: isFirstLogin,\r\n    updateEnabled: updateIsFirstLogin,\r\n  } = useProfileSetting({\r\n    profileSettingKey: 'IsFirstLoginUser',\r\n  });\r\n  const {\r\n    savedEnabled: OptOutCoreSelection,\r\n    updateEnabled: updateIsOptOut,\r\n  } = useProfileSetting({\r\n    profileSettingKey: 'CoreSelectionOptOut',\r\n  });\r\n  const pagelink = React.useMemo(\r\n    () => buildURL(`${publicUrl}coreselection`, filters ?? {}),\r\n    [filters, publicUrl],\r\n  );\r\n  useEffectOnMount(() => {\r\n    dispatch(\r\n      layoutActions.setHideNavigation(\r\n        !!authenticatedUser &&\r\n          !authenticatedUser.HasOptOutCoreSelection &&\r\n          !useSidePanel &&\r\n          isFirstLogin,\r\n      ),\r\n    );\r\n  });\r\n  // const closeCover = () => {\r\n  //   setCover(undefined);\r\n  // };\r\n\r\n  const closeSidePanel = React.useCallback(() => {\r\n    if (isFirstLogin && hideNavigation) {\r\n      updateIsFirstLogin(false);\r\n    }\r\n    closePanel({\r\n      isCover: isCover,\r\n      useSidePanel: useSidePanel,\r\n    } as SidePanelCloseState);\r\n  }, [\r\n    closePanel,\r\n    hideNavigation,\r\n    isCover,\r\n    isFirstLogin,\r\n    updateIsFirstLogin,\r\n    useSidePanel,\r\n  ]);\r\n  const isRowSelectable = (row: Row<ICoresDirectoryRow>): boolean => {\r\n    let isAdmin = authenticatedUser?.AdminServiceGroups?.some(\r\n      sg => sg.Id === row.original.Id,\r\n    );\r\n    let canSwitch =\r\n      row.original.Private === false ||\r\n      isAdmin === true ||\r\n      row.original.ApprovalStatusId === ServiceGroupRegistrationStatus.Approved;\r\n    return canSwitch;\r\n  };\r\n\r\n  const setfilterCallback = React.useCallback(\r\n    (v: IFilterSettings<ICoresDirectoryRow>[] | undefined) => {\r\n      const res = {};\r\n      if (!!v) {\r\n        toURLSearchParams(v).forEach((val, name) => {\r\n          res[name] = val;\r\n        });\r\n      }\r\n      dispatch(actions.setFilters(!v || v.length === 0 ? undefined : res));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  return (\r\n    <PageWrapper\r\n      pageLink={pagelink}\r\n      useSidePanel={useSidePanel}\r\n      //loading={loading}\r\n      //pageName={<Link href=\"coreselection\">{t(translations.menu_CoreSelection)}</Link>}\r\n      titlePage={t(translations.menu_CoreSelection)}\r\n      closable={useSidePanel}\r\n      //disableExpandToggle={true}\r\n      //rightTopActions={topButtons}\r\n      isCover={false}\r\n      coverClosed={coverClosed}\r\n      hideTitleBar={true}\r\n      cover={cover}\r\n      closeCover={!isCover ? onCloseCover : closeCover}\r\n      children={\r\n        <CoreSelectionTable\r\n          isSidePanel={useSidePanel}\r\n          setFilters={setfilterCallback}\r\n          authenticatedUser={authenticatedUser}\r\n          closeSidePanel={closeSidePanel}\r\n          updtFirstLogin={updateIsFirstLogin}\r\n          updtOptOut={updateIsOptOut}\r\n          optOutCoreSelection={OptOutCoreSelection}\r\n          isRowSelectable={isRowSelectable}\r\n          redirectToDash={redirectToDash}\r\n          isFirstLogin={isFirstLogin}\r\n          openPanel={openPanel}\r\n        />\r\n      }\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RadioGroup\r\n *\r\n */\r\nimport {\r\n  FormControl,\r\n  FormGroup,\r\n  FormHelperText,\r\n  FormLabel,\r\n} from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { Check } from '../BasicInputs/Check';\r\nimport FormControlLabel from '../Forms/FormControls/FormControlLabel';\r\n\r\nexport interface CheckEntity extends Entity<number> {\r\n  checked: boolean;\r\n  disabled?: boolean;\r\n}\r\nexport interface ChipEntity extends Entity<number> {\r\n  info?: string;\r\n  disabled?: boolean;\r\n}\r\nexport interface CheckBoxGroupProps {\r\n  options: CheckEntity[];\r\n  value?: CheckEntity[];\r\n  className?: string;\r\n  onChange?: (\r\n    value: CheckEntity,\r\n    event: React.ChangeEvent<HTMLInputElement>,\r\n  ) => void;\r\n  id: string;\r\n  //formik\r\n  name?: string;\r\n  error?: boolean;\r\n  label?: string;\r\n  disabled?: boolean;\r\n  required?: boolean;\r\n  helperText?: string;\r\n  info?: string;\r\n  fullWidth?: boolean;\r\n  size?: 'small' | 'medium';\r\n  margin?: 'none' | 'dense' | 'normal';\r\n  isRow?: boolean;\r\n}\r\n\r\nexport function CheckBoxGroup({\r\n  name,\r\n  id,\r\n  value,\r\n  options,\r\n  onChange,\r\n  label,\r\n  required,\r\n  helperText,\r\n  disabled,\r\n  fullWidth,\r\n  margin,\r\n  error,\r\n  size,\r\n  isRow,\r\n  ...props\r\n}: CheckBoxGroupProps) {\r\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = {\r\n      Id: parseInt(event.target.id),\r\n      Name: event.target.name,\r\n      checked: event.target.checked,\r\n    } as CheckEntity;\r\n    if (onChange !== undefined) {\r\n      onChange(value, event);\r\n    }\r\n  };\r\n  return (\r\n    <FormControl\r\n      required={required}\r\n      error={error}\r\n      component=\"fieldset\"\r\n      name={name}\r\n      margin={margin}\r\n      id={id}\r\n      fullWidth={fullWidth}\r\n    >\r\n      <FormLabel component=\"legend\">{label}</FormLabel>\r\n      <FormGroup row={isRow}>\r\n        {options.map((item, index) => (\r\n          <FormControlLabel\r\n            value={item}\r\n            key={item.Id}\r\n            disabled={disabled || item.disabled}\r\n            labelPlacement=\"top\"\r\n            control={\r\n              <Check\r\n                key={item.Id}\r\n                id={item.Id.toString()}\r\n                checked={item.checked}\r\n                name={item.Name}\r\n                onChange={handleChange}\r\n                size={size}\r\n                color=\"primary\"\r\n              />\r\n            }\r\n            label={item.Name}\r\n          />\r\n        ))}\r\n      </FormGroup>\r\n      <FormHelperText>{helperText}</FormHelperText>\r\n    </FormControl>\r\n    //  <MuiRadioGroup\r\n    //    key={id}\r\n    //    aria-label={id}\r\n    //    name={name}\r\n    //    value={value || ''}\r\n    //    onChange={handleChange}\r\n    //  >\r\n    //    {options.map((option, index) => (\r\n    //      <span key={option.Id}>\r\n    //        <FormControlLabel\r\n    //          key={option.Id}\r\n    //          value={option.Id}\r\n    //          control={<Radio key={option.Id} />}\r\n    //          label={option.Name}\r\n    //          disabled={props.disabled}\r\n    //        />\r\n    //        {(option as any).Info && (\r\n    //          <Tooltip key={option.Id + index} title={(option as any).Info}>\r\n    //            <span>\r\n    //              <Icon\r\n    //                key={option.Id}\r\n    //                icon=\"info-circle\"\r\n    //                color=\"default\"\r\n    //                colorExtend=\"textHover\"\r\n    //              />\r\n    //            </span>\r\n    //          </Tooltip>\r\n    //        )}\r\n    //      </span>\r\n    //    ))}\r\n    //  </MuiRadioGroup>\r\n  );\r\n}\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  CheckBoxGroup,\r\n  CheckBoxGroupProps,\r\n  CheckEntity,\r\n} from '../CheckBoxGroup';\r\n\r\n//export type FormCheckBoxGroupProps = FieldHookConfig<CheckEntity[]> & CheckBoxGroupProps;\r\n\r\nexport const FormCheckBoxGroup = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<CheckEntity[]> & CheckBoxGroupProps) => {\r\n  const [field, meta, helpers] = useField<CheckEntity[]>(props);\r\n  const handleChange = (value, event) => {\r\n    const val = value as CheckEntity;\r\n    helpers.setValue(\r\n      field.value.map(f => {\r\n        if (f.Id === val.Id) {\r\n          f.checked = val.checked;\r\n        }\r\n        return f;\r\n      }),\r\n      true,\r\n    );\r\n    if (props.onChange !== undefined) {\r\n      props.onChange(value, event);\r\n    }\r\n    field.onChange(event);\r\n  };\r\n  return (\r\n    <CheckBoxGroup\r\n      label={label}\r\n      value={field.value}\r\n      error={meta?.error !== undefined}\r\n      helperText={meta.error}\r\n      info={props.info}\r\n      onChange={handleChange}\r\n      disabled={props.disabled}\r\n      fullWidth={props.fullWidth}\r\n      required={props.required}\r\n      isRow={true}\r\n      margin=\"none\"\r\n      size=\"medium\"\r\n      {...props}\r\n    />\r\n  );\r\n};\r\n","/**\r\n *\r\n * EveryDaysPicker\r\n *\r\n */\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\n\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface EveryDaysPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const initEveryDaysData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        Array.from(Array(100))\r\n          .map((e, i) => {\r\n            return { Id: i, Name: i.toString() };\r\n          })\r\n          .filter(item => {\r\n            return item.Id.toString() === initval;\r\n          }),\r\n      );\r\n    });\r\n  }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = Array.from(Array(100))\r\n    .map((e, i) => {\r\n      return { Id: i, Name: i.toString() };\r\n    })\r\n    .filter(d => d.Id !== 0) as Entity<number>[];\r\n\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\nexport function EveryDaysPicker(props: EveryDaysPickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'everyDaysId'}\r\n      value={props.value}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { EveryDaysPicker } from '../pickers/StaticOptionsPickers/EveryDaysPicker';\r\n\r\nexport const FormEveryDaysPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <EveryDaysPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * RepeatMonthlyByPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { RepeatMonthlyBy } from 'enums/RepetitiveOptions';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface RepeatMonthlyByPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const initRepeatMonthlyByData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        enumToEntityArray(RepeatMonthlyBy).filter(item => {\r\n          return item.Id.toString() === initval;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(RepeatMonthlyBy);\r\n\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\nexport function RepeatMonthlyByPicker(props: RepeatMonthlyByPickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      value={props.value}\r\n      id={props.id || 'RepeatMonthlyById'}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RepeatMonthlyByPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { RepeatMonthlyByPicker } from '../pickers/StaticOptionsPickers/RepeatMonthlyBy';\r\n\r\nexport const FormRepeatMonthlyByPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <RepeatMonthlyByPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * RepeatPeriodPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport { RepeatPeriod } from 'enums/RepetitiveOptions';\r\nimport { Entity } from 'types/common';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\n\r\nexport interface RepeatPeriodPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'> {}\r\n\r\nexport const initRemindBeforeData = (\r\n  initval: number | string | undefined,\r\n): Promise<Entity<number>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve(\r\n        enumToEntityArray(RepeatPeriod).filter(item => {\r\n          return item.Id.toString() === initval;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\nconst getOptions = (searchTerm: string | null) => {\r\n  let items = enumToEntityArray(RepeatPeriod);\r\n\r\n  if (searchTerm !== null && searchTerm !== '') {\r\n    return items.filter(\r\n      f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n    );\r\n  }\r\n  return items;\r\n};\r\nexport function RepeatPeriodPicker(props: RepeatPeriodPickerProps) {\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'RepeatPeriodId'}\r\n      value={props.value}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RepeatPeriodPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { RepeatPeriodPicker } from '../pickers/StaticOptionsPickers/RepeatPeriodPicker';\r\n\r\nexport const FormRepeatPeriodPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <RepeatPeriodPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n        disableClearable={props.disableClearable}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * RepetitiveOptionsPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\n// import { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { selectSystemFirstDayOfWeek } from 'app/slice/selectors';\r\nimport { GetRepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport { useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { dateUtils } from 'utils/date-utils';\r\nexport interface IRepetitiveOptionsParamsPicker {\r\n  startDate: Date | null;\r\n}\r\nexport interface RepetitiveOptionsPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<number>>, 'getOptions'>,\r\n    IRepetitiveOptionsParamsPicker {}\r\n\r\n// export const initRepetitiveOptionsData = (\r\n//   initval: number | string | undefined,\r\n// ): Promise<Entity<number>[]> => {\r\n//   if (initval === undefined) {\r\n//     return new Promise<Entity<number>[]>((resolve, reject) => {\r\n//       resolve([] as Entity<number>[]);\r\n//     });\r\n//   } else {\r\n//     return new Promise<Entity<number>[]>((resolve, reject) => {\r\n//       resolve(\r\n//         enumToEntityArray(RepetitiveOptions).filter(item => {\r\n//           return item.Id.toString() === initval;\r\n//         }),\r\n//       );\r\n//     });\r\n//   }\r\n// };\r\n// const getOptions = (searchTerm: string | null) => {\r\n//   let items = enumToEntityArray(RepetitiveOptions);\r\n\r\n//   if (searchTerm !== null && searchTerm !== '') {\r\n//     return items.filter(\r\n//       f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n//     );\r\n//   }\r\n//   return items;\r\n// };\r\nexport function withParamsFilter(\r\n  startDate: Date | null,\r\n  firstDayOfWeek: number,\r\n) {\r\n  let date = startDate || new Date();\r\n  let items = GetRepetitiveOptions(date, firstDayOfWeek);\r\n\r\n  return (searchTerm: string | null) => {\r\n    if (searchTerm !== null && searchTerm !== '') {\r\n      return items.filter(\r\n        f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n      );\r\n    }\r\n    return items;\r\n  };\r\n}\r\nexport function RepetitiveOptionsPicker(props: RepetitiveOptionsPickerProps) {\r\n  const firstDayOfWeek = useSelector(selectSystemFirstDayOfWeek);\r\n  // const { getOffsetDate } = useSystemDate();\r\n  let getOptions = withParamsFilter(\r\n    props.startDate === null\r\n      ? null\r\n      : dateUtils.dateOrStringToDate(props.startDate),\r\n    firstDayOfWeek || 0,\r\n  );\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'RepetitiveOptionsId'}\r\n      value={props.value}\r\n      style={{ marginRight: '4px' }}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport {\r\n  IRepetitiveOptionsParamsPicker,\r\n  RepetitiveOptionsPicker,\r\n} from '../pickers/StaticOptionsPickers/RepetitiveOptionsPicker';\r\n\r\nexport const FormRepetitiveOptionsPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  IRepetitiveOptionsParamsPicker) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <RepetitiveOptionsPicker\r\n        name={props.name}\r\n        startDate={props.startDate}\r\n        placeholder={props.placeholder}\r\n        ariaLabel={props.ariaLabel}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { RepetitiveOptions } from 'enums/RepetitiveOptions';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { every } from 'lodash';\r\nimport { IRepetitiveDto } from 'types/IRepetitiveDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport * as Yup from 'yup';\r\nimport { CheckEntityShema } from '.';\r\nimport { TransformDate } from './SchemaMethods';\r\n\r\nexport const RepetitiveSchema: Yup.SchemaOf<IRepetitiveDto> = Yup.object({\r\n  StartDate: Yup.date()\r\n    .transform(TransformDate)\r\n    .default(dateUtils.dateOrStringToDate(new Date())),\r\n  RecurringEndDate: Yup.date()\r\n    .label(i18next.t(translations.Until))\r\n    .when('RecurringEvents', {\r\n      is: val =>\r\n        val !== null && val.Id !== (RepetitiveOptions.DoNotRepeat as number),\r\n      then: Yup.date()\r\n        .min(\r\n          Yup.ref('StartDate'),\r\n          i18next.t(translations.err_RepeatUntilDateLessThanStart) as string,\r\n        )\r\n        .required(i18next.t(translations.err_AlertInvalidRecurringUntilDate)),\r\n    }),\r\n  RecurringEvents: Yup.mixed(),\r\n  RepeatsEveryDay: Yup.mixed(),\r\n  RepeatsEveryPeriod: Yup.mixed(),\r\n  RepeatsMonthlyBy: Yup.mixed(),\r\n  RepeatsOnDays: Yup.array()\r\n    .of(CheckEntityShema)\r\n    .test({\r\n      name: i18next.t(translations.RepeatsBy),\r\n      message: i18next.t(translations.err_PepeatsOnDaysRequired),\r\n      test: val => !every(val, ['checked', false]),\r\n    }),\r\n});\r\n","import { CheckEntity } from 'app/components/CheckBoxGroup';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport {\r\n  RepeatMonthlyBy,\r\n  RepeatPeriod,\r\n  RepetitiveOptions,\r\n} from 'enums/RepetitiveOptions';\r\nimport { Formik } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { IRepetitiveDto, ShortWeekDays } from 'types/IRepetitiveDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { enumToEntityArray } from 'utils/enumKeys';\r\nimport { FormBookitDatePicker } from '../FormBookitDatePicker';\r\nimport { FormCheckBoxGroup } from '../FormCheckBoxGroup';\r\nimport { FormEveryDaysPicker } from '../FormEveryDaysPicker';\r\nimport {\r\n  FieldHandler,\r\n  FormFieldProps,\r\n  FormikSection,\r\n  FormListener,\r\n  IFieldSection,\r\n} from '../FormRender/FormRenderer';\r\nimport { FormRepeatMonthlyByPicker } from '../FormRepeatMonthlyByPicker';\r\nimport { FormRepeatPeriodPicker } from '../FormRepeatPeriodPicker';\r\nimport { FormRepetitiveOptionsPicker } from '../FormRepetitiveOptionsPicker';\r\nimport { RepetitiveSchema } from '../Schemas/RepititiveSchema';\r\nimport { useRepetitiveSlice } from './slice';\r\nimport { selectRepetitiveFieldHandler } from './slice/selectors';\r\nimport { RepetitiveFor } from './slice/types';\r\n\r\nexport interface FormRepetitiveProps {\r\n  onSubmit: (item: IRepetitiveDto) => void;\r\n  RepetitiveData?: IRepetitiveDto;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  StartDate?: Date;\r\n  title: string | undefined;\r\n  type: RepetitiveFor;\r\n  disabled?: boolean;\r\n  formIsValid?: (isValid: boolean) => void;\r\n  withTopSeparator?: boolean;\r\n  withBottomSeparator?: boolean;\r\n  onFormChange?: (\r\n    values: IRepetitiveDto,\r\n    isValid: boolean,\r\n    dirty: boolean,\r\n    setValue?: (field: string, value: any, shouldValidate?: boolean) => void,\r\n  ) => void;\r\n  setTouched?: (dirty: boolean) => void;\r\n}\r\n\r\nexport function RepetitiveForm({\r\n  onSubmit,\r\n  processing,\r\n  RepetitiveData,\r\n  bindSubmitForm,\r\n  StartDate,\r\n  title,\r\n  type,\r\n  disabled,\r\n  withTopSeparator,\r\n  withBottomSeparator,\r\n  formIsValid,\r\n  setTouched,\r\n}: FormRepetitiveProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRepetitiveSlice();\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n  const { newDate } = useSystemDate();\r\n  const [recurringChanged, setRecurringChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [repeatPeriodChanged, setRepeatPeriodChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [repeatEndChanged, setRepeatEndChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const fieldHandler = useSelector(selectRepetitiveFieldHandler);\r\n  const reserFieldHandler = () => {\r\n    dispatch(actions.resetRepetitiveHandler());\r\n  };\r\n  const handleFormChange = React.useCallback(\r\n    (values: IRepetitiveDto, isValid, dirty, setValue) => {\r\n      if (recurringChanged) {\r\n        if (\r\n          !!values.RecurringEvents &&\r\n          values.RecurringEvents.Id ===\r\n            (RepetitiveOptions.RepeatCustom as number)\r\n        ) {\r\n          setValue('RepeatsEveryDay', { Id: 1, Name: '1' }, false);\r\n          setValue(\r\n            'RepeatsEveryPeriod',\r\n            enumToEntityArray(RepeatPeriod, t).filter(f => f.Id === 2)[0],\r\n            false,\r\n          );\r\n          setValue(\r\n            'RepeatsOnDays',\r\n            ShortWeekDays().map(f => {\r\n              if (f.Id === 1) f.checked = true;\r\n              return f;\r\n            }),\r\n            false,\r\n          );\r\n          setValue('RepeatsMonthlyBy', null, false);\r\n        }\r\n        dispatch(\r\n          actions.saveState({\r\n            StartDate:\r\n              values.StartDate === undefined\r\n                ? undefined\r\n                : dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(values.StartDate),\r\n                  ),\r\n            RecurringEvents: values.RecurringEvents,\r\n            RepeatsOnDays: values.RepeatsOnDays,\r\n            RecurringEndDate:\r\n              values.RecurringEndDate === undefined\r\n                ? undefined\r\n                : dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n                  ),\r\n            RepeatsEveryDay: values.RepeatsEveryDay,\r\n            RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n            RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n          } as IRepetitiveDto),\r\n        );\r\n        setRecurringChanged(false);\r\n      }\r\n      if (repeatPeriodChanged) {\r\n        let period = values.RepeatsEveryPeriod;\r\n        if (period !== null && period !== undefined) {\r\n          if (period.Id === (RepeatPeriod.Days as number)) {\r\n            setValue('RepeatsMonthlyBy', null, false);\r\n            setValue(\r\n              'RepeatsOnDays',\r\n              ShortWeekDays().map(f => {\r\n                if (f.Id === 1) f.checked = true;\r\n                return f;\r\n              }),\r\n              false,\r\n            );\r\n          } else if (period.Id === (RepeatPeriod.Weeks as number)) {\r\n            setValue('RepeatsMonthlyBy', null, false);\r\n            setValue(\r\n              'RepeatsOnDays',\r\n              ShortWeekDays().map(f => {\r\n                if (f.Id === 1) f.checked = true;\r\n                return f;\r\n              }),\r\n              false,\r\n            );\r\n          } else if (period.Id === (RepeatPeriod.Months as number)) {\r\n            setValue(\r\n              'RepeatsMonthlyBy',\r\n              enumToEntityArray(RepeatMonthlyBy, t)[0],\r\n              false,\r\n            );\r\n            setValue(\r\n              'RepeatsOnDays',\r\n              ShortWeekDays().map(f => {\r\n                if (f.Id === 1) f.checked = true;\r\n                return f;\r\n              }),\r\n              false,\r\n            );\r\n          }\r\n        }\r\n        dispatch(\r\n          actions.saveState({\r\n            StartDate:\r\n              values.StartDate === undefined\r\n                ? undefined\r\n                : dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(values.StartDate),\r\n                  ),\r\n            RecurringEvents: values.RecurringEvents,\r\n            RepeatsOnDays: values.RepeatsOnDays,\r\n            RecurringEndDate:\r\n              values.RecurringEndDate === undefined\r\n                ? undefined\r\n                : dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n                  ),\r\n            RepeatsEveryDay: values.RepeatsEveryDay,\r\n            RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n            RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n          } as IRepetitiveDto),\r\n        );\r\n        setRepeatPeriodChanged(false);\r\n      }\r\n      if (repeatEndChanged) {\r\n        dispatch(\r\n          actions.saveState({\r\n            StartDate:\r\n              values.StartDate === undefined\r\n                ? undefined\r\n                : dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(values.StartDate),\r\n                  ),\r\n            RecurringEvents: values.RecurringEvents,\r\n            RepeatsOnDays: values.RepeatsOnDays,\r\n            RecurringEndDate:\r\n              values.RecurringEndDate === undefined\r\n                ? undefined\r\n                : dateUtils.formatISO(\r\n                    dateUtils.dateOrStringToDate(values.RecurringEndDate),\r\n                  ),\r\n            RepeatsEveryDay: values.RepeatsEveryDay,\r\n            RepeatsEveryPeriod: values.RepeatsEveryPeriod,\r\n            RepeatsMonthlyBy: values.RepeatsMonthlyBy,\r\n          } as IRepetitiveDto),\r\n        );\r\n        setRepeatEndChanged(false);\r\n      }\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      recurringChanged,\r\n      repeatEndChanged,\r\n      repeatPeriodChanged,\r\n      t,\r\n    ],\r\n  );\r\n  const leftSideSections = (\r\n    values: IRepetitiveDto,\r\n    isSubmitting: boolean,\r\n    title: string | undefined,\r\n  ): IFieldSection<IRepetitiveDto>[] => {\r\n    return [\r\n      {\r\n        title: title,\r\n        order: 1,\r\n        withBottomSeparator: withBottomSeparator,\r\n        withTopSeparator: withTopSeparator,\r\n        fields: [\r\n          {\r\n            id: 'RecurringEvents',\r\n            name: 'RecurringEvents',\r\n            startDate: dateUtils.dateOrStringToDate(\r\n              values.StartDate || newDate(),\r\n            ),\r\n            label: undefined,\r\n            ariaLabel:\r\n              type === RepetitiveFor.WorkOrder\r\n                ? t(translations.RecurringEvents)\r\n                : type === RepetitiveFor.Reservations\r\n                ? t(translations.RepetitiveReservation)\r\n                : t(translations.Repeat),\r\n            disabled: isSubmitting || disabled,\r\n            disableClearable: true,\r\n            onChange: () => setRecurringChanged(true),\r\n            fullWidth: true,\r\n            component: FormRepetitiveOptionsPicker,\r\n            order: 1,\r\n          } as FormFieldProps<Entity<number> | null>,\r\n          {\r\n            minRow: true,\r\n            hide:\r\n              values.RecurringEvents?.Id ===\r\n              (RepetitiveOptions.DoNotRepeat as number),\r\n            id: 'RecurringEndDate',\r\n            name: 'RecurringEndDate',\r\n            label: t(translations.Until),\r\n            disabled: isSubmitting || disabled,\r\n            fullWidth: true,\r\n            component: FormBookitDatePicker,\r\n            onChange: () => setRepeatEndChanged(true),\r\n            order: 2,\r\n          } as FormFieldProps<Date | null>,\r\n          {\r\n            hide:\r\n              values.RecurringEvents?.Id !==\r\n              (RepetitiveOptions.RepeatCustom as number),\r\n            id: 'RepeatsEveryDay',\r\n            name: 'RepeatsEveryDay',\r\n            label: t(translations.RepeatsEvery),\r\n            disabled: isSubmitting || disabled,\r\n            disableClearable: true,\r\n            fullWidth: true,\r\n            component: FormEveryDaysPicker,\r\n            order: 3,\r\n          } as FormFieldProps<Entity<number> | null>,\r\n          {\r\n            hide:\r\n              values.RecurringEvents?.Id !==\r\n              (RepetitiveOptions.RepeatCustom as number),\r\n            id: 'RepeatsEveryPeriod',\r\n            name: 'RepeatsEveryPeriod',\r\n            label: t(translations.RepeatsEveryPeriod),\r\n            onChange: () => setRepeatPeriodChanged(true),\r\n            disabled: isSubmitting || disabled,\r\n            disableClearable: true,\r\n            fullWidth: true,\r\n            component: FormRepeatPeriodPicker,\r\n            order: 4,\r\n          } as FormFieldProps<Entity<number> | null>,\r\n          {\r\n            hide:\r\n              values.RecurringEvents?.Id !==\r\n                (RepetitiveOptions.RepeatCustom as number) ||\r\n              values.RepeatsEveryPeriod?.Id !== (RepeatPeriod.Months as number),\r\n            id: 'RepeatsMonthlyBy',\r\n            name: 'RepeatsMonthlyBy',\r\n            label: t(translations.RepeatsBy),\r\n            disabled: isSubmitting || disabled,\r\n            disableClearable: true,\r\n            fullWidth: true,\r\n            component: FormRepeatMonthlyByPicker,\r\n            order: 5,\r\n          } as FormFieldProps<Entity<number> | null>,\r\n          {\r\n            fullRow: true,\r\n            hide:\r\n              values.RecurringEvents?.Id !==\r\n                (RepetitiveOptions.RepeatCustom as number) ||\r\n              values.RepeatsEveryPeriod?.Id !== (RepeatPeriod.Weeks as number),\r\n            id: 'RepeatsOnDays',\r\n            name: 'RepeatsOnDays',\r\n            label: t(translations.RepeatsOn),\r\n            options: values.RepeatsOnDays,\r\n            disabled: isSubmitting || disabled,\r\n            fullWidth: true,\r\n            component: FormCheckBoxGroup,\r\n            order: 6,\r\n          } as FormFieldProps<CheckEntity[]>,\r\n        ],\r\n        item: values,\r\n      } as IFieldSection<IRepetitiveDto>,\r\n    ];\r\n  };\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={RepetitiveSchema}\r\n        initialValues={RepetitiveData || ({} as IRepetitiveDto)}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('submitting', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          // if (formik.errors) {\r\n          //   console.log('Repetitive errors', formik.errors);\r\n          // }\r\n          if (formIsValid) {\r\n            formIsValid(formik.isValid);\r\n          }\r\n          setTouched?.(formik.dirty);\r\n          return (\r\n            <>\r\n              <form id=\"nestedForm\" onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={[\r\n                    'RecurringEvents',\r\n                    'RepeatsEveryPeriod',\r\n                    'RecurringEndDate',\r\n                  ]}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={reserFieldHandler}\r\n                />\r\n                <React.Fragment>\r\n                  {leftSideSections(formik.values, formik.isSubmitting, title)\r\n                    .sort((a, b) => a.order - b.order)\r\n                    .map((section, index) => (\r\n                      <FormikSection\r\n                        {...section}\r\n                        key={`${section.order}-${index}`}\r\n                      />\r\n                    ))}\r\n                </React.Fragment>\r\n              </form>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n  // return (\r\n  //   <FormikWrapper\r\n  //     bindSubmitForm={bindSubmitForm}\r\n  //     initialValues={RepetitiveData || ({} as IRepetitiveDto)}\r\n  //     onSubmit={handleSubmit}\r\n  //     onFormChange={handleFormChange}\r\n  //     observedFields={['RecurringEvents', 'RepeatsEveryPeriod']}\r\n  //     schema={RepetitiveShema}\r\n  //     rightSideSections={undefined}\r\n  //     avoidLeftSection={true}\r\n  //     avoidRightSection={true}\r\n  //     avoidStyledForm={true}\r\n  //     leftSideSections={leftSideSections}\r\n  //     id=\"repetetive\"\r\n  //   />\r\n  // );\r\n}\r\n","import { httpClient } from './HttpClient';\r\nimport { IUserTrainingDto } from './odata/generated/entities/IUserTrainingDto';\r\n\r\nexport const UserTrainingApi = {\r\n  initCreateData: (payload: {\r\n    equId?: string | null;\r\n    equIds?: string | null;\r\n    fatherId?: string | null;\r\n    user?: string | null;\r\n    rid?: string | null;\r\n    date?: string | null;\r\n  }) => {\r\n    const url = `/api/odata/v4/usertrainings/initNewTraining`;\r\n    return httpClient.post(url, payload);\r\n  },\r\n  initUpdateData: (payload: { Id: number }) => {\r\n    const url = '/api/odata/v4/usertrainings';\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Id asc',\r\n      $filter: '(Id eq ' + payload.Id + ')',\r\n      $select:\r\n        'Id,AttachmentExist,EquipmentId,UserGroupId,AllowBookingFromTrainingDate,MustOrderEveryDays,MustUseEveryDays,ReservationName,TrainerId' +\r\n        ',AssetId,UserDisplayName,UserId,ServiceGroupId,ExpiredDate,UserGroupName,Active,Remarks,RequiresAdminApproval,ReservationId,TrainingLevelName,TrainingLevelId,TrainerName' +\r\n        ',TrainingDate,EquipmentName,ServiceGroupName,ReservationStart,ReservationEnd',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient.get(url, params);\r\n  },\r\n\r\n  submitTrainings: (payload: IUserTrainingDto[]) => {\r\n    const data = {\r\n      trainings: payload,\r\n    };\r\n    const url = '/api/odata/v4/usertrainings/SubmitTrainings';\r\n    return httpClient.post(url, data);\r\n  },\r\n  approveRejectReservations: (payload: {\r\n    trainings: number[];\r\n    approve: boolean;\r\n  }) => {\r\n    const data = {\r\n      rows: payload.trainings,\r\n    };\r\n    const url = payload.approve\r\n      ? `/api/odata/v4/usertrainings/ApproveReservations`\r\n      : `/api/odata/v4/usertrainings/RejectReservations`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  hasUntrainedNotAllowed: (payload: { services: string; users: string }) => {\r\n    const url = `/api/odata/v4/usertrainings/UntrainedNotAllowed`;\r\n    return httpClient.post(url, payload);\r\n  },\r\n  activateTraining: (payload: { Id?: number; activate?: boolean }) => {\r\n    const url = `/api/odata/v4/usertrainings/ActivateDeactivateTraining`;\r\n    return httpClient.post(url, payload);\r\n  },\r\n};\r\n","import { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { IUserTrainingDto } from 'api/odata/generated/entities/IUserTrainingDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { toNumberOrNull } from 'utils/typeUtils';\r\n\r\n/* --- STATE --- */\r\nexport interface TrainingReservationsState {\r\n  showApproveReservations: boolean;\r\n  showRejectReservations: boolean;\r\n  ApproveRejectRecords: number[];\r\n  processing: boolean;\r\n  completed?: boolean;\r\n}\r\nexport interface TrainingState {\r\n  createState: AsyncDataState<TrainingDetailsState>;\r\n  updateState: AsyncDataState<TrainingDetailsState>;\r\n  reservationsUpdateState: TrainingReservationsState;\r\n  processing: boolean;\r\n}\r\n\r\nexport interface TrainingDetailsState {\r\n  Id: number | null | undefined;\r\n  Users: Entity<string>[];\r\n  Equipments: Entity<number>[];\r\n  UnhideServiceGroup: boolean | null | undefined;\r\n  TrainingDate: Date | string | null | undefined;\r\n  ExpiredDate: Date | string | null | undefined;\r\n  Trainer: Entity<string> | null | undefined;\r\n  MustOrderEveryDays: number | null | undefined;\r\n  MustUseEveryDays: number | null | undefined;\r\n  RequiresAdminApproval: boolean | null | undefined;\r\n  AllowBookingFromTrainingDate: boolean | null | undefined;\r\n  Reservations: Entity<number> | null | undefined;\r\n  TrainingLevel: Entity<number> | null | undefined;\r\n  Remarks?: string | null;\r\n  Active: boolean | null | undefined;\r\n  FatherId: number | null | undefined;\r\n  ServiceGroupId: number | null | undefined;\r\n  TrainingProgram: Entity<number> | null | undefined;\r\n}\r\n\r\nexport interface TrainingsResponse extends IResponseType {\r\n  ShowApproveReservationsMessage: boolean;\r\n  ShowReviseToPendingMessage: boolean;\r\n  ApproveRejectRecords: number[];\r\n  Id?: number;\r\n}\r\nexport function ConvertEntityToModel(\r\n  entity: IUserTrainingDto,\r\n): TrainingDetailsState | undefined {\r\n  if (!entity) {\r\n    return undefined;\r\n  } else {\r\n    return {\r\n      Id: entity.Id,\r\n      Active: entity.Active,\r\n      AllowBookingFromTrainingDate: entity.AllowBookingFromTrainingDate,\r\n      Equipments: [\r\n        {\r\n          Id: entity.EquipmentId,\r\n          Name: entity.EquipmentName,\r\n          ServiceGroupId: entity.ServiceGroupId,\r\n          ServiceTypeId: 1,\r\n        } as IServiceFilterDto,\r\n      ] as Entity<number>[],\r\n      ExpiredDate:\r\n        entity.ExpiredDate === null\r\n          ? null\r\n          : dateUtils.formatISO(dateUtils.parseISO(entity.ExpiredDate), {\r\n              representation: 'date',\r\n            }),\r\n      FatherId: null,\r\n      MustOrderEveryDays: entity.MustOrderEveryDays,\r\n      MustUseEveryDays: entity.MustUseEveryDays,\r\n      Remarks: entity.Remarks,\r\n      RequiresAdminApproval: entity.RequiresAdminApproval,\r\n      Reservations:\r\n        entity.ReservationId == null\r\n          ? null\r\n          : toEntity(\r\n              entity.ReservationId,\r\n              dateUtils.shortDateTimeFormat(entity.ReservationStart) +\r\n                ' - ' +\r\n                dateUtils.shortDateTimeFormat(entity.ReservationEnd),\r\n            ),\r\n      Trainer: toEntity(entity.TrainerId, entity.TrainerName) as IUserFilterDto,\r\n      TrainingDate: dateUtils.formatQueryStringDate(\r\n        dateUtils.dateOrStringToDate(entity.TrainingDate),\r\n        {\r\n          representation: 'date',\r\n        },\r\n      ),\r\n      TrainingLevel: toEntity(entity.TrainingLevelId, entity.TrainingLevelName),\r\n      Users: [{ Id: entity.UserId, Name: entity.UserDisplayName }],\r\n      ServiceGroupId: entity.ServiceGroupId,\r\n      UnhideServiceGroup: entity.UnhideServiceGroup,\r\n      TrainingProgram: toEntity(\r\n        entity.TrainingProgramId,\r\n        entity.TrainingProgramName,\r\n      ),\r\n    } as TrainingDetailsState;\r\n  }\r\n}\r\nexport function ConvertModelToEntity(\r\n  model: TrainingDetailsState,\r\n  original: TrainingDetailsState | undefined,\r\n): IUserTrainingDto[] {\r\n  let entities = [] as IUserTrainingDto[];\r\n  model.Equipments.forEach(eq => {\r\n    model.Users.forEach(ur => {\r\n      entities.push({\r\n        Id:\r\n          original === undefined\r\n            ? -1\r\n            : original?.Equipments[0].Id === eq.Id &&\r\n              original.Users[0].Id === ur.Id\r\n            ? model.Id ?? -1\r\n            : -1,\r\n        EquipmentId: eq.Id,\r\n        EquipmentName: eq.Name,\r\n        ServiceGroupId: (eq as IServiceFilterDto).ServiceGroupId ?? null,\r\n        UserId: ur.Id,\r\n        UserDisplayName: ur.Name,\r\n        Active: model.Active ?? false,\r\n        AllowBookingFromTrainingDate:\r\n          model.AllowBookingFromTrainingDate ?? true,\r\n        ExpiredDate:\r\n          model.ExpiredDate === null || model.ExpiredDate === undefined\r\n            ? null\r\n            : dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(model.ExpiredDate),\r\n              ),\r\n        MustOrderEveryDays: toNumberOrNull(model.MustOrderEveryDays),\r\n        MustUseEveryDays: toNumberOrNull(model.MustUseEveryDays),\r\n        Remarks: model.Remarks ?? null,\r\n        RequiresAdminApproval: model.RequiresAdminApproval ?? false,\r\n        ReservationId: model.Reservations?.Id ?? null,\r\n        TrainerId: model.Trainer?.Id ?? null,\r\n        TrainingDate: dateUtils.formatISO(\r\n          dateUtils.dateOrStringToDate(model.TrainingDate || new Date()),\r\n        ),\r\n        TrainingLevelId: model.TrainingLevel?.Id ?? null,\r\n        TrainingLevelName: model.TrainingLevel?.Name ?? null,\r\n        FatherId: model.FatherId ?? null,\r\n        UnhideServiceGroup: model.UnhideServiceGroup ?? false,\r\n        TrainingProgramId: model.TrainingProgram?.Id ?? null,\r\n        TrainingProgramName: model.TrainingProgram?.Name ?? null,\r\n      } as IUserTrainingDto);\r\n    });\r\n  });\r\n  return entities.filter(item => item !== undefined && item !== null);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { trainingActions as actions } from '.';\r\nimport { UserTrainingApi as api } from 'api/UserTrainingApi';\r\nimport { IUserTrainingDto } from 'api/odata/generated/entities/IUserTrainingDto';\r\nimport {\r\n  ConvertModelToEntity,\r\n  TrainingDetailsState,\r\n  TrainingsResponse,\r\n} from './types';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AxiosError } from 'axios';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { TrainingDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\n\r\nfunction* doInitCreate(\r\n  action: PayloadAction<{\r\n    equId?: string | null;\r\n    equIds?: string | null;\r\n    fatherId?: string | null;\r\n    rid?: string | null;\r\n    date?: string | null;\r\n    user?: string | null;\r\n  }>,\r\n) {\r\n  try {\r\n    const data = yield call(api.initCreateData, action.payload);\r\n    yield put(actions.initCreateTraining_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initCreateTraining_Error(Error));\r\n  }\r\n}\r\nfunction* doInitUpdate(action: PayloadAction<{ Id: number }>) {\r\n  try {\r\n    const data = yield call(api.initUpdateData, action.payload);\r\n    yield put(actions.initUpdateTraining_Success(data.value[0]));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initUpdateTraining_Error(Error));\r\n  }\r\n}\r\nfunction* doCreate(action: PayloadAction<TrainingDetailsState>) {\r\n  const httpPayloads: IUserTrainingDto[] = ConvertModelToEntity(\r\n    action.payload,\r\n    undefined,\r\n  );\r\n  try {\r\n    const result = yield call(api.submitTrainings, httpPayloads);\r\n    let trainingsResponse = result as TrainingsResponse;\r\n    if (trainingsResponse.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          trainingsResponse.ErrorMessages.map(item => {\r\n            return {\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (trainingsResponse.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          trainingsResponse.WarningMessages.map(item => {\r\n            return {\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (trainingsResponse.SuccessMessages.length > 0) {\r\n      if (trainingsResponse.Id) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'insertedSuccess',\r\n            message: trainingsResponse.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: trainingsResponse.Id,\r\n              created: true,\r\n              itemName: i18next.t(translations.UserTraining),\r\n              detailsType: RenderPageType.TrainingDetails,\r\n              detailsTypeProps: {\r\n                id: '' + trainingsResponse.Id,\r\n                useSidePanel: true,\r\n              } as TrainingDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      } else {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'insertedSuccess',\r\n            message: trainingsResponse.SuccessMessages[0],\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n    yield put(actions.createTraining_Success(trainingsResponse));\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'UserTrainingCreate',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createTraining_Error(Error));\r\n  }\r\n}\r\nfunction* duUpdateTraining(\r\n  action: PayloadAction<{\r\n    current: TrainingDetailsState;\r\n    original: TrainingDetailsState | undefined;\r\n  }>,\r\n) {\r\n  const httpPayloads: IUserTrainingDto[] = ConvertModelToEntity(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n  try {\r\n    const result = yield call(api.submitTrainings, httpPayloads);\r\n    let trainingsResponse = result as TrainingsResponse;\r\n    if (trainingsResponse.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          trainingsResponse.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'UpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (trainingsResponse.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'updateWarning',\r\n          message: trainingsResponse.WarningMessages[0],\r\n          variant: 'warning',\r\n        }),\r\n      );\r\n    }\r\n    if (trainingsResponse.SuccessMessages.length > 0) {\r\n      if (trainingsResponse.Id) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'updatedSuccess',\r\n            message: trainingsResponse.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: trainingsResponse.Id,\r\n              created: false,\r\n              itemName: i18next.t(translations.UserTraining),\r\n              detailsType: RenderPageType.TrainingDetails,\r\n              detailsTypeProps: {\r\n                id: '' + trainingsResponse.Id,\r\n                useSidePanel: true,\r\n              } as TrainingDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      } else {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'updatedSuccess',\r\n            message: trainingsResponse.SuccessMessages[0],\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n    yield put(actions.updateTraining_Success(trainingsResponse));\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'UserTrainingUpdate',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateTraining_Error(Error));\r\n  }\r\n}\r\nfunction* doApproveRejectReservations(\r\n  action: PayloadAction<{\r\n    trainings: number[];\r\n    approve: boolean;\r\n  }>,\r\n) {\r\n  try {\r\n    const result = yield call(api.approveRejectReservations, action.payload);\r\n    let response = result as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.SuccessMessages.map(item => {\r\n            return {\r\n              message: item,\r\n              variant: 'success',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    yield put(actions.approveRejectReservations_success());\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'UserTrainingResUpdate',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.approveRejectReservations_error(Error));\r\n  }\r\n}\r\nfunction* doActivate(\r\n  action: PayloadAction<{ Id?: number; activate?: boolean }>,\r\n) {\r\n  try {\r\n    const result = yield call(api.activateTraining, action.payload);\r\n    let response = result as IResponseType;\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.SuccessMessages.map(item => {\r\n            return {\r\n              message: item,\r\n              variant: 'success',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    yield put(\r\n      actions.activateDeactivateTraining_success(action.payload.activate),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'UserTrainingResUpdate',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.activateDeactivateTraining_error(Error));\r\n  }\r\n}\r\nexport function* trainingSaga() {\r\n  yield takeLatest(actions.initCreateTraining.type, doInitCreate);\r\n  yield takeLatest(actions.initUpdateTraining.type, doInitUpdate);\r\n  yield takeLatest(actions.createTraining.type, doCreate);\r\n  yield takeLatest(actions.updateTraining.type, duUpdateTraining);\r\n  yield takeLatest(\r\n    actions.approveRejectReservations.type,\r\n    doApproveRejectReservations,\r\n  );\r\n  yield takeLatest(actions.activateDeactivateTraining.type, doActivate);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IUserTrainingDto } from 'api/odata/generated/entities/IUserTrainingDto';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { trainingSaga } from './saga';\r\nimport {\r\n  ConvertEntityToModel,\r\n  TrainingDetailsState,\r\n  TrainingReservationsState,\r\n  TrainingsResponse,\r\n  TrainingState,\r\n} from './types';\r\n\r\nexport const initialState: TrainingState = {\r\n  createState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  updateState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  reservationsUpdateState: {\r\n    showApproveReservations: false,\r\n    showRejectReservations: false,\r\n    ApproveRejectRecords: [],\r\n    processing: false,\r\n    completed: undefined,\r\n  },\r\n  processing: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'training',\r\n  initialState,\r\n  reducers: {\r\n    initCreateTraining(\r\n      state,\r\n      action: PayloadAction<{\r\n        equId?: string | null;\r\n        equIds?: string | null;\r\n        fatherId?: string | null;\r\n        rid?: string | null;\r\n        date?: string | null;\r\n        user?: string | null;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initCreateTraining_Success(\r\n      state,\r\n      action: PayloadAction<TrainingDetailsState>,\r\n    ) {\r\n      state.processing = false;\r\n      state.createState.data = {\r\n        Id: null,\r\n        Active: action.payload.Active,\r\n        AllowBookingFromTrainingDate: true,\r\n        Equipments: action.payload.Equipments,\r\n        RequiresAdminApproval: false,\r\n        Reservations: action.payload.Reservations,\r\n        UnhideServiceGroup: false,\r\n        Users: action.payload.Users,\r\n        TrainingDate: action.payload.TrainingDate,\r\n        ExpiredDate: null,\r\n        MustOrderEveryDays: undefined,\r\n        MustUseEveryDays: undefined,\r\n        Remarks: undefined,\r\n        Trainer: action.payload.Trainer,\r\n        TrainingLevel: undefined,\r\n        FatherId: action.payload.FatherId ?? null,\r\n        ServiceGroupId: null,\r\n        TrainingProgram: undefined,\r\n      };\r\n    },\r\n    initCreateTraining_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n      state.createState.data = {\r\n        Id: null,\r\n        Active: true,\r\n        AllowBookingFromTrainingDate: true,\r\n        Equipments: [],\r\n        RequiresAdminApproval: false,\r\n        Reservations: undefined,\r\n        UnhideServiceGroup: false,\r\n        Users: [],\r\n        TrainingDate: new Date(),\r\n        ExpiredDate: null,\r\n        MustOrderEveryDays: undefined,\r\n        MustUseEveryDays: undefined,\r\n        Remarks: undefined,\r\n        Trainer: undefined,\r\n        TrainingLevel: undefined,\r\n        FatherId: null,\r\n        ServiceGroupId: null,\r\n        TrainingProgram: undefined,\r\n      };\r\n    },\r\n    createTraining(state, action: PayloadAction<TrainingDetailsState>) {\r\n      state.createState.processing = true;\r\n      state.createState.completed = undefined;\r\n      state.createState.hasErrors = undefined;\r\n    },\r\n    createTraining_Success(state, action: PayloadAction<TrainingsResponse>) {\r\n      state.createState.processing = false;\r\n      state.reservationsUpdateState.ApproveRejectRecords =\r\n        action.payload.ApproveRejectRecords;\r\n      state.reservationsUpdateState.showApproveReservations =\r\n        action.payload.ShowApproveReservationsMessage;\r\n      state.reservationsUpdateState.showRejectReservations =\r\n        action.payload.ShowReviseToPendingMessage;\r\n      state.createState.hasErrors = action.payload.ErrorMessages.length > 0;\r\n      state.createState.completed = true;\r\n    },\r\n    createTraining_Error(state, action: PayloadAction<any>) {\r\n      state.createState.processing = false;\r\n      state.createState.completed = true;\r\n    },\r\n    resetCreateTrainingState(state, action: PayloadAction) {\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    resetReservationsState(state, action: PayloadAction) {\r\n      state.reservationsUpdateState = {\r\n        showApproveReservations: false,\r\n        showRejectReservations: false,\r\n        ApproveRejectRecords: [],\r\n        processing: false,\r\n        completed: undefined,\r\n      };\r\n    },\r\n    resetUpdateTrainingState(state, action: PayloadAction) {\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUpdateTraining(\r\n      state,\r\n      action: PayloadAction<{\r\n        Id: number;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUpdateTraining_Success(state, action: PayloadAction<IUserTrainingDto>) {\r\n      state.processing = false;\r\n      state.updateState.data = ConvertEntityToModel(action.payload);\r\n    },\r\n    initUpdateTraining_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n      state.updateState.data = undefined;\r\n    },\r\n    updateTraining(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: TrainingDetailsState;\r\n        original: TrainingDetailsState | undefined;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateTraining_Success(state, action: PayloadAction<TrainingsResponse>) {\r\n      state.updateState.processing = false;\r\n      state.reservationsUpdateState.ApproveRejectRecords =\r\n        action.payload.ApproveRejectRecords;\r\n      state.reservationsUpdateState.showApproveReservations =\r\n        action.payload.ShowApproveReservationsMessage;\r\n      state.reservationsUpdateState.showRejectReservations =\r\n        action.payload.ShowReviseToPendingMessage;\r\n      state.updateState.hasErrors = action.payload.ErrorMessages.length > 0;\r\n      state.updateState.completed = true;\r\n    },\r\n    updateTraining_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n    },\r\n    setReservationsUpdateState(\r\n      state,\r\n      action: PayloadAction<TrainingReservationsState>,\r\n    ) {\r\n      state.reservationsUpdateState.ApproveRejectRecords =\r\n        action.payload.ApproveRejectRecords;\r\n      state.reservationsUpdateState.showApproveReservations =\r\n        action.payload.showApproveReservations;\r\n      state.reservationsUpdateState.showRejectReservations =\r\n        action.payload.showRejectReservations;\r\n    },\r\n    approveRejectReservations(\r\n      state,\r\n      action: PayloadAction<{\r\n        trainings: number[];\r\n        approve: boolean;\r\n      }>,\r\n    ) {\r\n      state.reservationsUpdateState.processing = true;\r\n      state.reservationsUpdateState.completed = false;\r\n    },\r\n    approveRejectReservations_success(state, action: PayloadAction) {\r\n      state.reservationsUpdateState.processing = false;\r\n      state.reservationsUpdateState.completed = true;\r\n    },\r\n    approveRejectReservations_error(state, action: PayloadAction<any>) {\r\n      state.reservationsUpdateState.processing = false;\r\n      state.reservationsUpdateState.completed = true;\r\n    },\r\n    activateDeactivateTraining(\r\n      state,\r\n      action: PayloadAction<{ Id?: number; activate?: boolean }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = false;\r\n    },\r\n    activateDeactivateTraining_success(\r\n      state,\r\n      action: PayloadAction<boolean | undefined>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      if (state.updateState.data) {\r\n        state.updateState.data.Active = action.payload;\r\n      }\r\n    },\r\n    activateDeactivateTraining_error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: trainingActions } = slice;\r\n\r\nexport const useTrainingSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: trainingSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useTrainingSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.training || initialState;\r\n\r\nexport const selectTraining = createSelector([selectSlice], state => state);\r\n\r\nexport const selectInitTrainingProcessing = createSelector(\r\n  [selectTraining],\r\n  state => state.processing,\r\n);\r\nexport const selectCreateTrainingProcessing = createSelector(\r\n  [selectTraining],\r\n  state => state.createState.processing,\r\n);\r\nexport const selectUpdateTrainingProcessing = createSelector(\r\n  [selectTraining],\r\n  state => state.updateState.processing,\r\n);\r\nexport const selectCreateTraining = createSelector(\r\n  [selectTraining],\r\n  state => state.createState.data,\r\n);\r\nexport const selectUpdateTraining = createSelector(\r\n  [selectTraining],\r\n  state => state.updateState.data,\r\n);\r\nexport const selectCreateTrainingCompleted = createSelector(\r\n  [selectTraining],\r\n  state => state.createState.completed,\r\n);\r\nexport const selectUpdateTrainingCompleted = createSelector(\r\n  [selectTraining],\r\n  state => state.updateState.completed,\r\n);\r\nexport const selectCreateTrainingHasError = createSelector(\r\n  [selectTraining],\r\n  state => state.createState.hasErrors,\r\n);\r\nexport const selectUpdateTrainingHasError = createSelector(\r\n  [selectTraining],\r\n  state => state.updateState.hasErrors,\r\n);\r\nexport const selectShowApproveReservatiions = createSelector(\r\n  [selectTraining],\r\n  state => state.reservationsUpdateState.showApproveReservations,\r\n);\r\nexport const selectShowRejectReservatiions = createSelector(\r\n  [selectTraining],\r\n  state => state.reservationsUpdateState.showRejectReservations,\r\n);\r\nexport const selectReservatiionsData = createSelector(\r\n  [selectTraining],\r\n  state => state.reservationsUpdateState.ApproveRejectRecords,\r\n);\r\nexport const selectReservatiionsProcessing = createSelector(\r\n  [selectTraining],\r\n  state => state.reservationsUpdateState.processing,\r\n);\r\nexport const selectReservatiionsUpdateCompleted = createSelector(\r\n  [selectTraining],\r\n  state => state.reservationsUpdateState.completed,\r\n);\r\n","/**\r\n *\r\n * RoomPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IReservationFilterDto } from 'api/odata/generated/entities/IReservationFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataFilterBuilder,\r\n  ODataOperators,\r\n} from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface ITrainingResFilterProps {\r\n  equipment?: Entity<number>;\r\n  user?: Entity<string>;\r\n  trainingDate?: Date;\r\n}\r\n\r\nexport interface TrainingResevationsPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'>,\r\n    ITrainingResFilterProps {}\r\n\r\nconst url = '/api/odata/v4/ReservationFilter';\r\nconst formatName = (\r\n  reservations: IReservationFilterDto[],\r\n): IReservationFilterDto[] => {\r\n  reservations.forEach(item => {\r\n    item.Name =\r\n      dateUtils.shortDateTimeFormat(item.Start) +\r\n      ' - ' +\r\n      dateUtils.shortDateTimeFormat(item.End);\r\n  });\r\n  return reservations;\r\n};\r\nexport function withUserTrainingFilter(\r\n  equipment: Entity<number> | undefined,\r\n  user: Entity<string> | undefined,\r\n  trainingDate: Date | undefined,\r\n) {\r\n  return (searchTerm: string | null) => {\r\n    const params: { $orderby: string; $filter?: string } = {\r\n      $orderby: 'Name asc',\r\n    };\r\n    const predicates: Condition<IReservationFilterDto>[] = [];\r\n    if (equipment !== undefined) {\r\n      predicates.push(\r\n        new Condition('EquipmentId', ODataOperators.Equals, equipment.Id),\r\n      );\r\n    }\r\n    if (user !== undefined) {\r\n      predicates.push(\r\n        new Condition('UserName', ODataOperators.Equals, user.Id),\r\n      );\r\n    }\r\n    if (trainingDate !== undefined) {\r\n      let tDate = dateUtils.parseISO(trainingDate);\r\n      let strDate = new Date() > tDate ? new Date() : tDate;\r\n      let endDate = new CustomDate(\r\n        new Date(\r\n          strDate.getFullYear(),\r\n          strDate.getMonth(),\r\n          strDate.getDate() + 1,\r\n        ),\r\n        'date',\r\n      );\r\n      predicates.push(\r\n        new Condition('Start', ODataOperators.GreaterThanEqual, strDate),\r\n      );\r\n      predicates.push(\r\n        new Condition('End', ODataOperators.LessThanEqual, endDate),\r\n      );\r\n    }\r\n    params.$filter = new ODataFilterBuilder<IReservationFilterDto>({\r\n      predicates: predicates,\r\n      stringColumns: ['Name'],\r\n      stringSearch: searchTerm === null ? undefined : searchTerm,\r\n      globalServiceGroupFilter: [],\r\n    }).toString();\r\n\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(\r\n        response =>\r\n          formatName(response.value as IReservationFilterDto[]) as Entity<\r\n            number\r\n          >[],\r\n      );\r\n  };\r\n}\r\nexport const initTrainingResevationsData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select: 'Id,Name,Start,End',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(\r\n        response =>\r\n          formatName(response.value as IReservationFilterDto[]) as Entity<\r\n            number\r\n          >[],\r\n      );\r\n  }\r\n};\r\n\r\nexport function TrainingResevationsPicker(\r\n  props: TrainingResevationsPickerProps,\r\n) {\r\n  const loadData = withUserTrainingFilter(\r\n    props.equipment,\r\n    props.user,\r\n    props.trainingDate,\r\n  );\r\n\r\n  return (\r\n    <AutocompletePicker\r\n      loadData={loadData}\r\n      id={props.id || 'trainingrespickerId'}\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      additionalItem={props.additionalItem}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * AsyncPicker\r\n *\r\n */\r\nimport { Entity } from 'types/common';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport {\r\n  ITrainingResFilterProps,\r\n  TrainingResevationsPicker,\r\n} from '../pickers/AutocompletePickers/TrainingReservationsPicker';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\n\r\nexport const FormTrainingReservationsPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  IFieldProps &\r\n  ITrainingResFilterProps) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <TrainingResevationsPicker\r\n        equipment={props.equipment}\r\n        user={props.user}\r\n        trainingDate={props.trainingDate}\r\n        name={props.name}\r\n        variant=\"filled\"\r\n        placeholder={props.placeholder}\r\n        label={label}\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * FormTrainingLevelPicker\r\n *\r\n */\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { TrainingLevelPicker } from '../pickers/AutocompletePickers/TrainingLevelPicker';\r\nimport { ITrainingLevelFilterDto } from 'api/odata/generated/entities/ITrainingLevelFilterDto';\r\n\r\nexport const FormTrainingLevelPicker = ({\r\n  label,\r\n  ...props\r\n}: FieldHookConfig<ITrainingLevelFilterDto | null> & IFieldProps) => {\r\n  const [field, meta, helpers] = useField<ITrainingLevelFilterDto | null>(\r\n    props,\r\n  );\r\n  return (\r\n    <>\r\n      <TrainingLevelPicker\r\n        name={props.name}\r\n        placeholder={props.placeholder}\r\n        predicates={props.predicates}\r\n        label={label}\r\n        variant=\"filled\"\r\n        onChange={value => {\r\n          helpers.setValue(value, true);\r\n          if (props.onChange) {\r\n            props.onChange(value);\r\n          }\r\n        }}\r\n        info={props.info}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        error={meta?.error !== undefined}\r\n        helperText={meta.error}\r\n        disabled={props.disabled}\r\n        fullWidth={props.fullWidth}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { CommentsApi } from 'api/CommentsApi';\r\nimport { IComment } from 'app/components/CommentsContainer/IComment';\r\nimport { selectPublicUrl } from 'app/slice/selectors';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { CommentsContainer } from 'app/components/CommentsContainer';\r\nimport { translations } from 'locales/translations';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { Portal } from '@material-ui/core';\r\nimport { TrainingDetailsState } from '../../slice/types';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\nimport { useLargeFilesUploadSlice } from 'app/components/LargeFilesUpload/slice';\r\n\r\nexport interface UserTrainingCommentsProps {\r\n  isAdmin?: boolean;\r\n  training: TrainingDetailsState;\r\n  disabled?: boolean;\r\n  commentsFormRef: React.MutableRefObject<any>;\r\n}\r\n\r\nexport const UserTrainingComments = (props: UserTrainingCommentsProps) => {\r\n  const { training, isAdmin, disabled, commentsFormRef } = props;\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const { t } = useTranslation();\r\n  const [changed, setchanged] = React.useState(false);\r\n  const dispatch = useDispatch();\r\n  const { actions: largeFileActions } = useLargeFilesUploadSlice();\r\n  const comments = useAsyncGetWthEffect<IComment[]>(\r\n    () =>\r\n      CommentsApi.GetComments(\r\n        CommentReferenceTypes.UserTraining,\r\n        training.Id ?? 0,\r\n      ),\r\n    [],\r\n    [changed],\r\n  );\r\n  const bindSubmitComment = React.useCallback(\r\n    submitForm => {\r\n      commentsFormRef.current = submitForm;\r\n    },\r\n    [commentsFormRef],\r\n  );\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  const portalRef = React.useRef(null);\r\n  React.useEffect(() => {\r\n    dispatch(\r\n      largeFileActions.setCommentProperties({\r\n        commentType: CommentReferenceTypes.UserTraining,\r\n        referenceId: training.Id ?? 0,\r\n      }),\r\n    );\r\n  }, [dispatch, largeFileActions, training.Id]);\r\n  return (\r\n    <React.Fragment>\r\n      <div ref={portalRef} style={{ width: '100%' }} />\r\n      <Portal container={portalRef.current}>\r\n        <CommentsContainer\r\n          disabled={disabled}\r\n          Comments={comments}\r\n          bindSubmitComment={bindSubmitComment}\r\n          onSubmit={c => {\r\n            CommentsApi.SendComment(\r\n              CommentReferenceTypes.UserTraining,\r\n              training.Id ?? 0,\r\n              c,\r\n            )\r\n              .then(res => onCommentAdded?.(res))\r\n              .finally(() => setchanged(prev => !prev));\r\n          }}\r\n          isAdmin={isAdmin}\r\n          withMentions\r\n          pageName={t(translations.menu_EditUserTraining)}\r\n          referenceName={(training.Id ?? 0).toString()}\r\n          linkUrl={buildURL(\r\n            `${publicUrl}usertraining/details/${training.Id ?? 0}`,\r\n            {},\r\n          )}\r\n          emailType={'Alert'}\r\n        />\r\n      </Portal>\r\n    </React.Fragment>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport * as Yup from 'yup';\r\nimport { Formik } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport { translations } from 'locales/translations';\r\nimport { FormUsersPicker } from 'app/components/Forms/FormUsersPicker';\r\nimport { FormCheckbox } from 'app/components/Forms/FormCheckbox';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { UserTrainingApi as api } from 'api/UserTrainingApi';\r\nimport { FormTrainingReservationsPicker } from 'app/components/Forms/FormTrainingReservationsPicker';\r\nimport { FormTrainingLevelPicker } from 'app/components/Forms/FormTrainingLevelPicker';\r\nimport { ITrainingLevelFilterDto } from 'api/odata/generated/entities/ITrainingLevelFilterDto';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { TrainingDetailsState } from '../slice/types';\r\nimport {\r\n  FormRightSection,\r\n  FormLeftSection,\r\n  StyledForm,\r\n  FormFieldsSection,\r\n  FormRow,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { UserTrainingComments } from './UserTrainingComments';\r\nimport { FormAdminSingleUsersPicker } from 'app/components/Forms/FormAdminUserPicker';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormOnlineServicesComboPicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { RestrictedByAdminFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { TrainingLevelFilter } from 'app/components/pickers/AutocompletePickers/TrainingLevelPicker';\r\nimport { FormNumberField } from 'app/components/Forms/FormNumberField';\r\nimport { AdminServicesFilter } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\n\r\nexport interface UserTrainingFormProps {\r\n  onSubmit: (item: TrainingDetailsState) => void;\r\n  onCancel?: () => void;\r\n  initialValues: TrainingDetailsState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isEdit: boolean;\r\n  onEquipmentClicked?: (equipment: Entity<number>) => void;\r\n  commentsFormRef: React.MutableRefObject<any>;\r\n  isAdmin?: boolean;\r\n}\r\n\r\nexport const UserTrainingForm = React.memo(function UserTrainingForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  onCancel,\r\n  bindSubmitForm,\r\n  isEdit,\r\n  onEquipmentClicked,\r\n  commentsFormRef,\r\n  isAdmin,\r\n}: UserTrainingFormProps) {\r\n  const { t } = useTranslation();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const trainingLevelPermissionsEnabled = React.useMemo(() => {\r\n    return IsModuleEnabled(appSettings, KnownModules.TrainingLevelPermissions);\r\n  }, [appSettings]);\r\n  const userPermissionsEnabled = React.useMemo(() => {\r\n    return (\r\n      IsModuleEnabled(appSettings, KnownModules.UserPermission) ||\r\n      IsModuleEnabled(appSettings, KnownModules.GroupPermissions)\r\n    );\r\n  }, [appSettings]);\r\n  const usersShema: Yup.SchemaOf<Entity<string>> = Yup.object({\r\n    Id: Yup.string().ensure(),\r\n    Name: Yup.string().ensure(),\r\n  });\r\n  const equipmentShema: Yup.SchemaOf<Entity<number>> = Yup.object({\r\n    Id: Yup.number().defined(),\r\n    Name: Yup.string().ensure(),\r\n  });\r\n  const schema: Yup.SchemaOf<TrainingDetailsState> = Yup.object({\r\n    Id: Yup.number().notRequired().nullable(),\r\n    Users: Yup.array()\r\n      .of(usersShema)\r\n      .required(t(translations.err_UserNameRequired))\r\n      .label(t(translations.User))\r\n      .min(1),\r\n    Equipments: Yup.array()\r\n      .of(equipmentShema)\r\n      .min(1)\r\n      .required(t(translations.err_OnlineServiceFieldRequired))\r\n      .label(t(translations.ServiceType_Online)),\r\n    UnhideServiceGroup: Yup.boolean(),\r\n    TrainingDate: Yup.date()\r\n      .required(t(translations.err_TrainingDateFieldRequired))\r\n      .label(t(translations.TrainingDate)),\r\n    ExpiredDate: Yup.date().nullable(true),\r\n    Trainer: Yup.mixed()\r\n      .required(t(translations.err_TrainerIsRequired))\r\n      .label(t(translations.Trainer)),\r\n    MustOrderEveryDays: Yup.number()\r\n      .integer()\r\n      .nullable()\r\n      .notRequired()\r\n      .label(t(translations.MustOrderEveryDays))\r\n      .min(0)\r\n      .max(365),\r\n    MustUseEveryDays: Yup.number()\r\n      .integer()\r\n      .nullable()\r\n      .notRequired()\r\n      .label(t(translations.MustUseEveryDays))\r\n      .min(0)\r\n      .max(365),\r\n    RequiresAdminApproval: Yup.boolean(),\r\n    AllowBookingFromTrainingDate: Yup.boolean().default(true),\r\n    Reservations: Yup.mixed(),\r\n    TrainingLevel: Yup.mixed(),\r\n    Remarks: Yup.string().nullable(),\r\n    Active: Yup.boolean(),\r\n    FatherId: Yup.number().notRequired().nullable(),\r\n    ServiceGroupId: Yup.number().notRequired().nullable(),\r\n    TrainingProgram: Yup.mixed(),\r\n  });\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n  const activeDisabled =\r\n    isEdit &&\r\n    settings.GetBooleanByKey(\r\n      AllowedSettings.TrainingActivationAllowedBySGAOnly,\r\n    );\r\n  const [resDisbaled, setResDisbaled] = React.useState<boolean>(false);\r\n  const [allowBookingDisbaled, setAllowBookingDisbaled] = React.useState<\r\n    boolean | undefined\r\n  >(false);\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const [allowBookingVisible, setAllowBookingVisible] = React.useState<\r\n    boolean | undefined\r\n  >(true);\r\n  const [equipmentChanged, setEquipmentChanged] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [userChanged, setUserChanged] = React.useState<boolean>(false);\r\n  const [trDateChanged, setTrDateChanged] = React.useState<boolean>(false);\r\n  const [trLevelChanged, setTrLevelChanged] = React.useState<boolean>(false);\r\n  const handleEquipmentChange = value => {\r\n    setEquipmentChanged(true);\r\n  };\r\n  const handleUserChange = value => {\r\n    setUserChanged(true);\r\n  };\r\n  const handleTrDateChange = value => {\r\n    setTrDateChanged(true);\r\n  };\r\n  const handleTrLevelChange = value => {\r\n    setTrLevelChanged(true);\r\n  };\r\n  const { newDate } = useSystemDate();\r\n  const handleFormChange = React.useCallback(\r\n    (values, isValid, dirty, setValue) => {\r\n      setResDisbaled(\r\n        values.Equipments.length !== 1 ||\r\n          values.Users.length !== 1 ||\r\n          !values.TrainingDate,\r\n      );\r\n      if (equipmentChanged || userChanged || trDateChanged) {\r\n        setValue('Reservations', undefined, false);\r\n        if (values.Equipments.length > 0 && values.Users.length > 0) {\r\n          const params: {\r\n            services: string;\r\n            users: string;\r\n          } = {\r\n            services: values.Equipments.map(item => item.Id).join(','),\r\n            users: values.Users.map(item => item.Id).join(','),\r\n          };\r\n          api.hasUntrainedNotAllowed(params).then(data => {\r\n            let value = data.value;\r\n            if (value === 0) {\r\n              setAllowBookingVisible(false);\r\n              setValue('AllowBookingFromTrainingDate', true, false);\r\n            } else {\r\n              if (isEdit) {\r\n                setAllowBookingDisbaled(true);\r\n              } else {\r\n                if (value === 1) {\r\n                  setAllowBookingDisbaled(false);\r\n                } else {\r\n                  setAllowBookingDisbaled(true);\r\n                  setValue('AllowBookingFromTrainingDate', true, false);\r\n                }\r\n              }\r\n            }\r\n          });\r\n        }\r\n        if (equipmentChanged) {\r\n          setValue('TrainingLevel', null);\r\n          setValue('Trainer', null);\r\n        }\r\n        setUserChanged(false);\r\n        setEquipmentChanged(false);\r\n        setTrDateChanged(false);\r\n      }\r\n      if (trLevelChanged) {\r\n        let level = values.TrainingLevel as ITrainingLevelFilterDto;\r\n        if (level) {\r\n          if (level.MustOrderEveryDays !== undefined) {\r\n            if (\r\n              values.MustOrderEveryDays === undefined ||\r\n              values.MustOrderEveryDays === null\r\n            ) {\r\n              setValue('MustOrderEveryDays', level.MustOrderEveryDays, false);\r\n            }\r\n          }\r\n          if (level.MustUseEveryDays !== undefined) {\r\n            if (\r\n              values.MustUseEveryDays === undefined ||\r\n              values.MustUseEveryDays === null\r\n            ) {\r\n              setValue('MustUseEveryDays', level.MustUseEveryDays, false);\r\n            }\r\n          }\r\n          if (\r\n            level.ExpiredDays !== undefined &&\r\n            level.ExpiredDays != null &&\r\n            level.ExpiredDays > 0\r\n          ) {\r\n            let date = newDate();\r\n            let trainingDate = dateUtils.parseISO(values.TrainingDate);\r\n            date.setDate(trainingDate.getDate() + level.ExpiredDays);\r\n            setValue('ExpiredDate', date, false);\r\n          }\r\n        }\r\n        setTrLevelChanged(false);\r\n      }\r\n    },\r\n    [\r\n      equipmentChanged,\r\n      isEdit,\r\n      newDate,\r\n      trDateChanged,\r\n      trLevelChanged,\r\n      userChanged,\r\n    ],\r\n  );\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={schema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('submitting', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          return (\r\n            <>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={[\r\n                    'Equipments',\r\n                    'Users',\r\n                    'TrainingDate',\r\n                    'TrainingLevel',\r\n                  ]}\r\n                />\r\n\r\n                <FormLeftSection\r\n                  pageDescription={\r\n                    (t(\r\n                      translations.UserTrainingTopMessage,\r\n                    ) as string).trim() !== ''\r\n                      ? (t(translations.UserTrainingTopMessage) as string)\r\n                      : undefined\r\n                  }\r\n                  warning={\r\n                    isEdit && !formik.values.Active\r\n                      ? (t(translations.NotActive) as string)\r\n                      : undefined\r\n                  }\r\n                >\r\n                  <FormFieldsSection>\r\n                    <FormRow fullRow={true} hide={!sidePanelExpanded}>\r\n                      <FormCheckbox\r\n                        name=\"Active\"\r\n                        label={t(translations.Active)}\r\n                        disabled={formik.isSubmitting || activeDisabled}\r\n                        id=\"trainingActive\"\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormOnlineServicesComboPicker\r\n                        onChipClick={onEquipmentClicked}\r\n                        name=\"Equipments\"\r\n                        info={t(translations.UserTraining_EquipmentInfo)}\r\n                        label={t(translations.ServiceType_Online)}\r\n                        placeholder={t(translations.PleaseSelectServices)}\r\n                        disabled={formik.isSubmitting}\r\n                        multiple={true}\r\n                        urlType=\"admin\"\r\n                        predicates={RestrictedByAdminFilter(\r\n                          formik.values.Trainer as IUserFilterDto,\r\n                        )}\r\n                        fullWidth\r\n                        onChange={handleEquipmentChange}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormUsersPicker\r\n                        name=\"Users\"\r\n                        info={t(translations.UserTraining_UserInfo)}\r\n                        label={t(translations.User)}\r\n                        placeholder={t(translations.UsersPlaceholder)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                        onChange={handleUserChange}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormBookitDatePicker\r\n                        id=\"TrainingDateId\"\r\n                        name=\"TrainingDate\"\r\n                        label={t(translations.TrainingDate)}\r\n                        placeholder={t(translations.DateOfTraining)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                        onChange={handleTrDateChange}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTrainingLevelPicker\r\n                        name=\"TrainingLevel\"\r\n                        label={t(translations.LevelAchieved)}\r\n                        placeholder={t(translations.TrainingLevelPlaceholder)}\r\n                        disabled={\r\n                          formik.isSubmitting ||\r\n                          formik.values.Equipments.length < 1\r\n                        }\r\n                        onChange={handleTrLevelChange}\r\n                        predicates={TrainingLevelFilter(\r\n                          formik.values.Equipments as IServiceFilterDto[],\r\n                          trainingLevelPermissionsEnabled,\r\n                          userPermissionsEnabled,\r\n                        )}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormAdminSingleUsersPicker\r\n                        name=\"Trainer\"\r\n                        label={t(translations.Trainer)}\r\n                        placeholder={t(translations.TrainerPlaceholder)}\r\n                        disabled={formik.isSubmitting}\r\n                        predicates={AdminServicesFilter(\r\n                          formik.values.Equipments as IServiceFilterDto[],\r\n                        )}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow hide={!sidePanelExpanded}>\r\n                      <FormTrainingReservationsPicker\r\n                        name=\"Reservations\"\r\n                        label={t(translations.LinkedReservation)}\r\n                        placeholder={t(translations.SelectLinkedReservation)}\r\n                        disabled={formik.isSubmitting || resDisbaled}\r\n                        equipment={\r\n                          formik.values.Equipments.length === 1\r\n                            ? formik.values.Equipments[0]\r\n                            : undefined\r\n                        }\r\n                        user={\r\n                          formik.values.Users.length === 1\r\n                            ? formik.values.Users[0]\r\n                            : undefined\r\n                        }\r\n                        trainingDate={dateUtils.parseISO(\r\n                          dateUtils.dateOrStringToDate(\r\n                            formik.values.TrainingDate || newDate(),\r\n                          ),\r\n                        )}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.TrainingRestrictions)}\r\n                  >\r\n                    {IsModuleEnabled(\r\n                      appSettings,\r\n                      KnownModules.TrainingExpiration,\r\n                    ) && (\r\n                      <React.Fragment>\r\n                        <FormRow>\r\n                          <FormBookitDatePicker\r\n                            id=\"ExpiredDateId\"\r\n                            info={t(translations.User_ExpiredDate_Description)}\r\n                            name=\"ExpiredDate\"\r\n                            disablePast={true}\r\n                            label={t(translations.ExpiredDate)}\r\n                            placeholder={t(translations.ExpiredDate)}\r\n                            disabled={formik.isSubmitting}\r\n                            clearable={true}\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow>\r\n                          <FormNumberField\r\n                            id=\"MustOrderEveryDaysId\"\r\n                            autoComplete=\"off\"\r\n                            name=\"MustOrderEveryDays\"\r\n                            info={t(\r\n                              translations.User_MustOrderEveryDays_Description,\r\n                            )}\r\n                            label={t(translations.MustOrderEveryDays)}\r\n                            placeholder={t(translations.EnterNumberOfDays)}\r\n                            disabled={formik.isSubmitting}\r\n                            min={0}\r\n                            max={365}\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                        <FormRow>\r\n                          <FormNumberField\r\n                            id=\"MustUseEveryDaysId\"\r\n                            autoComplete=\"off\"\r\n                            info={t(\r\n                              translations.User_MustUseEveryDays_Description,\r\n                            )}\r\n                            name=\"MustUseEveryDays\"\r\n                            label={t(translations.MustUseEveryDays)}\r\n                            placeholder={t(translations.EnterNumberOfDays)}\r\n                            disabled={formik.isSubmitting}\r\n                            min={0}\r\n                            max={365}\r\n                            fullWidth\r\n                          />\r\n                        </FormRow>\r\n                      </React.Fragment>\r\n                    )}\r\n                    <FormRow>\r\n                      <FormCheckbox\r\n                        name=\"RequiresAdminApproval\"\r\n                        label={t(translations.RequiresAdminApproval)}\r\n                        disabled={formik.isSubmitting}\r\n                        id=\"reqAdminApprovalId\"\r\n                      />\r\n                    </FormRow>\r\n                    {IsModuleEnabled(\r\n                      appSettings,\r\n                      KnownModules.HideInstrumentsFromUntrainedUsers,\r\n                    ) && (\r\n                      <FormRow>\r\n                        <FormCheckbox\r\n                          info={t(translations.UnhideServiceGroup_Description)}\r\n                          name=\"UnhideServiceGroup\"\r\n                          label={t(translations.UnhideServiceGroup)}\r\n                          disabled={formik.isSubmitting}\r\n                          id=\"unhideCoreId\"\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n                    {/* //!allowBookingVisible */}\r\n                    <FormRow fullRow={true} hide={true}>\r\n                      <FormCheckbox\r\n                        name=\"AllowBookingFromTrainingDate\"\r\n                        label={t(translations.AllowBookingFromNow)}\r\n                        disabled={formik.isSubmitting || allowBookingDisbaled}\r\n                        id=\"bookFromTrainingDateId\"\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n                <FormRightSection>\r\n                  <FormFieldsSection titleSection={t(translations.Remarks)}>\r\n                    <FormRow fullRow={true}>\r\n                      <FormRichTextField\r\n                        name=\"Remarks\"\r\n                        placeholder={t(translations.Remarks)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                  {isEdit && (\r\n                    <FormFieldsSection>\r\n                      <UserTrainingComments\r\n                        commentsFormRef={commentsFormRef}\r\n                        training={formik.values}\r\n                        isAdmin={isAdmin}\r\n                        disabled={formik.isSubmitting}\r\n                      />\r\n                    </FormFieldsSection>\r\n                  )}\r\n                </FormRightSection>\r\n              </StyledForm>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n  selectContinueToLink,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n  selectPublicUrl,\r\n} from 'app/slice/selectors';\r\n\r\nimport { push } from 'connected-react-router';\r\n//import { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport { omit } from 'lodash';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { useTrainingSlice } from './slice';\r\nimport {\r\n  selectCreateTraining,\r\n  selectCreateTrainingCompleted,\r\n  selectCreateTrainingHasError,\r\n  selectInitTrainingProcessing,\r\n  selectReservatiionsData,\r\n  selectReservatiionsProcessing,\r\n  selectReservatiionsUpdateCompleted,\r\n  selectShowApproveReservatiions,\r\n  selectShowRejectReservatiions,\r\n  selectUpdateTraining,\r\n  selectUpdateTrainingCompleted,\r\n  selectUpdateTrainingHasError,\r\n} from './slice/selectors';\r\nimport { TrainingDetailsState } from './slice/types';\r\nimport { UserTrainingForm } from './UserTrainingForm';\r\nimport { SaveFormButton, ActivateButton } from './Actions/TrainingActions';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { AssetPopUp } from 'app/pages/AssetPopUp';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\n\r\nexport interface TrainingDetailsProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  id?: string;\r\n  equId?: string;\r\n  equIds?: string;\r\n  fatherId?: string;\r\n  rid?: string;\r\n  date?: string;\r\n  user?: string;\r\n  onClose?: () => void;\r\n  onTrainingClose?: () => void;\r\n}\r\n\r\nexport function TrainingDetails(props: TrainingDetailsProps) {\r\n  const {\r\n    id,\r\n    equId,\r\n    equIds,\r\n    fatherId,\r\n    rid,\r\n    date,\r\n    user,\r\n    useSidePanel,\r\n    onClose,\r\n    onTrainingClose,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const loading = useSelector(selectInitTrainingProcessing);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useTrainingSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n  const [busy, setBusy] = React.useState<boolean>(false);\r\n  const [edit, setEdit] = React.useState<boolean>(false);\r\n  const [showApprove, setShowApprove] = React.useState<boolean>(false);\r\n  const [showReject, setShowReject] = React.useState<boolean>(false);\r\n  const requestCreateCompleted = useSelector(selectCreateTrainingCompleted);\r\n  const requestUpdateCompleted = useSelector(selectUpdateTrainingCompleted);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const approveReservations = useSelector(selectShowApproveReservatiions);\r\n  const rejectReservations = useSelector(selectShowRejectReservatiions);\r\n  const reservationProcessing = useSelector(selectReservatiionsProcessing);\r\n  const relatedReservations = useSelector(selectReservatiionsData);\r\n  const updateResCompleted = useSelector(selectReservatiionsUpdateCompleted);\r\n  const hasCreateError = useSelector(selectCreateTrainingHasError);\r\n  const hasUpdateError = useSelector(selectUpdateTrainingHasError);\r\n  const hasError = hasCreateError || hasUpdateError;\r\n  const createTraining = useSelector(selectCreateTraining, shallowEqual);\r\n  const editTraining = useSelector(selectUpdateTraining, shallowEqual);\r\n  const training = createTraining || editTraining;\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const currenTrainingServiceGroupId = training?.ServiceGroupId ?? undefined;\r\n  const activateAllowed = React.useMemo(() => {\r\n    return User?.HasAdminGroupPermissions(currenTrainingServiceGroupId);\r\n  }, [User, currenTrainingServiceGroupId]);\r\n  const IsAdmin = React.useMemo(() => {\r\n    return User?.IsAllGroupOrLabTechAdmin(\r\n      (training?.Equipments || []).map(\r\n        g => (g as IServiceFilterDto).ServiceGroupId,\r\n        (training?.Equipments || []).map(f => {\r\n          return {\r\n            Id: f.Id,\r\n            Name: f.Name,\r\n            ServiceTypeId: ServiceType.Online,\r\n          } as IServiceTypeFilterDto;\r\n        }),\r\n      ),\r\n    );\r\n  }, [User, training?.Equipments]);\r\n\r\n  useEffectOnMount(() => {\r\n    if (id !== undefined && !isNaN(parseInt(id))) {\r\n      dispatch(actions.initUpdateTraining({ Id: parseInt(id) }));\r\n    } else {\r\n      dispatch(\r\n        actions.initCreateTraining({\r\n          equId,\r\n          equIds,\r\n          fatherId,\r\n          rid,\r\n          date,\r\n          user,\r\n        }),\r\n      );\r\n    }\r\n    setBusy(false);\r\n    setEdit(false);\r\n    setShowApprove(false);\r\n    setShowReject(false);\r\n    setRequestCompleted(undefined);\r\n    return () => {};\r\n  });\r\n  const handleCancelClick = React.useCallback(() => {\r\n    if (!!onClose) {\r\n      onClose();\r\n      if (!!onTrainingClose) {\r\n        onTrainingClose();\r\n      }\r\n    } else {\r\n      if (useSidePanel) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        if (!!onTrainingClose) {\r\n          onTrainingClose();\r\n        }\r\n      } else {\r\n        dispatch(push('/usertraining'));\r\n      }\r\n    }\r\n    if (edit) {\r\n      dispatch(actions.resetUpdateTrainingState());\r\n    } else {\r\n      dispatch(actions.resetCreateTrainingState());\r\n    }\r\n    dispatch(actions.resetReservationsState());\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n    onClose,\r\n    onTrainingClose,\r\n    useSidePanel,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = loading === false;\r\n    if (active) {\r\n      if (id !== undefined && !isNaN(parseInt(id))) {\r\n        setEdit(true);\r\n      }\r\n      if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          if (approveReservations || rejectReservations) {\r\n            setShowApprove(approveReservations);\r\n            setShowReject(rejectReservations);\r\n          } else {\r\n            handleCancelClick();\r\n          }\r\n        }\r\n      } else if (\r\n        requestCreateCompleted === false ||\r\n        requestUpdateCompleted === false\r\n      ) {\r\n        setRequestCompleted(false);\r\n        setBusy(false);\r\n      }\r\n      if (updateResCompleted) {\r\n        handleCancelClick();\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    approveReservations,\r\n    handleCancelClick,\r\n    hasError,\r\n    id,\r\n    loading,\r\n    rejectReservations,\r\n    requestCompleted,\r\n    requestCreateCompleted,\r\n    requestUpdateCompleted,\r\n    updateResCompleted,\r\n  ]);\r\n  React.useEffect(() => {\r\n    if (confirmApproved) {\r\n      if (edit) {\r\n        dispatch(actions.resetUpdateTrainingState());\r\n      } else {\r\n        dispatch(actions.resetCreateTrainingState());\r\n      }\r\n      dispatch(actions.resetReservationsState());\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(layoutActions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(appSettingsActions.navigate(continueLink));\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n      //dispatch(actions.setChangedState(false));\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n\r\n    return () => undefined;\r\n  }, [\r\n    actions,\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n  ]);\r\n  const handleSubmit = React.useCallback(\r\n    (values: TrainingDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateTraining({ current: values, original: training }),\r\n        );\r\n      } else {\r\n        dispatch(actions.createTraining(values));\r\n      }\r\n    },\r\n    [actions, dispatch, edit, training],\r\n  );\r\n\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const submitCommentRef = React.useRef<any>(null);\r\n  const handleSubmitForm = e => {\r\n    if (submitCommentRef.current) {\r\n      submitCommentRef.current(e);\r\n    }\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const handleClose = () => {\r\n    if (hasChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCancelClick();\r\n    }\r\n  };\r\n\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n  const handleActivateTraining = React.useCallback(() => {\r\n    dispatch(\r\n      actions.activateDeactivateTraining({\r\n        Id: training?.Id ?? undefined,\r\n        activate: !(training?.Active ?? undefined),\r\n      }),\r\n    );\r\n  }, [actions, dispatch, training]);\r\n  const handleReject = React.useCallback(() => {\r\n    dispatch(\r\n      actions.approveRejectReservations({\r\n        trainings: relatedReservations,\r\n        approve: false,\r\n      }),\r\n    );\r\n  }, [actions, dispatch, relatedReservations]);\r\n  const handleApprove = React.useCallback(() => {\r\n    dispatch(\r\n      actions.approveRejectReservations({\r\n        trainings: relatedReservations,\r\n        approve: true,\r\n      }),\r\n    );\r\n  }, [actions, dispatch, relatedReservations]);\r\n  const handleResCancel = React.useCallback(() => {\r\n    dispatch(actions.resetReservationsState());\r\n  }, [actions, dispatch]);\r\n  const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const closeCover = () => {\r\n    setCover(undefined);\r\n  };\r\n\r\n  const leftActions = [\r\n    () => (\r\n      <React.Fragment>\r\n        <SaveFormButton\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"save\" />}\r\n          onClick={handleSubmitForm}\r\n          disabled={busy}\r\n          processing={!requestCompleted && busy}\r\n          edit={edit}\r\n          text={t(translations.Save)}\r\n        />\r\n      </React.Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n  if (\r\n    edit &&\r\n    settings.GetBooleanByKey(\r\n      AllowedSettings.TrainingActivationAllowedBySGAOnly,\r\n    ) &&\r\n    activateAllowed\r\n  ) {\r\n    leftActions.push(() => (\r\n      <ActivateButton\r\n        Active={training?.Active ?? false}\r\n        edit={edit}\r\n        text={\r\n          training?.Active\r\n            ? t(translations.DeactivateTraining)\r\n            : t(translations.ActivateTraining)\r\n        }\r\n        ServiceGroupId={training?.ServiceGroupId ?? undefined}\r\n        onClick={handleActivateTraining}\r\n      />\r\n    ));\r\n  }\r\n  if (edit && IsAdmin) {\r\n    leftActions.push(() => (\r\n      <IconButton\r\n        variant=\"white\"\r\n        href=\"/UserTrainingHistory\"\r\n        shape=\"square\"\r\n        icon=\"history\"\r\n        size=\"small\"\r\n        title={t(translations.UserTrainingModificationHistory) as string}\r\n      />\r\n    ));\r\n  }\r\n  const rightActions = [\r\n    () => (\r\n      <React.Fragment>\r\n        <Button\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={handleCancelClick}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </React.Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n  return (\r\n    <>\r\n      <PageWrapper\r\n        pageName={\r\n          edit\r\n            ? t(translations.menu_EditUserTraining)\r\n            : t(translations.menu_UserTraining)\r\n        }\r\n        titlePage={\r\n          training\r\n            ? edit\r\n              ? ` ${t(translations.UserTraining)} #${training?.Id || 'N/A'}`\r\n              : ` ${t(translations.menu_AddNewUserTraining)}`\r\n            : undefined\r\n        }\r\n        loading={loading}\r\n        useSidePanel={useSidePanel}\r\n        //closable={true}\r\n        closable={useSidePanel || props.isCover}\r\n        disableExpandToggle={props.isCover}\r\n        closeSidePanel={props.isCover ? onClose : handleClose}\r\n        //closeSidePanel={!!onClose ? onClose : handleClose}\r\n        children={\r\n          training !== undefined && !loading ? (\r\n            <UserTrainingForm\r\n              initialValues={training || ({} as TrainingDetailsState)}\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              isEdit={edit}\r\n              onEquipmentClicked={e =>\r\n                setCover(\r\n                  <AssetPopUp\r\n                    closeCover={closeCover}\r\n                    isCover\r\n                    identifier={{ serviceId: e.Id, serviceType: 'Online' }}\r\n                    onClose={closeCover}\r\n                    useSidePanel={true}\r\n                  />,\r\n                )\r\n              }\r\n              commentsFormRef={submitCommentRef}\r\n              isAdmin={IsAdmin}\r\n            />\r\n          ) : (\r\n            <React.Fragment></React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(\r\n          publicUrl + 'usertraining/details',\r\n          omit(props, ['useSidePanel']),\r\n        )}\r\n        toPageLink={`usertraining/details?${toQueryString(\r\n          omit(props, ['useSidePanel']),\r\n        )}`}\r\n        leftActions={leftActions}\r\n        rightActions={rightActions}\r\n        confirm={\r\n          requestCompleted && rejectReservations ? (\r\n            <DialogConfirm\r\n              isOpen={showReject && !updateResCompleted}\r\n              title={t(translations.RejectAllReservations)}\r\n              processing={reservationProcessing}\r\n              body={t(translations.UserTraining_ReviseReservations)}\r\n              confirmButtonLabel={t(translations.RejectAll)}\r\n              cancelButtonLabel={t(translations.Cancel)}\r\n              onConfirm={handleReject}\r\n              onCancel={handleResCancel}\r\n            />\r\n          ) : approveReservations ? (\r\n            <DialogConfirm\r\n              title={t(translations.ApproveAllReservations)}\r\n              body={t(translations.UserTraining_ApproveReservations)}\r\n              isOpen={showApprove && !updateResCompleted}\r\n              processing={reservationProcessing}\r\n              onConfirm={handleApprove}\r\n              onCancel={handleResCancel}\r\n              confirmButtonLabel={t(translations.ApproveAll)}\r\n              cancelButtonLabel={t(translations.Cancel)}\r\n            />\r\n          ) : (\r\n            <></>\r\n          )\r\n        }\r\n        isCover={props.isCover}\r\n        cover={cover}\r\n        //closeCover={closeCover}\r\n        closeCover={props.closeCover || closeCover}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { IWithSavedHistoryComponentProps } from 'app/components/BasicTable/withSavedHistory';\r\nimport { FiltersButton } from 'app/components/BasicTable/BasicFilter/FiltersButton';\r\nimport { FilterContainer } from 'app/components/BasicTable/FilterContainer';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { BasicFilterGroup } from 'app/components/BasicTable/BasicFilter';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { CombinedSchedulerTRow } from './Filter';\r\n\r\nexport interface FiltersComponentProps\r\n  extends IWithSavedHistoryComponentProps<CombinedSchedulerTRow>,\r\n    Pick<ButtonProps, 'fullWidth'> {\r\n  filtersButtonAnchorEl: HTMLElement | null;\r\n  onFilterOpen: React.MouseEventHandler<HTMLButtonElement>;\r\n  filterOpen: boolean;\r\n  onFilterClose: () => void;\r\n  filterRef?: React.RefObject<HTMLButtonElement>;\r\n}\r\nexport function FiltersComponent({\r\n  filterOpen,\r\n  onFilterClose,\r\n  onFilterOpen,\r\n  filtersButtonAnchorEl,\r\n\r\n  ...props\r\n}: FiltersComponentProps) {\r\n  const isMobile = DetectIsMobile();\r\n\r\n  const handleFilterChange = React.useCallback(\r\n    (items: IFilterSettings<CombinedSchedulerTRow>[]) => {\r\n      props.onFilterChange?.(items);\r\n    },\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [],\r\n  );\r\n\r\n  return (\r\n    <>\r\n      {!isMobile &&\r\n        props.availableFilters &&\r\n        props.availableFilters.length > 0 && (\r\n          <FiltersButton\r\n            onClick={onFilterOpen}\r\n            allFiltersLength={props.availableFilters?.length}\r\n            appliedFiltersLength={props.appliedFilters?.length}\r\n            innerRef={props.filterRef}\r\n          />\r\n        )}\r\n\r\n      <FilterContainer\r\n        open={filterOpen}\r\n        onClose={onFilterClose}\r\n        onChange={handleFilterChange}\r\n        anchorEl={filtersButtonAnchorEl}\r\n        appliedFilters={props.appliedFilters ?? []}\r\n      >\r\n        <BasicFilterGroup\r\n          availableFilters={props.availableFilters || []}\r\n          onChange={handleFilterChange}\r\n          appliedFilters={props.appliedFilters || []}\r\n          onClose={onFilterClose}\r\n          autoOpenAddFilter={true}\r\n          showFooter={!isMobile}\r\n          savedListSettings={props.savedListSettings}\r\n          getDefaultFilters={props.getDefaultFilters}\r\n        />\r\n      </FilterContainer>\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * MultiToggleProps\r\n *\r\n */\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface MultiToggleProps {\r\n  value?: boolean;\r\n  onchange: ValueChangeHandler<boolean>;\r\n}\r\n\r\nexport function MultiToggle(props: MultiToggleProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const handleChange = (value: boolean) => {\r\n    props?.onchange(value);\r\n  };\r\n  return (\r\n    <>\r\n      <IconButton\r\n        aria-label=\"Swithch Multiple Mode\"\r\n        variant={props.value === true ? 'white' : 'gray'}\r\n        shape=\"square\"\r\n        size={'small'}\r\n        title={t(translations.ToggleMultipleInstruments_info)}\r\n        onClick={event => handleChange(!props.value)}\r\n      >\r\n        <Icon\r\n          size=\"lg\"\r\n          icon={[props.value === true ? 'fas' : 'fal', 'calendars']}\r\n        />\r\n      </IconButton>\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * FullScreenButton\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { selectIsFullScreen } from 'app/slice/selectors';\r\nimport { TopActionButton } from '../BasicButtons/TopActionButton';\r\nimport { IconProp } from 'app/AllIcons';\r\n\r\nexport interface FullScreenButtonProps {\r\n  selector?: string;\r\n}\r\n\r\n/**\r\n * Icon button to switch elemnt/document into full screen mode in the browser\r\n * @param props.selector element selector to show in full screen mode. optionnal - documentElement is used if undefined\r\n * @returns\r\n */\r\nexport function FullScreenButton(props: FullScreenButtonProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const isFullScreen = useSelector(selectIsFullScreen);\r\n  const handleClick = () => {\r\n    if (isFullScreen) {\r\n      dispatch(appSettingsActions.exitFullScreen());\r\n    } else {\r\n      dispatch(\r\n        appSettingsActions.enterFullScreen({ selector: props.selector }),\r\n      );\r\n    }\r\n  };\r\n  const icon = isFullScreen\r\n    ? (['fal', 'minimize'] as IconProp)\r\n    : (['fal', 'maximize'] as IconProp);\r\n  return (\r\n    <TopActionButton\r\n      onClick={handleClick}\r\n      size=\"small\"\r\n      variant=\"white\"\r\n      icon={icon}\r\n      startIcon={icon}\r\n      title={t(translations.OpenInFullScreen)}\r\n      text={t(translations.OpenInFullScreen)}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * FullScreenSchedulerButton\r\n *\r\n */\r\nimport { FullScreenButton } from 'app/components/FullScreenButton';\r\n\r\nexport interface FullScreenSchedulerButtonProps {}\r\n\r\nexport function FullScreenSchedulerButton(\r\n  props: FullScreenSchedulerButtonProps,\r\n) {\r\n  return <FullScreenButton selector=\"#main_div_content\" />;\r\n}\r\n","import React from 'react';\r\nimport { DatePicker } from '@material-ui/pickers';\r\nimport { Dialog, DialogActions } from '@material-ui/core';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { ViewLengths, ViewTypes } from '../../slice/types';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { getPeriodDisplayLabel } from '../../utils';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\n/**\r\n * Internal componnent state interface\r\n */\r\ninterface ICalendarDatePickerState extends CalendarDateValue {\r\n  open: boolean;\r\n}\r\n/**\r\n * Period value including the period length and the date\r\n */\r\nexport interface CalendarDateValue {\r\n  date: Timestamp;\r\n  viewLength: ViewLengths;\r\n  customDays?: number;\r\n  customStart?: boolean;\r\n}\r\nexport interface CalendarDateProps extends ICalendarDatePickerState {\r\n  onChange: (value: CalendarDateValue) => void;\r\n  size?: 'small' | 'large' | 'medium';\r\n  compact?: boolean;\r\n  customDays?: number;\r\n  customStart?: boolean;\r\n  viewType: ViewTypes;\r\n}\r\n// const makeJSDateObject = (date: Date | string): Date => {\r\n//   return dateUtils.parseISO(date);\r\n// };\r\n\r\nexport function CalendarDatePicker(props: CalendarDateProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  //const firstDayOfWeek = useSelector(selectSystemFirstDayOfWeek);\r\n  // set initial state\r\n  const [state, , extendState] = useAsyncExtendedState<\r\n    ICalendarDatePickerState\r\n  >({\r\n    date: props.date,\r\n    open: props.open,\r\n    viewLength: props.viewLength,\r\n    customDays: props.customDays,\r\n    customStart: props.customStart,\r\n  });\r\n  // handle date change based on the period length\r\n  const handleDateChange = date => {\r\n    switch (state.viewLength) {\r\n      case 'day':\r\n      case 'twodays':\r\n        extendState({ date: date, customStart: true });\r\n        break;\r\n      case 'customdays':\r\n        extendState({\r\n          date: date,\r\n          customDays: props.customDays,\r\n          customStart: true,\r\n        });\r\n        break;\r\n      case 'week':\r\n        extendState({\r\n          date: date,\r\n          customStart: props.viewType === 'timeline' ? true : undefined,\r\n        });\r\n        break;\r\n      case 'month':\r\n      case 'quarter':\r\n      case 'year':\r\n        extendState({ date: date, customStart: true });\r\n        break;\r\n\r\n      default:\r\n        extendState({ date: date, customStart: true });\r\n      //assertExhaustive(state.viewLength);\r\n    }\r\n  };\r\n\r\n  const handleAccept = () => {\r\n    // close the dialog\r\n    extendState({ open: false });\r\n    // raise change event\r\n    props.onChange({\r\n      date: state.date,\r\n      viewLength: props.viewLength,\r\n      customStart: state.customStart,\r\n    });\r\n  };\r\n  const handleReject = React.useCallback(() => {\r\n    extendState({\r\n      // close dialog\r\n      open: false,\r\n      // reset internal state\r\n      viewLength: props.viewLength,\r\n      date: state.date,\r\n      customStart: state.customStart,\r\n    });\r\n  }, [extendState, props.viewLength, state.customStart, state.date]);\r\n  return (\r\n    <>\r\n      <Dialog open={state.open} fullWidth={isMobile} fullScreen={isMobile}>\r\n        <DatePicker\r\n          variant=\"static\"\r\n          open={state.open}\r\n          views={['year', 'month', 'date']}\r\n          value={state.date}\r\n          openTo=\"date\"\r\n          //   disableToolbar\r\n          onOpen={() => extendState({ open: true })}\r\n          onClose={() => extendState({ open: false })}\r\n          onChange={handleDateChange}\r\n          //   renderDay={renderDay}\r\n        />\r\n\r\n        <DialogActions>\r\n          <Button variant=\"ghostColor\" onClick={handleReject}>\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n          <Button variant=\"ghostColor\" onClick={handleAccept}>\r\n            {t(translations.OK)}\r\n          </Button>\r\n        </DialogActions>\r\n      </Dialog>\r\n\r\n      <Button\r\n        style={isMobile ? { padding: '4px 6px' } : undefined}\r\n        variant=\"ghostColor\"\r\n        size={props.size || 'medium'}\r\n        endIcon={<Icon icon=\"chevron-down\" />}\r\n        onClick={() => extendState({ open: true })}\r\n      >\r\n        {getPeriodDisplayLabel(\r\n          props.viewLength,\r\n          props.date,\r\n          props.compact ?? false,\r\n          props.customDays,\r\n          state.customStart,\r\n        )}\r\n      </Button>\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * TimelineGroupByPicker\r\n *\r\n */\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useSchedulerSlice } from '../../slice';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { selectTimelineGroupBy } from '../../slice/selectors';\r\nimport { EnumPicker } from 'app/components/BasicPickers/EnumPicker';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface TimelineGroupByPickerProps {\r\n  EnumNamesArray: TimelineGroupByUnion[];\r\n}\r\n\r\nexport function TimelineGroupByPicker(props: TimelineGroupByPickerProps) {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useSchedulerSlice();\r\n  const value = useSelector(selectTimelineGroupBy);\r\n  const { t } = useTranslation();\r\n\r\n  const handleChange = (value: TimelineGroupByUnion | null) => {\r\n    dispatch(actions.changeViewModePartial({ groupBy: value ?? undefined }));\r\n  };\r\n  return (\r\n    <EnumPicker\r\n      value={value ?? null}\r\n      onChange={handleChange}\r\n      label={t(translations.GroupReservationBy)}\r\n      title={t(translations.GroupReservationBy)}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * CalendarHeader\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ViewLengths, ViewTypes } from '../../slice/types';\r\nimport { Timestamp } from 'types/Timestamp';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useSchedulerSlice } from '../../slice';\r\nimport { useLocation } from 'react-router';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { FiltersComponent } from 'app/pages/CalendarPage/FiltersComponent';\r\nimport { IWithSavedHistoryComponentProps } from 'app/components/BasicTable/withSavedHistory';\r\nimport { MultiToggle } from '../MultiToggle';\r\nimport {\r\n  selectMultipleModeState,\r\n  selectSchedulerViewCustomStart,\r\n  selectSchedulerViewType,\r\n} from '../../slice/selectors';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { FiltersGroupDisplay } from 'app/components/BasicTable/BasicFilter/FiltersGroupDisplay';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { FilterIconButton } from 'app/components/BasicButtons/FilterIconButton';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalSetting,\r\n  selectIsFullScreen,\r\n  selectKnownModule,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { FullScreenSchedulerButton } from '../FullScreenSchedulerButton';\r\nimport { CalendarActionRenderer } from '../CalendarToolbar/CalendarActionRenderer';\r\nimport { AddReservation } from 'app/pages/Actions/PageTopActions/AddReservation';\r\nimport { ViewTypeLengthDropDown } from '../ViewTypeLengthDropDown';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { getPeriodFromViewLength, viewStateFromFilter } from '../../utils';\r\nimport { CombinedSchedulerTRow } from 'app/pages/CalendarPage/Filter';\r\nimport { CalendarDatePicker, CalendarDateValue } from '../CalendarDatePicker';\r\nimport { IsReadOnlyUser } from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { SchedulerDatePositionUnion } from 'app/components/BasicTable/Filters/DatesPeriodFilter';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { TimelineGroupByUnion } from 'api/odata/generated/enums/TimelineGroupBy';\r\nimport { TimelineGroupByPicker } from '../TimelineGroupByPicker';\r\nimport { ExportToPDF } from '../ExportToPDF';\r\nimport { useRefreshInterval } from '../useRefreshInterval';\r\n\r\nexport interface CalendarHeaderProps\r\n  extends IWithSavedHistoryComponentProps<CombinedSchedulerTRow> {\r\n  viewType: ViewTypes;\r\n  viewLength: ViewLengths;\r\n  date: Timestamp;\r\n  onMultipleModeChange: ValueChangeHandler<boolean>;\r\n  //range: Range<Timestamp | undefined>;\r\n  filtersButtonAnchorEl: HTMLElement | null;\r\n  filterRef?: React.RefObject<HTMLButtonElement>;\r\n  onFilterOpen: () => void;\r\n  filterOpen: boolean;\r\n  onFilterClose: () => void;\r\n  withoutHeader?: boolean;\r\n  noChangeLocation?: boolean;\r\n  noTypeChange?: boolean;\r\n  haideCalendarViewType?: boolean;\r\n  pageActions?: CalendarActionRenderer[];\r\n  setFilterValue?: (id: string, value: FilterValueType) => void;\r\n  showPeriodPicker?: boolean;\r\n  customDays?: number;\r\n  customDaysEnabled?: boolean;\r\n  twoDaysEnabled?: boolean;\r\n  handleSetPeriodFilter: (length: ViewLengths, value?: Date) => void;\r\n  handleViewTypeLengthChange: (\r\n    type: ViewTypes,\r\n    length: ViewLengths,\r\n    value?: Date,\r\n    noChangeLocation?: boolean,\r\n  ) => void;\r\n  updateSearchPeriod: (\r\n    preset: SchedulerDatePositionUnion | null,\r\n    search?: string,\r\n  ) => string | undefined;\r\n  onRefresh?: () => void;\r\n  loading: boolean;\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function CalendarHeader({\r\n  customDays,\r\n  handleSetPeriodFilter,\r\n  handleViewTypeLengthChange,\r\n  updateSearchPeriod,\r\n  showPeriodPicker = true,\r\n  customDaysEnabled = false,\r\n  twoDaysEnabled = false,\r\n  useSidePanel,\r\n  ...props\r\n}: CalendarHeaderProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const log = React.useMemo(() => getLogger('CalendarHeader'), []);\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const classes = useStyles({ isMobile: isMobile });\r\n  const dispatch = useDispatch();\r\n  const location = useLocation();\r\n  const { actions } = useSchedulerSlice();\r\n  const multipleMode = useSelector(selectMultipleModeState);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n  const isFullScreen = useSelector(selectIsFullScreen);\r\n  const hasCustomStart = useSelector(selectSchedulerViewCustomStart);\r\n  const { newDate } = useSystemDate();\r\n  useEffectOnMount(() => {\r\n    dispatch(actions.setNotUseLocation(props.noChangeLocation));\r\n  });\r\n  useRefreshInterval();\r\n  const handleCalendarDateChange: ValueChangeHandler<CalendarDateValue> = value => {\r\n    dispatch(\r\n      actions.changeViewMode({\r\n        current: {\r\n          viewType: props.viewType,\r\n          viewLength: value.viewLength,\r\n          date: dateUtils.formatISO(dateUtils.dateOrStringToDate(value.date)),\r\n          preset: null,\r\n          search: location.search,\r\n          customDays: customDaysEnabled ? customDays : undefined,\r\n          customStart: value.customStart,\r\n        },\r\n        withNoChangeLocation: props.noChangeLocation,\r\n      }),\r\n    );\r\n  };\r\n  const moveToDate = React.useCallback(\r\n    (value: Date, viewLength?: ViewLengths) => {\r\n      let presetValue = getPeriodFromViewLength(\r\n        viewLength ?? props.viewLength,\r\n        value ?? dateUtils.parseISO(props.date),\r\n        customDays,\r\n      );\r\n      handleSetPeriodFilter(viewLength ?? props.viewLength, value);\r\n      dispatch(\r\n        actions.changeViewMode({\r\n          current: {\r\n            viewType: props.viewType,\r\n            viewLength: viewLength ?? props.viewLength,\r\n            date: dateUtils.formatISO(value),\r\n            preset: viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n            search:\r\n              updateSearchPeriod(\r\n                viewStateFromFilter(presetValue.type)?.preset ?? null,\r\n                location.search,\r\n              ) ?? location.search,\r\n            customDays: customDays,\r\n            customStart: hasCustomStart,\r\n          },\r\n          withNoChangeLocation: props.noChangeLocation,\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      actions,\r\n      customDays,\r\n      dispatch,\r\n      handleSetPeriodFilter,\r\n      hasCustomStart,\r\n      location.search,\r\n      props.date,\r\n      props.noChangeLocation,\r\n      props.viewLength,\r\n      props.viewType,\r\n      updateSearchPeriod,\r\n    ],\r\n  );\r\n  const move = React.useCallback(\r\n    (a: 'next' | 'prev') => {\r\n      const diff = a === 'next' ? 1 : a === 'prev' ? -1 : undefined;\r\n      if (diff === undefined) {\r\n        return;\r\n      }\r\n      const customDiff =\r\n        props.viewLength === 'day'\r\n          ? diff\r\n          : props.viewLength === 'twodays'\r\n          ? a === 'next'\r\n            ? 2\r\n            : -2\r\n          : props.viewLength === 'customdays'\r\n          ? a === 'next'\r\n            ? customDays ?? 2\r\n            : -(customDays ?? 2)\r\n          : props.viewLength === 'week'\r\n          ? diff\r\n          : props.viewLength === 'month'\r\n          ? diff\r\n          : props.viewLength === 'quarter'\r\n          ? diff\r\n          : props.viewLength === 'year'\r\n          ? diff\r\n          : undefined;\r\n\r\n      const addDateFn =\r\n        props.viewLength === 'day'\r\n          ? dateUtils.addDays\r\n          : props.viewLength === 'twodays'\r\n          ? dateUtils.addDays\r\n          : props.viewLength === 'customdays'\r\n          ? dateUtils.addDays\r\n          : props.viewLength === 'week'\r\n          ? dateUtils.addWeeks\r\n          : props.viewLength === 'month'\r\n          ? dateUtils.addMonths\r\n          : props.viewLength === 'quarter'\r\n          ? dateUtils.addQuarters\r\n          : props.viewLength === 'year'\r\n          ? dateUtils.addYears\r\n          : undefined;\r\n      if (addDateFn === undefined) {\r\n        return undefined;\r\n      }\r\n      const newDate = addDateFn(\r\n        dateUtils.parseISO(props.date),\r\n        customDiff || diff,\r\n      );\r\n      return moveToDate(newDate);\r\n    },\r\n    [customDays, moveToDate, props.date, props.viewLength],\r\n  );\r\n  const handleMultipleModeChange: ValueChangeHandler<boolean> = value => {\r\n    props.onMultipleModeChange(value);\r\n  };\r\n  const handlePreviousPeriodClick = () => {\r\n    move('prev');\r\n  };\r\n\r\n  const handleNextPeriodClick = () => {\r\n    move('next');\r\n  };\r\n\r\n  const handleTodayClick = value => {\r\n    handleSetPeriodFilter('day');\r\n    dispatch(\r\n      actions.changeViewMode({\r\n        current: {\r\n          viewType: props.viewType,\r\n          viewLength: 'day',\r\n          date: dateUtils.formatISO(newDate()),\r\n          preset: 'Today',\r\n          search:\r\n            updateSearchPeriod('Today', location.search) ?? location.search,\r\n          customDays: undefined,\r\n          customStart: undefined,\r\n        },\r\n        withNoChangeLocation: props.noChangeLocation,\r\n        forceEvents: true,\r\n      }),\r\n    );\r\n  };\r\n  const handleFilterChange = (\r\n    filters: IFilterSettings<CombinedSchedulerTRow>[],\r\n  ) => {\r\n    props.onFilterChange?.(filters);\r\n  };\r\n\r\n  const getTitle = (viewType: ViewTypes) => {\r\n    switch (viewType) {\r\n      case 'calendar':\r\n        return t(translations.Calendar);\r\n      case 'timeline':\r\n        return t(translations.Timeline);\r\n      default:\r\n        assertExhaustive(viewType);\r\n    }\r\n  };\r\n\r\n  const lengthOptions = React.useMemo(() => {\r\n    let lengths: Array<ViewLengths> = ['day'];\r\n    if (twoDaysEnabled) {\r\n      lengths.push('twodays');\r\n    }\r\n    if (customDaysEnabled) {\r\n      lengths.push('customdays');\r\n    }\r\n    lengths.push('week');\r\n    lengths.push('month');\r\n    if (!isMobile) {\r\n      lengths.push('quarter');\r\n      lengths.push('year');\r\n    }\r\n    return lengths;\r\n  }, [customDaysEnabled, isMobile, twoDaysEnabled]);\r\n\r\n  const viewType = useSelector(selectSchedulerViewType);\r\n  const AssetCatEnabled = useSelector(\r\n    state =>\r\n      tryParseBool(\r\n        selectGlobalSetting(state, AllowedSettings.AssetCatEnabled),\r\n      ) === true,\r\n  );\r\n  const EquipmentAssembliesEnabled = useSelector(\r\n    state =>\r\n      selectKnownModule(state, KnownModules.EquipmentAssemblies) === true,\r\n  );\r\n\r\n  const TimelineGroupByEnumsArray = React.useMemo(() => {\r\n    const result: TimelineGroupByUnion[] = [];\r\n    if (EquipmentAssembliesEnabled) {\r\n      result.push('GroupByAssemblyPart');\r\n    }\r\n    if (AssetCatEnabled) {\r\n      result.push('GroupByAssetCat');\r\n    }\r\n    if (result.length === 0) {\r\n      return undefined;\r\n    } else {\r\n      result.unshift('NoTimelineGrouped');\r\n    }\r\n    return result;\r\n  }, [AssetCatEnabled, EquipmentAssembliesEnabled]);\r\n\r\n  // page level actions shown behind kebab menu\r\n  const secondaryPageActions: CalendarActionRenderer[] = React.useMemo(() => {\r\n    const calendarActions: CalendarActionRenderer[] = [];\r\n    // const hasCalendarAndOtherRoles =\r\n    //   authenticatedUser?.Roles?.includes(Roles.CalendarOnly) &&\r\n    //   authenticatedUser?.Roles?.length > 1;\r\n    if (TimelineGroupByEnumsArray !== undefined && viewType === 'timeline') {\r\n      calendarActions.push(() => (\r\n        <TimelineGroupByPicker EnumNamesArray={TimelineGroupByEnumsArray} />\r\n      ));\r\n    }\r\n\r\n    if (!authenticatedUser?.Roles?.includes(Roles.CalendarOnly) && !isMobile) {\r\n      calendarActions.push(() => <FullScreenSchedulerButton />);\r\n    }\r\n    if (!isMobile) {\r\n      calendarActions.push(() => (\r\n        <ExportToPDF\r\n          onClick={() => {\r\n            dispatch(actions.exportToPDF());\r\n          }}\r\n        />\r\n      ));\r\n    }\r\n\r\n    return calendarActions.concat(props.pageActions ?? []);\r\n  }, [\r\n    TimelineGroupByEnumsArray,\r\n    actions,\r\n    authenticatedUser?.Roles,\r\n    dispatch,\r\n    isMobile,\r\n    props.pageActions,\r\n    viewType,\r\n  ]);\r\n  const primaryPageActions: CalendarActionRenderer[] = React.useMemo(() => {\r\n    const actions: CalendarActionRenderer[] = [];\r\n    if (isMobile && props.availableFilters !== undefined) {\r\n      actions.push(() => (\r\n        <FilterIconButton\r\n          filterLength={props.appliedFilters?.length ?? 0}\r\n          handleClick={props.onFilterOpen}\r\n          innerRef={props.filterRef}\r\n        />\r\n      ));\r\n    }\r\n    if (!isFullScreen && isMobile && !IsReadOnlyUser(authenticatedUser)) {\r\n      actions.push(() => (\r\n        <AddReservation\r\n          text={t(translations.AddReservation)}\r\n          variant=\"main\"\r\n          useSidePanel={useSidePanel}\r\n        />\r\n      ));\r\n    }\r\n\r\n    return actions;\r\n  }, [\r\n    authenticatedUser,\r\n    isFullScreen,\r\n    isMobile,\r\n    props.appliedFilters?.length,\r\n    props.availableFilters,\r\n    props.filterRef,\r\n    props.onFilterOpen,\r\n    t,\r\n    useSidePanel,\r\n  ]);\r\n  const handleRefresh = () => {\r\n    props.onRefresh?.();\r\n  };\r\n  return (\r\n    <>\r\n      {!props.withoutHeader && (\r\n        <TableToolbar\r\n          screenName={getTitle(props.viewType)}\r\n          variant={isFullScreen ? 'dense' : 'regular'}\r\n          onRefresh={handleRefresh}\r\n          loading={props.loading}\r\n        >\r\n          {primaryPageActions.length > 0 &&\r\n            primaryPageActions.map((item, index) => (\r\n              <span key={index}>{item()}</span>\r\n            ))}\r\n          {authenticatedUser?.Roles?.includes(Roles.CalendarOnly) &&\r\n            !isMobile &&\r\n            !isFullScreen && <FullScreenSchedulerButton />}\r\n          {secondaryPageActions.length > 0 &&\r\n            !(\r\n              authenticatedUser?.Roles?.includes(Roles.CalendarOnly) &&\r\n              isFullScreen\r\n            ) && (\r\n              <ReactActions\r\n                id=\"CalendarHeaderReactActions\"\r\n                keepOpen /** keepOpen is used here to prevent the menu from closing when selecting the timeline grouping option */\r\n                disableRipple /** the ripple over the \"timeline group by\" dropdown is too confusing  */\r\n                items={secondaryPageActions.map((item, index) => (\r\n                  <React.Fragment key={index}>{item()}</React.Fragment>\r\n                ))}\r\n              />\r\n            )}\r\n        </TableToolbar>\r\n      )}\r\n      <Box className={classes.root}>\r\n        <Box className={classes.toolbar}>\r\n          {/* hide the menu in fullscreen mode since it's not functional (autocompletes do not show up) */}\r\n          {!isFullScreen && props.availableFilters !== undefined && (\r\n            <>\r\n              {isMobile ? (\r\n                <FiltersComponent\r\n                  appliedFilters={props.appliedFilters}\r\n                  availableFilters={props.availableFilters}\r\n                  onFilterChange={handleFilterChange}\r\n                  key=\"timeline-filter\"\r\n                  fullWidth\r\n                  filterOpen={props.filterOpen}\r\n                  filterRef={props.filterRef}\r\n                  onFilterOpen={props.onFilterOpen}\r\n                  onFilterClose={props.onFilterClose}\r\n                  getDefaultFilters={props.getDefaultFilters}\r\n                  filtersButtonAnchorEl={props.filtersButtonAnchorEl}\r\n                  savedListSettings={{\r\n                    enableSavedLists: true,\r\n                    savedListRelatedPickerName: 'Id',\r\n                    savedListSerializedKey: 'eid',\r\n                  }}\r\n                />\r\n              ) : (\r\n                <Box className={classes.otherControls}>\r\n                  <FiltersComponent\r\n                    appliedFilters={props.appliedFilters}\r\n                    availableFilters={props.availableFilters}\r\n                    onFilterChange={handleFilterChange}\r\n                    key=\"timeline-filter\"\r\n                    fullWidth\r\n                    filterOpen={props.filterOpen}\r\n                    filterRef={props.filterRef}\r\n                    onFilterOpen={props.onFilterOpen}\r\n                    onFilterClose={props.onFilterClose}\r\n                    getDefaultFilters={props.getDefaultFilters}\r\n                    filtersButtonAnchorEl={props.filtersButtonAnchorEl}\r\n                    savedListSettings={{\r\n                      enableSavedLists: true,\r\n                      savedListRelatedPickerName: 'Id',\r\n                      savedListSerializedKey: 'eid',\r\n                    }}\r\n                  />\r\n                </Box>\r\n              )}\r\n            </>\r\n          )}\r\n          <Box className={classes.periodControls}>\r\n            <IconButton\r\n              variant=\"ghost\"\r\n              shape=\"square\"\r\n              size={'small'}\r\n              title={translations.Previous}\r\n              onClick={handlePreviousPeriodClick}\r\n            >\r\n              <Icon icon=\"chevron-left\" />\r\n            </IconButton>\r\n            <CalendarDatePicker\r\n              viewLength={props.viewLength}\r\n              date={props.date}\r\n              open={false}\r\n              size=\"small\"\r\n              onChange={handleCalendarDateChange}\r\n              compact={isMobile}\r\n              customDays={customDays}\r\n              customStart={hasCustomStart}\r\n              viewType={props.viewType}\r\n            />\r\n            {props.viewType === 'calendar' && !isMobile && (\r\n              <MultiToggle\r\n                value={multipleMode}\r\n                onchange={handleMultipleModeChange}\r\n              />\r\n            )}\r\n            <IconButton\r\n              title={t(translations.Today)}\r\n              onClick={handleTodayClick}\r\n              variant=\"ghost\"\r\n              shape=\"square\"\r\n              size={'small'}\r\n            >\r\n              <Icon icon=\"home\" />\r\n            </IconButton>\r\n            <IconButton\r\n              title={t(translations.Next)}\r\n              onClick={handleNextPeriodClick}\r\n              variant=\"ghost\"\r\n              size={'small'}\r\n              shape=\"square\"\r\n            >\r\n              <Icon icon=\"chevron-right\" />\r\n            </IconButton>\r\n            {/* todo: implement settings */}\r\n            {false && (\r\n              <IconButton\r\n                title={t(translations.Settings)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size={'small'}\r\n              >\r\n                <Icon icon=\"cog\" />\r\n              </IconButton>\r\n            )}\r\n            {/* todo: implement \"save selection\" */}\r\n            {false && (\r\n              <Button\r\n                variant=\"ghost\"\r\n                size={'small'}\r\n                title={t(translations.SaveSelection)}\r\n              >\r\n                {t(translations.SaveSelection)}\r\n              </Button>\r\n            )}\r\n          </Box>\r\n          {showPeriodPicker && (\r\n            <Box className={classes.viewTypeControls}>\r\n              <ViewTypeLengthDropDown\r\n                viewType={props.viewType}\r\n                viewLength={props.viewLength}\r\n                compact={isMobile}\r\n                size=\"small\"\r\n                haideCalendarViewType={props.haideCalendarViewType}\r\n                onTypeLengthChange={(type, length, value) =>\r\n                  handleViewTypeLengthChange(\r\n                    type,\r\n                    length,\r\n                    value,\r\n                    props.noChangeLocation,\r\n                  )\r\n                }\r\n                customDays={customDays}\r\n                customDaysEnabled={customDaysEnabled}\r\n                twoDaysEnabled={twoDaysEnabled}\r\n                lengthOptions={lengthOptions}\r\n              />\r\n            </Box>\r\n          )}\r\n        </Box>\r\n        {!isMobile &&\r\n          props.availableFilters !== undefined &&\r\n          (props.appliedFilters ?? []).length > 0 && (\r\n            <Box component=\"div\" className={classes.filterDisplayRoot}>\r\n              <FiltersGroupDisplay\r\n                appliedFilters={props.appliedFilters ?? []}\r\n                onChange={handleFilterChange}\r\n                openFilter={props.onFilterOpen}\r\n              />\r\n            </Box>\r\n          )}\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n\r\nconst useStyles = makeStyles<Theme, { isMobile: boolean }>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      padding: 8,\r\n      gap: 8,\r\n    },\r\n    column: {\r\n      display: 'flex',\r\n      width: 'auto', //props => timelineColumnWidth(props.isMobile),\r\n      alignItems: 'center',\r\n    },\r\n    toolbar: {\r\n      flex: 1,\r\n      display: 'flex',\r\n      padding: props => (props.isMobile ? '8px 0px' : '0px'),\r\n      alignItems: 'center',\r\n      justifyContent: 'space-between',\r\n      [theme.breakpoints.down('sm')]: {\r\n        flexWrap: 'wrap',\r\n        gap: 0,\r\n        // flexDirection: 'column',\r\n        // alignItems: 'flex-start',\r\n      },\r\n    },\r\n    left: {\r\n      // flex: 1,\r\n      display: 'flex',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n      gap: theme.spacing(1),\r\n    },\r\n    right: {\r\n      flex: 1,\r\n      display: 'flex',\r\n      justifyContent: 'flex-end',\r\n      alignItems: 'center',\r\n    },\r\n    periodControls: {\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      flexDirection: 'row',\r\n      gap: props => (props.isMobile ? theme.spacing(0.5) : theme.spacing(1)),\r\n    },\r\n    viewTypeControls: {\r\n      display: 'flex',\r\n      justifyContent: 'flex-end',\r\n      alignItems: 'center',\r\n      gap: theme.spacing(1),\r\n    },\r\n    otherControls: {},\r\n    search: {\r\n      width: 150,\r\n    },\r\n    filterDisplayRoot: {\r\n      gap: 8,\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      flexWrap: 'wrap',\r\n    },\r\n  }),\r\n);\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalSetting,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { Roles } from 'app/slice/types';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { schedulerActions } from '../slice';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport const useRefreshInterval = () => {\r\n  const dispatch = useDispatch();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const intervalRefreshingCalendar = useSelector(state =>\r\n    selectGlobalSetting(state, AllowedSettings.IntervalRefreshingCalendar),\r\n  );\r\n  const calendarOnly = authenticatedUser?.Roles?.includes(Roles.CalendarOnly);\r\n  const { newDate } = useSystemDate();\r\n  const isMobile = DetectIsMobile();\r\n  const DEFAULT_REFRESH_INTERVAL_MINUTES = 2;\r\n  const MAX_REFRESH_INTERVAL_MINUTES = 120;\r\n  const MILLISECONDS_IN_MINUTE = 60000;\r\n\r\n  const configuredRefreshInterval = React.useMemo(() => {\r\n    return (\r\n      tryParseInt(intervalRefreshingCalendar) ??\r\n      DEFAULT_REFRESH_INTERVAL_MINUTES\r\n    );\r\n  }, [intervalRefreshingCalendar]);\r\n\r\n  const refreshIntervalNumber = React.useMemo(() => {\r\n    return configuredRefreshInterval < DEFAULT_REFRESH_INTERVAL_MINUTES ||\r\n      configuredRefreshInterval > MAX_REFRESH_INTERVAL_MINUTES\r\n      ? DEFAULT_REFRESH_INTERVAL_MINUTES\r\n      : configuredRefreshInterval;\r\n  }, [configuredRefreshInterval]);\r\n  const refreshInterval = React.useCallback(() => {\r\n    try {\r\n      const date = dateUtils.formatISO(newDate());\r\n      dispatch(schedulerActions.setDate(date));\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n  }, [dispatch, newDate]);\r\n  React.useEffect(() => {\r\n    let handle = 0;\r\n\r\n    if (calendarOnly === true && !isMobile) {\r\n      handle = setInterval(\r\n        refreshInterval,\r\n        refreshIntervalNumber * MILLISECONDS_IN_MINUTE,\r\n      );\r\n    }\r\n\r\n    return () => clearInterval(handle);\r\n  }, [calendarOnly, isMobile, refreshInterval, refreshIntervalNumber]);\r\n  return { refreshInterval };\r\n};\r\n","import { getSinglePriceSheetMethod } from 'app/components/pickers/StaticOptionsPickers/PriceSheetMethodPicker';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\n\r\n/* --- STATE --- */\r\nexport interface PricePeriodState {\r\n  detailsState: AsyncDataState<PricePeriodsDetailsState>;\r\n  processing: boolean;\r\n}\r\n\r\nexport interface IPriceSheetPeriodDto {\r\n  Id: number;\r\n  ServiceGroupId: number | null;\r\n  ServiceGroupName: string | null;\r\n  StartDate: Date | string;\r\n  EndDate: Date | string | null;\r\n  Method: number | null;\r\n  PriceSheetLink: string | null;\r\n}\r\n\r\nexport interface PricePeriodQueryParams {\r\n  id?: string;\r\n  groupId?: string;\r\n  start?: string;\r\n  end?: string;\r\n  method?: string;\r\n}\r\nexport interface PricePeriodsDetailsState {\r\n  Id: number;\r\n  ServiceGroup: Entity<number> | null;\r\n  StartDate: Date | string;\r\n  EndDate: Date | string | null;\r\n  Method: Entity<number> | null;\r\n}\r\nexport interface PricePeriodsResponse extends IResponseType {\r\n  Id: number | null;\r\n  data: IPriceSheetPeriodDto | null;\r\n  IsValid: boolean;\r\n}\r\nexport const ConvertDtoToModel = (\r\n  entity: IPriceSheetPeriodDto,\r\n): PricePeriodsDetailsState => {\r\n  let model = {\r\n    Id: entity.Id,\r\n    ServiceGroup:\r\n      entity.ServiceGroupId !== null\r\n        ? toEntity(entity.ServiceGroupId, entity.ServiceGroupName)\r\n        : null,\r\n    StartDate: dateUtils.formatQueryStringDate(\r\n      dateUtils.parseISO(entity.StartDate),\r\n    ),\r\n    EndDate:\r\n      entity.EndDate === null\r\n        ? null\r\n        : dateUtils.formatQueryStringDate(dateUtils.parseISO(entity.EndDate)),\r\n    Method:\r\n      entity.Method !== null\r\n        ? getSinglePriceSheetMethod(entity.Method ?? 0)\r\n        : null,\r\n  } as PricePeriodsDetailsState;\r\n  return model;\r\n};\r\n\r\nexport const ConvertModelToInsertEntity = (model: PricePeriodsDetailsState) => {\r\n  let data = {\r\n    Id: model.Id,\r\n    ServiceGroupId: model.ServiceGroup?.Id || null,\r\n    ServiceGroupName: model.ServiceGroup?.Name,\r\n    StartDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(model.StartDate),\r\n    ),\r\n    EndDate:\r\n      model.EndDate === null\r\n        ? null\r\n        : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EndDate)),\r\n    Method: model.Method?.Id,\r\n  } as IPriceSheetPeriodDto;\r\n  return data;\r\n};\r\nexport const ConvertModelToUpdateEntity = (\r\n  model: PricePeriodsDetailsState,\r\n  original: PricePeriodsDetailsState,\r\n) => {\r\n  let data = {\r\n    Id: original.Id,\r\n    ServiceGroupId: model.ServiceGroup?.Id || null,\r\n    ServiceGroupName: model.ServiceGroup?.Name,\r\n    StartDate: dateUtils.formatISO(\r\n      dateUtils.dateOrStringToDate(model.StartDate),\r\n    ),\r\n    EndDate:\r\n      model.EndDate === null\r\n        ? null\r\n        : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EndDate)),\r\n    Method: model.Method?.Id,\r\n  } as IPriceSheetPeriodDto;\r\n  return data;\r\n};\r\nexport const getDefaultPricePeriod = () => {\r\n  return {\r\n    Id: 0,\r\n    ServiceGroupId: null,\r\n    ServiceGroupName: null,\r\n    StartDate: dateUtils.formatISO(new Date()),\r\n    EndDate: null,\r\n    Method: null,\r\n  } as IPriceSheetPeriodDto;\r\n};\r\n","import {\r\n  IPriceSheetPeriodDto,\r\n  PricePeriodQueryParams,\r\n  PricePeriodsResponse,\r\n} from 'app/pages/PriceSheetPeriodDetails/Details/slice/types';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport const PriceSheetApi = {\r\n  initPeriodDetails: (payload: PricePeriodQueryParams) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = `/api/odata/v4/PriceSheetPeriod/InitPeriods`;\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertPricePeriod: (period: IPriceSheetPeriodDto) => {\r\n    const url = '/api/odata/v4/PriceSheetPeriod';\r\n    return httpClient.post(url, period);\r\n  },\r\n  updatePricePeriod: (period: IPriceSheetPeriodDto, rowId: number) => {\r\n    const url = '/api/odata/v4/PriceSheetPeriod';\r\n    return httpClient.put<any, PricePeriodsResponse>(\r\n      url + '(' + rowId + ')',\r\n      period,\r\n    );\r\n  },\r\n  deletePricePeriod: (Id: number) => {\r\n    const url = `/api/odata/v4/PriceSheetPeriod/${Id}`;\r\n    return httpClient.deleteCustom<PricePeriodsResponse>(url);\r\n  },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { pricePeriodActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport {\r\n  ConvertModelToInsertEntity,\r\n  ConvertModelToUpdateEntity,\r\n  getDefaultPricePeriod,\r\n  IPriceSheetPeriodDto,\r\n  PricePeriodQueryParams,\r\n  PricePeriodsDetailsState,\r\n  PricePeriodsResponse,\r\n} from './types';\r\nimport { PriceSheetApi as api } from 'api/PriceSheetApi';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { PricePeriodDetailsProps } from '..';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\n\r\nfunction* doInitDetails(\r\n  action: PayloadAction<{\r\n    query: PricePeriodQueryParams;\r\n    model?: IPriceSheetPeriodDto;\r\n  }>,\r\n) {\r\n  try {\r\n    let data: IPriceSheetPeriodDto | null = action.payload.model || null;\r\n    let hasError: boolean = false;\r\n    if (data === null) {\r\n      const result = yield call(api.initPeriodDetails, action.payload.query);\r\n      let response = result as PricePeriodsResponse;\r\n      if (response.ErrorMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.ErrorMessages.map(item => {\r\n              return {\r\n                key: 'initPeriodsErr',\r\n                message: item,\r\n                variant: 'error',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: 'initPeriodWarn',\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.SuccessMessages.map(item => {\r\n              return {\r\n                key: 'initPeriodSucc',\r\n                message: item,\r\n                variant: 'success',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      data = response.data ?? getDefaultPricePeriod();\r\n      hasError = !response.IsValid;\r\n    }\r\n    yield put(\r\n      actions.initDetails_Success({\r\n        hasErrors: hasError,\r\n        data: data,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    yield put(actions.initDetails_Error(error));\r\n  }\r\n}\r\nfunction* doCreatePeriod(action: PayloadAction<PricePeriodsDetailsState>) {\r\n  const httpPayloads: IPriceSheetPeriodDto = ConvertModelToInsertEntity(\r\n    action.payload,\r\n  );\r\n  try {\r\n    const result = yield call(api.insertPricePeriod, httpPayloads);\r\n    let response = result as PricePeriodsResponse;\r\n    let responseErrors = response.ErrorMessages;\r\n    let responseWarnings = response.WarningMessages;\r\n    let responseSuccess = response.SuccessMessages;\r\n    if (responseErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          responseErrors.map(item => {\r\n            return {\r\n              key: 'periodInsertError',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (responseSuccess.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'periodInsertSuccess',\r\n            message: responseSuccess[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: true,\r\n              itemName: i18next.t(translations.menu_PriceSheetPeriod),\r\n              detailsType: RenderPageType.PricePeriodsDetails,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id ?? -1,\r\n                },\r\n                initialPeriod: response.data,\r\n              } as PricePeriodDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (responseWarnings.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            responseWarnings.map(item => {\r\n              return {\r\n                key: 'periodInsertWarning',\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = responseErrors.length > 0;\r\n    yield put(\r\n      actions.createPeriod_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'periodInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createPeriod_Error(Error));\r\n  }\r\n}\r\nfunction* doUpdatePeriod(\r\n  action: PayloadAction<{\r\n    current: PricePeriodsDetailsState;\r\n    original: PricePeriodsDetailsState;\r\n  }>,\r\n) {\r\n  let updatedPeriod = ConvertModelToUpdateEntity(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n\r\n  try {\r\n    const results = yield call(\r\n      api.updatePricePeriod,\r\n      updatedPeriod,\r\n      action.payload.current.Id,\r\n    );\r\n    let response = results as PricePeriodsResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'periodUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    } else {\r\n      if (response.SuccessMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'periodUpdateSuccess',\r\n            message: response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id ?? undefined,\r\n              created: false,\r\n              itemName: i18next.t(translations.menu_PriceSheetPeriod),\r\n              detailsType: RenderPageType.PricePeriodsDetails,\r\n              detailsTypeProps: {\r\n                useSidePanel: true,\r\n                queryParams: {\r\n                  id: '' + response.Id ?? -1,\r\n                },\r\n                initialPeriod: response.data,\r\n              } as PricePeriodDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n      if (response.WarningMessages.length > 0) {\r\n        yield put(\r\n          appSettingsActions.addNotifications(\r\n            response.WarningMessages.map(item => {\r\n              return {\r\n                key: 'periodUpdateWarn',\r\n                message: item,\r\n                variant: 'warning',\r\n              };\r\n            }),\r\n          ),\r\n        );\r\n      }\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updatePeriod_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'periodUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updatePeriod_Error(Error));\r\n  }\r\n}\r\n\r\nexport function* pricePeriodSaga() {\r\n  yield takeLatest(actions.initDetails.type, doInitDetails);\r\n  yield takeLatest(actions.createPeriod.type, doCreatePeriod);\r\n  yield takeLatest(actions.updatePeriod.type, doUpdatePeriod);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { pricePeriodSaga } from './saga';\r\nimport {\r\n  ConvertDtoToModel,\r\n  IPriceSheetPeriodDto,\r\n  PricePeriodQueryParams,\r\n  PricePeriodsDetailsState,\r\n  PricePeriodState,\r\n} from './types';\r\n\r\nexport const initialState: PricePeriodState = {\r\n  detailsState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n    error: undefined,\r\n  },\r\n  processing: false,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'pricePeriod',\r\n  initialState,\r\n  reducers: {\r\n    initDetails(\r\n      state,\r\n      action: PayloadAction<{\r\n        query: PricePeriodQueryParams;\r\n        model?: IPriceSheetPeriodDto;\r\n      }>,\r\n    ) {\r\n      state.processing = true;\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n        data: IPriceSheetPeriodDto;\r\n      }>,\r\n    ) {\r\n      state.processing = false;\r\n      state.detailsState.data = ConvertDtoToModel(action.payload.data);\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n    },\r\n    initDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    resetDetailsState(state, action: PayloadAction) {\r\n      state.detailsState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n      state.processing = false;\r\n    },\r\n    createPeriod(state, action: PayloadAction<PricePeriodsDetailsState>) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    createPeriod_Success(state, action: PayloadAction<{ hasErrors: boolean }>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n    },\r\n    createPeriod_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n    updatePeriod(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: PricePeriodsDetailsState;\r\n        original: PricePeriodsDetailsState;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = true;\r\n      state.detailsState.completed = undefined;\r\n      state.detailsState.hasErrors = undefined;\r\n    },\r\n    updatePeriod_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.hasErrors = action.payload.hasErrors;\r\n      state.detailsState.completed = true;\r\n    },\r\n    updatePeriod_Error(state, action: PayloadAction<any>) {\r\n      state.detailsState.processing = false;\r\n      state.detailsState.completed = true;\r\n      state.detailsState.hasErrors = true;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: pricePeriodActions } = slice;\r\n\r\nexport const usePricePeriodSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: pricePeriodSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = usePricePeriodSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.pricePeriod || initialState;\r\n\r\nexport const selectPricePeriod = createSelector([selectSlice], state => state);\r\n\r\nexport const selectProcessing = createSelector(\r\n  [selectPricePeriod],\r\n  state => state.processing,\r\n);\r\nexport const selectDetails = createSelector(\r\n  [selectPricePeriod],\r\n  state => state.detailsState,\r\n);\r\nexport const selectDetailsProcessing = createSelector(\r\n  [selectDetails],\r\n  state => state.processing,\r\n);\r\nexport const selectDetailsError = createSelector(\r\n  [selectDetails],\r\n  state => state.error,\r\n);\r\nexport const selectDetailsHasError = createSelector(\r\n  [selectDetails],\r\n  state => state.hasErrors,\r\n);\r\nexport const selectDetailsCompleted = createSelector(\r\n  [selectDetails],\r\n  state => state.completed,\r\n);\r\nexport const selectDetailsData = createSelector(\r\n  [selectDetails],\r\n  state => state.data,\r\n);\r\n","import { FieldHookConfig, useField } from 'formik';\r\nimport { Entity } from 'types/common';\r\nimport {\r\n  PriceSheetMethodPicker,\r\n  PriceSheetMethodPickerProps,\r\n} from '../pickers/StaticOptionsPickers/PriceSheetMethodPicker';\r\n\r\nexport const FormPriceSheetMethodPicker = ({\r\n  onChange,\r\n  ...props\r\n}: FieldHookConfig<Entity<number> | null> &\r\n  Omit<PriceSheetMethodPickerProps, 'onChange'>) => {\r\n  const [field, meta, helpers] = useField<Entity<number> | null>(props);\r\n  return (\r\n    <>\r\n      <PriceSheetMethodPicker\r\n        onChange={value => helpers.setValue(value, true)}\r\n        onBlur={field?.onBlur}\r\n        value={field.value}\r\n        variant=\"filled\"\r\n        error={meta?.error !== undefined && meta?.touched}\r\n        helperText={meta.error}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n};\r\n","import { Formik, FormikProps } from 'formik';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSelector } from 'react-redux';\r\nimport { isEmpty } from 'lodash';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport {\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { PricePeriodsDetailsState } from '../slice/types';\r\nimport { selectDetailsHasError } from '../slice/selectors';\r\n\r\nimport i18next from 'i18next';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormPriceSheetMethodPicker } from 'app/components/Forms/FormPriceSheetMethodPicker';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { FormBookitDatePicker } from 'app/components/Forms/FormBookitDatePicker';\r\nexport interface PricePeriodsFormProps {\r\n  onSubmit: (item: PricePeriodsDetailsState) => void;\r\n  initialValues: PricePeriodsDetailsState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  innerFormRef: React.RefObject<FormikProps<PricePeriodsDetailsState>>;\r\n  globalPriceSheetEnabled: boolean;\r\n  priceEnabled: boolean;\r\n}\r\n\r\nexport const PricePeriodsForm = React.memo(function PricePeriodsForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isEdit,\r\n  isAdmin,\r\n  user,\r\n  globalPriceSheetEnabled,\r\n  innerFormRef,\r\n  priceEnabled,\r\n}: PricePeriodsFormProps) {\r\n  const { t } = useTranslation();\r\n  const hasError = useSelector(selectDetailsHasError);\r\n  const readonly = !isAdmin && isEdit;\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const handleSubmit = (values: PricePeriodsDetailsState) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values);\r\n    }\r\n  };\r\n  const { newDate } = useSystemDate();\r\n  /// Local State ///\r\n  const [serviceGroupChanged, setServiceGroupChanged] = React.useState(false);\r\n  const [startChanged, setStartChanged] = React.useState(false);\r\n  const [endChanged, setEndChanged] = React.useState(false);\r\n\r\n  const handleFormChange = React.useCallback(\r\n    (values: PricePeriodsDetailsState) => {\r\n      if (serviceGroupChanged) {\r\n        setServiceGroupChanged(false);\r\n      }\r\n      if (endChanged) {\r\n        setEndChanged(false);\r\n      }\r\n      if (startChanged) {\r\n        setStartChanged(false);\r\n      }\r\n    },\r\n    [serviceGroupChanged, endChanged, startChanged],\r\n  );\r\n\r\n  /// useEffects\r\n  React.useEffect(() => {\r\n    if (innerFormRef.current) {\r\n      innerFormRef.current.validateForm();\r\n    }\r\n  }, [innerFormRef]);\r\n\r\n  const computedSchema = React.useMemo(() => {\r\n    const pricPeriodsSchema: Yup.SchemaOf<PricePeriodsDetailsState> = Yup.object(\r\n      {\r\n        Id: Yup.number().notRequired().default(-1),\r\n        StartDate: Yup.date()\r\n          .default(newDate())\r\n          .label(i18next.t(translations.StartDate) as string)\r\n          .required(i18next.t(translations._errStartTimeRequired) as string),\r\n        EndDate: Yup.date()\r\n          .nullable()\r\n          .default(null)\r\n          .label(i18next.t(translations.EndDate) as string)\r\n          .notRequired()\r\n          .min(\r\n            Yup.ref('StartDate'),\r\n            i18next.t(translations.err_EndTimeLowerThanStartTime) as string,\r\n          ),\r\n        ServiceGroup: Yup.mixed().nullable(),\r\n        Method: Yup.mixed()\r\n          .label(t(translations.PriceSheetMethod) as string)\r\n          .nullable(),\r\n      },\r\n    );\r\n    if (!globalPriceSheetEnabled) {\r\n      pricPeriodsSchema.fields.ServiceGroup.withMutation(schema =>\r\n        schema.required(t(translations.err_ServiceGroupRequired) as string),\r\n      );\r\n    }\r\n    if (!priceEnabled) {\r\n      pricPeriodsSchema.fields.Method.withMutation(schema =>\r\n        schema.required(\r\n          t(translations.err_PriceSheetMethod_isrequired) as string,\r\n        ),\r\n      );\r\n    }\r\n    return pricPeriodsSchema;\r\n  }, [globalPriceSheetEnabled, newDate, priceEnabled, t]);\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={computedSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        validateOnChange={true}\r\n        enableReinitialize\r\n        innerRef={innerFormRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          formikHelpers.validateForm(values).then(responseErrors => {\r\n            if (!isEmpty(responseErrors)) {\r\n              formikHelpers.setSubmitting(false);\r\n              console.debug('errors', responseErrors);\r\n            } else {\r\n              console.debug('submitting', values);\r\n              formikHelpers.setSubmitting(true);\r\n              handleSubmit(values);\r\n            }\r\n          });\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          return (\r\n            <React.Fragment>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['ServiceGroup']}\r\n                />\r\n                <SubmittingHandler\r\n                  value={hasError === true && submitting === undefined}\r\n                  resetSubmitting={resetSubmitting}\r\n                />\r\n                <FormLeftSection\r\n                // warningNodes={warningMessages}\r\n                // infoNodes={infoMessages}\r\n                // errors={errorMessages}\r\n                // successNodes={successMessages}\r\n                >\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.PricePeriodDetails) as string}\r\n                  >\r\n                    {!globalPriceSheetEnabled && (\r\n                      <FormRow fullRow={true}>\r\n                        <FormServiceGroupPicker\r\n                          fullWidth\r\n                          id=\"ServiceGroupId\"\r\n                          name=\"ServiceGroup\"\r\n                          urlType=\"billableAdminUrl\"\r\n                          label={t(translations.ServiceGroup)}\r\n                          placeholder={t(translations.PleaseSelectServiceGroup)}\r\n                          disabled={formik.isSubmitting || readonly}\r\n                          onChange={val => {\r\n                            setServiceGroupChanged(true);\r\n                          }}\r\n                        />\r\n                      </FormRow>\r\n                    )}\r\n\r\n                    <FormRow>\r\n                      <FormBookitDatePicker\r\n                        fullWidth\r\n                        id=\"StartDateID\"\r\n                        name=\"StartDate\"\r\n                        clearable={false}\r\n                        label={t(translations.StartDate) as string}\r\n                        onChange={() => setStartChanged(true)}\r\n                        disabled={formik.isSubmitting || readonly}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormBookitDatePicker\r\n                        fullWidth\r\n                        id=\"EndDateID\"\r\n                        name=\"EndDate\"\r\n                        label={t(translations.EndDate) as string}\r\n                        onChange={() => setEndChanged(true)}\r\n                        disabled={formik.isSubmitting || readonly}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormPriceSheetMethodPicker\r\n                        fullWidth\r\n                        id=\"MethodID\"\r\n                        name=\"Method\"\r\n                        label={t(translations.PriceSheetMethod)}\r\n                        info={t(translations.PriceSheetMethod_info)}\r\n                        disabled={\r\n                          formik.isSubmitting || readonly || priceEnabled\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Box } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n  selectContinueToLink,\r\n  selectHasNotSavedChanges,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n  selectPublicUrl,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { buildURL, toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { PricePeriodsForm } from './PricePeriodsForm';\r\nimport { usePricePeriodSlice } from './slice';\r\nimport {\r\n  selectDetails,\r\n  selectDetailsCompleted,\r\n  selectDetailsHasError,\r\n  selectProcessing,\r\n} from './slice/selectors';\r\nimport {\r\n  IPriceSheetPeriodDto,\r\n  PricePeriodQueryParams,\r\n  PricePeriodsDetailsState,\r\n} from './slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\n\r\nexport interface PricePeriodDetailsProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  queryParams: PricePeriodQueryParams;\r\n  initialPeriod?: IPriceSheetPeriodDto;\r\n  onClose?: () => void;\r\n}\r\n\r\nexport const PricePeriodDetails = React.memo(function PricePeriodDetails(\r\n  props: PricePeriodDetailsProps,\r\n) {\r\n  const { useSidePanel, queryParams, initialPeriod, onClose } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = usePricePeriodSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n  /// Selectors ///\r\n  const processing = useSelector(selectProcessing);\r\n  const pricePeriod = useSelector(selectDetails);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const actionCompleted = useSelector(selectDetailsCompleted);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const hasError = useSelector(selectDetailsHasError);\r\n  /// Refs ///\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<PricePeriodsDetailsState>>(\r\n    null,\r\n  );\r\n  //cover\r\n  const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [edit, setEdit] = React.useState<boolean | undefined>(false);\r\n\r\n  const globalPriceSheetEnabled = settings?.GetBooleanByKey(\r\n    AllowedSettings.GlobalPriceSheetPeriods,\r\n  );\r\n  const priceSheetByEnabled = React.useMemo(() => {\r\n    const priceSheetBy =\r\n      settings !== null && settings !== undefined\r\n        ? settings?.GetString(AllowedSettings.PriceSheetBy)\r\n        : '';\r\n\r\n    return priceSheetBy !== '' && priceSheetBy !== '3';\r\n  }, [settings]);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const fullAdmin = React.useMemo(() => {\r\n    return User !== undefined && User.Roles.includes(Roles.Administrators);\r\n  }, [User]);\r\n  const IsAdmin = React.useMemo(() => {\r\n    return (\r\n      fullAdmin ||\r\n      (!globalPriceSheetEnabled &&\r\n        User?.HasAdminGroupPermissions(pricePeriod?.data?.ServiceGroup?.Id))\r\n    );\r\n  }, [\r\n    fullAdmin,\r\n    globalPriceSheetEnabled,\r\n    User,\r\n    pricePeriod?.data?.ServiceGroup?.Id,\r\n  ]);\r\n\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initDetails({\r\n          query: queryParams,\r\n          model: initialPeriod,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [actions, dispatch, firstLoad, initialPeriod, queryParams]);\r\n  /// functions, callbacks ///\r\n  const closeCover = () => {\r\n    setCover(undefined);\r\n  };\r\n  const handleClose = () => {\r\n    if (hasChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCloselClick();\r\n    }\r\n  };\r\n  const handleCloselClick = React.useCallback(() => {\r\n    if (!!onClose) {\r\n      onClose();\r\n    } else {\r\n      if (useSidePanel) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(push('/PricePeriods'));\r\n      }\r\n    }\r\n    dispatch(actions.resetDetailsState());\r\n  }, [actions, dispatch, layoutActions, onClose, useSidePanel]);\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: PricePeriodsDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updatePeriod({\r\n            current: values,\r\n            original: pricePeriod.data || values,\r\n          }),\r\n        );\r\n      } else {\r\n        dispatch(actions.createPeriod(values));\r\n      }\r\n    },\r\n    [actions, dispatch, edit, pricePeriod.data],\r\n  );\r\n  /// Use Effects ///\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n        setEdit(true);\r\n      } else {\r\n        setEdit(false);\r\n      }\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actionCompleted,\r\n    handleCloselClick,\r\n    hasError,\r\n    processing,\r\n    queryParams.id,\r\n  ]);\r\n  React.useEffect(() => {\r\n    if (confirmApproved) {\r\n      dispatch(actions.resetDetailsState());\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(layoutActions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(appSettingsActions.navigate(continueLink));\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n      //dispatch(actions.setChangedState(false));\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n\r\n    return () => undefined;\r\n  }, [\r\n    actions,\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n  ]);\r\n\r\n  const leftActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={busy}\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    return actions;\r\n  }, [busy, handleSaveClick, requestCompleted, t]);\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCloselClick}\r\n          >\r\n            {t(translations.Close)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCloselClick, t]);\r\n  const topButtons: ActionRenderer[] = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    let data =\r\n      pricePeriod.data ||\r\n      innerFormRef.current?.values ||\r\n      ({} as PricePeriodsDetailsState);\r\n    if (edit && IsAdmin && data !== undefined) {\r\n      actions.push(() => (\r\n        <TopActionButton\r\n          text={t(translations.PriceSheets)}\r\n          icon=\"money-check-edit\"\r\n          startIcon=\"money-check-edit\"\r\n          size=\"small\"\r\n          title={t(translations.OpenPriceSheetInfo)}\r\n          onClick={() =>\r\n            window.open(\r\n              toRootedURL(\r\n                `/Admin/PriceSheet.aspx?${toQueryString({\r\n                  periodId: queryParams.id,\r\n                  start: dateUtils.formatQueryStringDate(\r\n                    dateUtils.dateOrStringToDate(data.StartDate),\r\n                  ),\r\n                  end:\r\n                    data.EndDate === null\r\n                      ? undefined\r\n                      : dateUtils.formatQueryStringDate(\r\n                          dateUtils.dateOrStringToDate(data.EndDate),\r\n                        ),\r\n                  groupId: globalPriceSheetEnabled\r\n                    ? undefined\r\n                    : data.ServiceGroup?.Id ?? undefined,\r\n                  gName: globalPriceSheetEnabled\r\n                    ? undefined\r\n                    : data.ServiceGroup?.Name ?? undefined,\r\n                  priceBy: data.Method?.Id ?? undefined,\r\n                }).toString()}`,\r\n              ),\r\n              '_blank',\r\n            )\r\n          }\r\n          variant=\"ghost\"\r\n          shape=\"square\"\r\n        />\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    IsAdmin,\r\n    edit,\r\n    globalPriceSheetEnabled,\r\n    pricePeriod.data,\r\n    queryParams.id,\r\n    t,\r\n  ]);\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={\r\n          edit\r\n            ? t(translations.EditPriceSheetPeriod)\r\n            : t(translations.AddPriceSheetPeriod)\r\n        }\r\n        titlePage={\r\n          pricePeriod?.data\r\n            ? edit\r\n              ? ` ${t(translations.PricePeriod)} #${queryParams.id || 'N/A'}`\r\n              : ` ${t(translations.AddPricePeriod)}`\r\n            : undefined\r\n        }\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || props.isCover}\r\n        disableExpandToggle={props.isCover}\r\n        closeSidePanel={props.isCover ? onClose : handleClose}\r\n        leftTopActions={topButtons}\r\n        //leftTopActions={topActions}\r\n        //topProcessing={equipmentChangeCompleted === false}\r\n        leftActions={leftActions}\r\n        children={\r\n          pricePeriod?.data !== undefined && !processing ? (\r\n            <PricePeriodsForm\r\n              initialValues={\r\n                pricePeriod?.data || ({} as PricePeriodsDetailsState)\r\n              }\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              isEdit={edit || false}\r\n              isAdmin={IsAdmin || false}\r\n              user={User}\r\n              globalPriceSheetEnabled={globalPriceSheetEnabled}\r\n              priceEnabled={priceSheetByEnabled}\r\n              innerFormRef={innerFormRef}\r\n            />\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + 'pricePeriods/details', queryParams)}\r\n        toPageLink={`pricePeriods/details?${toQueryString(queryParams)}`}\r\n        rightActions={rightActions}\r\n        isCover={props.isCover}\r\n        cover={cover}\r\n        closeCover={props.closeCover || closeCover}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","/**\r\n *\r\n * CalendarMessagesActions\r\n *\r\n */\r\n\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: SaveFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\n","import { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\nimport { AsyncDataState, Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { toEntity } from 'utils/entity-utils';\r\n\r\n/* --- STATE --- */\r\nexport interface CalendarMessagesState {\r\n  createState: AsyncDataState<CalendarMessagesDetailsState>;\r\n  updateState: AsyncDataState<CalendarMessagesDetailsState>;\r\n  processing: boolean;\r\n}\r\n\r\nexport interface CalendarMessagesDetailsState {\r\n  Id: number;\r\n  ServiceGroup: Entity<number> | null;\r\n  Equipment: Entity<number> | null;\r\n  Title: string;\r\n  StartDate?: Date | null;\r\n  EndDate?: Date | null;\r\n  PlantDate?: Date | null;\r\n  Body?: string | null;\r\n  Description: string | null;\r\n  DisplaySeconds: number | null;\r\n  ShowOn?: string | null;\r\n}\r\n\r\nexport interface CalendarMessagesDetailsQStringParameters {\r\n  id?: string;\r\n  servGrId?: string;\r\n  servGr?: string;\r\n  eqId?: string;\r\n  eq?: string;\r\n  title?: string;\r\n  sDate?: string;\r\n  eDate?: string;\r\n  plantDate?: string;\r\n  body?: string;\r\n  desc?: string;\r\n  dispSec?: string;\r\n}\r\n\r\nexport interface CalendarMessagesDetailsResponse extends IResponseType {\r\n  Id?: number;\r\n}\r\n\r\nexport function ConvertModelToEntityCalendarMessagesDetails(\r\n  entity: ICalendarMessagesDto,\r\n): CalendarMessagesDetailsState | undefined {\r\n  if (!entity) {\r\n    return undefined;\r\n  } else {\r\n    return {\r\n      Id: entity.Id,\r\n      ServiceGroup:\r\n        entity.ServiceGroupId !== null\r\n          ? toEntity(entity.ServiceGroupId, entity.ServiceGroup)\r\n          : null,\r\n      Equipment:\r\n        entity.EquipmentId !== null\r\n          ? toEntity(entity.EquipmentId, entity.Equipment)\r\n          : null,\r\n      Title: entity.Title,\r\n      /*       StartDate: entity.StartDate ?? new Date(),\r\n      EndDate:\r\n        entity.EndDate ??\r\n        new Date(new Date().setHours(new Date().getHours() + 1)), */\r\n      StartDate:\r\n        entity.StartDate === null\r\n          ? null\r\n          : dateUtils.formatISO(\r\n              dateUtils.parseISO(entity.StartDate ?? new Date()),\r\n              {\r\n                representation: 'complete',\r\n              },\r\n            ),\r\n      EndDate:\r\n        entity.EndDate === null\r\n          ? null\r\n          : dateUtils.formatISO(\r\n              dateUtils.parseISO(\r\n                entity.EndDate ??\r\n                  new Date(new Date().setHours(new Date().getHours() + 1)),\r\n              ),\r\n              {\r\n                representation: 'complete',\r\n              },\r\n            ),\r\n      PlantDate: entity.PlantDate,\r\n      Body: entity.Body,\r\n      Description: entity.Description,\r\n      DisplaySeconds: entity.DisplaySeconds ?? 60,\r\n      ShowOn: entity.ShowOn,\r\n    } as CalendarMessagesDetailsState;\r\n  }\r\n}\r\n\r\nexport function ConvertEntityToModelCalendarMessagesDetails(\r\n  model: CalendarMessagesDetailsState,\r\n  original: CalendarMessagesDetailsState | undefined,\r\n): ICalendarMessagesDto {\r\n  let entity = {\r\n    Id: original?.Id === undefined ? model.Id : original.Id,\r\n    ServiceGroupId: model.ServiceGroup?.Id,\r\n    ServiceGroup: model.ServiceGroup?.Name,\r\n    EquipmentId: model.Equipment?.Id,\r\n    Equipment: model.Equipment?.Name,\r\n    Title: model.Title,\r\n    StartDate:\r\n      model.StartDate === null || model.StartDate === undefined\r\n        ? null\r\n        : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.StartDate)),\r\n    //model.StartDate,\r\n    EndDate:\r\n      model.EndDate === null || model.EndDate === undefined\r\n        ? null\r\n        : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.EndDate)),\r\n    //model.EndDate,\r\n    PlantDate:\r\n      model.PlantDate === null || model.PlantDate === undefined\r\n        ? null\r\n        : dateUtils.formatISO(dateUtils.dateOrStringToDate(model.PlantDate)),\r\n    //model.PlantDate,\r\n    Body: model.Body,\r\n    Description: model.Description,\r\n    DisplaySeconds: model.DisplaySeconds ?? 60,\r\n    ShowOn: model.ShowOn,\r\n  } as ICalendarMessagesDto;\r\n  return entity;\r\n}\r\n","import { CalendarMessagesDetailsQStringParameters } from 'app/pages/CalendarMessages/CalendarMessagesDetails/Details/slice/types';\r\nimport { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { httpClient } from './HttpClient';\r\n\r\nexport const CalendarMessagesApi = {\r\n  initCreateData: (payload: CalendarMessagesDetailsQStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    const url = '/api/odata/v4/CalendarMessages/InitCalendarMessages';\r\n    return httpClient.post(url, data);\r\n  },\r\n  initUpdateData: (payload: CalendarMessagesDetailsQStringParameters) => {\r\n    const data = {\r\n      params: payload,\r\n    };\r\n    console.log(data);\r\n    const url = '/api/odata/v4/CalendarMessages/InitCalendarMessages';\r\n    return httpClient.post(url, data);\r\n  },\r\n  insertCalendarMessagesDetails: (payload: ICalendarMessagesDto) => {\r\n    const url = '/api/odata/v4/CalendarMessages'; //POST action in Controller\r\n    return httpClient.post(url, payload);\r\n  },\r\n  updateCalendarMessagesDetails: (payload: ICalendarMessagesDto) => {\r\n    const url = `/api/odata/v4/CalendarMessages(${payload.Id})`; //PUT action in Controller\r\n    return httpClient.put(url, payload);\r\n  },\r\n  deleteCalendarMessagesDetails: (\r\n    rows: ICalendarMessagesDto[],\r\n  ): Promise<IResponseType> => {\r\n    const calendarMessagesIds: number[] = rows.map(item => item.Id);\r\n    const data = { calendarMessagesIds };\r\n    const url = '/api/odata/v4/CalendarMessages/DeleteCalendarMessages';\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport {\r\n  ConvertEntityToModelCalendarMessagesDetails,\r\n  CalendarMessagesDetailsQStringParameters,\r\n  CalendarMessagesDetailsResponse,\r\n  CalendarMessagesDetailsState,\r\n} from './types';\r\nimport { calendarMessagesDetailsActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\nimport { CalendarMessagesApi } from 'api/CalendarMessagesApi';\r\nimport { CalendarMessagesDetailsProps } from '..';\r\n\r\nfunction* doInitCreate(\r\n  action: PayloadAction<CalendarMessagesDetailsQStringParameters>,\r\n) {\r\n  try {\r\n    const data = yield call(CalendarMessagesApi.initCreateData, action.payload);\r\n    yield put(actions.initCalendarMessagesDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initCalendarMessagesDetails_Error(error));\r\n  }\r\n}\r\n\r\nfunction* doInitUpdate(\r\n  action: PayloadAction<CalendarMessagesDetailsQStringParameters>,\r\n) {\r\n  try {\r\n    const data = yield call(CalendarMessagesApi.initUpdateData, action.payload);\r\n    yield put(actions.initUpdateCalendarMessagesDetails_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.initUpdateCalendarMessagesDetails_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doCreate(action: PayloadAction<CalendarMessagesDetailsState>) {\r\n  const httpPayloads: ICalendarMessagesDto = ConvertEntityToModelCalendarMessagesDetails(\r\n    action.payload,\r\n    undefined,\r\n  );\r\n  try {\r\n    const result = yield call(\r\n      CalendarMessagesApi.insertCalendarMessagesDetails,\r\n      httpPayloads,\r\n    );\r\n    let response: CalendarMessagesDetailsResponse = result as CalendarMessagesDetailsResponse;\r\n\r\n    if (response.ErrorMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.ErrorMessages.map(item => {\r\n            return {\r\n              key: 'calendarMessagesInsert',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'calendarMessagesInsert',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      if (response.Id) {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'calendarMessagesInsert',\r\n            message: response.SuccessMessages[0],\r\n            messageType: SnackBarMessageType.openSidepanelDetails,\r\n            messageTypeProps: {\r\n              Id: response.Id,\r\n              created: true,\r\n              itemName: i18next.t(translations.menu_CalendarMessages),\r\n              detailsType: RenderPageType.CalendarMessagesDetails,\r\n              detailsTypeProps: {\r\n                queryParams: {\r\n                  id: '' + response.Id,\r\n                } as CalendarMessagesDetailsQStringParameters,\r\n                useSidePanel: true,\r\n              } as CalendarMessagesDetailsProps,\r\n            },\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      } else {\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            key: 'calendarMessagesInsertSuccess',\r\n            message: response.SuccessMessages[0],\r\n            variant: 'success',\r\n          }),\r\n        );\r\n        yield put(layoutActions.setRefreshTable(true));\r\n      }\r\n    }\r\n\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.createCalendarMessagesDetails_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'calendarMessagesInsert',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.createCalendarMessagesDetails_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doUpdate(\r\n  action: PayloadAction<{\r\n    current: CalendarMessagesDetailsState;\r\n    original: CalendarMessagesDetailsState | undefined;\r\n  }>,\r\n) {\r\n  const httpPayloads: ICalendarMessagesDto = ConvertEntityToModelCalendarMessagesDetails(\r\n    action.payload.current,\r\n    action.payload.original,\r\n  );\r\n  try {\r\n    const results = yield call(\r\n      CalendarMessagesApi.updateCalendarMessagesDetails,\r\n      httpPayloads,\r\n    );\r\n    let response = results as CalendarMessagesDetailsResponse;\r\n    let respErrors = response.ErrorMessages;\r\n    if (respErrors.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          respErrors.map(item => {\r\n            return {\r\n              key: 'calendarMessagesUpdateErr',\r\n              message: item,\r\n              variant: 'error',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.WarningMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotifications(\r\n          response.WarningMessages.map(item => {\r\n            return {\r\n              key: 'calendarMessagesUpdateWarn',\r\n              message: item,\r\n              variant: 'warning',\r\n            };\r\n          }),\r\n        ),\r\n      );\r\n    }\r\n    if (response.SuccessMessages.length > 0) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'calendarMessagesUpdate',\r\n          message: response.SuccessMessages[0],\r\n          messageType: SnackBarMessageType.openSidepanelDetails,\r\n          messageTypeProps: {\r\n            Id: response.Id,\r\n            created: false,\r\n            itemName: i18next.t(translations.menu_CalendarMessages),\r\n            detailsType: RenderPageType.CalendarMessagesDetails,\r\n            detailsTypeProps: {\r\n              queryParams: {\r\n                id: '' + response.Id,\r\n              } as CalendarMessagesDetailsQStringParameters,\r\n              useSidePanel: true,\r\n            } as CalendarMessagesDetailsProps,\r\n          },\r\n          variant: 'success',\r\n        }),\r\n      );\r\n      yield put(layoutActions.setRefreshTable(true));\r\n    }\r\n    let hasErrors = response.ErrorMessages.length > 0;\r\n    yield put(\r\n      actions.updateCalendarMessagesDetails_Success({\r\n        hasErrors: hasErrors,\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const message =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      ((error as AxiosError)?.response?.status === 403\r\n        ? i18next.t(translations.Forbidden)\r\n        : undefined) ??\r\n      i18next.t(translations.errormessage);\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'calendarMessagesUpdateErr',\r\n        message: message,\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.updateCalendarMessagesDetails_Error(Error));\r\n  }\r\n}\r\n\r\nexport function* calendarMessagesDetailsSaga() {\r\n  yield takeLatest(actions.initCalendarMessagesDetails.type, doInitCreate);\r\n  yield takeLatest(\r\n    actions.initUpdateCalendarMessagesDetails.type,\r\n    doInitUpdate,\r\n  );\r\n  yield takeLatest(actions.createCalendarMessagesDetails.type, doCreate);\r\n  yield takeLatest(actions.updateCalendarMessagesDetails.type, doUpdate);\r\n}\r\n","import {\r\n  CalendarMessagesDetailsQStringParameters,\r\n  CalendarMessagesDetailsState,\r\n  CalendarMessagesState,\r\n  ConvertModelToEntityCalendarMessagesDetails,\r\n} from './types';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport { calendarMessagesDetailsSaga } from './saga';\r\nimport { ICalendarMessagesDto } from 'app/pages/CalendarMessages/CalendarMessagesPage/ICalendarMessagesDto';\r\n\r\nexport const initialState: CalendarMessagesState = {\r\n  processing: false,\r\n  createState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n  updateState: {\r\n    data: undefined,\r\n    processing: undefined,\r\n    completed: undefined,\r\n    hasErrors: undefined,\r\n  },\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'calendarMessagesDetail',\r\n  initialState,\r\n  reducers: {\r\n    initCalendarMessagesDetails(\r\n      state,\r\n      action: PayloadAction<CalendarMessagesDetailsQStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initUpdateCalendarMessagesDetails(\r\n      state,\r\n      action: PayloadAction<CalendarMessagesDetailsQStringParameters>,\r\n    ) {\r\n      state.processing = true;\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    initCalendarMessagesDetails_Success(\r\n      state,\r\n      action: PayloadAction<ICalendarMessagesDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.createState.data = ConvertModelToEntityCalendarMessagesDetails(\r\n        action.payload,\r\n      );\r\n    },\r\n    initUpdateCalendarMessagesDetails_Success(\r\n      state,\r\n      action: PayloadAction<ICalendarMessagesDto>,\r\n    ) {\r\n      state.processing = false;\r\n      state.updateState.data = ConvertModelToEntityCalendarMessagesDetails(\r\n        action.payload,\r\n      );\r\n    },\r\n    initCalendarMessagesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    initUpdateCalendarMessagesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.processing = false;\r\n    },\r\n    //====================================================================\r\n    resetUpdateCalendarMessagesDetailsState(state, action: PayloadAction) {\r\n      state.updateState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    resetCreateCalendarMessagesDetailsState(state, action: PayloadAction) {\r\n      state.createState = {\r\n        data: undefined,\r\n        processing: undefined,\r\n        completed: undefined,\r\n        hasErrors: undefined,\r\n      };\r\n    },\r\n    //====================================================================\r\n    updateCalendarMessagesDetails(\r\n      state,\r\n      action: PayloadAction<{\r\n        current: CalendarMessagesDetailsState;\r\n        original: CalendarMessagesDetailsState | undefined;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = true;\r\n      state.updateState.completed = undefined;\r\n      state.updateState.hasErrors = undefined;\r\n    },\r\n    updateCalendarMessagesDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.updateState.processing = false;\r\n      state.updateState.hasErrors = action.payload.hasErrors;\r\n      state.updateState.completed = true;\r\n    },\r\n    updateCalendarMessagesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.updateState.processing = false;\r\n      state.updateState.completed = true;\r\n      state.updateState.hasErrors = true;\r\n    },\r\n    //====================================================================\r\n    createCalendarMessagesDetails(\r\n      state,\r\n      action: PayloadAction<CalendarMessagesDetailsState>,\r\n    ) {\r\n      state.createState.processing = true;\r\n      state.createState.completed = undefined;\r\n      state.createState.hasErrors = undefined;\r\n    },\r\n    createCalendarMessagesDetails_Success(\r\n      state,\r\n      action: PayloadAction<{\r\n        hasErrors: boolean;\r\n      }>,\r\n    ) {\r\n      state.createState.processing = false;\r\n      state.createState.hasErrors = action.payload.hasErrors;\r\n      state.createState.completed = true;\r\n    },\r\n    createCalendarMessagesDetails_Error(state, action: PayloadAction<any>) {\r\n      state.createState.processing = false;\r\n      state.createState.completed = true;\r\n      state.createState.hasErrors = true;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: calendarMessagesDetailsActions } = slice;\r\n\r\nexport const useCalendarMessagesDetailsSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: calendarMessagesDetailsSaga });\r\n  return { actions: slice.actions };\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.calendarMessagesDetail || initialState;\r\n\r\nexport const selectCalendarMessagesDetails = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n//====================================================================\r\nexport const selectCreateCalendarMessagesDetails = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.createState.data,\r\n);\r\n\r\nexport const selectCreateCalendarMessagesDetailsCompleted = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.createState.completed,\r\n);\r\n\r\nexport const selectCreateCalendarMessagesDetailsHasError = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.createState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectUpdateCalendarMessagesDetails = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.updateState.data,\r\n);\r\n\r\nexport const selectUpdateCalendarMessagesDetailsCompleted = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.updateState.completed,\r\n);\r\nexport const selectUpdateCalendarMessagesDetailsHasError = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.updateState.hasErrors,\r\n);\r\n//====================================================================\r\nexport const selectCalendarMessagesDetailsProcessing = createSelector(\r\n  [selectCalendarMessagesDetails],\r\n  state => state.processing,\r\n);\r\n","import * as React from 'react';\r\nimport { useCallback, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { CalendarMessagesDetailsState } from '../slice/types';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { FormOnlineServicesSinglePicker } from 'app/components/Forms/FormEquipmentsPicker';\r\nimport { ServiceGroupFilter } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { FormListener } from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { BaseOptionsMultiPicker } from 'app/components/BasicPickers/BaseOptionsMultiPicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { undefinedIfIsEmpty } from 'app/components/BasicTable/useProfileSetting/parseProfileUrl';\r\nimport { Entity } from 'types/common';\r\nimport { FormBookitDateTimePicker } from 'app/components/Forms/FormBookitDateTimePicker';\r\n\r\nexport interface CalendarMessagesFormProps {\r\n  initialValues: CalendarMessagesDetailsState;\r\n  onSubmit: (item: CalendarMessagesDetailsState) => void;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  bindSubmitForm: any;\r\n}\r\n\r\nexport const CalendarMessagesForm = React.memo(function CalendarMessagesForm({\r\n  initialValues,\r\n  onSubmit,\r\n  isEdit,\r\n  isAdmin,\r\n  bindSubmitForm,\r\n}: CalendarMessagesFormProps): JSX.Element {\r\n  //SETTINGS\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const initValues = React.useMemo(() => {\r\n    if (isEdit) return initialValues;\r\n    return { ...initialValues, StartDate: newDate(), EndDate: newDate() };\r\n  }, [initialValues, isEdit, newDate]);\r\n\r\n  //STATES\r\n  const [IsServiceGroupChanged, setIsServiceGroupChanged] = useState<boolean>(\r\n    false,\r\n  );\r\n  const [IsEquipmentChanged, setIsEquipmentChanged] = useState<boolean>(false);\r\n\r\n  //FUNCTIONS\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n\r\n  const handleFormChange = useCallback(\r\n    (values: CalendarMessagesDetailsState, isValid, dirty, setValue) => {\r\n      if (IsServiceGroupChanged) {\r\n        setValue('Equipment', null, false);\r\n      }\r\n      if (IsEquipmentChanged) {\r\n        setValue('ServiceGroup', null, false);\r\n      }\r\n      setIsServiceGroupChanged(false);\r\n      setIsEquipmentChanged(false);\r\n    },\r\n    [IsEquipmentChanged, IsServiceGroupChanged],\r\n  );\r\n\r\n  //SCHEMA\r\n  const calendarMessagesDetailsSchema: Yup.SchemaOf<CalendarMessagesDetailsState> = Yup.object(\r\n    {\r\n      Id: Yup.number().notRequired().default(-1),\r\n      ServiceGroup: Yup.mixed()\r\n        .nullable()\r\n        .label(i18next.t(translations.Laboratory)),\r\n      Equipment: Yup.mixed()\r\n        .nullable()\r\n        .label(i18next.t(translations.Equipment)),\r\n      Title: Yup.string()\r\n        .nullable()\r\n        .default('')\r\n        .required()\r\n        //.required(i18next.t(translations.err_AttributeRequired))\r\n        .label(i18next.t(translations.Title)),\r\n      StartDate: Yup.date()\r\n        .default(newDate())\r\n        .nullable()\r\n        .notRequired()\r\n        .label(i18next.t(translations.StartDate)),\r\n      EndDate: Yup.date()\r\n        .default(newDate())\r\n        .nullable()\r\n        .notRequired()\r\n        .label(i18next.t(translations.EndDate)),\r\n      PlantDate: Yup.date()\r\n        .nullable()\r\n        .notRequired()\r\n        .label(i18next.t(translations.PlantDate)),\r\n      Body: Yup.string()\r\n        .nullable()\r\n        .default('')\r\n        .label(i18next.t(translations.Body)),\r\n      Description: Yup.string()\r\n        .default('')\r\n        .nullable()\r\n        .notRequired()\r\n        .label(i18next.t(translations.Description)),\r\n      DisplaySeconds: Yup.number()\r\n        .notRequired()\r\n        .default(60)\r\n        .label(i18next.t(translations.Group)),\r\n      ShowOn: Yup.string()\r\n        .default(null)\r\n        .nullable()\r\n        .required('Please select at least one option for Show On.')\r\n        .label('Show on'),\r\n    },\r\n  );\r\n  const getDisabledInfo = useCallback(\r\n    (entity: Entity<string>) => {\r\n      const id = entity.Id;\r\n      if (\r\n        id === 'system' &&\r\n        !authenticatedUser?.Roles.includes(Roles.Administrators)\r\n      ) {\r\n        return 'Disabled: You need to be a main admin';\r\n      }\r\n      if (\r\n        id === 'core' &&\r\n        !authenticatedUser?.Roles.includes(Roles.GroupAdministrators)\r\n      ) {\r\n        return 'Disabled: You need to be a core admin';\r\n      }\r\n      return undefined;\r\n    },\r\n    [authenticatedUser?.Roles],\r\n  );\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <Formik\r\n        initialValues={initValues}\r\n        validationSchema={calendarMessagesDetailsSchema}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('Submitting: ', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            //console.log('User Attributes Details Errors: ', formik.errors);\r\n          }\r\n          return (\r\n            <>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['ServiceGroup', 'Equipment']}\r\n                />\r\n                <FormLeftSection>\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.Details) as string}\r\n                  >\r\n                    <FormFieldsSection>\r\n                      <FormRow fullRow>\r\n                        <BaseOptionsMultiPicker\r\n                          getOptions={search => {\r\n                            return options.filter(o => {\r\n                              if (!!getDisabledInfo(o)) return false;\r\n                              if ((search ?? '') === '') return true;\r\n                              return o.Name.includes(search ?? '');\r\n                            });\r\n                          }}\r\n                          onChange={val => {\r\n                            formik.setFieldValue(\r\n                              'ShowOn',\r\n                              undefinedIfIsEmpty(val?.map(o => o.Id).join(',')),\r\n                            );\r\n                          }}\r\n                          value={\r\n                            formik.values.ShowOn?.split(',')\r\n                              .map(o => options.find(f => f.Id === o))\r\n                              .filter(f => f !== undefined) as Entity<string>[]\r\n                          }\r\n                          placeholder=\"Select where to show\"\r\n                          disabled={formik.isSubmitting}\r\n                          label=\"Show on\"\r\n                          fullWidth\r\n                          variant=\"filled\"\r\n                          error={!!formik.errors.ShowOn}\r\n                          helperText={formik.errors.ShowOn}\r\n                        />\r\n                      </FormRow>\r\n                    </FormFieldsSection>\r\n                    <FormRow fullRow>\r\n                      <FormServiceGroupPicker\r\n                        id=\"ServiceGroupID\"\r\n                        name=\"ServiceGroup\"\r\n                        placeholder={t(translations.AllServiceGroups)}\r\n                        label={t(translations.ServiceGroup)}\r\n                        disabled={formik.isSubmitting}\r\n                        urlType=\"admin\"\r\n                        onChange={() => setIsServiceGroupChanged(true)}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormOnlineServicesSinglePicker\r\n                        id=\"EquipmentID\"\r\n                        name=\"Equipment\"\r\n                        fullWidth\r\n                        placeholder={t(translations.Equipment)}\r\n                        label={t(translations.Equipment)}\r\n                        onChange={() => setIsEquipmentChanged(true)}\r\n                        disabled={formik.isSubmitting}\r\n                        predicates={ServiceGroupFilter(\r\n                          formik.values.ServiceGroup?.Id,\r\n                        )}\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        id=\"TitleID\"\r\n                        name=\"Title\"\r\n                        label={t(translations.Title)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow>\r\n                      <FormRichTextField\r\n                        id=\"BodyID\"\r\n                        name=\"Body\"\r\n                        placeholder={t(translations.Body)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormBookitDateTimePicker\r\n                        id=\"StartDateID\"\r\n                        name=\"StartDate\"\r\n                        // label={t(translations.StartDate)}\r\n                        label={t(translations.From)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow>\r\n                      <FormBookitDateTimePicker\r\n                        id=\"EndDateID\"\r\n                        name=\"EndDate\"\r\n                        // label={t(translations.CalendarMessagesEndDate)}\r\n                        label={t(translations.To)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n                {/* <FormRightSection>\r\n                  <FormFieldsSection>\r\n                    <FormRow fullRow>\r\n                      <FormNumberField\r\n                        id=\"DisplaySeconds\"\r\n                        name=\"DisplaySeconds\"\r\n                        inputMode=\"decimal\"\r\n                        label={t(translations.DisplaySeconds)}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormRightSection> */}\r\n              </StyledForm>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n\r\nconst options = [\r\n  { Id: 'system', Name: 'System Dashboard' },\r\n  { Id: 'core', Name: 'Core Dashboard' },\r\n  { Id: 'calendar', Name: 'Schedule' },\r\n];\r\n","import Box from '@material-ui/core/Box';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectHasNotSavedChanges,\r\n  selectContinueToLink,\r\n  selectConfirmApproved,\r\n  selectConfirmRejected,\r\n  selectContinueState,\r\n} from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { push } from 'connected-react-router';\r\nimport { translations } from 'locales/translations';\r\nimport { Fragment, useCallback, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { SaveFormButton } from './Actions/CalendarMessagesActions';\r\nimport { useCalendarMessagesDetailsSlice } from './slice';\r\nimport {\r\n  selectCalendarMessagesDetailsProcessing,\r\n  selectCreateCalendarMessagesDetailsCompleted,\r\n  selectUpdateCalendarMessagesDetailsCompleted,\r\n  selectCreateCalendarMessagesDetails,\r\n  selectUpdateCalendarMessagesDetails,\r\n} from './slice/selectors';\r\nimport {\r\n  CalendarMessagesDetailsQStringParameters,\r\n  CalendarMessagesDetailsState,\r\n} from './slice/types';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { CalendarMessagesForm } from './CalendarMessagesForm';\r\n\r\nexport interface CalendarMessagesDetailsProps {\r\n  useSidePanel: boolean;\r\n  queryParams: CalendarMessagesDetailsQStringParameters;\r\n}\r\n\r\nexport function CalendarMessagesDetails(\r\n  props: CalendarMessagesDetailsProps,\r\n): JSX.Element {\r\n  //PROPS\r\n  const { queryParams, useSidePanel } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n\r\n  //PERMISSIONS\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const IsAdmin =\r\n    User !== undefined && User.Roles.includes(Roles.Administrators);\r\n\r\n  //SLICES\r\n  const { actions } = useCalendarMessagesDetailsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n\r\n  //SELECTORS\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  //====================================================================\r\n  const hasUnsavedChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n  const continueLink = useSelector(selectContinueToLink);\r\n  const loading = useSelector(selectCalendarMessagesDetailsProcessing);\r\n  //====================================================================\r\n  const confirmRejected = useSelector(selectConfirmRejected);\r\n  const confirmApproved = useSelector(selectConfirmApproved);\r\n  const continueToOther = useSelector(selectContinueState);\r\n  //====================================================================\r\n  const requestCreateCompleted = useSelector(\r\n    selectCreateCalendarMessagesDetailsCompleted,\r\n  );\r\n  const requestUpdateCompleted = useSelector(\r\n    selectUpdateCalendarMessagesDetailsCompleted,\r\n  );\r\n  //====================================================================\r\n  const createModel = useSelector(\r\n    selectCreateCalendarMessagesDetails,\r\n    shallowEqual,\r\n  );\r\n  const editModel = useSelector(\r\n    selectUpdateCalendarMessagesDetails,\r\n    shallowEqual,\r\n  );\r\n  const baseModel = createModel || editModel;\r\n  //====================================================================\r\n\r\n  //STATES\r\n  const [edit, setEdit] = useState<boolean>(false);\r\n  const [busy, setBusy] = useState<boolean>(false);\r\n  const [requestCompleted, setRequestCompleted] = useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n\r\n  //REF\r\n  const submitFormRef = useRef<any>(null);\r\n\r\n  //FUNCTIONS\r\n  const bindSubmitForm = useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n\r\n  const handleSaveClick = (e: any) => {\r\n    handleSubmitForm(e);\r\n  };\r\n\r\n  const handleSubmit = useCallback(\r\n    (values: CalendarMessagesDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateCalendarMessagesDetails({\r\n            current: values,\r\n            original: baseModel,\r\n          }),\r\n        );\r\n      } else {\r\n        let value = values as CalendarMessagesDetailsState;\r\n        console.debug('Data: ', value);\r\n        dispatch(actions.createCalendarMessagesDetails(values));\r\n      }\r\n    },\r\n    [actions, baseModel, dispatch, edit],\r\n  );\r\n\r\n  const handleCancelClick = useCallback(() => {\r\n    if (useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    } else {\r\n      dispatch(push('/CalendarMessages'));\r\n    }\r\n    if (edit) {\r\n      dispatch(actions.resetUpdateCalendarMessagesDetailsState());\r\n    } else {\r\n      dispatch(actions.resetCreateCalendarMessagesDetailsState());\r\n    }\r\n  }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n  const handleClose = () => {\r\n    if (hasUnsavedChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCancelClick();\r\n    }\r\n  };\r\n\r\n  //USE EFFECT ON MOUNT\r\n  useEffectOnMount(() => {\r\n    if (\r\n      queryParams.id !== undefined &&\r\n      !isNaN(parseInt(queryParams.id || ''))\r\n    ) {\r\n      dispatch(actions.initUpdateCalendarMessagesDetails(queryParams));\r\n    } else {\r\n      dispatch(actions.initCalendarMessagesDetails(queryParams));\r\n    }\r\n    setBusy(false);\r\n    setEdit(false);\r\n    setRequestCompleted(undefined);\r\n    return () => {};\r\n  });\r\n\r\n  //USE EFFECT\r\n  useEffect(() => {\r\n    let active = loading === false;\r\n    if (active) {\r\n      if (queryParams.id !== undefined && !isNaN(parseInt(queryParams.id))) {\r\n        setEdit(true);\r\n      }\r\n      if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n      } else if (\r\n        requestCreateCompleted === false ||\r\n        requestUpdateCompleted === false\r\n      ) {\r\n        setRequestCompleted(false);\r\n        setBusy(false);\r\n      }\r\n      if (requestUpdateCompleted === true || requestCreateCompleted === true) {\r\n        handleCancelClick();\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    handleCancelClick,\r\n    loading,\r\n    queryParams.id,\r\n    requestCreateCompleted,\r\n    requestUpdateCompleted,\r\n  ]);\r\n\r\n  //USE EFFECT 2\r\n  useEffect(() => {\r\n    if (confirmApproved) {\r\n      if (edit) {\r\n        dispatch(actions.resetUpdateCalendarMessagesDetailsState());\r\n      } else {\r\n        dispatch(actions.resetCreateCalendarMessagesDetailsState());\r\n      }\r\n      if (continueToOther.continueOnApprove) {\r\n        dispatch(layoutActions.resetSidePanel());\r\n        setTimeout(() => {\r\n          dispatch(\r\n            layoutActions.openSidePanel({\r\n              type: continueToOther.pageType,\r\n              props: continueToOther.pageProps,\r\n              expanded: continueToOther.expanded,\r\n            }),\r\n          );\r\n          dispatch(layoutActions.resetContinueState());\r\n        }, 200);\r\n      } else if (continueLink !== undefined) {\r\n        dispatch(appSettingsActions.navigate(continueLink));\r\n        dispatch(layoutActions.resetSidePanel());\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n    }\r\n    if (confirmRejected) {\r\n      dispatch(layoutActions.resetConfirmState());\r\n    }\r\n    return () => undefined;\r\n  }, [\r\n    actions,\r\n    appSettingsActions,\r\n    confirmApproved,\r\n    confirmRejected,\r\n    continueLink,\r\n    continueToOther,\r\n    dispatch,\r\n    edit,\r\n    layoutActions,\r\n  ]);\r\n\r\n  //LEFT ACTIONS\r\n  const leftActions = [\r\n    () => (\r\n      <Fragment>\r\n        <SaveFormButton\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"save\" />}\r\n          onClick={handleSaveClick}\r\n          disabled={busy}\r\n          processing={!requestCompleted && busy}\r\n          edit={edit}\r\n          text={t(translations.Save)}\r\n        />\r\n      </Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n\r\n  //RIGHT ACTIONS\r\n  const rightActions = [\r\n    () => (\r\n      <Fragment>\r\n        <Button\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={handleCancelClick}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </Fragment>\r\n    ),\r\n  ] as ActionRenderer[];\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <PageWrapper\r\n        pageName={\r\n          edit\r\n            ? t(translations.Announcement)\r\n            : t(translations.AddNewAnnouncement)\r\n        }\r\n        titlePage={\r\n          baseModel\r\n            ? edit\r\n              ? ` ${t(translations.Announcement)} #${queryParams.id || 'N/A'}`\r\n              : ` ${t(translations.AddNewAnnouncement)}`\r\n            : undefined\r\n        }\r\n        loading={loading}\r\n        disableExpandToggle={true}\r\n        useSidePanel={useSidePanel}\r\n        leftActions={leftActions}\r\n        rightActions={rightActions}\r\n        closable={true}\r\n        closeSidePanel={handleClose}\r\n        pageLink={buildURL(\r\n          publicUrl + 'CalendarMessages/details',\r\n          props.queryParams,\r\n        )}\r\n        toPageLink={`CalendarMessages/details?${toQueryString(\r\n          props.queryParams,\r\n        )}`}\r\n        children={\r\n          baseModel !== undefined && !loading ? (\r\n            <Fragment>\r\n              <CalendarMessagesForm\r\n                initialValues={\r\n                  baseModel || ({} as CalendarMessagesDetailsState)\r\n                }\r\n                bindSubmitForm={bindSubmitForm}\r\n                onSubmit={handleSubmit}\r\n                isEdit={edit}\r\n                isAdmin={IsAdmin}\r\n              />\r\n            </Fragment>\r\n          ) : (\r\n            <Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={loading} size={80} />\r\n              </Box>\r\n            </Fragment>\r\n          )\r\n        }\r\n      />\r\n      {hasUnsavedChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\n\r\nimport { CampusPickerFilter } from 'app/components/BasicTable/Filters/CampusPickerFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport { RoomPickerFilter } from 'app/components/BasicTable/Filters/RoomPickerFilter';\r\n\r\nimport { TagsFilter } from 'app/components/BasicTable/Filters/TagsFilter';\r\nimport { LoanableFilter } from 'app/components/BasicTable/Filters/LoanableFilter';\r\nimport { StatusFilter } from 'app/components/BasicTable/Filters/StatusFilter';\r\nimport { LockersFilter } from 'app/components/BasicTable/Filters/LockersFilter';\r\nimport { AssetCatGroupFilter } from 'app/components/BasicTable/Filters/AssetCatGroupFilter';\r\nimport { AssetCatFilter } from 'app/components/BasicTable/Filters/AssetCatFilter';\r\nimport {\r\n  arrayToQueryString,\r\n  assetRangeSerializer,\r\n  getAssetRange,\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  GetDateOrUndefined,\r\n  getNumberEntityArray,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  getStringEntityArray,\r\n  GetStringOrUndefined,\r\n  initExPickerValue,\r\n  initMultiExPickerValue,\r\n  initMultiPickerValue,\r\n  initPickerValue,\r\n  URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initCampusData } from 'app/components/pickers/AutocompletePickers/CampusPicker';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport { initRoomData } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport { initLockersData } from 'app/components/pickers/AutocompletePickers/LockersPicker';\r\nimport { initTagsData } from 'app/components/pickers/AutocompletePickers/TagsPicker';\r\nimport { initAssetCatData } from 'app/components/pickers/AutocompletePickers/AssetCatPicker';\r\nimport { initAssetCatGroupData } from 'app/components/pickers/AutocompletePickers/AssetCatGroupPicker';\r\nimport { initLoanableData } from 'app/components/pickers/AutocompletePickers/LoanablePicker';\r\nimport { IsAssetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { initStatusData } from 'app/components/pickers/AutocompletePickers/StatusPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\nimport { CustomDate } from 'types/CustomDate';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport {\r\n  DatePickerFilter,\r\n  TextFieldFilter,\r\n} from 'app/components/BasicTable/Filters';\r\nimport { initAssetMultiData } from 'app/components/pickers/AutocompletePickers/AssetMultiPicker';\r\nimport { AssetMultiFilter } from 'app/components/BasicTable/Filters/AssetMultiFilter';\r\nimport { AssetTypesFilter } from 'app/components/BasicTable/Filters/AssemblyTypesFilter';\r\nimport { initAssemblyTypeData } from 'app/components/pickers/StaticOptionsPickers/AssemblyTypePicker';\r\nimport { AreasFilter } from 'app/components/BasicTable/Filters/AreasFilter';\r\nimport { initAreasData } from 'app/components/pickers/AutocompletePickers/AreassPicker';\r\nimport { initLocationData } from 'app/components/pickers/AutocompletePickers/LocationPicker';\r\nimport { LocationPickerFilter } from 'app/components/BasicTable/Filters/LocationPickerFilter';\r\nimport { SubLocationFilter } from 'app/components/BasicTable/Filters/SubLocationListFilter';\r\nimport { initSubLocationListData } from 'app/components/pickers/AutocompletePickers/SubLocationListPicker';\r\nimport {\r\n  initInstrumentCatData,\r\n  InstrumentCatFilter,\r\n} from 'app/components/BasicTable/Filters/InstrumentCatFilter';\r\nimport { OnlineServiceTypeFilter } from 'app/components/BasicTable/Filters/OnlineServiceTypeFilter';\r\nimport { initOnlineServiceTypeData } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\nimport { initUserMultiData } from 'app/components/pickers/AutocompletePickers/UserMultiPicker';\r\nimport UserAssetContactMultiFilter from 'app/components/BasicTable/Filters/UserAssetContactMultiFilter';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { initMyAssetAvailabilityTypeMultiData } from 'app/components/pickers/AutocompletePickers/MyAssetAvailabilityTypeMultiPicker';\r\nimport {\r\n  assetRangeCustomFilter,\r\n  assetRangeDisplay,\r\n  AssetRangeFilter,\r\n  initAssetRangeData,\r\n} from 'app/components/BasicTable/Filters/AssetRangeFilter';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { AvailabilityTypeAvailableMultiFilter } from 'app/components/BasicTable/Filters/MyAssetAvailabilityTypeMultiPickerFilter';\r\nimport ServiceTypeEnumFilter from 'app/components/BasicTable/Filters/ServiceTypeEnumFilter';\r\nimport { initServiceTypeEnumData } from 'app/components/pickers/StaticOptionsPickers/ServiceTypeEnumPicker';\r\nimport ExtraDDLFilter from 'app/components/BasicTable/Filters/ExtraDDLFilter';\r\nimport { initExtraDDLData } from 'app/components/pickers/AutocompletePickers/ExtraddlPicker';\r\nimport { SuperGroupFilter } from 'app/components/BasicTable/Filters/SuperGroupFilter';\r\nimport { initSuperGroupData } from 'app/components/pickers/AutocompletePickers/SuperGroupPicker';\r\nimport { initRegionData } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\nimport RegionFilter from 'app/components/BasicTable/Filters/RegionFilter';\r\n\r\nexport const GetFilters: GetPageFilters<IMyAssetsRow> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const myAssetsDefaultFilters: string[] = [\r\n    ...(settings as GlobalSettings)\r\n      .GetString(AllowedSettings.AdvancedAssetSearchFilterAttributes)\r\n      .split(','),\r\n  ];\r\n\r\n  const params = new URLSearchParamsCI(search);\r\n  var result: IFilterSettings<IMyAssetsRow>[] = [\r\n    {\r\n      fieldName: 'Id',\r\n      queryStringSerializer: arrayToQueryString('aid'),\r\n      displayName: t(translations.AssetName), //(displayed as Resource Name)\r\n      operator: ODataOperators.Includes,\r\n      value: getNumberEntityArray(params, 'aid'),\r\n      initData: initMultiPickerValue(initAssetMultiData),\r\n      component: AssetMultiFilter,\r\n      urlKey: 'aid',\r\n    },\r\n    {\r\n      fieldName: 'CampusId',\r\n      displayName: t(translations.Campus),\r\n      queryStringSerializer: 'CampusId',\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'CampusId')),\r\n      ),\r\n      initData: initPickerValue(initCampusData),\r\n      component: CampusPickerFilter,\r\n    },\r\n    {\r\n      fieldName: 'LocationId',\r\n      queryStringSerializer: 'LocationId',\r\n      displayName: t(translations.LocationsList),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'LocationId')),\r\n      ),\r\n      initData: initPickerValue(initLockersData),\r\n      component: LockersFilter,\r\n    },\r\n    {\r\n      fieldName: 'AssetRecordDate',\r\n      queryStringSerializer: 'AssetRecordDate',\r\n      displayName: t(translations.CreatedSince),\r\n      operator: ODataOperators.GreaterThanEqual,\r\n      defaultValue: new CustomDate(),\r\n      value: GetDateOrUndefined(GetRawValue(params, 'AssetRecordDate'), 'date'),\r\n      component: DatePickerFilter,\r\n    },\r\n    {\r\n      fieldName: 'Active',\r\n      queryStringSerializer: 'active',\r\n      displayName: t(translations.ActiveAssets),\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'active')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n    },\r\n    {\r\n      fieldName: 'InstrumentTypeId',\r\n      queryStringSerializer: 'typeId',\r\n      displayName: t(translations.InstrumentType),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'typeId')),\r\n      ),\r\n      initData: initPickerValue(initAssemblyTypeData),\r\n      component: AssetTypesFilter,\r\n    },\r\n    {\r\n      fieldName: 'OperationTypeID',\r\n      queryStringSerializer: 'OperationTypeID',\r\n      displayName: t(translations.OperationType),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'OperationTypeID')),\r\n      ),\r\n      customFilter: (value, setting) => {\r\n        return `${new Condition(\r\n          'AutoMode',\r\n          ODataOperators.Equals,\r\n          1,\r\n        ).toString()} and ${new Condition(\r\n          setting.fieldName,\r\n          ODataOperators.Equals,\r\n          value,\r\n        ).toString()}`;\r\n      },\r\n      initData: initPickerValue(initOnlineServiceTypeData),\r\n      component: OnlineServiceTypeFilter,\r\n    },\r\n    {\r\n      fieldName: 'RoomAreaId',\r\n      queryStringSerializer: 'areaId',\r\n      displayName: t(translations.Areas),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'areaId')),\r\n      ),\r\n      initData: initPickerValue(initAreasData),\r\n      component: AreasFilter,\r\n    },\r\n    {\r\n      fieldName: 'LocationId',\r\n      queryStringSerializer: 'locationid',\r\n      displayName: t(translations.LocationList),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'locationid')),\r\n      ),\r\n      initData: initPickerValue(initLocationData),\r\n      component: LocationPickerFilter,\r\n    },\r\n    {\r\n      fieldName: 'SubLocationId',\r\n      queryStringSerializer: 'sublocationid',\r\n      displayName: t(translations.SubLocationsList),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'sublocationid')),\r\n      ),\r\n      initData: initPickerValue(initSubLocationListData),\r\n      component: SubLocationFilter,\r\n    },\r\n    {\r\n      fieldName: 'InstrumentCatId',\r\n      displayName: t(translations.InstrumentCat),\r\n      queryStringSerializer: 'instrumentCatId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'instrumentCatId')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: InstrumentCatFilter,\r\n      initData: initPickerValue(initInstrumentCatData),\r\n    },\r\n    {\r\n      fieldName: 'StatusId',\r\n      queryStringSerializer: 'StatusId',\r\n      displayName: t(translations.Status),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'StatusId')),\r\n      ),\r\n      initData: initPickerValue(initStatusData),\r\n      component: StatusFilter,\r\n    },\r\n    {\r\n      fieldName: 'ApprovalRequired',\r\n      queryStringSerializer: 'approval',\r\n      displayName: t(translations.ApprovalRequired),\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'approval')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n    },\r\n  ];\r\n  if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n    result.push({\r\n      fieldName: 'DivisionId',\r\n      displayName: t(translations.Division),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'divid',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'divid')),\r\n      ),\r\n      component: SuperGroupFilter,\r\n      initData: initExPickerValue(initSuperGroupData, undefined, 'base'),\r\n      urlType: 'base',\r\n      urlKey: 'divid',\r\n    });\r\n    result.push({\r\n      fieldName: 'RegionId',\r\n      displayName: t(translations.Region),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'regionid',\r\n      initData: initExPickerValue(initRegionData, undefined, 'base'),\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'regionid')),\r\n      ),\r\n      component: RegionFilter,\r\n      urlType: 'base',\r\n    });\r\n  }\r\n  if (IsModuleEnabled(appSettings, KnownModules.LocationTracking)) {\r\n    result.push({\r\n      fieldName: 'LocationUpdatedAt',\r\n      queryStringSerializer: 'locationNotUpdatedSince',\r\n      displayName: t(translations.LocationNotUpdatedSince),\r\n      operator: ODataOperators.LessThan,\r\n      defaultValue: new CustomDate(),\r\n      value: GetDateOrUndefined(\r\n        GetRawValue(params, 'locationNotUpdatedSince'),\r\n        'date',\r\n      ),\r\n      component: DatePickerFilter,\r\n    });\r\n  }\r\n  if (\r\n    IsModuleEnabled(appSettings, KnownModules.LoanDesk) &&\r\n    myAssetsDefaultFilters.includes('Loanable')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'LoanTypeId',\r\n      queryStringSerializer: 'LoanTypeId',\r\n      displayName: t(translations.Loanable),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'loantypeId')),\r\n      ),\r\n      initData: initPickerValue(initLoanableData),\r\n      component: LoanableFilter,\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('Tags')) {\r\n    result.push({\r\n      fieldName: 'TagsText',\r\n      queryStringSerializer: arrayToQueryString('TagsText'),\r\n      displayName: t(translations.Tags),\r\n      operator: ODataOperators.ContainsM,\r\n      value: getNumberEntityArray(params, 'TagsText'),\r\n      initData: initMultiPickerValue(initTagsData),\r\n      component: TagsFilter,\r\n      urlKey: 'TagsText',\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('AssetCatGroup')) {\r\n    result.push({\r\n      fieldName: 'AssetCatGroupId',\r\n      queryStringSerializer: 'AssetCatGroupId',\r\n      displayName: t(translations.AssetCatGroupName),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'AssetCatGroupId')),\r\n      ),\r\n      initData: initPickerValue(initAssetCatGroupData),\r\n      component: AssetCatGroupFilter,\r\n      urlType: 'assetBase',\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('AssetCat')) {\r\n    result.push({\r\n      fieldName: 'AssetCatId',\r\n      queryStringSerializer: 'AssetCatId',\r\n      displayName: t(translations.AssetCatName),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'AssetCatId')),\r\n      ),\r\n      initData: initPickerValue(initAssetCatData),\r\n      component: AssetCatFilter,\r\n      urlType: 'assetBase',\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('Building')) {\r\n    result.push({\r\n      fieldName: 'BuildingId',\r\n      displayName: t(translations.Building),\r\n      queryStringSerializer: 'BuildingId',\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'BuildingId')),\r\n      ),\r\n      initData: initPickerValue(initBuildingData),\r\n      component: BuildingPickerFilter,\r\n      urlType: 'assetBase',\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('Room')) {\r\n    result.push({\r\n      fieldName: 'RoomId',\r\n      queryStringSerializer: 'RoomId',\r\n      displayName: t(translations.Room),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'RoomId')),\r\n      ),\r\n      initData: initPickerValue(initRoomData),\r\n      component: RoomPickerFilter,\r\n    });\r\n  }\r\n  //if (myAssetsDefaultFilters.includes('Availability')) {\r\n  result.push({\r\n    fieldName: 'AvailabilityTypeId',\r\n    queryStringSerializer: arrayToQueryString('AvailabilityTypeId'),\r\n    displayName: t(translations.AvailabilityType),\r\n    operator: ODataOperators.Includes,\r\n    value: getNumberEntityArray(params, 'AvailabilityTypeId'),\r\n    initData: initMultiPickerValue(initMyAssetAvailabilityTypeMultiData),\r\n    component: AvailabilityTypeAvailableMultiFilter,\r\n    urlKey: 'AvailabilityTypeId',\r\n  });\r\n  result.push({\r\n    fieldName: 'ServiceTypeId',\r\n    queryStringSerializer: 'stid',\r\n    displayName: t(translations.ResourceServiceType),\r\n    operator: ODataOperators.Equals,\r\n    value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'stid'))),\r\n    initData: initPickerValue(initServiceTypeEnumData),\r\n    component: ServiceTypeEnumFilter,\r\n    urlKey: 'stid',\r\n  });\r\n\r\n  //}\r\n  if (myAssetsDefaultFilters.includes('ContactsPersonForEquipment')) {\r\n    result.push({\r\n      fieldName: 'Contacts',\r\n      displayName: t(translations.ContactsPersonForEquipment),\r\n      operator: ODataOperators.AnyIn,\r\n      queryStringSerializer: arrayToQueryString('contacts'),\r\n      value: getStringEntityArray(params, 'contacts'),\r\n      component: UserAssetContactMultiFilter,\r\n      initData: initMultiExPickerValue(initUserMultiData),\r\n      urlKey: 'contacts',\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('Experts')) {\r\n    result.push({\r\n      fieldName: 'Experts',\r\n      displayName: t(translations.EquipmentExperts),\r\n      operator: ODataOperators.AnyIn,\r\n      queryStringSerializer: arrayToQueryString('experts'),\r\n      value: getStringEntityArray(params, 'experts'),\r\n      component: UserAssetContactMultiFilter,\r\n      initData: initMultiExPickerValue(initUserMultiData),\r\n      urlKey: 'experts',\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('OtherNames')) {\r\n    result.push({\r\n      fieldName: 'OtherNames',\r\n      displayName: t(translations.OtherNames),\r\n      operator: ODataOperators.Contains,\r\n      queryStringSerializer: 'otherNames',\r\n      value: GetStringOrUndefined(GetRawValue(params, 'otherNames')),\r\n      component: TextFieldFilter,\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('InternalCode')) {\r\n    result.push({\r\n      fieldName: 'InternalCode',\r\n      displayName: t(translations.InternalEquipmentBarcodeNumber),\r\n      operator: ODataOperators.Contains,\r\n      queryStringSerializer: 'internalCode',\r\n      value: GetStringOrUndefined(GetRawValue(params, 'internalCode')),\r\n      component: TextFieldFilter,\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('ShowAssemblyParts')) {\r\n    result.push({\r\n      fieldName: 'HasAssemblyParts',\r\n      displayName: t(translations.ShowAssemblyParts),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'showAssemblyParts',\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'showAssemblyParts')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n    });\r\n  }\r\n  if (myAssetsDefaultFilters.includes('IsUsageOpen')) {\r\n    result.push({\r\n      fieldName: 'HasActiveUsage',\r\n      displayName: t(translations.UsageStatus),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'isUsageOpen',\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'isUsageOpen')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n    result.push({\r\n      fieldName: 'Ranges',\r\n      queryStringSerializer: assetRangeSerializer('RangeWeight'),\r\n      value: getAssetRange(params, 'RangeWeight'),\r\n      displayName: t(translations.RangeWeight),\r\n      operator: ODataOperators.In,\r\n      component: AssetRangeFilter,\r\n      initData: initAssetRangeData,\r\n      customData: 1,\r\n      customFilter: assetRangeCustomFilter,\r\n      getDisplay: assetRangeDisplay,\r\n      urlKey: 'RangeWeight',\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n    result.push({\r\n      fieldName: 'Ranges',\r\n      queryStringSerializer: assetRangeSerializer('RangekN'),\r\n      value: getAssetRange(params, 'RangekN'),\r\n      displayName: t(translations.RangekN),\r\n      operator: ODataOperators.In,\r\n      component: AssetRangeFilter,\r\n      initData: initAssetRangeData,\r\n      customData: 2,\r\n      customFilter: assetRangeCustomFilter,\r\n      getDisplay: assetRangeDisplay,\r\n      urlKey: 'RangekN',\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n    result.push({\r\n      fieldName: 'Ranges',\r\n      queryStringSerializer: assetRangeSerializer('RangeTemperature'),\r\n      value: getAssetRange(params, 'RangeTemperature'),\r\n      displayName: t(translations.RangeTemperature),\r\n      operator: ODataOperators.In,\r\n      component: AssetRangeFilter,\r\n      initData: initAssetRangeData,\r\n      customData: 3,\r\n      customFilter: assetRangeCustomFilter,\r\n      getDisplay: assetRangeDisplay,\r\n      urlKey: 'RangeTemperature',\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n    result.push({\r\n      fieldName: 'Ranges',\r\n      queryStringSerializer: assetRangeSerializer('RangeArea'),\r\n      value: getAssetRange(params, 'RangeArea'),\r\n      displayName: t(translations.RangeArea),\r\n      operator: ODataOperators.In,\r\n      component: AssetRangeFilter,\r\n      initData: initAssetRangeData,\r\n      customData: 4,\r\n      customFilter: assetRangeCustomFilter,\r\n      getDisplay: assetRangeDisplay,\r\n      urlKey: 'RangeArea',\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n    result.push({\r\n      fieldName: 'Ranges',\r\n      queryStringSerializer: assetRangeSerializer('RangeVolume'),\r\n      value: getAssetRange(params, 'RangeVolume'),\r\n      displayName: t(translations.RangeVolume),\r\n      operator: ODataOperators.In,\r\n      component: AssetRangeFilter,\r\n      initData: initAssetRangeData,\r\n      customData: 5,\r\n      customFilter: assetRangeCustomFilter,\r\n      getDisplay: assetRangeDisplay,\r\n      urlKey: 'RangeVolume',\r\n    });\r\n  }\r\n  if (IsAssetFieldEnabled(appSettings, AssetAttributes.Range)) {\r\n    result.push({\r\n      fieldName: 'Ranges',\r\n      queryStringSerializer: assetRangeSerializer('RangeAmount'),\r\n      value: getAssetRange(params, 'RangeAmount'),\r\n      displayName: t(translations.RangeAmount),\r\n      operator: ODataOperators.In,\r\n      component: AssetRangeFilter,\r\n      initData: initAssetRangeData,\r\n      customData: 6,\r\n      customFilter: assetRangeCustomFilter,\r\n      getDisplay: assetRangeDisplay,\r\n      urlKey: 'RangeAmount',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL0) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL0')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL0',\r\n      displayName: t(translations.Asset_ExtraDDL0),\r\n      queryStringSerializer: 'extddl0',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl0')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL0'),\r\n      urlType: 'ExtraDDL0',\r\n      urlKey: 'extddl0',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL1) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL1')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL1',\r\n      displayName: t(translations.Asset_ExtraDDL1),\r\n      queryStringSerializer: 'extddl1',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl1')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL1'),\r\n      urlType: 'ExtraDDL1',\r\n      urlKey: 'extddl1',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL2) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL2')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL2',\r\n      displayName: t(translations.Asset_ExtraDDL2),\r\n      queryStringSerializer: 'extddl2',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl2')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL2'),\r\n      urlType: 'ExtraDDL2',\r\n      urlKey: 'extddl2',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL3) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL3')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL3',\r\n      displayName: t(translations.Asset_ExtraDDL3),\r\n      queryStringSerializer: 'extddl3',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl3')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL3'),\r\n      urlType: 'ExtraDDL3',\r\n      urlKey: 'extddl3',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL4) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL4')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL4',\r\n      displayName: t(translations.Asset_ExtraDDL4),\r\n      queryStringSerializer: 'extddl4',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl4')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL4'),\r\n      urlType: 'ExtraDDL4',\r\n      urlKey: 'extddl4',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL5) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL5')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL5',\r\n      displayName: t(translations.Asset_ExtraDDL5),\r\n      queryStringSerializer: 'extddl5',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl5')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL5'),\r\n      urlType: 'ExtraDDL5',\r\n      urlKey: 'extddl5',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL6) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL6')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL6',\r\n      displayName: t(translations.Asset_ExtraDDL6),\r\n      queryStringSerializer: 'extddl6',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl6')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL6'),\r\n      urlType: 'ExtraDDL6',\r\n      urlKey: 'extddl6',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL7) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL7')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL7',\r\n      displayName: t(translations.Asset_ExtraDDL7),\r\n      queryStringSerializer: 'extddl7',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl7')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL7'),\r\n      urlType: 'ExtraDDL7',\r\n      urlKey: 'extddl7',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL8) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL8')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL8',\r\n      displayName: t(translations.Asset_ExtraDDL8),\r\n      queryStringSerializer: 'extddl8',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl8')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL8'),\r\n      urlType: 'ExtraDDL8',\r\n      urlKey: 'extddl8',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL9) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL9')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL9',\r\n      displayName: t(translations.Asset_ExtraDDL9),\r\n      queryStringSerializer: 'extddl9',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl9')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL9'),\r\n      urlType: 'ExtraDDL9',\r\n      urlKey: 'extddl9',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL10) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL10')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL10',\r\n      displayName: t(translations.Asset_ExtraDDL10),\r\n      queryStringSerializer: 'extddl10',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl10')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL10'),\r\n      urlType: 'ExtraDDL10',\r\n      urlKey: 'extddl10',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL11) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL11')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL11',\r\n      displayName: t(translations.Asset_ExtraDDL11),\r\n      queryStringSerializer: 'extddl11',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl11')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL11'),\r\n      urlType: 'ExtraDDL11',\r\n      urlKey: 'extddl11',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL12) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL12')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL12',\r\n      displayName: t(translations.Asset_ExtraDDL12),\r\n      queryStringSerializer: 'extddl12',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl12')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL12'),\r\n      urlType: 'ExtraDDL12',\r\n      urlKey: 'extddl12',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL13) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL13')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL13',\r\n      displayName: t(translations.Asset_ExtraDDL13),\r\n      queryStringSerializer: 'extddl13',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl13')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL13'),\r\n      urlType: 'ExtraDDL13',\r\n      urlKey: 'extddl13',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL14) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL14')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL14',\r\n      displayName: t(translations.Asset_ExtraDDL14),\r\n      queryStringSerializer: 'extddl14',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl14')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL14'),\r\n      urlType: 'ExtraDDL14',\r\n      urlKey: 'extddl14',\r\n    });\r\n  }\r\n  if (\r\n    IsAssetFieldEnabled(appSettings, AssetAttributes.ExtraDDL15) &&\r\n    myAssetsDefaultFilters.includes('ExtraDDL15')\r\n  ) {\r\n    result.push({\r\n      fieldName: 'ExtraDDL5',\r\n      displayName: t(translations.Asset_ExtraDDL15),\r\n      queryStringSerializer: 'extddl15',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'extddl15')),\r\n      ),\r\n      operator: ODataOperators.Equals,\r\n      component: ExtraDDLFilter,\r\n      initData: initExPickerValue(initExtraDDLData, undefined, 'ExtraDDL15'),\r\n      urlType: 'ExtraDDL15',\r\n      urlKey: 'extddl15',\r\n    });\r\n  }\r\n  return result;\r\n};\r\n","import { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport * as React from 'react';\r\nimport { Column, IdType, Row } from 'react-table';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { getColumns } from '../Columns';\r\nimport { DefaultFilter } from '../DefaultFilter';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectAppSettings,\r\n  selectglobalSettings,\r\n  selectIsAuthenticated,\r\n  selectShowAllCores,\r\n} from 'app/slice/selectors';\r\nimport {\r\n  SelectedRowsActionExtRenderer,\r\n  SelectedRowsActionRenderer,\r\n} from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\nimport {\r\n  AppSettings,\r\n  IsAssetFieldEnabled,\r\n  IsAssetFieldIsPublic,\r\n  IsModuleEnabled,\r\n} from 'types/AppSettings';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { BookitChipWithInfo } from 'app/components/BasicChip';\r\nimport { SavedViewSelected } from 'app/pages/SavedViewsPage/SavedViewPage/slice/types';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { GetFilters } from './Filter';\r\nimport { AssetActionType } from './AssetsSelection';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport useState from 'react-usestateref';\r\nimport { TableMode } from 'app/components/BasicTable/ControlledTable';\r\nimport { CustomEmptyTableProps } from 'app/components/BasicTable/components/CustomEmptyTable';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { GetSelectedActions } from '../SelectedRowActions/GetSelectedActions';\r\nimport { AssetAttributes } from 'enums/AssetAttributes';\r\nimport { translations } from 'locales/translations';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { getOnlineServiceTypeAssetFilter } from 'app/components/pickers/StaticOptionsPickers/OnlineServiceTypePicker';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\n\r\nexport interface AssetsSelectionTableProps {\r\n  useSidePanel?: boolean;\r\n  authenticatedUser?: AuthenticatedUser;\r\n  closeSidePanel: () => void;\r\n  setFilters?: (\r\n    appliedFilters: IFilterSettings<IMyAssetsRow>[] | undefined,\r\n  ) => void;\r\n  allowMultiToggle: boolean;\r\n  primaryAction?: (row: Row<IMyAssetsRow>) => void;\r\n  primaryMultiAction: (rows: IMyAssetsRow[]) => void;\r\n  isRowSelectable: (row: Row<IMyAssetsRow>) => boolean;\r\n  getRequiredFilter?: (\r\n    search: string,\r\n    appSettings?: AppSettings | null,\r\n  ) => string | undefined;\r\n  assets?: Entity<number>[];\r\n  screenName: string;\r\n  multiModeDisabled?: boolean;\r\n  openAsset: (id: number) => void;\r\n  useRecentAssets?: boolean;\r\n  RecentAssets?: React.ReactNode;\r\n  actionType: AssetActionType;\r\n  customPredicates?: (string | Condition<IMyAssetsRow>)[];\r\n  isShortView?: boolean;\r\n  emptyTable?: CustomEmptyTableProps;\r\n  searchTerm?: string;\r\n}\r\n\r\nexport function AssetsSelectionTable(props: AssetsSelectionTableProps) {\r\n  const {\r\n    useSidePanel,\r\n    authenticatedUser,\r\n    setFilters,\r\n    isRowSelectable,\r\n    getRequiredFilter,\r\n    assets,\r\n    primaryAction,\r\n    primaryMultiAction,\r\n    screenName,\r\n    multiModeDisabled,\r\n    // openAsset,\r\n    useRecentAssets,\r\n    RecentAssets,\r\n    actionType,\r\n    customPredicates,\r\n    isShortView = false,\r\n    emptyTable,\r\n    searchTerm,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const showAllCores = useSelector(selectShowAllCores);\r\n  const isMobile = DetectIsMobile();\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const roomsEnabled = settings.GetBoolean(\r\n    AllowedSettings[AllowedSettings.RoomUserRoleEnabled],\r\n  );\r\n  const canExportAssetRanges = IsAssetFieldEnabled(\r\n    appSettings,\r\n    AssetAttributes.Range,\r\n  );\r\n  const assetFieldEnabled = React.useCallback(\r\n    (AssetField: AssetAttributes): boolean => {\r\n      if (isAuthenticated) {\r\n        return IsAssetFieldEnabled(appSettings, AssetField);\r\n      } else {\r\n        return (\r\n          IsAssetFieldEnabled(appSettings, AssetField) &&\r\n          IsAssetFieldIsPublic(appSettings, AssetField)\r\n        );\r\n      }\r\n    },\r\n    [appSettings, isAuthenticated],\r\n  );\r\n  const searchColumns = React.useMemo(() => {\r\n    let result: string[] = [\r\n      'Name',\r\n      'AvailabilityTypeName',\r\n      'DivisionName',\r\n      'ServiceGroupName',\r\n      'InstrumentType',\r\n      //'RoomAreaName',\r\n      //'InstrumentCatName',\r\n    ];\r\n    if (assetFieldEnabled(AssetAttributes.Building)) {\r\n      result.push('Building');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Room)) {\r\n      result.push('Room');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.AssetCat)) {\r\n      result.push('AssetCatName');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.LocationsList)) {\r\n      result.push('LocationName');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.SubLocationsList)) {\r\n      result.push('SubLocationName');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.AssetCatGroup)) {\r\n      result.push('AssetCatGroupName');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.POnumber)) {\r\n      result.push('POnumber');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.AssetAccessories)) {\r\n      result.push('AccessoriesText');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Contacts)) {\r\n      result.push('ContactsText');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Experts)) {\r\n      result.push('ExpertsText');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Suppliers)) {\r\n      result.push('SuppliersText');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.OtherNames)) {\r\n      result.push('OtherNames');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Brand)) {\r\n      result.push('Brand');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Description)) {\r\n      result.push('Description');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ShortDescription)) {\r\n      result.push('ShortDescription');\r\n    }\r\n\r\n    if (assetFieldEnabled(AssetAttributes.ServiceContract)) {\r\n      result.push('ServiceContract');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Campus)) {\r\n      result.push('Campus');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Tags)) {\r\n      result.push('TagsText');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.MainSpecRange)) {\r\n      result.push('MainSpecRange');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.AccountingId)) {\r\n      result.push('AccountingId');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ModelNumber)) {\r\n      result.push('ModelNumber');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.FunctionalCharacteristics)) {\r\n      result.push('FunctionalCharacteristics');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.WebLink)) {\r\n      result.push('WebLink');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.Model)) {\r\n      result.push('Model');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL0)) {\r\n      result.push('ExtraDDL0Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL1)) {\r\n      result.push('ExtraDDL1Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL2)) {\r\n      result.push('ExtraDDL2Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL3)) {\r\n      result.push('ExtraDDL3Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL4)) {\r\n      result.push('ExtraDDL4Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL5)) {\r\n      result.push('ExtraDDL5Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL6)) {\r\n      result.push('ExtraDDL6Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL7)) {\r\n      result.push('ExtraDDL7Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL8)) {\r\n      result.push('ExtraDDL8Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL9)) {\r\n      result.push('ExtraDDL9Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL10)) {\r\n      result.push('ExtraDDL10Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL11)) {\r\n      result.push('ExtraDDL11Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL12)) {\r\n      result.push('ExtraDDL12Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL13)) {\r\n      result.push('ExtraDDL13Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL14)) {\r\n      result.push('ExtraDDL14Value');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL15)) {\r\n      result.push('ExtraDDL15Value');\r\n    }\r\n    return result;\r\n  }, [assetFieldEnabled]);\r\n\r\n  const additionalColumns = React.useMemo(() => {\r\n    let result: string[] = [\r\n      'Id',\r\n      'ServiceId',\r\n      'AvailabilityTypeId',\r\n      'ServiceGroupId',\r\n      'ServiceTypeId',\r\n      'AutoMode',\r\n      'AvailabilityTypeName',\r\n      'TrainingSessionsEnabled',\r\n      'HideProjects',\r\n      'AllowToUser',\r\n      'StaffOnly',\r\n      'AssetCatId',\r\n      'AssetCatGroupId',\r\n      'BuildingId',\r\n      'FloorName',\r\n      'RoomAreaId',\r\n      'RegionId',\r\n      'RemoteControlEnabled',\r\n    ];\r\n    if (IsModuleEnabled(appSettings, KnownModules.Divisions)) {\r\n      result.push('DivisionAssetId');\r\n      result.push('DivisionId');\r\n      result.push('RegionId');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.AssetCat)) {\r\n      result.push('AssetCatId');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.AssetCatGroup)) {\r\n      result.push('AssetCatGroupId');\r\n    }\r\n\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL0)) {\r\n      result.push('ExtraDDL0');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL1)) {\r\n      result.push('ExtraDDL1');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL2)) {\r\n      result.push('ExtraDDL2');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL3)) {\r\n      result.push('ExtraDDL3');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL4)) {\r\n      result.push('ExtraDDL4');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL5)) {\r\n      result.push('ExtraDDL5');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL6)) {\r\n      result.push('ExtraDDL6');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL7)) {\r\n      result.push('ExtraDDL7');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL8)) {\r\n      result.push('ExtraDDL8');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL9)) {\r\n      result.push('ExtraDDL9');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL10)) {\r\n      result.push('ExtraDDL10');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL11)) {\r\n      result.push('ExtraDDL11');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL12)) {\r\n      result.push('ExtraDDL12');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL13)) {\r\n      result.push('ExtraDDL13');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL14)) {\r\n      result.push('ExtraDDL14');\r\n    }\r\n    if (assetFieldEnabled(AssetAttributes.ExtraDDL15)) {\r\n      result.push('ExtraDDL15');\r\n    }\r\n    return result;\r\n  }, [appSettings, assetFieldEnabled]);\r\n  const [multiAssetSelectionMode, setMultiAssetSelectionMode] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [selectedRowIds, setSelectedRowIds] = React.useState<\r\n    Record<IdType<number>, boolean>\r\n  >({});\r\n  const [, setCurrentMode, currentModeRef] = useState<TableMode>('card');\r\n  const [loacalAssets, setLoacalAssets, localAssetsRef] = useState<\r\n    Entity<number>[]\r\n  >([]);\r\n  React.useEffect(() => {\r\n    let obj = {};\r\n    if (!!assets && assets.length > 0) {\r\n      for (const key of assets) {\r\n        obj[key.Id] = true;\r\n      }\r\n      setMultiAssetSelectionMode(assets.length > 1);\r\n      setLoacalAssets(assets);\r\n    }\r\n    setSelectedRowIds(obj);\r\n  }, [assets, setLoacalAssets]);\r\n\r\n  function getMyListFilter(search: string, selectedView: SavedViewSelected) {\r\n    const result = isEmptyOrWhitespace(search)\r\n      ? new URLSearchParams()\r\n      : new URLSearchParams(search);\r\n    result.set('aid', selectedView.assetIds || '');\r\n    const res = result.toString();\r\n    return isEmptyOrWhitespace(res) ? undefined : res;\r\n  }\r\n\r\n  const columns: Column<IMyAssetsRow>[] = React.useMemo(\r\n    () => getColumns(t, authenticatedUser, appSettings, settings),\r\n    [t, authenticatedUser, appSettings, settings],\r\n  );\r\n  const initialState: IBasicTableState<IMyAssetsRow> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Name', desc: false }],\r\n      selectedRowIds: selectedRowIds,\r\n      globalFilter: searchTerm,\r\n    }),\r\n    [searchTerm, selectedRowIds],\r\n  );\r\n  // const selectedRowActions: SelectedRowsActionRenderer<\r\n  //   IMyAssetsRow\r\n  // >[] = GetSelectedActions(t, {\r\n  //   enableSavedLists: false,\r\n  //   canExport: false,\r\n  //   canExportAssetRanges: false,\r\n  // });\r\n  const selectedRowActions: SelectedRowsActionExtRenderer<\r\n    IMyAssetsRow\r\n  >[] = React.useMemo(() => {\r\n    let actions: SelectedRowsActionExtRenderer<IMyAssetsRow>[] =\r\n      loacalAssets.length > 0\r\n        ? loacalAssets.map(\r\n            sg => (selectedRws, rows, refresh, toggleAll, toggleSingle) => (\r\n              <BookitChipWithInfo\r\n                info={\r\n                  rows.filter(f => f.id === sg.Id.toString()).length > 0\r\n                    ? undefined\r\n                    : t(translations.DeleteSelectedCard_info)\r\n                }\r\n                onDelete={() => {\r\n                  onSelectChange(\r\n                    selectedRws.filter(f => f.Id === sg.Id)[0],\r\n                    false,\r\n                  );\r\n                  rows\r\n                    .filter(f => f.id === sg.Id.toString())\r\n                    .forEach(f => {\r\n                      f.toggleRowSelected(false);\r\n                    });\r\n                  //toggleSingle(sg.Id.toString(), false);\r\n                }}\r\n                disabled={\r\n                  !(rows.filter(f => f.id === sg.Id.toString()).length > 0)\r\n                }\r\n                // onClick={() => {\r\n                //   openAsset(sg.Id);\r\n                // }}\r\n                variant=\"default\"\r\n                customsize={isShortView ? 'small' : 'medium'}\r\n                label={sg.Name}\r\n                customwidth={isShortView ? 100 : 180}\r\n                custombgcolor={bookitColors.primary.disabled}\r\n                customcolor={bookitColors.grayscale.blackComponents}\r\n                customiconcolor={bookitColors.grayscale.blackComponents}\r\n                shape=\"circle\"\r\n                key={sg.Id}\r\n              />\r\n            ),\r\n          )\r\n        : [];\r\n    return actions;\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [isShortView, loacalAssets]);\r\n\r\n  const selectedRowDefaultActions: SelectedRowsActionRenderer<\r\n    IMyAssetsRow\r\n  >[] = GetSelectedActions(t, {\r\n    enableSavedLists: isAuthenticated,\r\n    canExportAssetRanges: canExportAssetRanges,\r\n    isShowAllCores: showAllCores,\r\n    authenticatedUser: authenticatedUser,\r\n    useSidePanel: useSidePanel,\r\n  });\r\n  const handleRowsChange = (rows: Row<IMyAssetsRow>[]) => {\r\n    let selectable = rows.map(f => {\r\n      return {\r\n        Id: f.original.Id,\r\n        Name: f.original.Name,\r\n      } as Entity<number>;\r\n    });\r\n    setLoacalAssets(selectable);\r\n  };\r\n  const toggleAllRows = (rows: Row<IMyAssetsRow>[], checked: boolean) => {\r\n    if (checked) {\r\n      handleRowsChange(rows);\r\n    } else {\r\n      handleRowsChange([]);\r\n    }\r\n  };\r\n  const handleSingleChange = React.useCallback(\r\n    (value: Entity<number>, added: boolean) => {\r\n      if (added) {\r\n        if (\r\n          !!localAssetsRef.current &&\r\n          localAssetsRef.current.length + 1 >\r\n            (currentModeRef.current === 'card' ? 0 : 0)\r\n        ) {\r\n          setMultiAssetSelectionMode(true);\r\n        }\r\n        setLoacalAssets(oldAssets => [\r\n          ...oldAssets,\r\n          {\r\n            Id: value.Id,\r\n            Name: value.Name,\r\n          } as Entity<number>,\r\n        ]);\r\n      } else {\r\n        if (\r\n          !!localAssetsRef.current &&\r\n          localAssetsRef.current.length - 1 <\r\n            (currentModeRef.current === 'card' ? 1 : 1)\r\n        ) {\r\n          setMultiAssetSelectionMode(false);\r\n        }\r\n        setLoacalAssets(oldAssets => {\r\n          let newAsset = oldAssets.filter(ass => ass.Id !== value.Id);\r\n          return newAsset;\r\n        });\r\n      }\r\n    },\r\n    [currentModeRef, localAssetsRef, setLoacalAssets],\r\n  );\r\n  const onSelectChange = React.useCallback(\r\n    (row: IMyAssetsRow, checked: boolean) => {\r\n      handleSingleChange(\r\n        {\r\n          Id: row.Id,\r\n          Name: row.Name,\r\n        } as Entity<number>,\r\n        checked,\r\n      );\r\n    },\r\n    [handleSingleChange],\r\n  );\r\n  const customFilter = React.useMemo(() => {\r\n    let filter: (string | Condition<IMyAssetsRow>)[] = customPredicates ?? [];\r\n    if (actionType === 'StartUsage') {\r\n      filter.push(\r\n        new Condition<IMyAssetsRow>('AutoMode', ODataOperators.Equals, 1),\r\n      );\r\n      filter.push(getOnlineServiceTypeAssetFilter(appSettings, roomsEnabled));\r\n    }\r\n    if (actionType === 'TrainingSession') {\r\n      filter.push(\r\n        new Condition<IMyAssetsRow>(\r\n          'TrainingSessionsEnabled',\r\n          ODataOperators.Equals,\r\n          true,\r\n        ),\r\n      );\r\n    }\r\n    return filter.length > 0 ? filter : undefined;\r\n  }, [actionType, appSettings, customPredicates, roomsEnabled]);\r\n  const useFloatingActions = React.useMemo(() => {\r\n    return multiAssetSelectionMode\r\n      ? loacalAssets.length > 0\r\n      : loacalAssets.length > 1;\r\n  }, [loacalAssets.length, multiAssetSelectionMode]);\r\n\r\n  const url = '/api/odata/v4/MyAssets';\r\n  const { serviceGroups } = useGlobalServiceGroupsFilter(!showAllCores);\r\n  const TTable = React.useMemo(\r\n    () =>\r\n      filterHandler<IMyAssetsRow, {}>(BasicTable, GetFilters, {\r\n        isSidePanel: useSidePanel,\r\n        setFilters: setFilters,\r\n        reservedQueryStringParameterNames: ['active'],\r\n        getDefaultFilter: DefaultFilter,\r\n        getRequiredFilter: getRequiredFilter,\r\n        getSelectedViewFilter: getMyListFilter,\r\n        enableSavedLists: true,\r\n      }),\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [useSidePanel],\r\n  );\r\n  return (\r\n    <React.Fragment>\r\n      <TTable\r\n        screenId={\r\n          actionType === 'AssetSearch'\r\n            ? ScreensId.AssetSearch\r\n            : ScreensId.MyAssets\r\n        }\r\n        api={url}\r\n        columns={columns}\r\n        screenName={screenName}\r\n        screenNameVariant=\"section\"\r\n        additionalColumns={additionalColumns}\r\n        searchColumns={searchColumns}\r\n        serviceGroups={serviceGroups}\r\n        inlineRowActions={undefined}\r\n        // selectedRowsActions={selectedRowActions}\r\n        initialState={initialState}\r\n        isRowSelectable={isRowSelectable}\r\n        hideMenuOnMobile={useSidePanel}\r\n        useExport={actionType === 'AssetSearch'}\r\n        cardSize=\"small\"\r\n        viewCardsCheck={!multiModeDisabled || actionType === 'AssetSearch'}\r\n        // viewCardsCheck={\r\n        //   multiAssetSelectionMode ||\r\n        //   (isShortView && !multiModeDisabled) ||\r\n        //   actionType === 'AssetSearch'\r\n        // }\r\n        onSelectedChange={onSelectChange}\r\n        imageSrcKey=\"ImageName\"\r\n        titleKey=\"Name\"\r\n        allowCards={true}\r\n        compactTable={isShortView}\r\n        onModeChange={mode => setCurrentMode(mode === true ? 'card' : 'table')}\r\n        primaryAction={row => {\r\n          let canSwitch = isRowSelectable(row);\r\n          if (!multiAssetSelectionMode) {\r\n            if (canSwitch) {\r\n              primaryAction?.(row);\r\n            }\r\n          } else {\r\n            if (canSwitch) {\r\n              row.toggleRowSelected(!row.isSelected);\r\n              onSelectChange(row.original, !row.isSelected);\r\n            }\r\n          }\r\n        }}\r\n        savedListSettings={{\r\n          enableSavedLists: isAuthenticated,\r\n          savedListRelatedPickerName: 'Id',\r\n          savedListSerializedKey: 'aid',\r\n          listViewbyAsset: true,\r\n        }}\r\n        useConfigurable={actionType === 'AssetSearch'}\r\n        useCardsByDefault={true}\r\n        selectedRowsActions={\r\n          actionType === 'AssetSearch' ? selectedRowDefaultActions : undefined\r\n        }\r\n        floatingTabSettings={{\r\n          useFloatingActions:\r\n            useFloatingActions && actionType !== 'AssetSearch',\r\n          selectedFloatingActions: selectedRowActions,\r\n          buttonFloatingActions: [\r\n            rows => (\r\n              <Button\r\n                size={isShortView ? 'small' : 'medium'}\r\n                onClick={() => {\r\n                  primaryMultiAction(rows);\r\n                }}\r\n              >\r\n                {isShortView ? 'Continue' : 'Continue with Selected'}\r\n              </Button>\r\n            ),\r\n          ],\r\n          useSidePanel: useSidePanel,\r\n        }}\r\n        //pageActions={pageActions}\r\n        useRowSelect={true}\r\n        withToolBar={false}\r\n        customEmptyTableSettings={emptyTable}\r\n        tabSectionSettings={{\r\n          useTabsSection: isAuthenticated,\r\n          getMultiMode: value => setMultiAssetSelectionMode(value),\r\n          selectedTabValue: undefined,\r\n          onAllRowsSelected: toggleAllRows,\r\n          disableMultiMode: multiModeDisabled,\r\n          defaultMultiMode: !multiModeDisabled,\r\n          // defaultMultiMode:\r\n          //   multiAssetSelectionMode === true ||\r\n          //   (!!localAssetsRef.current && localAssetsRef.current.length > 0),\r\n        }}\r\n        customToolbarSettings={{\r\n          useCustomToolbar: useRecentAssets,\r\n          CustomToolbar: RecentAssets,\r\n        }}\r\n        predicates={customFilter}\r\n        preventInnerClicks={isMobile}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer } from 'utils/redux-injectors';\r\nimport { AssetsSelectionState } from './types';\r\n\r\nexport const initialState: AssetsSelectionState = {\r\n  filters: undefined,\r\n  loading: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'assetsSelection',\r\n  initialState,\r\n  reducers: {\r\n    setFilters(state, action: PayloadAction<Record<string, any> | undefined>) {\r\n      state.filters = action.payload;\r\n    },\r\n    setLoading(state, action: PayloadAction<boolean>) {\r\n      state.loading = action.payload;\r\n    },\r\n    reset(state, action: PayloadAction) {\r\n      state.filters = undefined;\r\n      state.loading = undefined;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: assetsSelectionActions } = slice;\r\n\r\nexport const useAssetsSelectionSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  // useInjectSaga({ key: slice.name, saga: assetsSelectionSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useAssetsSelectionSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.assetsSelection || initialState;\r\n\r\nexport const selectAssetsSelection = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectAssetsSelectionLoading = createSelector(\r\n  [selectAssetsSelection],\r\n  state => state.loading,\r\n);\r\n\r\nexport const selectAssetsSelectionFilters = createSelector(\r\n  [selectAssetsSelection],\r\n  state => state.filters,\r\n);\r\n","import { Box, Collapse, useTheme } from '@material-ui/core';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { AssetQuickSearchDetails } from 'app/components/AssetQuickSearch/slice/types';\r\nimport { getAssetImageThumbSrc } from 'app/components/AssetThumbImage/getAssetImageSrc';\r\nimport { Body } from 'app/components/Typography';\r\nimport { BasicCard } from 'app/components/BasicCards';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { AssetActionType } from './AssetsSelection';\r\nimport * as React from 'react';\r\nimport { IsAssetImageExist } from 'types/AppSettings';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport styled from 'styled-components';\r\nimport clsx from 'clsx';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\n\r\nexport interface RecentAssetsProps {\r\n  actionType: AssetActionType;\r\n  primaryAction?: (row: AssetQuickSearchDetails) => void;\r\n  useSidePanel?: boolean;\r\n  shortView?: boolean;\r\n}\r\nconst RecentContent = styled('div')(({ theme }) => ({\r\n  '&.recentRoot': {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    width: '100%',\r\n    gap: 16,\r\n    '& .recentTitle': {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      justifyContent: 'flex-start',\r\n      gap: 8,\r\n    },\r\n    '& .recentContainer': {\r\n      width: '100%',\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      justifyContent: 'space-between',\r\n      gap: '32px',\r\n      '&.recentShort': {\r\n        flexDirection: 'column',\r\n        alignItems: 'start',\r\n        gap: '16px',\r\n        '& .recentItem': {\r\n          flex: '1 1 100%',\r\n          maxWidth: '100%',\r\n          width: '100%',\r\n          '& .nameOverRule': {\r\n            maxWidth: '25ch',\r\n          },\r\n        },\r\n      },\r\n      '& .recentItem': {\r\n        flex: '1 1 10%',\r\n        borderRadius: 8,\r\n        width: 0,\r\n        minWidth: '256px',\r\n        maxWidth: '360px',\r\n        '& .nameOverRule': {\r\n          display: 'inline-block',\r\n          whiteSpace: 'pre',\r\n          overflow: 'hidden',\r\n          textOverflow: 'ellipsis',\r\n          maxWidth: '30ch',\r\n          // [theme.breakpoints.down('sm')]: {\r\n          //   maxWidth: '25ch',\r\n          // },\r\n        },\r\n      },\r\n    },\r\n  },\r\n}));\r\nexport function RecentAssets(props: RecentAssetsProps) {\r\n  const { actionType, primaryAction, shortView } = props;\r\n  const isMobile = DetectIsMobile();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const theme = useTheme();\r\n  const { t } = useTranslation();\r\n  const [collapseOpen, setCollapseOpen] = React.useState(\r\n    shortView ? false : true,\r\n  );\r\n  React.useEffect(() => {\r\n    setCollapseOpen(shortView ? false : true);\r\n  }, [shortView]);\r\n  const fetchRecentAssets = async (\r\n    type: AssetActionType,\r\n  ): Promise<AssetQuickSearchDetails[]> => {\r\n    let url =\r\n      actionType === 'WorkOrder'\r\n        ? '/api/assets/recentReported?top=5'\r\n        : actionType === 'StartUsage'\r\n        ? '/api/assets/recentUsed?top=5'\r\n        : '/api/assets/recentBook?top=5';\r\n    return new Promise(async resolve => {\r\n      try {\r\n        const data = await httpClient.get(url);\r\n        let result = data as AssetQuickSearchDetails[];\r\n        if (data.length > 0) {\r\n          resolve(result);\r\n        } else {\r\n          resolve([] as AssetQuickSearchDetails[]);\r\n        }\r\n      } catch {\r\n        resolve([] as AssetQuickSearchDetails[]);\r\n      }\r\n    });\r\n  };\r\n  const [recentAssets, setRecentAssets] = useAsyncExtendedState<\r\n    AssetQuickSearchDetails[]\r\n  >([]);\r\n  const [fetchRecentAssetsState, fetchRecentAssetsPromise] = usePromise(\r\n    fetchRecentAssets,\r\n  );\r\n  useEffectOnMount(() => {\r\n    setRecentAssets(fetchRecentAssetsPromise(actionType));\r\n  });\r\n  return recentAssets.length > 0 &&\r\n    fetchRecentAssetsState.status === 'resolved' ? (\r\n    <RecentContent theme={theme} className={'recentRoot'}>\r\n      <div className={'recentTitle'}>\r\n        <Icon icon=\"history\" />\r\n        <Body size=\"small\" bold={true}>\r\n          {t(translations.RecentAssets)}\r\n        </Body>\r\n        <IconButton\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          onClick={() => setCollapseOpen(previousState => !previousState)}\r\n        >\r\n          <Icon icon={collapseOpen ? 'chevron-up' : 'chevron-down'} />\r\n        </IconButton>\r\n      </div>\r\n      <Collapse in={collapseOpen}>\r\n        <div\r\n          className={clsx('recentContainer', {\r\n            recentShort: isMobile || shortView,\r\n          })}\r\n        >\r\n          {recentAssets.map(item => {\r\n            return (\r\n              <div key={item.Id} className={'recentItem'}>\r\n                <BasicCard\r\n                  key={item.ServiceId}\r\n                  position=\"horizontal\"\r\n                  cardSize=\"small\"\r\n                  mobileSize=\"small\"\r\n                  title={undefined}\r\n                  cardContent={\r\n                    <Box className={'nameOverRule'}>\r\n                      <Body bold={true}>\r\n                        <React.Fragment>{item.Name}</React.Fragment>\r\n                      </Body>\r\n                    </Box>\r\n                  }\r\n                  imageSrc={getAssetImageThumbSrc(\r\n                    item.Image || null,\r\n                    'thumb',\r\n                    IsAssetImageExist(appSettings, item.Image || null, 'thumb'),\r\n                  )}\r\n                  useImage={true}\r\n                  maxContentHeight={20}\r\n                  useButtons={false}\r\n                  primaryAction={() => !!primaryAction && primaryAction(item)}\r\n                  backStyle=\"white\"\r\n                />\r\n              </div>\r\n            );\r\n          })}\r\n        </div>\r\n      </Collapse>\r\n    </RecentContent>\r\n  ) : (\r\n    <></>\r\n  );\r\n}\r\n","import { AssetQuickSearchDetails } from 'app/components/AssetQuickSearch/slice/types';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { CreateNewRequest } from 'app/pages/ServiceRequestListPage/CreateNewRequest';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectIsAuthenticated,\r\n  selectPublicUrl,\r\n  selectShowAllCores,\r\n} from 'app/slice/selectors';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Row } from 'react-table';\r\nimport { Entity } from 'types/common';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { getRequiredFilter } from '../DefaultFilter';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { AssetsSelectionTable } from './AssetsSelectionTable';\r\nimport { useAssetsSelectionSlice } from './slice';\r\nimport { selectAssetsSelectionFilters } from './slice/selectors';\r\nimport { useAddNewActions } from './useAddNewActions';\r\nimport { RecentAssets } from './RecentAssets';\r\nimport { useSchedulerSlice } from 'app/pages/CalendarPage/Scheduler/slice';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { CustomEmptyTableProps } from 'app/components/BasicTable/components/CustomEmptyTable';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { BasicToggle } from 'app/components/BasicToggle';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Roles } from 'app/slice/types';\r\nimport { AdminActions } from 'app/components/Admin/AdminActions';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\n\r\nexport type AssetActionType =\r\n  | 'Reservation'\r\n  | 'WorkOrder'\r\n  | 'OfflineService'\r\n  | 'Request'\r\n  | 'StartUsage'\r\n  | 'TrainingSession'\r\n  | 'AssetSearch';\r\nexport interface AssetsSelectionProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  assetIds?: number[];\r\n  serviceIds?: number[];\r\n  offTypeIds?: number[];\r\n  requestTypeIds?: number[];\r\n  actionType?: AssetActionType;\r\n  customPredicates?: (string | Condition<IMyAssetsRow>)[];\r\n  pageLink?: string;\r\n  onClose?: () => void;\r\n  useCustomFilter?: boolean;\r\n  customAppliedFilters?: IFilterSettings<IMyAssetsRow>[];\r\n  customAvailableFilters?: IFilterSettings<IMyAssetsRow>[];\r\n  customFilterChange?: (items: IFilterSettings<IMyAssetsRow>[]) => void;\r\n  serviceTypeId?: number;\r\n  assetCatId?: number;\r\n  assetCatGroupId?: number;\r\n  searchTerm?: string;\r\n  hideCoresToggle?: boolean;\r\n}\r\n\r\nexport function AssetsSelection(props: AssetsSelectionProps) {\r\n  const {\r\n    useSidePanel,\r\n    actionType = 'AssetSearch',\r\n    assetIds,\r\n    serviceIds,\r\n    offTypeIds,\r\n    requestTypeIds,\r\n    customPredicates,\r\n    onClose,\r\n    serviceTypeId,\r\n    searchTerm,\r\n    hideCoresToggle,\r\n    assetCatId,\r\n    assetCatGroupId,\r\n    closeCover,\r\n    // useCustomFilter,\r\n    // customAppliedFilters,\r\n    // customAvailableFilters,\r\n    // customFilterChange\r\n  } = props;\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const filters = useSelector(selectAssetsSelectionFilters);\r\n  const showAllCores = useSelector(selectShowAllCores);\r\n  //const hideNavigation = useSelector(selectHideNavigation);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAssetsSelectionSlice();\r\n  const { t } = useTranslation();\r\n  const { actions: appSettingsAction } = useAppSettingsSlice();\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const isMobile = DetectIsMobile();\r\n  // const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState();\r\n  const [openRequest, setOpenRequest] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const [requestId, setRequestId] = React.useState<number | undefined>(\r\n    undefined,\r\n  );\r\n  const [selectedAssets, setSelectedAssets] = React.useState<Entity<number>[]>(\r\n    [],\r\n  );\r\n  const showShortView =\r\n    isMobile || (useSidePanel && !sidePanelExpanded) || props.isCover;\r\n  const { actions: schedActions } = useSchedulerSlice();\r\n  // const multipleMode = useSelector(selectMultipleModeState);\r\n  const pagelink = React.useMemo(\r\n    () =>\r\n      !!props.pageLink\r\n        ? props.pageLink\r\n        : buildURL(\r\n            `${publicUrl}AssetSearch`,\r\n            Object.assign({}, filters, {\r\n              serviceTypeId: serviceTypeId,\r\n              searchTerm: searchTerm,\r\n              actionType: actionType,\r\n              AssetCatGroupId: assetCatGroupId,\r\n              AssetCatId: assetCatId,\r\n            }),\r\n          ),\r\n    [\r\n      actionType,\r\n      assetCatGroupId,\r\n      assetCatId,\r\n      filters,\r\n      props.pageLink,\r\n      publicUrl,\r\n      searchTerm,\r\n      serviceTypeId,\r\n    ],\r\n  );\r\n  // const closeCover = () => {\r\n  //   setCover(undefined);\r\n  // };\r\n\r\n  const closeSidePanel = React.useCallback(() => {\r\n    closePanel({\r\n      isCover: props.isCover,\r\n      useSidePanel: true,\r\n      onClose: () => {\r\n        if (hideCoresToggle) {\r\n          dispatch(appSettingsAction.setShowAllCores(false));\r\n        }\r\n      },\r\n    } as SidePanelCloseState);\r\n    // if (props.isCover) {\r\n    //   if (!!onClose) {\r\n    //     onClose();\r\n    //   } else {\r\n    //     dispatch(layoutActions.resetSidePanel());\r\n    //   }\r\n    //   if (hideCoresToggle) {\r\n    //     dispatch(appSettingsAction.setShowAllCores(false));\r\n    //   }\r\n    // } else {\r\n    //   dispatch(layoutActions.resetSidePanel());\r\n    //   if (hideCoresToggle) {\r\n    //     dispatch(appSettingsAction.setShowAllCores(false));\r\n    //   }\r\n    // }\r\n  }, [appSettingsAction, closePanel, dispatch, hideCoresToggle, props.isCover]);\r\n  const openAsset = React.useCallback(\r\n    (id: number) => {\r\n      let assetProps = {\r\n        identifier: {\r\n          id: id,\r\n        },\r\n        showAllCores: showAllCores,\r\n        useSidePanel: true,\r\n      };\r\n      openPanel({\r\n        renderPageType: RenderPageType.AssetDetails,\r\n        renderPageProps: assetProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [openPanel, showAllCores, useSidePanel],\r\n  );\r\n  // const saveCalendarMultiMode = React.useCallback((value: boolean) => {\r\n  //   dispatch(\r\n  //     appSettingsAction.updateUserProfileSettings({\r\n  //       key: 'BookMultipleInstruments',\r\n  //       model: {\r\n  //         UserName: authenticatedUser?.Id,\r\n  //         Key: 'BookMultipleInstruments',\r\n  //         IsMultiple: value,\r\n  //       } as UserProfileSettings,\r\n  //     }),\r\n  //   );\r\n  // }, [appSettingsAction, authenticatedUser?.Id, dispatch]);\r\n  const IsAdmin = React.useCallback(\r\n    (asset: IMyAssetsRow) => {\r\n      return isAuthenticated\r\n        ? authenticatedUser?.IsAllGroupOrLabTechAdmin(\r\n            [asset.ServiceGroupId ?? 0],\r\n            [\r\n              {\r\n                Id: asset.ServiceId,\r\n                Name: asset.Name,\r\n                ServiceTypeId: asset.ServiceTypeId,\r\n              } as IServiceTypeFilterDto,\r\n            ],\r\n          )\r\n        : false;\r\n    },\r\n    [isAuthenticated, authenticatedUser],\r\n  );\r\n  const isRowSelectable = (row: Row<IMyAssetsRow>): boolean => {\r\n    if (actionType === 'OfflineService') {\r\n      return (\r\n        IsAdmin(row.original) ||\r\n        (row.original.AllowToUser === true && row.original.StaffOnly !== true)\r\n      );\r\n    }\r\n    return true;\r\n  };\r\n  const {\r\n    createOffline,\r\n    createReservation,\r\n    createWorkOrder,\r\n    startUsage,\r\n    addTrainingSession,\r\n  } = useAddNewActions();\r\n  const allowMultiToggle = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'Reservation':\r\n      case 'WorkOrder':\r\n      case 'OfflineService':\r\n        return true;\r\n      case 'Request':\r\n      case 'StartUsage':\r\n      case 'TrainingSession':\r\n      case 'AssetSearch':\r\n      default:\r\n        return false;\r\n    }\r\n  }, [actionType]);\r\n  const allowAllCoresToggle = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'AssetSearch':\r\n        return !hideCoresToggle;\r\n      case 'Request':\r\n      case 'StartUsage':\r\n      case 'TrainingSession':\r\n      case 'Reservation':\r\n      case 'WorkOrder':\r\n      case 'OfflineService':\r\n      default:\r\n        return false;\r\n    }\r\n  }, [actionType, hideCoresToggle]);\r\n  const setfilterCallback = React.useCallback(\r\n    (v: IFilterSettings<IMyAssetsRow>[] | undefined) => {\r\n      const res = {};\r\n      if (!!v) {\r\n        toURLSearchParams(v).forEach((val, name) => {\r\n          res[name] = val;\r\n        });\r\n      }\r\n      dispatch(actions.setFilters(!v || v.length === 0 ? undefined : res));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const availabilityTypesArray = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'Reservation':\r\n      case 'StartUsage':\r\n        return [\r\n          AvailabilityTypes.FreelyBookable as number,\r\n          AvailabilityTypes.TrainingProgram as number,\r\n          AvailabilityTypes.LoanableEquipment as number,\r\n          AvailabilityTypes.LectureRoom as number,\r\n        ];\r\n      case 'OfflineService':\r\n        return [AvailabilityTypes.ServiceRelated as number];\r\n      case 'Request':\r\n        return [AvailabilityTypes.RequestRelated as number];\r\n      case 'WorkOrder':\r\n        return [\r\n          AvailabilityTypes.FreelyBookable as number,\r\n          AvailabilityTypes.TrainingProgram as number,\r\n          AvailabilityTypes.LoanableEquipment as number,\r\n          AvailabilityTypes.LectureRoom as number,\r\n          AvailabilityTypes.ServiceRelated as number,\r\n          AvailabilityTypes.RequestRelated as number,\r\n        ];\r\n      case 'TrainingSession':\r\n        return [\r\n          AvailabilityTypes.FreelyBookable as number,\r\n          AvailabilityTypes.TrainingProgram as number,\r\n          AvailabilityTypes.LoanableEquipment as number,\r\n          AvailabilityTypes.LectureRoom as number,\r\n        ];\r\n      // case 'AssetSearch':\r\n      //   if (!!serviceTypeId) {\r\n      //     switch (serviceTypeId) {\r\n      //       case ServiceType.Online:\r\n      //         return [\r\n      //           AvailabilityTypes.FreelyBookableBillable as number,\r\n      //           AvailabilityTypes.ApprovalRequiredBillable as number,\r\n      //           AvailabilityTypes.FreelyBookable as number,\r\n      //           AvailabilityTypes.BookableWApproval as number,\r\n      //           AvailabilityTypes.TrainingProgram as number,\r\n      //           AvailabilityTypes.LoanableEquipment as number,\r\n      //           AvailabilityTypes.LectureRoom as number,\r\n      //         ];\r\n      //       case ServiceType.Offline:\r\n      //         return [AvailabilityTypes.ServiceRelated as number];\r\n      //       case ServiceType.Sample:\r\n      //         return [AvailabilityTypes.RequestRelated as number];\r\n      //       default:\r\n      //         return [];\r\n      //     }\r\n      //   }\r\n      //   return [];\r\n      default:\r\n        return [];\r\n    }\r\n  }, [actionType]);\r\n  const screenName = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'Reservation':\r\n        return t(translations.CreateReservation) as string;\r\n      case 'StartUsage':\r\n        return t(translations.StartUsage) as string;\r\n      case 'OfflineService':\r\n        return t(translations.SelectConsumables) as string;\r\n      case 'Request':\r\n        return t(translations.CreateRequest) as string;\r\n      case 'WorkOrder':\r\n        return t(translations.CreateAWorkOrder) as string;\r\n      case 'TrainingSession':\r\n        return t(translations.AddTrainingSession);\r\n      case 'AssetSearch':\r\n        return t(translations.InstrumentAssetSearch) as string;\r\n      default:\r\n        return t(translations.CreateReservation) as string;\r\n    }\r\n  }, [actionType, t]);\r\n  const noTableData = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'OfflineService':\r\n        return {\r\n          headTitle: t(translations.NoConsumablesHeadTitle) as string,\r\n          title: t(translations.NoConsumablesTitle) as string,\r\n        } as CustomEmptyTableProps;\r\n      case 'Reservation':\r\n      case 'StartUsage':\r\n      case 'Request':\r\n      case 'WorkOrder':\r\n      case 'TrainingSession':\r\n      default:\r\n        return undefined;\r\n    }\r\n  }, [actionType, t]);\r\n  const requiredFilter = (search: string) => {\r\n    const result = new URLSearchParams(getRequiredFilter(search));\r\n    if (availabilityTypesArray.length > 0) {\r\n      if (\r\n        result.has('AvailabilityTypeId') === false ||\r\n        result.get('AvailabilityTypeId') === null ||\r\n        result.get('AvailabilityTypeId') === ''\r\n      ) {\r\n        result.set('AvailabilityTypeId', availabilityTypesArray.join('|'));\r\n      }\r\n    }\r\n    if (!!serviceTypeId) {\r\n      if (\r\n        result.has('stid') === false ||\r\n        result.get('stid') === null ||\r\n        result.get('stid') === ''\r\n      ) {\r\n        result.set('stid', serviceTypeId.toString());\r\n      }\r\n    }\r\n    const res = result.toString();\r\n    return isEmptyOrWhitespace(res) ? undefined : res;\r\n  };\r\n  const primaryRecentAction = React.useCallback(\r\n    (row: AssetQuickSearchDetails) => {\r\n      if (actionType === 'Reservation') {\r\n        dispatch(schedActions.updateMultiMode(false));\r\n        setTimeout(\r\n          () =>\r\n            createReservation(row.ServiceId !== null ? [row.ServiceId] : []),\r\n          10,\r\n        );\r\n        if (useSidePanel) {\r\n          closeSidePanel();\r\n        }\r\n      } else if (actionType === 'WorkOrder') {\r\n        createWorkOrder([row.Id], useSidePanel);\r\n        if (useSidePanel) {\r\n          closeSidePanel();\r\n        }\r\n      } else if (actionType === 'StartUsage') {\r\n        startUsage(row.ServiceId ?? 0);\r\n        if (useSidePanel) {\r\n          closeSidePanel();\r\n        }\r\n      } else if (actionType === 'AssetSearch') {\r\n        openAsset(row.Id);\r\n      }\r\n    },\r\n    [\r\n      actionType,\r\n      closeSidePanel,\r\n      createReservation,\r\n      createWorkOrder,\r\n      dispatch,\r\n      openAsset,\r\n      schedActions,\r\n      startUsage,\r\n      useSidePanel,\r\n    ],\r\n  );\r\n  const primaryAction = React.useCallback(\r\n    (row: Row<IMyAssetsRow>) => {\r\n      if (\r\n        availabilityTypesArray.includes(row.original.AvailabilityTypeId) ||\r\n        actionType === 'AssetSearch'\r\n      ) {\r\n        if (useSidePanel && !(actionType === 'AssetSearch')) {\r\n          closeSidePanel();\r\n        }\r\n        switch (actionType) {\r\n          case 'Reservation':\r\n            dispatch(schedActions.updateMultiMode(false));\r\n            setTimeout(\r\n              () =>\r\n                createReservation(\r\n                  row.original.ServiceId !== null\r\n                    ? [row.original.ServiceId]\r\n                    : [],\r\n                ),\r\n              10,\r\n            );\r\n            break;\r\n          case 'OfflineService':\r\n            createOffline(\r\n              row.original.ServiceId !== null ? [row.original.ServiceId] : [],\r\n              false,\r\n            );\r\n            break;\r\n          case 'StartUsage':\r\n            startUsage(row.original.ServiceId ?? 0);\r\n            break;\r\n          case 'WorkOrder':\r\n            createWorkOrder([row.original.Id], useSidePanel);\r\n            break;\r\n          case 'Request':\r\n            setRequestId(row.original.ServiceId ?? undefined);\r\n            setOpenRequest(true);\r\n            break;\r\n          case 'TrainingSession':\r\n            addTrainingSession(row.original.ServiceId as number);\r\n            break;\r\n          case 'AssetSearch':\r\n            openAsset(row.original.Id);\r\n            break;\r\n        }\r\n      } else {\r\n        dispatch(\r\n          appSettingsAction.addNotification({\r\n            key: 'availability_error',\r\n            message: `Can not perform this action for resource with Availability Type ${row.original.AvailabilityTypeName}.\r\n                       Please change filters and try again.`,\r\n            variant: 'error',\r\n            persist: true,\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [\r\n      actionType,\r\n      addTrainingSession,\r\n      appSettingsAction,\r\n      availabilityTypesArray,\r\n      closeSidePanel,\r\n      createOffline,\r\n      createReservation,\r\n      createWorkOrder,\r\n      dispatch,\r\n      openAsset,\r\n      schedActions,\r\n      startUsage,\r\n      useSidePanel,\r\n    ],\r\n  );\r\n  const primaryMultiAction = React.useCallback(\r\n    (rows: IMyAssetsRow[]) => {\r\n      if (\r\n        !rows.some(f => availabilityTypesArray.includes(f.AvailabilityTypeId))\r\n      ) {\r\n        let notAvailable = rows\r\n          .filter(f => !availabilityTypesArray.includes(f.AvailabilityTypeId))\r\n          .map(f => f.AvailabilityTypeName);\r\n        dispatch(\r\n          appSettingsAction.addNotification({\r\n            key: 'availability_error',\r\n            message: `Can not perform this action for resources with Availability Type ${notAvailable.join(\r\n              `, `,\r\n            )}.\r\n                       Please change filters and try again.`,\r\n            variant: 'error',\r\n            persist: true,\r\n          }),\r\n        );\r\n      } else {\r\n        switch (actionType) {\r\n          case 'Reservation':\r\n            dispatch(schedActions.updateMultiMode(true));\r\n            setTimeout(\r\n              () =>\r\n                createReservation(\r\n                  rows.map(f => f.ServiceId ?? 0).filter(f => f > 0),\r\n                  true,\r\n                ),\r\n              10,\r\n            );\r\n            break;\r\n          case 'OfflineService':\r\n            //if (rows.length === 1) {\r\n            createOffline(\r\n              rows.map(f => f.ServiceId ?? 0).filter(f => f > 0),\r\n              true,\r\n            );\r\n            // } else {\r\n            //   dispatch(\r\n            //     appSettingsAction.addNotification({\r\n            //       key: 'multiSelect_error',\r\n            //       message:\r\n            //         'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n            //       variant: 'error',\r\n            //     }),\r\n            //   );\r\n            // }\r\n            break;\r\n          case 'StartUsage':\r\n            if (rows.length === 1) {\r\n              startUsage(rows[0].ServiceId ?? 0);\r\n            } else {\r\n              dispatch(\r\n                appSettingsAction.addNotification({\r\n                  key: 'multiSelect_error',\r\n                  message:\r\n                    'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n                  variant: 'error',\r\n                }),\r\n              );\r\n            }\r\n            break;\r\n          case 'TrainingSession':\r\n            if (rows.length === 1) {\r\n              addTrainingSession(rows[0].ServiceId ?? 0);\r\n            } else {\r\n              dispatch(\r\n                appSettingsAction.addNotification({\r\n                  key: 'multiSelect_error',\r\n                  message:\r\n                    'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n                  variant: 'error',\r\n                }),\r\n              );\r\n            }\r\n            break;\r\n          case 'WorkOrder':\r\n            createWorkOrder(\r\n              rows.map(f => f.Id),\r\n              useSidePanel,\r\n            );\r\n            break;\r\n          case 'Request':\r\n            if (rows.length === 1) {\r\n              setRequestId(rows[0].ServiceId ?? undefined);\r\n              setOpenRequest(true);\r\n            } else {\r\n              dispatch(\r\n                appSettingsAction.addNotification({\r\n                  key: 'multiSelect_error',\r\n                  message:\r\n                    'Can not perform this action for multiple services. Please select only one sevice and try again.',\r\n                  variant: 'error',\r\n                }),\r\n              );\r\n            }\r\n            break;\r\n        }\r\n        if (useSidePanel) {\r\n          closeSidePanel();\r\n        }\r\n      }\r\n    },\r\n    [\r\n      actionType,\r\n      addTrainingSession,\r\n      appSettingsAction,\r\n      availabilityTypesArray,\r\n      closeSidePanel,\r\n      createOffline,\r\n      createReservation,\r\n      createWorkOrder,\r\n      dispatch,\r\n      schedActions,\r\n      startUsage,\r\n      useSidePanel,\r\n    ],\r\n  );\r\n  const handleSearchAllCores = React.useCallback(\r\n    (value: boolean) => {\r\n      dispatch(appSettingsAction.setShowAllCores(value));\r\n      //dispatch(layoutActions.setRefreshTable(true));\r\n    },\r\n    [appSettingsAction, dispatch],\r\n  );\r\n  const multiModeDisabled = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'Reservation':\r\n      case 'WorkOrder':\r\n      case 'TrainingSession':\r\n      case 'OfflineService':\r\n      case 'AssetSearch':\r\n        return false;\r\n\r\n      case 'Request':\r\n      case 'StartUsage':\r\n        return true;\r\n      default:\r\n        return false;\r\n    }\r\n  }, [actionType]);\r\n  const useRecentAssets = React.useMemo(() => {\r\n    switch (actionType) {\r\n      case 'Reservation':\r\n      case 'StartUsage':\r\n      case 'WorkOrder':\r\n        return !isMobile;\r\n      case 'OfflineService':\r\n      case 'Request':\r\n      case 'TrainingSession':\r\n      case 'AssetSearch':\r\n      default:\r\n        return false;\r\n    }\r\n  }, [actionType, isMobile]);\r\n  const pageActions: ActionRenderer[] = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    if (allowAllCoresToggle) {\r\n      actions.push(() => (\r\n        <BasicToggle\r\n          label={t(translations.SearchAllCores)}\r\n          checked={showAllCores ?? false}\r\n          onChange={(value, event) => handleSearchAllCores(value)}\r\n        />\r\n      ));\r\n    }\r\n\r\n    if (\r\n      !isMobile &&\r\n      actionType === 'AssetSearch' &&\r\n      !!authenticatedUser &&\r\n      (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n        authenticatedUser.Roles.includes(Roles.GroupAdministrators))\r\n    ) {\r\n      actions.push(() => (\r\n        <AdminActions\r\n          id={`assetsSearch_settings`}\r\n          icon={'cog'}\r\n          menuTab=\"Assets\"\r\n        />\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    actionType,\r\n    allowAllCoresToggle,\r\n    authenticatedUser,\r\n    handleSearchAllCores,\r\n    isMobile,\r\n    showAllCores,\r\n    t,\r\n  ]);\r\n  useEffectOnMount(() => {\r\n    //dispatch(layoutActions.setUpSnackBarIndex(true));\r\n    if (!!assetIds && assetIds.length > 0) {\r\n      (async () => {\r\n        try {\r\n          const data = await initAssetsData(assetIds.join(','), false);\r\n          setSelectedAssets(\r\n            data.map(f => {\r\n              return { Id: f.Id, Name: f.Name };\r\n            }),\r\n          );\r\n        } catch {}\r\n      })();\r\n    } else if (!!serviceIds && serviceIds.length > 0) {\r\n      (async () => {\r\n        try {\r\n          const data = await initAssetsData(serviceIds.join(','), true);\r\n          setSelectedAssets(\r\n            data.map(f => {\r\n              return { Id: f.Id, Name: f.Name };\r\n            }),\r\n          );\r\n        } catch {}\r\n      })();\r\n    } else if (!!offTypeIds && offTypeIds.length > 0) {\r\n      (async () => {\r\n        try {\r\n          const data = await initAssetsData(offTypeIds.join(','), true, [\r\n            { Id: 2 },\r\n          ]);\r\n          setSelectedAssets(\r\n            data.map(f => {\r\n              return { Id: f.Id, Name: f.Name };\r\n            }),\r\n          );\r\n        } catch {}\r\n      })();\r\n    } else if (!!requestTypeIds && requestTypeIds.length > 0) {\r\n      (async () => {\r\n        try {\r\n          const data = await initAssetsData(requestTypeIds.join(','), true, [\r\n            { Id: 3 },\r\n          ]);\r\n          setSelectedAssets(\r\n            data.map(f => {\r\n              return { Id: f.Id, Name: f.Name };\r\n            }),\r\n          );\r\n        } catch {}\r\n      })();\r\n    }\r\n    return () => {\r\n      //dispatch(layoutActions.setUpSnackBarIndex(false));\r\n    };\r\n  });\r\n  return (\r\n    <PageWrapper\r\n      pageLink={pagelink}\r\n      useSidePanel={useSidePanel || false}\r\n      pageName={screenName}\r\n      //loading={loading}\r\n      //pageName={<Link href=\"coreselection\">{t(translations.menu_CoreSelection)}</Link>}\r\n      titlePage={t(translations.menu_MyInstrumentsAssets)}\r\n      closable={useSidePanel || props.isCover}\r\n      //disableExpandToggle={true}\r\n      //rightTopActions={topButtons}\r\n      isCover={props.isCover}\r\n      coverClosed={coverClosed}\r\n      hideTitleBar={false}\r\n      cover={cover}\r\n      closeCover={!props.isCover ? onCloseCover : closeCover}\r\n      closeSidePanel={props.isCover ? onClose : undefined}\r\n      leftTopActions={pageActions}\r\n      children={\r\n        <React.Fragment>\r\n          <AssetsSelectionTable\r\n            useSidePanel={useSidePanel}\r\n            setFilters={setfilterCallback}\r\n            authenticatedUser={authenticatedUser}\r\n            closeSidePanel={closeSidePanel}\r\n            primaryAction={primaryAction}\r\n            isRowSelectable={isRowSelectable}\r\n            getRequiredFilter={requiredFilter}\r\n            allowMultiToggle={allowMultiToggle}\r\n            screenName={screenName}\r\n            assets={selectedAssets}\r\n            primaryMultiAction={primaryMultiAction}\r\n            multiModeDisabled={multiModeDisabled}\r\n            openAsset={openAsset}\r\n            useRecentAssets={useRecentAssets}\r\n            customPredicates={customPredicates}\r\n            isShortView={showShortView}\r\n            emptyTable={noTableData}\r\n            searchTerm={searchTerm}\r\n            RecentAssets={\r\n              <RecentAssets\r\n                actionType={actionType}\r\n                primaryAction={primaryRecentAction}\r\n                useSidePanel={useSidePanel}\r\n                shortView={showShortView}\r\n              />\r\n            }\r\n            actionType={actionType}\r\n          />\r\n          <CreateNewRequest\r\n            isOpen={openRequest || false}\r\n            setOpen={setOpenRequest}\r\n            serviceId={requestId}\r\n          />\r\n        </React.Fragment>\r\n      }\r\n    />\r\n  );\r\n}\r\n","import { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { WorkOrderQueryStringParameters } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details/slice/types';\r\nimport { WorkOrderDetailsProps } from 'app/pages/WorkOrders/WorkOrderDetailsPage/Details';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { selectGlobalDbSetting_EnableLegacyScheduler } from 'app/slice/globalDbSettingsSelectors';\r\nimport { useOfflineServiceStateSlice } from 'app/pages/OtherServiceDetails/Details/slice';\r\n\r\nexport function useAddNewActions() {\r\n  const history = useHistory();\r\n  const dispatch = useDispatch();\r\n  const { newDate } = useSystemDate();\r\n  const isMobile = DetectIsMobile();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: offActions } = useOfflineServiceStateSlice();\r\n  const EnableLegacyScheduler = useSelector(\r\n    selectGlobalDbSetting_EnableLegacyScheduler,\r\n  );\r\n\r\n  const createReservation = React.useCallback(\r\n    (services: number[], multiple?: boolean) => {\r\n      if (EnableLegacyScheduler) {\r\n        window.open(\r\n          toRootedURL('/Reservation.aspx', {\r\n            id: services.join(','),\r\n          }),\r\n          '_blank',\r\n        );\r\n        return;\r\n      }\r\n      history.push(\r\n        `/schedule/calendar?${toQueryString({\r\n          eid: services.join(','),\r\n          period: getPeriodTypesEntity(\r\n            isMobile ? 'Today' : 'ThisWeek',\r\n          ).Id.toString(),\r\n          openToBook: true,\r\n          defaultMulti: multiple,\r\n        })}`,\r\n      );\r\n    },\r\n    [EnableLegacyScheduler, history, isMobile],\r\n  );\r\n  const createWorkOrder = React.useCallback(\r\n    (assetIds: number[], useSidePanel?: boolean) => {\r\n      let p = {\r\n        queryParams: {\r\n          eqid: undefined,\r\n          down: undefined,\r\n          offH: undefined,\r\n          eStart: dateUtils.formatQueryStringDate(newDate(), {\r\n            representation: 'complete',\r\n          }),\r\n          offStart: undefined,\r\n          offEnd: undefined,\r\n          defaultMulti: undefined,\r\n          source: undefined,\r\n          id: undefined,\r\n          aType: undefined,\r\n          title: undefined,\r\n          sympt: undefined,\r\n          aStatus: undefined,\r\n          aStart: undefined,\r\n          desc: undefined,\r\n          assetId: assetIds.join(','),\r\n          reason: undefined,\r\n          sid: undefined,\r\n          Up: undefined,\r\n          continueTo: 'edit',\r\n        } as WorkOrderQueryStringParameters,\r\n        useSidePanel: true,\r\n        continueTo: 'edit',\r\n      } as WorkOrderDetailsProps;\r\n      if (useSidePanel) {\r\n        dispatch(\r\n          layoutActions.openSidePanel({\r\n            type: RenderPageType.WorkOrderDetails,\r\n            props: p,\r\n          }),\r\n        );\r\n      } else {\r\n        history.push(`/workorders/details?${toQueryString(p.queryParams)}`);\r\n      }\r\n    },\r\n    [dispatch, history, layoutActions, newDate],\r\n  );\r\n  // const createOffline = React.useCallback(\r\n  //   (serviceTypeId: number, useSidePanel?: boolean) => {\r\n  //     let params = {\r\n  //       useSidePanel: true,\r\n  //       queryParams: {\r\n  //         stid: serviceTypeId.toString(),\r\n  //         user: authuser?.Id,\r\n  //       },\r\n  //     } as OtherServiceDetailsProps;\r\n\r\n  //     if (useSidePanel) {\r\n  //       dispatch(\r\n  //         layoutActions.openSidePanel({\r\n  //           type: RenderPageType.OtherServiceDetails,\r\n  //           props: params,\r\n  //         }),\r\n  //       );\r\n  //     }\r\n  //     history.push(\r\n  //       `/otherServices/details?${toQueryString(params.queryParams)}`,\r\n  //     );\r\n  //   },\r\n  //   [authuser?.Id, dispatch, history, layoutActions],\r\n  // );\r\n  const createOffline = React.useCallback(\r\n    (services: number[], multiple: boolean) => {\r\n      dispatch(offActions.setSelectedServiceType(services));\r\n      if (!multiple) {\r\n        dispatch(offActions.setBarcodeScanned(true));\r\n      }\r\n    },\r\n    [dispatch, offActions],\r\n  );\r\n  const addTrainingSession = React.useCallback((eqid: number) => {\r\n    window.open(\r\n      toRootedURL('/TrainingSession/AddNew.aspx', {\r\n        eqid: eqid,\r\n      }),\r\n      '_blank',\r\n    );\r\n  }, []);\r\n  const startUsage = React.useCallback((serviceId: number) => {\r\n    window.open(\r\n      toRootedURL('/Usage.aspx', {\r\n        id: serviceId,\r\n      }),\r\n      '_blank',\r\n    );\r\n  }, []);\r\n  return {\r\n    createReservation,\r\n    createWorkOrder,\r\n    createOffline,\r\n    startUsage,\r\n    addTrainingSession,\r\n  };\r\n}\r\n","/**\r\n *\r\n * BarcodeLogStatusPicker\r\n *\r\n */\r\n\r\nimport {\r\n  BaseOptionsPicker,\r\n  BaseOptionsPickerProps,\r\n} from 'app/components/BasicPickers/BaseOptionsPicker';\r\nimport i18next from 'i18next';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface BarcodeLogStatusPickerProps\r\n  extends Omit<BaseOptionsPickerProps<Entity<string>>, 'getOptions'> {}\r\nconst Statuses = [\r\n  'Updated',\r\n  'Failed',\r\n  'RoomScanned',\r\n  'LocationScanned',\r\n  'SubLocationScanned',\r\n  'NoRoomAccess',\r\n];\r\nexport const initLogStatusesData = (\r\n  initval: string | undefined,\r\n): Promise<Entity<string>[]> => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve([] as Entity<string>[]);\r\n    });\r\n  } else {\r\n    return new Promise<Entity<string>[]>((resolve, reject) => {\r\n      resolve(\r\n        Statuses.filter(item => {\r\n          return item === initval;\r\n        }).map(f => {\r\n          return {\r\n            Id: f,\r\n            Name: i18next.t(f) as string,\r\n          } as Entity<string>;\r\n        }),\r\n      );\r\n    });\r\n  }\r\n};\r\n\r\nexport function BarcodeLogStatusPicker(props: BarcodeLogStatusPickerProps) {\r\n  const { t } = useTranslation();\r\n  const getOptions = (searchTerm: string | null) => {\r\n    let items = Statuses.map(f => {\r\n      return {\r\n        Id: f,\r\n        Name: t(f) as string,\r\n      } as Entity<string>;\r\n    });\r\n\r\n    if (searchTerm !== null && searchTerm !== '') {\r\n      return items.filter(\r\n        f => f.Name.startsWith(searchTerm) || f.Name.indexOf(searchTerm) !== -1,\r\n      );\r\n    }\r\n    return items;\r\n  };\r\n  return (\r\n    <BaseOptionsPicker\r\n      mini={props.mini ? true : undefined}\r\n      size={props.size}\r\n      getOptions={getOptions}\r\n      id={props.id || 'barcodeStatusId'}\r\n      value={props.value}\r\n      {...props}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * BarcodeLogStatusFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { BarcodeLogStatusPicker } from 'app/components/pickers/StaticOptionsPickers/BarcodeLogStatusPicker';\r\n\r\nexport const BarcodeLogStatusFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: Entity<string> | null) => {\r\n    props.onChange(value);\r\n  };\r\n\r\n  const { t } = useTranslation();\r\n  return (\r\n    <BarcodeLogStatusPicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllStatuses)}\r\n      ariaLabel={props.label}\r\n      id={props.id}\r\n      size=\"small\"\r\n      predicates={props.predicates}\r\n      onPickerOpen={props.onOpen}\r\n    />\r\n  );\r\n};\r\nexport default BarcodeLogStatusFilter;\r\n","import { translations } from 'locales/translations';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { BuildingPickerFilter } from 'app/components/BasicTable/Filters/BuildingPickerFilter';\r\nimport { RoomPickerFilter } from 'app/components/BasicTable/Filters/RoomPickerFilter';\r\n\r\nimport {\r\n  arrayToQueryString,\r\n  GetBooleanEntity,\r\n  GetBooleanOrUndefined,\r\n  getDefaultFilterDatePeriod,\r\n  getNumberEntityArray,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  GetStringOrUndefined,\r\n  initExPickerValue,\r\n  initMultiPickerValue,\r\n  initPickerValue,\r\n  presetDatesRangeToQueryString,\r\n  URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initBuildingData } from 'app/components/pickers/AutocompletePickers/BuildingPicker';\r\nimport { initRoomData } from 'app/components/pickers/AutocompletePickers/RoomPicker';\r\nimport BooleanPickerFilter from 'app/components/BasicTable/Filters/BooleanPickerFilter';\r\n\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { TextFieldFilter } from 'app/components/BasicTable/Filters';\r\nimport { initAssetMultiData } from 'app/components/pickers/AutocompletePickers/AssetMultiPicker';\r\nimport { AssetMultiFilter } from 'app/components/BasicTable/Filters/AssetMultiFilter';\r\nimport { initLocationData } from 'app/components/pickers/AutocompletePickers/LocationPicker';\r\nimport { LocationPickerFilter } from 'app/components/BasicTable/Filters/LocationPickerFilter';\r\nimport { SubLocationFilter } from 'app/components/BasicTable/Filters/SubLocationListFilter';\r\nimport { initSubLocationListData } from 'app/components/pickers/AutocompletePickers/SubLocationListPicker';\r\n\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport DatesRangeFilter from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { initLogStatusesData } from 'app/components/pickers/StaticOptionsPickers/BarcodeLogStatusPicker';\r\nimport BarcodeLogStatusFilter from 'app/components/BasicTable/Filters/BarcodeLogStatusFilter';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { Roles } from 'api/odata/generated/enums/Roles';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport const GetFilters: GetPageFilters<IBarcodeScanLogDto> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParamsCI(search);\r\n  const hideRoomFloor =\r\n    tryParseBool(\r\n      settings?.GetString(AllowedSettings.HideRoomFloorTextBoxes),\r\n    ) === true;\r\n  const isAdmin =\r\n    user !== undefined &&\r\n    user !== null &&\r\n    (user?.Roles?.includes(Roles.Administrators) ||\r\n      user?.Roles?.includes(Roles.InventoryAdmin));\r\n  var result: IFilterSettings<IBarcodeScanLogDto>[] = [\r\n    {\r\n      fieldName: 'AssetId',\r\n      queryStringSerializer: arrayToQueryString('aid'),\r\n      displayName: t(translations.AssetName), //(displayed as Resource Name)\r\n      operator: ODataOperators.Includes,\r\n      value: getNumberEntityArray(params, 'aid'),\r\n      initData: initMultiPickerValue(initAssetMultiData),\r\n      component: AssetMultiFilter,\r\n      urlKey: 'aid',\r\n    },\r\n    {\r\n      fieldName: 'Date',\r\n      displayName: t(translations.EntryDate),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromInitPreset(\r\n        getPeriodTypesEntity('CustomDate'),\r\n        dateUtils.addMonths(new Date(), -1),\r\n        new Date(),\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      dateTimeClear: true,\r\n      component: DatesRangeFilter,\r\n      inversionDisabled: true,\r\n      urlKey: 'period',\r\n    },\r\n    {\r\n      fieldName: 'BuildingId',\r\n      displayName: t(translations.BuildingName),\r\n      queryStringSerializer: 'BuildingId',\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'BuildingId')),\r\n      ),\r\n      initData: initExPickerValue(\r\n        initBuildingData,\r\n        undefined,\r\n        'locations',\r\n        true,\r\n      ),\r\n      component: BuildingPickerFilter,\r\n      urlType: 'locations',\r\n    },\r\n    {\r\n      fieldName: 'RoomId',\r\n      displayName: t(translations.Room),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'roomId',\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'roomId')),\r\n      ),\r\n      initData: initExPickerValue(initRoomData, undefined, 'base', true),\r\n      urlType: 'base',\r\n      withoutServiceGroups: true,\r\n      component: RoomPickerFilter,\r\n      urlKey: 'roomId',\r\n    },\r\n    {\r\n      fieldName: 'StatusName',\r\n      queryStringSerializer: 'status',\r\n      displayName: t(translations.StatusName),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'status')),\r\n      ),\r\n      initData: initPickerValue(initLogStatusesData),\r\n      component: BarcodeLogStatusFilter,\r\n      urlKey: 'status',\r\n    },\r\n    {\r\n      fieldName: 'LocationId',\r\n      queryStringSerializer: 'locationid',\r\n      displayName: t(translations.LocationList),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'locationid')),\r\n      ),\r\n      initData: initPickerValue(initLocationData),\r\n      component: LocationPickerFilter,\r\n    },\r\n    {\r\n      fieldName: 'SubLocationId',\r\n      queryStringSerializer: 'sublocationid',\r\n      displayName: t(translations.SubLocationsList),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'sublocationid')),\r\n      ),\r\n      initData: initPickerValue(initSubLocationListData),\r\n      component: SubLocationFilter,\r\n    },\r\n  ];\r\n  if (!hideRoomFloor) {\r\n    result.push({\r\n      fieldName: 'FloorName',\r\n      displayName: t(translations.FloorName),\r\n      operator: ODataOperators.Contains,\r\n      queryStringSerializer: 'floor',\r\n      value: GetStringOrUndefined(GetRawValue(params, 'floor')),\r\n      component: TextFieldFilter,\r\n      urlKey: 'floor',\r\n    });\r\n  }\r\n  if (isAdmin) {\r\n    result.push({\r\n      fieldName: 'Id',\r\n      queryStringSerializer: 'empty',\r\n      displayName: t(translations.ShowBarcodesWithoutAssetsOrRooms),\r\n      operator: ODataOperators.Equals,\r\n      value: GetBooleanEntity(\r\n        GetBooleanOrUndefined(GetRawValue(params, 'empty')),\r\n        t,\r\n      ),\r\n      component: BooleanPickerFilter,\r\n      customFilter: (value, settings, filters) => {\r\n        if ((value as Identifiable<boolean>)?.Id === true) {\r\n          return `${new Condition(\r\n            'AssetId',\r\n            ODataOperators.Equals,\r\n            null,\r\n          ).toString()} and ${new Condition(\r\n            'RoomId',\r\n            ODataOperators.Equals,\r\n            null,\r\n          ).toString()}`;\r\n        } else {\r\n          return undefined;\r\n        }\r\n      },\r\n      inversionDisabled: true,\r\n    });\r\n  }\r\n  return result;\r\n};\r\n","import { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { filterHandler } from 'app/components/BasicTable/UnconfigurableTable/FilterHandler';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport * as React from 'react';\r\nimport { Column } from 'react-table';\r\nimport { AuthenticatedUser, IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { useGlobalServiceGroupsFilter } from 'app/hooks/useGlobalServiceGroupsFilter';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { CustomEmptyTableProps } from 'app/components/BasicTable/components/CustomEmptyTable';\r\nimport { translations } from 'locales/translations';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\nimport { getColumns } from './GetColumns';\r\nimport { GetFilters } from './GetFilters';\r\n\r\nexport interface InventoryLogTableProps {\r\n  useSidePanel?: boolean;\r\n  authenticatedUser?: AuthenticatedUser;\r\n  closeSidePanel: () => void;\r\n  setFilters?: (\r\n    appliedFilters: IFilterSettings<IBarcodeScanLogDto>[] | undefined,\r\n  ) => void;\r\n  //   primaryAction?: (row: Row<IMyAssetsRow>) => void;\r\n  //   primaryMultiAction: (rows: IMyAssetsRow[]) => void;\r\n  screenName?: string;\r\n  openAsset: (id: number) => void;\r\n  customPredicates?: (string | Condition<IBarcodeScanLogDto>)[];\r\n  isShortView?: boolean;\r\n  emptyTable?: CustomEmptyTableProps;\r\n  searchTerm?: string;\r\n  defaultFilter?: (user: IAuthenticatedUser) => URLSearchParams;\r\n}\r\n\r\nexport function InventoryLogTable(props: InventoryLogTableProps) {\r\n  const {\r\n    useSidePanel,\r\n    authenticatedUser,\r\n    setFilters,\r\n    screenName,\r\n    isShortView = false,\r\n    emptyTable,\r\n    searchTerm,\r\n    defaultFilter,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const isMobile = DetectIsMobile();\r\n  //   const admins =\r\n  //     authenticatedUser !== undefined &&\r\n  //     (authenticatedUser.Roles.includes(Roles.Administrators) ||\r\n  //       authenticatedUser.Roles.includes(Roles.GroupAdministrators) ||\r\n  //       authenticatedUser.Roles.includes(Roles.LabTech) ||\r\n  //       authenticatedUser.Roles.includes(Roles.InventoryAdmin));\r\n\r\n  const searchColumns = React.useMemo(() => {\r\n    let result: string[] = [\r\n      'Username',\r\n      'UserDisplayName',\r\n      'Barcode',\r\n      'ServiceGroupName',\r\n      'AssetName',\r\n      'RoomName',\r\n      'FloorName',\r\n      'BuildingName',\r\n      'LocationName',\r\n      'SubLocationName',\r\n      'StatusName',\r\n      'Remarks',\r\n    ];\r\n    return result;\r\n  }, []);\r\n\r\n  const additionalColumns = React.useMemo(() => {\r\n    let result: string[] = [\r\n      'Id',\r\n      'ServiceId',\r\n      'AssetId',\r\n      'ServiceGroupId',\r\n      'RoomId',\r\n      'ServiceTypeId',\r\n      'BuildingId',\r\n      'LocationId',\r\n      'SubLocationId',\r\n      'Username',\r\n    ];\r\n    return result;\r\n  }, []);\r\n  //   const [multiAssetSelectionMode, setMultiAssetSelectionMode] = React.useState<\r\n  //     boolean\r\n  //   >(false);\r\n  //   const [selectedRowIds, setSelectedRowIds] = React.useState<\r\n  //     Record<IdType<number>, boolean>\r\n  //   >({});\r\n  //   const [, setCurrentMode, currentModeRef] = useState<TableMode>('card');\r\n  //   const [loacalAssets, setLoacalAssets, localAssetsRef] = useState<\r\n  //     Entity<number>[]\r\n  //   >([]);\r\n  //   React.useEffect(() => {\r\n  //     let obj = {};\r\n  //     if (!!assets && assets.length > 0) {\r\n  //       for (const key of assets) {\r\n  //         obj[key.Id] = true;\r\n  //       }\r\n  //       setMultiAssetSelectionMode(assets.length > 1);\r\n  //       setLoacalAssets(assets);\r\n  //     }\r\n  //     setSelectedRowIds(obj);\r\n  //   }, [assets, setLoacalAssets]);\r\n\r\n  const columns: Column<IBarcodeScanLogDto>[] = React.useMemo(\r\n    () => getColumns(t, authenticatedUser, appSettings, settings),\r\n    [t, authenticatedUser, appSettings, settings],\r\n  );\r\n  const initialState: IBasicTableState<IBarcodeScanLogDto> = React.useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Date', desc: true }],\r\n      //selectedRowIds: selectedRowIds,\r\n      globalFilter: searchTerm,\r\n    }),\r\n    [searchTerm],\r\n  );\r\n\r\n  //   const customFilter = React.useMemo(() => {\r\n  //     let filter: (string | Condition<IBarcodeScanLogDto>)[] = customPredicates ?? [];\r\n  //     if (actionType === 'StartUsage') {\r\n  //       filter.push(\r\n  //         new Condition<IBarcodeScanLogDto>('AutoMode', ODataOperators.Equals, 1),\r\n  //       );\r\n  //     }\r\n  //     if (actionType === 'TrainingSession') {\r\n  //       filter.push(\r\n  //         new Condition<IBarcodeScanLogDto>(\r\n  //           'TrainingSessionsEnabled',\r\n  //           ODataOperators.Equals,\r\n  //           true,\r\n  //         ),\r\n  //       );\r\n  //     }\r\n  //     return filter.length > 0 ? filter : undefined;\r\n  //   }, [actionType, customPredicates]);\r\n\r\n  const url = '/api/odata/v4/BarcodeScanLog';\r\n  const { serviceGroups } = useGlobalServiceGroupsFilter(false);\r\n  const TTable = React.useMemo(\r\n    () =>\r\n      filterHandler<IBarcodeScanLogDto, {}>(BasicTable, GetFilters, {\r\n        isSidePanel: useSidePanel,\r\n        setFilters: setFilters,\r\n        reservedQueryStringParameterNames: undefined,\r\n        getDefaultFilter: defaultFilter,\r\n        getRequiredFilter: undefined,\r\n        getSelectedViewFilter: undefined,\r\n        enableSavedLists: false,\r\n      }),\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    [useSidePanel],\r\n  );\r\n  return (\r\n    <React.Fragment>\r\n      <TTable\r\n        screenId={ScreensId.BarcodeScanLog}\r\n        api={url}\r\n        columns={columns}\r\n        screenName={screenName ?? t(translations.menu_AssetInventoryLog)}\r\n        screenNameVariant=\"section\"\r\n        additionalColumns={additionalColumns}\r\n        searchColumns={searchColumns}\r\n        serviceGroups={serviceGroups}\r\n        inlineRowActions={undefined}\r\n        // selectedRowsActions={selectedRowActions}\r\n        initialState={initialState}\r\n        isRowSelectable={undefined}\r\n        hideMenuOnMobile={useSidePanel}\r\n        useExport={true}\r\n        cardSize=\"small\"\r\n        viewCardsCheck={false}\r\n        allowCards={false}\r\n        compactTable={isShortView}\r\n        useConfigurable={true}\r\n        useCardsByDefault={false}\r\n        //pageActions={pageActions}\r\n        useRowSelect={false}\r\n        withToolBar={false}\r\n        customEmptyTableSettings={emptyTable}\r\n        // tabSectionSettings={{\r\n        //   useTabsSection: isAuthenticated,\r\n        //   getMultiMode: value => setMultiAssetSelectionMode(value),\r\n        //   selectedTabValue: undefined,\r\n        //   onAllRowsSelected: toggleAllRows,\r\n        //   disableMultiMode: multiModeDisabled,\r\n        //   defaultMultiMode: !multiModeDisabled,\r\n        //   // defaultMultiMode:\r\n        //   //   multiAssetSelectionMode === true ||\r\n        //   //   (!!localAssetsRef.current && localAssetsRef.current.length > 0),\r\n        // }}\r\n        //predicates={customFilter}\r\n        preventInnerClicks={isMobile}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { ColumnWithDep } from 'app/components/BasicTable/types/ColumnWithDeps';\r\nimport { AssetLink } from 'app/pages/AssetPopUp/OpenAssetDetails';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\n\r\nexport function getColumns(\r\n  t: TFunction,\r\n  user: AuthenticatedUser | undefined,\r\n  appSettings: AppSettings | null,\r\n  settings: GlobalSettings | null,\r\n) {\r\n  const hideRoomFloor =\r\n    tryParseBool(\r\n      settings?.GetString(AllowedSettings.HideRoomFloorTextBoxes),\r\n    ) === true;\r\n  const res: ColumnWithDep<IBarcodeScanLogDto>[] = [\r\n    {\r\n      Header: t(translations.HashSymbol) as string,\r\n      accessor: 'Id',\r\n    },\r\n    {\r\n      Header: t(translations.UserName) as string,\r\n      accessor: 'UserDisplayName',\r\n      Cell: ({ value, row }) => (\r\n        <>\r\n          <UserProfileLink\r\n            UserId={`${row.original.Username}`}\r\n            DisplayName={`${row.original.UserDisplayName}`}\r\n          />\r\n        </>\r\n      ),\r\n    },\r\n    {\r\n      Header: t(translations.EntryDate) as string,\r\n      accessor: 'Date',\r\n      Cell: DateRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.AssetName) as string,\r\n      accessor: 'AssetName',\r\n      Cell: ({ value, row }) => {\r\n        if (!!value && value !== null) {\r\n          if (\r\n            row.original.AssetId !== null &&\r\n            row.original.AssetId !== undefined\r\n          ) {\r\n            return (\r\n              <AssetLink id={row.original.AssetId ?? undefined}>\r\n                {value}\r\n              </AssetLink>\r\n            );\r\n          } else {\r\n            return <>{value}</>;\r\n          }\r\n        } else {\r\n          return <>{'N/A'}</>;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.BarCode) as string,\r\n      accessor: 'Barcode',\r\n    },\r\n    {\r\n      Header: t(translations.Room) as string,\r\n      accessor: 'RoomName',\r\n    },\r\n    {\r\n      Header: t(translations.Building) as string,\r\n      accessor: 'BuildingName',\r\n    },\r\n    {\r\n      Header: t(translations.LocationName) as string,\r\n      accessor: 'LocationName',\r\n    },\r\n    {\r\n      Header: t(translations.SubLocationName) as string,\r\n      accessor: 'SubLocationName',\r\n    },\r\n    {\r\n      Header: t(translations.StatusName) as string,\r\n      accessor: 'StatusName',\r\n    },\r\n    {\r\n      Header: t(translations.Remarks) as string,\r\n      accessor: 'Remarks',\r\n    },\r\n    {\r\n      Header: t(translations.ServiceGroupName) as string,\r\n      accessor: 'ServiceGroupName',\r\n    },\r\n  ];\r\n\r\n  if (!hideRoomFloor) {\r\n    res.push({\r\n      Header: t(translations.FloorName) as string,\r\n      accessor: 'FloorName',\r\n    });\r\n  }\r\n  return res;\r\n}\r\n","import { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { toURLSearchParams } from 'app/components/BasicTable/withSavedHistory';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { AssetPopUp } from 'app/pages/AssetPopUp';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { selectInventoryLogFilters } from 'app/pages/AssetsInventory/Details/slice/selectors';\r\nimport { useAssetInventorySlice } from 'app/pages/AssetsInventory/Details/slice';\r\nimport { IBarcodeScanLogDto } from './IBarcodeScanLogDto';\r\nimport { InventoryLogTable } from './InventoryLogTable';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { presetDatesRangeToQueryString } from 'app/components/BasicTable/types/FilterParam';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface InventoryLogProps extends CoverProps, SidePanelContentProps {\r\n  roomId?: number;\r\n  customPredicates?: (string | Condition<IBarcodeScanLogDto>)[];\r\n  pageLink?: string;\r\n  onClose?: () => void;\r\n  searchTerm?: string;\r\n}\r\n\r\nexport function InventoryLog(props: InventoryLogProps) {\r\n  const { useSidePanel, roomId, customPredicates, onClose, searchTerm } = props;\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const filters = useSelector(selectInventoryLogFilters);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAssetInventorySlice();\r\n  const { t } = useTranslation();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const isMobile = DetectIsMobile();\r\n  const [cover, setCover] = React.useState<React.ReactNode>();\r\n\r\n  const showShortView =\r\n    isMobile || (useSidePanel && !sidePanelExpanded) || props.isCover;\r\n  const pagelink = React.useMemo(\r\n    () =>\r\n      !!props.pageLink\r\n        ? props.pageLink\r\n        : buildURL(\r\n            `${publicUrl}Assets/Inventory/Log`,\r\n            Object.assign({}, filters, {\r\n              RoomId: roomId,\r\n              searchTerm: searchTerm,\r\n            }),\r\n          ),\r\n    [filters, props.pageLink, publicUrl, roomId, searchTerm],\r\n  );\r\n  const closeCover = () => {\r\n    setCover(undefined);\r\n  };\r\n\r\n  const closeSidePanel = React.useCallback(() => {\r\n    if (props.isCover) {\r\n      if (!!onClose) {\r\n        onClose();\r\n      } else {\r\n        dispatch(layoutActions.resetSidePanel());\r\n      }\r\n    } else {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    }\r\n  }, [dispatch, layoutActions, onClose, props.isCover]);\r\n  const openAsset = React.useCallback((id: number) => {\r\n    setCover(\r\n      <AssetPopUp\r\n        closeCover={closeCover}\r\n        isCover\r\n        identifier={{ id: id }}\r\n        onClose={closeCover}\r\n        showAllCores={true}\r\n        useSidePanel={true}\r\n      />,\r\n    );\r\n  }, []);\r\n\r\n  //   const IsAdmin = React.useCallback(\r\n  //     (log: IBarcodeScanLogDto) => {\r\n  //       return (\r\n  //         authenticatedUser?.IsAllGroupOrLabTechAdmin(\r\n  //           [log.ServiceGroupId ?? 0],\r\n  //           [\r\n  //             {\r\n  //               Id: log.ServiceId,\r\n  //               Name: log.AssetName,\r\n  //               ServiceTypeId: log.ServiceTypeId,\r\n  //             } as IServiceTypeFilterDto,\r\n  //           ],\r\n  //         ) ||\r\n  //         authenticatedUser?.Roles?.includes(Roles.Administrators) ||\r\n  //         authenticatedUser?.Roles?.includes(Roles.InventoryAdmin)\r\n  //       );\r\n  //     },\r\n  //     [authenticatedUser],\r\n  //   );\r\n\r\n  const setfilterCallback = React.useCallback(\r\n    (v: IFilterSettings<IBarcodeScanLogDto>[] | undefined) => {\r\n      const res = {};\r\n      if (!!v) {\r\n        toURLSearchParams(v).forEach((val, name) => {\r\n          res[name] = val;\r\n        });\r\n      }\r\n      dispatch(actions.setLogFilters(!v || v.length === 0 ? undefined : res));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const defaultFilterSearch = React.useCallback(\r\n    (user: IAuthenticatedUser) => {\r\n      let dateFilter = presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      )(\r\n        PresetDatesRange.fromInitPreset(\r\n          getPeriodTypesEntity('CustomDate'),\r\n          dateUtils.addMonths(new Date(), -1),\r\n          new Date(),\r\n        ),\r\n      );\r\n      if (roomId !== undefined) {\r\n        dateFilter.set('roomId', roomId.toString());\r\n      }\r\n      return dateFilter;\r\n    },\r\n    [roomId],\r\n  );\r\n  return (\r\n    <PageWrapper\r\n      id=\"inventory_log_page\"\r\n      pageLink={pagelink}\r\n      useSidePanel={useSidePanel || false}\r\n      pageName={undefined}\r\n      disableExpandToggle\r\n      //loading={loading}\r\n      //pageName={<Link href=\"coreselection\">{t(translations.menu_CoreSelection)}</Link>}\r\n      titlePage={t(translations.menu_AssetInventoryLog)}\r\n      closable={useSidePanel || props.isCover}\r\n      //disableExpandToggle={true}\r\n      //rightTopActions={topButtons}\r\n      isCover={props.isCover}\r\n      hideTitleBar={false}\r\n      cover={cover}\r\n      closeCover={props.closeCover || closeCover}\r\n      closeSidePanel={props.isCover ? onClose : undefined}\r\n      //leftTopActions={pageActions}\r\n      children={\r\n        <React.Fragment>\r\n          <InventoryLogTable\r\n            useSidePanel={useSidePanel}\r\n            setFilters={setfilterCallback}\r\n            authenticatedUser={authenticatedUser}\r\n            closeSidePanel={closeSidePanel}\r\n            screenName={undefined}\r\n            openAsset={openAsset}\r\n            customPredicates={customPredicates}\r\n            isShortView={showShortView}\r\n            emptyTable={undefined}\r\n            searchTerm={searchTerm}\r\n            defaultFilter={defaultFilterSearch}\r\n          />\r\n        </React.Fragment>\r\n      }\r\n    />\r\n  );\r\n}\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface SaveFormButtonProps extends ButtonProps {\r\n  edit: boolean;\r\n  text: string;\r\n  onClick: (e: any) => void;\r\n}\r\n\r\nexport function SaveFormButton({\r\n  edit,\r\n  text,\r\n  onClick,\r\n  ...props\r\n}: SaveFormButtonProps) {\r\n  return (\r\n    <Button {...props} onClick={onClick}>\r\n      {text}\r\n    </Button>\r\n  );\r\n}\r\n","import { useTranslation } from 'react-i18next';\r\nimport { SavedViewDetailsState, SavedViewExtraData } from '../slice/types';\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { FormAssetsPicker } from 'app/components/Forms/FormAssetsPicker';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormSwitch } from 'app/components/Forms/Switch';\r\nimport { getsavedViewSchema } from './validationSchema';\r\nimport { AssetsFilterForSavedView } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n  IAssetDto,\r\n  mapAssetsToServiceTypeFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { Entity } from 'types/common';\r\nimport { Body } from 'app/components/Typography';\r\nimport { dateUtils } from 'utils/date-utils';\r\n\r\nexport interface SavedViewFormProps {\r\n  onSubmit: (item: SavedViewDetailsState) => void;\r\n  initialValues: SavedViewDetailsState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isEdit: boolean;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  onEquipmentClicked?: (equipment: Entity<number>) => void;\r\n  viewOnly: boolean;\r\n  ExtraData?: SavedViewExtraData;\r\n}\r\n\r\nexport const SavedViewForm = React.memo(function SavedViewForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isEdit,\r\n  isAdmin,\r\n  user,\r\n  viewOnly,\r\n  ExtraData,\r\n  onEquipmentClicked,\r\n}: SavedViewFormProps) {\r\n  const { t } = useTranslation();\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n  // const areTheSameServiceGroup = (assets: IAssetDto[]): boolean => {\r\n  //   let groupId = assets.filter(\r\n  //     f => f.ServiceGroupId != null && f.ServiceGroupId !== undefined,\r\n  //   )[0].ServiceGroupId;\r\n  //   return assets.every(\r\n  //     v =>\r\n  //       v.ServiceGroupId === null ||\r\n  //       v.ServiceGroupId === undefined ||\r\n  //       v.ServiceGroupId === groupId,\r\n  //   );\r\n  // };\r\n  const userIsServiceGroupAdmin = (assets: IAssetDto[]): boolean => {\r\n    return (\r\n      user?.IsAllGroupOrLabTechAdmin(\r\n        assets.map(g => g.ServiceGroupId ?? 0),\r\n        mapAssetsToServiceTypeFilterDto(assets),\r\n      ) || false\r\n    );\r\n  };\r\n  const savedViewSchema = React.useMemo(() => getsavedViewSchema(t), [t]);\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={savedViewSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={false}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          if (viewOnly) return;\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          return (\r\n            <>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormLeftSection>\r\n                  {isEdit && !!ExtraData && (\r\n                    <FormFieldsSection>\r\n                      <>\r\n                        <FormRow>\r\n                          <Body bold>{t(translations.CreatedBy)}</Body>\r\n                          <Body>{ExtraData.userName}</Body>\r\n                        </FormRow>\r\n                        <FormRow>\r\n                          <Body bold>{t(translations.CreatedAt)}</Body>\r\n                          <Body>\r\n                            {dateUtils.shortDateTimeFormat(ExtraData.createdAt)}\r\n                          </Body>\r\n                        </FormRow>\r\n                        <FormRow>\r\n                          <Body bold>{t(translations.TimesUsed)}</Body>\r\n                          <Body>{ExtraData.usages}</Body>\r\n                        </FormRow>\r\n                      </>\r\n                    </FormFieldsSection>\r\n                  )}\r\n                  <FormFieldsSection>\r\n                    <FormRow>\r\n                      <FormTextField\r\n                        name=\"Name\"\r\n                        label={t(translations.SavedViewName)}\r\n                        placeholder={t(translations.SavedViewName)}\r\n                        disabled={viewOnly || formik.isSubmitting}\r\n                        autoComplete=\"on\"\r\n                        id=\"SavedViewNameId\"\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormAssetsPicker\r\n                        filter={AssetsFilterForSavedView(selectedServiceGroups)}\r\n                        onChipClick={onEquipmentClicked}\r\n                        name=\"Assets\"\r\n                        label={t(translations.SavedViewAssets)}\r\n                        placeholder={t(translations.SavedViewAssetsPlaceholder)}\r\n                        disabled={viewOnly || formik.isSubmitting}\r\n                        fullWidth\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormSwitch\r\n                        boldLebel\r\n                        name=\"Shared\"\r\n                        label={t(translations.SavedViewShared)}\r\n                        disabled={\r\n                          viewOnly ||\r\n                          formik.isSubmitting ||\r\n                          !(\r\n                            formik.values.Assets?.length > 0 &&\r\n                            userIsServiceGroupAdmin(formik.values.Assets)\r\n                          )\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                    <FormRow fullRow={true}>\r\n                      <FormSwitch\r\n                        boldLebel\r\n                        info={t(translations.SavedViewBookMultiple_info)}\r\n                        name=\"Multiple\"\r\n                        label={t(translations.SavedViewBookMultiple)}\r\n                        disabled={\r\n                          viewOnly ||\r\n                          formik.isSubmitting ||\r\n                          formik.values.Assets?.length < 2\r\n                        }\r\n                      />\r\n                    </FormRow>\r\n                    {/* <FormRow hide={formik.values.Shared !== true}>\r\n                        <FormSharedToPicker\r\n                          name=\"SharedTo\"\r\n                          label={t(translations.SavedViewSharedTo)}\r\n                          disabled={formik.isSubmitting}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n\r\n                      <FormRow\r\n                        fullRow={true}\r\n                        hide={\r\n                          !(\r\n                            formik.values.Shared &&\r\n                            formik.values.SharedTo?.Id ===\r\n                              SharedWithType.shareWithUsers\r\n                          )\r\n                        }\r\n                      >\r\n                        <FormUsersPicker\r\n                          name=\"SharedUsers\"\r\n                          label={t(translations.SavedViewSharedUsers)}\r\n                          placeholder={t(\r\n                            translations.SavedViewSharedUsersPlaceholder,\r\n                          )}\r\n                          disabled={formik.isSubmitting}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow>\r\n                      <FormRow\r\n                        hide={\r\n                          !(\r\n                            formik.values.Shared &&\r\n                            formik.values.SharedTo?.Id ===\r\n                              SharedWithType.shareWithCores\r\n                          )\r\n                        }\r\n                      >\r\n                        <FormServiceGroupsPicker\r\n                          name=\"SharedCores\"\r\n                          label={t(translations.SavedViewSharedCores)}\r\n                          placeholder={t(\r\n                            translations.SavedViewSharedCoresPlaceholder,\r\n                          )}\r\n                          disabled={formik.isSubmitting}\r\n                          fullWidth\r\n                        />\r\n                      </FormRow> */}\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport * as Yup from 'yup';\r\nimport { SavedViewDetailsState } from '../slice/types';\r\n\r\nexport const getsavedViewSchema: (\r\n  t: TFunction,\r\n) => Yup.SchemaOf<SavedViewDetailsState> = t =>\r\n  Yup.object({\r\n    Id: Yup.number().notRequired().default(-1),\r\n    Name: Yup.string()\r\n      .required(t(translations.err_SavedViewNameRequired))\r\n      .typeError(t(translations.err_SavedViewNameRequired))\r\n      .label(t(translations.SavedViewName)),\r\n    Assets: Yup.array()\r\n      .of(EntityNumberSchema)\r\n      .min(1)\r\n      .required(t(translations.err_savedViewAssetRequired))\r\n      .label(t(translations.SavedViewAssets))\r\n      .typeError(t(translations.err_savedViewAssetRequired)),\r\n    Shared: Yup.boolean().label(t(translations.SavedViewShared)),\r\n    Multiple: Yup.boolean().label(t(translations.SavedViewBookMultiple)),\r\n    // SharedTo: Yup.mixed().label(i18next.t(translations.SavedViewSharedTo)),\r\n    // SharedCores: Yup.array()\r\n    //   .of(EntityNumberSchema)\r\n    //   .label(i18next.t(translations.SavedViewSharedCores)),\r\n    // SharedUsers: Yup.array()\r\n    //   .of(EntityStringSchema)\r\n    //   .label(i18next.t(translations.SavedViewSharedUsers)),\r\n  });\r\n","import { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { useSavedViewSlice } from '../slice';\r\nimport {\r\n  selectCreateSavedView,\r\n  selectCreateSavedViewCompleted,\r\n  selectCreateSavedViewHasError,\r\n  selectExtraData,\r\n  selectSavedViewProcessing,\r\n  selectUpdateSavedView,\r\n  selectUpdateSavedViewCompleted,\r\n  selectUpdateSavedViewHasError,\r\n  selectUpdateUserName,\r\n} from '../slice/selectors';\r\nimport { SavedViewDetailsState } from '../slice/types';\r\nimport * as React from 'react';\r\n//import { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport {\r\n  IAssetDto,\r\n  mapAssetsToServiceTypeFilterDto,\r\n} from 'api/odata/generated/entities/IAssetDto';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { push } from 'connected-react-router';\r\nimport { SaveFormButton } from './Actions/SavedViewActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { SavedViewForm } from './SavedViewForm';\r\nimport { Box } from '@material-ui/core';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { SidePanelContentProps } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useLeftTopActions } from './Actions/RightTopActions';\r\nimport { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { AssetPopUp } from 'app/pages/AssetPopUp';\r\n\r\nexport interface SavedViewDetailsProps extends SidePanelContentProps {\r\n  id?: string;\r\n  eid?: string;\r\n}\r\n\r\nexport function SavedViewDetails(props: SavedViewDetailsProps) {\r\n  const { id, useSidePanel, eid } = props;\r\n  const dispatch = useDispatch();\r\n  const { t } = useTranslation();\r\n  const { actions } = useSavedViewSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const loading = useSelector(selectSavedViewProcessing);\r\n  const [busy, setBusy] = React.useState<boolean>(false);\r\n  const [edit, setEdit] = React.useState<boolean>(false);\r\n\r\n  //   const [currentScreen, setCurrentScreen] = React.useState<\r\n  //     ScreensId | undefined\r\n  //   >(undefined);\r\n  //   const hasCreateProcessing = useSelector(selectCreateSavedViewProcessing);\r\n  //   const hasUpdateUpdateProcessing = useSelector(\r\n  //     selectUpdateSavedViewProcessing,\r\n  //   );\r\n  //const hasProcessing = hasCreateProcessing || hasUpdateUpdateProcessing;\r\n  const hasCreateError = useSelector(selectCreateSavedViewHasError);\r\n  const hasUpdateError = useSelector(selectUpdateSavedViewHasError);\r\n  const hasError = hasCreateError || hasUpdateError;\r\n  const requestCreateCompleted = useSelector(selectCreateSavedViewCompleted);\r\n  const requestUpdateCompleted = useSelector(selectUpdateSavedViewCompleted);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const createModel = useSelector(selectCreateSavedView, shallowEqual);\r\n  const editModel = useSelector(selectUpdateSavedView, shallowEqual);\r\n  const baseModel = createModel || editModel;\r\n\r\n  const hasChanges = useSelector(selectHasNotSavedChanges, shallowEqual);\r\n\r\n  //const continueToOther = useSelector(selectContinueState);\r\n\r\n  //   const isMobile = DetectIsMobile();\r\n  //   const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  //const showShortView = isMobile || (useSidePanel && !sidePanelExpanded);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const fullAdmin =\r\n    User !== undefined && User.Roles.includes(Roles.Administrators);\r\n  const IsAdmin = React.useMemo(() => {\r\n    return (\r\n      fullAdmin ||\r\n      User?.IsAllGroupOrLabTechAdmin(\r\n        baseModel?.Assets.map(g => (g as IAssetDto).ServiceGroupId ?? 0),\r\n        mapAssetsToServiceTypeFilterDto(\r\n          (baseModel?.Assets === undefined\r\n            ? []\r\n            : baseModel?.Assets) as IAssetDto[],\r\n        ),\r\n      )\r\n    );\r\n  }, [fullAdmin, User, baseModel]);\r\n\r\n  const savedViewUserName = useSelector(selectUpdateUserName);\r\n  const extraData = useSelector(selectExtraData);\r\n  const viewOnly = React.useMemo(() => {\r\n    return edit && !fullAdmin && User?.Id !== savedViewUserName;\r\n  }, [User?.Id, edit, fullAdmin, savedViewUserName]);\r\n\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  useEffectOnMount(() => {\r\n    if (id !== undefined && !isNaN(parseInt(id || ''))) {\r\n      dispatch(actions.initDetails(parseInt(id || '')));\r\n    } else {\r\n      dispatch(actions.initNewDetails(eid));\r\n    }\r\n    setBusy(false);\r\n    setEdit(false);\r\n    setRequestCompleted(undefined);\r\n    return () => {};\r\n  });\r\n  const submitFormRef = React.useRef<any>(null);\r\n\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n  const handleSubmitForm = (e: any) => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: SavedViewDetailsState) => {\r\n      setBusy(true);\r\n      if (edit) {\r\n        dispatch(\r\n          actions.updateView({\r\n            current: values,\r\n            original: baseModel,\r\n          }),\r\n        );\r\n      } else {\r\n        dispatch(actions.createView(values));\r\n      }\r\n    },\r\n    [actions, baseModel, dispatch, edit],\r\n  );\r\n  const handleClose = () => {\r\n    if (hasChanges) {\r\n      dispatch(layoutActions.setConfirmOpen(true));\r\n    } else {\r\n      handleCancelClick();\r\n    }\r\n  };\r\n  const handleCancelClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n    } else {\r\n      dispatch(push('/SavedViews'));\r\n    }\r\n    if (edit) {\r\n      dispatch(actions.resetUpdateSavedViewState());\r\n    } else {\r\n      dispatch(actions.resetCreateSavedViewState());\r\n    }\r\n  }, [actions, dispatch, edit, layoutActions, useSidePanel]);\r\n\r\n  React.useEffect(() => {\r\n    let active = loading === false;\r\n    if (active) {\r\n      if (id !== undefined && !isNaN(parseInt(id))) {\r\n        setEdit(true);\r\n      }\r\n      if (requestCreateCompleted === true || requestUpdateCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          handleCancelClick();\r\n        }\r\n      } else if (\r\n        requestCreateCompleted === false ||\r\n        requestUpdateCompleted === false\r\n      ) {\r\n        setRequestCompleted(false);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    baseModel,\r\n    handleCancelClick,\r\n    hasError,\r\n    id,\r\n    loading,\r\n    requestCompleted,\r\n    requestCreateCompleted,\r\n    requestUpdateCompleted,\r\n  ]);\r\n\r\n  const leftActions = React.useMemo(() => {\r\n    if (viewOnly) return [];\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <SaveFormButton\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"save\" />}\r\n            onClick={handleSaveClick}\r\n            disabled={busy}\r\n            processing={!requestCompleted && busy}\r\n            edit={edit}\r\n            text={t(translations.Save)}\r\n          />\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [busy, edit, handleSaveClick, requestCompleted, t, viewOnly]);\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCancelClick}\r\n          >\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCancelClick, t]);\r\n\r\n  const leftTopActions = useLeftTopActions({\r\n    savedView: baseModel as ISavedViewDto,\r\n    isNew: !edit,\r\n    useSidePanel: useSidePanel,\r\n    extraData: extraData,\r\n  });\r\n  const [cover, setCover] = React.useState<React.ReactNode>();\r\n  const closeCover = () => {\r\n    setCover(undefined);\r\n  };\r\n\r\n  return (\r\n    <>\r\n      <PageWrapper\r\n        disableExpandToggle={true}\r\n        pageName={\r\n          edit\r\n            ? t(translations.menu_EditSavedView)\r\n            : t(translations.menu_AddNewSavedView)\r\n        }\r\n        titlePage={\r\n          baseModel\r\n            ? edit\r\n              ? `Edit ${baseModel.Name} #${id || 'N/A'}`\r\n              : ` ${t(translations.AddNew)} List`\r\n            : undefined\r\n        }\r\n        loading={loading}\r\n        useSidePanel={useSidePanel}\r\n        closable={true}\r\n        closeSidePanel={handleClose}\r\n        cover={cover}\r\n        closeCover={closeCover}\r\n        children={\r\n          baseModel !== undefined && !loading ? (\r\n            <React.Fragment>\r\n              <SavedViewForm\r\n                initialValues={baseModel || ({} as SavedViewDetailsState)}\r\n                bindSubmitForm={bindSubmitForm}\r\n                onSubmit={handleSubmit}\r\n                isEdit={edit}\r\n                isAdmin={IsAdmin || false}\r\n                user={User}\r\n                ExtraData={extraData}\r\n                viewOnly={viewOnly}\r\n                onEquipmentClicked={asset => {\r\n                  setCover(\r\n                    <AssetPopUp\r\n                      closeCover={closeCover}\r\n                      isCover\r\n                      identifier={{ id: asset.Id }}\r\n                      onClose={closeCover}\r\n                      useSidePanel={true}\r\n                    />,\r\n                  );\r\n                }}\r\n              />\r\n            </React.Fragment>\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={loading} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + 'mylists/details', { id: id })}\r\n        toPageLink={`mylists/details?${toQueryString({ id: id })}`}\r\n        leftActions={leftActions}\r\n        rightActions={rightActions}\r\n        leftTopActions={leftTopActions}\r\n        maxLeftTopButtonsLength={1}\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </>\r\n  );\r\n}\r\n","import { ISavedViewDto } from 'api/odata/generated/entities/ISavedViewDto';\r\nimport { savedViewsApi } from 'api/savedViewsApi';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { ReservationCreateButton } from 'app/components/ReservationCreateButton';\r\nimport { AddWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/AddWorkOrder';\r\nimport { BringBackUp } from 'app/pages/Actions/GlobalSelectedActions/BringBackUp';\r\nimport { DownWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/DownWorkOrder';\r\nimport { OpenCalendar } from 'app/pages/Actions/GlobalSelectedActions/OpenCalendar';\r\nimport { OpenTimeline } from 'app/pages/Actions/GlobalSelectedActions/OpenTimeline';\r\nimport { OpenWorkOrders } from 'app/pages/Actions/GlobalSelectedActions/OpenWrokOrders';\r\nimport { RenderTypes } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes';\r\nimport { useAssetsPermissions } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport { useCallback, useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { GetResponseMessages, IResponseType } from 'types/ResponseType';\r\nimport { useSavedViewSlice } from '../../slice';\r\nimport { SavedViewExtraData } from '../../slice/types';\r\n\r\nexport interface GetLeftTopActionsProps {\r\n  savedView?: ISavedViewDto;\r\n  isNew: boolean;\r\n  useSidePanel?: boolean;\r\n  extraData?: SavedViewExtraData;\r\n}\r\n\r\ntype filterableArray<T> = Array<{ notShown?: boolean; value: T }>;\r\n\r\nexport const useLeftTopActions: (\r\n  props: GetLeftTopActionsProps,\r\n) => ActionRenderer[] = ({\r\n  savedView,\r\n  isNew,\r\n  useSidePanel,\r\n  extraData,\r\n}: GetLeftTopActionsProps) => {\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const isAdmin = useMemo(() => {\r\n    return authenticatedUser?.Roles.includes(Roles.Administrators);\r\n  }, [authenticatedUser]);\r\n  const isServiceGroupAdmin = useMemo(() => {\r\n    return authenticatedUser?.Roles.includes(Roles.GroupAdministrators);\r\n  }, [authenticatedUser]);\r\n  const { allowedToView } = useAssetsPermissions();\r\n  const rows = useMemo(() => (savedView === undefined ? [] : [savedView]), [\r\n    savedView,\r\n  ]);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useSavedViewSlice();\r\n\r\n  const useView = useCallback(() => {\r\n    dispatch(actions.useSavedView(savedView?.Id));\r\n  }, [actions, dispatch, savedView?.Id]);\r\n\r\n  const result = useMemo(() => {\r\n    if (savedView === undefined || isNew) return [];\r\n    const res: filterableArray<ActionRenderer> = [\r\n      {\r\n        notShown:\r\n          !allowedToView(savedView.Assets, RenderTypes.OpenCalendar) ||\r\n          !savedView.Assets.some(a => a.BookableAsset),\r\n        value: () => (\r\n          <OpenCalendar\r\n            rows={rows}\r\n            getEquipmentIds={rows =>\r\n              rows.flatMap(r =>\r\n                r.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0),\r\n              ) || []\r\n            }\r\n            startIcon={<Icon icon=\"add\" />}\r\n            primary\r\n            bookMultiple={savedView.Multiple}\r\n            onClick={useView}\r\n          />\r\n        ),\r\n      },\r\n      {\r\n        notShown:\r\n          !(isAdmin || isServiceGroupAdmin) ||\r\n          !allowedToView(savedView.Assets, RenderTypes.AddWorkOrder),\r\n        value: () => (\r\n          <AddWorkOrder\r\n            rows={rows}\r\n            getAssets={rows =>\r\n              new Promise((resolve, reject) => {\r\n                resolve(rows.flatMap(a => a.Assets) || []);\r\n              })\r\n            }\r\n            buttonName={t(translations.AddEvent)}\r\n            primary={!savedView.Assets.some(a => a.BookableAsset)}\r\n            useSidePanel={useSidePanel}\r\n            onClick={useView}\r\n          />\r\n        ),\r\n      },\r\n      {\r\n        notShown: authenticatedUser?.Name !== extraData?.userName && !isAdmin,\r\n        value: submit => (\r\n          <SelectedRowsActionIconButton\r\n            key=\"delete_savedview\"\r\n            title={t(translations.Delete)}\r\n            text={t(translations.Delete)}\r\n            confirm={true}\r\n            validConfirm={true}\r\n            confirmTitle={t(translations.Delete) as string}\r\n            rows={rows}\r\n            onRefresh={() => submit?.()}\r\n            variantButton=\"button\"\r\n            action={() =>\r\n              new Promise<IResponseType>((resolve, reject) => {\r\n                return savedViewsApi\r\n                  .deleteSavedViews(rows)\r\n                  .then(response => {\r\n                    const messages: IResponseType = GetResponseMessages(\r\n                      response,\r\n                      t(translations.Success) as string,\r\n                    );\r\n                    resolve(messages);\r\n                  })\r\n                  .catch(error => {\r\n                    console.log('Error: ', error);\r\n                    let err = t(translations.Failed) as string;\r\n                    reject(err);\r\n                  });\r\n              })\r\n            }\r\n          />\r\n        ),\r\n      },\r\n      {\r\n        notShown: !allowedToView(savedView.Assets, RenderTypes.OpenTimeline),\r\n        value: () => (\r\n          <OpenTimeline\r\n            rows={rows}\r\n            getEquipmentIds={rows =>\r\n              rows.flatMap(r =>\r\n                r.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0),\r\n              ) || []\r\n            }\r\n          />\r\n        ),\r\n      },\r\n      {\r\n        notShown: !allowedToView(savedView.Assets, RenderTypes.NewReservation),\r\n        value: () => (\r\n          <ReservationCreateButton\r\n            useSidePanel={useSidePanel}\r\n            instruments={\r\n              savedView.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0) ||\r\n              []\r\n            }\r\n          >\r\n            {t(translations.AddReservation)}\r\n          </ReservationCreateButton>\r\n        ),\r\n      },\r\n      {\r\n        notShown:\r\n          !(isAdmin || isServiceGroupAdmin) ||\r\n          !allowedToView(savedView.Assets, RenderTypes.OpenWorkOrders),\r\n        value: () => (\r\n          <OpenWorkOrders\r\n            rows={rows}\r\n            getAssetIds={r => r.flatMap(a => a.Assets).map(a => a.Id) || []}\r\n          />\r\n        ),\r\n      },\r\n      {\r\n        notShown:\r\n          !(isAdmin || isServiceGroupAdmin) ||\r\n          !allowedToView(savedView.Assets, RenderTypes.DownWorkOrder),\r\n        value: () => (\r\n          <DownWorkOrder\r\n            rows={rows}\r\n            getAssets={rows =>\r\n              new Promise((resolve, reject) => {\r\n                resolve(rows.flatMap(a => a.Assets) || []);\r\n              })\r\n            }\r\n            buttonName={t(translations.TakeDown)}\r\n            useSidePanel={useSidePanel}\r\n          />\r\n        ),\r\n      },\r\n      {\r\n        notShown:\r\n          !(isAdmin || isServiceGroupAdmin) ||\r\n          !allowedToView(savedView.Assets, RenderTypes.BringBackUp),\r\n        value: () => (\r\n          <BringBackUp\r\n            rows={rows}\r\n            useSidePanel={useSidePanel}\r\n            getAssetIds={r => r.flatMap(a => a.Assets).map(a => a.Id) || []}\r\n            getEquipmentIds={rows =>\r\n              rows.flatMap(r =>\r\n                r.Assets.map(a => a.ServiceId ?? 0).filter(f => f > 0),\r\n              ) || []\r\n            }\r\n          />\r\n        ),\r\n      },\r\n    ];\r\n    return res.filter(f => !f.notShown).map(f => f.value);\r\n  }, [\r\n    allowedToView,\r\n    authenticatedUser?.Name,\r\n    extraData?.userName,\r\n    isAdmin,\r\n    isNew,\r\n    isServiceGroupAdmin,\r\n    rows,\r\n    savedView,\r\n    t,\r\n    useSidePanel,\r\n    useView,\r\n  ]);\r\n  return result;\r\n};\r\n","/* eslint-disable prettier/prettier */\r\nimport {\r\n  makeStyles,\r\n  Theme,\r\n  createStyles,\r\n  Paper,\r\n  List,\r\n  ListItem,\r\n  Grid,\r\n  ListItemText,\r\n  Divider,\r\n} from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport const HtmlDefaultTemplate: string =\r\n  '<p ></p><p >Company name, IL 60637</p><p >Invoice ID: {@InvoiceLinkId}</p><p >Dates: From {@InvoiceFromDate} To {@InvoiceToDate}</p><p > </p><table style=\"height: 70px; width: 99.3288%; border-collapse: collapse; border: solid 1px; font-size: 13px; margin: center;\" ><tbody ><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Invoice Date</td><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Processed By</td><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >User Group</td><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Core</td><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Total Cost</td></tr><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF;\" ><p >{@InvoiceDate}</p></td><td style=\"border: solid 1px #CCCCCF;\" ><p >{@InvoiceProcessedUser}</p></td><td style=\"border: solid 1px #CCCCCF;\" ><p >{@InvoiceUserGroup}</p></td><td style=\"border: solid 1px #CCCCCF;\" ><p >{@InvoiceCore}</p></td><td style=\"border: solid 1px #CCCCCF;\" >{@InvoiceTotalCost}</td></tr></tbody></table><p > </p><table style=\"height: 70px; width: 99.3288%; border-collapse: collapse; border: solid 1px; font-size: 13px; margin: center;\" ><tbody ><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" > </td><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Customer </td><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Misc</td></tr><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Name</td><td style=\"border: solid 1px #CCCCCF;\" >{@InvoiceProcessedUser}</td><td style=\"border: solid 1px #CCCCCF;\" > </td></tr><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Billing Adress</td><td style=\"border: solid 1px #CCCCCF;\" >{@BillingAddress1}</td><td style=\"border: solid 1px #CCCCCF;\" > </td></tr><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >City</td><td style=\"border: solid 1px #CCCCCF;\" >{@BillingAddress2}</td><td style=\"border: solid 1px #CCCCCF;\" > </td></tr><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >State</td><td style=\"border: solid 1px #CCCCCF;\" >{@BillingAddress3}</td><td style=\"border: solid 1px #CCCCCF;\" > </td></tr><tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\" ><td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\" >Country</td><td style=\"border: solid 1px #CCCCCF;\" >{@BillingAddress4}</td><td style=\"border: solid 1px #CCCCCF;\" > </td></tr></tbody></table><p > </p><p >{@InvoiceSummaryTable}</p><p >Remarks: {@InvoiceRemarks}</p>';\r\n\r\n/* export const HtmlDefaultTemplate: string =\r\n  '<p>' +\r\n  'Company name, IL 60637' +\r\n  '</p>' +\r\n  '<p>Invoice ID: {@InvoiceLinkId}</p>' +\r\n  '<p>Dates: From {@InvoiceFromDate} To {@InvoiceToDate}</p>' +\r\n  '<p> </p>' +\r\n  '<table style=\"height: 70px; width: 99.3288%; border-collapse: collapse; border: solid 1px; font-size: 13px; margin: center;\">' +\r\n  '<tbody>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px #CCCCCF; background-color: #D6EEEE;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Invoice Date</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Processed By</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">User Group</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Core</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Total Cost</td>' +\r\n  '</tr>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px; background-color: #D6EEEE;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">' +\r\n  '<p>{@InvoiceDate}</p>' +\r\n  '</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">' +\r\n  '<p>{@InvoiceProcessedUser}</p>' +\r\n  '</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">' +\r\n  '<p>{@InvoiceUserGroup}</p>' +\r\n  '</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">' +\r\n  '<p>{@InvoiceCore}</p>' +\r\n  '</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">{@InvoiceTotalCost}</td>' +\r\n  '</tr>' +\r\n  '</tbody>' +\r\n  '</table>' +\r\n  '<p> </p>' +\r\n  '<table style=\"height: 70px; width: 99.3288%; border-collapse: collapse; border: solid 1px; font-size: 13px; margin: center;\">' +\r\n  '<tbody>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\"> </td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Customer </td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Misc</td>' +\r\n  '</tr>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Name</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">{@InvoiceProcessedUser}</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\"> </td>' +\r\n  '</tr>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Billing Adress</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">{@BillingAddress1}</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\"> </td>' +\r\n  '</tr>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">City</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">{@BillingAddress2}</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\"> </td>' +\r\n  '</tr>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">State</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">{@BillingAddress3}</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\"> </td>' +\r\n  '</tr>' +\r\n  '<tr style=\"width: 18px; height: 15px; vertical-align: bottom; text-align: center; border: solid 1px;\">' +\r\n  '<td style=\"border: solid 1px #CCCCCF; background-color: #D6EEEE;\">Country</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\">{@BillingAddress4}</td>' +\r\n  '<td style=\"border: solid 1px #CCCCCF;\"> </td>' +\r\n  '</tr>' +\r\n  '</tbody>' +\r\n  '</table>' +\r\n  '<p> </p>' +\r\n  '<p>{@InvoiceSummaryTable}</p>' +\r\n  '<p>{@InvoiceSummury_BudgetUserService}</p>' +\r\n  '<p>Remarks: {@InvoiceRemarks}</p>' +\r\n  '<p>More details can be obtained by clicking on the Invoice ID.  The statement total will be charged to your budget accounts as detailed above 5 business days after the statement date. Please contact your facility management with any billing questions.</p>';\r\n */\r\nexport function PopUpListItems(): JSX.Element {\r\n  //SETTINGS\r\n  const { t } = useTranslation();\r\n\r\n  //CSS\r\n  const useStyles = makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      invoiceTemplateRightSection: {\r\n        width: '100%',\r\n        //maxWidth: 570,\r\n        backgroundColor: theme.palette.background.default,\r\n        position: 'relative',\r\n        overflow: 'auto',\r\n        maxHeight: '63vh',\r\n        overflowY: 'auto',\r\n        '&::-webkit-scrollbar': {\r\n          width: '6px',\r\n        },\r\n        '&::-webkit-scrollbar-thumb': {\r\n          boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n          borderRadius: '6px',\r\n          backgroundColor: theme.palette.common.grayBorders,\r\n        },\r\n      },\r\n      paper: {\r\n        padding: theme.spacing(2),\r\n        backgroundColor: theme.palette.background.default,\r\n        border: '1px solid #E3E3E3',\r\n      },\r\n    }),\r\n  );\r\n  const classes = useStyles();\r\n\r\n  //RENDER\r\n  return (\r\n    <Paper className={classes.paper}>\r\n      <List className={classes.invoiceTemplateRightSection}>\r\n        <ListItem>\r\n          <Grid container>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BillingAddress1}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BillingAddress_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BillingAddress2}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BillingAddress_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BillingAddress3}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BillingAddress_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BillingAddress4}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BillingAddress_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetActivityCode}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetActivityCode_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetCostCenter}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetCostCenter_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetExtraTextField1}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetExtraTextField1_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetExtraTextField2_info}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetExtraTextField2_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetExtraTextField3}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetExtraTextField3_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetExtraTextField4}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetExtraTextField4_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetExtraTextField5}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetExtraTextField5_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetProjectCode}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetProjectCode_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@BudgetProjectName}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetProjectName_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@CoreCostCenter}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.CoreCostCenter_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@CreditCode}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.CreditCode_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceBalance}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceBalance_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceCore}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceCore_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceCurrency}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceCurrency_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceCustomerEHF}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceCustomerEHF_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceCustomerRef}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceCustomerRef_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceDate}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceDate_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceDepartment}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceDepartment_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceFromDate}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceFromDate_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceId}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceId_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceInstitute}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceInstitute_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceInstituteType}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceInstituteType_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceLinkId}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceIdLink_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceProcessedUser}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceProcessedUser_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceProcessedUserEmail}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceProcessedUserEmail_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceProcessedUserGroup}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceProcessedUserGroup_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceProcessedUserMobile}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceProcessedUserMobile_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceProcessedUserPhone}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceProcessedUserPhone_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceProject}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceProjectNumber_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceRemarks}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceRemarks_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={10} md={10}>\r\n              <ListItemText primary=\"{@InvoiceSummary_BudgetUserService_GroupedByBudget}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ConfigureColumns)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                target=\"_blank\"\r\n                href={toRootedURL(\r\n                  `/ConfigurableColumn.aspx?ID=${ScreensId.InvoiceLetters}&type=5`,\r\n                )}\r\n              >\r\n                <Icon icon=\"cog\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceSummaryTable_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={10} md={10}>\r\n              <ListItemText primary=\"{@InvoiceSummaryServicesTable}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ConfigureColumns)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                target=\"_blank\"\r\n                href={toRootedURL(\r\n                  `/ConfigurableColumn.aspx?ID=${ScreensId.InvoiceLetters}&type=3`,\r\n                )}\r\n              >\r\n                <Icon icon=\"cog\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceSummarServicesTable_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={10} md={10}>\r\n              <ListItemText primary=\"{@InvoiceSummaryTable}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ConfigureColumns)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                target=\"_blank\"\r\n                href={toRootedURL(\r\n                  `/ConfigurableColumn.aspx?ID=${ScreensId.InvoiceLetters}&type=2`,\r\n                )}\r\n              >\r\n                <Icon icon=\"cog\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceSummaryTable_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={10} md={10}>\r\n              <ListItemText primary=\"{@InvoiceSummury_BudgetUserService_NoGrouped}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ConfigureColumns)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                target=\"_blank\"\r\n                href={toRootedURL(\r\n                  `/ConfigurableColumn.aspx?ID=${ScreensId.InvoiceLetters}&type=4`,\r\n                )}\r\n              >\r\n                <Icon icon=\"cog\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceSummaryTable_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={10} md={10}>\r\n              <ListItemText primary=\"{@InvoiceSummury_BudgetUserService}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ConfigureColumns)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                target=\"_blank\"\r\n                href={toRootedURL(\r\n                  `/ConfigurableColumn.aspx?ID=${ScreensId.InvoiceLetters}&type=1`,\r\n                )}\r\n              >\r\n                <Icon icon=\"cog\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceSummury_BudgetUserService_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={10} md={10}>\r\n              <ListItemText primary=\"{@InvoiceSummaryByInvoiceRowsNonGrouped}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ConfigureColumns)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n                target=\"_blank\"\r\n                href={toRootedURL(\r\n                  `/ConfigurableColumn.aspx?ID=${ScreensId.InvoiceLetters}&type=6`,\r\n                )}\r\n              >\r\n                <Icon icon=\"cog\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceSummaryByInvoiceRowsNonGrouped)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceToDate}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceToDate_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceTotalCost}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceTotalCost_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceUserGroup}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceAdGroup_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceUserGroupEmail}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceUserGroupEmail_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoiceVAT}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceVAT_template_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@InvoicingRemarks}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.BudgetInvoicingRemarks_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@LastRequestID}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.LastRequestID_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@LetterDate}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.LetterDate_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@ProjectActivity}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ProjectActivity_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@ProjectNumber}\" />\r\n              <Divider />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.ProjectNumber_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n            <Grid item xs={11} md={11}>\r\n              <ListItemText primary=\"{@UserGroupName}\" />\r\n            </Grid>\r\n            <Grid item xs={1} md={1}>\r\n              <IconButton\r\n                title={t(translations.InvoiceUserGroup_info)}\r\n                variant=\"ghost\"\r\n                shape=\"square\"\r\n                size=\"small\"\r\n              >\r\n                <Icon icon=\"info-circle\" color=\"primary\" />\r\n              </IconButton>\r\n            </Grid>\r\n          </Grid>\r\n        </ListItem>\r\n      </List>\r\n    </Paper>\r\n  );\r\n}\r\n","import {\r\n  Dialog,\r\n  DialogTitle,\r\n  DialogContent,\r\n  //DialogContentText,\r\n  DialogActions,\r\n  createStyles,\r\n  makeStyles,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { TextField } from 'app/components/TextField';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport React, { Dispatch, SetStateAction, useCallback } from 'react';\r\nimport { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { IInvoiceTemplatePopUp } from '../IInvoiceTemplatePopUp';\r\n\r\nexport interface HtmlTextBoxProps extends ButtonProps {\r\n  Id: number | undefined;\r\n  className?: string | undefined;\r\n  setInitialValue: Dispatch<SetStateAction<IInvoiceTemplatePopUp>>;\r\n  isEdit: boolean;\r\n  setBusy: (value: SetStateAction<boolean>) => void;\r\n  formikValues: IInvoiceTemplatePopUp;\r\n}\r\n\r\nexport const HtmlTextBox = ({\r\n  Id,\r\n  className,\r\n  setInitialValue,\r\n  isEdit,\r\n  setBusy,\r\n  formikValues,\r\n}: HtmlTextBoxProps): JSX.Element => {\r\n  //PROPS\r\n  const { t } = useTranslation();\r\n\r\n  //REDUX\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n\r\n  //STATES\r\n  const [open, setOpen] = useState<boolean>(false);\r\n  const [textBoxValue, setTextBoxValue] = useState<string | null | undefined>(\r\n    formikValues.Html,\r\n  );\r\n\r\n  //FUNCTIONS\r\n  const OnUpdate = useCallback(\r\n    (invoiceTemplate: IInvoiceTemplatePopUp) => {\r\n      setBusy(true);\r\n      setInitialValue(invoiceTemplate);\r\n      dispatch(actions.resetSidePanel());\r\n      //if Add mode\r\n      if (!isEdit) {\r\n        dispatch(\r\n          actions.openSidePanel({\r\n            type: RenderPageType.InvoiceTemplatePopUp,\r\n            expanded: true,\r\n            props: {},\r\n          }),\r\n        );\r\n      } else {\r\n        //if Edit mode\r\n        dispatch(\r\n          actions.openSidePanel({\r\n            type: RenderPageType.InvoiceTemplatePopUp,\r\n            expanded: true,\r\n            props: {\r\n              Id: Id,\r\n            },\r\n          }),\r\n        );\r\n      }\r\n      setBusy(false);\r\n    },\r\n    [Id, actions, dispatch, isEdit, setBusy, setInitialValue],\r\n  );\r\n\r\n  //CSS\r\n  const useStyles = makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      invoiceTemplateHtmlTextBox: {\r\n        width: '100%',\r\n        minWidth: 500,\r\n        backgroundColor: theme.palette.background.default,\r\n        //position: 'relative',\r\n        //overflow: 'auto',\r\n        maxHeight: '63vh',\r\n        overflowY: 'auto',\r\n        '&::-webkit-scrollbar': {\r\n          width: '6px',\r\n        },\r\n        '&::-webkit-scrollbar-thumb': {\r\n          boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n          borderRadius: '6px',\r\n          backgroundColor: theme.palette.common.grayBorders,\r\n        },\r\n      },\r\n    }),\r\n  );\r\n  const classes = useStyles();\r\n\r\n  //RENDER\r\n  return (\r\n    <React.Fragment>\r\n      <Button\r\n        className={className}\r\n        variant=\"ghost\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"code\" />}\r\n        onClick={() => {\r\n          setOpen(true);\r\n        }}\r\n      ></Button>\r\n      <Dialog\r\n        open={open}\r\n        onClose={() => {}}\r\n        aria-labelledby=\"form-dialog-title\"\r\n      >\r\n        <DialogTitle id=\"form-dialog-title\">\r\n          {t(translations.InvoiceTemplateHtmlSource)}\r\n        </DialogTitle>\r\n        <DialogContent>\r\n          {/* <DialogContentText>\r\n            {t(translations.InvoiceTemplateHtmlSource)}\r\n          </DialogContentText> */}\r\n          <TextField\r\n            className={classes.invoiceTemplateHtmlTextBox}\r\n            multiline={true}\r\n            id=\"HtmlTextBoxID\"\r\n            defaultValue={formikValues.Html}\r\n            onChange={event => {\r\n              setTextBoxValue(event.target.value);\r\n            }}\r\n          />\r\n        </DialogContent>\r\n        <DialogActions>\r\n          <Button\r\n            onClick={() => {\r\n              setOpen(false);\r\n            }}\r\n            variant=\"ghost\"\r\n          >\r\n            {t(translations.Cancel)}\r\n          </Button>\r\n          <Button\r\n            onClick={() => {\r\n              setOpen(false);\r\n              let values = { ...formikValues };\r\n              values.Html = textBoxValue;\r\n              OnUpdate(values);\r\n            }}\r\n            variant=\"main\"\r\n          >\r\n            {t(translations.Update)}\r\n          </Button>\r\n        </DialogActions>\r\n      </Dialog>\r\n    </React.Fragment>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { FormControl, FormGroup } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport { HexColorPicker } from 'react-colorful';\r\nimport { InfoIcon } from '../BasicIcons/InfoIcon';\r\nimport { TextField, TextFieldProps } from '../TextField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport const FormColorPicker = ({\r\n  label,\r\n  name,\r\n  onBlur,\r\n  onChange,\r\n  value,\r\n  ...props\r\n}: TextFieldProps & FieldHookConfig<string> & IFieldProps) => {\r\n  const { t } = useTranslation();\r\n  const [field, meta, helpers] = useField<string>({ name, ...props });\r\n\r\n  const handleChange = e => {\r\n    if (onChange !== undefined) {\r\n      onChange(e);\r\n    }\r\n    field.onChange(e);\r\n  };\r\n\r\n  const handleColorPickerChange = (e: string) => {\r\n    helpers.setValue(e);\r\n  };\r\n\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <FormControl\r\n        className={props.className}\r\n        fullWidth={props.fullWidth}\r\n        variant=\"outlined\"\r\n      >\r\n        <FormGroup>\r\n          <TextField\r\n            name={name}\r\n            label={label ?? t(translations[name])}\r\n            fullWidth={props.fullWidth}\r\n            variant=\"filled\"\r\n            onChange={handleChange}\r\n            onBlur={field?.onBlur}\r\n            value={field.value}\r\n            error={meta?.error !== undefined}\r\n            helperText={meta.error}\r\n            id={props.id || 'textfieldId'}\r\n            inputProps={{\r\n              maxLength: 7,\r\n              ...props.inputProps,\r\n              'aria-label': `${label ? undefined : 'text input'}`,\r\n            }}\r\n            color=\"primary\"\r\n            InputProps={{\r\n              ...props.InputProps,\r\n              endAdornment: (\r\n                <React.Fragment>\r\n                  {props.info ? <InfoIcon title={props.info} /> : null}\r\n                  {props.InputProps?.endAdornment}\r\n                </React.Fragment>\r\n              ),\r\n            }}\r\n            {...props}\r\n          />\r\n          <HexColorPicker\r\n            color={field.value}\r\n            onChange={handleColorPickerChange}\r\n          />\r\n        </FormGroup>\r\n      </FormControl>\r\n    </>\r\n  );\r\n};\r\n","import { Box, Divider, Grid, Popover } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Body } from 'app/components/Typography';\r\nimport { InvoiceIdMultiPicker } from 'app/components/pickers/AutocompletePickers/InvoiceIdMultiPicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { translations } from 'locales/translations';\r\nimport {\r\n  bindPopover,\r\n  bindTrigger,\r\n  usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport { useCallback } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\nimport { buildURL, openExportLink } from 'utils/url-utils';\r\n\r\nexport interface PreviewButtonProps {}\r\n\r\nexport function PreviewButton() {\r\n  //PROPS\r\n  const { t } = useTranslation();\r\n\r\n  const popupState = usePopupState({\r\n    variant: 'popover',\r\n    popupId: 'previewInvoiceSelection',\r\n  });\r\n\r\n  //STATES\r\n  const [invoiceIds, setInvoiceIds] = useAsyncExtendedState<\r\n    Entity<number>[] | undefined\r\n  >(undefined);\r\n\r\n  //FUNCTIONS\r\n  const handleInvoiceIdChange = useCallback(\r\n    (value: Entity<number>[] | undefined) => {\r\n      setInvoiceIds(value);\r\n    },\r\n    [setInvoiceIds],\r\n  );\r\n\r\n  const handlePreview = () => {\r\n    if (!!invoiceIds) {\r\n      const ids: string = invoiceIds.map(item => item.Id).join(',');\r\n      var params = {\r\n        ids: ids,\r\n      };\r\n      //BillingController->InvoiceExportPDFs - [Route(\"api/Billing/Invoices/InvoiceExportPDFs\")]\r\n      const url = buildURL('api/Billing/Invoices/InvoiceExportPDFs', params);\r\n      openExportLink(url);\r\n      popupState.close();\r\n      setInvoiceIds([]);\r\n    }\r\n  };\r\n\r\n  //RENDER\r\n  return (\r\n    <Box component=\"div\">\r\n      <TopActionButton\r\n        text={t(translations.Preview) as string}\r\n        title={t(translations.Preview) as string}\r\n        icon=\"link\"\r\n        startIcon=\"save\"\r\n        size=\"small\"\r\n        variant=\"main\"\r\n        /* endIcon=\"chevron-down\" */\r\n        css={{ marginLeft: '8px' }}\r\n        disabled={false}\r\n        noChangeOnMobile={true}\r\n        {...bindTrigger(popupState)}\r\n      />\r\n      <Popover\r\n        {...bindPopover(popupState)}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'center',\r\n        }}\r\n        transformOrigin={{\r\n          vertical: 'top',\r\n          horizontal: 'center',\r\n        }}\r\n        disableAutoFocus\r\n        PaperProps={{ style: { width: '360px' } }}\r\n      >\r\n        <Box component=\"div\" style={{ padding: 16 }}>\r\n          <Grid container spacing={2} wrap=\"nowrap\" direction=\"column\">\r\n            <Grid item key=\"title-content\">\r\n              <Box display=\"row\" justifyContent=\"space-between\">\r\n                <Body size=\"small\" bold={true}>\r\n                  {t(translations.Invoice)}\r\n                </Body>\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  aria-label=\"close\"\r\n                  size=\"xs\"\r\n                  style={{ position: 'absolute', right: 8, top: 8 }}\r\n                  onClick={() => {\r\n                    popupState.close();\r\n                    setInvoiceIds([]);\r\n                  }}\r\n                >\r\n                  <Icon icon=\"times\" />\r\n                </IconButton>\r\n              </Box>\r\n            </Grid>\r\n            <Divider variant=\"fullWidth\" />\r\n            <Grid item key=\"previewInvoice-picker\">\r\n              <InvoiceIdMultiPicker\r\n                id=\"previewInvoiceID\"\r\n                isOpen={false}\r\n                placeholder={t(translations.AllValues)}\r\n                value={invoiceIds}\r\n                onChange={value => {\r\n                  handleInvoiceIdChange(value);\r\n                }}\r\n              />\r\n            </Grid>\r\n            <Divider variant=\"fullWidth\" />\r\n            <Grid item key=\"preview-button\">\r\n              <Button\r\n                variant=\"main\"\r\n                size=\"small\"\r\n                disabled={\r\n                  invoiceIds === null ||\r\n                  invoiceIds === undefined ||\r\n                  invoiceIds.length === 0\r\n                }\r\n                onClick={() => handlePreview()}\r\n              >\r\n                {t(translations.Preview)}\r\n              </Button>\r\n            </Grid>\r\n          </Grid>\r\n        </Box>\r\n      </Popover>\r\n    </Box>\r\n  );\r\n}\r\n","import Link from '@material-ui/core/Link';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { translations } from 'locales/translations';\r\nimport { ReactNode, useCallback, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Entity } from 'types/common';\r\nimport { Formik } from 'formik';\r\nimport * as Yup from 'yup';\r\nimport { IInvoiceTemplatePopUp } from './IInvoiceTemplatePopUp';\r\nimport { InvoiceTemplatesApi } from 'api/InvoiceTemplatesApi';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport {\r\n  StyledForm,\r\n  FormLeftSection,\r\n  FormFieldsSection,\r\n  FormRow,\r\n  FormRightSection,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { createStyles, makeStyles, Theme, Paper } from '@material-ui/core';\r\nimport { HtmlDefaultTemplate, PopUpListItems } from './PopUpListItems';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { FormServiceGroupPicker } from 'app/components/Forms/FormServiceGroupPicker';\r\nimport { FormFundingTypePicker } from 'app/components/Forms/FormFundingTypePicker';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { EntityNumberSchema } from 'app/components/Forms/Schemas';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { FormInputFile } from 'app/components/Forms/FormInputFile';\r\nimport { formFileSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { HtmlTextBox } from './HtmlTextBox';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { IsBudgetFieldEnabled } from 'types/AppSettings';\r\nimport { FormColorPicker } from 'app/components/Forms/FormColorPicker';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { PreviewButton } from './PreviewButton';\r\n\r\nexport interface InvoiceTemplatePopUpProps extends CoverProps {\r\n  Id?: number;\r\n  serviceGroup?: Entity<number> | null;\r\n  isMainAdmin?: boolean | null;\r\n  onClose?: () => void;\r\n}\r\n\r\nexport const InvoiceTemplatePopUpLink = ({\r\n  children,\r\n  ...props\r\n}: InvoiceTemplatePopUpProps & { children: ReactNode }) => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const onClick = () => {\r\n    dispatch(\r\n      actions.openSidePanel({\r\n        type: RenderPageType.InvoiceTemplatePopUp,\r\n        expanded: true,\r\n        props: {\r\n          Id: props.Id,\r\n        } as InvoiceTemplatePopUpProps,\r\n      }),\r\n    );\r\n  };\r\n  return <Link onClick={onClick}>{children}</Link>;\r\n};\r\n\r\nexport const InvoiceTemplatePopUp = ({\r\n  Id,\r\n  serviceGroup,\r\n  isMainAdmin,\r\n  onClose,\r\n  ...props\r\n}: InvoiceTemplatePopUpProps) => {\r\n  //SETTINGS\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const budgetFieldFundingTypeEnabled:\r\n    | boolean\r\n    | undefined = IsBudgetFieldEnabled(\r\n    appSettings ?? null,\r\n    BudgetFields.FundingType,\r\n  );\r\n\r\n  //PROPS\r\n  const isEdit = !!Id;\r\n  const submitRef = useRef<any>();\r\n\r\n  //REDUX\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { actions: notifyActions } = useAppSettingsSlice();\r\n\r\n  //STATES\r\n  const [busy, setBusy] = useState(false);\r\n  const [initialValues, setInitialValue] = useState<IInvoiceTemplatePopUp>({\r\n    Id: -1,\r\n    Name: null,\r\n    CreatedAt: newDate(),\r\n    LastUpdated: newDate(),\r\n    FundingType: null,\r\n    ServiceGroup: null,\r\n    Html: HtmlDefaultTemplate,\r\n    TableHeaderColor: '#8D8BC9',\r\n    TableBodyColor: '#ffffff',\r\n    HeaderFile: [],\r\n    FooterFile: [],\r\n    HeaderFileName: null,\r\n    FooterFileName: null,\r\n  });\r\n\r\n  //SCHEMAS\r\n  async function testHex(input: string | null | undefined) {\r\n    let result = false;\r\n    if (!!input) {\r\n      const regHex = /^#([0-9a-f]{3}){1,2}$/i;\r\n      result = regHex.test(input);\r\n    }\r\n    return result;\r\n  }\r\n\r\n  const InvoiceTemplatePopUpSchema: Yup.SchemaOf<IInvoiceTemplatePopUp> = Yup.object(\r\n    {\r\n      Id: Yup.number().notRequired().default(-1),\r\n      Name: Yup.string().required(),\r\n      CreatedAt: Yup.date().required().default(newDate()),\r\n      LastUpdated: Yup.date().notRequired().nullable(),\r\n      FundingType: Yup.array().of(EntityNumberSchema).notRequired().nullable(),\r\n      ServiceGroup: Yup.array().of(EntityNumberSchema).notRequired().nullable(),\r\n      Html: Yup.string().notRequired().nullable(),\r\n      TableHeaderColor: Yup.string().notRequired().nullable().test({\r\n        name: 'TableHeaderColor',\r\n        test: testHex,\r\n      }),\r\n      TableBodyColor: Yup.string().notRequired().nullable().test({\r\n        name: 'TableBodyColor',\r\n        test: testHex,\r\n      }),\r\n      HeaderFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n      FooterFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n      HeaderFileName: Yup.string().notRequired().nullable(),\r\n      FooterFileName: Yup.string().notRequired().nullable(),\r\n    },\r\n  );\r\n  /*   const InvoiceTemplatePopUpSGASchema: Yup.SchemaOf<IInvoiceTemplatePopUp> = Yup.object(\r\n    {\r\n      Id: Yup.number().notRequired().default(-1),\r\n      Name: Yup.string().required(),\r\n      CreatedAt: Yup.date().required().default(new Date()),\r\n      LastUpdated: Yup.date().notRequired().nullable(),\r\n      FundingType: Yup.array().of(EntityNumberSchema).notRequired().nullable(),\r\n      ServiceGroup: Yup.mixed().required(),\r\n      Html: Yup.string().notRequired().nullable(),\r\n      TableHeaderColor: Yup.string().notRequired().nullable(),\r\n      TableBodyColor: Yup.string().notRequired().nullable(),\r\n      HeaderFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n      FooterFile: Yup.array().of(formFileSchema).notRequired().nullable(),\r\n    },\r\n  ); */\r\n\r\n  const close = useCallback(() => {\r\n    if (props.isCover) {\r\n      props.closeCover?.();\r\n    } else {\r\n      dispatch(actions.resetSidePanel());\r\n    }\r\n  }, [props, dispatch, actions]);\r\n\r\n  const refreshTable = useCallback(() => {\r\n    dispatch(actions.setRefreshTable(true));\r\n  }, [dispatch, actions]);\r\n\r\n  function html_replace(html: string, valueToReplace: string) {\r\n    const patrn = /background-color: #(?:[A-Fa-f0-9]{3}){1,2}\\b/;\r\n    if (html.match(patrn)) {\r\n      //console.log(html.match(patrn)?.toString());\r\n      let originalValue: string = html.match(patrn)?.toString() as string;\r\n      html = html.replaceAll(originalValue, valueToReplace);\r\n    }\r\n    return html;\r\n  }\r\n\r\n  const OnSubmit = useCallback(\r\n    (invoiceTemplate: IInvoiceTemplatePopUp) => {\r\n      setBusy(true);\r\n      let invoiceTemplateHtml = html_replace(\r\n        invoiceTemplate.Html as string,\r\n        'background-color: ' + invoiceTemplate.TableHeaderColor ??\r\n          'background-color: #FFFFFF',\r\n      );\r\n      //if Add mode\r\n      if (!isEdit) {\r\n        let formValues = {\r\n          Id: invoiceTemplate.Id,\r\n          Name: invoiceTemplate.Name,\r\n          CreatedAt: dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(invoiceTemplate.CreatedAt),\r\n          ),\r\n          LastUpdated: !!invoiceTemplate.LastUpdated\r\n            ? dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(invoiceTemplate.LastUpdated),\r\n              )\r\n            : null,\r\n          FundingType: invoiceTemplate.FundingType?.Id,\r\n          ServiceGroupId: invoiceTemplate.ServiceGroup?.Id,\r\n          ServiceGroup: invoiceTemplate.ServiceGroup?.Name ?? '',\r\n          Html: invoiceTemplateHtml,\r\n          TableHeaderColor: invoiceTemplate.TableHeaderColor,\r\n          TableBodyColor: invoiceTemplate.TableBodyColor,\r\n          HeaderFile: invoiceTemplate.HeaderFile,\r\n          FooterFile: invoiceTemplate.FooterFile,\r\n          HeaderFileName: invoiceTemplate.HeaderFileName,\r\n          FooterFileName: invoiceTemplate.FooterFileName,\r\n        };\r\n        InvoiceTemplatesApi.insertInvoiceTemplate(formValues)\r\n          .then(response => {\r\n            if (response.ErrorMessages.length > 0) {\r\n              response.ErrorMessages.forEach(errmsg =>\r\n                dispatch(\r\n                  notifyActions.addNotification({\r\n                    variant: 'error',\r\n                    message: errmsg,\r\n                  }),\r\n                ),\r\n              );\r\n            } else {\r\n              dispatch(\r\n                notifyActions.addNotification({\r\n                  message: t(translations.InvoiceTemplateAddedSuccessfully),\r\n                  variant: 'success',\r\n                }),\r\n              );\r\n            }\r\n          })\r\n          .catch(e => console.error(e))\r\n          .finally(() => {\r\n            close();\r\n            refreshTable();\r\n          });\r\n      } else {\r\n        //if Edit mode\r\n        let formValues = {\r\n          Id: invoiceTemplate.Id,\r\n          Name: invoiceTemplate.Name,\r\n          CreatedAt: dateUtils.formatISO(\r\n            dateUtils.dateOrStringToDate(invoiceTemplate.CreatedAt),\r\n          ),\r\n          LastUpdated: !!invoiceTemplate.LastUpdated\r\n            ? dateUtils.formatISO(\r\n                dateUtils.dateOrStringToDate(invoiceTemplate.LastUpdated),\r\n              )\r\n            : null,\r\n          FundingType: invoiceTemplate.FundingType?.Id,\r\n          ServiceGroupId: invoiceTemplate.ServiceGroup?.Id,\r\n          ServiceGroup: invoiceTemplate.ServiceGroup?.Name ?? '',\r\n          Html: invoiceTemplateHtml,\r\n          TableHeaderColor: invoiceTemplate.TableHeaderColor,\r\n          TableBodyColor: invoiceTemplate.TableBodyColor,\r\n          HeaderFile: invoiceTemplate.HeaderFile,\r\n          FooterFile: invoiceTemplate.FooterFile,\r\n          HeaderFileName: invoiceTemplate.HeaderFileName,\r\n          FooterFileName: invoiceTemplate.FooterFileName,\r\n        };\r\n        InvoiceTemplatesApi.updateInvoiceTemplate(Id, formValues)\r\n          .then(response => {\r\n            if (response.ErrorMessages.length > 0) {\r\n              dispatch(\r\n                notifyActions.addNotification({\r\n                  message: response.ErrorMessages[0],\r\n                  variant: 'error',\r\n                }),\r\n              );\r\n              setBusy(false);\r\n              return;\r\n            }\r\n            dispatch(\r\n              notifyActions.addNotification({\r\n                message: t(translations.InvoiceTemplateUpdateSuccess),\r\n                variant: 'success',\r\n              }),\r\n            );\r\n            close();\r\n            refreshTable();\r\n          })\r\n          .catch(e => console.error(e));\r\n      }\r\n    },\r\n    [Id, close, dispatch, isEdit, notifyActions, refreshTable, t],\r\n  );\r\n\r\n  //USE EFFECT ON MOUNT\r\n  useEffectOnMount(() => {\r\n    //if Edit mode\r\n    if (isEdit) {\r\n      setBusy(true);\r\n      let mounted = true;\r\n      (async () => {\r\n        try {\r\n          const invoiceTemplate = await InvoiceTemplatesApi.getInvoiceTemplateById(\r\n            Id,\r\n          );\r\n          if (mounted) {\r\n            setInitialValue({\r\n              Id: invoiceTemplate.value[0].Id ?? -1,\r\n              Name: invoiceTemplate.value[0].Name ?? null,\r\n              CreatedAt: invoiceTemplate.value[0].CreatedAt ?? null,\r\n              LastUpdated: invoiceTemplate.value[0].LastUpdated ?? null,\r\n              FundingType:\r\n                getSingleInvoiceFundingType(\r\n                  invoiceTemplate.value[0].FundingType,\r\n                ) ?? null,\r\n              ServiceGroup: invoiceTemplate.value[0].ServiceGroup\r\n                ? {\r\n                    Id: invoiceTemplate.value[0].ServiceGroupId,\r\n                    Name: invoiceTemplate.value[0].ServiceGroup,\r\n                  }\r\n                : null,\r\n              //\"split\"-\"join\" is to avoid breaking the RichTextEditor (path, offset problems)\r\n              Html:\r\n                invoiceTemplate.value[0].Html.split(/[\\r\\n]+/).join('') ?? null,\r\n              //Html: invoiceTemplate.value[0].Html ?? null,\r\n              TableHeaderColor:\r\n                invoiceTemplate.value[0].TableHeaderColor ?? null,\r\n              TableBodyColor: invoiceTemplate.value[0].TableBodyColor ?? null,\r\n              HeaderFile: [],\r\n              FooterFile: [],\r\n              HeaderFileName: invoiceTemplate.value[0].HeaderFileName,\r\n              FooterFileName: invoiceTemplate.value[0].FooterFileName,\r\n            });\r\n            setBusy(false);\r\n          }\r\n        } catch (e) {\r\n          console.error(e);\r\n        }\r\n      })();\r\n      return () => {\r\n        mounted = false;\r\n      };\r\n    } else {\r\n      //if Add mode\r\n      //if (!!serviceGroup) {\r\n      setBusy(true);\r\n      let isMounted = true;\r\n      if (isMounted) {\r\n        const values = { ...initialValues };\r\n        values.Name = t(translations.InvoiceTemplate) as string;\r\n        if (!!serviceGroup && isMainAdmin === false) {\r\n          //set first service group\r\n          values.ServiceGroup = serviceGroup;\r\n        }\r\n        setInitialValue(values);\r\n        setBusy(false);\r\n      }\r\n      return () => {\r\n        isMounted = false;\r\n      };\r\n      //}\r\n      //return;\r\n    }\r\n  });\r\n\r\n  //CSS\r\n  const useStyles = makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      leftSectionH6Image: {\r\n        padding: theme.spacing(1),\r\n        backgroundColor: '#026AA2',\r\n        color: '#FFFFFF',\r\n        marginRight: 10,\r\n      },\r\n      rightSectionH5Title: {\r\n        padding: theme.spacing(2),\r\n        backgroundColor: '#026AA2',\r\n      },\r\n      row: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        padding: 0,\r\n        width: '100%',\r\n      },\r\n    }),\r\n  );\r\n  const classes = useStyles();\r\n\r\n  //FORM\r\n  const InvoiceTemplateForm = () => {\r\n    return (\r\n      <Formik\r\n        validationSchema={InvoiceTemplatePopUpSchema}\r\n        /*         validationSchema={\r\n          isMainAdmin === true\r\n            ? InvoiceTemplatePopUpSchema\r\n            : InvoiceTemplatePopUpSGASchema\r\n        } */\r\n        initialValues={initialValues}\r\n        onSubmit={OnSubmit}\r\n      >\r\n        {formik => {\r\n          submitRef.current = formik.submitForm;\r\n          const additionalButtons = [\r\n            (classname, key) => {\r\n              return (\r\n                <HtmlTextBox\r\n                  Id={Id}\r\n                  className={classname}\r\n                  setInitialValue={setInitialValue}\r\n                  isEdit={isEdit}\r\n                  setBusy={setBusy}\r\n                  formikValues={formik.values}\r\n                  disabled={false}\r\n                  key={key}\r\n                />\r\n              );\r\n            },\r\n          ];\r\n          return (\r\n            <StyledForm onSubmit={formik.handleSubmit}>\r\n              <FormLeftSection>\r\n                <FormFieldsSection>\r\n                  <FormRow fullRow>\r\n                    <PreviewButton />\r\n                  </FormRow>\r\n                  <FormRow fullRow>\r\n                    <FormTextField\r\n                      id=\"NameID\"\r\n                      name=\"Name\"\r\n                      label={t(translations.TemplateName)}\r\n                      disabled={formik.isSubmitting}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow fullRow>\r\n                    <FormServiceGroupPicker\r\n                      id=\"ServiceGroupID\"\r\n                      name=\"ServiceGroup\"\r\n                      placeholder={t(translations.AllServiceGroups)}\r\n                      label={t(translations.ServiceGroup)}\r\n                      disabled={formik.isSubmitting}\r\n                      urlType=\"base\"\r\n                      fullWidth\r\n                      //adminOnly={isMainAdmin ? false : true}\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow fullRow hide={!budgetFieldFundingTypeEnabled}>\r\n                    <FormFundingTypePicker\r\n                      id=\"FundingTypeID\"\r\n                      name=\"FundingType\"\r\n                      placeholder={t(translations.AllFundingTypes)}\r\n                      label={t(translations.FundingType)}\r\n                      disabled={formik.isSubmitting}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow fullRow>\r\n                    <FormInputFile\r\n                      id=\"HeaderFileID\"\r\n                      uploadLabel={initialValues.HeaderFileName ?? ''}\r\n                      type=\"file\"\r\n                      name=\"HeaderFile\"\r\n                      label={t(translations.TemplateHeaderImage)}\r\n                      inputProps={{ multiple: false }}\r\n                      disabled={formik.isSubmitting}\r\n                      accept=\"image/png, image/jpeg\"\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow fullRow>\r\n                    <FormRichTextField\r\n                      id=\"HtmlID\"\r\n                      name=\"Html\"\r\n                      label={t(translations.ModifyInvoiceLetterTemplateHere)}\r\n                      disabled={formik.isSubmitting}\r\n                      isInvoiceTemplateEditor={true}\r\n                      extendedMode={true}\r\n                      additionalButtons={additionalButtons}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow fullRow>\r\n                    <FormInputFile\r\n                      id=\"FooterFileID\"\r\n                      uploadLabel={initialValues.FooterFileName ?? ''}\r\n                      type=\"file\"\r\n                      name=\"FooterFile\"\r\n                      label={t(translations.TemplateFooterImage)}\r\n                      inputProps={{ multiple: false }}\r\n                      disabled={formik.isSubmitting}\r\n                      accept=\"image/png, image/jpeg\"\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormColorPicker\r\n                      id=\"TableHeaderColorID\"\r\n                      name=\"TableHeaderColor\"\r\n                      label={t(translations.InvoiceLetterTableHeadColor)}\r\n                      info={t(translations.InvoiceLetterTableHeadColor_info)}\r\n                      value={initialValues.TableHeaderColor ?? ''}\r\n                      disabled={formik.isSubmitting}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <FormColorPicker\r\n                      id=\"TableBodyColorID\"\r\n                      name=\"TableBodyColor\"\r\n                      label={t(translations.InvoiceLetterTableBodyColor)}\r\n                      info={t(translations.InvoiceLetterTableBodyColor_info)}\r\n                      value={initialValues.TableHeaderColor ?? ''}\r\n                      disabled={formik.isSubmitting}\r\n                      fullWidth\r\n                    />\r\n                  </FormRow>\r\n                </FormFieldsSection>\r\n              </FormLeftSection>\r\n              <FormRightSection>\r\n                <FormFieldsSection>\r\n                  <FormRow>\r\n                    <Paper className={classes.rightSectionH5Title}>\r\n                      <BasicTypography\r\n                        style={{ color: '#FFFFFF' }}\r\n                        variant=\"boldM\"\r\n                      >\r\n                        {t(\r\n                          translations.ReservedWordsForInvoiceLetterTemplateMsg,\r\n                        )}\r\n                      </BasicTypography>\r\n                    </Paper>\r\n                  </FormRow>\r\n                  <FormRow>\r\n                    <PopUpListItems />\r\n                  </FormRow>\r\n                </FormFieldsSection>\r\n              </FormRightSection>\r\n            </StyledForm>\r\n          );\r\n        }}\r\n      </Formik>\r\n    );\r\n  };\r\n\r\n  const leftActions = [\r\n    () => (\r\n      <>\r\n        <Button\r\n          onClick={() => submitRef.current?.()}\r\n          size=\"small\"\r\n          disabled={busy}\r\n        >\r\n          {t(translations.Save)}\r\n        </Button>\r\n      </>\r\n    ),\r\n  ];\r\n\r\n  const rightActions = [\r\n    () => (\r\n      <>\r\n        <Button\r\n          variant=\"ghost\"\r\n          startIcon={<Icon icon=\"times\" />}\r\n          onClick={close}\r\n          size=\"small\"\r\n          disabled={busy}\r\n        >\r\n          {t(translations.Cancel)}\r\n        </Button>\r\n      </>\r\n    ),\r\n  ];\r\n\r\n  //RENDER\r\n  return (\r\n    <PageWrapper\r\n      loading={busy}\r\n      pageName={\r\n        isEdit\r\n          ? t(translations.EditInvoiceTemplate)\r\n          : t(translations.menu_InvoiceTemplates)\r\n      }\r\n      titlePage={\r\n        isEdit\r\n          ? `${t(translations.InvoiceTemplate)} #${Id}`\r\n          : t(translations.AddInvoiceTemplate)\r\n      }\r\n      closable={true}\r\n      useSidePanel={true}\r\n      children={<InvoiceTemplateForm />}\r\n      leftActions={leftActions}\r\n      rightActions={rightActions}\r\n      disableExpandToggle={true}\r\n      /*       closeSidePanel={() => {\r\n        if (hasChanges) {\r\n          dispatch(actions.setConfirmOpen(true));\r\n        } else {\r\n          dispatch(actions.resetSidePanel());\r\n        }\r\n      }} */\r\n      isCover={props.isCover}\r\n      closeCover={props.closeCover}\r\n    />\r\n  );\r\n};\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\nexport const uploadStyle = makeStyles<Theme>((theme: Theme) =>\r\n  createStyles({\r\n    buttonRoot: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'center',\r\n      alignItems: 'center',\r\n      gap: theme.spacing(1.25),\r\n      padding: '6px 8px',\r\n      boxShadow: 'unset',\r\n      lineHeight: 'normal',\r\n      height: '48px',\r\n      backgroundColor: theme.palette.common.white,\r\n      border: `1px solid ${theme.palette.common.grayBorders}`,\r\n      '&:hover': {\r\n        backgroundColor: theme.palette.common.grayDividers,\r\n        border: `1px solid ${theme.palette.common.grayBorders}`,\r\n      },\r\n      '&$disabled': {\r\n        backgroundColor: theme.palette.common.grayDividers,\r\n        color: theme.palette.common.grayComponents,\r\n        border: `1px solid ${theme.palette.common.grayBorders}`,\r\n      },\r\n      '&>[class*=\"MuiButton-label\"]': {\r\n        gap: theme.spacing(1),\r\n        pointerEvents: 'none',\r\n      },\r\n      '&.shrinkLabel': {\r\n        padding: '20px 8px 0px 8px',\r\n      },\r\n    },\r\n    buttonLabel: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '0px',\r\n      margin: 0,\r\n      height: '24px',\r\n      justifyContent: 'flex-start',\r\n    },\r\n    startIcon: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: '0px',\r\n      flex: 'none',\r\n      order: 0,\r\n      flexGrow: 0,\r\n      margin: 0,\r\n      // margin: props =>\r\n      //   props.size === 'large'\r\n      //     ? '0px 12px 0px 0px'\r\n      //     : props.size === 'medium'\r\n      //     ? '0px 8px 0px 0px'\r\n      //     : props.size === 'small'\r\n      //     ? '0px 8px'\r\n      //     : props.size === 'xs'\r\n      //     ? '0px 8px 0px 0px'\r\n      //     : '0px 12px 0px 0px',\r\n      '&$iconSizeSmall': {\r\n        marginLeft: 'unset',\r\n      },\r\n    },\r\n    endIcon: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: '0px',\r\n      flex: 'none',\r\n      order: 2,\r\n      flexGrow: 0,\r\n      marginLeft: 'auto',\r\n      marginRight: 0,\r\n    },\r\n    disabled: {\r\n      backgroundColor: theme.palette.common.grayDividers,\r\n      color: theme.palette.common.grayComponents,\r\n      border: `1px solid ${theme.palette.common.grayBorders}`,\r\n    },\r\n    dividerRoot: {\r\n      backgroundColor: theme.palette.common.grayComponents,\r\n    },\r\n    previewContainer: {\r\n      display: 'flex',\r\n      justifyContent: 'flex-start',\r\n      alignItems: 'center',\r\n      flexDirection: 'row',\r\n      gap: theme.spacing(1),\r\n      height: '48px',\r\n      padding: '0px 10px 0px 0px',\r\n      '&.shrinkLabel': {\r\n        alignItems: 'flex-end',\r\n      },\r\n    },\r\n    previewIconAndText: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'center',\r\n      padding: 0,\r\n      gap: theme.spacing(1.5),\r\n      width: '100%',\r\n    },\r\n    previewIcon: {\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      alignItems: 'flex-start',\r\n      padding: '12px',\r\n      gap: theme.spacing(1.25),\r\n      cursor: 'pointer',\r\n      backgroundColor: theme.palette.common.white,\r\n      borderRadius: '8px',\r\n      color: theme.palette.common.grayComponents,\r\n      '& svg': {\r\n        width: '24px',\r\n        height: '24px',\r\n      },\r\n      '& img': {\r\n        height: '24px',\r\n      },\r\n      '.shrinkLabel &': {\r\n        padding: 0,\r\n      },\r\n    },\r\n    previewText: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: 0,\r\n      width: '100%',\r\n    },\r\n    previewTextSize: {\r\n      color: theme.palette.common.grayComponents,\r\n    },\r\n    previewCloseButton: {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      padding: 2,\r\n      gap: theme.spacing(1.25),\r\n    },\r\n    previewCloseButtonIcon: {\r\n      color: theme.palette.common.grayComponents,\r\n      width: '16px',\r\n      height: '16px',\r\n      fontSize: '16px',\r\n    },\r\n  }),\r\n);\r\n","import { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { uploadStyle } from './styles';\r\nimport * as React from 'react';\r\nimport { lookup } from 'mime-types';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { openExportLink, toRootedURL } from 'utils/url-utils';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport cliTruncate from 'cli-truncate';\r\nimport { Body } from 'app/components/Typography';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport prettyBytes from 'pretty-bytes';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FileViewProps {\r\n  file: IFormFileValue;\r\n  onRemove: (value: any) => void;\r\n  withShrinkLabel?: boolean;\r\n}\r\n\r\nexport function FileView(props: FileViewProps) {\r\n  const { file, onRemove, withShrinkLabel } = props;\r\n  const { t } = useTranslation();\r\n\r\n  const fileName =\r\n    file.DisplayValue !== null && file.DisplayValue !== undefined\r\n      ? file.DisplayValue\r\n      : '';\r\n  const fileSize =\r\n    file.Size == null\r\n      ? null\r\n      : prettyBytes(file.Size, { maximumFractionDigits: 2 });\r\n  const mimeType = lookup(fileName);\r\n  const fileUrl =\r\n    file.PostedFile === null || file.PostedFile === undefined\r\n      ? toRootedURL(`/file.ashx?id=${file.Id}&ap=true`)\r\n      : file.PostedFile.webkitRelativePath;\r\n  const previewImg =\r\n    !isEmptyOrWhitespace(file.DisplayValue) &&\r\n    mimeType !== false &&\r\n    mimeType.startsWith('image/');\r\n  const downloadClick = async () => {\r\n    if (file.PostedFile === null || file.PostedFile === undefined) {\r\n      await openExportLink(fileUrl);\r\n    }\r\n  };\r\n  // const fileDownloadClick = async () => {\r\n  //   fileDownload(res.data, filename)\r\n  // };\r\n\r\n  const classes = uploadStyle();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  return (\r\n    <React.Fragment>\r\n      <div\r\n        className={clsx(classes.previewContainer, {\r\n          shrinkLabel: withShrinkLabel,\r\n        })}\r\n      >\r\n        <div className={classes.previewIconAndText}>\r\n          {file.Value !== null ? (\r\n            <Tooltip title={t(translations.Download)}>\r\n              <div\r\n                className={classes.previewIcon}\r\n                onClick={() => downloadClick()}\r\n              >\r\n                {previewImg ? (\r\n                  <img alt={fileName} src={fileUrl} />\r\n                ) : (\r\n                  <Icon icon=\"link\" />\r\n                )}\r\n              </div>\r\n            </Tooltip>\r\n          ) : (\r\n            <div className={classes.previewIcon}>\r\n              <Icon icon=\"link\" />\r\n            </div>\r\n          )}\r\n          <div className={classes.previewText}>\r\n            <Body bold={true} size=\"small\">\r\n              {cliTruncate(fileName, sidePanelExpanded ? 40 : 25, {\r\n                position: 'middle',\r\n              })}\r\n            </Body>\r\n\r\n            {fileSize && (\r\n              <Body size=\"small\" className={classes.previewTextSize}>\r\n                {fileSize}\r\n              </Body>\r\n            )}\r\n          </div>\r\n        </div>\r\n        <div className={classes.previewCloseButton}>\r\n          <IconButton\r\n            variant=\"ghost\"\r\n            size=\"xs\"\r\n            shape=\"square\"\r\n            onClick={() => onRemove(fileName)}\r\n          >\r\n            <Icon icon=\"times\" className={classes.previewCloseButtonIcon} />\r\n          </IconButton>\r\n        </div>\r\n      </div>\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import {\r\n  Button,\r\n  Divider,\r\n  FormControl,\r\n  FormHelperText,\r\n  FormLabel,\r\n  Input,\r\n  InputLabel,\r\n  InputProps,\r\n  styled,\r\n} from '@material-ui/core';\r\nimport { Body } from 'app/components/Typography';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport * as React from 'react';\r\n\r\nimport cliTruncate from 'cli-truncate';\r\nimport { uploadStyle } from './styles';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FileView } from './FileView';\r\nimport { buttonM } from 'styles/typography/bookitTypography';\r\nimport clsx from 'clsx';\r\n\r\nexport interface FileInputProps extends InputProps {\r\n  className?: string;\r\n  onFileChange?: (file: FileList | null) => void;\r\n  label?: string;\r\n  multiple?: boolean;\r\n  uploadLabel?: string;\r\n  showPreview?: boolean;\r\n  removeable?: boolean;\r\n  onRemove?: (value: string) => void;\r\n  acceptedFiles?: string;\r\n  isRequired?: string;\r\n  helperText?: string;\r\n  errorMesage?: string;\r\n  info?: string;\r\n  referenceId?: number;\r\n  file?: IFormFileValue;\r\n  shrinkLabel?: boolean;\r\n}\r\n\r\nconst StyledFormHelperText = styled(FormHelperText)(props => ({\r\n  // empty helperText results in zero element height. So when field is validated the appearance of the\r\n  // error message in the helperText causes the form element to increase in height and forces a redraw\r\n  // empty char \\00a0 causes the FormHelperText to always occupy one line height and prevents reflows\r\n  '&::before': {\r\n    content: '\"\\\\00a0\"',\r\n  },\r\n}));\r\nconst StyledFormLabel = styled(FormLabel)(({ theme }) => ({\r\n  color: theme.palette.common.blackRegular,\r\n  ...buttonM,\r\n  '&[class*=\"Mui-focused\"]': {\r\n    color: theme.palette.common.blackRegular,\r\n  },\r\n}));\r\nexport function FileInput(props: FileInputProps) {\r\n  const {\r\n    className,\r\n    onFileChange,\r\n    onRemove,\r\n    id,\r\n    multiple,\r\n    uploadLabel,\r\n    helperText,\r\n    errorMesage,\r\n    onChange,\r\n    label,\r\n    file,\r\n    required,\r\n    shrinkLabel,\r\n    acceptedFiles,\r\n  } = props;\r\n  const classes = uploadStyle();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  //const [file, setFile] = React.useState<string | undefined>(undefined);\r\n\r\n  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    if (onChange) {\r\n      onChange(event);\r\n    } else {\r\n      const files = event.target.files;\r\n      if (onFileChange) {\r\n        onFileChange(files);\r\n      }\r\n    }\r\n    // if (event.target.files?.length) {\r\n    //   setFileName(event.target.files[event.target.files?.length - 1].name);\r\n    // }\r\n  };\r\n  const removeFile = (fileName: string) => {\r\n    if (onRemove) {\r\n      onRemove(fileName);\r\n    }\r\n    //setFileName(undefined);\r\n  };\r\n  return (\r\n    <FormControl\r\n      required={required}\r\n      error={props.error}\r\n      fullWidth={props.fullWidth}\r\n      disabled={props.disabled}\r\n      variant=\"filled\"\r\n    >\r\n      {/* {label && (\r\n        <StyledFormLabel\r\n          htmlFor={id || 'standart-uploader'}\r\n          style={{ marginBottom: '8px' }}\r\n          required={required}\r\n          filled={true}\r\n        >\r\n          {label}\r\n        </StyledFormLabel>\r\n      )} */}\r\n      {label && (\r\n        <React.Fragment>\r\n          {shrinkLabel ? (\r\n            <InputLabel\r\n              htmlFor={id || 'standart-uploader'}\r\n              required={required}\r\n              variant={'filled'}\r\n              shrink={file === undefined}\r\n              className={clsx({\r\n                shrinkFile: shrinkLabel && !!label && file !== undefined,\r\n              })}\r\n            >\r\n              {label}\r\n            </InputLabel>\r\n          ) : (\r\n            <StyledFormLabel\r\n              htmlFor={id || 'standart-uploader'}\r\n              style={{ marginBottom: '8px' }}\r\n              required={required}\r\n              filled={true}\r\n            >\r\n              {label}\r\n            </StyledFormLabel>\r\n          )}\r\n        </React.Fragment>\r\n      )}\r\n      <Button\r\n        component=\"label\"\r\n        style={{ display: `${file !== undefined ? 'none' : 'flex'}` }}\r\n        classes={{\r\n          root: classes.buttonRoot,\r\n          label: classes.buttonLabel,\r\n          endIcon: classes.endIcon,\r\n        }}\r\n        className={clsx({\r\n          shrinkLabel: shrinkLabel && !!label && file === undefined,\r\n        })}\r\n        endIcon={\r\n          multiple && file !== undefined ? (\r\n            <IconButton\r\n              variant=\"ghost\"\r\n              shape=\"square\"\r\n              onClick={() => removeFile(file.DisplayValue || '')}\r\n              children={<Icon icon=\"times\" />}\r\n              size=\"small\"\r\n            />\r\n          ) : props.info ? (\r\n            <InfoIcon title={props.info} />\r\n          ) : undefined\r\n        }\r\n      >\r\n        <span>{uploadLabel ? uploadLabel : 'Upload File'}</span>\r\n        <Divider\r\n          orientation=\"vertical\"\r\n          variant=\"fullWidth\"\r\n          classes={{ root: classes.dividerRoot }}\r\n        />\r\n        {multiple && file ? (\r\n          <Body size=\"small\">\r\n            {cliTruncate(file.DisplayValue || '', sidePanelExpanded ? 35 : 22, {\r\n              position: 'middle',\r\n            })}\r\n          </Body>\r\n        ) : (\r\n          <Body size=\"small\">{'Please select a file...'}</Body>\r\n        )}\r\n        <Input\r\n          id={id || 'standart-uploader'}\r\n          className={className}\r\n          value={props.value}\r\n          name={props.name}\r\n          onChange={handleChange}\r\n          type=\"file\"\r\n          style={{ display: 'none' }}\r\n          inputProps={{ multiple: multiple, accept: acceptedFiles }}\r\n          aria-describedby=\"upload-input\"\r\n        />\r\n      </Button>\r\n      {!multiple && file !== undefined && (\r\n        <FileView\r\n          file={file}\r\n          onRemove={() => removeFile(file.DisplayValue || ' ')}\r\n          withShrinkLabel={shrinkLabel}\r\n        />\r\n      )}\r\n      {(!!errorMesage || !!helperText) && (\r\n        <StyledFormHelperText\r\n          id=\"upload-input\"\r\n          required={required}\r\n          error={props.error}\r\n          disabled={props.disabled}\r\n        >\r\n          {errorMesage ? (\r\n            <span>{errorMesage}</span>\r\n          ) : helperText ? (\r\n            <span>{helperText}</span>\r\n          ) : undefined}\r\n        </StyledFormHelperText>\r\n      )}\r\n    </FormControl>\r\n  );\r\n}\r\n","import { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { FileView } from './FileView';\r\nimport * as React from 'react';\r\n\r\nexport interface FilesPreviewProps {\r\n  files: IFormFileValue[] | null;\r\n  multiple?: boolean;\r\n  onRemove?: (value: any) => void;\r\n}\r\nexport function FilesPreview(props: FilesPreviewProps) {\r\n  const { files, onRemove } = props;\r\n  const handleRemove = (value: any) => {\r\n    if (onRemove) onRemove(value);\r\n  };\r\n  return (\r\n    <React.Fragment>\r\n      {files !== null &&\r\n        files.length > 0 &&\r\n        files.map(file => <FileView file={file} onRemove={handleRemove} />)}\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { Box } from '@material-ui/core';\r\nimport { IFormFileValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport * as React from 'react';\r\nimport { FileInput, FileInputProps } from './FileInput';\r\nimport { FilesPreview } from './FilesPreview';\r\n\r\nexport interface FileUploadProps {\r\n  values: IFormFileValue[];\r\n  multiple?: boolean;\r\n  uploadLabel?: string;\r\n  showPreview?: boolean;\r\n  fileSizeLimit?: number;\r\n  saveFiles?: (files: IFormFileValue[]) => void;\r\n  fileInputProps: FileInputProps;\r\n}\r\n\r\nexport function FileUpload(props: FileUploadProps) {\r\n  const { values, multiple, showPreview, saveFiles, fileInputProps } = props;\r\n\r\n  const [innerFiles, setInnerFiles] = React.useState<Record<string, File>>({});\r\n  const [fileValues, setFileValues] = React.useState<IFormFileValue[] | null>(\r\n    values,\r\n  );\r\n  const referenceId = fileInputProps.referenceId;\r\n  const convertFilesToArray = (files: Record<string, File>) =>\r\n    Object.keys(files).map(key => files[key]);\r\n\r\n  const addNewFiles = (newFiles: FileList) => {\r\n    let files = multiple ? innerFiles : {};\r\n    for (let file of newFiles) {\r\n      if (!multiple) {\r\n        // return { file };\r\n        files[file.name] = file;\r\n        return { ...files };\r\n      }\r\n      files[file.name] = file;\r\n    }\r\n    return { ...files };\r\n  };\r\n  const updateState = (files: File[], deleteFileName?: string) => {\r\n    let savedFiles = fileValues ?? [];\r\n    if (deleteFileName) {\r\n      savedFiles =\r\n        fileValues?.filter(f => f.DisplayValue !== deleteFileName) ?? [];\r\n    } else {\r\n      files?.forEach(file => {\r\n        if (\r\n          savedFiles?.filter(f => f.DisplayValue === file.name)?.length === 0\r\n        ) {\r\n          savedFiles?.push({\r\n            Id: referenceId || -1,\r\n            Value: null,\r\n            DisplayValue: file.name,\r\n            Size: file.size,\r\n            PostedFile: file,\r\n          } as IFormFileValue);\r\n        }\r\n      });\r\n    }\r\n    return savedFiles;\r\n  };\r\n  const updateFiles = (\r\n    files: Record<string, File>,\r\n    deleteFileName?: string,\r\n  ) => {\r\n    const filesAsArray = convertFilesToArray(files);\r\n    const savedFiles = updateState(filesAsArray, deleteFileName);\r\n    setFileValues(savedFiles);\r\n    if (saveFiles !== undefined) {\r\n      saveFiles(savedFiles ?? []);\r\n    }\r\n  };\r\n  const handleChange = (files: FileList | null) => {\r\n    let updatedFiles = {};\r\n    if (files?.length) {\r\n      updatedFiles = addNewFiles(files);\r\n      setInnerFiles(updatedFiles);\r\n    } else {\r\n      setInnerFiles({});\r\n    }\r\n    updateFiles(updatedFiles);\r\n  };\r\n  const removeFile = (fileName: string) => {\r\n    let files = innerFiles;\r\n    delete files[fileName];\r\n    setInnerFiles({ ...files });\r\n\r\n    updateFiles({ ...files }, fileName);\r\n  };\r\n  return (\r\n    <Box display=\"flex\" flexDirection=\"column\" gridRowGap=\"16px\" width=\"100%\">\r\n      <FileInput\r\n        onFileChange={handleChange}\r\n        onRemove={removeFile}\r\n        file={fileValues && fileValues.length > 0 ? fileValues[0] : undefined}\r\n        {...fileInputProps}\r\n      />\r\n      {multiple && showPreview && (\r\n        <FilesPreview\r\n          files={fileValues}\r\n          multiple={multiple}\r\n          onRemove={removeFile}\r\n        />\r\n      )}\r\n    </Box>\r\n  );\r\n}\r\n","/**\r\n *\r\n * EmailTypePicker\r\n *\r\n */\r\n\r\nimport {\r\n  EmailTypeUnionArray,\r\n  EmailTypeUnion,\r\n} from 'api/odata/generated/enums/EmailType';\r\nimport {\r\n  EnumPicker,\r\n  EnumPickerProps,\r\n  withEnumOptions,\r\n} from 'app/components/BasicPickers/EnumPicker';\r\n\r\nexport type EmailTypePickerProps = Omit<\r\n  EnumPickerProps<EmailTypeUnion>,\r\n  'EnumNamesArray'\r\n>;\r\nexport const EmailTypePicker = withEnumOptions<EmailTypeUnion>(\r\n  EmailTypeUnionArray,\r\n)(EnumPicker);\r\n","/**\r\n *\r\n * EmailTypeFilter\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { IFilterComponentProps } from '../IFilterComponentProps';\r\nimport { EmailTypePicker } from 'app/components/pickers/StaticOptionsPickers/EmailTypePicker';\r\nimport { EmailTypeUnion } from 'api/odata/generated/enums/EmailType';\r\n\r\nexport const EmailTypeFilter = (props: IFilterComponentProps) => {\r\n  const handleOnChange = (value: EmailTypeUnion | null) => {\r\n    props.onChange(value);\r\n  };\r\n  const { t } = useTranslation();\r\n  return (\r\n    <EmailTypePicker\r\n      value={props.value}\r\n      onChange={handleOnChange}\r\n      isOpen={props.open}\r\n      placeholder={t(translations.AllValues)}\r\n      ariaLabel={props.label}\r\n      size=\"small\"\r\n      id={props.id}\r\n    />\r\n  );\r\n};\r\nexport default EmailTypeFilter;\r\n","import { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { AssetPickerFilter } from 'app/components/BasicTable/Filters/AssetFilter';\r\nimport { DatesRangeFilter } from 'app/components/BasicTable/Filters/DatesRangeFilter';\r\nimport { UserFilter } from 'app/components/BasicTable/Filters/UserFilter';\r\nimport {\r\n  getDefaultFilterDatePeriod,\r\n  GetNumberOrUndefined,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  GetStringOrUndefined,\r\n  getStringUnionOrUndefined,\r\n  initPickerValue,\r\n  presetDatesRangeToQueryString,\r\n  URLSearchParamsCI,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { initAssetData } from 'app/components/pickers/AutocompletePickers/AssetPicker';\r\nimport { initUserData } from 'app/components/pickers/AutocompletePickers/UserPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { PresetDatesRange } from 'types/PresetDatesRange';\r\nimport { IEmailNotificationsRow } from './IEmailNotificationsRow';\r\nimport { EmailTypeUnionArray } from 'api/odata/generated/enums/EmailType';\r\nimport EmailTypeFilter from 'app/components/BasicTable/Filters/EmailTypeFilter';\r\nimport NumberFieldFilter from 'app/components/BasicTable/Filters/NumberFieldFilter';\r\n\r\nexport const GetFilters: GetPageFilters<IEmailNotificationsRow> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParamsCI(search);\r\n  var result: IFilterSettings<IEmailNotificationsRow>[] = [\r\n    {\r\n      fieldName: 'Recipient',\r\n      displayName: t(translations.Recipient),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'recipient',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'recipient')),\r\n      ),\r\n      component: UserFilter,\r\n      initData: initPickerValue(initUserData),\r\n    },\r\n    {\r\n      fieldName: 'AssetId',\r\n      queryStringSerializer: 'aid',\r\n      displayName: t(translations.Asset),\r\n      operator: ODataOperators.Equals,\r\n      value: GetPartialEntity(GetNumberOrUndefined(GetRawValue(params, 'aid'))),\r\n      initData: initPickerValue(initAssetData),\r\n      component: AssetPickerFilter,\r\n    },\r\n    {\r\n      fieldName: 'CreatedBy',\r\n      displayName: t(translations.CreatedBy),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'createdby',\r\n      value: GetPartialEntity(\r\n        GetStringOrUndefined(GetRawValue(params, 'createdby')),\r\n      ),\r\n      component: UserFilter,\r\n      initData: initPickerValue(initUserData),\r\n    },\r\n    {\r\n      fieldName: 'Timestamp',\r\n      displayName: t(translations.Timestamp),\r\n      operator: ODataOperators.Between,\r\n      defaultValue: PresetDatesRange.fromPreset(\r\n        getPeriodTypesEntity('ThisMonth'),\r\n      ),\r\n      queryStringSerializer: presetDatesRangeToQueryString(\r\n        'period',\r\n        'st',\r\n        'et',\r\n      ),\r\n      value: getDefaultFilterDatePeriod('period', 'st', 'et', params),\r\n      component: DatesRangeFilter,\r\n      urlKey: 'period',\r\n    },\r\n    {\r\n      fieldName: 'NotificationTypeId',\r\n      displayName: t(translations.NotificationType),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'NotificationTypeId',\r\n      value: getStringUnionOrUndefined(\r\n        GetRawValue(params, 'NotificationTypeId'),\r\n        EmailTypeUnionArray,\r\n      ),\r\n      component: EmailTypeFilter,\r\n    },\r\n    {\r\n      fieldName: 'ReferenceId',\r\n      displayName: t(translations.Reference),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'ReferenceId',\r\n      value: GetNumberOrUndefined(GetRawValue(params, 'ReferenceId')),\r\n      component: NumberFieldFilter,\r\n    },\r\n  ];\r\n  return result;\r\n};\r\n","import { Skeleton } from '@material-ui/lab';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\n\r\nexport interface CustomFormSkeletonProps {\r\n  formFields: IFormFieldDto[];\r\n}\r\nexport function CustomFormSkeleton(props: CustomFormSkeletonProps) {\r\n  // TODO: add skeleton based on the formfields definition\r\n  return <Skeleton />;\r\n}\r\n","/**\r\n *\r\n * QuizCustomForm\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { Formik } from 'formik';\r\nimport { Grid } from '@material-ui/core';\r\nimport { CustomFormField } from './CustomFormFields';\r\nimport { ValidationSchemaProvider } from '../Forms/ValidationSchemaProvider';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport {\r\n  getCustomFormInitialValues,\r\n  useCustomFormSchema,\r\n} from './CustomFormUtils';\r\nimport { CustomFormSkeleton } from './CustomFormSkeleton';\r\n\r\nexport interface QuizCustomFormProps {\r\n  formFields: IFormFieldDto[];\r\n  formValues?: IFormValueDto[];\r\n  readonly?: boolean;\r\n  onSubmit: (value: CustomFormValue) => void;\r\n  bindSubmitForm: any;\r\n}\r\n\r\nexport interface CustomFormValue extends Record<number, any> {}\r\n\r\nexport function QuizCustomForm({\r\n  formFields,\r\n  formValues,\r\n  onSubmit,\r\n  readonly,\r\n  bindSubmitForm,\r\n}: QuizCustomFormProps) {\r\n  const schema = useCustomFormSchema(formFields, false);\r\n  const handleSubmit = value => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(value);\r\n    }\r\n  };\r\n  const initialValues = getCustomFormInitialValues(\r\n    formFields,\r\n    formValues,\r\n    true,\r\n  );\r\n  if (initialValues === undefined) {\r\n    // show progress while form values are being fetched\r\n    return <CustomFormSkeleton formFields={formFields} />;\r\n  }\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={schema}\r\n        initialValues={initialValues}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          console.debug('submitting', values);\r\n          formikHelpers.setSubmitting(true);\r\n          handleSubmit(values);\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          return (\r\n            <ValidationSchemaProvider schema={schema}>\r\n              <>\r\n                <form onSubmit={formik.handleSubmit}>\r\n                  <Grid container spacing={2} direction=\"column\">\r\n                    {formFields.map((formField, index) => {\r\n                      return (\r\n                        <React.Fragment key={formField.Id}>\r\n                          <Grid item xs={12}>\r\n                            <CustomFormField\r\n                              name={String(formField.Id)}\r\n                              id={String(formField.Id)}\r\n                              key={index}\r\n                              formField={formField}\r\n                              readonly={readonly}\r\n                            />\r\n                          </Grid>\r\n                        </React.Fragment>\r\n                      );\r\n                    })}\r\n                  </Grid>\r\n                </form>\r\n              </>\r\n            </ValidationSchemaProvider>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { IQuizDto } from 'api/odata/generated/entities/IQuizDto';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { IQuizSubmissionDto } from 'api/odata/generated/entities/IQuizSubmissionDto';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { push } from 'connected-react-router';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { Box } from '@material-ui/core';\r\nimport parse from 'html-react-parser';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { Body } from 'app/components/Typography';\r\nimport { selectExpandedSidePanel } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { QuizDetailsProps } from 'app/pages/QuizDetailsPage/QuizDetails';\r\nimport { QuizCustomForm } from 'app/components/CustomForm/QuizCustomForm';\r\nimport { ParseFormFieldEnums } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { IFormValueDto } from 'api/odata/generated/entities/IFormValueDto';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nexport interface StartQuizProps extends SidePanelContentProps {\r\n  id: string;\r\n  closable: boolean;\r\n}\r\nexport function StartQuiz(props: StartQuizProps) {\r\n  const { id, useSidePanel } = props;\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const fetchQuiz = async (quizId: number) =>\r\n    httpClient\r\n      .get<IQuizDto>(`/api/odata/v4/quizzes(${quizId})`, {\r\n        $expand: ['Submissions', 'ServiceGroups'].join(','),\r\n      })\r\n      .then(value => {\r\n        // Enums are serialized using string representations\r\n        // parse enum values\r\n        ParseFormFieldEnums(value.FormFields);\r\n        // shuffle questions according to quiz settings\r\n        if (value.ShuffleFields) {\r\n          value.FormFields = value.FormFields.sort(() => 0.5 - Math.random());\r\n        }\r\n        // enumerate questions\r\n        value.FormFields.forEach(\r\n          (formField, index) =>\r\n            (formField.Label = `${t(translations.Question)} ${index + 1}. ${\r\n              formField.Label\r\n            }`),\r\n        );\r\n        value.UsedAttempts = value.Submissions.filter(\r\n          item =>\r\n            item.SubmittedById === User?.Id &&\r\n            (item.Score ?? 0) < (value.QuizTrainingPassingScore ?? 0),\r\n        ).length;\r\n        value.UserCanStartQuiz =\r\n          value.UsedAttempts === 0 ||\r\n          (value.QuizNumberOfAttempts ?? 0) === 0 ||\r\n          value.UsedAttempts < (value.QuizNumberOfAttempts ?? 0);\r\n        return value;\r\n      });\r\n  const [fetchQuizPromiseState, fetchQuizPromise] = usePromise(fetchQuiz);\r\n  const [state, setState] = useAsyncExtendedState<IQuizDto | undefined>(\r\n    undefined,\r\n  );\r\n  const [startQuiz, setStartQuiz] = React.useState<boolean>(true);\r\n  useEffectOnMount(() => {\r\n    setState(fetchQuizPromise(+id));\r\n    return () => {};\r\n  });\r\n  const isMobile = DetectIsMobile();\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  React.useEffect(() => {\r\n    const messageKey = 'QuizLoad';\r\n    if (fetchQuizPromiseState.error) {\r\n      dispatch(\r\n        actions.addNotification({\r\n          variant: 'error',\r\n          message: 'Something went wrong.',\r\n          key: messageKey,\r\n        }),\r\n      );\r\n    }\r\n  }, [fetchQuizPromiseState.error, actions, dispatch]);\r\n\r\n  const [submitStatus, submitQuiz] = usePromise(\r\n    async (values: Record<number, string>) => {\r\n      const formValues: IFormValueDto[] = Object.entries(values).map(\r\n        ([formFieldId, value]) => ({\r\n          Id: -1,\r\n          FormFieldId: +formFieldId,\r\n          Value: value,\r\n          SourceValueId: null,\r\n          AlertId: null,\r\n          AlertTypeId: null,\r\n          Readonly: false,\r\n          CustomFormId: null,\r\n          CustomFormName: null,\r\n          DisplayValue: null,\r\n          RequestId: null,\r\n          ReservationId: null,\r\n          ExperimentItemId: null,\r\n          BudgetExperimentId: null,\r\n          ServiceGroupUserId: null,\r\n          ServiceGroupId: null,\r\n        }),\r\n      );\r\n      const quizSubmission: Partial<IQuizSubmissionDto> = {\r\n        CustomFormId: +id,\r\n        FormValues: formValues,\r\n      };\r\n      return httpClient.post<Partial<IQuizSubmissionDto>>(\r\n        `/api/odata/v4/quizsubmissions`,\r\n        quizSubmission,\r\n      );\r\n    },\r\n  );\r\n  const [readonly] = React.useState<boolean>(false);\r\n  const [submission, setSubmission] = useAsyncExtendedState<\r\n    Partial<IQuizSubmissionDto> | undefined\r\n  >(undefined);\r\n\r\n  React.useEffect(() => {\r\n    const messageKey = 'QuizSubmission';\r\n    if (submitStatus.status === 'resolved') {\r\n      dispatch(\r\n        actions.addNotification({\r\n          variant: 'success',\r\n          message: 'Submission success.',\r\n          key: messageKey,\r\n        }),\r\n      );\r\n    }\r\n    if (submitStatus.status === 'rejected') {\r\n      dispatch(\r\n        actions.addNotification({\r\n          variant: 'error',\r\n          message: 'Submission failed.',\r\n          key: messageKey,\r\n        }),\r\n      );\r\n    }\r\n  }, [actions, dispatch, submitStatus.status]);\r\n\r\n  const submissionId = submission?.Id;\r\n  const resultQuiz = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      dispatch(\r\n        layoutActions.openSidePanel({\r\n          type: RenderPageType.QuizzDetails,\r\n          props: {\r\n            id: '' + submissionId,\r\n            useSidePanel: useSidePanel,\r\n          } as QuizDetailsProps,\r\n        }),\r\n      );\r\n    } else {\r\n      dispatch(push(`/quizzes/details/${submissionId}`));\r\n    }\r\n  }, [dispatch, layoutActions, submissionId, useSidePanel]);\r\n  React.useEffect(() => {\r\n    if (submissionId !== undefined) {\r\n      resultQuiz();\r\n    }\r\n  }, [resultQuiz, submissionId]);\r\n  const handleSubmit = (values: Record<number, any>) =>\r\n    setSubmission(submitQuiz(values));\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const handleSubmitForm = e => {\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const leftActions = React.useMemo(\r\n    () => [\r\n      () =>\r\n        readonly !== true && startQuiz ? (\r\n          <React.Fragment>\r\n            <Button\r\n              size={isMobile || !sidePanelExpanded ? 'small' : 'medium'}\r\n              startIcon={<Icon icon=\"save\" />}\r\n              onClick={() => setStartQuiz(false)}\r\n            >\r\n              {isMobile || !sidePanelExpanded\r\n                ? t(translations.Continue)\r\n                : t(translations.ContinueToQuiz)}\r\n            </Button>\r\n          </React.Fragment>\r\n        ) : (\r\n          <React.Fragment>\r\n            <Button\r\n              size={isMobile || !sidePanelExpanded ? 'small' : 'medium'}\r\n              startIcon={<Icon icon=\"save\" />}\r\n              onClick={handleSubmitForm}\r\n            >\r\n              {t(translations.Submit)}\r\n            </Button>\r\n          </React.Fragment>\r\n        ),\r\n    ],\r\n    [isMobile, readonly, sidePanelExpanded, startQuiz, t],\r\n  );\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () =>\r\n        readonly !== true && (\r\n          <React.Fragment>\r\n            <Button\r\n              variant=\"ghost\"\r\n              size={isMobile || !sidePanelExpanded ? 'small' : 'medium'}\r\n              startIcon={<Icon icon=\"times\" />}\r\n              onClick={() => {\r\n                if (useSidePanel) {\r\n                  dispatch(layoutActions.resetSidePanel());\r\n                } else {\r\n                  dispatch(push(`/quizzes`));\r\n                }\r\n              }}\r\n            >\r\n              {state?.UserCanStartQuiz\r\n                ? isMobile || !sidePanelExpanded\r\n                  ? t(translations.Cancel)\r\n                  : t(translations.CancelYourSubmission)\r\n                : t(translations.BackToQuizzes)}\r\n            </Button>\r\n          </React.Fragment>\r\n        ),\r\n    ] as ActionRenderer[];\r\n  }, [\r\n    dispatch,\r\n    isMobile,\r\n    layoutActions,\r\n    readonly,\r\n    sidePanelExpanded,\r\n    state?.UserCanStartQuiz,\r\n    t,\r\n    useSidePanel,\r\n  ]);\r\n  return (\r\n    <PageWrapper\r\n      pageName={\r\n        !useSidePanel || sidePanelExpanded\r\n          ? (t(translations.Quiz) as string)\r\n          : undefined\r\n      }\r\n      useSidePanel={useSidePanel}\r\n      titlePage={state?.Name}\r\n      children={\r\n        !!fetchQuizPromiseState.status &&\r\n        fetchQuizPromiseState.status !== 'pending' &&\r\n        !!state ? (\r\n          <Box component=\"div\" marginTop={3}>\r\n            <StyledFormFieldsContainer>\r\n              <FormLeftSection>\r\n                <FormFieldsSection>\r\n                  <React.Fragment>\r\n                    {state.UserCanStartQuiz ? (\r\n                      <React.Fragment>\r\n                        <Body italic={true} color=\"secondary\">\r\n                          {(t(translations.QuizDescription) as string)\r\n                            .replace(\r\n                              '{0}',\r\n                              state?.FormFields?.length.toString(),\r\n                            )\r\n                            .replace(\r\n                              '{1}',\r\n                              (state.QuizTrainingPassingScore ?? 0).toString(),\r\n                            )}\r\n                        </Body>\r\n\r\n                        <Box component=\"div\" marginTop={3}>\r\n                          {startQuiz ? (\r\n                            <React.Fragment>\r\n                              <Box component=\"div\" marginTop={3}>\r\n                                {parse(state?.QuizInstructions || '')}\r\n                              </Box>\r\n                            </React.Fragment>\r\n                          ) : (\r\n                            <React.Fragment>\r\n                              <Box component=\"div\" marginTop={3}>\r\n                                {\r\n                                  <QuizCustomForm\r\n                                    bindSubmitForm={bindSubmitForm}\r\n                                    formFields={state.FormFields}\r\n                                    onSubmit={handleSubmit}\r\n                                  />\r\n                                }\r\n                              </Box>\r\n                            </React.Fragment>\r\n                          )}\r\n                        </Box>\r\n                      </React.Fragment>\r\n                    ) : (\r\n                      <React.Fragment>\r\n                        <Box\r\n                          component=\"span\"\r\n                          style={{\r\n                            display: 'flex',\r\n                            gap: 16,\r\n                            flexDirection: 'column',\r\n                          }}\r\n                        >\r\n                          <Box\r\n                            component=\"span\"\r\n                            style={{\r\n                              display: 'flex',\r\n                              gap: 8,\r\n                              flexDirection: 'row',\r\n                              alignItems: 'center',\r\n                            }}\r\n                          >\r\n                            <Body bold={true}>\r\n                              {t(translations.QuizFiledAttemptsMessage).replace(\r\n                                '{0}',\r\n                                state.UsedAttempts.toString(),\r\n                              )}\r\n                            </Body>\r\n                          </Box>\r\n                          {state.EquipmentName && (\r\n                            <Box\r\n                              component=\"span\"\r\n                              style={{\r\n                                display: 'flex',\r\n                                gap: 8,\r\n                                flexDirection: 'row',\r\n                                alignItems: 'center',\r\n                              }}\r\n                            >\r\n                              <React.Fragment>\r\n                                <Body bold={true}>\r\n                                  {t(\r\n                                    translations.QuizFiledAttemptsInstrumentMessage,\r\n                                  )}\r\n                                </Body>\r\n                                <Link\r\n                                  href={`/Assets/Details.aspx?EquipmentId=${state.EquipmentId}`}\r\n                                  target=\"_blank\"\r\n                                >\r\n                                  {state.EquipmentName}\r\n                                </Link>\r\n                              </React.Fragment>\r\n                            </Box>\r\n                          )}\r\n                        </Box>\r\n                      </React.Fragment>\r\n                    )}\r\n                  </React.Fragment>\r\n                </FormFieldsSection>\r\n              </FormLeftSection>\r\n            </StyledFormFieldsContainer>\r\n          </Box>\r\n        ) : (\r\n          <React.Fragment>\r\n            <Box component=\"div\">\r\n              <Progress\r\n                inProgress={fetchQuizPromiseState.status === 'pending'}\r\n                size={80}\r\n              />\r\n            </Box>\r\n          </React.Fragment>\r\n        )\r\n      }\r\n      leftActions={state?.UserCanStartQuiz ? leftActions : undefined}\r\n      rightActions={rightActions}\r\n      closable={true}\r\n    />\r\n  );\r\n}\r\n","import { Chip, ChipProps, Theme, withStyles } from '@material-ui/core';\r\n\r\nexport interface StatusChipProps extends ChipProps {}\r\n\r\nconst StyledChip = withStyles((theme: Theme) => ({\r\n  //   root: {\r\n  //     borderRadius: 4,\r\n  //     backgroundColor: theme.palette.primary.main,\r\n  //     height: 24,\r\n  //     color: theme.palette.common.white,\r\n  //     gap: 4,\r\n  //     paddingBlock: '2px',\r\n  //     '&$disabled': {\r\n  //       opacity: 1,\r\n  //       backgroundColor: theme.palette.common.grayComponents,\r\n  //       color: theme.palette.common.white,\r\n  //       pointerEvents: 'none',\r\n  //     },\r\n  //     '&:hover, &:focus': {\r\n  //       backgroundColor: theme.palette.primary.dark,\r\n  //       color: theme.palette.common.white,\r\n  //     },\r\n  //   },\r\n  //   disabled: {\r\n  //     backgroundColor: theme.palette.common.grayComponents,\r\n  //     color: theme.palette.common.white,\r\n  //   },\r\n  //   label: {\r\n  //     fontFamily: `'Lato', sans-serif`,\r\n  //     fontStyle: 'normal',\r\n  //     fontWeight: 400,\r\n  //     fontSize: '14px',\r\n  //     lineHeight: '141%',\r\n  //     letterSpacing: '0.1px',\r\n  //   },\r\n  //   labelSmall: {\r\n  //     fontFamily: `'Lato', sans-serif`,\r\n  //     fontStyle: 'normal',\r\n  //     fontWeight: 400,\r\n  //     fontSize: '14px',\r\n  //     lineHeight: '141%',\r\n  //     letterSpacing: '0.1px',\r\n  //   },\r\n  //   clickable: {\r\n  //     backgroundColor: theme.palette.primary.main,\r\n  //     color: theme.palette.common.white,\r\n  //   },\r\n  //   sizeSmall: {\r\n  //     height: 20,\r\n  //   },\r\n  //   deleteIcon: {\r\n  //     color: theme.palette.primary.contrastText,\r\n  //     height: 18,\r\n  //     width: 18,\r\n  //     '&:hover': {\r\n  //       color: fade(theme.palette.primary.contrastText, 0.8),\r\n  //     },\r\n  //   },\r\n}))(Chip);\r\n\r\nexport const StatusChip = (props: StatusChipProps) => {\r\n  return <StyledChip {...props} />;\r\n};\r\n","import { IWorkOrderDetailsDto } from 'api/odata/generated/entities/IWorkOrderDetailsDto';\r\nimport { StatusChip } from 'app/components/BasicChip/StatusChip';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { UserProfileLink } from 'app/components/BasicTable/components/UserProfileLink';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { AssetLink } from '../AssetPopUp/OpenAssetDetails';\r\nimport {\r\n  allowedToViewAlert,\r\n  IAlertPermissionCheckRecord,\r\n} from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { WorkOrderLink } from '../Actions/GlobalSelectedActions/OpenWorkOrder';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nexport const getColumns = (\r\n  t: TFunction,\r\n  appSettings?: AppSettings,\r\n  globalSettings?: GlobalSettings,\r\n  user?: AuthenticatedUser,\r\n  useSidePanel?: boolean,\r\n  openPanel?: (state: SidePanelOpenState) => void,\r\n): Column<IWorkOrderDetailsDto>[] => {\r\n  return [\r\n    {\r\n      Header: t(translations.Id) as string,\r\n      accessor: 'Id',\r\n      //for testing comments component\r\n      //Cell: WorkOrderIdRenderer,\r\n      Cell: ({ value, row }) => {\r\n        return allowedToViewAlert(\r\n          user,\r\n          row.original as IAlertPermissionCheckRecord,\r\n        ) && value !== null ? (\r\n          <WorkOrderLink\r\n            id={value}\r\n            useSidePanel={useSidePanel}\r\n            openPanelWithCover={openPanel}\r\n          >\r\n            {value}\r\n          </WorkOrderLink>\r\n        ) : (\r\n          <>{value}</>\r\n        );\r\n      },\r\n    },\r\n    //Attachment of Comment\r\n    {\r\n      Header: () => (\r\n        <>\r\n          {t(translations.Attachment) as string} <Icon icon=\"paperclip\" />\r\n        </>\r\n      ),\r\n      accessor: 'AttachmentExist',\r\n      Cell: ({ value, row }) => (\r\n        <>{value === true ? <Icon icon=\"paperclip\" /> : <></>}</>\r\n      ),\r\n    },\r\n    {\r\n      Header: t(translations.AssetName) as string,\r\n      accessor: 'AssetName', // AssetName\r\n      Cell: ({ value, row }) =>\r\n        !!row.original.AssetId ? (\r\n          <AssetLink\r\n            id={row.original.AssetId ?? undefined}\r\n            openPanelWithCover={openPanel}\r\n            useSidePanel={useSidePanel}\r\n          >\r\n            {value}\r\n          </AssetLink>\r\n        ) : (\r\n          <>{value}</>\r\n        ),\r\n    },\r\n    {\r\n      Header: t(translations.ServiceGroup) as string,\r\n      accessor: 'ServiceGroup', // Laboratory\r\n    },\r\n    {\r\n      Header: t(translations.AlertDescription) as string,\r\n      accessor: 'AlertDescription', // Description\r\n      Cell: DescriptionCell({ width: 'short' }),\r\n    },\r\n    {\r\n      Header: t(translations.AlertTitle) as string,\r\n      accessor: 'AlertTitle', // Subject\r\n    },\r\n    {\r\n      Header: t(translations.StatusName) as string,\r\n      accessor: 'StatusName', // StatusName\r\n    },\r\n    {\r\n      Header: t(translations.AlertType) as string,\r\n      accessor: 'AlertType', // WorkOrderType\r\n    },\r\n    {\r\n      Header: t(translations.EventDueDate) as string,\r\n      accessor: 'EventStart', // WorkOrderStart\r\n      Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)}</>,\r\n    },\r\n    {\r\n      Header: t(translations.EventEnd) as string,\r\n      accessor: 'EventEnd', // WorkOrderEnd\r\n      Cell: ({ value }) => {\r\n        if (value !== null) {\r\n          return <>{dateUtils.shortDateTimeFormat(value)}</>;\r\n        } else {\r\n          return <></>;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.ReportedBy) as string,\r\n      accessor: 'ReportedBy',\r\n      Cell: ({ value, row }) => (\r\n        <>\r\n          <UserProfileLink\r\n            UserId={`${row.original.ReportedBy}`}\r\n            DisplayName={`${row.original.ReportedByDisplayName}`}\r\n          />\r\n        </>\r\n      ),\r\n    },\r\n    {\r\n      Header: t(translations.AssignedUsers) as string,\r\n      accessor: 'AssignedUsers',\r\n      Cell: ({ value, row }) => {\r\n        if (value !== undefined) {\r\n          let users = value.map((item, i) => {\r\n            return (\r\n              <Box key={item.Id}>\r\n                <UserProfileLink UserId={item.Id} DisplayName={item.Name} />\r\n                <br />\r\n              </Box>\r\n            );\r\n          });\r\n          return <>{users}</>;\r\n        }\r\n        return t(translations.NA) as string;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.LastUpdated) as string,\r\n      accessor: 'LastUpdated', // UpdatedAt\r\n      Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)}</>,\r\n    },\r\n    {\r\n      Header: t(translations.Reservation) as string,\r\n      accessor: 'Reservation', // ReservationId\r\n    },\r\n    {\r\n      Header: t(translations.LastComment) as string,\r\n      accessor: 'LastComment',\r\n      Cell: DescriptionCell({ width: 'medium' }),\r\n    },\r\n    {\r\n      Header: t(translations.LastCommentBy) as string,\r\n      accessor: 'LastCommentBy',\r\n    },\r\n    {\r\n      Header: t(translations.LastCommentAt) as string,\r\n      accessor: 'LastCommentAt',\r\n      Cell: ({ value }) => <>{dateUtils.shortDateTimeFormat(value)}</>,\r\n    },\r\n    {\r\n      Header: t(translations.AlertOfflineTime) as string,\r\n      accessor: 'AlertOfflineTime', // OfflineTime (h)\r\n      Cell: ({ value, row }) => {\r\n        if (value) {\r\n          if (value > 69000000) {\r\n            return (\r\n              <StatusChip\r\n                label={t(translations.UnlimitedDowntime)}\r\n                size=\"small\"\r\n                icon={<Icon icon={['fad', 'infinity']} size=\"2x\" />}\r\n                variant=\"outlined\"\r\n              />\r\n            );\r\n          } else {\r\n            return value;\r\n          }\r\n        } else {\r\n          return <>{'N/A'}</>;\r\n        }\r\n        // let startTime: Date | null = value;\r\n        // let endTime: Date | null = row.original.OfflineEnd;\r\n        // if (startTime !== null && endTime !== null) {\r\n        //   let newStartTime = new Date(startTime);\r\n        //   let newEndTime = new Date(endTime);\r\n        //   let timeDiff =\r\n        //     (newEndTime.getTime() - newStartTime.getTime()) / 36e5;\r\n        //   return <> {roundTwoPlacesAfterDecimalPoint(value)} </>;\r\n        // } else return <></>;\r\n      },\r\n    },\r\n  ];\r\n};\r\n","import fileDownload from 'js-file-download';\r\nimport * as Papa from 'papaparse';\r\n\r\nexport type CsvColumnsMapType<T> = { [key in keyof T]: 'string' };\r\n\r\nexport async function writeCsvFile(\r\n  fields: string[],\r\n  data: string[][],\r\n): Promise<string> {\r\n  return new Promise((resolve, reject) => {\r\n    try {\r\n      const csv = Papa.unparse({ fields: fields, data: data });\r\n      resolve(csv);\r\n    } catch (error) {\r\n      reject(error);\r\n    }\r\n  });\r\n}\r\nexport async function exportCsv({\r\n  data,\r\n  fields,\r\n  fileName = 'file.csv',\r\n}: {\r\n  data: unknown[][];\r\n  fields: string[];\r\n  fileName: string;\r\n}): Promise<void> {\r\n  const stringData = data.map(row =>\r\n    row.map(value => (value as any)?.toString()),\r\n  );\r\n  const csvContent = await writeCsvFile(fields, stringData);\r\n  fileDownload(csvContent, fileName);\r\n}\r\n","import {\r\n  call,\r\n  put,\r\n  takeLatest,\r\n  debounce,\r\n  select,\r\n  takeLeading,\r\n} from 'redux-saga/effects';\r\nimport { samplesListActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { PayloadAction } from '@reduxjs/toolkit';\r\nimport {\r\n  IRunDetails,\r\n  ISample,\r\n  ISampleListTableState,\r\n  ISampleRun,\r\n  ISampleRunUpdate,\r\n  ISampleTarget,\r\n} from './types';\r\nimport { push } from 'connected-react-router';\r\nimport { TableFilterBuilder } from 'app/components/BasicTable/TableFilterBuilder';\r\nimport { AxiosError } from 'axios';\r\nimport * as Papa from 'papaparse';\r\nimport { Identifiable } from 'types/common';\r\nimport { selectRunDetails, selectSamplesTableState } from './selectors';\r\nimport { RunTypesUnion } from '../../components/RunTypePicker';\r\n\r\nimport { getExportParameters, buildURL } from 'utils/url-utils';\r\nimport i18next from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { selectSamplePlatesTableState } from '../../SamplePlatesPage/slice/selectors';\r\nimport { deleteSamples, IDeleteSamplesResult } from 'api/SamplesApi';\r\nimport { exportCsv } from 'utils/export';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\nimport { ISampleCreateBase } from '../../SamplePlatesPage/slice/types';\r\nimport { ISamplePlateDto } from 'api/odata/generated/entities/ISamplePlateDto';\r\nimport { IRow } from 'app/components/BasicTable/IRow';\r\nimport { BasicTableRefreshEventHandler } from 'app/components/BasicTable/ControlledTable/ControlledTableProps';\r\nimport { openExportLink } from 'utils/url-utils';\r\n\r\ninterface ODataParams {\r\n  $top: number | undefined;\r\n  $skip: number | undefined;\r\n  $count?: boolean;\r\n  $orderby?: string;\r\n  $filter?: string;\r\n  $select?: string;\r\n}\r\nexport function getLoadDataParams(\r\n  currentTableState: Partial<ISampleListTableState>,\r\n): ODataParams {\r\n  const params = {\r\n    $count: true,\r\n    $top: currentTableState.pageSize,\r\n    $skip:\r\n      (currentTableState.pageIndex ?? 1) * (currentTableState.pageSize ?? 5),\r\n    $orderby:\r\n      currentTableState.sortBy\r\n        ?.map(f => `${f.id} ${f.desc ?? false ? 'desc' : 'asc'}`)\r\n        .join(',') || undefined,\r\n    //$select: ,\r\n    $filter: TableFilterBuilder(\r\n      currentTableState.customFilters as Array<IFilterSettings<ISample>>,\r\n      currentTableState.globalFilter,\r\n      currentTableState.serviceGroups,\r\n      currentTableState.searchColumns,\r\n    ),\r\n    $select:\r\n      currentTableState.visibleColumns === undefined\r\n        ? undefined\r\n        : currentTableState.visibleColumns.join(','),\r\n  };\r\n  return params;\r\n}\r\nasync function loadData(currentTableState) {\r\n  const url = '/api/odata/v4/samples';\r\n  const params = getLoadDataParams(currentTableState);\r\n  const result = await httpClient.get(url, params);\r\n  return result;\r\n}\r\nfunction* doExport(action: PayloadAction<ISampleListTableState>) {\r\n  try {\r\n    const tableState = yield select(selectSamplesTableState);\r\n    const tableParams = getLoadDataParams({\r\n      ...tableState,\r\n      ...{ visibleColumns: action.payload.visibleColumns },\r\n    });\r\n    const entitySetURl = '/api/odata/v4/samples';\r\n    var params = getExportParameters(tableParams);\r\n    const url = buildURL(entitySetURl, params);\r\n    yield call(openExportLink, url);\r\n  } catch (error) {\r\n    console.error('doExport failed', error);\r\n  }\r\n}\r\nasync function loadIds(currentTableState) {\r\n  const url = '/api/odata/v4/samples';\r\n  const params = getLoadDataParams(currentTableState);\r\n  params.$top = undefined;\r\n  params.$skip = undefined;\r\n  params.$count = undefined;\r\n  params.$orderby = undefined;\r\n  params.$select = 'Id';\r\n  const result = await httpClient.get(url, params);\r\n  return result;\r\n}\r\nfunction* doLoadData(\r\n  action: PayloadAction<{\r\n    tableState: ISampleListTableState;\r\n    columns: (keyof ISample)[] | undefined;\r\n  }>,\r\n) {\r\n  try {\r\n    const data = yield call(loadData, action.payload);\r\n    yield put(actions.loadSamplesList_Success(data));\r\n  } catch (error) {\r\n    console.error(error);\r\n  }\r\n}\r\nfunction* doUpdateField(action: PayloadAction<Partial<ISample>>) {\r\n  const url = `/api/odata/v4/samples(${action.payload.Id})`;\r\n  const payload: Partial<ISample> = { ...action.payload };\r\n  delete payload.Id;\r\n  try {\r\n    yield call(httpClient.patch, url, payload);\r\n    yield put(actions.updateField_Success());\r\n  } catch (error) {\r\n    const msg = (error as AxiosError)?.response?.data?.error?.innererror\r\n      ?.message;\r\n    if (msg !== undefined) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          key: 'SamplesListPage.saga.updateField',\r\n          variant: 'error',\r\n          message: msg,\r\n        }),\r\n      );\r\n    }\r\n    yield put(actions.updateField_Error());\r\n  }\r\n}\r\nfunction* doRunSelectedSamples(\r\n  action: PayloadAction<{ runType?: string; samples: ISample[] | undefined }>,\r\n) {\r\n  try {\r\n    const httpUrl = '/api/odata/v4/sampleruns';\r\n    let samples = action.payload.samples;\r\n    if (samples === undefined) {\r\n      const tableState = yield select(selectSamplesTableState);\r\n      const allsamples = yield call(loadIds, tableState);\r\n      samples = allsamples.value;\r\n    }\r\n    if (samples === undefined) {\r\n      return;\r\n    }\r\n    const httpPayload = {\r\n      RunType: action.payload.runType,\r\n      Samples: samples.map(f => ({\r\n        Id: f.Id,\r\n      })),\r\n    };\r\n    const response = yield call(httpClient.post, httpUrl, httpPayload);\r\n    yield put(push(`/samples/runs/details/${response.Id}`));\r\n  } catch (error: unknown) {\r\n    console.error(error);\r\n  }\r\n}\r\nfunction* doCompleteRun(action: PayloadAction<IRunDetails>) {\r\n  try {\r\n    const url = `/api/odata/v4/sampleruns(${action.payload.Id})`;\r\n    // note that api call does not return dto but rater a custom summary of the operation\r\n    const completeRunResponse: {\r\n      derivativesCount: number;\r\n      skippedSamplesCount: number;\r\n    } = yield call(httpClient.put, url, action.payload);\r\n    yield put(actions.completeRun_Success);\r\n    const msg = [\r\n      i18next.t(translations.XSamplesWereProcessed, completeRunResponse),\r\n    ];\r\n    if (completeRunResponse.skippedSamplesCount > 0) {\r\n      msg.push(\r\n        i18next.t(translations.XSamplesWereSkipped, completeRunResponse),\r\n      );\r\n    }\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: msg.join(' '),\r\n        variant:\r\n          completeRunResponse.skippedSamplesCount === 0 &&\r\n          completeRunResponse.derivativesCount > 0\r\n            ? 'success'\r\n            : completeRunResponse.skippedSamplesCount > 0 &&\r\n              completeRunResponse.derivativesCount > 0\r\n            ? 'warning'\r\n            : 'error',\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const msg =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      'Operation Failed';\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'SamplesListPage.saga.updateField',\r\n        variant: 'error',\r\n        message: msg,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doUpdateRun(action: PayloadAction<ISampleRunUpdate>) {\r\n  try {\r\n    const url = '/api/odata/v4/SampleRuns/SampleRunUpdate';\r\n    const data = {\r\n      runupdate: action.payload,\r\n    };\r\n    const result = yield call(httpClient.post, url, data);\r\n    yield put(actions.updateRun_Success(result));\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: 'success',\r\n        variant: 'success',\r\n      }),\r\n    );\r\n  } catch (error: unknown) {\r\n    const msg =\r\n      (error as AxiosError)?.response?.data?.error?.innererror?.message ??\r\n      'Operation Failed';\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'SamplesListPage.saga.updateField',\r\n        variant: 'error',\r\n        message: msg,\r\n      }),\r\n    );\r\n  }\r\n}\r\nfunction* doLoadRunDetqails<TRow extends IRow>(\r\n  action: PayloadAction<{ id: number; columns: Array<keyof TRow> | undefined }>,\r\n) {\r\n  try {\r\n    const url = `/api/odata/v4/sampleruns(${action.payload.id})`;\r\n    const runDetails: IRunDetails = yield call(httpClient.get, url);\r\n\r\n    const samples_url = `/api/odata/v4/sampleruns(${action.payload.id})/Samples`;\r\n    const samples_response = yield call(httpClient.get, samples_url);\r\n    runDetails.Samples = samples_response.value;\r\n    yield put(actions.loadRunDetqails_Success(runDetails));\r\n  } catch (error: unknown) {\r\n    console.error(error);\r\n    yield put(actions.completeRun_Success);\r\n  }\r\n}\r\n/**\r\n * Reads a csv file and returns parse results\r\n * todo: move to shared utils location\r\n * @param file File\r\n * @returns parse results\r\n */\r\nfunction readCsvFile(file: File): Promise<Papa.ParseResult<unknown>> {\r\n  return new Promise((resolve, reject) => {\r\n    Papa.parse(file, {\r\n      header: true,\r\n      dynamicTyping: true,\r\n\r\n      complete: results => {\r\n        resolve(results);\r\n      },\r\n      error: error => {\r\n        reject(error);\r\n      },\r\n    });\r\n  });\r\n}\r\nconst platesUrl = `/api/odata/v4/SamplePlates`;\r\nasync function createPlate(samplePlateId: string, plate: ISampleCreateBase) {\r\n  const httpPayload: Partial<ISamplePlateDto> = {\r\n    Id: samplePlateId,\r\n    RoomId: plate.Room?.Id ?? null,\r\n    LocationId: plate.Location?.Id ?? null,\r\n    SamplePlateTypeId: plate.SamplePlateType?.Id,\r\n    ServiceGroupId: plate.ServiceGroup?.Id ?? null,\r\n    Active: plate.Active ?? true,\r\n    IsRack: plate.IsRack ?? false,\r\n  };\r\n  try {\r\n    return await httpClient.post(platesUrl, httpPayload);\r\n  } catch (error: unknown) {}\r\n}\r\nfunction createPlates(\r\n  runSamples: (Identifiable<number> & ISampleTarget)[],\r\n  plate: ISampleCreateBase,\r\n) {\r\n  return new Promise(async (resolve, reject) => {\r\n    try {\r\n      for (const record of runSamples) {\r\n        const tpid = record.TargetPlateId;\r\n        if (tpid !== undefined && tpid !== null && tpid !== '') {\r\n          const params: {\r\n            $filter: string;\r\n          } = {\r\n            // eslint-disable-next-line no-useless-concat\r\n            $filter: '(Id eq ' + \"'\" + tpid + \"'\" + ')',\r\n          };\r\n          try {\r\n            const count = await httpClient.get(`${platesUrl}/$count`, params);\r\n            if (count === 0) {\r\n              await createPlate(tpid, plate);\r\n            }\r\n          } catch {}\r\n        }\r\n      }\r\n      resolve(true);\r\n    } catch (error) {\r\n      reject(error);\r\n    }\r\n  });\r\n}\r\n\r\nfunction* doImportRunDetails(\r\n  action: PayloadAction<{ file: File; plate: ISampleCreateBase | null }>,\r\n) {\r\n  try {\r\n    const file = action.payload.file;\r\n    const result: Papa.ParseResult<Record<string, any>> = yield call(\r\n      readCsvFile,\r\n      file,\r\n    );\r\n    type t = Identifiable<number> & ISampleTarget;\r\n    const records = result.data\r\n      .filter(record => record['Id'] !== null)\r\n      .map(\r\n        record =>\r\n          ({\r\n            Id: record['Id'] as number,\r\n            TargetPlateId: record['target sample plate id']?.toString()?.trim(),\r\n            TargetPosition: record['target sample plate position']\r\n              ?.toString()\r\n              ?.trim(),\r\n            TargetConcentration: record['target sample concentration (mg/mL)'],\r\n            TargetVolume: record['target sample volume (ul)'],\r\n            TargetTubeLabel: record['target tube id']?.toString()?.trim(),\r\n            TargetSampleType: record['target sample type']?.toString()?.trim(),\r\n          } as t),\r\n      );\r\n    const runDetails: IRunDetails = yield select(selectRunDetails);\r\n\r\n    const runSamples = records\r\n      .filter(record =>\r\n        runDetails.Samples.find(sample => sample.Id === record.Id),\r\n      )\r\n      .map(record => {\r\n        const result: Partial<ISampleTarget> = { Id: record.Id };\r\n        const runType = runDetails.RunType;\r\n        const positionImport: RunTypesUnion[] = [\r\n          'Fractioning',\r\n          'Labeling',\r\n          'StandardRun',\r\n        ];\r\n        if (positionImport.includes(runType)) {\r\n          result.TargetPlateId = record?.TargetPlateId;\r\n          result.TargetPosition = record?.TargetPosition;\r\n          result.TargetTubeLabel = record?.TargetTubeLabel;\r\n          result.TargetSampleType = record?.TargetSampleType;\r\n        }\r\n        const volumeImport: RunTypesUnion[] = [\r\n          'Fractioning',\r\n          'Labeling',\r\n          'MassSpec',\r\n        ];\r\n        if (volumeImport.includes(runType)) {\r\n          result.TargetVolume = record.TargetVolume;\r\n          result.TargetConcentration = record.TargetConcentration;\r\n        }\r\n        return record;\r\n      });\r\n\r\n    // Checking and creating missing Plates\r\n    if (action.payload.plate !== null) {\r\n      yield call(createPlates, runSamples, action.payload.plate);\r\n    }\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'runsamples_import',\r\n        variant: records.length === runSamples.length ? 'success' : 'warning',\r\n        message:\r\n          'Import finished: Matching sample IDs were updated with the related target plate ID and target plate positions as per the file. Violations for samples already existing in the target plate position will be done on clicking Complete',\r\n      }),\r\n    );\r\n    yield put(actions.readImportFile_Success(runSamples));\r\n  } catch (error) {\r\n    console.error(error);\r\n  }\r\n}\r\n\r\nfunction* doLoadAllSelectedSamples(\r\n  action: PayloadAction<ISample[] | undefined>,\r\n) {\r\n  try {\r\n    const tablestate = yield select(selectSamplesTableState);\r\n    const foo = yield call(loadIds, tablestate);\r\n    yield put(actions.loadAllFilteredSamples_Success(foo));\r\n  } catch {}\r\n}\r\n\r\nfunction* doExportRun(action: PayloadAction<ISampleRun[]>) {\r\n  try {\r\n    const fields = [\r\n      'Id',\r\n      'analytical sample id',\r\n      'TMT Label',\r\n      'TMT Run Set',\r\n      'source sample type',\r\n      'source sample plate id',\r\n      'source sample plate position',\r\n      'source tube id',\r\n      'source sample volume (ul)',\r\n      'source sample concentration (mg/mL)',\r\n      'target sample type',\r\n      'target sample plate id',\r\n      'target sample plate position',\r\n      'target tube id',\r\n      'target sample volume (ul)',\r\n      'target sample concentration (mg/mL)',\r\n    ];\r\n    const data = action.payload.map(item => [\r\n      item.Id,\r\n      item.AnalyticalSampleId,\r\n      item.TMT_Label,\r\n      item.TMT_Set,\r\n      item.TMT_Type,\r\n      item.SamplePlateId,\r\n      item.Position,\r\n      item.TubeLabel,\r\n      item.Volume,\r\n      item.Concentration,\r\n      item.TargetSampleType,\r\n      item.TargetPlateId,\r\n      item.TargetPosition,\r\n      item.TargetTubeLabel,\r\n      item.TargetVolume,\r\n      item.TargetConcentration,\r\n    ]);\r\n\r\n    yield call(() =>\r\n      exportCsv({\r\n        fields: fields,\r\n        data: data,\r\n        fileName: 'file.csv',\r\n      }),\r\n    );\r\n  } catch (error) {\r\n    console.error(error);\r\n  }\r\n}\r\n\r\nfunction* doDeleteSamples(\r\n  action: PayloadAction<{\r\n    selectedRows: ISample[];\r\n    refresh: BasicTableRefreshEventHandler | undefined;\r\n  }>,\r\n) {\r\n  let r: IDeleteSamplesResult = yield call(\r\n    deleteSamples,\r\n    action.payload.selectedRows,\r\n  );\r\n  action.payload.refresh?.();\r\n  for (const error of r.errors) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: error.message,\r\n      }),\r\n    );\r\n  }\r\n  if (r.successCount > 0) {\r\n    // reload table data\r\n    const tableState = yield select(selectSamplePlatesTableState);\r\n    yield put(actions.loadSamplesList(tableState));\r\n\r\n    // post success notification of deleted records\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.XRecordsWereBeDeleted, {\r\n          x: r.successCount,\r\n        }),\r\n      }),\r\n    );\r\n  }\r\n}\r\n\r\nexport function* samplesListSaga() {\r\n  yield debounce(500, actions.loadSamplesList.type, doLoadData);\r\n  yield debounce(500, actions.updateField.type, doUpdateField);\r\n  yield takeLatest(actions.runSelectedSamples.type, doRunSelectedSamples);\r\n  yield takeLatest(actions.completeRun.type, doCompleteRun);\r\n  yield takeLatest(actions.updateRun.type, doUpdateRun);\r\n  yield takeLatest(actions.loadRunDetqails.type, doLoadRunDetqails);\r\n  yield takeLatest(actions.readImportFile.type, doImportRunDetails);\r\n  yield takeLatest(\r\n    actions.loadAllFilteredSamples.type,\r\n    doLoadAllSelectedSamples,\r\n  );\r\n  yield takeLatest(actions.exportRun.type, doExportRun);\r\n  yield takeLeading(actions.deleteSamples.type, doDeleteSamples);\r\n  yield takeLatest(actions.export.type, doExport);\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\n\r\nexport const AssetsApi = {\r\n  LocalAppUpgrade: (ids: number[]) => {\r\n    const data = { ids };\r\n    const url = '/api/odata/v4/MyAssets/StartUpgradeIds';\r\n    return httpClient.post(url, data);\r\n  },\r\n};\r\n","import { SelectedRowsActionIconButton } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionIconButton';\r\nimport { SelectedRowsActionRenderer } from 'app/components/BasicTable/SelectedRowsActionButton/SelectedRowsActionRenderer';\r\nimport { initAssetsData } from 'app/components/pickers/MultiSelectPickers/AssetsPicker';\r\nimport { ExportImportActions } from 'app/components/PopupImportExport/Actions';\r\nimport { AddWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/AddWorkOrder';\r\n//import { AssetRangesExportForImport } from 'app/pages/Actions/GlobalSelectedActions/AssetRangesExportForImport';\r\nimport { BringBackUp } from 'app/pages/Actions/GlobalSelectedActions/BringBackUp';\r\nimport { CloneEquipmentSettings } from 'app/pages/Actions/GlobalSelectedActions/CloneEquipments';\r\nimport { DownWorkOrder } from 'app/pages/Actions/GlobalSelectedActions/DownWorkOrder';\r\nimport { OpenCalendar } from 'app/pages/Actions/GlobalSelectedActions/OpenCalendar';\r\nimport { OpenWorkOrders } from 'app/pages/Actions/GlobalSelectedActions/OpenWrokOrders';\r\nimport { RenderTypes } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/renderTypes';\r\nimport { useAssetsPermissions } from 'app/pages/Actions/GlobalSelectedActions/ValidToRender/useAssetsPermissionsUtils';\r\nimport { AddToLists } from 'app/pages/SavedViewsPage/AddToLists';\r\nimport { useAdminPermissions } from 'app/permissions/Asset/assetPermissions';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { TFunction } from 'i18next';\r\nimport fileDownload from 'js-file-download';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useMemo } from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { IMyAssetsRow } from '../IMyAssetsRow';\r\nimport { openExportLink } from 'utils/url-utils';\r\nimport { ImportAdditionalData } from 'app/components/PopupImportExport/Actions/Types';\r\nimport { PrintSelectedAssetLabelsButton } from 'app/components/LabelPrint/PrintSelectedAssetLabelsButton';\r\nimport { mapToAssetDto } from 'app/pages/AssetPopUp/IAsset';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalServiceGroupFilter } from 'app/slice/selectors';\r\nimport { ExportQRCodesButton } from 'app/components/QrCodeExport';\r\nimport { AssetsApi } from '../Actions/Api';\r\n\r\nexport interface GetSelectedActionsProps {\r\n  enableSavedLists?: boolean;\r\n  canExportAssetRanges?: boolean;\r\n  isShowAllCores?: boolean;\r\n  authenticatedUser?: AuthenticatedUser;\r\n  useSidePanel?: boolean;\r\n}\r\n\r\nexport function GetSelectedActions(\r\n  t: TFunction,\r\n  props: GetSelectedActionsProps,\r\n): SelectedRowsActionRenderer<IMyAssetsRow>[] {\r\n  const { allowedToView } = useAssetsPermissions();\r\n  const ap = useAdminPermissions();\r\n  const allowedToImport = React.useCallback(\r\n    (rows: any[]): any[] => {\r\n      return rows.filter(r => ap.allowedToAdd(r) && ap.allowedToEdit(r));\r\n    },\r\n    [ap],\r\n  );\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const enabledByCores = React.useCallback(\r\n    (rows: IMyAssetsRow[]) => {\r\n      return !props.isShowAllCores\r\n        ? true\r\n        : rows.every(f =>\r\n            selectedServiceGroups?.some(g => g.Id === f.ServiceGroupId),\r\n          );\r\n    },\r\n    [props.isShowAllCores, selectedServiceGroups],\r\n  );\r\n  const SelectedActions: SelectedRowsActionRenderer<IMyAssetsRow>[] = useMemo(\r\n    () => [\r\n      rows =>\r\n        props.enableSavedLists &&\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.AddToList) &&\r\n        enabledByCores(rows) && (\r\n          <AddToLists\r\n            rows={rows}\r\n            useSidePanel={props.useSidePanel}\r\n            getEquipments={rows =>\r\n              rows.map(item => {\r\n                return {\r\n                  Id: item.ServiceId,\r\n                  Name: item.Name,\r\n                } as Entity<number>;\r\n              })\r\n            }\r\n            getAssets={rows => {\r\n              let ids = rows.map(item => item.Id).join(',');\r\n              return initAssetsData(ids);\r\n            }}\r\n          />\r\n        ),\r\n      rows =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.OpenCalendar) &&\r\n        enabledByCores(rows) && (\r\n          <OpenCalendar\r\n            rows={rows}\r\n            getEquipmentIds={rows =>\r\n              rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n            }\r\n            bookMultiple\r\n          />\r\n        ),\r\n      /* Commented according to BKT-7297 */\r\n      /*       (rows, refresh) =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.OpenTimeline) && (\r\n          <OpenTimeline\r\n            rows={rows}\r\n            getEquipmentIds={rows =>\r\n              rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n            }\r\n          />\r\n        ), */\r\n      rows =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.OpenWorkOrders) &&\r\n        enabledByCores(rows) && (\r\n          <OpenWorkOrders\r\n            rows={rows}\r\n            getAssetIds={r => r.map(a => a.Id) || []}\r\n          />\r\n        ),\r\n      rows =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.AddWorkOrder) &&\r\n        enabledByCores(rows) && (\r\n          <AddWorkOrder\r\n            rows={rows}\r\n            getAssets={rows => {\r\n              let ids = rows.map(item => item.Id).join(',');\r\n              return initAssetsData(ids);\r\n            }}\r\n            buttonName={t(translations.AddEvent)}\r\n            useSidePanel={props.useSidePanel}\r\n          />\r\n        ),\r\n      rows =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.DownWorkOrder) &&\r\n        enabledByCores(rows) && (\r\n          <DownWorkOrder\r\n            rows={rows}\r\n            getAssets={rows => {\r\n              let ids = rows.map(item => item.Id).join(',');\r\n              return initAssetsData(ids);\r\n            }}\r\n            buttonName={t(translations.TakeDown)}\r\n            useSidePanel={props.useSidePanel}\r\n          />\r\n        ),\r\n      rows =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.CloneEquipments) && (\r\n          <CloneEquipmentSettings\r\n            rows={rows}\r\n            getEquipmentIds={rows =>\r\n              rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n            }\r\n          />\r\n        ),\r\n      (rows, onRefresh) => {\r\n        if (\r\n          allowedToView(rows.map(mapToAssetDto), RenderTypes.ExportForImport)\r\n        ) {\r\n          const exportRows = allowedToImport(rows);\r\n          if (exportRows.length > 0) {\r\n            return (\r\n              <SelectedRowsActionIconButton\r\n                key=\"export-forimport-assets\"\r\n                title={t(translations.ExportForImport)}\r\n                text={t(translations.ExportForImport)}\r\n                confirm={false}\r\n                validConfirm={false}\r\n                rows={rows}\r\n                onRefresh={onRefresh}\r\n                variantButton=\"button\"\r\n                action={() =>\r\n                  new Promise<IResponseType>(async (resolve, reject) => {\r\n                    const selectedRows = exportRows.map(item => item.Id);\r\n                    const res = await ExportImportActions.ExportForImport(\r\n                      ScreensId.MyAssets,\r\n                      selectedRows,\r\n                    );\r\n                    const cd = res.headers['content-disposition'];\r\n                    const filename =\r\n                      cd !== undefined\r\n                        ? cd.split('filename=')[1]\r\n                        : 'ExportForImport_assets.xlsx';\r\n                    fileDownload(res.data, filename);\r\n                    let messages: IResponseType = {\r\n                      SuccessMessages: [],\r\n                      ErrorMessages: [],\r\n                      WarningMessages: [],\r\n                    };\r\n                    resolve(messages);\r\n                  })\r\n                }\r\n              />\r\n            );\r\n          } else {\r\n            return <></>;\r\n          }\r\n        } else {\r\n          return <></>;\r\n        }\r\n      },\r\n      (rows, onRefresh) => {\r\n        if (\r\n          allowedToView(rows.map(mapToAssetDto), RenderTypes.ExportForImport) &&\r\n          props.canExportAssetRanges\r\n        ) {\r\n          const exportRows = allowedToImport(rows);\r\n          if (exportRows.length > 0) {\r\n            return (\r\n              //<AssetRangesExportForImport\r\n              //rows={rows}\r\n              //getAssetIds={rows => rows.map(r => r.Id)}\r\n              ///>\r\n              <SelectedRowsActionIconButton\r\n                key=\"export-forimport-assetRanges\"\r\n                title={t(translations.ExportAssetRangesTooltip)}\r\n                text={t(translations.ExportAssetRanges)}\r\n                confirm={false}\r\n                validConfirm={false}\r\n                rows={rows}\r\n                onRefresh={onRefresh}\r\n                variantButton=\"button\"\r\n                action={() =>\r\n                  new Promise<IResponseType>(async (resolve, reject) => {\r\n                    const selectedRows = exportRows.map(item => item.Id);\r\n                    const res = await ExportImportActions.ExportForImport(\r\n                      ScreensId.MyAssets,\r\n                      selectedRows,\r\n                      ImportAdditionalData.AssetRanges,\r\n                    );\r\n                    const cd = res.headers['content-disposition'];\r\n                    const filename =\r\n                      cd !== undefined\r\n                        ? cd.split('filename=')[1]\r\n                        : 'ExportForImport_assetRanges.xlsx';\r\n                    fileDownload(res.data, filename);\r\n                    let messages: IResponseType = {\r\n                      SuccessMessages: [],\r\n                      ErrorMessages: [],\r\n                      WarningMessages: [],\r\n                    };\r\n                    resolve(messages);\r\n                  })\r\n                }\r\n              />\r\n            );\r\n          } else {\r\n            return <></>;\r\n          }\r\n        } else {\r\n          return <></>;\r\n        }\r\n      },\r\n      (rows, onRefresh) => {\r\n        if (\r\n          allowedToView(rows.map(mapToAssetDto), RenderTypes.DownloadImages)\r\n        ) {\r\n          return (\r\n            <SelectedRowsActionIconButton\r\n              key=\"download-asset-images\"\r\n              title={t(translations.DownloadAssetImages)}\r\n              text={t(translations.DownloadAssetImages)}\r\n              confirm={false}\r\n              validConfirm={false}\r\n              rows={rows}\r\n              onRefresh={onRefresh}\r\n              variantButton=\"button\"\r\n              action={() =>\r\n                new Promise<IResponseType>(async (resolve, reject) => {\r\n                  const rowHasNoImages =\r\n                    rows.filter(f => f.ImageName === null).length > 0;\r\n                  if (rowHasNoImages) {\r\n                    const messages: IResponseType = {\r\n                      SuccessMessages: [],\r\n                      ErrorMessages: ['One or more row has no image file'],\r\n                      WarningMessages: [],\r\n                    };\r\n                    resolve(messages);\r\n                  } else {\r\n                    const downUrl = `api/AssetImages/Selected?selectedIds=${rows\r\n                      .map(r => r.Id)\r\n                      .join(',')}`;\r\n                    await openExportLink(downUrl);\r\n                    const messages: IResponseType = {\r\n                      SuccessMessages: [t(translations.Success)],\r\n                      ErrorMessages: [],\r\n                      WarningMessages: [],\r\n                    };\r\n                    resolve(messages);\r\n                  }\r\n                })\r\n              }\r\n            />\r\n          );\r\n        } else return <></>;\r\n      },\r\n      rows =>\r\n        allowedToView(rows.map(mapToAssetDto), RenderTypes.BringBackUp) &&\r\n        enabledByCores(rows) &&\r\n        rows.some(f => f.StatusId === 2 || f.StatusId === 3) && (\r\n          <BringBackUp\r\n            rows={rows}\r\n            getEquipmentIds={rows =>\r\n              rows.map(r => r.ServiceId ?? 0).filter(f => f > 0)\r\n            }\r\n            getAssetIds={rows => rows.map(r => r.Id ?? 0).filter(f => f > 0)}\r\n            useSidePanel={props.useSidePanel}\r\n          />\r\n        ),\r\n      (rows, onRefresh) => {\r\n        if (\r\n          allowedToView(rows.map(mapToAssetDto), RenderTypes.PrintAssetLabels)\r\n        ) {\r\n          return (\r\n            <PrintSelectedAssetLabelsButton\r\n              key=\"printlabels\"\r\n              rows={rows}\r\n              onRefresh={onRefresh}\r\n              title={t(translations.PrintLabels)}\r\n            />\r\n          );\r\n        }\r\n      },\r\n      (rows, onRefresh, toggleAllRowsSelected) => {\r\n        if (allowedToView(rows.map(mapToAssetDto), RenderTypes.ExportQRCodes)) {\r\n          return (\r\n            <>\r\n              <ExportQRCodesButton\r\n                url=\"/api/QrCodes/assets\"\r\n                rows={rows}\r\n                toggleAllRowsSelected={toggleAllRowsSelected}\r\n              />\r\n            </>\r\n          );\r\n        } else {\r\n        }\r\n      },\r\n      (rows, onRefresh) => (\r\n        <SelectedRowsActionIconButton\r\n          key=\"startupgrade\"\r\n          text={t(translations.UpgradeLocalApp)}\r\n          title={t(translations.UpgradeLocalApp)}\r\n          rows={rows}\r\n          onRefresh={onRefresh}\r\n          variantButton=\"button\"\r\n          action={() =>\r\n            new Promise<IResponseType>((resolve, reject) => {\r\n              const ids = rows.map(r => r.Id);\r\n              return AssetsApi.LocalAppUpgrade(ids)\r\n                .then(response => {\r\n                  const messages: IResponseType = {\r\n                    SuccessMessages: [t(translations.Success) as string],\r\n                    ErrorMessages: [],\r\n                    WarningMessages: [],\r\n                  };\r\n                  resolve(messages);\r\n                })\r\n                .catch(error => {\r\n                  console.log('status error', error);\r\n                  let err = t(translations.Failed) as string;\r\n                  reject(err);\r\n                });\r\n            })\r\n          }\r\n        />\r\n      ),\r\n    ],\r\n    [\r\n      allowedToImport,\r\n      allowedToView,\r\n      enabledByCores,\r\n      props.canExportAssetRanges,\r\n      props.enableSavedLists,\r\n      props.useSidePanel,\r\n      t,\r\n    ],\r\n  );\r\n\r\n  return SelectedActions;\r\n}\r\n","import { GlobalSettingsType } from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport {\r\n  ErrorServices,\r\n  ReportConsumablesState,\r\n  ServiceChangeStateParameters,\r\n} from '../Details/slice/types';\r\nimport React from 'react';\r\nimport * as Yup from 'yup';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n  StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport {\r\n  selectConnectedFiltersData,\r\n  selectConnectedSettings,\r\n} from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport {\r\n  selectConnectedInitState,\r\n  selectConsumablesHasErrors,\r\n  selectConsumablesValueHandler,\r\n  selectEditCreatableService,\r\n  selectServiceChangeState,\r\n} from '../Details/slice/selectors';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { isEmpty } from 'lodash';\r\nimport { ConnectedFiltersControl } from 'app/components/Forms/FormConnectedFilters/ConnectedFiltersControl';\r\nimport {\r\n  FieldHandler,\r\n  FormListener,\r\n  SubmittingHandler,\r\n} from 'app/components/Forms/FormRender/FormRenderer';\r\nimport { BookQuickServices } from '../Details/components/BookQuickServices';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { IConnectedFiltersDto } from 'types/IConnectedFiltersDto';\r\nimport { IOfflineServiceFilterDto } from 'types/IOfflineServiceFilterDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { IUserFilterDto } from 'api/odata/generated/entities/IUserFilterDto';\r\nimport { ErrorsSummury } from 'app/components/Forms/FormsLayout/FormErrorSummury';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SnackBarMessageType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport {\r\n  ListMessagesProps,\r\n  SingleMessagesProps,\r\n} from 'app/Layout/FrontendLayout/components/Snackbar/Actions';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\n\r\nexport interface ConsumablesFormProps {\r\n  onSubmit: (\r\n    item: ReportConsumablesState,\r\n    factor?: number,\r\n    remarks?: string,\r\n  ) => void;\r\n  onAddServiceClick: (services: number[]) => void;\r\n  initialValues: ReportConsumablesState;\r\n  processing?: boolean;\r\n  bindSubmitForm: any;\r\n  isAdmin: boolean;\r\n  user?: AuthenticatedUser;\r\n  innerFormRef: React.RefObject<FormikProps<ReportConsumablesState>>;\r\n  connectedFiltersFormRef: React.MutableRefObject<any>;\r\n  globalSettings: GlobalSettingsType;\r\n  onOfflineServiceClick?: (\r\n    service: IOtherServices,\r\n    discountFactor?: number,\r\n    remarks?: string,\r\n  ) => void;\r\n  editCreatable?: boolean;\r\n  onAddBatchClick: (\r\n    batch: IInventoryBatchDto | null,\r\n    serviceTypeId: number,\r\n  ) => void;\r\n  onRenewStockClick?: (service: IOtherServices) => void;\r\n  setError?: (errors: ErrorServices) => void;\r\n  offlineServicesErrors: ErrorServices[];\r\n}\r\n\r\nexport const ConsumablesForm = React.memo(function ConsumablesForm({\r\n  onSubmit,\r\n  processing,\r\n  initialValues,\r\n  bindSubmitForm,\r\n  isAdmin,\r\n  user,\r\n  connectedFiltersFormRef,\r\n  globalSettings,\r\n  innerFormRef,\r\n  onOfflineServiceClick,\r\n  onAddServiceClick,\r\n  editCreatable,\r\n  onAddBatchClick,\r\n  onRenewStockClick,\r\n  offlineServicesErrors,\r\n  setError,\r\n}: ConsumablesFormProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n  const { actions: appActions } = useAppSettingsSlice();\r\n\r\n  const fieldHandler = useSelector(selectConsumablesValueHandler);\r\n  const hasError = useSelector(selectConsumablesHasErrors);\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  const connectedData = useSelector(selectConnectedFiltersData);\r\n  const connectedInit = useSelector(selectConnectedInitState);\r\n  const serviceChangeState = useSelector(selectServiceChangeState);\r\n  const editCreatableService = useSelector(selectEditCreatableService);\r\n  const { newDate, getOffsetDate } = useSystemDate();\r\n  // const readonly = !isAdmin;\r\n  const [submitting, setSubmitting] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n  const fundingTypeVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      globalSettings.fundingTypeBudgetEnabled\r\n    );\r\n  }, [globalSettings]);\r\n  const resetSubmitting = () => {\r\n    setSubmitting(true);\r\n  };\r\n  const handleSubmit = (\r\n    values: ReportConsumablesState,\r\n    factor?: number,\r\n    remarks?: string,\r\n  ) => {\r\n    if (onSubmit !== undefined && onSubmit !== null) {\r\n      onSubmit(values, factor, remarks);\r\n    }\r\n  };\r\n  const resetFieldHandler = () => {\r\n    dispatch(actions.resetConsumableValueHandler());\r\n  };\r\n  /// Local State ///\r\n  const [serviceChanged, setServiceChanged] = React.useState(false);\r\n  const [allIsValid, setAllIsValid] = React.useState<boolean>(true);\r\n  const [innerDiscountFactor, setDiscountFactor] = React.useState<\r\n    number | null\r\n  >(1);\r\n  const [innerRemarks, setRemarks] = React.useState<string | null>(null);\r\n  const [servicesSelected, setServicesSelected] = useAsyncExtendedState<\r\n    IOtherServices[]\r\n  >(initialValues.Services ?? []);\r\n\r\n  const validateForms = React.useCallback((isValid: boolean) => {\r\n    setAllIsValid(isValid);\r\n  }, []);\r\n\r\n  /// useEffects\r\n  React.useEffect(() => {\r\n    if (innerFormRef.current) {\r\n      innerFormRef.current.validateForm();\r\n    }\r\n  }, [innerFormRef]);\r\n  React.useEffect(() => {\r\n    if (!!serviceChangeState) {\r\n      console.log('service settings: ', serviceSettings);\r\n      if (!!serviceChangeState) {\r\n        if (serviceSettings.budgetVisible) {\r\n          dispatch(\r\n            connectedFiltersActions.setConnectedValue({\r\n              fieldKey: 'Budget',\r\n              fieldValue: serviceChangeState.DefaultBudget,\r\n            }),\r\n          );\r\n          if (\r\n            fundingTypeVisible &&\r\n            serviceChangeState.DefaultBudget?.FundingTypeId !== undefined &&\r\n            serviceChangeState.DefaultBudget?.FundingTypeId !== null\r\n          ) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'FundingType',\r\n                fieldValue: serviceChangeState.DefaultBudget.FundingTypeId,\r\n              }),\r\n            );\r\n          }\r\n          if (serviceSettings.ReservationUserGroupGroupByBudgetUserGroup) {\r\n            if (serviceChangeState.DefaultBudget !== null) {\r\n              dispatch(\r\n                connectedFiltersActions.setConnectedValue({\r\n                  fieldKey: 'UserGroup',\r\n                  fieldValue: {\r\n                    Id: serviceChangeState.DefaultBudget.UserGroupId,\r\n                    Name: serviceChangeState.DefaultBudget.UserGroupName,\r\n                  },\r\n                }),\r\n              );\r\n            }\r\n          } else {\r\n            if (\r\n              connectedData?.UserGroup === null ||\r\n              connectedData?.UserGroup === undefined\r\n            ) {\r\n              dispatch(\r\n                connectedFiltersActions.setConnectedValue({\r\n                  fieldKey: 'UserGroup',\r\n                  fieldValue: {\r\n                    Id:\r\n                      (connectedData?.User as IUserFilterDto).UserGroupId ??\r\n                      user?.ActiveUserGroup?.Id,\r\n                    Name:\r\n                      (connectedData?.User as IUserFilterDto).UserGroupName ??\r\n                      user?.ActiveUserGroup?.Name,\r\n                  },\r\n                }),\r\n              );\r\n            }\r\n          }\r\n          if (\r\n            serviceSettings.budgetExpirementVisible &&\r\n            serviceChangeState.DefaultExperiment !== null\r\n          ) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'BudgetExperiment',\r\n                fieldValue: serviceChangeState.DefaultExperiment,\r\n              }),\r\n            );\r\n          }\r\n        } else {\r\n          if (serviceSettings.isUserGroupCoordinator) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'UserGroup',\r\n                fieldValue: {\r\n                  Id: user?.ActiveUserGroup?.Id,\r\n                  Name: user?.ActiveUserGroup?.Name,\r\n                },\r\n              }),\r\n            );\r\n          } else if (\r\n            connectedData?.UserGroup === null ||\r\n            connectedData?.UserGroup === undefined\r\n          ) {\r\n            dispatch(\r\n              connectedFiltersActions.setConnectedValue({\r\n                fieldKey: 'UserGroup',\r\n                fieldValue: {\r\n                  Id:\r\n                    (connectedData?.User as IUserFilterDto).UserGroupId ??\r\n                    user?.ActiveUserGroup?.Id,\r\n                  Name:\r\n                    (connectedData?.User as IUserFilterDto).UserGroupName ??\r\n                    user?.ActiveUserGroup?.Name,\r\n                },\r\n              }),\r\n            );\r\n          }\r\n        }\r\n      }\r\n      dispatch(actions.resetServiceChangeState());\r\n    }\r\n  }, [\r\n    actions,\r\n    connectedData?.User,\r\n    connectedData?.UserGroup,\r\n    connectedFiltersActions,\r\n    dispatch,\r\n    fundingTypeVisible,\r\n    serviceChangeState,\r\n    serviceSettings,\r\n    user?.ActiveUserGroup?.Id,\r\n    user?.ActiveUserGroup?.Name,\r\n  ]);\r\n  React.useEffect(() => {\r\n    dispatch(\r\n      actions.setConsumableValue({\r\n        fieldKey: 'Services',\r\n        fieldValue: servicesSelected,\r\n      }),\r\n    );\r\n    dispatch(actions.extendConsumablesData(servicesSelected));\r\n  }, [actions, dispatch, servicesSelected]);\r\n\r\n  const otherServicesSchema = Yup.array().of(\r\n    Yup.mixed() as Yup.SchemaOf<IOtherServices>,\r\n  );\r\n  const reportConsumableSchema: Yup.SchemaOf<ReportConsumablesState> = Yup.object(\r\n    {\r\n      Services: otherServicesSchema\r\n        .min(1)\r\n        .label(t(translations.Consumables) as string)\r\n        .required(t(translations.err_OfflineServiceTypeRequired) as string),\r\n      DiscountFactor: Yup.number()\r\n        .nullable()\r\n        .label(t(translations.DiscountFactor) as string)\r\n        .max(9999)\r\n        .min(0.01),\r\n      Remarks: Yup.string()\r\n        .nullable()\r\n        .label(t(translations.Remarks) as string),\r\n    },\r\n  );\r\n  const changeOfflineServices = React.useCallback(\r\n    (services: IOtherServices[], operation: 'add' | 'remove' | 'update') => {\r\n      if (operation === 'add') {\r\n        let addedServ = services.filter(\r\n          f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n        );\r\n        setServicesSelected([...servicesSelected, ...addedServ]);\r\n        setServiceChanged(true);\r\n      }\r\n      if (operation === 'remove') {\r\n        let otherServices = servicesSelected.filter(f => {\r\n          return !services.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n        });\r\n        setServicesSelected(otherServices);\r\n        setServiceChanged(true);\r\n      }\r\n      if (operation === 'update') {\r\n        setServicesSelected(\r\n          servicesSelected.map(f => {\r\n            let service = services.find(\r\n              s => s.ServiceTypeID === f.ServiceTypeID,\r\n            );\r\n            if (!!service && service !== null) {\r\n              return Object.assign({}, f, service);\r\n            } else {\r\n              return f;\r\n            }\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [servicesSelected, setServicesSelected],\r\n  );\r\n  const initServices = async (): Promise<IOtherServices[]> => {\r\n    return new Promise(async resolve => {\r\n      resolve(servicesSelected);\r\n    });\r\n  };\r\n  const sortFunc = (a: IInventoryBatchDto, b: IInventoryBatchDto) => {\r\n    return b.Id - a.Id;\r\n  };\r\n  const prepareService = (\r\n    serviceType: IOfflineServiceFilterDto,\r\n    otherData?: IConnectedFiltersDto,\r\n    discountFactor?: number,\r\n    remarks?: string,\r\n  ) => {\r\n    let batch = serviceType.InventoryBatchesEnabled\r\n      ? !!serviceType.InventoryBatches &&\r\n        serviceType.InventoryBatches.length > 0\r\n        ? serviceType.InventoryBatches.filter(\r\n            f =>\r\n              (f.ExpirationDate === null ||\r\n                getOffsetDate(f.ExpirationDate) > newDate()) &&\r\n              (serviceType.NotLessThanZero ? f.Inventory > 0 : true) &&\r\n              f.StokRenewed,\r\n          ).sort(sortFunc)[0]\r\n        : null\r\n      : null;\r\n    let data = {\r\n      Id: 0,\r\n      BookedBy: otherData?.User?.Id,\r\n      UserDisplayName: otherData?.User?.Name,\r\n      BudgetID: otherData?.Budget?.Id,\r\n      Budget: otherData?.Budget?.Name,\r\n      BudgetExperimentId: otherData?.BudgetExperiment?.Id,\r\n      BudgetExperimentName: otherData?.BudgetExperiment?.Name,\r\n      Quantity: serviceType.DefaultQuantity,\r\n      DefaultQuantity: serviceType.DefaultQuantity,\r\n      ExternalCustomerId: otherData?.ExternalCustomer?.Id,\r\n      ExternalCustomerName: otherData?.ExternalCustomer?.Name,\r\n      FundingType: otherData?.FundingType?.Id,\r\n      IntQuantityOnly: serviceType.IntQuantityOnly,\r\n      DiscountFactor: Number(discountFactor),\r\n      InstituteProjectId: otherData?.InstituteProject?.Id,\r\n      InstituteProjectName: otherData?.InstituteProject?.Name,\r\n      PurchaseOrder: otherData?.PurchaseOrder,\r\n      Reference: otherData?.Reference,\r\n      Mandatory: false,\r\n      Remarks: remarks ?? null,\r\n      ReservationId: null,\r\n      ServiceDate: dateUtils.formatISO(\r\n        dateUtils.dateOrStringToDate(otherData?.StartTime ?? newDate()),\r\n      ),\r\n      ServiceTypeID: serviceType.Id,\r\n      ServiceType: serviceType.Name,\r\n      ServiceGroupId: serviceType.ServiceGroupId,\r\n      Units: serviceType.UnitTypeName,\r\n      UserGroup: otherData?.UserGroup?.Id,\r\n      UserGroupName: otherData?.UserGroup?.Name,\r\n      AllowToUser: serviceType.AllowToUser,\r\n      BudgetsTurnedOn: serviceType.BudgetsTurnedOn,\r\n      StaffOnly: serviceType.StaffOnly,\r\n      HideProjects: serviceType.HideProjects,\r\n      InventoryBatchesEnabled: serviceType.InventoryBatchesEnabled,\r\n      InventoryBatchId: batch === null ? null : batch.Id,\r\n      InventoryBatchName: batch === null ? null : batch.Name,\r\n      InventoryBatchAmount: batch === null ? null : batch.Inventory,\r\n    } as IOtherServices;\r\n    return data;\r\n  };\r\n  const createService = async (\r\n    serviceType: IOfflineServiceFilterDto,\r\n    discountFactor?: number,\r\n    remarks?: string,\r\n  ): Promise<IOtherServices | undefined> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticService = prepareService(\r\n        serviceType,\r\n        connectedData,\r\n        discountFactor,\r\n        remarks,\r\n      );\r\n      changeOfflineServices([staticService], 'add');\r\n      resolve(staticService);\r\n    });\r\n  };\r\n  const createServices = async (\r\n    serviceTypes: IOfflineServiceFilterDto[],\r\n    discountFactor?: number,\r\n    remarks?: string,\r\n  ): Promise<IOtherServices[]> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticServices = serviceTypes.map(f =>\r\n        prepareService(f, connectedData, discountFactor, remarks),\r\n      );\r\n      changeOfflineServices(staticServices, 'add');\r\n      resolve(staticServices);\r\n    });\r\n  };\r\n  const onRemoveService = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices([service], 'remove');\r\n      resolve(service);\r\n    });\r\n  };\r\n  const onRemoveServices = async (services: IOtherServices[]) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices(services, 'remove');\r\n      resolve(services);\r\n    });\r\n  };\r\n  const onUpdateService = async (service: IOtherServices) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      changeOfflineServices([service], 'update');\r\n      resolve(service);\r\n    });\r\n  };\r\n  const onAddAndRemoveServices = async (\r\n    serviceTypes: IOfflineServiceFilterDto[],\r\n    removed: IOtherServices[],\r\n    discountFactor?: number,\r\n    remarks?: string,\r\n  ): Promise<IOtherServices[]> => {\r\n    return new Promise(async (resolve, reject) => {\r\n      let staticServices = serviceTypes.map(f =>\r\n        prepareService(f, connectedData, discountFactor, remarks),\r\n      );\r\n      let addedServ = staticServices.filter(\r\n        f => !servicesSelected.some(s => s.ServiceTypeID === f.ServiceTypeID),\r\n      );\r\n      let otherServices = servicesSelected.filter(f => {\r\n        return !removed.some(a => a.ServiceTypeID === f.ServiceTypeID);\r\n      });\r\n      setServicesSelected([...otherServices, ...addedServ]);\r\n      setServiceChanged(true);\r\n      resolve([...otherServices, ...addedServ]);\r\n    });\r\n  };\r\n  React.useEffect(() => {\r\n    let active =\r\n      editCreatableService !== undefined &&\r\n      servicesSelected.some(\r\n        f => f.ServiceTypeID === editCreatableService.ServiceTypeID,\r\n      );\r\n    if (active && editCreatableService !== undefined) {\r\n      changeOfflineServices([editCreatableService], 'update');\r\n      dispatch(actions.setEditCreatableService(undefined));\r\n      dispatch(actions.setRefreshConsumableOfflineServices(true));\r\n      setServiceChanged(true);\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    changeOfflineServices,\r\n    dispatch,\r\n    editCreatableService,\r\n    servicesSelected,\r\n  ]);\r\n  const handleFormChange = React.useCallback(\r\n    (\r\n      values: ReportConsumablesState,\r\n      isValid,\r\n      dirty,\r\n      setValue,\r\n      setTouched,\r\n      validateField,\r\n      setError,\r\n      validate,\r\n    ) => {\r\n      if (serviceChanged) {\r\n        dispatch(\r\n          connectedFiltersActions.extendSettingsState({\r\n            services:\r\n              values.Services.length < 1\r\n                ? []\r\n                : values.Services.map(f => {\r\n                    return {\r\n                      Id: f.ServiceTypeId,\r\n                      Name: f.ServiceTypeName,\r\n                      ServiceGroupId: f.ServiceGroupId,\r\n                      ServiceTypeId: ServiceType.Offline,\r\n                      Active: true,\r\n                      BudgetsTurnedOn: f.BudgetsTurnedOn,\r\n                      HideProject: f.HideProjects,\r\n                    } as IServiceTypeFilterDto;\r\n                  }),\r\n            globalSettings: globalSettings,\r\n            settings: serviceSettings,\r\n            isEdit: false,\r\n            data: connectedData,\r\n          }),\r\n        );\r\n        if (values.Services.length > 0 && connectedData?.User !== null) {\r\n          const parameters = {\r\n            ServiceTypes: values.Services.map(f => f.ServiceTypeID),\r\n            ReservationId: null,\r\n            UsageId: null,\r\n            BookedBy: connectedData?.User?.Id || null,\r\n            ADGroup: connectedData?.UserGroup?.Id || null,\r\n            Start: dateUtils.formatISO(\r\n              dateUtils.dateOrStringToDate(\r\n                connectedData?.StartTime || newDate(),\r\n              ),\r\n            ),\r\n            BudgetId: connectedData?.Budget?.Id || null,\r\n            FundingTypeId: connectedData?.FundingType?.Id || 0,\r\n          } as ServiceChangeStateParameters;\r\n          dispatch(actions.initServiceChangeStateData(parameters));\r\n          // if (!!connectedData) {\r\n          //   dispatch(connectedFiltersActions.saveState(connectedData));\r\n          // }\r\n        }\r\n        //setServiceTypesSelected(values.Services);\r\n        setServiceChanged(false);\r\n      }\r\n      // if (factorChanged) {\r\n      //   if (Number(values.DiscountFactor) > 0) {\r\n      //     changeOfflineServices(\r\n      //       servicesSelected.map(f => {\r\n      //         return Object.assign({}, f, {\r\n      //           DiscountFactor: Number(values.DiscountFactor),\r\n      //         });\r\n      //       }),\r\n      //       'update',\r\n      //     );\r\n      //   }\r\n      //   setFactorChanged(false);\r\n      // }\r\n    },\r\n    [\r\n      serviceChanged,\r\n      dispatch,\r\n      connectedFiltersActions,\r\n      globalSettings,\r\n      serviceSettings,\r\n      connectedData,\r\n      newDate,\r\n      actions,\r\n    ],\r\n  );\r\n  return (\r\n    <>\r\n      <Formik\r\n        validationSchema={reportConsumableSchema}\r\n        initialValues={initialValues}\r\n        validateOnMount={true}\r\n        validateOnBlur={true}\r\n        validateOnChange={true}\r\n        enableReinitialize={true}\r\n        innerRef={innerFormRef}\r\n        onSubmit={async (values, formikHelpers) => {\r\n          // call setSubmit to finish submit cycle\r\n          if (allIsValid) {\r\n            formikHelpers.validateForm(values).then(responseErrors => {\r\n              if (!isEmpty(responseErrors)) {\r\n                formikHelpers.setSubmitting(false);\r\n                console.debug('errors', responseErrors);\r\n              } else if (values.Services.length < 1) {\r\n                formikHelpers.setErrors({\r\n                  Services: t(\r\n                    translations.err_OfflineServiceTypeRequired,\r\n                  ) as string,\r\n                });\r\n                formikHelpers.setSubmitting(false);\r\n              } else if (offlineServicesErrors.length > 0) {\r\n                formikHelpers.setSubmitting(false);\r\n                dispatch(\r\n                  appActions.addNotification({\r\n                    variant: 'error',\r\n                    message: '',\r\n                    messageType: SnackBarMessageType.messageList,\r\n                    messageTypeProps: {\r\n                      messages: offlineServicesErrors.map(f => {\r\n                        return {\r\n                          Id: f.id.toString(),\r\n                          message: f.error,\r\n                        } as SingleMessagesProps;\r\n                      }),\r\n                    } as ListMessagesProps,\r\n                  }),\r\n                );\r\n              } else {\r\n                console.debug('submitting', values);\r\n                formikHelpers.setSubmitting(true);\r\n                handleSubmit(\r\n                  values,\r\n                  innerDiscountFactor ?? undefined,\r\n                  innerRemarks ?? undefined,\r\n                );\r\n              }\r\n            });\r\n          } else {\r\n            formikHelpers.setSubmitting(false);\r\n          }\r\n        }}\r\n      >\r\n        {formik => {\r\n          bindSubmitForm(formik.submitForm);\r\n          if (formik.errors) {\r\n            console.log('Consumables errors', formik.errors);\r\n          }\r\n          console.log('Consumables submitting', formik.isSubmitting);\r\n          return (\r\n            <React.Fragment>\r\n              <StyledForm onSubmit={formik.handleSubmit}>\r\n                <FormListener\r\n                  onFormChange={handleFormChange}\r\n                  fields={['Services']}\r\n                />\r\n                <FieldHandler\r\n                  {...fieldHandler}\r\n                  resetFieldState={resetFieldHandler}\r\n                />\r\n                <SubmittingHandler\r\n                  value={hasError === true && submitting === undefined}\r\n                  resetSubmitting={resetSubmitting}\r\n                />\r\n                <FormLeftSection\r\n                // warningNodes={warningMessages}\r\n                // infoNodes={infoMessages}\r\n                // errors={errorMessages}\r\n                // successNodes={successMessages}\r\n                >\r\n                  <ErrorsSummury errors={formik.errors} />\r\n                  <FormFieldsSection\r\n                    titleSection={t(translations.ReportedConsumables) as string}\r\n                  >\r\n                    <BookQuickServices\r\n                      createServiceFromServiceType={st =>\r\n                        createService(\r\n                          st,\r\n                          innerDiscountFactor ?? undefined,\r\n                          innerRemarks ?? undefined,\r\n                        )\r\n                      }\r\n                      createServicesFromServiceType={st =>\r\n                        createServices(\r\n                          st,\r\n                          innerDiscountFactor ?? undefined,\r\n                          innerRemarks ?? undefined,\r\n                        )\r\n                      }\r\n                      onAddAndRemoveServices={(st, removed) =>\r\n                        onAddAndRemoveServices(\r\n                          st,\r\n                          removed,\r\n                          innerDiscountFactor ?? undefined,\r\n                          innerRemarks ?? undefined,\r\n                        )\r\n                      }\r\n                      initServicesFunc={initServices}\r\n                      onServiceRemove={onRemoveService}\r\n                      onServicesRemove={onRemoveServices}\r\n                      onServiceUpdate={onUpdateService}\r\n                      onServiceClick={service =>\r\n                        onOfflineServiceClick?.(\r\n                          service,\r\n                          innerDiscountFactor ?? undefined,\r\n                          innerRemarks ?? undefined,\r\n                        )\r\n                      }\r\n                      isEditMode={false}\r\n                      disabled={false}\r\n                      useAssetSelection={true}\r\n                      onAddClick={onAddServiceClick}\r\n                      userName={connectedData?.User?.Id}\r\n                      createdEditable={editCreatable}\r\n                      onAddBatchClick={onAddBatchClick}\r\n                      onRenewStockClick={onRenewStockClick}\r\n                      setError={setError}\r\n                    />\r\n                  </FormFieldsSection>\r\n                  <FormFieldsSection\r\n                    titleSection={\r\n                      t(translations.ReportConsumablesMainInfo) as string\r\n                    }\r\n                  >\r\n                    <ConnectedFiltersControl\r\n                      initialState={connectedInit}\r\n                      submitFormRef={connectedFiltersFormRef}\r\n                      isEdit={false}\r\n                      serviceTypeEnum={ServiceType.Offline}\r\n                      serviceTypes={\r\n                        formik.values.Services.length < 1\r\n                          ? []\r\n                          : formik.values.Services.map(s => {\r\n                              return {\r\n                                Id: s.ServiceTypeID,\r\n                                Name: s.ServiceType,\r\n                                Active: true,\r\n                                BudgetsTurnedOn: s.BudgetsTurnedOn,\r\n                                HideProject: s.HideProjects,\r\n                                ServiceGroupId: s.ServiceGroupId,\r\n                                ServiceTypeId: ServiceType.Offline,\r\n                              } as IServiceTypeFilterDto;\r\n                            })\r\n                      }\r\n                      globalSettings={globalSettings}\r\n                      formIsValid={validateForms}\r\n                      startTimeLabel={\r\n                        t(translations.LogDateTimeLabel) as string\r\n                      }\r\n                      startLabelInline={true}\r\n                      //orderForConsumables={true}\r\n                      //forceDisabled={servicesSelected.length > 1}\r\n                      budgetPickerInfo={\r\n                        t(translations.ConsumableProject_info) as string\r\n                      }\r\n                    />\r\n                    {formik.values.Services.length > 0 &&\r\n                      isAdmin &&\r\n                      !globalSettings.priceSheetPricing &&\r\n                      globalSettings.billingModuleEnabled && (\r\n                        <FormRow fullRow>\r\n                          <BaseTextField\r\n                            id=\"DiscountFactorID\"\r\n                            name=\"DiscountFactorInn\"\r\n                            variant=\"filled\"\r\n                            fullWidth\r\n                            inputProps={{\r\n                              step: 0.01,\r\n                              min: 0.01,\r\n                              max: 9999,\r\n                              'aria-label': 'Factor',\r\n                              type: 'number',\r\n                            }}\r\n                            value={String(innerDiscountFactor)}\r\n                            onChange={e => {\r\n                              setDiscountFactor(Number(e.target.value));\r\n                              if (Number(e.target.value) > 0) {\r\n                                changeOfflineServices(\r\n                                  servicesSelected.map(f => {\r\n                                    return Object.assign({}, f, {\r\n                                      DiscountFactor: Number(e.target.value),\r\n                                    });\r\n                                  }),\r\n                                  'update',\r\n                                );\r\n                              }\r\n                            }}\r\n                            inputMode=\"decimal\"\r\n                            label={t(translations.DiscountFactor)}\r\n                            placeholder={t(translations.DiscountFactor)}\r\n                            disabled={formik.isSubmitting}\r\n                          />\r\n                        </FormRow>\r\n                      )}\r\n                    <FormRow fullRow={true}>\r\n                      <FormRichTextField\r\n                        name=\"RemarksInn\"\r\n                        id=\"remarksId\"\r\n                        placeholder={t(translations.Remarks)}\r\n                        value={innerRemarks ?? undefined}\r\n                        onChange={val => setRemarks(String(val))}\r\n                        disabled={formik.isSubmitting}\r\n                        fullWidth={true}\r\n                      />\r\n                    </FormRow>\r\n                  </FormFieldsSection>\r\n                </FormLeftSection>\r\n              </StyledForm>\r\n            </React.Fragment>\r\n          );\r\n        }}\r\n      </Formik>\r\n    </>\r\n  );\r\n});\r\n","import { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useConnectedFiltersSlice } from 'app/components/Forms/FormConnectedFilters/slice';\r\nimport {\r\n  CoverProps,\r\n  PageWrapper,\r\n} from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IOtherServices } from 'app/pages/OtherServicesPage/IOtherServices';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { selectAuthenticatedUser, selectPublicUrl } from 'app/slice/selectors';\r\nimport { push } from 'connected-react-router';\r\nimport { FormikProps } from 'formik';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Beforeunload } from 'react-beforeunload';\r\nimport { useOfflineServiceStateSlice } from '../Details/slice';\r\nimport {\r\n  selectConsumablesCompleted,\r\n  selectConsumablesData,\r\n  selectConsumablesHasErrors,\r\n  selectCredit,\r\n  selectCreditCompleted,\r\n  selectCreditProcessing,\r\n  selectInitConsumablesProcessing,\r\n} from '../Details/slice/selectors';\r\nimport {\r\n  ErrorServices,\r\n  OfflineServiceQueryStringParameters,\r\n  ReportConsumablesState,\r\n} from '../Details/slice/types';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { ConsumablesForm } from './ConsumablesForm';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Progress } from 'app/components/LoadingIndicator';\r\nimport { buildURL, toQueryString } from 'utils/url-utils';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { Roles, ScanTarget } from 'app/slice/types';\r\nimport {\r\n  selectConnectedFiltersData,\r\n  selectConnectedSettings,\r\n} from 'app/components/Forms/FormConnectedFilters/slice/selectors';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IMyAssetsRow } from 'app/pages/MyAssetsPage/IMyAssetsRow';\r\nimport { IBudgetFilterDto } from 'api/odata/generated/entities/IBudgetFilterDto';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { Body, ButtonLabel } from 'app/components/Typography';\r\nimport { LinearProgress } from '@material-ui/core';\r\nimport useSidePanelState, {\r\n  SidePanelCloseState,\r\n  SidePanelOpenState,\r\n} from 'app/hooks/useSidePanelOpen';\r\nimport { IInventoryBatchDto } from 'api/odata/generated/entities/IInventoryBatchDto';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\n\r\nexport interface ReportConsumablesProps\r\n  extends CoverProps,\r\n    SidePanelContentProps {\r\n  queryParams: OfflineServiceQueryStringParameters;\r\n  initialServices: IOtherServices[];\r\n  onClose?: () => void;\r\n}\r\nexport const ReportConsumables = React.memo(function ReportConsumables(\r\n  props: ReportConsumablesProps,\r\n) {\r\n  const {\r\n    useSidePanel,\r\n    queryParams,\r\n    initialServices,\r\n    closeCover,\r\n    isCover,\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOfflineServiceStateSlice();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const { actions: connectedFiltersActions } = useConnectedFiltersSlice();\r\n  const { actions: appSettingsActions } = useAppSettingsSlice();\r\n  const processing = useSelector(selectInitConsumablesProcessing);\r\n  // const consumablesProcessing = useSelector(selectConsumablesProcessing);\r\n  const actionCompleted = useSelector(selectConsumablesCompleted);\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const hasChanges = useSelector(selectHasNotSavedChanges);\r\n  const hasError = useSelector(selectConsumablesHasErrors);\r\n  const consumableServicesData = useSelector(selectConsumablesData);\r\n  const connectedData = useSelector(selectConnectedFiltersData);\r\n  const publicUrl = useSelector(selectPublicUrl);\r\n  const serviceSettings = useSelector(selectConnectedSettings);\r\n  const credit = useSelector(selectCredit);\r\n  const creditProccessing = useSelector(selectCreditProcessing);\r\n  const creditCompleted = useSelector(selectCreditCompleted);\r\n  //   const { checkIsMobile } = useIsMobile();\r\n  //   const mobile = checkIsMobile();\r\n  const globalSettings = useGlobalSettingsHook();\r\n  //Local State\r\n  const {\r\n    cover,\r\n    openPanel,\r\n    closePanel,\r\n    coverClosed,\r\n    onCloseCover,\r\n  } = useSidePanelState(\r\n    () => {\r\n      dispatch(actions.resetConsumablesState());\r\n      dispatch(connectedFiltersActions.resetConnectedState());\r\n      return true;\r\n    },\r\n    undefined,\r\n    useSidePanel,\r\n    isCover,\r\n  );\r\n  const [busy, setBusy] = React.useState<boolean | undefined>(false);\r\n  const [firstLoad, setFirstLoad] = React.useState<boolean | undefined>(true);\r\n  const [showCalculateCredit, setShowCalculateCredit] = React.useState(false);\r\n  const [requestCompleted, setRequestCompleted] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n\r\n  //Refs\r\n  const submitFormRef = React.useRef<any>(null);\r\n  const connectedFiltersFormRef = React.useRef<any>(null);\r\n  const innerFormRef = React.useRef<FormikProps<ReportConsumablesState>>(null);\r\n\r\n  const isReadOnlyUser = React.useMemo(() => {\r\n    return (\r\n      User !== undefined &&\r\n      (User.Roles.includes(Roles.CalendarOnly) ||\r\n        User.Roles.includes(Roles.Readonly) ||\r\n        User.Roles.includes(Roles.RoomOnly))\r\n    );\r\n  }, [User]);\r\n\r\n  //Methods\r\n  const handleCloselClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      closePanel({\r\n        isCover: isCover,\r\n        useSidePanel: useSidePanel,\r\n        showConfirm: hasChanges,\r\n        onClose: () => {\r\n          dispatch(actions.resetConsumablesState());\r\n          dispatch(connectedFiltersActions.resetConnectedState());\r\n        },\r\n      } as SidePanelCloseState);\r\n    } else {\r\n      dispatch(push('/otherServices'));\r\n    }\r\n  }, [\r\n    actions,\r\n    closePanel,\r\n    connectedFiltersActions,\r\n    dispatch,\r\n    hasChanges,\r\n    isCover,\r\n    useSidePanel,\r\n  ]);\r\n  const handleSaveClick = React.useCallback((e: any) => {\r\n    handleSubmitForm(e);\r\n  }, []);\r\n\r\n  const handleSubmitForm = (e: any) => {\r\n    if (connectedFiltersFormRef.current) {\r\n      connectedFiltersFormRef.current(e);\r\n    }\r\n    if (submitFormRef.current) {\r\n      submitFormRef.current(e);\r\n    }\r\n  };\r\n  const bindSubmitForm = React.useCallback(submitForm => {\r\n    submitFormRef.current = submitForm;\r\n  }, []);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    (values: ReportConsumablesState, factor?: number, remarks?: string) => {\r\n      setBusy(true);\r\n      dispatch(\r\n        actions.createConsumables({\r\n          Services: values.Services,\r\n          DiscountFactor: factor,\r\n          Remarks: remarks,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const handleCalculateCredit = React.useCallback(() => {\r\n    if (!!innerFormRef?.current?.values?.Services) {\r\n      setShowCalculateCredit(true);\r\n      dispatch(actions.getTotalCredit(innerFormRef?.current?.values.Services));\r\n    }\r\n  }, [actions, dispatch]);\r\n  const handleCalculateClose = React.useCallback(() => {\r\n    setShowCalculateCredit(false);\r\n    dispatch(actions.resetTotalCreditState());\r\n  }, [actions, dispatch]);\r\n  //effects\r\n  useEffectOnMount(() => {\r\n    dispatch(\r\n      appSettingsActions.setBarcodeScannigTarget(ScanTarget.Consumables),\r\n    );\r\n    return () => {\r\n      dispatch(appSettingsActions.setBarcodeScannigTarget(ScanTarget.All));\r\n    };\r\n  });\r\n  React.useEffect(() => {\r\n    let active = firstLoad;\r\n    if (globalSettings.loadCompleted && active) {\r\n      setFirstLoad(false);\r\n      dispatch(\r\n        actions.initConsumables({\r\n          query: queryParams,\r\n          globalSettings: globalSettings,\r\n          services: initialServices,\r\n        }),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    firstLoad,\r\n    globalSettings,\r\n    initialServices,\r\n    queryParams,\r\n  ]);\r\n  React.useEffect(() => {\r\n    let active = processing === false;\r\n    if (active) {\r\n      if (actionCompleted === true) {\r\n        setRequestCompleted(true);\r\n        setBusy(false);\r\n        if (!hasError) {\r\n          dispatch(layoutActions.setNotSavedChanges(false));\r\n          handleCloselClick();\r\n        }\r\n      } else if (actionCompleted === false) {\r\n        setRequestCompleted(undefined);\r\n        setBusy(false);\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    actionCompleted,\r\n    dispatch,\r\n    handleCloselClick,\r\n    hasError,\r\n    layoutActions,\r\n    processing,\r\n    queryParams.id,\r\n  ]);\r\n  const assetsFilter = React.useMemo(() => {\r\n    let filter: (string | Condition<IMyAssetsRow>)[] | undefined = [];\r\n    if (globalSettings.budgetModuleEnabled && serviceSettings.budgetVisible) {\r\n      if (\r\n        connectedData?.Budget === null ||\r\n        connectedData?.Budget === undefined\r\n      ) {\r\n        filter.push(\r\n          new Condition<IMyAssetsRow>(\r\n            'HideProjects',\r\n            ODataOperators.Equals,\r\n            serviceSettings.hideProject ?? false,\r\n          ),\r\n        );\r\n      } else {\r\n        let budget = connectedData?.Budget as IBudgetFilterDto;\r\n        let byService = '';\r\n        let byGroup = '';\r\n        if (!budget.ServiceGroupServicesAllowed) {\r\n          if (!!budget.AllowedServices && budget.AllowedServices.length > 0) {\r\n            byService = `(${new Condition<IMyAssetsRow>(\r\n              'ServiceId',\r\n              ODataOperators.Includes,\r\n              budget.AllowedServices.map(f => f.Id),\r\n            ).toString()} and ServiceTypeId eq 2)`;\r\n          }\r\n          if (!!budget.ServiceGroupIds && budget.ServiceGroupIds.length > 0) {\r\n            byGroup = `(${new Condition<IMyAssetsRow>(\r\n              'ServiceGroupId',\r\n              ODataOperators.Includes,\r\n              budget.ServiceGroupIds,\r\n            ).toString()})`;\r\n          }\r\n          let res = `(${[byService, byGroup]\r\n            .filter(f => f !== '')\r\n            .join(' or ')})`;\r\n          if (res !== '()') {\r\n            filter.push(res);\r\n          }\r\n        } else {\r\n          filter.push('ServiceTypeId eq 2');\r\n        }\r\n      }\r\n    }\r\n    return filter.length > 0 ? filter : undefined;\r\n  }, [\r\n    connectedData?.Budget,\r\n    globalSettings.budgetModuleEnabled,\r\n    serviceSettings.budgetVisible,\r\n    serviceSettings.hideProject,\r\n  ]);\r\n\r\n  const onRenewStockClick = React.useCallback(\r\n    (service: IOtherServices) => {\r\n      let renewProps = {\r\n        saveCreatable: true,\r\n        preventRefreshTable: true,\r\n        initialService: undefined,\r\n        queryParams: {\r\n          id: '-1',\r\n          stid: '' + service.ServiceTypeID,\r\n          batchId:\r\n            !!service.InventoryBatchId && service.InventoryBatchId !== null\r\n              ? '' + service.InventoryBatchId\r\n              : undefined,\r\n        },\r\n      };\r\n      if (!useSidePanel) {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n      }\r\n      openPanel({\r\n        renderPageType: RenderPageType.RenewStock,\r\n        renderPageProps: renewProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [dispatch, layoutActions, openPanel, useSidePanel],\r\n  );\r\n  const onAddBatchClick = React.useCallback(\r\n    (batch: IInventoryBatchDto | null, serviceType: number) => {\r\n      let batchProps = {\r\n        initialBatch: batch ?? undefined,\r\n        preventRefreshTable: true,\r\n        queryParams: {\r\n          id: '' + (batch?.Id ?? -1),\r\n          stid: '' + serviceType,\r\n        },\r\n        saveCreatable: true,\r\n      };\r\n      if (!useSidePanel) {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n      }\r\n      openPanel({\r\n        renderPageType: RenderPageType.InventoryBatch,\r\n        renderPageProps: batchProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [dispatch, layoutActions, openPanel, useSidePanel],\r\n  );\r\n  const onOfflineServiceClick = React.useCallback(\r\n    (service: IOtherServices, discountFactor?: number, remarks?: string) => {\r\n      let updatedRemarks = isEmptyOrWhitespace(service.Remarks)\r\n        ? remarks ?? null\r\n        : service.Remarks;\r\n      let factor =\r\n        Number(service.DiscountFactor) !== Number(discountFactor)\r\n          ? Number(discountFactor)\r\n          : Number(service.DiscountFactor);\r\n      let otherProps = {\r\n        initialService: Object.assign({}, service, {\r\n          UserGroup: connectedData?.UserGroup?.Id ?? null,\r\n          UserGroupName: connectedData?.UserGroup?.Name ?? null,\r\n          Budget: connectedData?.Budget?.Name ?? null,\r\n          BudgetID: connectedData?.Budget?.Id ?? null,\r\n          UserDisplayName: connectedData?.User?.Name ?? null,\r\n          BookedBy: connectedData?.User?.Id ?? null,\r\n          Remarks: updatedRemarks,\r\n          DiscountFactor: factor,\r\n        }),\r\n        editCreatable: true,\r\n        queryParams: {\r\n          id: '' + service.Id ?? -1,\r\n        },\r\n      };\r\n      dispatch(layoutActions.setNotSavedChanges(false));\r\n      openPanel({\r\n        renderPageType: RenderPageType.OtherServiceDetails,\r\n        renderPageProps: otherProps,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [\r\n      connectedData?.Budget?.Id,\r\n      connectedData?.Budget?.Name,\r\n      connectedData?.User?.Id,\r\n      connectedData?.User?.Name,\r\n      connectedData?.UserGroup?.Id,\r\n      connectedData?.UserGroup?.Name,\r\n      dispatch,\r\n      layoutActions,\r\n      openPanel,\r\n      useSidePanel,\r\n    ],\r\n  );\r\n  const onAddServiceClick = React.useCallback(\r\n    (services: number[]) => {\r\n      let selParams = {\r\n        actionType: 'OfflineService',\r\n        offTypeIds: services,\r\n        customPredicates: assetsFilter,\r\n      } as AssetsSelectionProps;\r\n      if (!useSidePanel) {\r\n        dispatch(layoutActions.setNotSavedChanges(false));\r\n      }\r\n      openPanel({\r\n        renderPageType: RenderPageType.AssetsSelection,\r\n        renderPageProps: selParams,\r\n        expanded: false,\r\n        useSidePanel: useSidePanel,\r\n        isCover: useSidePanel,\r\n      } as SidePanelOpenState);\r\n    },\r\n    [assetsFilter, dispatch, layoutActions, openPanel, useSidePanel],\r\n  );\r\n\r\n  const [offlineServicesErrors, setOfflineServicesErrors] = React.useState<\r\n    ErrorServices[]\r\n  >([]);\r\n  const handleSetError = React.useCallback(\r\n    (error: ErrorServices) => {\r\n      if (error.error !== undefined) {\r\n        setOfflineServicesErrors(prev => [...prev, error]);\r\n      } else {\r\n        setOfflineServicesErrors([\r\n          ...offlineServicesErrors.filter(f => f.id !== error.id),\r\n        ]);\r\n      }\r\n    },\r\n    [offlineServicesErrors],\r\n  );\r\n  //memo\r\n  const IsAdmin = React.useMemo(() => {\r\n    return !!consumableServicesData &&\r\n      consumableServicesData.Services.length > 0\r\n      ? User?.IsAllGroupOrLabTechAdmin(\r\n          consumableServicesData.Services.map(g => g.ServiceGroupId || 0),\r\n          consumableServicesData.Services.map(f => {\r\n            return {\r\n              Id: f.ServiceTypeId,\r\n              Name: f.ServiceTypeName,\r\n              ServiceTypeId: ServiceType.Offline,\r\n            } as IServiceTypeFilterDto;\r\n          }),\r\n        )\r\n      : false;\r\n  }, [User, consumableServicesData]);\r\n  const leftActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n    actions.push(() => (\r\n      <Button\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"save\" />}\r\n        onClick={handleSaveClick}\r\n        disabled={\r\n          busy ||\r\n          !(\r\n            !!consumableServicesData &&\r\n            consumableServicesData.Services.length > 0\r\n          )\r\n        }\r\n        processing={!requestCompleted && busy}\r\n      >\r\n        {t(translations.Save)}\r\n      </Button>\r\n    ));\r\n    if (\r\n      globalSettings.showCalcPriceOnOfflineService &&\r\n      !!consumableServicesData &&\r\n      consumableServicesData.Services.length > 0 &&\r\n      offlineServicesErrors.length < 1\r\n    ) {\r\n      actions.push(() => (\r\n        <Button\r\n          id={'CalculateTotalCreditPopupButtonId'}\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          startIcon={<Icon icon=\"money-bill\" />}\r\n          title={t(translations.CalculatePricing_info) as string}\r\n          onClick={handleCalculateCredit}\r\n          disabled={creditProccessing}\r\n          processing={creditProccessing}\r\n        >\r\n          {t(translations.CalculatePricing)}\r\n        </Button>\r\n      ));\r\n    }\r\n    return actions;\r\n  }, [\r\n    busy,\r\n    consumableServicesData,\r\n    creditProccessing,\r\n    globalSettings.showCalcPriceOnOfflineService,\r\n    handleCalculateCredit,\r\n    handleSaveClick,\r\n    offlineServicesErrors.length,\r\n    requestCompleted,\r\n    t,\r\n  ]);\r\n  const rightActions = React.useMemo(() => {\r\n    let actions: ActionRenderer[] = [];\r\n\r\n    actions.push(() => (\r\n      <Button\r\n        variant=\"ghost\"\r\n        size=\"small\"\r\n        startIcon={<Icon icon=\"times\" />}\r\n        onClick={handleCloselClick}\r\n      >\r\n        {t(translations.Close)}\r\n      </Button>\r\n    ));\r\n\r\n    return actions;\r\n  }, [handleCloselClick, t]);\r\n\r\n  return (\r\n    <React.Fragment>\r\n      <PageWrapper\r\n        pageName={t(translations.Consumables)}\r\n        titlePage={t(translations.LogConsumables)}\r\n        loading={processing}\r\n        useSidePanel={useSidePanel}\r\n        closable={useSidePanel || isCover}\r\n        disableExpandToggle={true}\r\n        closeSidePanel={handleCloselClick}\r\n        // leftTopActions={topButtons}\r\n        //rightTopActions={topButtons}\r\n        rightTopActionsAsMenu={true}\r\n        //leftTopActions={topActions}\r\n        //topProcessing={equipmentChangeCompleted === false}\r\n        leftActions={isReadOnlyUser ? [] : leftActions}\r\n        rightActions={isReadOnlyUser ? [] : rightActions}\r\n        children={\r\n          consumableServicesData !== undefined && !processing ? (\r\n            <ConsumablesForm\r\n              initialValues={consumableServicesData}\r\n              bindSubmitForm={bindSubmitForm}\r\n              onSubmit={handleSubmit}\r\n              connectedFiltersFormRef={connectedFiltersFormRef}\r\n              isAdmin={IsAdmin || false}\r\n              user={User}\r\n              globalSettings={globalSettings}\r\n              innerFormRef={innerFormRef}\r\n              editCreatable={true}\r\n              onAddBatchClick={onAddBatchClick}\r\n              onRenewStockClick={onRenewStockClick}\r\n              onOfflineServiceClick={onOfflineServiceClick}\r\n              onAddServiceClick={onAddServiceClick}\r\n              setError={handleSetError}\r\n              offlineServicesErrors={offlineServicesErrors}\r\n            />\r\n          ) : (\r\n            <React.Fragment>\r\n              {' '}\r\n              <Box component=\"div\">\r\n                <Progress inProgress={processing || false} size={80} />\r\n              </Box>\r\n            </React.Fragment>\r\n          )\r\n        }\r\n        pageLink={buildURL(publicUrl + 'reportConsumables', queryParams)}\r\n        toPageLink={`reportConsumables?${toQueryString(queryParams)}`}\r\n        isCover={isCover}\r\n        cover={cover}\r\n        coverClosed={coverClosed}\r\n        closeCover={!isCover ? onCloseCover : closeCover}\r\n        confirm={\r\n          showCalculateCredit ? (\r\n            <DialogConfirm\r\n              isOpen={showCalculateCredit}\r\n              title={t(translations.CalculatePricing)}\r\n              onConfirm={() => handleCalculateClose()}\r\n              onClose={() => handleCalculateClose()}\r\n              body={\r\n                creditProccessing && !creditCompleted ? (\r\n                  <Box width=\"100%\">\r\n                    <LinearProgress variant=\"query\" color=\"primary\" />\r\n                  </Box>\r\n                ) : (\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      flexDirection: 'column',\r\n                      paddingTop: '16px',\r\n                      gap: 32,\r\n                      width: '100%',\r\n                    }}\r\n                  >\r\n                    <Box\r\n                      style={{\r\n                        display: 'flex',\r\n                        flexDirection: 'row',\r\n                        justifyContent: 'space-between',\r\n                        gap: 16,\r\n                        width: '100%',\r\n                      }}\r\n                    >\r\n                      <ButtonLabel size=\"small\">\r\n                        {t(translations.Pricing_EstimatedCost)}\r\n                      </ButtonLabel>\r\n                      <Body size=\"small\">\r\n                        {(t(\r\n                          translations.PricingConfirmationOfflineText1,\r\n                        ) as string).replace(\r\n                          '{0}',\r\n                          (credit?.credit || 0).toFixed(2),\r\n                        )}\r\n                      </Body>\r\n                    </Box>\r\n                    {!!credit?.balance && credit?.balance !== null && (\r\n                      <Box\r\n                        style={{\r\n                          display: 'flex',\r\n                          flexDirection: 'row',\r\n                          justifyContent: 'space-between',\r\n                          gap: 16,\r\n                          width: '100%',\r\n                        }}\r\n                      >\r\n                        <ButtonLabel size=\"small\">\r\n                          {t(translations.Pricing_Balance)}\r\n                        </ButtonLabel>\r\n                        <Body size=\"small\">\r\n                          {(t(\r\n                            translations.Pricing_BalanceResult,\r\n                          ) as string).replace(\r\n                            '{0}',\r\n                            (credit?.balance || 0).toFixed(2),\r\n                          )}\r\n                        </Body>\r\n                      </Box>\r\n                    )}\r\n                  </Box>\r\n                )\r\n              }\r\n              maxWidth={'sm'}\r\n            />\r\n          ) : (\r\n            <></>\r\n          )\r\n        }\r\n      />\r\n      {hasChanges && (\r\n        <Beforeunload onBeforeunload={() => 'Youll lose your data!'} />\r\n      )}\r\n    </React.Fragment>\r\n  );\r\n});\r\n","/**\r\n *\r\n * ArticeDatasetlLink\r\n *\r\n */\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\n\r\nexport interface ArticleLinkProps {\r\n  dataset: string | undefined | null;\r\n  externalId?: string | null;\r\n  externalIdSource?: string | null;\r\n}\r\n\r\nexport function ArticleDatasetLink({\r\n  dataset,\r\n  externalIdSource,\r\n  externalId,\r\n}: ArticleLinkProps) {\r\n  if (dataset !== undefined && dataset !== null) {\r\n    return (\r\n      <>\r\n        <ExternalLink showIcon href={dataset}>\r\n          {dataset}\r\n        </ExternalLink>\r\n      </>\r\n    );\r\n  } else {\r\n    return <></>;\r\n  }\r\n}\r\n","import { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { IArticleDto } from 'api/odata/generated/entities/IArticleDto';\r\nimport { ListRenderer } from 'app/components/BasicTable/CellRenderers/ListRenderer';\r\nimport { AvailabilityTypes } from 'api/odata/generated/enums/AvailabilityTypes';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { ArticleSource } from './ArticlesSourcePicker';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { ArticleDoiLink } from './ArticleDoiLink';\r\nimport { DateTimeLabel } from 'app/components/DateTimeLabel';\r\nimport { ArticleStatus } from 'enums/Article';\r\nimport { ColumnWithDep } from 'app/components/BasicTable/types/ColumnWithDeps';\r\nimport { ArticleDatasetLink } from './AricleDatasetLink';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { AssetLink } from '../AssetPopUp/OpenAssetDetails';\r\nimport htmlParse from 'html-react-parser';\r\nimport {\r\n  allowedToViewAlert,\r\n  IAlertPermissionCheckRecord,\r\n} from 'app/permissions/WorkOrders/workOrdersPermissionUtils';\r\nimport { WorkOrderLink } from '../Actions/GlobalSelectedActions/OpenWorkOrder';\r\nimport { ArticleLink } from '../Actions/GlobalSelectedActions/OpenArticleDetails';\r\n\r\nexport const ArticleServiceGroupsColumnId /*: keyof IArticleDto*/ =\r\n  'FirstServiceGroupAssetName';\r\nexport const ArticleInstrumentsColumnId /*: keyof IArticleDto*/ =\r\n  'FirstInstrumentAssetName';\r\n\r\nexport function getColumns(\r\n  t: TFunction,\r\n  user: AuthenticatedUser | undefined,\r\n  settings: GlobalSettings,\r\n  useSidePanel?: boolean,\r\n  openPanel?: (state: SidePanelOpenState) => void,\r\n) {\r\n  if (user === undefined) {\r\n    return [];\r\n  }\r\n\r\n  const result: ColumnWithDep<IArticleDto>[] = [\r\n    {\r\n      Header: t(translations.Id) as string,\r\n      accessor: 'Id',\r\n    },\r\n    {\r\n      Header: t(translations.Title) as string,\r\n      accessor: 'Title',\r\n      Cell: ({ value, row }) => {\r\n        return (\r\n          value !== null && (\r\n            <ArticleLink\r\n              Id={row.original.Id}\r\n              useSidePanel={useSidePanel}\r\n              title={row.original.Title ?? undefined}\r\n              value={row.original}\r\n              externalIdSource={row.original.ExternalIdSource ?? undefined}\r\n              externalId={row.original.ExternalId ?? undefined}\r\n              openPanelWithCover={openPanel}\r\n            >\r\n              {htmlParse(value)}\r\n            </ArticleLink>\r\n          )\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Authors) as string,\r\n      accessor: 'Authors',\r\n      Cell: ListRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.Journal) as string,\r\n      accessor: 'Journal',\r\n    },\r\n    {\r\n      Header: t(translations.ArticlePageNumber) as string,\r\n      accessor: 'PageNumber',\r\n    },\r\n    {\r\n      id: ArticleServiceGroupsColumnId,\r\n      accessor: ArticleServiceGroupsColumnId,\r\n      Header: t(translations.ServiceGroups) as string,\r\n      Cell: ({ row }) => {\r\n        let groups =\r\n          row.original.Assets?.filter(\r\n            f => f.Availability?.Id === AvailabilityTypes.ServiceGroup,\r\n          )?.map(item => item) ?? [];\r\n        if (groups.length > 0) {\r\n          const res = groups.map((v, index) => (\r\n            <>\r\n              <AssetLink\r\n                id={v.Id}\r\n                useSidePanel={useSidePanel}\r\n                openPanelWithCover={openPanel}\r\n              >\r\n                {v.Name}\r\n              </AssetLink>\r\n              {index < groups.length - 1 && <br />}\r\n            </>\r\n          ));\r\n          return res;\r\n        } else {\r\n          return <></>;\r\n        }\r\n        //return ListRenderer({ value: groups });\r\n      },\r\n    },\r\n    {\r\n      id: ArticleInstrumentsColumnId,\r\n      accessor: ArticleInstrumentsColumnId,\r\n      Header: t(translations.Instruments) as string,\r\n      Cell: ({ row }) => {\r\n        const groups =\r\n          row.original.Assets?.filter(\r\n            f => f.ServiceTypeId === ServiceType.Online,\r\n          )?.map(item => item) ?? [];\r\n        if (groups.length > 0) {\r\n          const res = groups.map((v, index) => (\r\n            <>\r\n              <AssetLink\r\n                id={v.Id}\r\n                useSidePanel={useSidePanel}\r\n                openPanelWithCover={openPanel}\r\n              >\r\n                {v.Name}\r\n              </AssetLink>\r\n\r\n              {index < groups.length - 1 && <br />}\r\n            </>\r\n          ));\r\n          return res;\r\n        } else {\r\n          return <></>;\r\n        }\r\n        // return ListRenderer({ value: groups });\r\n      },\r\n    },\r\n    {\r\n      id: 'PubMedId',\r\n      Header: t(translations.PubMedId) as string,\r\n      accessor: 'ExternalId',\r\n      Cell: ({ value, row }) => {\r\n        const pubmedType: ArticleSource = 'PubMed';\r\n        return (\r\n          row.original.ExternalIdSource === pubmedType && (\r\n            <ExternalLink href={`https://pubmed.ncbi.nlm.nih.gov/${value}/`}>\r\n              {value}\r\n            </ExternalLink>\r\n          )\r\n        );\r\n      },\r\n    },\r\n    {\r\n      id: 'Doi',\r\n      Header: t(translations.Doi) as string,\r\n      accessor: 'Doi',\r\n      Cell: ({ value, row }) => {\r\n        return (\r\n          value !== null && (\r\n            <ArticleDoiLink\r\n              doi={value}\r\n              externalIdSource={row.original.ExternalIdSource}\r\n              externalId={row.original.ExternalId}\r\n            />\r\n          )\r\n        );\r\n      },\r\n    },\r\n    {\r\n      id: 'Dataset',\r\n      Header: t(translations.ArticleDataset) as string,\r\n      accessor: 'Dataset',\r\n      Cell: ({ value, row }) => {\r\n        return (\r\n          value !== null && (\r\n            <ArticleDatasetLink\r\n              dataset={value}\r\n              externalIdSource={row.original.ExternalIdSource}\r\n              externalId={row.original.ExternalId}\r\n            />\r\n          )\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.InsertedBy) as string,\r\n      accessor: 'UserDisplayName',\r\n      Cell: ({ value, row }) => {\r\n        const res = value ?? '';\r\n        return <> {res} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.InsertedAt) as string,\r\n      accessor: 'EnteredAt',\r\n      Cell: ({ value, row }) => {\r\n        return <DateTimeLabel value={value} />;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.RelatedUser) as string,\r\n      accessor: 'RelatedUserDisplayName',\r\n      Cell: ({ value, row }) => {\r\n        const res = value ?? '';\r\n        return <> {res} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.UserGroup) as string,\r\n      accessor: 'UserGroupName',\r\n      Cell: ({ value, row }) => {\r\n        const res = value ?? '';\r\n        return <> {res} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Department) as string,\r\n      accessor: 'DepartmentName',\r\n      Cell: ({ value, row }) => {\r\n        const res = value ?? '';\r\n        return <> {res} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Institute) as string,\r\n      accessor: 'InstituteName',\r\n      Cell: ({ value, row }) => {\r\n        const res = value ?? '';\r\n        return <> {res} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.InstituteType) as string,\r\n      accessor: 'InstituteTypeName',\r\n      Cell: ({ value, row }) => {\r\n        const res = value ?? '';\r\n        return <> {res} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.ArticleStatus) as string,\r\n      accessor: 'Status',\r\n      Cell: ({ value, row }) => {\r\n        const key = 'Article' + ArticleStatus[value];\r\n        return <> {t(key)} </>;\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.FileComment) as string,\r\n      accessor: 'FileComment',\r\n      // Cell: ArticleHTMLLinkRenderer,\r\n      Cell: ({ value, row }) => {\r\n        let v =\r\n          value !== null && value !== undefined && value !== ''\r\n            ? value[0] === '<'\r\n              ? (htmlParse(value) as JSX.Element).props.children\r\n              : value\r\n            : '';\r\n        return (\r\n          <ArticleLink\r\n            Id={row.original.Id}\r\n            useSidePanel={useSidePanel}\r\n            value={row.original}\r\n            externalIdSource={row.original.ExternalIdSource ?? undefined}\r\n            externalId={row.original.ExternalId ?? undefined}\r\n            openPanelWithCover={openPanel}\r\n          >\r\n            {v}\r\n          </ArticleLink>\r\n        );\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.CalibrationRecord) as string,\r\n      accessor: 'CalibrationRecord',\r\n      Cell: ({ value, row }) => {\r\n        const checkRow = {\r\n          ServiceGroupId:\r\n            row.original.Assets?.length > 0\r\n              ? row.original.Assets[0].ServiceGroupId\r\n              : null,\r\n          ReportedBy: row.original.EnteredBy,\r\n        } as IAlertPermissionCheckRecord;\r\n        return allowedToViewAlert(user, checkRow) && value !== null ? (\r\n          <WorkOrderLink\r\n            id={value}\r\n            useSidePanel={useSidePanel}\r\n            openPanelWithCover={openPanel}\r\n          >\r\n            {value}\r\n          </WorkOrderLink>\r\n        ) : (\r\n          <>{value}</>\r\n        );\r\n      },\r\n      deps: ['CalibrationRecordName'],\r\n    },\r\n  ];\r\n  return result;\r\n}\r\n","import { Select } from '@material-ui/core';\r\nimport styled from 'styled-components';\r\n\r\nexport const StyledSelect = styled(Select)`\r\n  min-width: 9em;\r\n  margin: 0;\r\n  background: transparent;\r\n`;\r\n","/**\r\n *\r\n * TmtType\r\n *\r\n */\r\nimport { MenuItem } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport { RUN_TYPES } from '../RunTypePicker';\r\nimport { StyledSelect } from '../../EditableTable/Fields/StyledSelect';\r\nimport { BaseInputProps } from '../../EditableTable/EditableCell';\r\n\r\nexport interface TmtTypeProps extends BaseInputProps<RUN_TYPES> {}\r\nexport function TmtType({ value, onChange, onBlur }: TmtTypeProps) {\r\n  const options = ['TMT Pro'];\r\n  return (\r\n    <StyledSelect\r\n      disableUnderline={true}\r\n      value={value || ''}\r\n      onChange={e => onChange(e.target.value as RUN_TYPES)}\r\n      onBlur={onBlur}\r\n      displayEmpty\r\n      autoWidth\r\n      inputProps={{ 'aria-label': 'Without label' }}\r\n    >\r\n      <MenuItem value=\"\">\r\n        <em>None</em>\r\n      </MenuItem>\r\n      {options.map((item, index) => (\r\n        <MenuItem key={index} value={item}>\r\n          {item}\r\n        </MenuItem>\r\n      ))}\r\n    </StyledSelect>\r\n  );\r\n}\r\n","import { Tab, TabProps } from '@material-ui/core';\r\nimport * as React from 'react';\r\nimport clsx from 'clsx';\r\nimport { capitalize } from 'lodash';\r\n\r\nexport interface BasicTabProps extends TabProps {\r\n  mainIcon?: React.ReactElement;\r\n  startIcon?: React.ReactElement;\r\n  endIcon?: React.ReactElement;\r\n  processing?: boolean;\r\n  size?: 'small' | 'medium';\r\n}\r\n\r\nexport const BasicTab = React.forwardRef<any, BasicTabProps>(function TabButton(\r\n  {\r\n    disabled,\r\n    processing,\r\n    size = 'medium',\r\n    mainIcon,\r\n    startIcon,\r\n    endIcon,\r\n    label,\r\n    className,\r\n    ...props\r\n  },\r\n  ref,\r\n) {\r\n  const startIconComponent = startIcon && (\r\n    <span className={clsx('startIcon', `iconSize${capitalize(size)}`)}>\r\n      {startIcon}\r\n    </span>\r\n  );\r\n  const endIconComponent = endIcon && (\r\n    <span className={clsx('endIcon', `iconSize${capitalize(size)}`)}>\r\n      {endIcon}\r\n    </span>\r\n  );\r\n  return (\r\n    <Tab\r\n      disabled={(processing || disabled) ?? false}\r\n      ref={ref}\r\n      className={clsx(className, `tabSize${capitalize(size)}`, {\r\n        startIcon: startIcon !== undefined,\r\n        endIcon: endIcon !== undefined,\r\n      })}\r\n      value={props.value}\r\n      fullWidth={props.fullWidth}\r\n      icon={\r\n        !!mainIcon ? (\r\n          <span className={clsx('mainIcon', `iconSize${capitalize(size)}`)}>\r\n            {mainIcon}\r\n          </span>\r\n        ) : undefined\r\n      }\r\n      disableRipple\r\n      label={\r\n        <React.Fragment>\r\n          {!!startIcon || !!endIcon ? (\r\n            <React.Fragment>\r\n              {!!startIconComponent && startIconComponent}\r\n              <span className={'buttonLabel'}>{label}</span>\r\n              {!!endIconComponent && endIconComponent}\r\n            </React.Fragment>\r\n          ) : (\r\n            <span className={'buttonLabel'}>{label}</span>\r\n          )}\r\n        </React.Fragment>\r\n      }\r\n      {...props}\r\n    />\r\n  );\r\n});\r\n","import { TabContent } from './TabContent';\r\nimport * as React from 'react';\r\nimport { Tabs, useTheme } from '@material-ui/core';\r\nimport { TabPanel, TabPanelProps } from './TabPanel';\r\nimport { BasicTab } from './BasicTab';\r\nimport clsx from 'clsx';\r\nimport { capitalize } from 'lodash';\r\nimport { TabsWrapper } from './TabsWrapper';\r\n\r\nexport interface BasicTabsProps {\r\n  tabs: Array<TabContent>;\r\n  selectedTabIndex?: number;\r\n  tabsId: string;\r\n  tabsPanelId: string;\r\n  textColor?: 'secondary' | 'primary' | 'inherit';\r\n  scrollButtons?: 'auto' | 'desktop' | 'on' | 'off';\r\n  indicatorColor?: 'secondary' | 'primary';\r\n  variant?: 'standard' | 'scrollable' | 'fullWidth';\r\n  selectionFollowsFocus?: boolean;\r\n  centered?: boolean;\r\n  orientation?: 'horizontal' | 'vertical';\r\n  ariaLabel?: string;\r\n  size?: 'small' | 'medium';\r\n  scrollableContent?: boolean;\r\n  className?: string;\r\n  handleTabChange?: (tab: TabContent) => void;\r\n  tabPanels?: Array<React.ReactElement<TabPanelProps>>;\r\n}\r\n\r\nexport function BasicTabs(props: BasicTabsProps) {\r\n  const {\r\n    selectedTabIndex,\r\n    tabs,\r\n    tabsId,\r\n    tabsPanelId,\r\n    textColor,\r\n    scrollButtons,\r\n    indicatorColor,\r\n    variant,\r\n    selectionFollowsFocus,\r\n    centered,\r\n    orientation,\r\n    ariaLabel,\r\n    size = 'medium',\r\n    className,\r\n    scrollableContent,\r\n    handleTabChange,\r\n    tabPanels,\r\n  } = props;\r\n  const theme = useTheme();\r\n  const [tabIndex, setTabIndex] = React.useState<number>(selectedTabIndex ?? 0);\r\n  // used for case when state is managed otside this component\r\n  React.useEffect(() => {\r\n    if (!!handleTabChange) {\r\n      setTabIndex(selectedTabIndex ?? 0);\r\n    }\r\n  }, [handleTabChange, selectedTabIndex]);\r\n\r\n  const handleSelectedTabIndexChange = (\r\n    event: React.ChangeEvent<{}>,\r\n    newValue: number,\r\n  ) => {\r\n    //when state is managed outside the index is come from the parrent component\r\n    if (!!handleTabChange) {\r\n      handleTabChange(tabs[newValue]);\r\n    } else {\r\n      setTabIndex(newValue);\r\n    }\r\n  };\r\n  const getTabProps = React.useCallback(\r\n    (item: TabContent) => {\r\n      return {\r\n        id: `${tabsId}-${item.Id}`,\r\n        'aria-controls': `${tabsPanelId}-${item.Id}`,\r\n        label: item.Name,\r\n      };\r\n    },\r\n    [tabsId, tabsPanelId],\r\n  );\r\n  return (\r\n    <TabsWrapper\r\n      theme={theme}\r\n      className={clsx('tabsWrapper', {\r\n        tabsVertical: orientation === 'vertical',\r\n        tabsHorizontal: orientation !== 'vertical',\r\n        scrollContent: scrollableContent === true,\r\n      })}\r\n    >\r\n      <Tabs\r\n        className={clsx(className, 'basicTabs', `size${capitalize(size)}`)}\r\n        indicatorColor={indicatorColor || 'primary'}\r\n        textColor={textColor || 'inherit'}\r\n        orientation={orientation || 'horizontal'}\r\n        value={tabIndex}\r\n        onChange={handleSelectedTabIndexChange}\r\n        variant={variant || 'fullWidth'}\r\n        selectionFollowsFocus={selectionFollowsFocus || true}\r\n        centered={centered}\r\n        scrollButtons={scrollButtons}\r\n        aria-label={ariaLabel || 'basic tabs'}\r\n      >\r\n        {tabs.map(item => (\r\n          <BasicTab\r\n            className={'basicTab'}\r\n            {...getTabProps(item)}\r\n            startIcon={item.startIcon}\r\n            endIcon={item.endIcon}\r\n            mainIcon={item.icon}\r\n            size={size}\r\n            key={`tab_${item.Id}`}\r\n            //fullWidth={false}\r\n            //wrapped={false}\r\n          />\r\n        ))}\r\n      </Tabs>\r\n      {!!tabPanels && tabPanels.length > 0 ? (\r\n        <React.Fragment>{tabPanels}</React.Fragment>\r\n      ) : (\r\n        <React.Fragment>\r\n          {tabs.map((item, index) => (\r\n            <TabPanel\r\n              value={tabIndex}\r\n              index={index}\r\n              tabsId={tabsId}\r\n              tabsPanelId={tabsPanelId}\r\n              scrollableContent={scrollableContent}\r\n              key={`tabpanel_${item.Id}`}\r\n            >\r\n              {item.Content}\r\n            </TabPanel>\r\n          ))}\r\n        </React.Fragment>\r\n      )}\r\n    </TabsWrapper>\r\n  );\r\n}\r\n","import { styled } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectEventsCount,\r\n  selectEventsCountLoading,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Roles } from 'app/slice/types';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nexport interface EventsCountProps {}\r\n\r\nexport const EventsCount = React.memo(function EventsCount(\r\n  props: EventsCountProps,\r\n) {\r\n  const count = useSelector(selectEventsCount);\r\n  const { t } = useTranslation();\r\n  const { newDate } = useSystemDate();\r\n  const user = useSelector(selectAuthenticatedUser);\r\n  const eventsLoading = useSelector(selectEventsCountLoading);\r\n  const isAdmin = React.useMemo(() => {\r\n    return (\r\n      user !== undefined &&\r\n      (user.Roles.indexOf(Roles.Administrators) >= 0 ||\r\n        user.Roles.indexOf(Roles.GroupAdministrators) >= 0 ||\r\n        user.Roles.indexOf(Roles.LabTech) >= 0 ||\r\n        user.Roles.indexOf(Roles.InstrumentEventsAdmin) >= 0)\r\n    );\r\n  }, [user]);\r\n\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const isMaintenanceAssetsEnabled = IsModuleEnabled(\r\n    appSettings,\r\n    KnownModules.MaintenanceAssets,\r\n  );\r\n\r\n  const StyledSpanIcon = styled('span')(({ theme }) => ({\r\n    fontSize: '20px',\r\n    color: bookitColors.grayscale.graySubtitles,\r\n    width: '20px',\r\n    height: '20px',\r\n  }));\r\n\r\n  //RENDER\r\n  return isAdmin && isMaintenanceAssetsEnabled && !eventsLoading ? (\r\n    <IconButton\r\n      variant=\"ghost\"\r\n      size=\"small\"\r\n      aria-label=\"search\"\r\n      to={`/workorders?openedOnly=false&period=0&et=${dateUtils.formatQueryStringDate(\r\n        newDate(),\r\n      )}`}\r\n      title={t(translations.Alerts)}\r\n      shape=\"square\"\r\n    >\r\n      <Tooltip title={t(translations.Alerts) as string}>\r\n        <StyledSpanIcon className=\"fa-layers fa-fw\">\r\n          <Icon icon={['fas', 'tools']} />\r\n          <span\r\n            className=\"fa-layers-counter\"\r\n            style={{\r\n              whiteSpace: 'nowrap',\r\n              fontSize: '26px',\r\n              right: '-4px',\r\n              top: '-4px',\r\n            }}\r\n          >\r\n            {count}\r\n          </span>\r\n        </StyledSpanIcon>\r\n      </Tooltip>\r\n    </IconButton>\r\n  ) : null;\r\n});\r\n","import {\r\n  AssetQuickSearchDetails,\r\n  IQuickAssetsSearchResult,\r\n} from 'app/components/AssetQuickSearch/slice/types';\r\nimport { Identifiable } from 'types/common';\r\nimport { httpClient } from './HttpClient';\r\nimport { Condition, ODataOperators } from './odata/ODataFilter';\r\n\r\nexport const AssetQuickSearchApi = {\r\n  getAssetSearch: async (payload: {\r\n    q: string;\r\n    serviceGroups: Identifiable<number>[];\r\n    serviceTypeId?: number;\r\n  }) => {\r\n    const url = `/api/odata/v4/AssetQuickSearch`;\r\n    let filters: Array<string> = [];\r\n    if (payload.serviceGroups.length > 0) {\r\n      filters.push(\r\n        `${new Condition<AssetQuickSearchDetails>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          payload.serviceGroups,\r\n        ).toString()}`,\r\n      );\r\n    }\r\n    if (!!payload.serviceTypeId) {\r\n      filters.push(\r\n        `${new Condition<AssetQuickSearchDetails>(\r\n          'ServiceTypeId',\r\n          ODataOperators.Equals,\r\n          payload.serviceTypeId,\r\n        ).toString()}`,\r\n      );\r\n    }\r\n    const params: {\r\n      q: string;\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $count: boolean;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      q: payload.q,\r\n      $filter: filters.length > 0 ? filters.join(' and ') : undefined,\r\n      $count: true,\r\n      $select:\r\n        'Id,Name,Image,AvailabilityTypeId,AvailabilityTypeName,BookableAsset,ServiceId,ServiceGroupId,ApprovalRequired',\r\n      $skip: 0,\r\n      $top: 5,\r\n      $orderby: 'Rank desc',\r\n    };\r\n    try {\r\n      const response = await httpClient.get(url, params);\r\n      return {\r\n        Results: response.value,\r\n        TotalResultsLength: response['@odata.count'],\r\n        ServiceType: payload.serviceTypeId,\r\n      } as IQuickAssetsSearchResult;\r\n    } catch {\r\n      return {\r\n        Results: [],\r\n        TotalResultsLength: 0,\r\n        ServiceType: undefined,\r\n      } as IQuickAssetsSearchResult;\r\n    }\r\n  },\r\n  getRecentAssets: async (payload: {\r\n    serviceGroups: Identifiable<number>[];\r\n  }) => {\r\n    const url = `/api/odata/v4/AssetQuickSearch/RecentAssets`;\r\n    let filters: Array<string> = [];\r\n    if (payload.serviceGroups.length > 0) {\r\n      filters.push(\r\n        `${new Condition<AssetQuickSearchDetails>(\r\n          'ServiceGroupId',\r\n          ODataOperators.Includes,\r\n          payload.serviceGroups,\r\n        ).toString()}`,\r\n      );\r\n    }\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $count: boolean;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: filters.length > 0 ? filters.join(' and ') : undefined,\r\n      $count: true,\r\n      $select:\r\n        'Id,Name,Image,AvailabilityTypeId,AvailabilityTypeName,BookableAsset,ServiceId,ServiceGroupId,ApprovalRequired',\r\n      $skip: 0,\r\n      $top: 10,\r\n    };\r\n    try {\r\n      const response = await httpClient.get(url, params);\r\n      return {\r\n        Results: response.value,\r\n        TotalResultsLength: response['@odata.count'],\r\n        ServiceType: undefined,\r\n      } as IQuickAssetsSearchResult;\r\n    } catch {\r\n      return {\r\n        Results: [],\r\n        TotalResultsLength: 0,\r\n        ServiceType: undefined,\r\n      } as IQuickAssetsSearchResult;\r\n    }\r\n  },\r\n};\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest, debounce, select } from 'redux-saga/effects';\r\nimport { assetQuickSearchActions as actions } from '.';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n  selectShowAllCores,\r\n  selectSiteMapSettings,\r\n} from 'app/slice/selectors';\r\nimport { Identifiable } from 'types/common';\r\nimport { AssetQuickSearchApi } from 'api/assetQuickSearchApi';\r\nimport {\r\n  IMenuItemsSearchResult,\r\n  IQuickAssetsSearchResult,\r\n  IQuickSearchResults,\r\n} from './types';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { SiteMapNode, SiteMapProvider } from 'types/SiteMapSettings';\r\nimport { AuthenticatedUser, isInRole } from 'types/AuthenticatedUser';\r\nimport { Roles } from 'app/slice/types';\r\nimport { uniqBy } from 'lodash';\r\n\r\nfunction* doShowSearchInput(action: PayloadAction<boolean>) {\r\n  yield put(actions.setOpen(action.payload));\r\n}\r\nfunction* doSetOpen(action: PayloadAction<boolean>) {\r\n  if (action.payload) {\r\n    yield put(actions.getRecentAssets());\r\n    yield put(actions.getRecentSearchTerms());\r\n  }\r\n}\r\nfunction* doSearchAssets(action: PayloadAction<string>) {\r\n  const topServiceGroups: Array<Identifiable<number>> | undefined =\r\n    yield select(selectGlobalServiceGroupFilter);\r\n  const payload = {\r\n    q: action.payload,\r\n    serviceGroups: topServiceGroups ?? [],\r\n  };\r\n  try {\r\n    const data = yield call(AssetQuickSearchApi.getAssetSearch, payload);\r\n    yield put(actions.searchAssets_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.searchAssets_Error({ error: error }));\r\n  }\r\n}\r\nfunction* doSearchAllAssets(action: PayloadAction<string>) {\r\n  const topServiceGroups: Array<Identifiable<number>> | undefined =\r\n    yield select(selectGlobalServiceGroupFilter);\r\n  const allCores = yield select(selectShowAllCores);\r\n  const sett = yield select(selectSiteMapSettings);\r\n  const user = yield select(selectAuthenticatedUser);\r\n  let siteMapProvider = new SiteMapProvider(sett);\r\n  let searchMenus: SiteMapNode[] = searchMenu(\r\n    action.payload,\r\n    siteMapProvider,\r\n    siteMapProvider.getUserNodes(),\r\n    user,\r\n  );\r\n\r\n  let menuResult: IMenuItemsSearchResult = {\r\n    Results: searchMenus,\r\n    TotalResultsLength: searchMenus.length,\r\n  };\r\n  yield put(actions.setMenuSearchResults(menuResult));\r\n  try {\r\n    let responses: IQuickAssetsSearchResult[] = [];\r\n    for (let idx = 1; idx <= 3; idx++) {\r\n      let payload = {\r\n        q: action.payload,\r\n        serviceGroups: allCores ? [] : topServiceGroups ?? [],\r\n        serviceTypeId: idx,\r\n      };\r\n      const result = yield call(AssetQuickSearchApi.getAssetSearch, payload);\r\n      if (result.ServiceType === ServiceType.Online) {\r\n        yield put(actions.setOnlineSearchResults(result));\r\n      } else if (result.ServiceType === ServiceType.Offline) {\r\n        yield put(actions.setOfflineSearchResults(result));\r\n      } else if (result.ServiceType === ServiceType.Sample) {\r\n        yield put(actions.setRequestSearchResults(result));\r\n      }\r\n      responses.push(result);\r\n    }\r\n    yield put(\r\n      actions.setTotalSearchCount(\r\n        responses.reduce((part, a) => part + a.TotalResultsLength, 0),\r\n      ),\r\n    );\r\n    const data = {\r\n      online: responses.filter(f => f.ServiceType === ServiceType.Online)[0],\r\n      offline: responses.filter(f => f.ServiceType === ServiceType.Offline)[0],\r\n      request: responses.filter(f => f.ServiceType === ServiceType.Sample)[0],\r\n      totalRresults: responses.reduce(\r\n        (part, a) => part + a.TotalResultsLength,\r\n        0,\r\n      ),\r\n    } as IQuickSearchResults;\r\n    yield put(actions.searchAllAssets_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.searchAllAssets_Error({ error: error }));\r\n  }\r\n}\r\nfunction* doGetRecentAssets(action: PayloadAction) {\r\n  const topServiceGroups: Array<Identifiable<number>> | undefined =\r\n    yield select(selectGlobalServiceGroupFilter);\r\n  const allCores = yield select(selectShowAllCores);\r\n  const payload = {\r\n    serviceGroups: allCores ? [] : topServiceGroups ?? [],\r\n  };\r\n  try {\r\n    const data = yield call(AssetQuickSearchApi.getRecentAssets, payload);\r\n    yield put(actions.getRecentAssets_Success(data.Results));\r\n  } catch (error: unknown) {\r\n    yield put(actions.getRecentAssets_Error({ error: error }));\r\n  }\r\n}\r\nfunction* doGetRecentSearchTerms(payload: PayloadAction<boolean>) {\r\n  try {\r\n    const data = yield call(\r\n      httpClient.get,\r\n      '/api/assets/recenttextsearchterms',\r\n    );\r\n    yield put(actions.getRecentSearchTerms_Success(data));\r\n  } catch (error: unknown) {\r\n    yield put(actions.getRecentSearchTerms_Error({ error: error }));\r\n  }\r\n}\r\nconst searchMenu = (\r\n  searchTerm: string,\r\n  siteMapProvider: SiteMapProvider,\r\n  menuNodes: SiteMapNode[],\r\n  user?: AuthenticatedUser,\r\n): SiteMapNode[] => {\r\n  let searchMenus: SiteMapNode[] = [];\r\n  const isAdmin =\r\n    isInRole(user, Roles.Administrators) ||\r\n    isInRole(user, Roles.GroupAdministrators) ||\r\n    isInRole(user, Roles.EquipmentAdministrator) ||\r\n    isInRole(user, Roles.CustomRole);\r\n  if (searchTerm !== '') {\r\n    menuNodes.forEach(item => {\r\n      if (\r\n        item.Hide === false &&\r\n        (!item.isAdminNode ||\r\n          (item.isAdminNode &&\r\n            isAdmin &&\r\n            siteMapProvider.nodeAccesibleByRole(item, user)))\r\n      ) {\r\n        let childItems = item.ChildNodes.filter(\r\n          ch =>\r\n            ch.HideReact === false &&\r\n            ch.Hide === false &&\r\n            (!ch.isAdminNode ||\r\n              (ch.isAdminNode &&\r\n                isAdmin &&\r\n                siteMapProvider.nodeAccesibleByRole(ch, user))),\r\n        );\r\n        if (childItems.length > 0) {\r\n          childItems.forEach(c => {\r\n            if (c.Title.toLowerCase().indexOf(searchTerm.toLowerCase()) >= 0) {\r\n              searchMenus.push(c);\r\n            }\r\n          });\r\n        }\r\n        if (item.Title.toLowerCase().indexOf(searchTerm.toLowerCase()) >= 0) {\r\n          searchMenus.push(item);\r\n        }\r\n      }\r\n    });\r\n  }\r\n  let results =\r\n    searchMenus.length > 0 ? uniqBy(searchMenus, f => f.Title) : searchMenus;\r\n  return results;\r\n};\r\nexport function* assetQuickSearchSaga() {\r\n  yield takeLatest(actions.setOpen.type, doSetOpen);\r\n  yield takeLatest(actions.showSearchInput.type, doShowSearchInput);\r\n  yield takeLatest(actions.getRecentAssets.type, doGetRecentAssets);\r\n  yield takeLatest(actions.getRecentSearchTerms.type, doGetRecentSearchTerms);\r\n  yield debounce(500, actions.searchAssets.type, doSearchAssets);\r\n  yield debounce(500, actions.searchAllAssets.type, doSearchAllAssets);\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { assetQuickSearchSaga } from './saga';\r\nimport {\r\n  AssetQuickSearchDetails,\r\n  AssetQuickSearchState,\r\n  IMenuItemsSearchResult,\r\n  IQuickAssetsSearchResult,\r\n  IQuickSearchResults,\r\n} from './types';\r\n\r\nexport const initialState: AssetQuickSearchState = {\r\n  open: false,\r\n  showSearchInSidebar: false,\r\n  showSearchResults: false,\r\n  recentAssets: { status: undefined },\r\n  recentSearchTerms: { status: undefined },\r\n  searchResults: { status: undefined },\r\n  allSearchResults: { status: undefined },\r\n  onlineSearchResults: undefined,\r\n  offlineSearchResults: undefined,\r\n  requestSearchResults: undefined,\r\n  totalSearchCount: undefined,\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'assetQuickSearch',\r\n  initialState,\r\n  reducers: {\r\n    showSearchInput(state, action: PayloadAction<boolean>) {\r\n      state.showSearchInSidebar = action.payload;\r\n      state.searchTerm = undefined;\r\n    },\r\n    setOpen(state, action: PayloadAction<boolean>) {\r\n      state.open = action.payload;\r\n    },\r\n    searchAssets(state: AssetQuickSearchState, action: PayloadAction<string>) {\r\n      state.searchTerm = action.payload;\r\n      state.showSearchResults = action.payload?.length > 0;\r\n      state.searchResults.status = 'pending';\r\n      state.searchResults.error = undefined;\r\n    },\r\n    searchAssets_Success(\r\n      state,\r\n      action: PayloadAction<IQuickAssetsSearchResult>,\r\n    ) {\r\n      state.searchResults.status = 'resolved';\r\n      state.searchResults.error = undefined;\r\n      state.searchResults.value = action.payload;\r\n    },\r\n    searchAssets_Error(state, action: PayloadAction<{ error: unknown }>) {\r\n      state.searchResults.status = 'rejected';\r\n      state.searchResults.error = action.payload;\r\n      state.searchResults.value = undefined;\r\n    },\r\n    getRecentAssets(state, action: PayloadAction) {\r\n      state.recentAssets.status = 'pending';\r\n      state.recentAssets.error = undefined;\r\n    },\r\n    getRecentAssets_Success(\r\n      state,\r\n      action: PayloadAction<AssetQuickSearchDetails[]>,\r\n    ) {\r\n      state.recentAssets.status = 'resolved';\r\n      state.recentAssets.error = undefined;\r\n      state.recentAssets.value = action.payload;\r\n    },\r\n    getRecentAssets_Error(state, action: PayloadAction<{ error: unknown }>) {\r\n      state.recentAssets.status = 'rejected';\r\n      state.recentAssets.error = action.payload;\r\n      state.recentAssets.value = [];\r\n    },\r\n    getRecentSearchTerms(state, action: PayloadAction) {\r\n      state.recentSearchTerms.status = 'pending';\r\n      state.recentSearchTerms.error = undefined;\r\n    },\r\n    getRecentSearchTerms_Success(state, action: PayloadAction<string[]>) {\r\n      state.recentSearchTerms.status = 'resolved';\r\n      state.recentSearchTerms.error = undefined;\r\n      state.recentSearchTerms.value = action.payload;\r\n    },\r\n    getRecentSearchTerms_Error(\r\n      state,\r\n      action: PayloadAction<{ error: unknown }>,\r\n    ) {\r\n      state.recentSearchTerms.status = 'rejected';\r\n      state.recentSearchTerms.error = action.payload;\r\n      state.recentSearchTerms.value = [];\r\n    },\r\n    searchAllAssets(\r\n      state: AssetQuickSearchState,\r\n      action: PayloadAction<string>,\r\n    ) {\r\n      state.searchTerm = action.payload;\r\n      state.showSearchResults = action.payload?.length > 0;\r\n      state.allSearchResults.status = 'pending';\r\n      state.allSearchResults.error = undefined;\r\n    },\r\n    searchAllAssets_Success(state, action: PayloadAction<IQuickSearchResults>) {\r\n      state.allSearchResults.status = 'resolved';\r\n      state.allSearchResults.error = undefined;\r\n      state.allSearchResults.value = action.payload;\r\n    },\r\n    searchAllAssets_Error(state, action: PayloadAction<{ error: unknown }>) {\r\n      state.allSearchResults.status = 'rejected';\r\n      state.allSearchResults.error = action.payload;\r\n      state.allSearchResults.value = undefined;\r\n    },\r\n    setOnlineSearchResults(\r\n      state,\r\n      action: PayloadAction<IQuickAssetsSearchResult | undefined>,\r\n    ) {\r\n      state.onlineSearchResults = action.payload;\r\n    },\r\n    setOfflineSearchResults(\r\n      state,\r\n      action: PayloadAction<IQuickAssetsSearchResult | undefined>,\r\n    ) {\r\n      state.offlineSearchResults = action.payload;\r\n    },\r\n    setRequestSearchResults(\r\n      state,\r\n      action: PayloadAction<IQuickAssetsSearchResult | undefined>,\r\n    ) {\r\n      state.requestSearchResults = action.payload;\r\n    },\r\n    setTotalSearchCount(state, action: PayloadAction<number | undefined>) {\r\n      state.totalSearchCount = action.payload;\r\n    },\r\n    setMenuSearchResults(\r\n      state,\r\n      action: PayloadAction<IMenuItemsSearchResult | undefined>,\r\n    ) {\r\n      state.menuItemsSearchResult = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: assetQuickSearchActions } = slice;\r\n\r\nexport const useAssetQuickSearchSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: assetQuickSearchSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useAssetQuickSearchSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.someAction());\r\n *   };\r\n * }\r\n */\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.assetQuickSearch || initialState;\r\n\r\nexport const selectAssetQuickSearch = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectRecentAssets = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.recentAssets,\r\n);\r\nexport const selectRecentSearchTerms = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.recentSearchTerms,\r\n);\r\nexport const selectSearchResults = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.searchResults,\r\n);\r\nexport const selectAllSearchResults = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.allSearchResults,\r\n);\r\nexport const selectSearchTerm = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.searchTerm,\r\n);\r\nexport const selectOpen = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.open,\r\n);\r\nexport const selectShowSearchInSidebar = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.showSearchInSidebar,\r\n);\r\nexport const selectOnlineSearchResults = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.onlineSearchResults,\r\n);\r\nexport const selectOfflineSearchResults = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.offlineSearchResults,\r\n);\r\nexport const selectRequestSearchResults = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.requestSearchResults,\r\n);\r\nexport const selectTotalSearchCount = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.totalSearchCount,\r\n);\r\nexport const selectMenuSearchResults = createSelector(\r\n  [selectAssetQuickSearch],\r\n  state => state.menuItemsSearchResult,\r\n);\r\n","/**\r\n *\r\n * ListItemLink\r\n *\r\n */\r\nimport { ListItem, ListItemProps } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport * as React from 'react';\r\n\r\nexport interface ListItemLinkProps extends ListItemProps {\r\n  info?: string;\r\n}\r\n\r\nexport function ListItemLink(props) {\r\n  return !!props.info ? (\r\n    <Tooltip title={<>{props.info}</>}>\r\n      <span>\r\n        <ListItem component=\"a\" {...props} />\r\n      </span>\r\n    </Tooltip>\r\n  ) : (\r\n    <React.Fragment>\r\n      <ListItem component=\"a\" {...props} />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetListItem\r\n *\r\n */\r\nimport {\r\n  Avatar,\r\n  ListItemIcon,\r\n  ListItemSecondaryAction,\r\n  ListItemText,\r\n} from '@material-ui/core';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { AssetThumbImage } from 'app/components/AssetThumbImage';\r\nimport { AssetQuickSearchDetails } from '../slice/types';\r\nimport { ListItemLink } from 'app/components/ListItemLink';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectGlobalSetting, selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings, GlobalSettings } from 'utils/globalSettings';\r\nimport { GetSchedulerPagePath } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport cliTruncate from 'cli-truncate';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body, Tips } from 'app/components/Typography';\r\nimport React from 'react';\r\nimport { ActionIconButton } from 'app/components/BasicButtons/ActionIconButton';\r\nimport { tryParseBool } from 'utils/string-utils';\r\nimport { Entity } from 'types/common';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\n\r\nexport interface AssetListItemProps {\r\n  item: AssetQuickSearchDetails;\r\n  useAssetPopup?: boolean;\r\n  isMobile?: boolean;\r\n  selectedServiceGroups?: Entity<number>[];\r\n}\r\n\r\nconst DefaultQuickAssetSearchAction = [\r\n  'AssetDetails',\r\n  'Calendar',\r\n  'Timeline',\r\n] as const;\r\n\r\nconst getAssetDetailsLink = (item: AssetQuickSearchDetails) =>\r\n  `/assets/details?id=${item.Id}`;\r\nconst getCalendarLink = (\r\n  item: AssetQuickSearchDetails,\r\n  EnableLegacyScheduler: boolean,\r\n) => {\r\n  if (EnableLegacyScheduler) {\r\n    return toRootedURL('/Weekly.aspx', { id: `os${item.ServiceId}` });\r\n  }\r\n\r\n  return toRootedURL(\r\n    `${GetSchedulerPagePath('calendar')}?${toQueryString({\r\n      eid: item.ServiceId,\r\n      openToBook: true,\r\n    })}`,\r\n  );\r\n};\r\n\r\nconst getTimelineLink = (\r\n  item: AssetQuickSearchDetails,\r\n  EnableLegacyScheduler: boolean,\r\n) => {\r\n  if (EnableLegacyScheduler) {\r\n    return toRootedURL('/Timeline.aspx', { services: item.ServiceId });\r\n  }\r\n  return toRootedURL(\r\n    `${GetSchedulerPagePath('timeline')}?eid=${item.ServiceId}&openToBook=true`,\r\n  );\r\n};\r\n\r\nfunction getSettingValue(\r\n  g: GlobalSettings,\r\n  selectedServiceGroups?: Entity<number>[],\r\n): (item: AssetQuickSearchDetails) => { t: string; url: string } {\r\n  const s = g.GetString(AllowedSettings.DefaultQuickAssetSearchAction);\r\n  const t = g.GetBooleanByKey(AllowedSettings.EnableLegacyScheduler);\r\n  var validKey =\r\n    DefaultQuickAssetSearchAction.find(f => f === s) || 'AssetDetails';\r\n  return (item: AssetQuickSearchDetails) => {\r\n    if (\r\n      !item.BookableAsset ||\r\n      (item.BookableAsset &&\r\n        !selectedServiceGroups?.some(f => f.Id === item.ServiceGroupId))\r\n    ) {\r\n      return { t: 'AssetDetails', url: getAssetDetailsLink(item) };\r\n    }\r\n    switch (validKey) {\r\n      case 'AssetDetails':\r\n        return { t: validKey, url: getAssetDetailsLink(item) };\r\n      case 'Calendar':\r\n        return { t: validKey, url: getCalendarLink(item, t) };\r\n      case 'Timeline':\r\n        return { t: validKey, url: getTimelineLink(item, t) };\r\n    }\r\n  };\r\n}\r\n\r\nexport function AssetListItem({\r\n  item,\r\n  useAssetPopup,\r\n  isMobile,\r\n  selectedServiceGroups,\r\n}: AssetListItemProps) {\r\n  const { t } = useTranslation();\r\n  const history = useHistory();\r\n  const truncateName = isMobile\r\n    ? item.Name?.length > 25\r\n    : item.Name?.length > 50;\r\n  const app = useSelector(selectglobalSettings);\r\n  const defaultLink = getSettingValue(app);\r\n  const EnableLegacyScheduler = useSelector(\r\n    state =>\r\n      tryParseBool(\r\n        selectGlobalSetting(state, AllowedSettings.EnableLegacyScheduler),\r\n      ) === true,\r\n  );\r\n  const showCalendarLinks = React.useMemo(() => {\r\n    return (\r\n      (selectedServiceGroups === undefined && item.BookableAsset) ||\r\n      (!!selectedServiceGroups &&\r\n        selectedServiceGroups.some(f => f.Id === item.ServiceGroupId))\r\n    );\r\n  }, [item.BookableAsset, item.ServiceGroupId, selectedServiceGroups]);\r\n  const href = React.useMemo(() => {\r\n    return defaultLink(item);\r\n  }, [defaultLink, item]);\r\n  const handleAssetClick = React.useCallback(() => {\r\n    history.push(href.url);\r\n  }, [history, href.url]);\r\n  return (\r\n    <ListItemLink\r\n      key={item.Id}\r\n      disableGutters\r\n      button\r\n      component=\"a\"\r\n      target={href.t !== 'AssetDetails' ? '_blank' : undefined}\r\n      href={href.t !== 'AssetDetails' ? href.url : undefined}\r\n      onClick={href.t === 'AssetDetails' ? handleAssetClick : undefined}\r\n      className={'assetListItemLink'}\r\n      disableRipple\r\n      info={t(translations.ShowFullDetails) as string}\r\n    >\r\n      <ListItemIcon>\r\n        {item.Image !== null ? (\r\n          <AssetThumbImage imageName={item.Image} maxSize={32} />\r\n        ) : (\r\n          <Avatar variant=\"square\">{'A'}</Avatar>\r\n        )}\r\n      </ListItemIcon>\r\n      <ListItemText\r\n        primary={\r\n          isMobile ? (\r\n            <>{cliTruncate(item.Name, 25, { position: 'end' })}</>\r\n          ) : (\r\n            <>\r\n              {truncateName ? (\r\n                <Tooltip title={item.Name}>\r\n                  <span>{item.Name?.substr(0, 50) + '...'}</span>\r\n                </Tooltip>\r\n              ) : (\r\n                <>{item.Name}</>\r\n              )}\r\n            </>\r\n          )\r\n        }\r\n        secondary={\r\n          isMobile ? (\r\n            cliTruncate(item.AvailabilityTypeName, 15, { position: 'middle' })\r\n          ) : item.ApprovalRequired ? (\r\n            <div\r\n              style={{ display: 'inline-flex', gap: 8, alignItems: 'center' }}\r\n            >\r\n              <Body>{item.AvailabilityTypeName}</Body>\r\n              <Tips bold>{t(translations.ApprovalRequired) as string}</Tips>\r\n            </div>\r\n          ) : (\r\n            item.AvailabilityTypeName\r\n          )\r\n        }\r\n      />\r\n      <ListItemSecondaryAction>\r\n        <div style={{ display: 'flex', flexDirection: 'row' }}>\r\n          {item.BookableAsset && showCalendarLinks && (\r\n            <ActionIconButton\r\n              variant=\"ghost\"\r\n              icon=\"calendar-alt\"\r\n              size=\"xs\"\r\n              title={t(translations.Schedule)}\r\n              href={getCalendarLink(item, EnableLegacyScheduler)}\r\n              shape=\"square\"\r\n            />\r\n          )}\r\n          {/* {item.BookableAsset && showCalendarLinks && (\r\n            <ActionIconButton\r\n              variant=\"ghost\"\r\n              icon=\"stream\"\r\n              size=\"xs\"\r\n              title={t(translations.Timeline)}\r\n              href={getTimelineLink(item, EnableLegacyScheduler)}\r\n              shape=\"square\"\r\n            />\r\n          )} */}\r\n          {/* <ActionIconButton\r\n            variant=\"ghost\"\r\n            icon=\"file-alt\"\r\n            size=\"xs\"\r\n            title={t(translations.AssetDetails)}\r\n            href={getAssetDetailsLink(item)}\r\n            shape=\"square\"\r\n          /> */}\r\n        </div>\r\n      </ListItemSecondaryAction>\r\n    </ListItemLink>\r\n  );\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const QuickSearchSection = styled('div')`\r\n  display: flex;\r\n  flex-direction: column;\r\n  align-items: flex-start;\r\n  gap: 8px;\r\n  align-self: stretch;\r\n  width: 100%;\r\n`;\r\nexport const QuickSearchSectionTitle = styled('div')`\r\n  display: flex;\r\n  padding: 0px 8px;\r\n  align-items: center;\r\n  gap: 10px;\r\n  align-self: stretch;\r\n`;\r\nexport const QuickSearchSearchesItems = styled('div')`\r\n  display: flex;\r\n  flex-direction: row;\r\n  align-items: flex-start;\r\n  flex-wrap: wrap;\r\n  gap: 8px;\r\n  align-self: stretch;\r\n`;\r\nexport const QuickSearchRecentItems = styled('div')`\r\n  display: flex;\r\n  padding: 4px 0px;\r\n  flex-direction: column;\r\n  align-items: stretch;\r\n  gap: 4px;\r\n  align-self: stretch;\r\n  width: 100%;\r\n`;\r\nexport const QuickSearchEmptySection = styled('div')`\r\n  display: flex;\r\n  width: 100%;\r\n  height: 260px;\r\n  padding: 0px 16px 16px 16px;\r\n  flex-direction: column;\r\n  justify-content: center;\r\n  align-items: center;\r\n  flex-shrink: 0;\r\n`;\r\nexport const QuickSearchEmptyContent = styled('div')`\r\n  display: flex;\r\n  padding: 0px 8px;\r\n  flex-direction: column;\r\n  align-items: flex-start;\r\n  gap: 8px;\r\n  align-self: stretch;\r\n`;\r\nexport const QuickSearchSeeAll = styled('div')`\r\n  display: flex;\r\n  flex-direction: row;\r\n  align-items: center;\r\n  align-self: stretch;\r\n`;\r\nexport const QuickSearchMainTitleSection = styled('div')`\r\n  display: flex;\r\n  padding: 0px 8px;\r\n  align-items: center;\r\n  gap: 10px;\r\n  align-self: stretch;\r\n`;\r\nexport const QuickSearchAllInstrumentsSection = styled('div')`\r\n  display: flex;\r\n  padding: 0px 8px;\r\n  flex-direction: column;\r\n  align-items: flex-start;\r\n  gap: 10px;\r\n  align-self: stretch;\r\n`;\r\nexport const MenuSearchEmptyContent = styled('div')`\r\n  display: flex;\r\n  width: 100%;\r\n  padding: 0px 16px 16px 16px;\r\n  flex-direction: column;\r\n  justify-content: center;\r\n  align-items: center;\r\n  flex-shrink: 0;\r\n`;\r\n","/**\r\n *\r\n * RecentAssetsList\r\n *\r\n */\r\nimport { LinearProgress, ListItem } from '@material-ui/core';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectRecentAssets } from '../slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AssetListItem } from '../AssetListItem';\r\nimport {\r\n  QuickSearchSection,\r\n  QuickSearchRecentItems,\r\n  QuickSearchSectionTitle,\r\n} from '../RecentWrappers/wrappers';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport React from 'react';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface RecentAssetsListProps {\r\n  useAssetPopup?: boolean;\r\n  isMobile?: boolean;\r\n  selectedServiceGroups?: Entity<number>[];\r\n}\r\n\r\nexport function RecentAssetsList(props: RecentAssetsListProps) {\r\n  const { t } = useTranslation();\r\n  const data = useSelector(selectRecentAssets);\r\n  const { useAssetPopup, isMobile, selectedServiceGroups } = props;\r\n\r\n  return (\r\n    <ListItem disableGutters component=\"div\" style={{ width: '100%' }}>\r\n      <QuickSearchSection>\r\n        <QuickSearchSectionTitle>\r\n          <Uppercase color=\"secondary\">\r\n            {t(translations.RecentAssets)}\r\n          </Uppercase>\r\n        </QuickSearchSectionTitle>\r\n        <QuickSearchRecentItems>\r\n          {data.status === 'pending' ? (\r\n            <div style={{ width: '100%' }}>\r\n              <LinearProgress variant=\"query\" color=\"primary\" />\r\n            </div>\r\n          ) : data.status === 'rejected' ||\r\n            (data.status === 'resolved' && data.value?.length === 0) ? (\r\n            <div style={{ width: '100%' }}>\r\n              <Body>{'No recent data'}</Body>\r\n            </div>\r\n          ) : (\r\n            <React.Fragment>\r\n              {data.value?.map((item, index) => (\r\n                <AssetListItem\r\n                  key={index}\r\n                  item={item}\r\n                  useAssetPopup={useAssetPopup}\r\n                  isMobile={isMobile}\r\n                  selectedServiceGroups={selectedServiceGroups}\r\n                />\r\n              ))}\r\n            </React.Fragment>\r\n          )}\r\n        </QuickSearchRecentItems>\r\n      </QuickSearchSection>\r\n    </ListItem>\r\n  );\r\n}\r\n","import Chip from '@material-ui/core/Chip';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport React from 'react';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface RecentItemProps {\r\n  label: React.ReactNode;\r\n  icon?: IconProp;\r\n  link?: string | IPathAndQuery;\r\n  searchTerm?: string;\r\n  onClick?: (searchTerm?: string) => void;\r\n}\r\nexport function RecentItem(props: RecentItemProps) {\r\n  const { label, icon, onClick, searchTerm, link } = props;\r\n  const handleClick = React.useCallback(() => {\r\n    !!onClick && onClick(searchTerm);\r\n  }, [onClick, searchTerm]);\r\n  const absolutePath =\r\n    link === undefined\r\n      ? undefined\r\n      : typeof link === 'string'\r\n      ? toRootedURL(link)\r\n      : toRootedURL(\r\n          (link as IPathAndQuery).path,\r\n          (link as IPathAndQuery).search,\r\n        );\r\n  return (\r\n    <Chip\r\n      className={'recentItem'}\r\n      label={label}\r\n      onClick={() => handleClick()}\r\n      component={'a'}\r\n      avatar={<Icon icon={icon || 'magnifying-glass'} />}\r\n      href={absolutePath}\r\n      clickable\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * RecentSearchTermsList\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { LinearProgress, ListItem } from '@material-ui/core';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectRecentSearchTerms } from '../slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { RecentItem } from '../RecentItem';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport {\r\n  QuickSearchSection,\r\n  QuickSearchSearchesItems,\r\n  QuickSearchSectionTitle,\r\n  QuickSearchEmptyContent,\r\n} from '../RecentWrappers/wrappers';\r\n\r\nexport interface RecentSearchTermsListProps {\r\n  onClick: (searchTerm?: string) => void;\r\n}\r\n\r\nexport function RecentSearchTermsList(props: RecentSearchTermsListProps) {\r\n  const { t } = useTranslation();\r\n  const recentSearchTermsState = useSelector(selectRecentSearchTerms);\r\n  const { onClick } = props;\r\n\r\n  return (\r\n    <>\r\n      <ListItem key=\"recent-searches\" disableGutters>\r\n        <QuickSearchSection>\r\n          <QuickSearchSectionTitle>\r\n            <Uppercase color=\"secondary\">\r\n              {t(translations.RecentSearches)}\r\n            </Uppercase>\r\n          </QuickSearchSectionTitle>\r\n          <QuickSearchSearchesItems>\r\n            {recentSearchTermsState.status === 'pending' ? (\r\n              <div style={{ width: '100%' }}>\r\n                <LinearProgress variant=\"query\" color=\"primary\" />\r\n              </div>\r\n            ) : recentSearchTermsState.status === 'rejected' ||\r\n              (recentSearchTermsState.status === 'resolved' &&\r\n                recentSearchTermsState.value?.length === 0) ? (\r\n              <QuickSearchEmptyContent>\r\n                <span style={{ alignSelf: 'stretch' }}>\r\n                  <Body size=\"large\" bold style={{ textAlign: 'center' }}>\r\n                    {t(translations.NoSearchTermFound)}\r\n                  </Body>\r\n                </span>\r\n              </QuickSearchEmptyContent>\r\n            ) : (\r\n              <>\r\n                {recentSearchTermsState.value?.map((item, index) => (\r\n                  <RecentItem\r\n                    key={index}\r\n                    label={item}\r\n                    searchTerm={item}\r\n                    onClick={search => onClick(search)}\r\n                    // link={toRootedURL(`/assets/`, { q: item })}\r\n                  />\r\n                ))}\r\n              </>\r\n            )}\r\n          </QuickSearchSearchesItems>\r\n        </QuickSearchSection>\r\n      </ListItem>\r\n    </>\r\n  );\r\n}\r\n","import { SiteMapNode } from 'types/SiteMapSettings';\r\nimport * as React from 'react';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\n\r\nexport interface MenuSearchItemProps {\r\n  item: SiteMapNode;\r\n}\r\n\r\nexport function MenuSearchItem(props: MenuSearchItemProps) {\r\n  const { item } = props;\r\n  const convertUrl = (url: string): string => {\r\n    if (url !== null) {\r\n      if (url.indexOf(process.env.PUBLIC_URL) !== -1) {\r\n        return url.replace(process.env.PUBLIC_URL, '');\r\n      }\r\n      return url;\r\n    }\r\n    return url;\r\n  };\r\n  const link: string = React.useMemo(() => {\r\n    return item.ChildNodes.filter(\r\n      ch => ch.HideReact === false && ch.Hide === false,\r\n    ).length > 0\r\n      ? item.LinkWithChildren ?? item.reactUrl ?? convertUrl(item.Url)\r\n      : item.reactUrl ?? convertUrl(item.Url);\r\n  }, [item.ChildNodes, item.LinkWithChildren, item.Url, item.reactUrl]);\r\n\r\n  const external = React.useMemo(() => {\r\n    return (\r\n      link.includes('aspx') ||\r\n      (isNullOrUndefined(item.reactUrl) &&\r\n        item.ChildNodes.filter(\r\n          ch => ch.HideReact === false && ch.Hide === false,\r\n        ).length === 0)\r\n    );\r\n  }, [item.ChildNodes, item.reactUrl, link]);\r\n  return (\r\n    <Button\r\n      variant=\"ghostColor\"\r\n      component={LinkBehavior}\r\n      size=\"small\"\r\n      to={external ? undefined : link}\r\n      href={external ? link : undefined}\r\n    >\r\n      {item.Title}\r\n    </Button>\r\n  );\r\n}\r\n","/**\r\n *\r\n * MenuSearchResultList\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { ListItem } from '@material-ui/core';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectMenuSearchResults } from '../slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport {\r\n  QuickSearchSection,\r\n  QuickSearchSearchesItems,\r\n  QuickSearchSectionTitle,\r\n  QuickSearchEmptyContent,\r\n  MenuSearchEmptyContent,\r\n} from '../RecentWrappers/wrappers';\r\nimport { MenuSearchItem } from '../MenuSearchItem';\r\n\r\nexport interface MenuSearchResultListProps {}\r\n\r\nexport function MenuSearchResultList(props: MenuSearchResultListProps) {\r\n  const { t } = useTranslation();\r\n  const menuSearchState = useSelector(selectMenuSearchResults);\r\n\r\n  return (\r\n    <>\r\n      <ListItem key=\"menu-searches\" disableGutters>\r\n        <QuickSearchSection>\r\n          <QuickSearchSectionTitle>\r\n            <Uppercase color=\"secondary\">\r\n              {t(translations.RelatedScreens)}\r\n            </Uppercase>\r\n          </QuickSearchSectionTitle>\r\n          <QuickSearchSearchesItems>\r\n            {menuSearchState === undefined ||\r\n            menuSearchState.Results.length === 0 ? (\r\n              <MenuSearchEmptyContent>\r\n                <QuickSearchEmptyContent>\r\n                  <span style={{ alignSelf: 'stretch' }}>\r\n                    <Body size=\"large\" bold style={{ textAlign: 'center' }}>\r\n                      {t(translations.NoRelatedScreensFound)}\r\n                    </Body>\r\n                  </span>\r\n                </QuickSearchEmptyContent>\r\n              </MenuSearchEmptyContent>\r\n            ) : (\r\n              <>\r\n                {menuSearchState.Results.map((item, index) => (\r\n                  <MenuSearchItem key={index} item={item} />\r\n                ))}\r\n              </>\r\n            )}\r\n          </QuickSearchSearchesItems>\r\n        </QuickSearchSection>\r\n      </ListItem>\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetSearchResultsByType\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { LinearProgress, ListItem } from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n  selectAllSearchResults,\r\n  selectMenuSearchResults,\r\n  selectOfflineSearchResults,\r\n  selectOnlineSearchResults,\r\n  selectRequestSearchResults,\r\n  selectSearchTerm,\r\n  selectTotalSearchCount,\r\n} from '../slice/selectors';\r\nimport { AssetListItem } from '../AssetListItem';\r\nimport {\r\n  QuickSearchEmptyContent,\r\n  QuickSearchEmptySection,\r\n  QuickSearchRecentItems,\r\n  QuickSearchSection,\r\n  QuickSearchSectionTitle,\r\n  QuickSearchSeeAll,\r\n} from '../RecentWrappers/wrappers';\r\nimport { Body, Uppercase } from 'app/components/Typography';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport { Entity } from 'types/common';\r\nimport { MenuSearchResultList } from '../MenuSearchResultList';\r\n\r\nexport interface AssetSearchResultsByTypeProps {\r\n  onAllAssetsClick: (serviceTypeId?: number, searchTerm?: string) => void;\r\n  isMobile?: boolean;\r\n  selectedServiceGroups?: Entity<number>[];\r\n}\r\n\r\nexport function AssetSearchResultsByType(props: AssetSearchResultsByTypeProps) {\r\n  const { t } = useTranslation();\r\n  const { onAllAssetsClick, isMobile, selectedServiceGroups } = props;\r\n  // const searchTerm = useSelector(selectSearchTerm);\r\n  const state = useSelector(selectAllSearchResults);\r\n  const onlineState = useSelector(selectOnlineSearchResults);\r\n  const offlineState = useSelector(selectOfflineSearchResults);\r\n  const requestState = useSelector(selectRequestSearchResults);\r\n  const totalRresults = useSelector(selectTotalSearchCount);\r\n  const searchTerm = useSelector(selectSearchTerm);\r\n  const menuItemsState = useSelector(selectMenuSearchResults);\r\n  // const resultsLength = React.useMemo(() => {\r\n  //   return state.value?.totalRresults;\r\n  // }, [state.value?.totalRresults]);\r\n\r\n  const OnlineServiceLabel = React.useMemo(() => {\r\n    return (t(translations.InstrumentsFound) as string).replace(\r\n      '{0}',\r\n      `(${(onlineState?.TotalResultsLength ?? 0).toString()})`,\r\n    );\r\n  }, [onlineState?.TotalResultsLength, t]);\r\n  const RequestServiceLabel = React.useMemo(() => {\r\n    return (t(translations.RequestsFound) as string).replace(\r\n      '{0}',\r\n      `(${(requestState?.TotalResultsLength ?? 0).toString()})`,\r\n    );\r\n  }, [requestState?.TotalResultsLength, t]);\r\n  const OfflineServiceLabel = React.useMemo(() => {\r\n    return (t(translations.ConsumablesFound) as string).replace(\r\n      '{0}',\r\n      `(${(offlineState?.TotalResultsLength ?? 0).toString()})`,\r\n    );\r\n  }, [offlineState?.TotalResultsLength, t]);\r\n\r\n  const showOnline = React.useMemo(() => {\r\n    return (\r\n      (state.status === 'pending' &&\r\n        !!onlineState &&\r\n        onlineState.Results.length > 0) ||\r\n      (state.status === 'resolved' && (totalRresults ?? 0) > 0)\r\n    );\r\n  }, [onlineState, state.status, totalRresults]);\r\n\r\n  const showOffline = React.useMemo(() => {\r\n    return (\r\n      (state.status === 'pending' &&\r\n        !!offlineState &&\r\n        offlineState.Results.length > 0) ||\r\n      (state.status === 'resolved' && (totalRresults ?? 0) > 0)\r\n    );\r\n  }, [offlineState, state.status, totalRresults]);\r\n  const showRequests = React.useMemo(() => {\r\n    return (\r\n      (state.status === 'pending' &&\r\n        !!requestState &&\r\n        requestState.Results.length > 0) ||\r\n      (state.status === 'resolved' && (totalRresults ?? 0) > 0)\r\n    );\r\n  }, [requestState, state.status, totalRresults]);\r\n  // const error = React.useMemo(() => {\r\n  //   return state.error !== undefined\r\n  //     ? typeof state.error === 'string'\r\n  //       ? state.error\r\n  //       : undefined\r\n  //     : undefined;\r\n  // }, [state.error]);\r\n  return (\r\n    <>\r\n      {!state.status ||\r\n        (state.status === 'pending' && (\r\n          <div style={{ width: '100%' }}>\r\n            <LinearProgress variant=\"query\" color=\"primary\" />\r\n          </div>\r\n        ))}\r\n      {state.status === 'resolved' && totalRresults === 0 && (\r\n        <ListItem disableGutters component=\"div\" style={{ width: '100%' }}>\r\n          <QuickSearchEmptySection>\r\n            <QuickSearchEmptyContent>\r\n              <span style={{ alignSelf: 'stretch' }}>\r\n                <Body size=\"large\" bold style={{ textAlign: 'center' }}>\r\n                  {t(translations.NothingFound)}\r\n                </Body>\r\n              </span>\r\n              <span\r\n                style={{\r\n                  alignSelf: 'stretch',\r\n                  display: 'flex',\r\n                  alignItems: 'center',\r\n                  justifyContent: 'center',\r\n                  gap: 4,\r\n                }}\r\n              >\r\n                <Body\r\n                  size=\"medium\"\r\n                  color=\"secondary\"\r\n                  style={{ textAlign: 'center' }}\r\n                >\r\n                  {`Try to `}\r\n                </Body>\r\n                <Button variant=\"text\" onClick={() => onAllAssetsClick()}>\r\n                  {t(translations.SearchAllCores)}\r\n                </Button>\r\n                <Body\r\n                  size=\"medium\"\r\n                  color=\"secondary\"\r\n                  style={{ textAlign: 'center' }}\r\n                >\r\n                  {` or change the query`}\r\n                </Body>\r\n              </span>\r\n            </QuickSearchEmptyContent>\r\n          </QuickSearchEmptySection>\r\n        </ListItem>\r\n      )}\r\n\r\n      <React.Fragment>\r\n        {showOnline && (\r\n          <QuickSearchSection>\r\n            <QuickSearchSectionTitle>\r\n              <Uppercase color=\"secondary\">{OnlineServiceLabel}</Uppercase>\r\n              <QuickSearchSeeAll>\r\n                <Button\r\n                  variant=\"text\"\r\n                  size=\"small\"\r\n                  endIcon={<Icon icon=\"chevron-double-right\" />}\r\n                  onClick={() =>\r\n                    onAllAssetsClick(ServiceType.Online, searchTerm)\r\n                  }\r\n                >\r\n                  {t(translations.FullResults)}\r\n                </Button>\r\n              </QuickSearchSeeAll>\r\n            </QuickSearchSectionTitle>\r\n            <QuickSearchRecentItems>\r\n              <React.Fragment>\r\n                {onlineState?.Results?.map((item, index) => (\r\n                  <AssetListItem\r\n                    key={index}\r\n                    item={item}\r\n                    isMobile={isMobile}\r\n                    selectedServiceGroups={selectedServiceGroups}\r\n                  />\r\n                ))}\r\n              </React.Fragment>\r\n            </QuickSearchRecentItems>\r\n          </QuickSearchSection>\r\n        )}\r\n\r\n        {showOffline && (\r\n          <QuickSearchSection>\r\n            <QuickSearchSectionTitle>\r\n              <Uppercase color=\"secondary\">{OfflineServiceLabel}</Uppercase>\r\n              <QuickSearchSeeAll>\r\n                <Button\r\n                  variant=\"text\"\r\n                  size=\"small\"\r\n                  endIcon={<Icon icon=\"chevron-double-right\" />}\r\n                  onClick={() =>\r\n                    onAllAssetsClick(ServiceType.Offline, searchTerm)\r\n                  }\r\n                >\r\n                  {t(translations.FullResults)}\r\n                </Button>\r\n              </QuickSearchSeeAll>\r\n            </QuickSearchSectionTitle>\r\n            <QuickSearchRecentItems>\r\n              <React.Fragment>\r\n                {offlineState?.Results?.map((item, index) => (\r\n                  <AssetListItem key={index} item={item} isMobile={isMobile} />\r\n                ))}\r\n              </React.Fragment>\r\n            </QuickSearchRecentItems>\r\n          </QuickSearchSection>\r\n        )}\r\n\r\n        {showRequests && (\r\n          <QuickSearchSection>\r\n            <QuickSearchSectionTitle>\r\n              <Uppercase color=\"secondary\">{RequestServiceLabel}</Uppercase>\r\n              <QuickSearchSeeAll>\r\n                <Button\r\n                  variant=\"text\"\r\n                  size=\"small\"\r\n                  endIcon={<Icon icon=\"chevron-double-right\" />}\r\n                  onClick={() =>\r\n                    onAllAssetsClick(ServiceType.Sample, searchTerm)\r\n                  }\r\n                >\r\n                  {t(translations.FullResults)}\r\n                </Button>\r\n              </QuickSearchSeeAll>\r\n            </QuickSearchSectionTitle>\r\n            <QuickSearchRecentItems>\r\n              <React.Fragment>\r\n                {requestState?.Results?.map((item, index) => (\r\n                  <AssetListItem key={index} item={item} isMobile={isMobile} />\r\n                ))}\r\n              </React.Fragment>\r\n            </QuickSearchRecentItems>\r\n          </QuickSearchSection>\r\n        )}\r\n        {!!menuItemsState && (\r\n          <QuickSearchSection>\r\n            <MenuSearchResultList />\r\n          </QuickSearchSection>\r\n        )}\r\n      </React.Fragment>\r\n    </>\r\n  );\r\n}\r\n","/**\r\n *\r\n * AssetQuickSearch\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  ClickAwayListener,\r\n  createStyles,\r\n  Fade,\r\n  List,\r\n  makeStyles,\r\n  Paper,\r\n  Popper,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { useAssetQuickSearchSlice } from './slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAssetQuickSearch,\r\n  selectOpen,\r\n  selectSearchTerm,\r\n} from './slice/selectors';\r\nimport { RecentAssetsList } from './RecentAssetsList';\r\nimport { RecentSearchTermsList } from './RecentSearchTermsList';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { TextControlField } from '../BasicInputs/TextControlField';\r\nimport { useRef } from 'react';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useEffect } from 'react';\r\nimport { IconButton } from '../BasicButtons/IconButton';\r\nimport { Icon } from '../BasicIcons/FontAwesome';\r\nimport { Body } from '../Typography';\r\nimport useGlobalDOMEvents from 'app/hooks/useGlobalDomEvents';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { box_shadow_s } from 'styles/shadows/bookitShadow';\r\nimport { BasicToggle } from '../BasicToggle';\r\nimport { AssetSearchResultsByType } from './AssetSearchResultsByType';\r\nimport {\r\n  QuickSearchAllInstrumentsSection,\r\n  QuickSearchMainTitleSection,\r\n} from './RecentWrappers/wrappers';\r\nimport { Button } from '../BasicButtons/Button';\r\nimport { AssetsSelectionProps } from 'app/pages/MyAssetsPage/AssetsSelection/AssetsSelection';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectShowAllCores,\r\n} from 'app/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport clsx from 'clsx';\r\n\r\nexport interface AssetQuickSearchProps {\r\n  showInSideBar?: boolean;\r\n}\r\n\r\nexport const AssetQuickSearch = React.memo(function AssetQuickSearch(\r\n  props: AssetQuickSearchProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAssetQuickSearchSlice();\r\n  const { actions: appSettingsAction } = useAppSettingsSlice();\r\n  const open = useSelector(selectOpen);\r\n  const isMobile = DetectIsMobile();\r\n  const searchAllCores = useSelector(selectShowAllCores);\r\n  const searchTerm = useSelector(selectSearchTerm);\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const handleInputChange = e => {\r\n    if (!open) {\r\n      dispatch(actions.setOpen(true));\r\n    }\r\n    dispatch(actions.searchAllAssets(e.target.value));\r\n  };\r\n  const state = useSelector(selectAssetQuickSearch);\r\n  const elementRef = useRef<HTMLDivElement>(null);\r\n\r\n  const handleClick = event => {\r\n    dispatch(actions.setOpen(true));\r\n  };\r\n\r\n  const handleSearchAllCores = (value: boolean) => {\r\n    dispatch(appSettingsAction.setShowAllCores(value));\r\n    if (!!searchTerm && searchTerm !== '') {\r\n      dispatch(actions.searchAllAssets(searchTerm));\r\n    } else {\r\n      dispatch(actions.getRecentSearchTerms());\r\n      dispatch(actions.getRecentAssets());\r\n    }\r\n  };\r\n\r\n  const handleClose = () => {\r\n    if (open) {\r\n      dispatch(actions.setOpen(false));\r\n    }\r\n  };\r\n  const handleHideAssetQuickSearchClick = () => {\r\n    dispatch(actions.showSearchInput(false));\r\n  };\r\n  const handleOpenAssets = (serviceTypeId?: number, searchTerm?: string) => {\r\n    let selParams = {\r\n      useSidePanel: true,\r\n      actionType: 'AssetSearch',\r\n      serviceTypeId: serviceTypeId,\r\n      searchTerm: searchTerm,\r\n      //offTypeIds: services,\r\n    } as AssetsSelectionProps;\r\n    if (isMobile) {\r\n      dispatch(\r\n        appSettingsAction.navigate(\r\n          `/AssetSearch?${toQueryString({\r\n            actionType: 'AssetSearch',\r\n            serviceTypeId: serviceTypeId,\r\n            searchTerm: searchTerm,\r\n          })}`,\r\n        ),\r\n      );\r\n    } else {\r\n      dispatch(\r\n        layoutActions.openSidePanel({\r\n          type: RenderPageType.AssetsSelection,\r\n          props: selParams,\r\n          expanded: true,\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  // manually trigger rerender using a useless usState hook\r\n  // this ensures that the popper is rendered only after the div is rendered and have provided the elementRef value to ancor the popper\r\n  const countState = React.useState(0);\r\n  useEffect(() => {\r\n    countState[1](c => c + 1);\r\n    // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [elementRef.current]);\r\n  useGlobalDOMEvents({\r\n    keyup(ev) {\r\n      if ((ev as KeyboardEvent).key === 'Escape') {\r\n        dispatch(actions.setOpen(false));\r\n      }\r\n    },\r\n  });\r\n\r\n  return (\r\n    <ClickAwayListener onClickAway={() => handleClose()}>\r\n      <form\r\n        action={toRootedURL('/AssetSearch', {\r\n          actionType: 'AssetSearch',\r\n          searchTerm: searchTerm,\r\n        })}\r\n        style={props.showInSideBar ? { width: '100%' } : undefined}\r\n        method=\"get\"\r\n      >\r\n        <div className={classes.search} ref={elementRef}>\r\n          {isMobile && (\r\n            <IconButton\r\n              onClick={() => handleHideAssetQuickSearchClick()}\r\n              title={t(translations.Close)}\r\n              variant=\"ghost\"\r\n              shape=\"square\"\r\n              size=\"small\"\r\n            >\r\n              <Icon icon=\"times\" />\r\n            </IconButton>\r\n          )}\r\n          <TextControlField\r\n            name=\"q\"\r\n            placeholder={t(translations.SearchAnAssets)}\r\n            onChange={e => handleInputChange(e)}\r\n            onFocus={e => handleClick(e)}\r\n            onClick={e => handleClick(e)}\r\n            autoFocus={false}\r\n            size=\"small\"\r\n            value={state.searchTerm || ''}\r\n            classes={{\r\n              root: props.showInSideBar\r\n                ? classes.inputRootMobile\r\n                : classes.inputRoot,\r\n            }}\r\n            autoComplete=\"off\"\r\n            aria-label=\"search\"\r\n            inputProps={{ 'aria-label': 'search' }}\r\n            endIcon={<FontAwesomeIcon icon=\"search\" />}\r\n            fullWidth\r\n          />\r\n          {elementRef.current !== null && (\r\n            <Popper\r\n              open={open}\r\n              anchorEl={elementRef.current}\r\n              className={clsx(classes.popper, { isMobile: isMobile })}\r\n              placement={'bottom-start'}\r\n              transition\r\n              disablePortal={!isMobile}\r\n              modifiers={{\r\n                keepTogether: { enabled: true },\r\n                flip: { enabled: false },\r\n                preventOverflow: {\r\n                  enabled: false,\r\n                  boundariesElement: 'viewport',\r\n                },\r\n                offset: {\r\n                  offset: '-15,0',\r\n                },\r\n              }}\r\n            >\r\n              {({ TransitionProps }) => (\r\n                <Fade {...TransitionProps} timeout={333}>\r\n                  <Paper\r\n                    className={clsx(classes.paper, { isMobile: isMobile })}\r\n                  >\r\n                    <QuickSearchMainTitleSection>\r\n                      <Body size=\"large\" bold style={{ flex: '1 0 0' }}>\r\n                        {isMobile\r\n                          ? t(translations.AssetsSearch)\r\n                          : t(translations.InstrumentAssetSearch)}\r\n                      </Body>\r\n                      <BasicToggle\r\n                        label={t(translations.SearchAllCores)}\r\n                        checked={searchAllCores}\r\n                        onChange={(value, event) => handleSearchAllCores(value)}\r\n                      />\r\n                    </QuickSearchMainTitleSection>\r\n                    {state.searchTerm !== undefined &&\r\n                    state.searchTerm?.length > 0 ? (\r\n                      <List\r\n                        component=\"div\"\r\n                        disablePadding\r\n                        style={{\r\n                          width: '100%',\r\n                          maxHeight: '85vh',\r\n                          overflowY: 'auto',\r\n                        }}\r\n                        dense={true}\r\n                      >\r\n                        <AssetSearchResultsByType\r\n                          onAllAssetsClick={(serviceType, searchTerm) => {\r\n                            handleOpenAssets(serviceType, searchTerm);\r\n                            handleClose();\r\n                          }}\r\n                          selectedServiceGroups={selectedServiceGroups}\r\n                          isMobile={isMobile}\r\n                        />\r\n                      </List>\r\n                    ) : (\r\n                      <List\r\n                        dense={true}\r\n                        disablePadding\r\n                        style={{ overflowY: 'auto', width: '100%' }}\r\n                      >\r\n                        <RecentSearchTermsList\r\n                          onClick={searchTerm => {\r\n                            handleOpenAssets(undefined, searchTerm);\r\n                            handleClose();\r\n                          }}\r\n                        />\r\n                        {/* <ListItemLink href={toRootedURL('/assets/')}>\r\n                            <ListItemIcon>\r\n                              <FontAwesomeIcon icon=\"search\" />\r\n                            </ListItemIcon>\r\n                            <ListItemText>\r\n                              <Body bold={true}>\r\n                                {t(translations.AdvancedAssetSearch)}\r\n                              </Body>\r\n                            </ListItemText>\r\n                            <ListItemSecondaryAction>\r\n                              <IconButton\r\n                                onClick={() => handleClose()}\r\n                                title={t(translations.Close)}\r\n                                variant=\"ghost\"\r\n                                shape=\"square\"\r\n                                aria-label=\"close\"\r\n                                size=\"small\"\r\n                              >\r\n                                <Icon icon=\"times\" />\r\n                              </IconButton>\r\n                            </ListItemSecondaryAction>\r\n                          </ListItemLink> */}\r\n                        {/* <Divider component=\"li\" /> */}\r\n                        <RecentAssetsList\r\n                          isMobile={isMobile}\r\n                          selectedServiceGroups={selectedServiceGroups}\r\n                        />\r\n                        <QuickSearchAllInstrumentsSection>\r\n                          <Button\r\n                            variant=\"text\"\r\n                            onClick={() => {\r\n                              handleOpenAssets();\r\n                              handleClose();\r\n                            }}\r\n                          >\r\n                            {t(translations.SeeAllInstruments)}\r\n                          </Button>\r\n                        </QuickSearchAllInstrumentsSection>\r\n                      </List>\r\n                    )}\r\n                  </Paper>\r\n                </Fade>\r\n              )}\r\n            </Popper>\r\n          )}\r\n        </div>\r\n      </form>\r\n    </ClickAwayListener>\r\n  );\r\n});\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      // root css\r\n    },\r\n    menuButton: {\r\n      marginRight: theme.spacing(2),\r\n    },\r\n    title: {\r\n      flexGrow: 1,\r\n      display: 'none',\r\n      [theme.breakpoints.up('sm')]: {\r\n        display: 'block',\r\n      },\r\n    },\r\n    search: {\r\n      position: 'relative',\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      borderRadius: theme.shape.borderRadius,\r\n      //  backgroundColor: alpha(theme.palette.common.white, 0.15),\r\n      // '&:hover': {\r\n      //   backgroundColor: alpha(theme.palette.common.white, 0.25),\r\n      // },\r\n      marginLeft: 0,\r\n      [theme.breakpoints.up('sm')]: {\r\n        width: 355,\r\n      },\r\n      [theme.breakpoints.up('lg')]: {\r\n        width: 463,\r\n      },\r\n      paddingTop: 2,\r\n      paddingBottom: 2,\r\n      gap: 8,\r\n      // [theme.breakpoints.up('sm')]: {\r\n      //   marginLeft: theme.spacing(1),\r\n      //   width: 'auto',\r\n      // },\r\n    },\r\n    searchIcon: {\r\n      padding: theme.spacing(0, 2),\r\n      height: '100%',\r\n      position: 'absolute',\r\n      pointerEvents: 'none',\r\n      display: 'flex',\r\n      alignItems: 'center',\r\n      justifyContent: 'center',\r\n    },\r\n    inputRoot: {\r\n      color: 'inherit',\r\n      flexGrow: 1,\r\n    },\r\n    inputRootMobile: {\r\n      color: 'inherit',\r\n      flexGrow: 1,\r\n      flexShrink: 1,\r\n    },\r\n    inputInput: {\r\n      padding: theme.spacing(1, 1, 1, 0),\r\n      // vertical padding + font size from searchIcon\r\n      paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,\r\n      transition: theme.transitions.create('width'),\r\n      width: '100%',\r\n      [theme.breakpoints.up('sm')]: {\r\n        width: '30ch',\r\n        '&:focus': {\r\n          width: '50ch',\r\n        },\r\n      },\r\n    },\r\n    popper: {\r\n      // +1 from the appBar (zIndex: theme.zIndex.drawer + 1)\r\n      zIndex: theme.zIndex.drawer + 2,\r\n      '&.isMobile': {\r\n        zIndex: theme.zIndex.modal + 2,\r\n        height: 'calc(100% - 92px)',\r\n      },\r\n\r\n      [theme.breakpoints.up('lg')]: {\r\n        width: 700,\r\n      },\r\n      [theme.breakpoints.down('lg')]: {\r\n        width: 600,\r\n      },\r\n      [theme.breakpoints.down('sm')]: {\r\n        width: '100%',\r\n      },\r\n    },\r\n    paper: {\r\n      display: 'flex',\r\n      width: '672px',\r\n      padding: '16px 12px',\r\n      flexDirection: 'column',\r\n      alignItems: 'flex-start',\r\n      gap: '24px',\r\n\r\n      borderRadius: '12px',\r\n      border: `1px solid ${bookitColors.grayscale.graySelection}`,\r\n      background: bookitColors.base.white,\r\n      /* Shadow/box-shadow-s */\r\n      boxShadow: box_shadow_s,\r\n      '&.isMobile': {\r\n        width: '100%',\r\n        height: '100%',\r\n      },\r\n    },\r\n    paperTitleSection: {},\r\n  }),\r\n);\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n  userDetails: () => _t(translations.UserDetails),\r\n  changePassword: () => _t(translations.reg_ChangePassword),\r\n  changeUserGroup: () => _t(translations.changeUserGroup),\r\n  logout: () => _t(translations.main_master_LogOutLinkText),\r\n  help: () => _t(translations.Help),\r\n  optOutNotifications: () => _t(translations.OptOutNotifications),\r\n  optOutNotificationsTitle: () => _t(translations.OptOutNotifications_info),\r\n  coreRegistration: () => _t(translations.ServiceGroupRegistration),\r\n  googleCalendar: () => _t(translations.menu_GoogleCalendar),\r\n  outlookCalendar: () => _t(translations.menu_OutlookCalendar),\r\n  notifications: () => _t(translations.Notifications),\r\n};\r\n","import { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport * as React from 'react';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface UserMenuButtonProps extends ButtonProps {\r\n  children: React.ReactNode;\r\n  open: boolean;\r\n  isMobile?: boolean;\r\n}\r\n\r\nexport default function UserMenuButton(props: UserMenuButtonProps) {\r\n  const { children, isMobile, open, ...other } = props;\r\n  return isMobile ? (\r\n    <IconButton disableRipple variant=\"ghost\" size=\"small\" {...other}>\r\n      {children}\r\n    </IconButton>\r\n  ) : (\r\n    <Button\r\n      disableRipple\r\n      variant=\"ghost\"\r\n      color=\"default\"\r\n      size=\"small\"\r\n      endIcon={<Icon icon={open ? 'chevron-up' : 'chevron-down'} />}\r\n      startIcon={\r\n        <Icon\r\n          icon=\"user-circle\"\r\n          style={{\r\n            width: 20,\r\n            height: 20,\r\n            fontSize: 20,\r\n            color: bookitColors.grayscale.graySubtitles,\r\n          }}\r\n        />\r\n      }\r\n      {...other}\r\n    >\r\n      {children}\r\n    </Button>\r\n  );\r\n}\r\n","import {\r\n  MenuItem,\r\n  Divider,\r\n  ListItemIcon,\r\n  ListItemText,\r\n} from '@material-ui/core';\r\n\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { messages } from '../messages';\r\nimport UserMenuButton from './UserMenuButton';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { translations } from 'locales/translations';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { StyledUserMenu } from '../../styled';\r\nimport { BasicToggle } from 'app/components/BasicToggle';\r\nimport { isInRole } from 'types/AuthenticatedUser';\r\nimport { Roles } from 'app/slice/types';\r\n\r\nexport interface UserMenuProps {}\r\n\r\nexport function UserMenu(props: UserMenuProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const [open, setOpen] = React.useState(false);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const googleCalendarModuleEnabled = IsModuleEnabled(\r\n    appSettings,\r\n    KnownModules.GoogleCalendar,\r\n  );\r\n  const multipleAdGroupsModuleEnabled = IsModuleEnabled(\r\n    appSettings,\r\n    KnownModules.MultipleAdGroups,\r\n  );\r\n  const serviceGroupRegistrationModuleEnabled = IsModuleEnabled(\r\n    appSettings,\r\n    KnownModules.ServiceGroupRegistration,\r\n  );\r\n  const isAdmin =\r\n    isInRole(authenticatedUser, Roles.Administrators) ||\r\n    isInRole(authenticatedUser, Roles.GroupAdministrators);\r\n  const googleCalendar = googleCalendarModuleEnabled; // && authenticatedUser?.CalendarType === 0;\r\n  const outlookCalendar = googleCalendarModuleEnabled; // && authenticatedUser?.CalendarType === 1;\r\n  const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\r\n  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n    setAnchorEl(event.currentTarget);\r\n    setOpen(true);\r\n  };\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n    setOpen(false);\r\n  };\r\n  const Opt_Out = settings.GetBooleanByKey(AllowedSettings.AllowUsersToOpt_Out);\r\n  const theme = useTheme();\r\n  return (\r\n    <React.Fragment>\r\n      <UserMenuButton\r\n        aria-controls=\"user-profile-menu\"\r\n        aria-haspopup=\"true\"\r\n        onClick={event => handleClick(event)}\r\n        open={open}\r\n        isMobile={isMobile}\r\n      >\r\n        {isMobile && (\r\n          <Icon\r\n            icon=\"user-circle\"\r\n            style={{\r\n              width: 20,\r\n              height: 20,\r\n              fontSize: 20,\r\n              color: bookitColors.grayscale.graySubtitles,\r\n            }}\r\n          />\r\n        )}\r\n        {!isMobile && authenticatedUser?.DisplayName}\r\n      </UserMenuButton>\r\n      <StyledUserMenu\r\n        theme={theme}\r\n        marginThreshold={1}\r\n        id=\"user-profile-menu\"\r\n        anchorEl={anchorEl}\r\n        getContentAnchorEl={null}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'right',\r\n        }}\r\n        transformOrigin={{\r\n          vertical: 'top',\r\n          horizontal: isMobile ? 'right' : 'center',\r\n        }}\r\n        open={Boolean(anchorEl)}\r\n        PaperProps={\r\n          isMobile\r\n            ? {\r\n                style: {\r\n                  width: '100%',\r\n                  height: '100%',\r\n                  maxHeight: 'calc(100% - 32px)',\r\n                  maxWidth: 'calc(100% - 0px)',\r\n                },\r\n              }\r\n            : undefined\r\n        }\r\n        onClose={() => handleClose()}\r\n      >\r\n        {isMobile && (\r\n          <MenuItem dense onClick={() => handleClose()}>\r\n            <ListItemIcon>\r\n              <Icon icon=\"times\" color=\"default\" colorExtend=\"textHover\" />\r\n            </ListItemIcon>\r\n            <ListItemText>\r\n              <Body bold={true}>{authenticatedUser?.DisplayName}</Body>\r\n            </ListItemText>\r\n          </MenuItem>\r\n        )}\r\n        {isMobile && <Divider />}\r\n        <MenuItem\r\n          component={'a'}\r\n          href={toRootedURL(`/UserProfile.aspx?id=${authenticatedUser?.Id}`)}\r\n          target={'_blank'}\r\n          onClick={() => handleClose()}\r\n        >\r\n          <ListItemIcon>\r\n            <Icon icon=\"pencil\" color=\"default\" colorExtend=\"textHover\" />\r\n          </ListItemIcon>\r\n          <ListItemText>{t(messages.userDetails())}</ListItemText>\r\n        </MenuItem>\r\n        {googleCalendar && (\r\n          <MenuItem\r\n            component={'a'}\r\n            target={'_blank'}\r\n            href={toRootedURL('/GoogleCalendarLog.aspx')}\r\n            onClick={() => handleClose()}\r\n          >\r\n            <ListItemIcon>\r\n              <Icon\r\n                icon={['fab', 'google']}\r\n                color=\"default\"\r\n                colorExtend=\"textHover\"\r\n              />\r\n            </ListItemIcon>\r\n            <ListItemText>{t(messages.googleCalendar())}</ListItemText>\r\n          </MenuItem>\r\n        )}\r\n        {outlookCalendar && (\r\n          <MenuItem\r\n            component={'a'}\r\n            href={toRootedURL('/OutlookCalendarLog.aspx')}\r\n            target={'_blank'}\r\n            onClick={() => handleClose()}\r\n          >\r\n            <ListItemIcon>\r\n              <Icon\r\n                icon={['fab', 'windows']}\r\n                color=\"default\"\r\n                colorExtend=\"textHover\"\r\n              />\r\n            </ListItemIcon>\r\n            <ListItemText>{t(messages.outlookCalendar())}</ListItemText>\r\n          </MenuItem>\r\n        )}\r\n        <MenuItem\r\n          component={'a'}\r\n          href={toRootedURL('ChangePassword.aspx')}\r\n          target={'_blank'}\r\n          onClick={() => handleClose()}\r\n        >\r\n          <ListItemIcon>\r\n            <Icon icon=\"lock\" color=\"default\" colorExtend=\"textHover\" />\r\n          </ListItemIcon>\r\n          <ListItemText>{t(messages.changePassword())}</ListItemText>\r\n        </MenuItem>\r\n        <MenuItem\r\n          onClick={() => handleClose()}\r\n          component={'a'}\r\n          href={toRootedURL('/ActiveUserGroup/shrink')}\r\n          disabled={\r\n            !(\r\n              (authenticatedUser?.UserGroups?.length || 1) > 1 &&\r\n              multipleAdGroupsModuleEnabled\r\n            )\r\n          }\r\n        >\r\n          <ListItemIcon>\r\n            <Icon icon=\"users\" color=\"default\" colorExtend=\"textHover\" />\r\n          </ListItemIcon>\r\n          <ListItemText\r\n            primary={\r\n              <Tooltip\r\n                title={\r\n                  (authenticatedUser?.UserGroups?.length || 1) > 1 &&\r\n                  multipleAdGroupsModuleEnabled\r\n                    ? //t(messages.changeUserGroup()) +\r\n                      t(translations.SwitchFromToAnotherUserGroup).replace(\r\n                        '{0}',\r\n                        (authenticatedUser?.ActiveUserGroup?.Name as string) ??\r\n                          (authenticatedUser?.ActiveUserGroup?.Id as string),\r\n                      )\r\n                    : authenticatedUser?.ActiveUserGroup?.Name ??\r\n                      authenticatedUser?.ActiveUserGroup?.Id\r\n                }\r\n              >\r\n                <span>\r\n                  {(authenticatedUser?.UserGroups?.length || 1) > 1 &&\r\n                  multipleAdGroupsModuleEnabled\r\n                    ? //t(messages.changeUserGroup()) +\r\n                      t(translations.SwitchFrom).replace(\r\n                        '{0}',\r\n                        (authenticatedUser?.ActiveUserGroup?.Name as string) ??\r\n                          (authenticatedUser?.ActiveUserGroup?.Id as string),\r\n                      )\r\n                    : authenticatedUser?.ActiveUserGroup?.Name ??\r\n                      authenticatedUser?.ActiveUserGroup?.Id}\r\n                </span>\r\n              </Tooltip>\r\n            }\r\n          ></ListItemText>\r\n        </MenuItem>\r\n        {Opt_Out && (\r\n          <MenuItem onClick={() => handleClose()}>\r\n            <BasicToggle\r\n              name=\"check_optout\"\r\n              label={t(messages.optOutNotifications())}\r\n              info={<>t(messages.optOutNotificationsTitle())</>}\r\n            />\r\n          </MenuItem>\r\n        )}\r\n        {(authenticatedUser?.HasRegisterableServiceGroups || false) &&\r\n          serviceGroupRegistrationModuleEnabled && (\r\n            <MenuItem\r\n              onClick={() => handleClose()}\r\n              component={'a'}\r\n              href={toRootedURL('/ServiceGroupRegistrations.aspx')}\r\n              target={'_blank'}\r\n            >\r\n              <ListItemIcon>\r\n                <Icon\r\n                  icon=\"layer-group\"\r\n                  color=\"default\"\r\n                  colorExtend=\"textHover\"\r\n                />\r\n              </ListItemIcon>\r\n              <ListItemText>{t(messages.coreRegistration())}</ListItemText>\r\n            </MenuItem>\r\n          )}\r\n        <MenuItem\r\n          onClick={() => handleClose()}\r\n          component={'a'}\r\n          href={toRootedURL('/NotificationSettings.aspx')}\r\n          target={'_blank'}\r\n        >\r\n          <ListItemIcon>\r\n            <Icon\r\n              icon={authenticatedUser?.HasNotifications ? 'bell' : 'bell-slash'}\r\n              color=\"default\"\r\n              colorExtend=\"textHover\"\r\n            />\r\n          </ListItemIcon>\r\n          <ListItemText>{t(messages.notifications())}</ListItemText>\r\n        </MenuItem>\r\n\r\n        <MenuItem\r\n          onClick={() => handleClose()}\r\n          component={'a'}\r\n          href={\r\n            isAdmin\r\n              ? toRootedURL('/Admin/default.aspx')\r\n              : toRootedURL('/help.aspx')\r\n          }\r\n          target={'_blank'}\r\n        >\r\n          <ListItemIcon>\r\n            <Icon\r\n              icon=\"question-circle\"\r\n              color=\"default\"\r\n              colorExtend=\"textHover\"\r\n            />\r\n          </ListItemIcon>\r\n          <ListItemText>{t(messages.help())}</ListItemText>\r\n        </MenuItem>\r\n        <MenuItem\r\n          onClick={() => handleClose()}\r\n          component={'a'}\r\n          href={toRootedURL('/account/signout')}\r\n        >\r\n          <ListItemIcon>\r\n            <Icon icon=\"sign-out-alt\" color=\"default\" colorExtend=\"textHover\" />\r\n          </ListItemIcon>\r\n          <ListItemText>{t(messages.logout())}</ListItemText>\r\n        </MenuItem>\r\n      </StyledUserMenu>\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport * as React from 'react';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { MenuItem } from '@material-ui/core';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\r\nimport { translations } from 'locales/translations';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface SwitchSitesProps {}\r\n\r\nexport function SwitchSites(props: SwitchSitesProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n  const allowToSwitchToOtherSites = settings.GetBooleanByKey(\r\n    AllowedSettings.AllowToSwitchToOtherSites,\r\n  );\r\n  const externalTitleOne = settings.GetNullableByKey(\r\n    AllowedSettings.ExternalSwitchTitle1,\r\n  );\r\n  const externalUrlOne = settings.GetNullableByKey(\r\n    AllowedSettings.ExternalSwitchUrl1,\r\n  );\r\n  const externalTitleTwo = settings.GetNullableByKey(\r\n    AllowedSettings.ExternalSwitchTitle2,\r\n  );\r\n  const externalUrlTwo = settings.GetNullableByKey(\r\n    AllowedSettings.ExternalSwitchUrl2,\r\n  );\r\n  const externalSitesIcon = settings.GetNullableByKey(\r\n    AllowedSettings.ExternalSitesIcon,\r\n  );\r\n  const buttonIcon = React.useMemo(() => {\r\n    if (externalSitesIcon !== null) {\r\n      if (externalSitesIcon.indexOf('globe-europe') !== -1) {\r\n        return 'earth-europe' as IconProp;\r\n      } else if (externalSitesIcon.indexOf(' fa-') !== -1) {\r\n        let tmpIcon = externalSitesIcon.substring(\r\n          externalSitesIcon.indexOf(' fa-') + 4,\r\n          externalSitesIcon.length,\r\n        );\r\n        return tmpIcon as IconProp;\r\n      } else {\r\n        return 'earth-europe' as IconProp;\r\n      }\r\n    } else {\r\n      return 'earth-europe' as IconProp;\r\n    }\r\n  }, [externalSitesIcon]);\r\n  const hasExternalOne = React.useMemo(() => {\r\n    return !(\r\n      isEmptyOrWhitespace(externalTitleOne) ||\r\n      isEmptyOrWhitespace(externalUrlOne)\r\n    );\r\n  }, [externalTitleOne, externalUrlOne]);\r\n  const hasExternalTwo = React.useMemo(() => {\r\n    return !(\r\n      isEmptyOrWhitespace(externalTitleTwo) ||\r\n      isEmptyOrWhitespace(externalUrlTwo)\r\n    );\r\n  }, [externalTitleTwo, externalUrlTwo]);\r\n  const useExternalLinks = React.useMemo(() => {\r\n    return (\r\n      allowToSwitchToOtherSites &&\r\n      (hasExternalOne || hasExternalTwo) &&\r\n      authenticatedUser?.IsActiveDirectory\r\n    );\r\n  }, [\r\n    allowToSwitchToOtherSites,\r\n    authenticatedUser?.IsActiveDirectory,\r\n    hasExternalOne,\r\n    hasExternalTwo,\r\n  ]);\r\n  const items: React.ReactNode[] = React.useMemo(() => {\r\n    let actions: React.ReactNode[] = [];\r\n    if (hasExternalOne && externalUrlOne !== null) {\r\n      actions.push(\r\n        <MenuItem\r\n          component={'a'}\r\n          key={'firstExternal'}\r\n          href={toRootedURL(externalUrlOne)}\r\n        >\r\n          {externalTitleOne}\r\n        </MenuItem>,\r\n      );\r\n    }\r\n    if (hasExternalTwo && externalUrlTwo !== null) {\r\n      actions.push(\r\n        <MenuItem\r\n          component={'a'}\r\n          key={'secondExternal'}\r\n          href={toRootedURL(externalUrlTwo)}\r\n        >\r\n          {externalTitleTwo}\r\n        </MenuItem>,\r\n      );\r\n    }\r\n    return actions;\r\n  }, [\r\n    externalTitleOne,\r\n    externalTitleTwo,\r\n    externalUrlOne,\r\n    externalUrlTwo,\r\n    hasExternalOne,\r\n    hasExternalTwo,\r\n  ]);\r\n  return useExternalLinks ? (\r\n    <DropDown\r\n      size=\"small\"\r\n      color=\"primary\"\r\n      variant=\"ghost\"\r\n      style={{ padding: '4px 4px' }}\r\n      title={t(translations.SwitchToOtherSites)}\r\n      menuChildren={() => items}\r\n      iconButton={isMobile}\r\n      menuProps={{\r\n        anchorOrigin: {\r\n          vertical: 'bottom',\r\n          horizontal: 'left',\r\n        },\r\n        transformOrigin: {\r\n          vertical: 'top',\r\n          horizontal: 'left',\r\n        },\r\n        getContentAnchorEl: null,\r\n      }}\r\n    >\r\n      <Icon\r\n        icon={buttonIcon}\r\n        style={{\r\n          width: 20,\r\n          height: 20,\r\n          fontSize: 20,\r\n          color: bookitColors.grayscale.graySubtitles,\r\n        }}\r\n      />\r\n    </DropDown>\r\n  ) : null;\r\n}\r\n","/**\r\n *\r\n * ProfileMenu\r\n *\r\n */\r\nimport React from 'react';\r\nimport { EventsCount } from './EventsCount';\r\nimport { AssetQuickSearch } from 'app/components/AssetQuickSearch';\r\nimport { UserMenu } from './UserMenu';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { ProfileSection } from '../styled';\r\nimport { SwitchSites } from './SwitchSites';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectShowGlobalServiceGroupFilter } from 'app/slice/selectors';\r\n\r\nexport const ProfileMenu = React.memo(function ProfileMenu() {\r\n  const theme = useTheme();\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n  return (\r\n    <ProfileSection theme={theme} className={'userProfile'}>\r\n      {!showGroups && <AssetQuickSearch />}\r\n      <EventsCount />\r\n      <SwitchSites />\r\n      <UserMenu />\r\n      {/* <div className={'mainMenu menuSearch'}>\r\n        <AssetQuickSearch />\r\n      </div> */}\r\n\r\n      {/* <div className={'mainMenu menuIcon'}>\r\n        \r\n      </div>\r\n\r\n      <div className={'mainMenu menuCores'}>\r\n        {/* <GlobalServiceGroupFilter useButtons /> \r\n        <CoreSelectionButton />\r\n      </div> */}\r\n\r\n      {/* <div className={'mainMenu userMenu'}>\r\n       \r\n      </div>\r\n      <div className={'mainMenu userMenu'}>\r\n       \r\n      </div> */}\r\n    </ProfileSection>\r\n  );\r\n});\r\n","import { IconProp } from 'app/AllIcons';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\n\r\nexport interface ToggleSideMenuButtonProps {\r\n  icon?: IconProp;\r\n}\r\nexport function ToggleSideMenuButton(props: ToggleSideMenuButtonProps) {\r\n  const { toggle } = useExpandedSideBarState();\r\n  const { icon } = props;\r\n  return (\r\n    <IconButton\r\n      variant=\"ghost\"\r\n      aria-label=\"open drawer\"\r\n      size={'small'}\r\n      onClick={() => {\r\n        toggle();\r\n      }}\r\n    >\r\n      <Icon icon={icon ?? 'chevrons-left'} />\r\n    </IconButton>\r\n  );\r\n}\r\n","/**\r\n *\r\n * TopToolbar\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { ToolbarProps } from '@material-ui/core/Toolbar';\r\nimport { CustomerLogo } from '../../CustomerLogo';\r\nimport { ProfileMenu } from '../ProfileMenu';\r\nimport styled from 'styled-components';\r\nimport { StyledToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar/styled';\r\nimport { useTheme } from '@material-ui/core/styles';\r\nimport { ToggleSideMenuButton } from '../components/ToggleSideMenuButton';\r\nimport clsx from 'clsx';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface TopToolbarProps extends ToolbarProps {}\r\nconst Separator = styled('div')`\r\n  flex-grow: 1;\r\n`;\r\nexport const TopToolbar = React.memo(function TopToolbar(\r\n  props: TopToolbarProps,\r\n) {\r\n  const isMobile = DetectIsMobile();\r\n\r\n  const expanded = useSelector(state =>\r\n    selectIsExpandedSideBar(state, isMobile),\r\n  );\r\n\r\n  const theme = useTheme();\r\n  return (\r\n    <React.Fragment>\r\n      <StyledToolbar\r\n        variant=\"dense\"\r\n        theme={theme}\r\n        className={clsx('toptoolbar', { isExpanded: expanded })}\r\n      >\r\n        <div className=\"titleSection\">\r\n          {/* <IconButton\r\n            variant=\"textGray\"\r\n            aria-label=\"open drawer\"\r\n            onClick={handleClick}\r\n          >\r\n            <Icon icon=\"bars\" size=\"xl\" />\r\n          </IconButton> */}\r\n          {!expanded && <ToggleSideMenuButton icon={'chevrons-right'} />}\r\n          <CustomerLogo />\r\n        </div>\r\n        {/* acts as a separator between visually left and right components of the side bar */}\r\n        <Separator />\r\n        <ProfileMenu />\r\n      </StyledToolbar>\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { Badge, styled } from '@material-ui/core';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface TopGroupButtonProps extends ButtonProps {\r\n  savedServiceGroups: Entity<number>[] | undefined;\r\n  firstServiceGroupName: string | undefined;\r\n  fullWidth?: boolean;\r\n}\r\n\r\nexport default function TopGroupButton(props: TopGroupButtonProps) {\r\n  const {\r\n    children,\r\n    savedServiceGroups,\r\n    firstServiceGroupName,\r\n    fullWidth,\r\n    ...other\r\n  } = props;\r\n  const { t } = useTranslation();\r\n  return (\r\n    <Button\r\n      disableRipple\r\n      variant=\"white\"\r\n      size=\"small\"\r\n      fullWidth={fullWidth}\r\n      {...other}\r\n    >\r\n      {savedServiceGroups === undefined || savedServiceGroups.length === 0 ? (\r\n        <React.Fragment>{t(translations.AllServiceGroups)}</React.Fragment>\r\n      ) : savedServiceGroups.length === 1 ? (\r\n        <TruncatedLabel>{firstServiceGroupName}</TruncatedLabel>\r\n      ) : (\r\n        <Badge\r\n          badgeContent={\r\n            savedServiceGroups !== undefined && savedServiceGroups?.length > 1\r\n              ? `+${savedServiceGroups?.length - 1}`\r\n              : undefined\r\n          }\r\n        >\r\n          <TruncatedLabel>{firstServiceGroupName}</TruncatedLabel>\r\n        </Badge>\r\n      )}\r\n    </Button>\r\n  );\r\n}\r\nconst TruncatedLabel = styled('span')({\r\n  width: '10ch',\r\n  display: 'inline-block',\r\n  overflow: 'hidden',\r\n  textOverflow: 'ellipsis',\r\n});\r\n","/**\r\n *\r\n * CoreDashboardMenu\r\n *\r\n */\r\nimport {\r\n  Avatar,\r\n  Box,\r\n  LinearProgress,\r\n  List,\r\n  ListItem,\r\n  ListItemIcon,\r\n  ListItemSecondaryAction,\r\n  ListItemText,\r\n  Paper,\r\n  Popover,\r\n} from '@material-ui/core';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\nimport { AssetThumbImage } from 'app/components/AssetThumbImage';\r\nimport { Body } from 'app/components/Typography';\r\nimport { RouterLink } from 'app/components/BasicLinks/RouterLink';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { initFiltersServiceGroupsData } from 'app/components/pickers/MultiSelectPickers/ServiceGroupsPicker';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectShowGlobalServiceGroupsAsList,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Entity } from 'types/common';\r\nimport { useListStyles, useStyles } from '../styles';\r\nimport TopGroupButton from '../TopGroupButton';\r\nimport cliTruncate from 'cli-truncate';\r\nexport interface CoreDashboardMenuProps {}\r\n\r\nexport function CoreDashboardMenu(props: CoreDashboardMenuProps) {\r\n  const [open, setOpen] = React.useState(false);\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupsAsList);\r\n  const [anchorEl, setAnchorEl] = React.useState(null);\r\n  const { checkIsMobile } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const history = useHistory();\r\n  const classes = useStyles({\r\n    isMobile,\r\n  })();\r\n  const ddlClasses = useListStyles({ isMobile })();\r\n  const [selectedServiceGroups, setSelectedServiceGroups] = React.useState<\r\n    Entity<number>[]\r\n  >(savedServiceGroups || []);\r\n  const [\r\n    availableServiceGroups,\r\n    setAvailableServiceGroups,\r\n  ] = useAsyncExtendedState<Entity<number>[]>([]);\r\n  const [availableLoading, setAvailableLoading] = React.useState<\r\n    boolean | undefined\r\n  >(undefined);\r\n  const [show, setShow] = React.useState<boolean>(false);\r\n  React.useEffect(() => {\r\n    setOpen(false);\r\n    setSelectedServiceGroups(savedServiceGroups || []);\r\n  }, [savedServiceGroups]);\r\n  React.useEffect(() => {\r\n    setShow(showGroups);\r\n  }, [showGroups]);\r\n  React.useEffect(() => {\r\n    let active = availableLoading === undefined && open;\r\n    if (active) {\r\n      setAvailableLoading(true);\r\n      initFiltersServiceGroupsData(`(CanRequestAccess eq false)`).then(data => {\r\n        setAvailableServiceGroups(data);\r\n        setAvailableLoading(false);\r\n      });\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [availableLoading, open, setAvailableServiceGroups]);\r\n  const handleClick = event => {\r\n    setAnchorEl(event.currentTarget);\r\n    setOpen(prev => !prev);\r\n  };\r\n  const handleSaveItemClick = (item: Entity<number>) => {\r\n    dispatch(actions.saveGlobalServiceGroupFilter([item]));\r\n    setOpen(false);\r\n    setAvailableServiceGroups([]);\r\n    setAvailableLoading(undefined);\r\n    history.push('/dashboards/core/' + item.Id);\r\n  };\r\n\r\n  const handleItemClick = (item: Entity<number>) => {\r\n    setSelectedServiceGroups([item]);\r\n    //history.push('/dashboards/core/' + item.Id);\r\n    // dispatch(actions.navigate({\r\n    //     search: '/dashboards/core/' + item.Id,\r\n    //   }));\r\n    dispatch(actions.saveGlobalServiceGroupFilter_Success([item]));\r\n    setOpen(false);\r\n    setAvailableServiceGroups([]);\r\n    setAvailableLoading(undefined);\r\n  };\r\n\r\n  const firstServiceGroupName = React.useMemo(() => {\r\n    return selectedServiceGroups.length > 0\r\n      ? selectedServiceGroups[0]?.Name\r\n      : undefined;\r\n  }, [selectedServiceGroups]);\r\n  return show ? (\r\n    <React.Fragment>\r\n      <TopGroupButton\r\n        savedServiceGroups={selectedServiceGroups}\r\n        firstServiceGroupName={firstServiceGroupName}\r\n        startIcon={\r\n          <Icon\r\n            icon=\"layer-group\"\r\n            color={\r\n              savedServiceGroups !== undefined && savedServiceGroups?.length > 0\r\n                ? 'primary'\r\n                : 'black'\r\n            }\r\n          />\r\n        }\r\n        endIcon={<Icon icon={open ? 'chevron-up' : 'chevron-down'} />}\r\n        onClick={handleClick}\r\n      />\r\n\r\n      <Popover\r\n        classes={{\r\n          paper: isMobile ? classes.popoverPaper : undefined,\r\n        }}\r\n        open={open}\r\n        marginThreshold={1}\r\n        anchorEl={anchorEl}\r\n        onClose={handleClick}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'right',\r\n        }}\r\n        PaperProps={{ classes: { root: classes.root } }}\r\n        transformOrigin={{\r\n          vertical: 'top',\r\n          horizontal: isMobile ? 'right' : 'center',\r\n        }}\r\n      >\r\n        <Paper classes={{ root: classes.paper }}>\r\n          <IconButton\r\n            variant=\"ghost\"\r\n            aria-label=\"close\"\r\n            shape=\"square\"\r\n            size=\"xs\"\r\n            style={{ position: 'absolute', right: 8, top: 8 }}\r\n            onClick={() => {\r\n              setOpen(false);\r\n            }}\r\n          >\r\n            <Icon icon=\"times\" />\r\n          </IconButton>\r\n          <Box className={classes.mainContentAndScroll}>\r\n            <Box className={classes.mainContent}>\r\n              <Box className={classes.searchAndHeader}>\r\n                <Body bold={true} size=\"small\">\r\n                  {t(translations.Dashboard_ServiceGroupSelection) as string}\r\n                </Body>\r\n              </Box>\r\n\r\n              <Box style={{ width: '100%', padding: '4px 4px 0px' }}>\r\n                {availableLoading && (\r\n                  <Box style={{ width: '100%' }}>\r\n                    <LinearProgress variant=\"query\" color=\"primary\" />\r\n                  </Box>\r\n                )}\r\n                <List>\r\n                  {availableServiceGroups.length > 0 &&\r\n                    availableServiceGroups.map(item => (\r\n                      <ListItem\r\n                        key={item.Id}\r\n                        component={RouterLink}\r\n                        to={`/dashboards/core/${item.Id}`}\r\n                        selected={\r\n                          selectedServiceGroups.find(f => f.Id === item.Id) !==\r\n                          undefined\r\n                        }\r\n                        className={ddlClasses.root}\r\n                        //   component={'a'}\r\n                        //   href={buildURL(`${publicUrl}dashboards/core/${item.Id}`, {})}\r\n                        button\r\n                        onClick={() => handleItemClick(item)}\r\n                      >\r\n                        <ListItemIcon>\r\n                          {(item as IServiceGroupDto).ImageName !== null ? (\r\n                            <AssetThumbImage\r\n                              imageName={(item as IServiceGroupDto).ImageName}\r\n                              maxSize={40}\r\n                            />\r\n                          ) : (\r\n                            <Avatar\r\n                              variant=\"square\"\r\n                              className={ddlClasses.avatar}\r\n                            >\r\n                              {'C'}\r\n                            </Avatar>\r\n                          )}\r\n                        </ListItemIcon>\r\n                        <ListItemText\r\n                          classes={{\r\n                            root: ddlClasses.listItemText,\r\n                            primary: ddlClasses.primary,\r\n                            secondary: ddlClasses.secondary,\r\n                          }}\r\n                          className={ddlClasses.listItemText}\r\n                        >\r\n                          {cliTruncate(item.Name, 16, { position: 'end' })}\r\n                        </ListItemText>\r\n                        <ListItemSecondaryAction>\r\n                          <Button\r\n                            variant=\"white\"\r\n                            size=\"small\"\r\n                            onClick={() => handleSaveItemClick(item)}\r\n                          >\r\n                            {\r\n                              t(\r\n                                translations.Dashboard_ServiceGroupSwith,\r\n                              ) as string\r\n                            }\r\n                          </Button>\r\n                        </ListItemSecondaryAction>\r\n                      </ListItem>\r\n                    ))}\r\n                </List>\r\n              </Box>\r\n            </Box>\r\n          </Box>\r\n        </Paper>\r\n      </Popover>\r\n    </React.Fragment>\r\n  ) : null;\r\n}\r\n","import { makeStyles, Theme, createStyles } from '@material-ui/core';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const useStyles = props =>\r\n  makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      root: {\r\n        '&::-webkit-scrollbar': {\r\n          width: '6px',\r\n        },\r\n        '&::-webkit-scrollbar-thumb': {\r\n          boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n          borderRadius: '6px',\r\n          backgroundColor: theme.palette.common.grayBorders,\r\n        },\r\n      },\r\n      paper: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        padding: 0,\r\n        gap: theme.spacing(2),\r\n        background: theme.palette.common.white,\r\n        boxShadow: 'unset', //'0px 4px 20px rgba(39, 51, 65, 0.2)',\r\n        borderRadius: theme.spacing(1),\r\n        width: props.isMobile ? 'auto' : '360px',\r\n        maxHeight: props.isMobile ? '100%' : '400px',\r\n      },\r\n      popoverPaper: {\r\n        width: '100%',\r\n        height: '100%',\r\n        maxHeight: 'calc(100% - 32px)',\r\n        maxWidth: 'calc(100% - 0px)',\r\n      },\r\n      mainContentAndScroll: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        padding: 0,\r\n        gap: theme.spacing(2.5),\r\n        //borderRadius: theme.spacing(1),\r\n        width: '100%',\r\n      },\r\n      mainContent: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        padding: theme.spacing(1),\r\n        gap: theme.spacing(1),\r\n        width: '100%',\r\n      },\r\n      searchAndHeader: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        gap: theme.spacing(1),\r\n        width: '100%',\r\n        padding: '4px 8px',\r\n      },\r\n      controlButtons: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        gap: theme.spacing(2),\r\n        width: '100%',\r\n      },\r\n      coresAndServices: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        padding: theme.spacing(2, 1, 0),\r\n        gap: theme.spacing(6),\r\n        width: '100%',\r\n      },\r\n      coreCheks: {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        alignItems: 'flex-start',\r\n        padding: 0,\r\n        flexWrap: 'wrap',\r\n        boxSizing: 'border-box',\r\n        // paddingBottom: '36px',\r\n        width: '100%',\r\n      },\r\n      check: {\r\n        flex: '1 1 49%',\r\n        display: 'flex',\r\n        gap: theme.spacing(2),\r\n      },\r\n      scrollPaddings: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        padding: theme.spacing(1, 0),\r\n        gap: theme.spacing(1.25),\r\n        width: '13px',\r\n      },\r\n      scroll: {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        alignItems: 'flex-start',\r\n        padding: '7px 3px 100px',\r\n        gap: theme.spacing(1.25),\r\n        background: theme.palette.common.white,\r\n        boxShadow: 'inset 1px 0px 0px #E3E8EF',\r\n        borderRadius: theme.spacing(0, 1, 1, 0),\r\n      },\r\n    }),\r\n  );\r\nexport const useListStyles = props =>\r\n  makeStyles((theme: Theme) =>\r\n    createStyles({\r\n      root: {\r\n        fontSize: '14px',\r\n        gap: 8,\r\n      },\r\n      listItemText: {\r\n        [theme.breakpoints.up('sm')]: {\r\n          display: 'flex',\r\n        },\r\n        [theme.breakpoints.down('sm')]: {\r\n          overflow: 'hidden',\r\n        },\r\n      },\r\n      primary: {\r\n        [theme.breakpoints.up('sm')]: {\r\n          flexGrow: 1,\r\n        },\r\n        display: 'inline-block',\r\n        maxWidth: '100%',\r\n        textOverflow: 'ellipsis',\r\n        whiteSpace: 'nowrap',\r\n        overflow: 'hidden',\r\n      },\r\n      avatar: {\r\n        color: theme.palette.getContrastText(\r\n          bookitColors.grayscale.grayBorders,\r\n        ),\r\n        backgroundColor: theme.palette.common.grayDividers,\r\n      },\r\n      secondary: {},\r\n    }),\r\n  );\r\n","import { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectShowGlobalServiceGroupFilter,\r\n  selectShowGlobalServiceGroupsAsList,\r\n} from 'app/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport * as React from 'react';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { CoreSelectionProps } from 'app/pages/CoreSelectionPage/CoreSelection';\r\nimport TopGroupButton from '../TopGroupButton';\r\nimport { Icon } from '../../BasicIcons/FontAwesome';\r\nimport { CoreDashboardMenu } from '../CoreDashboardButton';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface CoreSelectionButtonProps {}\r\nexport function CoreSelectionButton(props) {\r\n  const dispatch = useDispatch();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n  const showInlineGroups = useSelector(selectShowGlobalServiceGroupsAsList);\r\n\r\n  const { expandLocal } = useExpandedSideBarState();\r\n  const isMobile = DetectIsMobile();\r\n  const [show, setShow] = React.useState<boolean>(false);\r\n  React.useEffect(() => {\r\n    setShow(showGroups);\r\n  }, [showGroups]);\r\n\r\n  const handleClick = event => {\r\n    dispatch(\r\n      layoutActions.openSidePanel({\r\n        type: RenderPageType.CoreSelection,\r\n        props: { useSidePanel: true } as CoreSelectionProps,\r\n        expanded: !isMobile,\r\n      }),\r\n    );\r\n    expandLocal(false);\r\n  };\r\n\r\n  const firstServiceGroupName = React.useMemo(() => {\r\n    return savedServiceGroups !== undefined && savedServiceGroups?.length > 0\r\n      ? savedServiceGroups[0]?.Name\r\n      : undefined;\r\n  }, [savedServiceGroups]);\r\n\r\n  return show ? (\r\n    <TopGroupButton\r\n      savedServiceGroups={savedServiceGroups}\r\n      firstServiceGroupName={firstServiceGroupName}\r\n      fullWidth={isMobile}\r\n      id=\"topCoreFilterId\"\r\n      startIcon={\r\n        <Icon\r\n          icon=\"layer-group\"\r\n          color={\r\n            savedServiceGroups !== undefined && savedServiceGroups?.length > 0\r\n              ? 'primary'\r\n              : 'black'\r\n          }\r\n        />\r\n      }\r\n      endIcon={<Icon icon={'chevron-down'} />}\r\n      onClick={handleClick}\r\n    />\r\n  ) : showInlineGroups ? (\r\n    <CoreDashboardMenu />\r\n  ) : null;\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { CoreSelectionButton } from 'app/components/GlobalServiceGroupFilter/CoreSelectionButton';\r\nimport { AssetQuickSearch } from 'app/components/AssetQuickSearch';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsSubBarCollapsed,\r\n  selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { SubTopBar } from '../styled';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\n\r\nexport interface SubTopToolbarProps {}\r\n\r\nexport function SubTopToolbar(props: SubTopToolbarProps) {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useAppSettingsSlice();\r\n  const { t } = useTranslation();\r\n  const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const collapsedBar = useSelector(selectIsSubBarCollapsed);\r\n  const serviceGroupsCount = React.useMemo(() => {\r\n    return savedServiceGroups !== undefined && savedServiceGroups?.length > 1\r\n      ? `+${savedServiceGroups?.length - 1}`\r\n      : undefined;\r\n  }, [savedServiceGroups]);\r\n  const firstServiceGroupName = React.useMemo(() => {\r\n    return savedServiceGroups !== undefined && savedServiceGroups?.length > 0\r\n      ? savedServiceGroups[0]?.Name\r\n      : undefined;\r\n  }, [savedServiceGroups]);\r\n  const singleCore = React.useMemo(() => {\r\n    return savedServiceGroups !== undefined && savedServiceGroups?.length === 1;\r\n  }, [savedServiceGroups]);\r\n\r\n  const isAdminOfSingle = React.useMemo(() => {\r\n    return (\r\n      singleCore &&\r\n      !!savedServiceGroups &&\r\n      authenticatedUser?.HasAdminGroupPermissions(savedServiceGroups[0].Id)\r\n    );\r\n  }, [authenticatedUser, savedServiceGroups, singleCore]);\r\n\r\n  const handleCollapse = React.useCallback(() => {\r\n    dispatch(actions.collapseSubBar(!collapsedBar));\r\n  }, [actions, collapsedBar, dispatch]);\r\n  const theme = useTheme();\r\n\r\n  return showGroups ? (\r\n    <React.Fragment>\r\n      <IconButton\r\n        variant=\"gray\"\r\n        size=\"xs\"\r\n        aria-label=\"collapse\"\r\n        style={{\r\n          position: 'absolute',\r\n          top: 48,\r\n          right: '50%',\r\n          border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n          background: bookitColors.grayscale.graybgComponents,\r\n          borderRadius: '1000px',\r\n          width: !collapsedBar ? '24px' : 'auto',\r\n        }}\r\n        onClick={() => {\r\n          handleCollapse();\r\n        }}\r\n        shape=\"circle\"\r\n      >\r\n        <React.Fragment>\r\n          {collapsedBar && !!firstServiceGroupName && (\r\n            <React.Fragment>\r\n              <Icon\r\n                icon=\"magnifying-glass\"\r\n                style={{\r\n                  color: bookitColors.grayscale.graySubtitles,\r\n                  width: '10px',\r\n                  height: '10px',\r\n                }}\r\n              />\r\n              {`${firstServiceGroupName} ${serviceGroupsCount ?? ''}`}\r\n            </React.Fragment>\r\n          )}\r\n          <Icon\r\n            icon={collapsedBar ? 'chevron-down' : 'chevron-up'}\r\n            style={{\r\n              color: bookitColors.grayscale.graySubtitles,\r\n              width: '10px',\r\n              height: '10px',\r\n            }}\r\n          />\r\n        </React.Fragment>\r\n      </IconButton>\r\n      <SubTopBar\r\n        theme={theme}\r\n        className={clsx('subBar', { subBarCollapsed: collapsedBar })}\r\n      >\r\n        <div className=\"frame\">\r\n          <div className=\"controls\">\r\n            <CoreSelectionButton />\r\n            <AssetQuickSearch />\r\n          </div>\r\n          {isAdminOfSingle && !!savedServiceGroups && (\r\n            <Button\r\n              variant=\"ghost\"\r\n              size=\"small\"\r\n              startIcon={<Icon icon=\"external-link-alt\" />}\r\n              href={{\r\n                search: { Edit: savedServiceGroups[0].Id },\r\n                path: '/newGroup.aspx',\r\n              }}\r\n              target=\"_blank\"\r\n            >\r\n              {t(translations.OpenCore)}\r\n            </Button>\r\n          )}\r\n        </div>\r\n      </SubTopBar>\r\n    </React.Fragment>\r\n  ) : null;\r\n}\r\n","/**\r\n *\r\n * TopBar\r\n *\r\n */\r\nimport { AppBarProps, useTheme } from '@material-ui/core';\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { TopToolbar } from './TopToolbar';\r\nimport { StyledTopBar } from './styled';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\n\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { SubTopToolbar } from './SubTopToolbar';\r\nexport interface StyleTopBarProps {\r\n  isOpen: boolean;\r\n  drawerWidth: number;\r\n  sidePanelCollapsed?: boolean;\r\n}\r\nexport interface TopBarProps extends AppBarProps {\r\n  isOpen: boolean;\r\n  drawerWidth: number;\r\n  sidePanelCollapsed?: boolean;\r\n}\r\n\r\nexport function TopBar(props: TopBarProps) {\r\n  const { children, isOpen, drawerWidth, sidePanelCollapsed, ...rest } = props;\r\n  const isMobile = DetectIsMobile();\r\n  const theme = useTheme();\r\n  return (\r\n    <>\r\n      <StyledTopBar\r\n        theme={theme}\r\n        drawerWidth={drawerWidth}\r\n        sidePanelWidth={SIDE_PANEL_WIDTH}\r\n        color=\"transparent\"\r\n        position=\"fixed\"\r\n        variant=\"elevation\"\r\n        elevation={0}\r\n        className={clsx('appBar', {\r\n          appBarShift: isOpen,\r\n          sidePanelShift: sidePanelCollapsed,\r\n        })}\r\n        {...rest}\r\n      >\r\n        <TopToolbar />\r\n        {!isMobile && <SubTopToolbar />}\r\n      </StyledTopBar>\r\n    </>\r\n  );\r\n}\r\n","import React from 'react';\r\nimport { ListItem, ListItemProps } from '@material-ui/core';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\nimport { Link } from 'react-router-dom';\r\n\r\nexport interface MenuItemComponentProps\r\n  extends Pick<ListItemProps, 'id' | 'className' | 'role'> {\r\n  link?: string | null; // because the InferProps props allows alows null value\r\n  onClick: (event: React.MouseEvent<HTMLElement>, index: number) => void;\r\n  external: boolean;\r\n  selected: boolean;\r\n  currentIndex: number;\r\n  onKeyDown?: (event: React.KeyboardEvent<HTMLElement>, index: number) => void;\r\n  onExternalClick?: (link: string) => void;\r\n}\r\nconst MenuItemComponent: React.FC<MenuItemComponentProps> = props => {\r\n  const {\r\n    className,\r\n    link,\r\n    onClick,\r\n    children,\r\n    external,\r\n    selected,\r\n    currentIndex: currentindex,\r\n    onKeyDown,\r\n    onExternalClick,\r\n    ...other\r\n  } = props;\r\n  // If link is not set return the orinary ListItem\r\n  if (!link || typeof link !== 'string') {\r\n    return (\r\n      <ListItem\r\n        button\r\n        className={className}\r\n        children={children}\r\n        onClick={event => onClick(event, currentindex)}\r\n        onKeyDown={event => onKeyDown && onKeyDown(event, currentindex)}\r\n        selected={selected}\r\n        disableTouchRipple\r\n        {...other}\r\n      />\r\n    );\r\n  } else {\r\n    if (external) {\r\n      return (\r\n        <ListItem\r\n          button\r\n          className={className}\r\n          children={children}\r\n          onClick={event => {\r\n            if (!!onExternalClick) {\r\n              onExternalClick(link);\r\n            }\r\n            onClick(event, currentindex);\r\n          }}\r\n          onKeyDown={event => onKeyDown && onKeyDown(event, currentindex)}\r\n          component={!!onExternalClick ? 'button' : LinkBehavior}\r\n          href={!!onExternalClick ? undefined : link}\r\n          target={'_blank'}\r\n          selected={selected}\r\n          disableTouchRipple\r\n          {...other}\r\n        />\r\n      );\r\n    }\r\n    return (\r\n      <ListItem\r\n        button\r\n        className={className}\r\n        children={children}\r\n        component={Link}\r\n        to={link}\r\n        onClick={event => onClick(event, currentindex)}\r\n        onKeyDown={event => onKeyDown && onKeyDown(event, currentindex)}\r\n        selected={selected}\r\n        disableTouchRipple\r\n        {...other}\r\n      />\r\n    );\r\n  }\r\n\r\n  // Return a LitItem with a link component\r\n};\r\n\r\nexport default MenuItemComponent;\r\n","import * as React from 'react';\r\nimport { SidebarMenuItemProps } from './MenuItem';\r\nimport { bindHover, bindMenu } from 'material-ui-popup-state';\r\nimport { Fade, ListItemIcon, makeStyles, MenuItem } from '@material-ui/core';\r\nimport PropTypes from 'prop-types';\r\nimport MenuItemComponent from './MenuItemComponent';\r\nimport {\r\n  anchorRef,\r\n  bindFocus,\r\n  usePopupState,\r\n} from 'material-ui-popup-state/hooks';\r\nimport HoverMenu from 'material-ui-popup-state/HoverMenu';\r\nimport { LinkBehavior } from 'app/components/ExternalLink';\r\nimport { NavLink, NavLinkProps } from 'react-router-dom';\r\nimport { setTimeout } from 'timers';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { Icon as AwesomeIcon } from 'app/components/BasicIcons/FontAwesome';\r\n\r\nexport interface HoverSideMenuProps {\r\n  items: SidebarMenuItemProps[];\r\n  handleChildClick: (event, index) => void;\r\n  handleClick: (event, index) => void;\r\n  selected: boolean;\r\n  id: string;\r\n  name: string;\r\n  Icon?: PropTypes.ReactElementLike | null;\r\n  link?: string | null;\r\n  external: boolean;\r\n  onExternalClick?: (link: string) => void;\r\n  index: number;\r\n}\r\nconst styles = makeStyles(theme => ({\r\n  paper: {\r\n    backgroundColor: theme.palette.primary.bgHover,\r\n    borderRadius: 0,\r\n  },\r\n  list: {\r\n    padding: 0,\r\n  },\r\n  childRoot: {\r\n    '& > .menuItem': {\r\n      minWidth: '200px',\r\n      boxShadow: '0px 1px 0px 0px #e0e5ec',\r\n      color: theme.palette.common.blackRegular,\r\n      '&.active': {\r\n        backgroundColor: theme.palette.primary.main,\r\n        color: theme.palette.common.white,\r\n      },\r\n      '&:focus': {\r\n        textDecoration: 'underline',\r\n        backgroundColor: theme.palette.primary.main,\r\n        color: theme.palette.common.white,\r\n      },\r\n      '&:hover': {\r\n        textDecoration: 'underline',\r\n        backgroundColor: theme.palette.primary.main,\r\n        color: theme.palette.common.white,\r\n      },\r\n      '& > .menuItemTextInset': {\r\n        paddingLeft: theme.spacing(2),\r\n        marginTop: 0,\r\n        marginBottom: 0,\r\n        '& > *': {\r\n          fontSize: '13px',\r\n          fontWeight: 700,\r\n        },\r\n      },\r\n    },\r\n  },\r\n  focusVisible: {\r\n    backgroundColor: theme.palette.common.grayDividers,\r\n    '&::focus': {\r\n      textDecoration: 'underline',\r\n    },\r\n  },\r\n  menuItem: {\r\n    '&::focus': {\r\n      textDecoration: 'underline',\r\n    },\r\n  },\r\n}));\r\nexport const createMenuItemRefs = (items, rowInd) => {\r\n  // obj\r\n  let menuItemRefs = {};\r\n  // loop each\r\n  for (let i = 0; i < Object.keys(items).length; i++) {\r\n    // When assign createRef, no current\r\n    menuItemRefs[rowInd + i] = React.createRef();\r\n  }\r\n  return menuItemRefs;\r\n};\r\nexport const HoverSideMenu = React.forwardRef<any, HoverSideMenuProps>(\r\n  function HoverSideMenu(props, ref) {\r\n    const {\r\n      items,\r\n      selected,\r\n      handleChildClick,\r\n      id,\r\n      name,\r\n      Icon,\r\n      link,\r\n      handleClick,\r\n      external,\r\n      index,\r\n      onExternalClick,\r\n    } = props;\r\n    const popupState = usePopupState({\r\n      variant: 'popper',\r\n      popupId: id,\r\n    });\r\n    const classes = styles();\r\n    const [childActiveIndex, setChildActiveIndex] = React.useState(-1);\r\n    const menuItemRefs = React.useRef(createMenuItemRefs(items, index));\r\n    React.useEffect(() => {\r\n      if (selected && childActiveIndex >= 0) {\r\n        setTimeout(() => {\r\n          menuItemRefs.current[index + childActiveIndex]?.focus();\r\n        }, 0);\r\n      }\r\n    }, [childActiveIndex, selected, index]);\r\n    const buttonIconKeyDown = (event, parentRowIndex) => {\r\n      if (event.keyCode === 13) {\r\n        // Enter pressed\r\n        console.log('enter is pressed');\r\n        setChildActiveIndex(0);\r\n      } else if (event.keyCode === 9) {\r\n        // tab away\r\n        console.log('tab away');\r\n\r\n        //handleClick(event, parentRowIndex + 1);\r\n        setChildActiveIndex(-1);\r\n        //setCurrRowInd('');\r\n      } else if (event.keyCode === 40) {\r\n        //test\r\n        console.log('down arrow');\r\n\r\n        // 38 is up arrow\r\n        if (selected) {\r\n          // No scrolling\r\n          event.preventDefault();\r\n\r\n          // set to 1st item in 0 index\r\n          setChildActiveIndex(prev => {\r\n            return prev !== items.length - 1 ? prev + 1 : 0;\r\n          });\r\n        }\r\n      } else if (event.keyCode === 38) {\r\n        //test\r\n        console.log('up arrow');\r\n\r\n        // 38 is up arrow\r\n        if (selected) {\r\n          // No scrolling\r\n          event.preventDefault();\r\n\r\n          // set to 1st item in 0 index\r\n          setChildActiveIndex(prev => {\r\n            return prev > 0 ? prev - 1 : items.length - 1;\r\n          });\r\n        }\r\n      }\r\n    };\r\n    return (\r\n      <React.Fragment>\r\n        <div ref={anchorRef(popupState)} className=\"hoverItem\">\r\n          <MenuItemComponent\r\n            className=\"menuItem\"\r\n            link={link}\r\n            onClick={handleClick}\r\n            onKeyDown={buttonIconKeyDown}\r\n            external={external}\r\n            selected={selected}\r\n            currentIndex={index}\r\n            onExternalClick={onExternalClick}\r\n            // {...{ 'aria-label': name }}\r\n            {...bindFocus(popupState)}\r\n            {...bindHover(popupState)}\r\n          >\r\n            {/* Display an icon if any */}\r\n            <div className=\"menuItemHoverContent\">\r\n              {!!Icon && (\r\n                <ListItemIcon className=\"menuItemIcon\">{Icon}</ListItemIcon>\r\n              )}\r\n              {/* <ListItemText\r\n                className={!Icon ? 'menuItemTextInset' : 'menuItemText'}\r\n                primary={name}\r\n                inset={!Icon}\r\n              /> */}\r\n            </div>\r\n          </MenuItemComponent>\r\n\r\n          {items && items.length > 0 && (\r\n            <HoverMenu\r\n              ref={ref}\r\n              autoFocus\r\n              {...bindMenu(popupState)}\r\n              anchorOrigin={{\r\n                vertical: 'top',\r\n                horizontal: 'right',\r\n              }}\r\n              transformOrigin={{\r\n                vertical: 'top',\r\n                horizontal: 'left',\r\n              }}\r\n              anchorPosition={{ top: 0, left: 200 }}\r\n              getContentAnchorEl={null}\r\n              TransitionComponent={Fade}\r\n              className={'hoverChildMenu'}\r\n              // classes={{ paper: classes.paper, list: classes.childRoot }}\r\n            >\r\n              {/* <List component=\"ul\" className={classes.childRoot} disablePadding> */}\r\n              <MenuItem className=\"menuItemName\" tabIndex={0} key={name}>\r\n                <BasicTypography variant=\"boldS\" display=\"block\">\r\n                  {name}\r\n                </BasicTypography>\r\n              </MenuItem>\r\n              {items.map(\r\n                (item, cindex) => {\r\n                  if (!item.link || typeof item.link !== 'string') {\r\n                    return (\r\n                      <MenuItem\r\n                        disableTouchRipple\r\n                        className=\"menuItem\"\r\n                        tabIndex={0}\r\n                        key={`child-${cindex}`}\r\n                        onClick={event => {\r\n                          console.log('child-div-click', event);\r\n                          handleChildClick(event, cindex);\r\n                        }}\r\n                        ref={element =>\r\n                          (menuItemRefs.current[index + cindex] = element)\r\n                        }\r\n                      >\r\n                        <div className=\"menuItemContent\">\r\n                          <ListItemIcon className=\"menuItemIcon\">\r\n                            <AwesomeIcon icon={'circle-small'} />\r\n                          </ListItemIcon>\r\n                          <BasicTypography\r\n                            className={'menuItemText'}\r\n                            variant=\"buttonS\"\r\n                            display=\"block\"\r\n                          >\r\n                            {item.name}\r\n                          </BasicTypography>\r\n                        </div>\r\n                        {/* <ListItemText\r\n                        className={'menuItemTextInset'}\r\n                        primary={item.name}\r\n                        inset={true}\r\n                      /> */}\r\n                      </MenuItem>\r\n                    );\r\n                  } else {\r\n                    if (item.external) {\r\n                      return (\r\n                        <MenuItem\r\n                          className=\"menuItem\"\r\n                          tabIndex={0}\r\n                          disableTouchRipple\r\n                          key={`child-external-${cindex}`}\r\n                          onClick={event => {\r\n                            console.log('child-external-click', event);\r\n                            if (\r\n                              !!onExternalClick &&\r\n                              item.link !== null &&\r\n                              item.link !== undefined\r\n                            ) {\r\n                              onExternalClick(item.link);\r\n                            }\r\n                            handleChildClick(event, cindex);\r\n                          }}\r\n                          selected={selected && item.selected}\r\n                          component={!!onExternalClick ? 'li' : LinkBehavior}\r\n                          href={!!onExternalClick ? undefined : item.link}\r\n                          target={'_blank'}\r\n                          ref={element =>\r\n                            (menuItemRefs.current[index + cindex] = element)\r\n                          }\r\n                        >\r\n                          <div className=\"menuItemContent\">\r\n                            <ListItemIcon className=\"menuItemIcon\">\r\n                              <AwesomeIcon icon={'circle-small'} />\r\n                            </ListItemIcon>\r\n                            <BasicTypography\r\n                              className={'menuItemText'}\r\n                              variant=\"buttonS\"\r\n                              display=\"block\"\r\n                            >\r\n                              {item.name}\r\n                            </BasicTypography>\r\n                          </div>\r\n                          {/* <ListItemText\r\n                          className={'menuItemTextInset'}\r\n                          primary={item.name}\r\n                          inset={true}\r\n                        /> */}\r\n                        </MenuItem>\r\n                      );\r\n                    } else {\r\n                      return (\r\n                        <MenuItem\r\n                          className=\"menuItem\"\r\n                          tabIndex={0}\r\n                          disableTouchRipple\r\n                          key={`child-react-${cindex}`}\r\n                          onClick={event => {\r\n                            console.log('child-react-click', event);\r\n                            handleChildClick(event, cindex);\r\n                          }}\r\n                          component={React.forwardRef(\r\n                            (props: NavLinkProps, ref: any) => (\r\n                              <NavLink\r\n                                tabIndex={0}\r\n                                exact\r\n                                {...props}\r\n                                innerRef={element =>\r\n                                  (menuItemRefs.current[\r\n                                    index + cindex\r\n                                  ] = element)\r\n                                }\r\n                              />\r\n                            ),\r\n                          )}\r\n                          focusVisibleClassName={classes.focusVisible}\r\n                          to={item.link}\r\n                          ref={element =>\r\n                            (menuItemRefs.current[index + cindex] = element)\r\n                          }\r\n                        >\r\n                          <div className=\"menuItemContent\">\r\n                            <ListItemIcon className=\"menuItemIcon\">\r\n                              <AwesomeIcon icon={'circle-small'} />\r\n                            </ListItemIcon>\r\n                            <BasicTypography\r\n                              className={'menuItemText'}\r\n                              variant=\"buttonS\"\r\n                              display=\"block\"\r\n                            >\r\n                              {item.name}\r\n                            </BasicTypography>\r\n                          </div>\r\n                          {/* <ListItemText\r\n                          className={'menuItemTextInset'}\r\n                          primary={item.name}\r\n                          inset={true}\r\n                        /> */}\r\n                        </MenuItem>\r\n                      );\r\n                    }\r\n                  }\r\n                },\r\n                // <SidbarMenuItem\r\n                //   ref={ref}\r\n                //   {...item}\r\n                //   key={cindex}\r\n                //   indexChanged={handleChildClick}\r\n                //   selected={selected && item.selected} //childIndex === index\r\n                // />\r\n              )}\r\n              {/* </List> */}\r\n            </HoverMenu>\r\n          )}\r\n        </div>\r\n      </React.Fragment>\r\n    );\r\n  },\r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport MenuItemComponent from './MenuItemComponent';\r\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\r\nimport List from '@material-ui/core/List';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectIsExpandedSideBar,\r\n  selectSiteMapProvider,\r\n  selectSiteMapSettings,\r\n} from 'app/slice/selectors';\r\nimport { HoverSideMenu } from './HoverMenu';\r\nimport {\r\n  AssetsSubTabUnionArray,\r\n  MainTabsUnion,\r\n  SiteMapProvider,\r\n} from 'types/SiteMapSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { useLocation } from 'react-router-dom';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { selectHasNotSavedChanges } from 'app/Layout/FrontendLayout/slice/selectors';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport {\r\n  RowActionsMenu,\r\n  RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport clsx from 'clsx';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { Icon as AwesomeIcon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Roles } from 'app/slice/types';\r\nimport { isInRole } from 'types/AuthenticatedUser';\r\n\r\nexport const MenuItemPropTypes = {\r\n  name: PropTypes.string.isRequired,\r\n  link: PropTypes.string,\r\n  external: PropTypes.bool.isRequired,\r\n  Icon: PropTypes.element,\r\n  items: PropTypes.array,\r\n  selected: PropTypes.bool.isRequired,\r\n  indexChanged: PropTypes.func,\r\n  index: PropTypes.number.isRequired,\r\n  chIndex: PropTypes.number,\r\n  onChange: PropTypes.func,\r\n  closeOnClick: PropTypes.bool,\r\n};\r\ntype MenuItemPropTypesItems = PropTypes.InferProps<typeof MenuItemPropTypes>;\r\ntype MenuItemPropTypesNoItems = Omit<MenuItemPropTypesItems, 'items'>;\r\n\r\nexport type SidebarMenuItemProps = MenuItemPropTypesNoItems & {\r\n  items?: SidebarMenuItemProps[];\r\n  mainTab?: MainTabsUnion;\r\n  groupTab?: number;\r\n  hasAdminSettings?: boolean;\r\n};\r\nconst SidbarMenuItem = React.forwardRef<any, SidebarMenuItemProps>(\r\n  function SidbarMenuItem(props, ref) {\r\n    const {\r\n      name,\r\n      link,\r\n      external,\r\n      Icon,\r\n      items = [],\r\n      selected,\r\n      indexChanged,\r\n      index,\r\n      chIndex,\r\n      mainTab,\r\n      hasAdminSettings,\r\n      closeOnClick,\r\n    } = props;\r\n    //const classes = useStyles();\r\n    const isExpandable = items && items.length > 0;\r\n    const isMobile = DetectIsMobile();\r\n    const [open, setOpen] = React.useState(selected);\r\n    const [isSelected, setSelected] = React.useState(selected);\r\n    const [, setChildIndex] = React.useState(chIndex);\r\n    const hasChanges = useSelector(selectHasNotSavedChanges);\r\n    const siteMapProvider = useSelector(selectSiteMapProvider);\r\n    const user = useSelector(selectAuthenticatedUser);\r\n    const dispatch = useDispatch();\r\n    const { actions } = useLayoutSlice();\r\n    const sidebarExpanded = useSelector(state =>\r\n      selectIsExpandedSideBar(state, isMobile),\r\n    );\r\n    const { expandLocal } = useExpandedSideBarState();\r\n    const siteMapSettings = useSelector(selectSiteMapSettings);\r\n    const location = useLocation();\r\n    const isAdmin =\r\n      isInRole(user, Roles.Administrators) ||\r\n      isInRole(user, Roles.GroupAdministrators) ||\r\n      isInRole(user, Roles.CustomRole);\r\n    const [urlLink, setUrlLink] = React.useState<string | null | undefined>(\r\n      link,\r\n    );\r\n    // const handleSettingClick = React.useCallback(\r\n    //   (link: string) => {\r\n    //     dispatch(\r\n    //       actions.openAdminPanel({\r\n    //         url: link,\r\n    //       }),\r\n    //     );\r\n    //   },\r\n    //   [actions, dispatch],\r\n    // );\r\n    const adminSettings = React.useMemo(() => {\r\n      let actions: RowActionsProps[] = [];\r\n      if (!!mainTab && isAdmin && hasAdminSettings) {\r\n        if (mainTab === 'Assets') {\r\n          AssetsSubTabUnionArray.forEach(ar => {\r\n            actions = [\r\n              ...actions,\r\n              ...siteMapProvider.adminSettingsActions(\r\n                mainTab,\r\n                user,\r\n                ar,\r\n                undefined, // handleSettingClick,\r\n              ),\r\n            ];\r\n          });\r\n        } else {\r\n          if (mainTab === 'Budgets') {\r\n            return siteMapProvider.adminSettingsActions(\r\n              mainTab,\r\n              user,\r\n              'BudgetTabSetting',\r\n              undefined, // handleSettingClick,\r\n            );\r\n          }\r\n          return siteMapProvider.adminSettingsActions(\r\n            mainTab,\r\n            user,\r\n            undefined,\r\n            undefined, // handleSettingClick,\r\n          );\r\n        }\r\n      }\r\n      return actions;\r\n    }, [hasAdminSettings, isAdmin, mainTab, siteMapProvider, user]);\r\n    React.useEffect(() => {\r\n      let active =\r\n        !isNullOrUndefined(siteMapSettings) && link === location?.pathname;\r\n      if (active) {\r\n        let siteMapProvider = new SiteMapProvider(siteMapSettings);\r\n        let node = siteMapProvider.findNode(\r\n          location?.pathname || window.location.pathname,\r\n        );\r\n\r\n        setUrlLink(() => {\r\n          if (node !== undefined) {\r\n            const reactUrl = node.reactUrl;\r\n            if (reactUrl !== undefined && reactUrl !== null) {\r\n              const elementPath = reactUrl.split('?')[0] ?? reactUrl;\r\n              if (elementPath === location.pathname) {\r\n                return reactUrl;\r\n              } else {\r\n                return link;\r\n              }\r\n            } else {\r\n              return link;\r\n            }\r\n          } else {\r\n            return link;\r\n          }\r\n        });\r\n      }\r\n      return () => {\r\n        active = false;\r\n      };\r\n    }, [link, location.pathname, siteMapSettings]);\r\n    function handleClick(event, index) {\r\n      if (\r\n        !!event.target &&\r\n        !!event.target.parentNode &&\r\n        'className' in event.target.parentNode &&\r\n        event.target.parentNode.className !== undefined &&\r\n        event.target.parentNode.className !== null &&\r\n        event.target.parentNode.className !== '' &&\r\n        typeof event.target.parentNode.className === 'string' &&\r\n        event.target.parentNode.className.indexOf('MuiPopover') > -1\r\n      ) {\r\n        event.preventDefault();\r\n        event.stopPropagation();\r\n      } else {\r\n        if (\r\n          hasChanges &&\r\n          (props.items === undefined || props.items.length < 1)\r\n        ) {\r\n          dispatch(\r\n            actions.setContinueToLink(\r\n              props.link === null || props.link === undefined\r\n                ? location.pathname\r\n                : props.link,\r\n            ),\r\n          );\r\n          dispatch(actions.setConfirmOpen(true));\r\n          event.preventDefault();\r\n        } else {\r\n          setOpen(!open);\r\n          if (props.index !== index) {\r\n            setSelected(!isSelected);\r\n          } else {\r\n            if (props.items !== undefined && props.items?.length > 0) {\r\n              setSelected(!selected);\r\n            }\r\n          }\r\n          if (indexChanged !== undefined && indexChanged !== null) {\r\n            indexChanged(event, index);\r\n          }\r\n        }\r\n        if (isMobile && closeOnClick) {\r\n          expandLocal(false);\r\n        }\r\n      }\r\n    }\r\n    const handleChildClick = (event, index) => {\r\n      if (hasChanges) {\r\n        dispatch(\r\n          actions.setContinueToLink(\r\n            props.link === null || props.link === undefined\r\n              ? location.pathname\r\n              : props.link,\r\n          ),\r\n        );\r\n        dispatch(actions.setConfirmOpen(true));\r\n        event.preventDefault();\r\n      } else {\r\n        if (isMobile) {\r\n          expandLocal(false);\r\n        }\r\n        setChildIndex(prev => {\r\n          if (props.chIndex !== index) {\r\n            return index;\r\n          }\r\n        });\r\n        setChildIndex(index);\r\n      }\r\n    };\r\n\r\n    const parentId = `menuitem-${index}`;\r\n    return !sidebarExpanded ? ( //isExpandable &&\r\n      <HoverSideMenu\r\n        ref={ref}\r\n        items={items}\r\n        selected={selected}\r\n        handleClick={handleClick}\r\n        handleChildClick={handleChildClick}\r\n        //onExternalClick={handleSettingClick}\r\n        external={external}\r\n        id={`index-${index}`}\r\n        index={index}\r\n        link={urlLink || link}\r\n        Icon={Icon}\r\n        name={name}\r\n      />\r\n    ) : (\r\n      <>\r\n        <MenuItemComponent\r\n          id={`${parentId}${chIndex === undefined ? '' : '-' + chIndex}`}\r\n          className={clsx('menuItem', {\r\n            mainTabMenu: mainTab !== undefined,\r\n            mainTabExpanded: sidebarExpanded,\r\n            mainTabShort: !sidebarExpanded,\r\n            mainTabOpen: open,\r\n          })}\r\n          role={isExpandable ? 'menu' : 'menuitem'}\r\n          link={urlLink || link}\r\n          onClick={handleClick}\r\n          external={external}\r\n          selected={selected}\r\n          //onExternalClick={handleSettingClick}\r\n          currentIndex={index}\r\n        >\r\n          {/* Display an icon if any */}\r\n          <div className=\"menuItemContent\">\r\n            {!!Icon && (\r\n              <ListItemIcon className=\"menuItemIcon\">{Icon}</ListItemIcon>\r\n            )}\r\n            {/* <ListItemText\r\n              className={!Icon ? 'menuItemTextInset' : 'menuItemText'}\r\n              primary={name}\r\n              inset={!Icon}\r\n            /> */}\r\n            <BasicTypography\r\n              className={'menuItemText'}\r\n              display=\"block\"\r\n              variant=\"buttonS\"\r\n            >\r\n              {name}\r\n            </BasicTypography>\r\n          </div>\r\n          {!!mainTab &&\r\n            hasAdminSettings &&\r\n            !isMobile &&\r\n            adminSettings.length > 0 && (\r\n              // <ListItemSecondaryAction className=\"secondary-icon\">\r\n\r\n              // </ListItemSecondaryAction>\r\n              <RowActionsMenu\r\n                id={`${mainTab}_settings`}\r\n                variant=\"textGray\"\r\n                onClick={event => {\r\n                  event.stopPropagation();\r\n                  event.preventDefault();\r\n                }}\r\n                items={adminSettings}\r\n                // items={settingItems.map(row => {\r\n                //   return {\r\n                //     //href: row.link,\r\n                //     text: row.name,\r\n                //     icon: 'circle-small',\r\n                //     onClick: () => handleSettingClick(row.link ?? ''),\r\n                //   } as RowActionsProps;\r\n                // })}\r\n              />\r\n            )}\r\n          {isExpandable && (\r\n            <AwesomeIcon\r\n              icon={\r\n                (open || isSelected) && selected\r\n                  ? 'chevron-up'\r\n                  : isMobile\r\n                  ? 'chevron-down'\r\n                  : 'chevron-right'\r\n              }\r\n              size=\"sm\"\r\n            />\r\n          )}\r\n        </MenuItemComponent>\r\n\r\n        {/* Display the expand menu if the item has children */}\r\n        {isExpandable && (open || isSelected) && selected && (\r\n          <List\r\n            component=\"div\"\r\n            className=\"secondMenuItem\"\r\n            disablePadding\r\n            role=\"menu\"\r\n            data-parent-id={parentId}\r\n          >\r\n            {items.map((item, chIndex) => (\r\n              <SidbarMenuItem\r\n                {...item}\r\n                index={index}\r\n                chIndex={chIndex}\r\n                key={chIndex}\r\n                indexChanged={handleChildClick}\r\n                selected={selected && item.selected}\r\n              />\r\n            ))}\r\n          </List>\r\n        )}\r\n      </>\r\n    );\r\n  },\r\n);\r\n\r\nexport default SidbarMenuItem;\r\n","import { css } from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport const verticalScrolling = css`\r\n  &::-webkit-scrollbar {\r\n    width: 4px;\r\n  }\r\n  &::-webkit-scrollbar-thumb {\r\n    box-shadow: inset 0 0 2px ${bookitColors.grayscale.grayBorders};\r\n    border-radius: 16px;\r\n    background-color: ${bookitColors.grayscale.grayBorders};\r\n  }\r\n`;\r\n","import { List } from '@material-ui/core';\r\nimport { IconProp } from 'app/AllIcons';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Roles } from 'app/slice/types';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router-dom';\r\n// import styled from 'styled-components';\r\n// import { verticalScrolling } from 'styles/CssVariables/styledVariables';\r\nimport { AuthenticatedUser, isInRole } from 'types/AuthenticatedUser';\r\nimport {\r\n  MainTabsUnion,\r\n  SiteMapNode,\r\n  SiteMapProvider,\r\n} from 'types/SiteMapSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { createMenuItemRefs } from './HoverMenu';\r\nimport SidbarMenuItem, { SidebarMenuItemProps } from './MenuItem';\r\nimport clsx from 'clsx';\r\nimport { groupBy, values } from 'lodash';\r\nimport styled from 'styled-components';\r\nimport { verticalScrolling } from 'styles/CssVariables/styledVariables';\r\nimport { selectRouterPathname } from 'app/slice/router-selectors';\r\n\r\nexport interface SideBarMenuItemProps {\r\n  menuItems: SiteMapNode[];\r\n  currentIndex?: number;\r\n  currentNode?: SiteMapNode | undefined;\r\n  isOpen: boolean;\r\n  loading: boolean;\r\n  isMobile?: boolean;\r\n}\r\nconst NavWrapper = styled('div')`\r\n  height: calc(100% - 50px);\r\n  overflow-y: auto;\r\n  width: 100%;\r\n  overflow-x: hidden;\r\n  ${verticalScrolling}\r\n`;\r\nconst MainMenuItem = styled('div')`\r\n  &.mainMenuItem {\r\n    display: flex;\r\n    flex-direction: column;\r\n    justify-content: center;\r\n    &.mainMenuItemExpanded {\r\n      align-items: flex-start;\r\n      align-self: stretch;\r\n    }\r\n    &.mainMenuItemCollapsed {\r\n      align-items: center;\r\n    }\r\n  }\r\n`;\r\nconst replaceIcon = (icon: string): IconProp => {\r\n  if (icon.indexOf(' fa-') !== -1) {\r\n    let tmpIcon = icon.substring(icon.indexOf(' fa-') + 4, icon.length);\r\n    return tmpIcon as IconProp;\r\n  }\r\n  return icon as IconProp;\r\n};\r\nconst convertUrl = (url: string): string => {\r\n  if (url !== null) {\r\n    if (url.indexOf(process.env.PUBLIC_URL) !== -1) {\r\n      return url.replace(process.env.PUBLIC_URL, '');\r\n    }\r\n    return url;\r\n  }\r\n  return url;\r\n};\r\nexport const getAdminNodeSettings = (\r\n  item: SiteMapNode,\r\n  siteMapProvider: SiteMapProvider,\r\n  user?: AuthenticatedUser,\r\n): SidebarMenuItemProps[] => {\r\n  let result: SidebarMenuItemProps[] = [];\r\n  const isAdmin =\r\n    isInRole(user, Roles.Administrators) ||\r\n    isInRole(user, Roles.GroupAdministrators) ||\r\n    isInRole(user, Roles.EquipmentAdministrator) ||\r\n    isInRole(user, Roles.CustomRole);\r\n  if (\r\n    isAdmin &&\r\n    item.ChildNodes.length > 0 &&\r\n    !!item.MainTab &&\r\n    item.ChildNodes.some(f => f.IsAdminSettings)\r\n  ) {\r\n    let filtered = item.ChildNodes.filter(\r\n      f => f.IsAdminSettings && siteMapProvider.nodeAccesibleByRole(f, user),\r\n    ).map((it, index) => {\r\n      return {\r\n        name: it.Title,\r\n        link: it.reactUrl ?? convertUrl(it.Url),\r\n        Icon: isNullOrUndefined(it.icon) ? undefined : (\r\n          <Icon icon={replaceIcon(it.icon)} />\r\n        ),\r\n        items: [] as SidebarMenuItemProps[],\r\n        external: isNullOrUndefined(it.reactUrl),\r\n        index: index,\r\n        selected: false,\r\n      } as SidebarMenuItemProps;\r\n    });\r\n    return filtered;\r\n  }\r\n  return result;\r\n};\r\n\r\nexport function SideBarMenu(props: SideBarMenuItemProps) {\r\n  // const classes = useStyles({ isOpen: props.isOpen });\r\n  const location = useLocation();\r\n  const routerPathName = useSelector(selectRouterPathname);\r\n  const { menuItems, currentIndex, currentNode, isOpen, isMobile } = props;\r\n  const [selectedIndex, setSelectedIndex] = React.useState(currentIndex || -1);\r\n  // const [mapItems, setMapItems] = React.useState<SidebarMenuItemProps[]>([]);\r\n  const mapItems = React.useMemo(() => {\r\n    return menuItems.map((item, index) => {\r\n      const link: string | null | undefined =\r\n        item.ChildNodes.filter(\r\n          ch => ch.HideReact === false && ch.Hide === false,\r\n        ).length > 0\r\n          ? item.LinkWithChildren ?? null\r\n          : item.reactUrl ?? convertUrl(item.Url);\r\n      return {\r\n        name: item.Title,\r\n        link: link,\r\n        Icon: isNullOrUndefined(item.icon) ? undefined : (\r\n          <Icon icon={replaceIcon(item.icon)} size=\"lg\" />\r\n        ),\r\n        items:\r\n          item.ChildNodes.filter(\r\n            ch => ch.HideReact === false && ch.Hide === false,\r\n          ).length > 0\r\n            ? item.ChildNodes.filter(citem => {\r\n                // filter to exclude '/usertraininghistory' url from sidebar\r\n                return citem.HideReact === false && citem.Hide === false;\r\n              }).map((chItem, chIndex) => {\r\n                return {\r\n                  name: chItem.Title,\r\n                  link: chItem.reactUrl ?? convertUrl(chItem.Url),\r\n                  Icon: isNullOrUndefined(chItem.icon) ? undefined : (\r\n                    <Icon icon={replaceIcon(chItem.icon)} />\r\n                  ),\r\n                  items: [] as SidebarMenuItemProps[],\r\n                  external: isNullOrUndefined(chItem.reactUrl),\r\n                  index: chIndex,\r\n                  selected:\r\n                    location.pathname\r\n                      .toLowerCase()\r\n                      .indexOf(\r\n                        (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n                      ) !== -1 ||\r\n                    (!!routerPathName &&\r\n                      routerPathName\r\n                        .toLowerCase()\r\n                        .indexOf(\r\n                          (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n                        ) !== -1),\r\n                };\r\n              })\r\n            : ([] as SidebarMenuItemProps[]),\r\n        hasAdminSettings: item.ChildNodes.some(f => f.IsAdminSettings === true),\r\n        mainTab: !!item.MainTab ? (item.MainTab as MainTabsUnion) : undefined,\r\n        groupTab: item.GroupTab,\r\n        external:\r\n          link?.includes('aspx') ||\r\n          (isNullOrUndefined(item.reactUrl) &&\r\n            item.ChildNodes.filter(\r\n              ch => ch.HideReact === false && ch.Hide === false,\r\n            ).length === 0),\r\n        index: index,\r\n        selected:\r\n          currentNode === undefined\r\n            ? false\r\n            : selectedIndex === -1\r\n            ? currentNode.Key === item.Key\r\n            : selectedIndex === index,\r\n        closeOnClick:\r\n          !isNullOrUndefined(item.LinkWithChildren) ||\r\n          item.ChildNodes.filter(\r\n            ch => ch.HideReact === false && ch.Hide === false,\r\n          ).length < 1,\r\n      };\r\n    });\r\n  }, [\r\n    currentNode,\r\n    location.pathname,\r\n    menuItems,\r\n    routerPathName,\r\n    selectedIndex,\r\n  ]);\r\n  // const isAdmin =\r\n  //   isInRole(authenticatedUser, Roles.Administrators) ||\r\n  //   isInRole(authenticatedUser, Roles.GroupAdministrators) ||\r\n  //   isInRole(authenticatedUser, Roles.EquipmentAdministrator);\r\n  const handleListItemClick = (event, index) => {\r\n    setSelectedIndex(index);\r\n  };\r\n  React.useEffect(() => {\r\n    if (!!currentNode) {\r\n      const idx = menuItems.findIndex(f => f.Key === currentNode.Key);\r\n      if (idx !== -1) {\r\n        setSelectedIndex(idx);\r\n      }\r\n    }\r\n  }, [currentNode, menuItems]);\r\n  // React.useEffect(() => {\r\n  //   setMapItems(\r\n  //     menuItems.map((item, index) => {\r\n  //       const link: string | null | undefined =\r\n  //         item.ChildNodes.filter(\r\n  //           ch => ch.HideReact === false && ch.Hide === false,\r\n  //         ).length > 0\r\n  //           ? item.LinkWithChildren ?? null\r\n  //           : item.reactUrl ?? convertUrl(item.Url);\r\n  //       return {\r\n  //         name: item.Title,\r\n  //         link: link,\r\n  //         Icon: isNullOrUndefined(item.icon) ? undefined : (\r\n  //           <Icon icon={replaceIcon(item.icon)} size=\"lg\" />\r\n  //         ),\r\n  //         items:\r\n  //           item.ChildNodes.filter(\r\n  //             ch => ch.HideReact === false && ch.Hide === false,\r\n  //           ).length > 0\r\n  //             ? item.ChildNodes.filter(citem => {\r\n  //                 // filter to exclude '/usertraininghistory' url from sidebar\r\n  //                 return citem.HideReact === false && citem.Hide === false;\r\n  //               }).map((chItem, chIndex) => {\r\n  //                 return {\r\n  //                   name: chItem.Title,\r\n  //                   link: chItem.reactUrl ?? convertUrl(chItem.Url),\r\n  //                   Icon: isNullOrUndefined(chItem.icon) ? undefined : (\r\n  //                     <Icon icon={replaceIcon(chItem.icon)} />\r\n  //                   ),\r\n  //                   items: [] as SidebarMenuItemProps[],\r\n  //                   external: isNullOrUndefined(chItem.reactUrl),\r\n  //                   index: chIndex,\r\n  //                   selected:\r\n  //                     location.pathname\r\n  //                       .toLowerCase()\r\n  //                       .indexOf(\r\n  //                         (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n  //                       ) !== -1 ||\r\n  //                     (!!routerPathName &&\r\n  //                       routerPathName\r\n  //                         .toLowerCase()\r\n  //                         .indexOf(\r\n  //                           (chItem.reactUrl ?? chItem.Url).toLowerCase(),\r\n  //                         ) !== -1),\r\n  //                 };\r\n  //               })\r\n  //             : ([] as SidebarMenuItemProps[]),\r\n  //         hasAdminSettings: item.ChildNodes.some(\r\n  //           f => f.IsAdminSettings === true,\r\n  //         ),\r\n  //         mainTab: !!item.MainTab ? (item.MainTab as MainTabsUnion) : undefined,\r\n  //         groupTab: item.GroupTab,\r\n  //         external:\r\n  //           link?.includes('aspx') ||\r\n  //           (isNullOrUndefined(item.reactUrl) &&\r\n  //             item.ChildNodes.filter(\r\n  //               ch => ch.HideReact === false && ch.Hide === false,\r\n  //             ).length === 0),\r\n  //         index: index,\r\n  //         selected:\r\n  //           currentNode === undefined\r\n  //             ? false\r\n  //             : selectedIndex === -1\r\n  //             ? currentNode.Key === item.Key\r\n  //             : selectedIndex === index,\r\n  //         closeOnClick:\r\n  //           !isNullOrUndefined(item.LinkWithChildren) ||\r\n  //           item.ChildNodes.filter(\r\n  //             ch => ch.HideReact === false && ch.Hide === false,\r\n  //           ).length < 1,\r\n  //       };\r\n  //     }),\r\n  //   );\r\n  // }, [\r\n  //   authenticatedUser,\r\n  //   location.pathname,\r\n  //   menuItems,\r\n  //   currentNode,\r\n  //   selectedIndex,\r\n  //   siteMapProvider,\r\n  //   routerPathName,\r\n  // ]);\r\n  const menuItemRefs = React.useRef(\r\n    createMenuItemRefs(menuItems, currentIndex ?? 0),\r\n  );\r\n  return (\r\n    <NavWrapper>\r\n      <List\r\n        component=\"nav\"\r\n        className={clsx('sideBarList', {\r\n          sideBarExpanded: isOpen,\r\n          sideBarCollapsed: !isOpen,\r\n          sideBarListMobile: isMobile,\r\n        })}\r\n        role=\"menubar\"\r\n        disablePadding\r\n      >\r\n        {values(groupBy(mapItems, f => f.groupTab)).map((f, key) => {\r\n          return (\r\n            <div className={'sideBarListGroup'} key={key}>\r\n              {f.map((item, index) => (\r\n                <MainMenuItem\r\n                  className={clsx('mainMenuItem', {\r\n                    mainMenuItemExpanded: isOpen,\r\n                    mainMenuItemCollapsed: !isOpen,\r\n                  })}\r\n                  key={index}\r\n                >\r\n                  <SidbarMenuItem\r\n                    {...item}\r\n                    key={item.index}\r\n                    selected={\r\n                      selectedIndex === -1\r\n                        ? item.selected\r\n                        : selectedIndex === item.index\r\n                    }\r\n                    ref={element =>\r\n                      (menuItemRefs.current[item.index] = element)\r\n                    }\r\n                    indexChanged={handleListItemClick}\r\n                  />\r\n                </MainMenuItem>\r\n              ))}\r\n            </div>\r\n          );\r\n        })}\r\n      </List>\r\n    </NavWrapper>\r\n  );\r\n}\r\n","/**\r\n *\r\n * BookitlabLogo\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { messages } from './messages';\r\n\r\nexport interface BookitlabShortLogoProps {}\r\n\r\nexport const BookitlabShortLogo = React.memo(function BookitlabShortLogo(\r\n  props: BookitlabShortLogoProps,\r\n) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n\r\n  return (\r\n    <svg\r\n      version=\"1.1\"\r\n      id=\"Layer_1\"\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      xmlnsXlink=\"http://www.w3.org/1999/xlink\"\r\n      x=\"0px\"\r\n      y=\"0px\"\r\n      width=\"34px\"\r\n      height=\"34px\"\r\n      viewBox=\"0 0 75 60\"\r\n      enableBackground=\"new 0 0 75 60\"\r\n      xmlSpace=\"preserve\"\r\n    >\r\n      <title>{t(messages.bookitlab())}</title>\r\n      <image\r\n        id=\"image0\"\r\n        width=\"75\"\r\n        height=\"60\"\r\n        x=\"0\"\r\n        y=\"0\"\r\n        href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAA8CA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nTlLR5+vKppwYqz7+xcDqq/I9GjCRWAijC1AuE+UyNUxD5RzQU2mWdIB2ohzE8JbCn1wOu9pTvt1j\r\n/c8v0vp/Ci1IyG6NV4UAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDctMTlUMTM6NDg6MzIrMDA6\r\nMDCo9EmgAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA3LTE5VDEzOjQ4OjMyKzAwOjAw2anxHAAA\r\nABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAASUVORK5CYII=\"\r\n      />\r\n    </svg>\r\n  );\r\n});\r\n","import { useAssetQuickSearchSlice } from 'app/components/AssetQuickSearch/slice';\r\nimport { selectShowSearchInSidebar } from 'app/components/AssetQuickSearch/slice/selectors';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { EventsCount } from '../../TopBar/ProfileMenu/EventsCount';\r\nimport { SwitchSites } from '../../TopBar/ProfileMenu/SwitchSites';\r\nimport { UserMenu } from '../../TopBar/ProfileMenu/UserMenu';\r\nimport React from 'react';\r\n\r\nexport interface UserProfileMobileProps {}\r\nexport function UserProfileMobile(props: UserProfileMobileProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions: assetSearchActions } = useAssetQuickSearchSlice();\r\n  const showSearchInSidebar = useSelector(selectShowSearchInSidebar);\r\n  return (\r\n    <React.Fragment>\r\n      <IconButton\r\n        variant=\"ghost\"\r\n        size=\"small\"\r\n        aria-label=\"search\"\r\n        onClick={() => {\r\n          dispatch(assetSearchActions.showSearchInput(!showSearchInSidebar));\r\n        }}\r\n        title={t(translations.SearchAssets)}\r\n        shape=\"square\"\r\n      >\r\n        <Icon\r\n          icon=\"search\"\r\n          style={{\r\n            color: bookitColors.grayscale.graySubtitles,\r\n            width: '20px',\r\n            height: '20px',\r\n          }}\r\n        />\r\n      </IconButton>\r\n      <EventsCount />\r\n      <SwitchSites />\r\n      <UserMenu />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","import { BookitlabLogo } from 'app/components/BookitlabLogo';\r\nimport { BookitlabShortLogo } from 'app/components/BookitlabLogo/BookitlabShortLogo';\r\nimport { selectMinimizedBookitlabLogo } from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { CustomerLogo } from '../../CustomerLogo';\r\nimport clsx from 'clsx';\r\nimport { ToggleSideMenuButton } from '../../TopBar/components/ToggleSideMenuButton';\r\nimport { UserProfileMobile } from '../UserProfileMobile';\r\n\r\nexport interface SideBarHeaderProps {\r\n  children?: React.ReactNode;\r\n  isOpen: boolean;\r\n}\r\n\r\nexport const SideBarHeader = React.memo(function SideBarHeader(\r\n  props: SideBarHeaderProps,\r\n) {\r\n  const { children, isOpen } = props;\r\n  const isMobile = DetectIsMobile();\r\n  const logoMinimized = useSelector(selectMinimizedBookitlabLogo);\r\n  return (\r\n    <React.Fragment>\r\n      <div\r\n        className={clsx('sideBarHeader', {\r\n          sideBarHeaderOpen: isOpen,\r\n          sideBarHeaderMobile: isMobile,\r\n        })}\r\n      >\r\n        {isMobile ? (\r\n          <CustomerLogo height=\"24\" width=\"90\" />\r\n        ) : isOpen && !logoMinimized ? (\r\n          <BookitlabLogo size=\"80x24\" />\r\n        ) : (\r\n          <BookitlabShortLogo />\r\n        )}\r\n        <div\r\n          className={clsx('headerButtons', { headerButtonsMobile: isMobile })}\r\n        >\r\n          {isMobile && isOpen && <UserProfileMobile />}\r\n\r\n          {/* {isMobile && isOpen && showSearchInSidebar && (\r\n            <div\r\n              style={{\r\n                padding: '0px 16px',\r\n                display: 'flex',\r\n                width: '100%',\r\n                // flexFlow: 'column',\r\n              }}\r\n            >\r\n              <AssetQuickSearch />\r\n            </div>\r\n          )} */}\r\n          {/* {isMobile && isOpen && (\r\n            <Box\r\n              style={{\r\n                padding: '8px 16px',\r\n                display: 'flex',\r\n                flexFlow: 'column',\r\n              }}\r\n            >\r\n              <CoreSelectionButton />\r\n            </Box>\r\n          )} */}\r\n          {isOpen && !isMobile && <ToggleSideMenuButton />}\r\n        </div>\r\n        {children}\r\n      </div>\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { makeStyles, Theme } from '@material-ui/core/styles';\r\n\r\nexport const useStyles = makeStyles<Theme, { isOpen: boolean }>(\r\n  (theme: Theme) => ({\r\n    root: {\r\n      backgroundColor: theme.palette.background.default,\r\n      padding: 0,\r\n      marginTop: 40,\r\n      '& .Mui-selected': {\r\n        backgroundColor: theme.palette.primary.bgHover,\r\n        '& > .menuItemContent': {\r\n          backgroundColor: theme.palette.primary.main,\r\n          color: theme.palette.background.paper,\r\n          '& svg': {\r\n            color: theme.palette.background.paper,\r\n          },\r\n        },\r\n      },\r\n      '& .Mui-selected:hover': {\r\n        backgroundColor: theme.palette.primary.bgHover,\r\n        '& > .menuItemContent': {\r\n          backgroundColor: theme.palette.primary.main,\r\n          color: theme.palette.background.paper,\r\n          '& svg': {\r\n            color: theme.palette.background.paper,\r\n          },\r\n        },\r\n      },\r\n      '& > .menuItem': {\r\n        padding: 0,\r\n        '& > .menuItemContent': {\r\n          display: 'flex',\r\n          width: '100%',\r\n          position: 'relative',\r\n          boxSizing: 'border-box',\r\n          textAlign: 'left',\r\n          alignItems: 'center',\r\n          justifyContent: 'flex-start',\r\n          textDecoration: 'none',\r\n          padding: '6px 8px 6px 26px',\r\n          fontWeight: '900', //theme.typography.fontWeightBold,\r\n          color: theme.palette.common.graySubtitle,\r\n          textTransform: 'uppercase',\r\n          backgroundColor: theme.palette.background.default,\r\n          gap: 16,\r\n          marginBottom: '8px',\r\n          '&:hover': {\r\n            backgroundColor: theme.palette.primary.main,\r\n            color: theme.palette.common.white,\r\n            '& > .menuItemIcon': {\r\n              color: theme.palette.common.white,\r\n            },\r\n          },\r\n          '& *': {\r\n            fontWeight: '900', //theme.typography.fontWeightBold,\r\n            whiteSpace: props => (props.isOpen ? 'initial' : 'inherit'),\r\n          },\r\n          '& > .menuItemIcon': {\r\n            color: theme.palette.common.grayComponents,\r\n            minWidth: props => (props.isOpen ? 'initial' : '48px'),\r\n            '& > svg': {\r\n              width: '19px',\r\n            },\r\n          },\r\n          '& > .menuItemText': {\r\n            margin: 0,\r\n            '& > *': {\r\n              fontSize: '13px',\r\n            },\r\n          },\r\n          '& > .menuItemTextInset': {\r\n            paddingLeft: 0,\r\n          },\r\n        },\r\n      },\r\n      '& > .hoverItem': {\r\n        marginBottom: '8px',\r\n        '& .Mui-selected': {\r\n          backgroundColor: theme.palette.primary.bgHover,\r\n          '& > .menuItemHoverContent': {\r\n            backgroundColor: theme.palette.primary.main,\r\n            color: theme.palette.background.paper,\r\n            '& svg': {\r\n              color: theme.palette.background.paper,\r\n            },\r\n          },\r\n        },\r\n        '& .Mui-selected:hover': {\r\n          backgroundColor: theme.palette.primary.bgHover,\r\n          '& > .menuItemHoverContent': {\r\n            backgroundColor: theme.palette.primary.main,\r\n            color: theme.palette.background.paper,\r\n            '& svg': {\r\n              color: theme.palette.background.paper,\r\n            },\r\n          },\r\n        },\r\n        '& > .menuItem': {\r\n          padding: 0,\r\n          '& > .menuItemHoverContent': {\r\n            display: 'flex',\r\n            alignItems: 'center',\r\n            justifyContent: 'center',\r\n            fontWeight: '900', //theme.typography.fontWeightBold,\r\n            color: theme.palette.common.graySubtitle,\r\n            textTransform: 'uppercase',\r\n            paddingLeft: 16,\r\n            '&:hover': {\r\n              backgroundColor: theme.palette.primary.main,\r\n              color: theme.palette.common.white,\r\n              '& > .menuItemIcon': {\r\n                color: theme.palette.common.white,\r\n              },\r\n            },\r\n            '&:focus': {\r\n              backgroundColor: theme.palette.primary.main,\r\n              color: theme.palette.common.white,\r\n              '& > .menuItemIcon': {\r\n                color: theme.palette.common.white,\r\n              },\r\n            },\r\n            '& *': {\r\n              fontWeight: '900', //theme.typography.fontWeightBold,\r\n              whiteSpace: props => (props.isOpen ? 'initial' : 'inherit'),\r\n            },\r\n            '& > .menuItemIcon': {\r\n              color: theme.palette.common.grayComponents,\r\n              minWidth: props => (props.isOpen ? '32px' : '48px'),\r\n              '& > svg': {\r\n                width: '1.5em',\r\n              },\r\n            },\r\n            '& > .menuItemText': {\r\n              '& > *': {\r\n                fontSize: '13px',\r\n              },\r\n            },\r\n            '& > .menuItemTextInset': {\r\n              paddingLeft: 0,\r\n            },\r\n          },\r\n        },\r\n      },\r\n      '& .childRoot': {\r\n        padding: '12px 0px 12px 0',\r\n        backgroundColor: theme.palette.primary.bgHover,\r\n        '& .Mui-selected': {\r\n          '& > .menuItemContent': {\r\n            backgroundColor: theme.palette.primary.bgHover,\r\n            color: theme.palette.primary.main,\r\n          },\r\n        },\r\n        '& .Mui-selected:hover': {\r\n          '& > .menuItemContent': {\r\n            color: theme.palette.primary.main,\r\n            backgroundColor: theme.palette.primary.bgHover,\r\n          },\r\n        },\r\n        '&:hover': {\r\n          backgroundColor: theme.palette.primary.bgHover,\r\n          color: theme.palette.primary.main,\r\n        },\r\n        '&>.active': {\r\n          '& > .menuItemContent': {\r\n            color: theme.palette.primary.main,\r\n            backgroundColor: theme.palette.primary.bgHover,\r\n          },\r\n        },\r\n        '& > .menuItem': {\r\n          padding: 0,\r\n          paddingLeft: '26px',\r\n          '& > .menuItemContent': {\r\n            display: 'flex',\r\n            width: '100%',\r\n            position: 'relative',\r\n            boxSizing: 'border-box',\r\n            textAlign: 'left',\r\n            alignItems: 'center',\r\n            justifyContent: 'flex-start',\r\n            textDecoration: 'none',\r\n            color: theme.palette.common.blackRegular,\r\n            '&.active': {\r\n              color: theme.palette.primary.main,\r\n            },\r\n            '& > .menuItemTextInset': {\r\n              paddingLeft: props => (props.isOpen ? '0px' : '40px'),\r\n              paddingBlock: '6px',\r\n              margin: 0,\r\n            },\r\n            '& *': {\r\n              fontWeight: '900', //theme.typography.fontWeightBold,\r\n              fontSize: '13px',\r\n            },\r\n            '&:hover': {\r\n              color: theme.palette.primary.main,\r\n            },\r\n          },\r\n        },\r\n      },\r\n    },\r\n    selected: {},\r\n    sideBarHeader: {\r\n      minHeight: '48px',\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'space-between',\r\n      alignItems: 'center',\r\n      padding: props => (props.isOpen ? '0px 16px' : '0px 8px'),\r\n      gap: 16,\r\n    },\r\n    sideBarFooter: {\r\n      minHeight: '48px',\r\n      display: 'flex',\r\n      flexDirection: 'row',\r\n      justifyContent: 'space-between',\r\n      alignItems: 'center',\r\n      padding: '0px 16px',\r\n      fontSize: '12px',\r\n      gap: 16,\r\n    },\r\n  }),\r\n);\r\n","import { Box, Divider } from '@material-ui/core';\r\nimport { BookitlabShortLogo } from 'app/components/BookitlabLogo/BookitlabShortLogo';\r\nimport { Link } from 'app/components/ExternalLink';\r\nimport { selectWebVersion } from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { useStyles } from '../styles';\r\n\r\nexport interface SideBarFooterProps {\r\n  isOpen?: boolean;\r\n}\r\n\r\nexport const SideBarFooter = React.memo(function SideBarFooter(\r\n  props: SideBarFooterProps,\r\n) {\r\n  const classes = useStyles({ isOpen: props.isOpen ?? false });\r\n  const { t } = useTranslation();\r\n  const webVersion = useSelector(selectWebVersion);\r\n  return (\r\n    <React.Fragment>\r\n      <Divider />\r\n      <div className={classes.sideBarFooter}>\r\n        <BookitlabShortLogo />\r\n        <Box>{`V: ${webVersion} `}</Box>\r\n        <Box>\r\n          <Link href=\"/TermsOfUseAgreement.aspx\" target=\"_blank\">\r\n            {t(translations.TermsOfUse)}\r\n          </Link>\r\n        </Box>\r\n      </div>\r\n    </React.Fragment>\r\n  );\r\n});\r\n","import { AddReservation } from 'app/pages/Actions/PageTopActions/AddReservation';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { CoreSelectionButton } from 'app/components/GlobalServiceGroupFilter/CoreSelectionButton';\r\nimport clsx from 'clsx';\r\nimport { AssetQuickSearch } from 'app/components/AssetQuickSearch';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectShowSearchInSidebar } from 'app/components/AssetQuickSearch/slice/selectors';\r\nimport * as React from 'react';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectGlobalSetting,\r\n  selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { toEntityEnumArray } from 'utils/enumKeys';\r\nimport { SideBarQuickActionsEnum } from 'enums/enums';\r\nimport { NewWorkOrderButton } from 'app/pages/WorkOrdersPage/Actions/NewWorkOrder';\r\nimport { useAsyncGetWthEffect } from 'app/hooks/useAsyncGetOnMount';\r\nimport { IServiceGroupDto } from 'api/odata/generated/entities/IServiceGroupDto';\r\nimport { quoteODataValue } from 'api/odata/ODataFilter';\r\nimport { httpClient } from 'api/HttpClient';\r\n\r\nexport interface SideBarQuickActionProps {\r\n  isOpen?: boolean;\r\n  isMobile?: boolean;\r\n}\r\n\r\nexport function SideBarQuickAction(props: SideBarQuickActionProps) {\r\n  const { isOpen, isMobile } = props;\r\n  const { t } = useTranslation();\r\n  const showSearchInSidebar = useSelector(selectShowSearchInSidebar);\r\n  const savedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n  const actionOptions = toEntityEnumArray(SideBarQuickActionsEnum, t);\r\n  const fetchCoreQuickAction = (\r\n    serviceGroupId: number | undefined,\r\n  ): Promise<IServiceGroupDto | undefined> => {\r\n    return new Promise((resolve, reject) => {\r\n      if (!serviceGroupId) {\r\n        resolve(undefined);\r\n      } else {\r\n        (async () => {\r\n          try {\r\n            const url =\r\n              '/api/odata/v4/servicegroups/GetGlobalServiceGroupsFilter';\r\n            const params = {\r\n              $select: 'Id,Name,SidebarQuickAction',\r\n              $filter: `Id eq ${quoteODataValue(serviceGroupId)}`,\r\n            };\r\n\r\n            let groups = await httpClient\r\n              .get(url, params)\r\n              .then(response => response.value as IServiceGroupDto[]);\r\n            resolve(groups[0]);\r\n          } catch {\r\n            resolve(undefined);\r\n          }\r\n        })();\r\n      }\r\n    });\r\n  };\r\n  const defaultSystemAction = useSelector(state =>\r\n    selectGlobalSetting(state, AllowedSettings.SideBarQuickActions),\r\n  );\r\n  const systemAction = React.useMemo(() => {\r\n    if (defaultSystemAction === 'NA') {\r\n      return undefined;\r\n    }\r\n    return actionOptions.some(f => f.OriginalName === defaultSystemAction)\r\n      ? actionOptions.filter(f => f.OriginalName === defaultSystemAction)[0].Id\r\n      : 1;\r\n  }, [actionOptions, defaultSystemAction]);\r\n\r\n  const serviceGroup = React.useMemo(() => {\r\n    return showGroups && !!savedServiceGroups && savedServiceGroups.length === 1\r\n      ? savedServiceGroups[0]\r\n      : undefined;\r\n  }, [savedServiceGroups, showGroups]);\r\n\r\n  const coreSelected = useAsyncGetWthEffect<IServiceGroupDto | undefined>(\r\n    () => fetchCoreQuickAction(serviceGroup?.Id),\r\n    undefined,\r\n    [serviceGroup],\r\n  );\r\n\r\n  const baseAction = React.useMemo(() => {\r\n    return !!coreSelected &&\r\n      coreSelected.SidebarQuickAction !== null &&\r\n      coreSelected.SidebarQuickAction !== undefined &&\r\n      coreSelected.SidebarQuickAction > 0\r\n      ? coreSelected.SidebarQuickAction\r\n      : !!systemAction\r\n      ? systemAction\r\n      : undefined;\r\n  }, [coreSelected, systemAction]);\r\n  return (\r\n    <div\r\n      className={clsx('sideBarQickAction', {\r\n        sideBarQickActionMobile: isMobile,\r\n      })}\r\n    >\r\n      {isMobile && isOpen && showSearchInSidebar && (\r\n        <AssetQuickSearch showInSideBar={showSearchInSidebar} />\r\n      )}\r\n      {isMobile && <CoreSelectionButton />}\r\n      {!!baseAction && (\r\n        <React.Fragment>\r\n          {baseAction === 1 ? (\r\n            <AddReservation\r\n              id=\"quick-actions-menu-add-reservation\"\r\n              compact={!isMobile}\r\n              text={t(translations.Reservation) as string}\r\n              size=\"small\"\r\n              isIconButton={isMobile ? false : !isOpen}\r\n              variant=\"main\"\r\n              isExpanded={true}\r\n              fullWidth\r\n            />\r\n          ) : (\r\n            <NewWorkOrderButton\r\n              id=\"quick-actions-menu-add-workorder\"\r\n              fullWidth\r\n              isIconButton={isMobile ? false : !isOpen}\r\n              noChangeOnMobile={isMobile}\r\n              variant=\"main\"\r\n            />\r\n          )}\r\n        </React.Fragment>\r\n      )}\r\n    </div>\r\n  );\r\n}\r\n","/**\r\n *\r\n * SideBar\r\n *\r\n */\r\nimport * as React from 'react';\r\n\r\nimport { useSelector } from 'react-redux';\r\nimport { selectSiteMapSettings } from 'app/slice/selectors';\r\nimport { SideBarMenu } from './SideBarMenu';\r\nimport { SideBarHeader } from './SideBarHeader';\r\nimport { SiteMapNode, SiteMapProvider } from 'types/SiteMapSettings';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { SideBarFooter } from './SideBarFooter';\r\nimport { SideBarQuickAction } from './SideBarQuickAction';\r\nimport { selectRouterPathname } from 'app/slice/router-selectors';\r\ninterface Props {\r\n  isOpen: boolean;\r\n  isMobile?: boolean;\r\n}\r\n\r\nconst SideBarComponent = (props: Props) => {\r\n  const { isOpen, isMobile } = props;\r\n  const siteMapSettings = useSelector(selectSiteMapSettings);\r\n  const [currentNode, setCurrentNode] = React.useState<SiteMapNode | undefined>(\r\n    undefined,\r\n  );\r\n  const routerPathName = useSelector(selectRouterPathname);\r\n  const location = useLocation();\r\n  const [currentNodes, setCurrentNodes] = React.useState<SiteMapNode[]>([]);\r\n  const loading = isNullOrUndefined(siteMapSettings);\r\n  React.useEffect(() => {\r\n    setCurrentNode(() =>\r\n      new SiteMapProvider(siteMapSettings).getCurrentMainNode(\r\n        location?.pathname || routerPathName || window.location.pathname,\r\n      ),\r\n    );\r\n  }, [location?.pathname, routerPathName, siteMapSettings]);\r\n  React.useEffect(() => {\r\n    let active = !isNullOrUndefined(siteMapSettings);\r\n    if (currentNodes.length > 0) {\r\n      return undefined;\r\n    }\r\n    if (active) {\r\n      let siteMapProvider = new SiteMapProvider(siteMapSettings);\r\n      setCurrentNode(() =>\r\n        siteMapProvider.getCurrentMainNode(\r\n          location?.pathname || routerPathName || window.location.pathname,\r\n        ),\r\n      );\r\n      setCurrentNodes(\r\n        siteMapProvider.getCurrentNodes(\r\n          location?.pathname || routerPathName || window.location.pathname,\r\n        ),\r\n      );\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [currentNodes, loading, location, routerPathName, siteMapSettings]);\r\n  return (\r\n    <React.Fragment>\r\n      <SideBarHeader isOpen={isOpen} />\r\n      <SideBarQuickAction isOpen={isOpen} isMobile={isMobile} />\r\n      <SideBarMenu\r\n        menuItems={currentNodes}\r\n        isOpen={isOpen}\r\n        currentNode={currentNode}\r\n        loading={loading}\r\n        isMobile={isMobile}\r\n      />\r\n      {isMobile && <SideBarFooter />}\r\n    </React.Fragment>\r\n  );\r\n};\r\nexport const SideBar = React.memo(SideBarComponent);\r\n","import * as React from 'react';\r\nimport Drawer from '@material-ui/core/Drawer';\r\nimport { SideBar } from 'app/Layout/FrontendLayout/components/SideBar';\r\nimport clsx from 'clsx';\r\nimport { ClickAwayListener } from '@material-ui/core';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\n\r\nexport interface SideBarDrawerProps {\r\n  hideNavigation: boolean | undefined;\r\n  isMobile: boolean;\r\n  isLandscape?: boolean;\r\n  handleDrawerClose: (event: any, reason: any) => void;\r\n}\r\nexport const SideBarDrawer = React.memo(function SideBarDrawer(\r\n  props: SideBarDrawerProps,\r\n) {\r\n  const { isMobile, handleDrawerClose, isLandscape } = props;\r\n  const expanded = useSelector(state =>\r\n    selectIsExpandedSideBar(state, isMobile),\r\n  );\r\n  const { toggle } = useExpandedSideBarState();\r\n  return !props.hideNavigation ? (\r\n    <ClickAwayListener\r\n      onClickAway={event => {\r\n        console.log('menu target: ', (event.target as any).nodeName);\r\n        if (\r\n          ((event.target as any).nodeName === 'path' ||\r\n            (event.target as any).nodeName === 'svg' ||\r\n            (event.target as any).nodeName === 'BODY') &&\r\n          event.type === 'click'\r\n        ) {\r\n          return;\r\n        }\r\n        if (isMobile) {\r\n          event.stopPropagation();\r\n          event.preventDefault();\r\n          if (expanded) {\r\n            toggle();\r\n          }\r\n        }\r\n      }}\r\n    >\r\n      <Drawer\r\n        tabIndex={0}\r\n        variant={isMobile ? 'temporary' : 'permanent'}\r\n        open={expanded}\r\n        disablePortal={isMobile}\r\n        onClose={handleDrawerClose}\r\n        ModalProps={{\r\n          hideBackdrop: true,\r\n        }}\r\n        className={clsx('sideBarDrawer', {\r\n          sideBarMobile: isMobile,\r\n          sideBarMobileHorizontal: isMobile && isLandscape,\r\n          drawerOpen: expanded,\r\n          drawerClose: !expanded,\r\n        })}\r\n      >\r\n        <SideBar isOpen={expanded} isMobile={isMobile} />\r\n      </Drawer>\r\n    </ClickAwayListener>\r\n  ) : null;\r\n});\r\n","import { Theme } from '@material-ui/core';\r\nimport transitions from '@material-ui/core/styles/transitions';\r\nimport styled from 'styled-components';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { SIDE_PANEL_WIDTH } from 'styles/constantVariables';\r\nimport { verticalScrolling } from 'styles/CssVariables/styledVariables';\r\n// width: 370px;\r\n//     left: calc(100vw - 370px);\r\n// transition: ${transitions.create('width', {\r\n//   easing: transitions.easing.sharp,\r\n//   duration: 500,\r\n// })};\r\nexport const LayoutRoot = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  &.layoutroot {\r\n    direction: ltr;\r\n    @media (min-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n      display: flex;\r\n    }\r\n    &.layoutRootMobile {\r\n      display: inline-flex;\r\n      justify-content: flex-end;\r\n      align-items: flex-start;\r\n      width: 100%;\r\n      margin-bottom: env(safe-area-inset-bottom, 50px);\r\n    }\r\n    & .sidePanelRoot {\r\n      height: 0;\r\n      position: absolute;\r\n      top: 0;\r\n      right: 0;\r\n    }\r\n    & .sidePanelMobileRoot {\r\n      height: 0;\r\n      position: absolute;\r\n      top: 50px;\r\n      left: 0;\r\n      max-height: calc(100dvh - 50px);\r\n      width: 100%;\r\n      margin-bottom: env(safe-area-inset-bottom, 50px);\r\n      margin-top: env(safe-area-inset-top);\r\n    }\r\n    & .backdropOpen {\r\n      height: 50px;\r\n      position: absolute;\r\n      top: -50px;\r\n      left: 0;\r\n      width: 100%;\r\n      background: ${bookitColors.overlays.overlayBlack};\r\n    }\r\n    & .sidePanelRootExpanded {\r\n      width: 100%;\r\n      transition: ${transitions.create('width', {\r\n        easing: transitions.easing.easeInOut,\r\n        duration: 500,\r\n      })};\r\n    }\r\n    & .sidePanelRootCollapsed {\r\n    }\r\n  }\r\n`;\r\nexport const Main = styled.main.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  direction: ltr;\r\n  @media (min-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n    display: flex;\r\n  }\r\n\r\n  flex-grow: 1;\r\n  min-height: 100dvh;\r\n  background: ${bookitColors.grayscale.grayBackground};\r\n  display: flex;\r\n  flex-direction: column;\r\n  justify-content: space-between;\r\n  margin-right: 0;\r\n  overflow: hidden;\r\n  height: 100dvh;\r\n  margin-bottom: env(safe-area-inset-bottom, 50px);\r\n  ${verticalScrolling}\r\n  &.shiftLeft {\r\n    margin-right: ${SIDE_PANEL_WIDTH}px;\r\n  }\r\n  & .appBarSpacer {\r\n    min-height: 60px;\r\n    &.subBarExpanded {\r\n      min-height: 118px;\r\n    }\r\n  }\r\n  & .container {\r\n    padding: 0px;\r\n    position: relative;\r\n    background-color: ${bookitColors.grayscale.grayBackground};\r\n    height: 100%;\r\n    display: flex;\r\n    flex-direction: column;\r\n    width: 100%;\r\n    margin-right: auto;\r\n    margin-left: auto;\r\n    overflow-y: auto;\r\n    overflow-x: hidden;\r\n    margin-bottom: env(safe-area-inset-bottom, 50px);\r\n    &.mobileOpen {\r\n      position: relative;\r\n      margin-left: calc(100% - 44px);\r\n    }\r\n    &.useselectable {\r\n      overflow-y: hidden;\r\n    }\r\n  }\r\n  & .footer {\r\n    margin-top: auto;\r\n    & .copyRight {\r\n      padding-top: 8px;\r\n      margin-top: auto;\r\n      margin-inline: '8px';\r\n    }\r\n  }\r\n`;\r\nexport const AssetWrapperRoot = styled.div.attrs(props => ({ props }))<{\r\n  theme: Theme;\r\n}>`\r\n  &.publicLayoutroot {\r\n    display: inline-flex;\r\n    flex-direction: column;\r\n    align-items: flex-start;\r\n    width: 100%;\r\n    gap: 24px;\r\n    padding: 32px;\r\n    background-color: ${bookitColors.grayscale.graybgComponents};\r\n    overflow-y: hidden;\r\n    direction: ltr;\r\n    @media (min-width: ${props => props.theme.breakpoints.values.sm}px) {\r\n      display: flex;\r\n    }\r\n    &.isAuthPanel {\r\n      padding: 24px;\r\n    }\r\n    &.publicLayoutRootMobile {\r\n      display: inline-flex;\r\n      flex-direction: column;\r\n      align-items: flex-start;\r\n      width: 100%;\r\n      padding: 0;\r\n      overflow: hidden;\r\n      background-color: ${bookitColors.grayscale.graybgComponents};\r\n\r\n      justify-content: flex-end;\r\n      align-items: flex-start;\r\n      width: 100%;\r\n    }\r\n    & .sidePanelRoot {\r\n      height: 0;\r\n      position: absolute;\r\n      top: 0;\r\n      right: 0;\r\n    }\r\n    & .sidePanelMobileRoot {\r\n      height: 0;\r\n      position: absolute;\r\n      top: 50px;\r\n      left: 0;\r\n      max-height: calc(100dvh - 50px);\r\n      width: 100%;\r\n    }\r\n    & .backdropOpen {\r\n      height: 50px;\r\n      position: absolute;\r\n      top: -50px;\r\n      left: 0;\r\n      width: 100%;\r\n      background: ${bookitColors.overlays.overlayBlack};\r\n    }\r\n    & .sidePanelRootExpanded {\r\n      width: 100%;\r\n      transition: ${transitions.create('width', {\r\n        easing: transitions.easing.easeInOut,\r\n        duration: 500,\r\n      })};\r\n    }\r\n    & .sidePanelRootCollapsed {\r\n    }\r\n  }\r\n`;\r\n","import {\r\n  LinearProgress,\r\n  Popper,\r\n  PopperProps,\r\n  Theme,\r\n  useTheme,\r\n} from '@material-ui/core';\r\nimport styled from 'styled-components';\r\nimport { IPathAndQuery, toRootedURL } from 'utils/url-utils';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAdminPanelOpen,\r\n  selectAdminPanelUrl,\r\n} from '../../slice/selectors';\r\nimport { DRAWER_WIDTH } from 'styles/constantVariables';\r\nimport { useLayoutSlice } from '../../slice';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { selectIsExpandedSideBar } from 'app/slice/selectors';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n// import Frame from 'react-frame-component';\r\n\r\nexport interface AdminPanelProps {}\r\nexport const AdminPanelPopper = styled(\r\n  ({\r\n    sideBarOpen,\r\n    theme,\r\n    children,\r\n    ...other\r\n  }: {\r\n    sideBarOpen: boolean;\r\n    theme: Theme;\r\n    children: React.ReactNode;\r\n  } & PopperProps) => <Popper {...other}>{children}</Popper>,\r\n)`\r\n  &.admin-panel {\r\n    z-index: ${props => props.theme.zIndex.modal};\r\n    height: 100dvh;\r\n    width: 100%;\r\n    margin-left: ${props => (props.sideBarOpen ? DRAWER_WIDTH : 56)}px;\r\n    & .admin-panel-paper {\r\n      background: ${props => props.theme.palette.common.white};\r\n      border-radius: 0;\r\n      height: 100%;\r\n      width: calc(100% - ${props => (props.sideBarOpen ? DRAWER_WIDTH : 56)}px);\r\n      margin: 0;\r\n      box-shadow: unset;\r\n      & .admin-panel-header {\r\n        display: flex;\r\n        justify-content: flex-end;\r\n        padding: 8px;\r\n      }\r\n    }\r\n  }\r\n`;\r\nexport function AdminPanel(props: AdminPanelProps) {\r\n  const adminPanelOpen = useSelector(selectAdminPanelOpen);\r\n  const adminUrl = useSelector(selectAdminPanelUrl);\r\n  const dispatch = useDispatch();\r\n  const { t } = useTranslation();\r\n  const { actions: layoutActions } = useLayoutSlice();\r\n  const isMobile = DetectIsMobile();\r\n  const sideBarOpen = useSelector(state =>\r\n    selectIsExpandedSideBar(state, isMobile),\r\n  );\r\n  const [iframeLoaded, setIframeLoaded] = React.useState<boolean>(false);\r\n  const elementRef = React.useRef<HTMLDivElement>(null);\r\n\r\n  const iframeRef = React.useRef<HTMLIFrameElement>(null);\r\n  const absolutePath = React.useMemo(() => {\r\n    return adminUrl !== undefined\r\n      ? typeof adminUrl === 'string'\r\n        ? toRootedURL(adminUrl)\r\n        : toRootedURL(\r\n            (adminUrl as IPathAndQuery).path,\r\n            (adminUrl as IPathAndQuery).search,\r\n          )\r\n      : undefined;\r\n  }, [adminUrl]);\r\n  const theme = useTheme();\r\n  const countState = React.useState(0);\r\n  React.useEffect(() => {\r\n    countState[1](c => c + 1);\r\n    // setCount (rerender) needs to occur after element elementRef.current value is bound\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, [elementRef.current]);\r\n  const closeAdminPanel = React.useCallback(() => {\r\n    dispatch(layoutActions.resetAdminPanel());\r\n  }, [dispatch, layoutActions]);\r\n  const handleIfarameLoad = () => {\r\n    setIframeLoaded(true);\r\n  };\r\n  // React.useEffect(() => {\r\n  //   if (!!iframeRef.current) {\r\n  //     let doc = iframeRef.current.contentWindow;\r\n  //   }\r\n  //   return () => {};\r\n  // }, []);\r\n  return (\r\n    <AdminPanelPopper\r\n      sideBarOpen={sideBarOpen}\r\n      className={'admin-panel'}\r\n      open={adminPanelOpen}\r\n      theme={theme}\r\n      anchorEl={elementRef.current}\r\n      placement={'left-start'}\r\n      transition\r\n      modifiers={{\r\n        keepTogether: { enabled: true },\r\n        preventOverflow: {\r\n          enabled: true,\r\n          // altAxis: true,\r\n          // altBoundary: true,\r\n          // tether: false,\r\n          // rootBoundary: 'document',\r\n          boundariesElement: 'window', //scrollParent, window, viewport\r\n          padding: 0,\r\n        },\r\n        flip: { enabled: false },\r\n        // offset: {\r\n        //   offset: '0,-10',\r\n        // },\r\n      }}\r\n    >\r\n      <div className={'admin-panel-paper'}>\r\n        <React.Fragment>\r\n          {adminPanelOpen && !!absolutePath ? (\r\n            <React.Fragment>\r\n              <div className={'admin-panel-header'}>\r\n                <IconButton\r\n                  variant=\"ghost\"\r\n                  aria-label=\"close\"\r\n                  size=\"small\"\r\n                  shape=\"square\"\r\n                  onClick={closeAdminPanel}\r\n                  title={t(translations.Close)}\r\n                >\r\n                  <Icon\r\n                    icon=\"times\"\r\n                    size=\"lg\"\r\n                    color=\"default\"\r\n                    colorExtend=\"textHover\"\r\n                  />\r\n                </IconButton>\r\n              </div>\r\n              {!iframeLoaded && (\r\n                <div style={{ width: '100%' }}>\r\n                  <LinearProgress variant=\"query\" color=\"primary\" />\r\n                </div>\r\n              )}\r\n              <iframe\r\n                title=\"adminpanel\"\r\n                ref={iframeRef}\r\n                src={absolutePath}\r\n                width=\"100%\"\r\n                height=\"100%\"\r\n                onLoad={handleIfarameLoad}\r\n                id=\"adminPanelIframeId\"\r\n              ></iframe>\r\n            </React.Fragment>\r\n          ) : (\r\n            <div style={{ height: '100%', maxHeight: '100dvh' }}></div>\r\n          )}\r\n        </React.Fragment>\r\n      </div>\r\n    </AdminPanelPopper>\r\n  );\r\n}\r\n","/**\r\n *\r\n * Layout\r\n *\r\n */\r\nimport React from 'react';\r\nimport clsx from 'clsx';\r\nimport { Copyright } from 'app/components/Copyright';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { SidePanel } from './components/SidePanel';\r\nimport {\r\n  selectConfirmOpen,\r\n  selectExpandedSidePanel,\r\n  selectHideNavigation,\r\n  selectSidePanelOpen,\r\n} from './slice/selectors';\r\nimport { TopBar } from './components/TopBar';\r\nimport useExpandedSideBarState from 'app/hooks/useExpandedSideBarState';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useLayoutSlice } from './slice';\r\nimport { translations } from 'locales/translations';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { useRequiredRedirect } from 'app/hooks/useRequiredRedirectToCoreSelection';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\nimport { SideBarDrawer } from './SideBarDrawer';\r\nimport { LayoutRoot, Main } from './styled';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { DRAWER_MOBILE_WIDTH, DRAWER_WIDTH } from 'styles/constantVariables';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n  selectIsExpandedSideBar,\r\n  selectIsSubBarCollapsed,\r\n  selectShowGlobalServiceGroupFilter,\r\n} from 'app/slice/selectors';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AdminPanel } from './components/AdminPanel';\r\n\r\ninterface Props {\r\n  children: React.ReactNode;\r\n}\r\n\r\nexport const FrontendLayout_MainContent_ID = 'main_div_content';\r\nexport function FrontendLayout({ children }: Props) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { actions: appActions } = useAppSettingsSlice();\r\n  const { checkIsMobile, isLandscape } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const expanded = useSelector(state =>\r\n    selectIsExpandedSideBar(state, isMobile),\r\n  );\r\n  const { expand } = useExpandedSideBarState();\r\n\r\n  const sidePanelExpanded = useSelector(selectExpandedSidePanel);\r\n  const sidePanelOpen = useSelector(selectSidePanelOpen);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const isBudgets = IsModuleEnabled(appSettings, KnownModules.Budgets);\r\n  const collapsedBar = useSelector(selectIsSubBarCollapsed);\r\n  const showGroups = useSelector(selectShowGlobalServiceGroupFilter);\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n\r\n  const confirmOpen = useSelector(selectConfirmOpen);\r\n  const hideNavigation = useSelector(selectHideNavigation);\r\n  const {\r\n    redirectToCoreSelection,\r\n    redirectToTermsOfUseAgreement,\r\n    redirectToActiveUserGroup,\r\n    redirectToUsageKiosk,\r\n    redirectToUsageRoom,\r\n    redirectToConsumableKiosk,\r\n    redirectToJoinAdGroup,\r\n  } = useRequiredRedirect();\r\n  const drawerWidth = React.useMemo(() => {\r\n    return isMobile ? DRAWER_MOBILE_WIDTH : DRAWER_WIDTH;\r\n  }, [isMobile]);\r\n  const marginRight = React.useMemo(() => {\r\n    return sidePanelOpen && !sidePanelExpanded && !isMobile;\r\n  }, [isMobile, sidePanelExpanded, sidePanelOpen]);\r\n  React.useEffect(() => {\r\n    let isRedirectToTermsOfUseAgreement =\r\n      redirectToTermsOfUseAgreement === true;\r\n    let isRedirectToActiveUserGroup = redirectToActiveUserGroup === true;\r\n    let isRedirectToCoreSelection = redirectToCoreSelection === true;\r\n    let isRedirectToUsageKiosk = redirectToUsageKiosk === true;\r\n    let isRedirectToUsageRoom = redirectToUsageRoom === true;\r\n    let isRedirectToConsumableKiosk = redirectToConsumableKiosk === true;\r\n    let isRedirectToJoinAdGroup = redirectToJoinAdGroup === true;\r\n    if (isRedirectToTermsOfUseAgreement === true) {\r\n      dispatch(appActions.navigate('/TermsOfUseAgreement/exp'));\r\n      return;\r\n    } else {\r\n      if (isRedirectToActiveUserGroup === true) {\r\n        dispatch(appActions.navigate('/ActiveUserGroup'));\r\n        return;\r\n      }\r\n    }\r\n    if (isRedirectToUsageKiosk) {\r\n      window.open(toRootedURL('/UsageKiosk.aspx'));\r\n      return;\r\n    }\r\n    if (isRedirectToUsageRoom) {\r\n      window.open(toRootedURL('/InstrumentRoom.aspx'));\r\n      return;\r\n    }\r\n    if (isRedirectToConsumableKiosk) {\r\n      dispatch(\r\n        appActions.navigate(\r\n          isBudgets ? '/kiosk/projects' : '/kiosk/projects/consumables',\r\n        ),\r\n      );\r\n      return;\r\n    }\r\n    if (isRedirectToJoinAdGroup) {\r\n      let url: string = '/join';\r\n      if (!!authenticatedUser?.ActiveUserGroup?.Id) {\r\n        url = `${url}?${toQueryString({\r\n          un: authenticatedUser?.Id,\r\n          adg: authenticatedUser?.ActiveUserGroup?.Id,\r\n          action: 'join',\r\n        })}`;\r\n      }\r\n      dispatch(appActions.navigate(url));\r\n      return;\r\n    }\r\n    if (isRedirectToCoreSelection) {\r\n      dispatch(appActions.navigate('/coreselection'));\r\n      dispatch(\r\n        appActions.addNotification({\r\n          key: 'coreSelection_error',\r\n          message: 'Please select core/s',\r\n          variant: 'error',\r\n        }),\r\n      );\r\n    }\r\n\r\n    return () => {\r\n      isRedirectToCoreSelection = false;\r\n      isRedirectToTermsOfUseAgreement = false;\r\n      isRedirectToActiveUserGroup = false;\r\n      isRedirectToUsageKiosk = false;\r\n      isRedirectToUsageRoom = false;\r\n      isRedirectToConsumableKiosk = false;\r\n      isRedirectToJoinAdGroup = false;\r\n    };\r\n  }, [\r\n    actions,\r\n    appActions,\r\n    dispatch,\r\n    redirectToCoreSelection,\r\n    redirectToTermsOfUseAgreement,\r\n    redirectToActiveUserGroup,\r\n    redirectToUsageKiosk,\r\n    redirectToUsageRoom,\r\n    redirectToConsumableKiosk,\r\n    isBudgets,\r\n    redirectToJoinAdGroup,\r\n    authenticatedUser?.ActiveUserGroup,\r\n    authenticatedUser?.Id,\r\n  ]);\r\n\r\n  const handleDrawerClose = React.useCallback(\r\n    (event, reason) => {\r\n      expand(!expanded);\r\n    },\r\n    [expand, expanded],\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    dispatch(actions.setIsMobileView(isMobile));\r\n  }, [actions, dispatch, isMobile]);\r\n  const handleRejectConfirm = React.useCallback(() => {\r\n    dispatch(actions.setConfirmRejected(true));\r\n  }, [actions, dispatch]);\r\n  const handleApproveConfirm = React.useCallback(() => {\r\n    dispatch(actions.setConfirmApproved(true));\r\n  }, [actions, dispatch]);\r\n  const theme = useTheme();\r\n  return (\r\n    <LayoutRoot\r\n      theme={theme}\r\n      className={clsx('layoutroot', { layoutRootMobile: isMobile })}\r\n    >\r\n      {!isMobile && !hideNavigation && (\r\n        <TopBar\r\n          drawerWidth={drawerWidth}\r\n          sidePanelCollapsed={sidePanelOpen && !sidePanelExpanded}\r\n          isOpen={expanded}\r\n        />\r\n      )}\r\n\r\n      <SideBarDrawer\r\n        hideNavigation={hideNavigation}\r\n        isMobile={isMobile}\r\n        isLandscape={isLandscape}\r\n        handleDrawerClose={handleDrawerClose}\r\n      />\r\n      {/* id is required on main in order for infinite scroll to work according to main's scrollbar*/}\r\n      <Main\r\n        theme={theme}\r\n        id=\"FrontendLayout_mainContent\"\r\n        className={clsx('content', marginRight ? 'shiftLeft' : '')}\r\n      >\r\n        {!isMobile && (\r\n          <div\r\n            className={\r\n              hideNavigation\r\n                ? undefined\r\n                : clsx('appBarSpacer', {\r\n                    subBarExpanded: !collapsedBar && showGroups,\r\n                  })\r\n            }\r\n          />\r\n        )}\r\n        <div\r\n          id={FrontendLayout_MainContent_ID}\r\n          className={clsx('container', {\r\n            useselectable: isMobile,\r\n            mobileOpen: expanded && isMobile,\r\n          })}\r\n        >\r\n          <React.Fragment>{children}</React.Fragment>\r\n          {!isMobile && (\r\n            <footer className={'footer'}>\r\n              <Copyright />\r\n            </footer>\r\n          )}\r\n        </div>\r\n      </Main>\r\n\r\n      <SidePanel />\r\n      <AdminPanel />\r\n      <DialogConfirm\r\n        isOpen={confirmOpen}\r\n        body={t(translations.NotSavedChanges_message) as string}\r\n        title={t(translations.NotSavedChanges_title) as string}\r\n        confirmButtonLabel={t(translations.Yes)}\r\n        cancelButtonLabel={t(translations.No)}\r\n        onConfirm={() => {\r\n          handleApproveConfirm();\r\n        }}\r\n        onCancel={() => {\r\n          handleRejectConfirm();\r\n        }}\r\n        id=\"confirm_sidepanel\"\r\n        aria-labelledby=\"side-panel-confirm\"\r\n      />\r\n    </LayoutRoot>\r\n  );\r\n}\r\n","import { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport {\r\n  selectGlobalServiceGroupFilter,\r\n  selectIsAuthenticated,\r\n  selectLoading,\r\n  selectGlobalSettingBool,\r\n  selectShowGlobalServiceGroupFilter,\r\n  selectAuthenticatedUser,\r\n  selectAppSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { UserGroupsProviderTypes } from 'enums/GlobalEnums';\r\nimport { JoinStatusEnum } from 'enums/JoinStatus';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { useLocationChange } from './useLocationChange';\r\n\r\nexport const useRequiredRedirect = () => {\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const selectedServiceGroups = useSelector(selectGlobalServiceGroupFilter);\r\n  const globalCoreVisible = useSelector(selectShowGlobalServiceGroupFilter);\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const loading = useSelector(selectLoading);\r\n  const topServiceGroupsIsHidden = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.HideTopServiceGroupFilter),\r\n  );\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const termsOfUseAgreementEnabled = React.useMemo(\r\n    () => IsModuleEnabled(appSettings, KnownModules.TermsOfUseAgreement),\r\n    [appSettings],\r\n  );\r\n  const multipleAdGroupsModuleEnabled = React.useMemo(\r\n    () => IsModuleEnabled(appSettings, KnownModules.MultipleAdGroups),\r\n    [appSettings],\r\n  );\r\n  const joinAdGroupEnabled = React.useMemo(\r\n    () => IsModuleEnabled(appSettings, KnownModules.JoinAdGroup),\r\n    [appSettings],\r\n  );\r\n  const UserGroupsProviderType = React.useMemo(\r\n    () => appSettings?.UserGroupsProviderType,\r\n    [appSettings],\r\n  );\r\n  const { savedEnabled: isFirstLogin } = useProfileSetting({\r\n    profileSettingKey: 'IsFirstLoginUser',\r\n  });\r\n  const { savedEnabled: OptOutCoreSelection } = useProfileSetting({\r\n    profileSettingKey: 'CoreSelectionOptOut',\r\n  });\r\n  const { savedEnabled: isFirstActiveUserGroupSelected } = useProfileSetting({\r\n    profileSettingKey: 'IsFirstActiveUserGroupSelected',\r\n  });\r\n  const skipCoreSelectionScreen = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.SkipCoreSelectionScreen),\r\n  );\r\n  const usageKioskRoleEnabled = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.UsageKioskRoleEnabled),\r\n  );\r\n  const roomUserRoleEnabled = useSelector(state =>\r\n    selectGlobalSettingBool(state, AllowedSettings.RoomUserRoleEnabled),\r\n  );\r\n  const [\r\n    redirectToTermsOfUseAgreement,\r\n    setRedirectToTermsOfUseAgreement,\r\n  ] = React.useState<boolean>(false);\r\n  const [\r\n    redirectToActiveUserGroup,\r\n    setRedirectToActiveUserGroup,\r\n  ] = React.useState<boolean>(false);\r\n  const [redirectToCoreSelection, setRedirectToCoreSelection] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [redirectToUsageKiosk, setRedirectToUsageKiosk] = React.useState<\r\n    boolean\r\n  >(false);\r\n  const [redirectToUsageRoom, setRedirectToUsageRoom] = React.useState<boolean>(\r\n    false,\r\n  );\r\n  const [\r\n    redirectToConsumableKiosk,\r\n    setRedirectToConsumableKiosk,\r\n  ] = React.useState<boolean>(false);\r\n  const [redirectToJoinAdGroup, setRedirectToJoinAdGroup] = React.useState<\r\n    boolean\r\n  >(false);\r\n  React.useEffect(() => {\r\n    if (!loading && isAuthenticated) {\r\n      if (\r\n        !topServiceGroupsIsHidden &&\r\n        !skipCoreSelectionScreen &&\r\n        globalCoreVisible\r\n      ) {\r\n        if (\r\n          !selectedServiceGroups ||\r\n          selectedServiceGroups.length < 1 ||\r\n          (!OptOutCoreSelection && isFirstLogin)\r\n        ) {\r\n          if (window.location.pathname.indexOf('/coreselection') === -1) {\r\n            setRedirectToCoreSelection(true);\r\n          } else {\r\n            setRedirectToCoreSelection(false);\r\n          }\r\n        } else {\r\n          setRedirectToCoreSelection(false);\r\n        }\r\n      } else {\r\n        setRedirectToCoreSelection(false);\r\n      }\r\n    } else {\r\n      setRedirectToCoreSelection(false);\r\n    }\r\n    return () => {\r\n      setRedirectToCoreSelection(false);\r\n    };\r\n  }, [\r\n    OptOutCoreSelection,\r\n    globalCoreVisible,\r\n    isAuthenticated,\r\n    isFirstLogin,\r\n    loading,\r\n    selectedServiceGroups,\r\n    skipCoreSelectionScreen,\r\n    topServiceGroupsIsHidden,\r\n  ]);\r\n\r\n  useLocationChange((current: Location, previus: Location) => {\r\n    if (!previus || current.pathname !== previus.pathname) {\r\n      if (!loading && isAuthenticated && !!authenticatedUser) {\r\n        if (termsOfUseAgreementEnabled) {\r\n          if (authenticatedUser.HasSignedTermsOfUse === true) {\r\n            setRedirectToTermsOfUseAgreement(false);\r\n          } else {\r\n            setRedirectToTermsOfUseAgreement(true);\r\n          }\r\n        } else {\r\n          setRedirectToTermsOfUseAgreement(false);\r\n        }\r\n        if (\r\n          (UserGroupsProviderType === UserGroupsProviderTypes.SQL ||\r\n            !authenticatedUser.IsActiveDirectory) &&\r\n          joinAdGroupEnabled &&\r\n          (!authenticatedUser.ActiveUserGroup?.Id ||\r\n            authenticatedUser.JoinStatus !== JoinStatusEnum.Approved)\r\n        ) {\r\n          setRedirectToJoinAdGroup(true);\r\n        } else {\r\n          setRedirectToJoinAdGroup(false);\r\n        }\r\n        if (\r\n          (isFirstActiveUserGroupSelected === false ||\r\n            isFirstActiveUserGroupSelected === undefined) &&\r\n          multipleAdGroupsModuleEnabled &&\r\n          (authenticatedUser.UserGroups?.length || 1) > 1\r\n        ) {\r\n          setRedirectToActiveUserGroup(true);\r\n        } else {\r\n          setRedirectToActiveUserGroup(false);\r\n        }\r\n        if (\r\n          usageKioskRoleEnabled &&\r\n          authenticatedUser.Roles.includes(Roles.KioskAdmin)\r\n        ) {\r\n          setRedirectToUsageKiosk(true);\r\n        } else {\r\n          setRedirectToUsageKiosk(false);\r\n        }\r\n        if (\r\n          roomUserRoleEnabled &&\r\n          authenticatedUser.Roles.includes(Roles.RoomOnly)\r\n        ) {\r\n          setRedirectToUsageRoom(true);\r\n        } else {\r\n          setRedirectToUsageRoom(false);\r\n        }\r\n        if (authenticatedUser.Roles.includes(Roles.ConsumableKiosk)) {\r\n          setRedirectToConsumableKiosk(true);\r\n        } else {\r\n          setRedirectToConsumableKiosk(false);\r\n        }\r\n        if (\r\n          !topServiceGroupsIsHidden &&\r\n          !skipCoreSelectionScreen &&\r\n          globalCoreVisible\r\n        ) {\r\n          if (\r\n            !selectedServiceGroups ||\r\n            selectedServiceGroups.length < 1 ||\r\n            (!OptOutCoreSelection && isFirstLogin)\r\n          ) {\r\n            if (\r\n              current.pathname.indexOf('/coreselection') === -1 &&\r\n              !redirectToUsageKiosk &&\r\n              !redirectToUsageRoom &&\r\n              !redirectToConsumableKiosk\r\n            ) {\r\n              setRedirectToCoreSelection(true);\r\n            } else {\r\n              setRedirectToCoreSelection(false);\r\n            }\r\n          } else {\r\n            setRedirectToCoreSelection(false);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  });\r\n  return {\r\n    redirectToCoreSelection,\r\n    redirectToTermsOfUseAgreement,\r\n    redirectToActiveUserGroup,\r\n    redirectToUsageKiosk,\r\n    redirectToUsageRoom,\r\n    redirectToConsumableKiosk,\r\n    redirectToJoinAdGroup,\r\n  };\r\n};\r\n","/**\r\n *\r\n * SamplesTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { EditableCell } from '../../EditableTable/EditableCell';\r\nimport { TmtType } from 'app/pages/Samples/components/TmtType';\r\nimport { DateField as CellDateField } from '../../EditableTable/Fields/DateField';\r\nimport { NumberField as CellNumberField } from '../../EditableTable/Fields/NumberField';\r\nimport { TextField as CellTextField } from '../../EditableTable/Fields/TextField';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { ISample } from '../../SamplesListPage/slice/types';\r\nimport { MouseEventHandler } from 'react';\r\nimport { ControlledTable } from 'app/components/BasicTable/ControlledTable';\r\nimport { useRequestSamplesSlice } from 'app/pages/Samples/RequestSamplesPage/slice';\r\nimport { SamplePlatePicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePicker';\r\nimport { SourceSamplePlatePositionPicker } from 'app/components/pickers/AutocompletePickers/SamplePlatePositionPicker';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DateLabel } from 'app/components/DateLabel.tsx';\r\nimport {\r\n  selectSamplesData,\r\n  selectSamplesTableState,\r\n  selectSelectedSamples,\r\n} from '../../RequestSamplesPage/slice/selectors';\r\nimport { useConfigurableColumnsAdvanced } from 'app/components/BasicTable/useConfigurableColumnsAdvanced';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\n\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { DropDown } from 'app/components/DropDown';\r\nimport { openExportLink } from 'utils/url-utils';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { ImportButton as SamplesImportButton } from '../../SamplesListPage/ImportButton';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { Column } from 'react-table';\r\n\r\nexport interface SamplesTableProps {\r\n  serviceRequestId?: number;\r\n  processing: boolean;\r\n  isEditable: boolean;\r\n  isAdmin: boolean;\r\n  pageSize?: number;\r\n  printing?: Printing;\r\n  sectionStyles?: React.CSSProperties;\r\n}\r\n\r\nconst READONLY_COLUMNS = ['Status'];\r\n\r\nexport const SamplesTable = React.memo(function SamplesTable({\r\n  serviceRequestId,\r\n  isAdmin,\r\n  isEditable,\r\n  pageSize,\r\n  printing,\r\n  sectionStyles,\r\n  ...props\r\n}: SamplesTableProps) {\r\n  const samplesTableState = useSelector(selectSamplesTableState);\r\n  const samples = useSelector(selectSamplesData);\r\n  const selectedSamples = useSelector(selectSelectedSamples);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const { actions: requestactions } = useRequestSamplesSlice();\r\n  const history = useHistory();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n\r\n  const columns: Column<ISample>[] = React.useMemo(() => {\r\n    var result = [\r\n      {\r\n        Header: t(translations.SampleId),\r\n        accessor: 'Id', // accessor is the \"key\" in the data\r\n      },\r\n      {\r\n        Header: 'Request ID',\r\n        accessor: 'ServiceRequestId',\r\n      },\r\n      {\r\n        Header: 'Status',\r\n        accessor: 'StatusName',\r\n        Cell: ({ row, value }) => {\r\n          /*switch (value) {\r\n              case 0:\r\n                return 'New';\r\n              case 1:\r\n                return 'In Work';\r\n              case 2:\r\n                return 'Done';\r\n              default:\r\n                return 'N/A';\r\n            }*/\r\n          return row.original.StatusName;\r\n        },\r\n      },\r\n      {\r\n        Header: t(translations.AnalyticalSampleId),\r\n        accessor: 'AnalyticalSampleId',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: t(translations.BiologicalSampleId),\r\n        accessor: 'BiologicalSampleId',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: t(translations.SubjectId),\r\n        accessor: 'SubjectId',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: t(translations.SampleType),\r\n        accessor: 'SampleType',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: t(translations.TaxaId),\r\n        accessor: 'TaxaId',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: t(translations.Grouping),\r\n        accessor: 'Grouping',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: 'Date Received',\r\n        accessor: 'DateReceived',\r\n        Cell: !isEditable ? DateLabel : EditableCell(CellDateField),\r\n      },\r\n      {\r\n        Header: 'Tube label',\r\n        accessor: 'TubeLabel',\r\n        Cell: !isEditable ? undefined : EditableCell(CellTextField),\r\n      },\r\n      {\r\n        Header: t(translations.TMT_Type),\r\n        accessor: 'TMT_Type',\r\n        Cell: !isEditable ? undefined : EditableCell(TmtType),\r\n      },\r\n      {\r\n        Header: t(translations.TMT_Label),\r\n        accessor: 'TMT_Label',\r\n        Cell: !isEditable ? undefined : React.memo(EditableCell(CellTextField)),\r\n      },\r\n      {\r\n        Header: t(translations.TMT_Set),\r\n        accessor: 'TMT_Set',\r\n        Cell: !isEditable ? undefined : React.memo(EditableCell(CellTextField)),\r\n      },\r\n      {\r\n        Header: t(translations.SamplePlateId),\r\n        accessor: 'SamplePlateId',\r\n        Cell: !isEditable\r\n          ? undefined\r\n          : React.memo(EditableCell(SamplePlatePicker)),\r\n      },\r\n      {\r\n        Header: t(translations.PlatePosition),\r\n        accessor: 'Position',\r\n        Cell: !isEditable\r\n          ? undefined\r\n          : React.memo(EditableCell(SourceSamplePlatePositionPicker)),\r\n      },\r\n      {\r\n        Header: t(translations.Volume),\r\n        accessor: 'Volume',\r\n        Cell: !isEditable\r\n          ? undefined\r\n          : React.memo(EditableCell(CellNumberField)),\r\n      },\r\n      {\r\n        Header: t(translations.Concentration),\r\n        accessor: 'Concentration',\r\n        Cell: !isEditable\r\n          ? undefined\r\n          : React.memo(EditableCell(CellNumberField)),\r\n      },\r\n      {\r\n        Header: t(translations.ServiceGroup),\r\n        accessor: 'ServiceGroup',\r\n      },\r\n    ];\r\n    /**\r\n     * { Cell: undefined } causes \"Renderer Error\"\r\n     */\r\n    result\r\n      .filter(column => column.Cell === undefined)\r\n      .forEach(column => delete column.Cell);\r\n    return result;\r\n  }, [isEditable, t]);\r\n\r\n  const {\r\n    configurableColumns,\r\n    columnAccessors,\r\n    exportConfigurableColumns,\r\n    handleConfigurableColumns,\r\n    configCompleted,\r\n  } = useConfigurableColumnsAdvanced<ISample>(\r\n    ScreensId.SampleRequests,\r\n    columns,\r\n    READONLY_COLUMNS,\r\n  );\r\n  const pageCount = React.useMemo(() => {\r\n    return Math.ceil(\r\n      (samples.value?.dataLength ?? 0) / (samplesTableState.pageSize ?? 10),\r\n    );\r\n  }, [samples.value?.dataLength, samplesTableState.pageSize]);\r\n  const customPageSize = React.useMemo(() => {\r\n    return printing !== undefined && printing.printing === true\r\n      ? 10000\r\n      : pageSize ?? 10;\r\n  }, [pageSize, printing]);\r\n  // const dispatch = useDispatch();\r\n  // const { actions } = useSamplesListSlice();\r\n  const updateMyData = item => {\r\n    // We also turn on the flag to not reset the page\r\n    // setSkipPageReset(true);\r\n    dispatch(actions.updateServiceRequestSampleField(item));\r\n  };\r\n\r\n  const handleCreateButtonClick: MouseEventHandler<HTMLButtonElement> = e => {\r\n    if (serviceRequestId === undefined) {\r\n      return;\r\n    }\r\n    const data: ISample = {\r\n      Id: 0,\r\n      ServiceRequestId: serviceRequestId,\r\n      BudgetId: null,\r\n      BudgetName: null,\r\n      SourceRunIds: [],\r\n      TargetRunIds: [],\r\n      Status: 0,\r\n      StatusName: null,\r\n      AnalyticalSampleId: null,\r\n      BiologicalSampleId: null,\r\n      TMT_Type: null,\r\n      TMT_Label: null,\r\n      TMT_Set: null,\r\n      SubjectId: null,\r\n      Concentration: null,\r\n      Volume: null,\r\n      SamplePlateId: null,\r\n      Position: null,\r\n      SampleType: null,\r\n      TaxaId: null,\r\n    };\r\n    dispatch(actions.createSample(data));\r\n  };\r\n\r\n  const handleChangeState = React.useCallback(\r\n    state => {\r\n      if (!!columnAccessors) {\r\n        dispatch(\r\n          actions.loadSamples({ ...state, ...{ columns: columnAccessors } }),\r\n        );\r\n      }\r\n    },\r\n    [actions, columnAccessors, dispatch],\r\n  );\r\n\r\n  const openExportUrl = React.useCallback(\r\n    (readWriteOnly: boolean): Promise<void> => {\r\n      if (\r\n        exportConfigurableColumns !== undefined &&\r\n        exportConfigurableColumns.length > 0\r\n      ) {\r\n        const exportColumns = exportConfigurableColumns;\r\n        if (readWriteOnly) exportColumns.concat(READONLY_COLUMNS);\r\n        const downloadTemplateUrl = toRootedURL('/api/odata/v4/samples', {\r\n          $format: 'application/xlsx',\r\n          $filter:\r\n            '(not SourceRunIds/any()) and ' +\r\n            (selectedSamples?.length > 0\r\n              ? `Id in (${selectedSamples.map(f => f.Id).join(',')})`\r\n              : `ServiceRequestId eq ${serviceRequestId}`),\r\n          $select: exportColumns.join(','),\r\n        });\r\n        return openExportLink(downloadTemplateUrl);\r\n      } else\r\n        return new Promise<void>((resolve, reject) => {\r\n          resolve();\r\n        });\r\n    },\r\n    [exportConfigurableColumns, selectedSamples, serviceRequestId],\r\n  );\r\n  const handleExportClick = (): Promise<void> => openExportUrl(false);\r\n  /*const handleExportForImportClick = React.useCallback(\r\n      () => openExportUrl(true),\r\n      [openExportUrl],\r\n    );*/\r\n  const handleDownloadTemplateClick = React.useCallback((): Promise<void> => {\r\n    if (\r\n      exportConfigurableColumns !== undefined &&\r\n      exportConfigurableColumns.length > 0\r\n    ) {\r\n      if (serviceRequestId === undefined) {\r\n        return new Promise<void>((resolve, reject) => {\r\n          resolve();\r\n        });\r\n      }\r\n      const downloadTemplateUrl = toRootedURL('/api/odata/v4/samples', {\r\n        $format: 'application/xlsx',\r\n        $filter: `ServiceRequestId eq ${serviceRequestId}`,\r\n        $top: 0,\r\n        $select: exportConfigurableColumns.join(','),\r\n      });\r\n      return openExportLink(downloadTemplateUrl);\r\n    } else\r\n      return new Promise<void>((resolve, reject) => {\r\n        resolve();\r\n      });\r\n  }, [exportConfigurableColumns, serviceRequestId]);\r\n  const goToSamplesList = React.useCallback(() => {\r\n    history.push(`/samples?ServiceRequestId=${serviceRequestId}`);\r\n  }, [history, serviceRequestId]);\r\n  const handelDeleteSamplesClick = (\r\n    selectedRows: ISample[],\r\n    toggleAllRowsSelected,\r\n  ) => {\r\n    dispatch(actions.deleteSamples(selectedRows));\r\n    toggleAllRowsSelected(false);\r\n  };\r\n  const handleSelectedRowsChange = React.useCallback(\r\n    rows => {\r\n      dispatch(actions.setSelected(rows));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const menuItems: React.ReactNode[] = React.useMemo(() => {\r\n    let items: React.ReactNode[] = [];\r\n\r\n    /*items.push(\r\n        <MenuItem key=\"goTo-SamplesList\" onClick={goToSamplesList}>\r\n          <ImportButton\r\n            variant=\"text\"\r\n            size=\"small\"\r\n            disabled={!isEditable}\r\n            onDownloadTemplateButtonClick={handleDownloadTemplateClick}\r\n            serviceRequestId={serviceRequestId}\r\n          />\r\n        </MenuItem>,\r\n      );\r\n      /*items.push(\r\n        <MenuItem\r\n          key=\"ExportForImport-SamplesList\"\r\n          onClick={handleExportForImportClick}\r\n        >\r\n          {t(translations.ExportForImport)}\r\n        </MenuItem>,\r\n      );*/\r\n    return items;\r\n  }, []);\r\n\r\n  const getActions = (): PageActionRenderer[] => {\r\n    const result: PageActionRenderer[] = [\r\n      /*() => (\r\n          <TopActionButton\r\n            size=\"small\"\r\n            variant=\"white\"\r\n            startIcon=\"arrow-up-right-from-square\"\r\n            icon=\"arrow-up-right-from-square\"\r\n            key={'OpenInSamplesList'}\r\n            href={toRootedURL(`/samples?ServiceRequestId=${serviceRequestId}`)}\r\n            text={t(translations.OpenInSamplesList) as string}\r\n          />\r\n        ),*/\r\n      () => (\r\n        <TopActionButton\r\n          size=\"small\"\r\n          variant=\"main\"\r\n          key={'AddSample'}\r\n          onClick={handleCreateButtonClick}\r\n          startIcon=\"plus\"\r\n          icon=\"plus\"\r\n          disabled={!isEditable}\r\n          text={t(translations.AddSample) as string}\r\n        />\r\n      ),\r\n    ];\r\n    if (isAdmin && menuItems.length > 0) {\r\n      result.push(() => (\r\n        <DropDown\r\n          size=\"small\"\r\n          variant=\"ghost\"\r\n          title={t(translations.MoreActions)}\r\n          menuProps={{}}\r\n          menuChildren={() => [...menuItems]}\r\n        >\r\n          <Icon icon=\"ellipsis-v\" />\r\n        </DropDown>\r\n      ));\r\n    }\r\n    return result;\r\n  };\r\n  const importHandler = () => {\r\n    dispatch(requestactions.toggleImport(true));\r\n  };\r\n  const customScreenName: React.ReactNode = React.useMemo(() => {\r\n    const result = (\r\n      <>\r\n        <FormSectionTitle title={'Request Samples'} />\r\n        <IconButton\r\n          aria-label=\"link\"\r\n          variant=\"ghost\"\r\n          shape=\"square\"\r\n          size=\"small\"\r\n          title={t(translations.OpenInSamplesList) as string}\r\n          onClick={goToSamplesList}\r\n        >\r\n          <Icon icon=\"arrow-up-right-from-square\" />\r\n        </IconButton>\r\n      </>\r\n    );\r\n    return result;\r\n  }, [goToSamplesList, t]);\r\n  return (\r\n    <>\r\n      <SamplesImportButton\r\n        onDownloadTemplateButtonClick={\r\n          IsModuleEnabled(appSettings, KnownModules.SamplesAutomation)\r\n            ? handleDownloadTemplateClick\r\n            : undefined\r\n        }\r\n        hideImportButton={true}\r\n        serviceRequestId={serviceRequestId}\r\n      />\r\n      <ControlledTable\r\n        api={'delete-me'}\r\n        screenId={ScreensId.SampleRequests}\r\n        columns={configurableColumns !== undefined ? configurableColumns : []}\r\n        useConfigurable={true}\r\n        onConfigurableColumns={handleConfigurableColumns}\r\n        useImportLink={true}\r\n        importHandler={importHandler}\r\n        onExport={handleExportClick}\r\n        initialState={{\r\n          pageIndex: 0,\r\n          pageSize: customPageSize,\r\n          sortBy: [{ id: 'Id', desc: true }],\r\n        }}\r\n        screenName={'Request Samples'}\r\n        screenNameVariant=\"section\"\r\n        customScreenName={customScreenName}\r\n        data={samples.value?.data || []}\r\n        dataLength={samples.value?.dataLength ?? 0}\r\n        pageCount={pageCount}\r\n        onSelectedRowsChange={handleSelectedRowsChange}\r\n        hideMenuOnMobile\r\n        loading={props.processing || !configCompleted || false} //|| samples.processing\r\n        serviceGroups={[]}\r\n        onChangeState={handleChangeState}\r\n        // onFilterChange={handleControlledTableFilterChange}\r\n        // appliedFilters={appliedFilters}\r\n        useRowSelect={true}\r\n        // availableFilters={availableFilters}\r\n        updateMyData={updateMyData}\r\n        searchColumns={[\r\n          'cast(Id,Edm.String)',\r\n          \"cast(ServiceRequestId , 'Edm.String')\",\r\n          'BudgetName',\r\n          \"cast(BudgetId , 'Edm.String')\",\r\n          // SourceRunIds: Array<number> | null;\r\n          // TargetRunIds: Array<number> | null;\r\n          //\"cast(Status , 'Edm.String')\",\r\n          'AnalyticalSampleId',\r\n          'BiologicalSampleId',\r\n          'TMT_Type',\r\n          'TMT_Label',\r\n          'TMT_Set',\r\n          'SubjectId',\r\n          \"cast(Concentration , 'Edm.String')\",\r\n          \"cast(Volume , 'Edm.String')\",\r\n          'SamplePlateId',\r\n          'Position',\r\n        ]}\r\n        compact={false}\r\n        // updateMyData={updateMyData}\r\n        selectedRowsActions={[\r\n          (rows: ISample[], _refresh, toggleAllRowsSelected) => (\r\n            <>\r\n              <ButtonConfirm\r\n                disabled={!isEditable}\r\n                size=\"small\"\r\n                variant=\"white\"\r\n                onClick={() =>\r\n                  handelDeleteSamplesClick(rows, toggleAllRowsSelected)\r\n                }\r\n                confirmationDialogBody={t(\r\n                  translations.ThisCannotBeUndoneAreYouSure,\r\n                )}\r\n              >\r\n                {t(translations.Delete)} ({rows.length})\r\n              </ButtonConfirm>\r\n            </>\r\n          ),\r\n        ]}\r\n        pageActions={getActions()}\r\n        printing={printing}\r\n        tableContainerSyles={sectionStyles}\r\n      />\r\n    </>\r\n  );\r\n});\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { FormikProps } from 'formik';\r\nimport {\r\n  CustomFormValueType,\r\n  getFieldsVisibilities,\r\n  getSerializableIsRequired,\r\n  isRequired,\r\n  SerializeValue,\r\n} from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useRequestSamplesSlice } from '../../slice';\r\nimport LinearProgress from '@material-ui/core/LinearProgress';\r\nimport { Box } from '@material-ui/core';\r\nimport { getLogger } from 'utils/logLevel';\r\nimport { IServiceRequestDetailsFormModel } from '../../slice/types';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { selectServiceRequestCustomFormFields } from '../../slice/selectors';\r\nimport { FormFieldsSection, FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { CustomFormField } from 'app/components/CustomForm/CustomFormFields';\r\nimport { sortBy } from 'lodash';\r\nimport { ICustomFormDto } from 'api/odata/generated/entities/ICustomFormDto';\r\n\r\nexport interface ServiceRequestCustomFormProps\r\n  extends FormikProps<IServiceRequestDetailsFormModel> {\r\n  serviceRequestId?: number;\r\n  customForm: ICustomFormDto;\r\n  isAdmin: boolean;\r\n  disabled: boolean;\r\n  allowUserUpload?: boolean;\r\n  sectionStyles?: React.CSSProperties;\r\n}\r\nconst log = getLogger('ServiceRequestCustomForm');\r\nexport const ServiceRequestCustomForm = React.memo(\r\n  function ServiceRequestCustomForm({\r\n    isAdmin,\r\n    disabled,\r\n    allowUserUpload,\r\n    sectionStyles,\r\n    ...props\r\n  }: ServiceRequestCustomFormProps) {\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    const { t } = useTranslation();\r\n    const dispatch = useDispatch();\r\n    const { actions } = useRequestSamplesSlice();\r\n    const formFields = useSelector(selectServiceRequestCustomFormFields);\r\n    const handleChange = React.useCallback(\r\n      (value, formField: IFormFieldDto) => {\r\n        const serviceRequestId = props.serviceRequestId;\r\n        if (serviceRequestId === undefined) {\r\n          log.info('handleSubmit - serviceRequestId is empty');\r\n          return;\r\n        }\r\n        dispatch(\r\n          actions.saveFormValues({\r\n            RequestId: serviceRequestId,\r\n            FormFieldId: formField.Id,\r\n            Value:\r\n              formField.Type === 'File'\r\n                ? value\r\n                : SerializeValue(formField, value?.target?.value ?? value),\r\n            DisplayValue: null,\r\n            Type: formField.Type,\r\n          }),\r\n        );\r\n      },\r\n      [actions, dispatch, props.serviceRequestId],\r\n    );\r\n\r\n    const isVisibleField = (\r\n      field: IFormFieldDto,\r\n      isAdmin: boolean,\r\n      values: Record<string, any> | undefined,\r\n      visibleOnCompletion?: () => boolean,\r\n    ): boolean => {\r\n      let visibilities = getFieldsVisibilities(\r\n        formFields,\r\n        isAdmin,\r\n        values,\r\n        visibleOnCompletion,\r\n      );\r\n      if (visibilities) {\r\n        return visibilities[field.Id];\r\n      }\r\n      return true;\r\n    };\r\n    const sortedActiveFormFields = React.useMemo(\r\n      () =>\r\n        sortBy(\r\n          formFields.filter(f => f.Active === true),\r\n          f => f.Index,\r\n        ).map(f => {\r\n          return {\r\n            fieldRequired:\r\n              isRequired(\r\n                f,\r\n                isAdmin || false,\r\n                props?.values?.FormValues?.[f.Id],\r\n              ) &&\r\n              getSerializableIsRequired(\r\n                f,\r\n                props?.values?.FormValues?.[f.Id] as CustomFormValueType,\r\n              ),\r\n            field: f,\r\n          };\r\n        }),\r\n      [formFields, isAdmin, props?.values?.FormValues],\r\n    );\r\n\r\n    return props.values.FormValues === undefined ? (\r\n      <Box style={{ width: '100%' }}>\r\n        <LinearProgress variant=\"query\" color=\"primary\" />\r\n      </Box>\r\n    ) : (\r\n      <FormFieldsSection\r\n        titleSection={props.customForm.Name}\r\n        styleSection={sectionStyles}\r\n      >\r\n        {sortedActiveFormFields.map((formField, index, arr) => {\r\n          // paragraphs & form sections deserve to start from the new line in 2 column layout (full screen)\r\n          const fullRow =\r\n            formField.field.Type !== null &&\r\n            ['Paragraph', 'FormSection'].includes(formField.field.Type);\r\n          const name = `FormValues.${String(formField.field.Id)}`;\r\n          const nextField = arr[index + 1];\r\n          const nextFullRow =\r\n            !!nextField &&\r\n            nextField.field.Type !== null &&\r\n            ['Paragraph', 'FormSection'].includes(nextField.field.Type);\r\n          const prevField = arr[index - 1];\r\n          const prevFullRow =\r\n            !!prevField &&\r\n            prevField.field.Type !== null &&\r\n            ['Paragraph', 'FormSection'].includes(prevField.field.Type);\r\n          const nextIsEmpty =\r\n            !fullRow &&\r\n            ((arr[index - 1] === undefined &&\r\n              (nextFullRow || arr[index + 1] === undefined)) ||\r\n              (arr[index - 1] !== undefined &&\r\n                !prevFullRow &&\r\n                nextFullRow &&\r\n                index % 2 === 0) ||\r\n              (prevFullRow && nextFullRow) ||\r\n              (prevFullRow && arr[index + 1] === undefined));\r\n          return (\r\n            <React.Fragment>\r\n              {/* {!fullRow && index % 2 === 1 && (\r\n                <FormRow key={`empty_${formField.field.Id}`}> </FormRow>\r\n              )} */}\r\n              <FormRow\r\n                key={formField.field.Id}\r\n                hide={\r\n                  isVisibleField(\r\n                    formField.field,\r\n                    isAdmin || false,\r\n                    props.values.FormValues,\r\n                    undefined,\r\n                  ) === false\r\n                }\r\n                fullRow={fullRow}\r\n              >\r\n                <CustomFormField\r\n                  name={name}\r\n                  id={name}\r\n                  key={index}\r\n                  formField={formField.field}\r\n                  autoFocus={formField.fieldRequired}\r\n                  required={formField.fieldRequired}\r\n                  readonly={\r\n                    disabled ||\r\n                    (formField.field.Type === 'File' && !allowUserUpload)\r\n                  }\r\n                  disabled={\r\n                    disabled ||\r\n                    props.isSubmitting ||\r\n                    (formField.field.Type === 'File' && !allowUserUpload)\r\n                  }\r\n                  onChange={value => handleChange(value, formField.field)}\r\n                />\r\n              </FormRow>\r\n              {nextIsEmpty && (\r\n                <FormRow key={`empty_${formField.field.Id}`}> </FormRow>\r\n              )}\r\n            </React.Fragment>\r\n          );\r\n        })}\r\n        {/* {sortedActiveFormFields.filter(f =>\r\n          isVisibleField(\r\n            f.field,\r\n            isAdmin || false,\r\n            props.values.FormValues,\r\n            undefined,\r\n          ),\r\n        ).length %\r\n          2 ===\r\n          1 && <FormRow> </FormRow>} */}\r\n      </FormFieldsSection>\r\n    );\r\n  },\r\n);\r\n","/**\r\n *\r\n * BudgetPicker\r\n *\r\n */\r\nimport { IServiceBaseDto } from 'api/odata/generated/entities/IServiceBaseDto';\r\nimport { IServiceTypeFilterDto } from 'api/odata/generated/entities/IServiceTypeFilterDto';\r\nimport {\r\n  BudgetPicker,\r\n  BudgetPickerProps,\r\n  restrictedBudgetFilter,\r\n} from 'app/components/pickers/AutocompletePickers/BudgetPicker';\r\nimport { getSingleInvoiceFundingType } from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { ServiceType } from 'enums/ServiceTypes';\r\nimport * as React from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nexport interface EventBudgetPickerProps extends BudgetPickerProps {\r\n  service: IServiceBaseDto;\r\n  userGroupId: string;\r\n  userId: string;\r\n  isAdmin: boolean;\r\n  fundingType: number | null;\r\n}\r\n\r\n/**\r\n * Budget picker that can be used to select a budget applicable to bookable events like reservations, offline services, requests, etc.\r\n * @param param0\r\n * @returns\r\n */\r\nexport function EventBudgetPicker({\r\n  predicates,\r\n  ...props\r\n}: EventBudgetPickerProps) {\r\n  const globalSettings = useGlobalSettingsHook();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const ReservationUserGroupGroupByBudgetUserGroup = React.useMemo(() => {\r\n    return (\r\n      globalSettings.reservationUserGroupGroupByBudgetUserGroup &&\r\n      !props.service.HideProjects\r\n    );\r\n  }, [\r\n    props.service,\r\n    globalSettings.reservationUserGroupGroupByBudgetUserGroup,\r\n  ]);\r\n  const eventPredicates = React.useMemo(() => {\r\n    const result = restrictedBudgetFilter({\r\n      budgetLimitedByUsers: globalSettings.budgetLimitedByUsers,\r\n      isBudgetsWithoutUserGroup: globalSettings.isBudgetsWithoutUserGroup,\r\n      userGroupId: ReservationUserGroupGroupByBudgetUserGroup\r\n        ? undefined\r\n        : props.userGroupId,\r\n      serviceGroupId: undefined,\r\n      services: [props.service].map(f => {\r\n        return {\r\n          Id: f.Id,\r\n          Name: f.Name,\r\n          ServiceTypeId: ServiceType[f.ServiceType],\r\n          ServiceGroupId: f.ServiceGroup.Id,\r\n          HideProject: f.HideProjects,\r\n        } as IServiceTypeFilterDto;\r\n      }),\r\n      startTime: undefined,\r\n      endTime: undefined,\r\n      user: props.isAdmin\r\n        ? props.userId === null\r\n          ? undefined\r\n          : props.userId\r\n        : authenticatedUser?.Id,\r\n      defaultBudgetEnabled: globalSettings.defaultBudgetEnabled,\r\n      userDefaultBudgetEnabled: globalSettings.userDefaultBudgetEnabled,\r\n      hideNonDefaultBudgets: globalSettings.hideNonDefaultBudgets,\r\n      // funding type is set to Internal by default even if it's not in use\r\n      fundingType:\r\n        props.fundingType === null\r\n          ? null\r\n          : getSingleInvoiceFundingType(props.fundingType),\r\n    });\r\n    return result.concat(predicates ?? []);\r\n  }, [\r\n    globalSettings.budgetLimitedByUsers,\r\n    globalSettings.isBudgetsWithoutUserGroup,\r\n    globalSettings.defaultBudgetEnabled,\r\n    globalSettings.userDefaultBudgetEnabled,\r\n    globalSettings.hideNonDefaultBudgets,\r\n    ReservationUserGroupGroupByBudgetUserGroup,\r\n    props.userGroupId,\r\n    props.service,\r\n    props.isAdmin,\r\n    props.userId,\r\n    props.fundingType,\r\n    authenticatedUser?.Id,\r\n    predicates,\r\n  ]);\r\n  return <BudgetPicker predicates={eventPredicates} {...props} />;\r\n}\r\n","import { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { InputLabel, InputValue } from 'app/components/Typography';\r\n\r\nexport function ReadonlyField(props: {\r\n  title: string;\r\n  value: string | undefined | null;\r\n}) {\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      <Box\r\n        style={{\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          alignItems: 'flex-start',\r\n          flex: '1 0 0',\r\n          alignSelf: 'stretch',\r\n        }}\r\n      >\r\n        <InputLabel size=\"xs\" color=\"secondary\">\r\n          {props.title}\r\n        </InputLabel>\r\n        <InputValue size=\"small\">\r\n          {props.value ?? t(translations.NA)}\r\n        </InputValue>\r\n      </Box>\r\n    </>\r\n  );\r\n}\r\n","import { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { selectServiceRequestDetailsFieldState } from '../../RequestSamplesPage/slice/selectors';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\n\r\nexport interface IUseServiceRequestStatusUpdateProps {\r\n  serviceRequestStatusId: number;\r\n}\r\nexport function useServiceRequestStatusUpdate(\r\n  props: IUseServiceRequestStatusUpdateProps,\r\n) {\r\n  const { actions } = useRequestSamplesSlice();\r\n  const dispatch = useDispatch();\r\n  const changeStatus = (value: {\r\n    status: IServiceRequestStatusDto;\r\n    reason?: string;\r\n  }) => {\r\n    value !== null &&\r\n      dispatch(\r\n        actions.updateStatus({\r\n          Id: props.serviceRequestStatusId,\r\n          Status: value.status,\r\n          Reason: value.reason,\r\n        }),\r\n      );\r\n  };\r\n  const fieldState = useSelector(state =>\r\n    selectServiceRequestDetailsFieldState(state, 'Status'),\r\n  );\r\n  return { changeStatus, fieldState };\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.InternalServiceRequestStatus\r\n *\r\n */\r\n\r\nexport enum InternalServiceRequestStatus {\r\n  Draft = 0,\r\n  WaitingForQuote = 1,\r\n  QuoteSendToUser = 2,\r\n  QuoteApproved = 3,\r\n  Completed = 5,\r\n  Cancelled = 6,\r\n  InProcess = 7,\r\n  ReturnedToUser = 8,\r\n  Pending = 9,\r\n  Started = 10,\r\n  Skipped = 11,\r\n}\r\nexport type InternalServiceRequestStatusUnion = keyof typeof InternalServiceRequestStatus;\r\nexport const InternalServiceRequestStatusUnionArray: Array<InternalServiceRequestStatusUnion> = [\r\n  'Draft',\r\n  'WaitingForQuote',\r\n  'QuoteSendToUser',\r\n  'QuoteApproved',\r\n  'Completed',\r\n  'Cancelled',\r\n  'InProcess',\r\n  'ReturnedToUser',\r\n  'Pending',\r\n  'Started',\r\n  'Skipped',\r\n];\r\n","/**\r\n *\r\n * ServiceRequestSubmissionDetails\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ServiceRequestStatusPicker } from 'app/components/pickers/AutocompletePickers/ServiceRequestStatusPicker';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectRequestDetailsFieldsState } from '../../RequestSamplesPage/slice/selectors';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { EventBudgetPicker } from '../EventBudgetPicker';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRightSection,\r\n  FormRow,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { ReadonlyField } from '../ReadonlyField';\r\nimport { useServiceRequestStatusUpdate } from '../Utils';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n  selectAppSettings,\r\n  selectAuthenticatedUser,\r\n} from 'app/slice/selectors';\r\nimport { IRequestDetailsModel } from '../../RequestSamplesPage/slice/types';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport useGlobalSettingsHook from 'app/pages/ReservationDetails/Details/components/useGlobalSettingsHook';\r\nimport { IsBudgetFieldEnabled, IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { BudgetFields } from 'enums/BudgetFields';\r\nimport { PurchaseOrderOptions } from 'api/odata/generated/enums/PurchaseOrderOptions';\r\nimport {\r\n  FundingTypeIdPicker,\r\n  getSingleInvoiceFundingType,\r\n} from 'app/components/pickers/StaticOptionsPickers/FundingTypeIdPicker';\r\nimport BaseTextField from 'app/components/BasicInputs/BaseTextField';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { debounce } from 'lodash';\r\nimport { InternalServiceRequestStatus } from 'api/odata/generated/enums/InternalServiceRequestStatus';\r\n\r\nexport interface ServiceRequestSubmissionDetailsProps {\r\n  requestDetails: IRequestDetailsModel;\r\n  isAdmin: boolean;\r\n  isOwner: boolean;\r\n  sectionStyles?: React.CSSProperties;\r\n}\r\n\r\nexport function ServiceRequestSubmissionDetails({\r\n  requestDetails,\r\n  ...props\r\n}: ServiceRequestSubmissionDetailsProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const fieldsState = useSelector(selectRequestDetailsFieldsState);\r\n  const { actions } = useRequestSamplesSlice();\r\n  const dispatch = useDispatch();\r\n  const authUser = useSelector(selectAuthenticatedUser);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const globalSettings = useGlobalSettingsHook();\r\n  const [poLocal, setPoLocal] = React.useState<string | null>(\r\n    requestDetails.PurchaseOrder,\r\n  );\r\n  const [internalLocal, setInternalLocal] = React.useState<string | null>(\r\n    requestDetails.ExternalInternalNumber || null,\r\n  );\r\n\r\n  const showProject = React.useMemo(() => {\r\n    return (\r\n      IsModuleEnabled(appSettings, KnownModules.Budgets) &&\r\n      ((IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents) &&\r\n        requestDetails.Service.HideProjects === false) ||\r\n        !IsModuleEnabled(appSettings, KnownModules.DisableBillingEvents))\r\n    );\r\n  }, [appSettings, requestDetails.Service.HideProjects]);\r\n  const projectFieldVisibleToUser = React.useMemo(() => {\r\n    return (\r\n      showProject &&\r\n      (requestDetails.Service.ProjectIsRequired === null ||\r\n      requestDetails.Service.ProjectIsRequired === true\r\n        ? true\r\n        : props.isAdmin ||\r\n          (props.isOwner &&\r\n            ![\r\n              InternalServiceRequestStatus[InternalServiceRequestStatus.Draft],\r\n              InternalServiceRequestStatus[\r\n                InternalServiceRequestStatus.ReturnedToUser\r\n              ],\r\n              InternalServiceRequestStatus[\r\n                InternalServiceRequestStatus.Pending\r\n              ],\r\n            ].includes(requestDetails.Status.InternalStatusId)))\r\n    );\r\n  }, [\r\n    props.isAdmin,\r\n    props.isOwner,\r\n    requestDetails.Service.ProjectIsRequired,\r\n    requestDetails.Status.InternalStatusId,\r\n    showProject,\r\n  ]);\r\n  const projectIsRequired = React.useMemo(() => {\r\n    return (\r\n      projectFieldVisibleToUser &&\r\n      (requestDetails.Service.ProjectIsRequired === null ||\r\n        requestDetails.Service.ProjectIsRequired === false)\r\n    );\r\n  }, [projectFieldVisibleToUser, requestDetails.Service.ProjectIsRequired]);\r\n  const fundingTypeVisible = React.useMemo(() => {\r\n    return (\r\n      IsBudgetFieldEnabled(appSettings, BudgetFields.FundingType) &&\r\n      IsBudgetFieldEnabled(appSettings, BudgetFields.PurchaseOrderOption) &&\r\n      projectFieldVisibleToUser\r\n    );\r\n  }, [appSettings, projectFieldVisibleToUser]);\r\n\r\n  const purchaseOrderLength = React.useMemo(() => {\r\n    return globalSettings.purchaseOrderLengthSetting ?? 0;\r\n  }, [globalSettings.purchaseOrderLengthSetting]);\r\n\r\n  const purchaseOrderVisible = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      (requestDetails.Budget?.PurchaseOrderOptionId ??\r\n        PurchaseOrderOptions.Hidden) !== PurchaseOrderOptions.Hidden\r\n    );\r\n  }, [\r\n    globalSettings.purchaseOrderBudgetEnabled,\r\n    requestDetails.Budget?.PurchaseOrderOptionId,\r\n  ]);\r\n  const purchaseOrderMandatory = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      requestDetails.Budget?.PurchaseOrderOptionId ===\r\n        PurchaseOrderOptions.Mandatory\r\n    );\r\n  }, [\r\n    globalSettings.purchaseOrderBudgetEnabled,\r\n    requestDetails.Budget?.PurchaseOrderOptionId,\r\n  ]);\r\n  const purchaseLengthInvalid = React.useMemo(() => {\r\n    return (\r\n      purchaseOrderVisible &&\r\n      (purchaseOrderMandatory ||\r\n        (!purchaseOrderMandatory && (poLocal?.length ?? 0) > 0)) &&\r\n      (poLocal?.length ?? 0) < purchaseOrderLength\r\n    );\r\n  }, [\r\n    purchaseOrderLength,\r\n    purchaseOrderMandatory,\r\n    purchaseOrderVisible,\r\n    poLocal?.length,\r\n  ]);\r\n  const purchaseOrderRequired = React.useMemo(() => {\r\n    return (\r\n      globalSettings.purchaseOrderBudgetEnabled &&\r\n      requestDetails.Budget?.PurchaseOrderOptionId ===\r\n        PurchaseOrderOptions.Mandatory &&\r\n      poLocal === null\r\n    );\r\n  }, [\r\n    globalSettings.purchaseOrderBudgetEnabled,\r\n    requestDetails.Budget?.PurchaseOrderOptionId,\r\n    poLocal,\r\n  ]);\r\n\r\n  const excludedQuoteStatuses: Array<InternalServiceRequestStatusesUnion> = [\r\n    'QuoteSendToUser',\r\n    'QuoteApproved',\r\n    'WaitingForQuote',\r\n  ];\r\n\r\n  useEffectOnMount(() => {\r\n    dispatch(actions.init());\r\n  });\r\n  const {\r\n    changeStatus,\r\n    fieldState: statusFieldState,\r\n  } = useServiceRequestStatusUpdate({\r\n    serviceRequestStatusId: requestDetails.Id,\r\n  });\r\n  const handleBudgetChange = value => {\r\n    if (value !== null) {\r\n      dispatch(\r\n        actions.updateBudget({\r\n          Id: requestDetails.Id,\r\n          Budget: value,\r\n        }),\r\n      );\r\n      if (\r\n        requestDetails.FundingTypeId === null &&\r\n        value.FundingTypeId !== null &&\r\n        fundingTypeVisible\r\n      ) {\r\n        dispatch(\r\n          actions.patch({\r\n            Id: requestDetails.Id,\r\n            FundingTypeId: value.FundingTypeId,\r\n          }),\r\n        );\r\n      }\r\n    }\r\n  };\r\n  const handleFundingTypeChange = value => {\r\n    value !== null &&\r\n      dispatch(\r\n        actions.patch({\r\n          Id: requestDetails.Id,\r\n          FundingTypeId: value.Id,\r\n          Budget: undefined,\r\n          PurchaseOrder: null,\r\n        }),\r\n      );\r\n    // if (value?.Id !== requestDetails.Budget?.FundingTypeId) {\r\n    //   //setChosenBudget(null);\r\n    // }\r\n  };\r\n  const handlePurchaseOrderSave = React.useCallback(\r\n    value => {\r\n      if (\r\n        (value?.length ?? 0) === 0 ||\r\n        (value?.length ?? 0) >= purchaseOrderLength\r\n      ) {\r\n        dispatch(\r\n          actions.patch({\r\n            Id: requestDetails.Id,\r\n            PurchaseOrder: value,\r\n          }),\r\n        );\r\n        dispatch(\r\n          appSettingsActions.addNotification({\r\n            message: `${t(translations.PurchaseOrder)} updated to: ${\r\n              value ?? 'null'\r\n            }`,\r\n            variant: 'success',\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [actions, dispatch, purchaseOrderLength, requestDetails.Id, t],\r\n  );\r\n  const debouncedPoChange = React.useMemo(\r\n    () => debounce(handlePurchaseOrderSave, 500),\r\n    [handlePurchaseOrderSave],\r\n  );\r\n  const handlePurchaseOrderChange = value => {\r\n    setPoLocal(value);\r\n    debouncedPoChange(value);\r\n  };\r\n\r\n  const handleStatusChange = value => {\r\n    changeStatus({\r\n      status: value,\r\n    });\r\n  };\r\n  const handleExternalInternalNumberSave = React.useCallback(\r\n    value => {\r\n      dispatch(\r\n        actions.patch({\r\n          Id: requestDetails.Id,\r\n          ExternalInternalNumber: value,\r\n        }),\r\n      );\r\n      dispatch(\r\n        appSettingsActions.addNotification({\r\n          message: t(translations.ExternalInternalNumberUpdatedTo, {\r\n            Name: value as string,\r\n          }),\r\n          variant: 'success',\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch, requestDetails.Id, t],\r\n  );\r\n  const debouncedInterChange = React.useMemo(\r\n    () => debounce(handleExternalInternalNumberSave, 500),\r\n    [handleExternalInternalNumberSave],\r\n  );\r\n  const handleExternalInternalNumberChange = value => {\r\n    setInternalLocal(value);\r\n    debouncedInterChange(value);\r\n  };\r\n  return (\r\n    <StyledFormFieldsContainer>\r\n      <FormLeftSection>\r\n        <FormFieldsSection\r\n          styleSection={props.sectionStyles}\r\n          titleSection={t(translations.ServiceRequestSubmissionDetails)}\r\n        >\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.UserGroup)}\r\n              value={requestDetails.UserGroup?.Name}\r\n            />\r\n          </FormRow>\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.CreatedFor)}\r\n              value={requestDetails.CreatedFor?.Name}\r\n            />\r\n          </FormRow>\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.CreatedBy)}\r\n              value={requestDetails.CreatedBy?.Name}\r\n            />\r\n          </FormRow>\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.SubmittedBy)}\r\n              value={requestDetails.SubmittedBy?.Name}\r\n            />\r\n          </FormRow>\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.SubmittedAt)}\r\n              value={dateUtils.longDateTimeFormat(requestDetails.SubmittedAt)}\r\n            />\r\n          </FormRow>\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.UpdatedBy)}\r\n              value={requestDetails.UpdatedBy?.Name}\r\n            />\r\n          </FormRow>\r\n          <FormRow>\r\n            <ReadonlyField\r\n              title={t(translations.UpdatedAt)}\r\n              value={dateUtils.longDateTimeFormat(requestDetails.UpdatedAt)}\r\n            />\r\n          </FormRow>\r\n        </FormFieldsSection>\r\n      </FormLeftSection>\r\n      <FormRightSection>\r\n        <FormFieldsSection\r\n          styleSection={props.sectionStyles}\r\n          titleSection={t(translations.StatusAndBudget)}\r\n        >\r\n          <FormRow fullRow>\r\n            {props.isAdmin ? (\r\n              <ServiceRequestStatusPicker\r\n                label={t(translations.Status)}\r\n                predicates={\r\n                  !requestDetails.Service.SendQuoteToUser\r\n                    ? [\r\n                        new Condition<IServiceRequestStatusDto>(\r\n                          'InternalStatusId',\r\n                          ODataOperators.Excludes,\r\n                          excludedQuoteStatuses,\r\n                        ),\r\n                      ]\r\n                    : undefined\r\n                }\r\n                value={requestDetails.Status}\r\n                disabled={statusFieldState?.status === 'pending'}\r\n                disableClearable={true}\r\n                onChange={handleStatusChange}\r\n                fullWidth\r\n                variant=\"filled\"\r\n              />\r\n            ) : (\r\n              <ReadonlyField\r\n                title={t(translations.Status)}\r\n                value={requestDetails.Status?.Name}\r\n              />\r\n            )}\r\n          </FormRow>\r\n          {fundingTypeVisible && (\r\n            <FormRow fullRow>\r\n              {props.isAdmin || (props.isOwner && projectFieldVisibleToUser) ? (\r\n                <FundingTypeIdPicker\r\n                  name=\"FundingType\"\r\n                  label={t(translations.FundingType)}\r\n                  variant=\"filled\"\r\n                  value={\r\n                    requestDetails.FundingTypeId === null\r\n                      ? requestDetails.Budget === null ||\r\n                        requestDetails.Budget.FundingTypeId === null\r\n                        ? null\r\n                        : getSingleInvoiceFundingType(\r\n                            requestDetails.Budget.FundingTypeId,\r\n                          )\r\n                      : getSingleInvoiceFundingType(\r\n                          requestDetails.FundingTypeId,\r\n                        )\r\n                  }\r\n                  error={Boolean(\r\n                    fundingTypeVisible &&\r\n                      requestDetails.FundingTypeId === null &&\r\n                      projectIsRequired,\r\n                  )}\r\n                  helperText={\r\n                    fundingTypeVisible &&\r\n                    requestDetails.FundingTypeId === null &&\r\n                    projectIsRequired\r\n                      ? t(translations.FundingTypeRequired)\r\n                      : undefined\r\n                  }\r\n                  disabled={fieldsState['FundingTypeId']?.status === 'pending'}\r\n                  onChange={value => {\r\n                    handleFundingTypeChange(value);\r\n                  }}\r\n                  fullWidth\r\n                />\r\n              ) : (\r\n                <ReadonlyField\r\n                  title={t(translations.FundingType)}\r\n                  value={\r\n                    requestDetails.FundingTypeId === null\r\n                      ? requestDetails.Budget === null ||\r\n                        requestDetails.Budget.FundingTypeId === null\r\n                        ? 'N/A'\r\n                        : getSingleInvoiceFundingType(\r\n                            requestDetails.Budget.FundingTypeId,\r\n                          ).Name\r\n                      : getSingleInvoiceFundingType(\r\n                          requestDetails.FundingTypeId,\r\n                        ).Name\r\n                  }\r\n                />\r\n              )}\r\n            </FormRow>\r\n          )}\r\n          {projectFieldVisibleToUser && (\r\n            <FormRow fullRow>\r\n              {props.isAdmin || props.isOwner ? (\r\n                <EventBudgetPicker\r\n                  userId={requestDetails.CreatedFor?.Id ?? authUser?.Id}\r\n                  userGroupId={\r\n                    requestDetails.UserGroup?.Id ??\r\n                    authUser?.ActiveUserGroup?.Id\r\n                  }\r\n                  isAdmin={props.isAdmin}\r\n                  service={requestDetails.Service}\r\n                  label={t(translations.BudgetNumber)}\r\n                  value={requestDetails.Budget}\r\n                  onChange={handleBudgetChange}\r\n                  disabled={fieldsState['Budget']?.status === 'pending'}\r\n                  fundingType={requestDetails.FundingTypeId}\r\n                  fullWidth\r\n                  variant=\"filled\"\r\n                  error={Boolean(\r\n                    (requestDetails.Budget === null ||\r\n                      requestDetails.Budget === undefined) &&\r\n                      projectIsRequired,\r\n                  )}\r\n                  helperText={\r\n                    (requestDetails.Budget === null ||\r\n                      requestDetails.Budget === undefined) &&\r\n                    projectIsRequired\r\n                      ? t(translations.BudgetIsRequired)\r\n                      : undefined\r\n                  }\r\n                />\r\n              ) : (\r\n                <ReadonlyField\r\n                  title={t(translations.Budget)}\r\n                  value={requestDetails.Budget?.Name}\r\n                />\r\n              )}\r\n            </FormRow>\r\n          )}\r\n          {purchaseOrderVisible && (\r\n            <FormRow fullRow>\r\n              {props.isAdmin ? (\r\n                <BaseTextField\r\n                  id=\"requestPurchaseOrder\"\r\n                  name=\"PurchaseOrder\"\r\n                  label={t(translations.PurchaseOrder)}\r\n                  fullWidth\r\n                  variant=\"filled\"\r\n                  error={Boolean(\r\n                    purchaseLengthInvalid || purchaseOrderRequired,\r\n                  )}\r\n                  helperText={\r\n                    purchaseLengthInvalid\r\n                      ? (t(\r\n                          translations.Reservation_Error_ShortPurchaseOrderLength,\r\n                        ) as string).replace(\r\n                          '{0}',\r\n                          purchaseOrderLength.toString(),\r\n                        )\r\n                      : purchaseOrderRequired\r\n                      ? t(translations.Reservation_Error_PurchaseOrderRequired)\r\n                      : undefined\r\n                  }\r\n                  onChange={ev => {\r\n                    let val = ev.target.value;\r\n                    handlePurchaseOrderChange(val === '' ? null : val);\r\n                  }}\r\n                  value={poLocal ?? ''}\r\n                  disabled={fieldsState['PurchaseOrder']?.status === 'pending'}\r\n                />\r\n              ) : (\r\n                <ReadonlyField\r\n                  title={t(translations.PurchaseOrder)}\r\n                  value={poLocal}\r\n                />\r\n              )}\r\n            </FormRow>\r\n          )}\r\n          {requestDetails.ShowInternalNumber && (\r\n            <FormRow fullRow>\r\n              {props.isAdmin ? (\r\n                <BaseTextField\r\n                  id=\"requestExternalInternalNumber\"\r\n                  name=\"ExternalInternalNumber\"\r\n                  label={t(translations.ExternalInternalNumber)}\r\n                  fullWidth\r\n                  variant=\"filled\"\r\n                  onChange={ev => {\r\n                    let val = ev.target.value;\r\n                    handleExternalInternalNumberChange(val === '' ? null : val);\r\n                  }}\r\n                  value={internalLocal ?? ''}\r\n                  disabled={\r\n                    fieldsState['ExternalInternalNumber']?.status === 'pending'\r\n                  }\r\n                />\r\n              ) : (\r\n                <ReadonlyField\r\n                  title={t(translations.ExternalInternalNumber)}\r\n                  value={internalLocal}\r\n                />\r\n              )}\r\n            </FormRow>\r\n          )}\r\n        </FormFieldsSection>\r\n      </FormRightSection>\r\n    </StyledFormFieldsContainer>\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { IRequestDetailsModel } from '../../slice/types';\r\nimport { useFormikContext } from 'formik';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\n\r\nexport interface ISubmitServiceRequestButtonProps {\r\n  serviceRequest?: IRequestDetailsModel;\r\n  getRowsErrors?: (hasRowErrors: boolean) => void;\r\n  disabled?: boolean;\r\n}\r\nexport function SubmitServiceRequestButton(\r\n  props: ISubmitServiceRequestButtonProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const { serviceRequest, getRowsErrors } = props;\r\n  const formik = useFormikContext<IRequestDetailsModel>();\r\n  const submitEnabled = React.useMemo(() => {\r\n    return (\r\n      serviceRequest?.Status.InternalStatusId === 'Draft' ||\r\n      serviceRequest?.Status.InternalStatusId === 'ReturnedToUser'\r\n    );\r\n  }, [serviceRequest?.Status.InternalStatusId]);\r\n\r\n  const handleSubmit = React.useCallback(async () => {\r\n    if (!formik.isValid) {\r\n      return;\r\n    }\r\n    if (serviceRequest !== undefined) {\r\n      await formik.submitForm();\r\n      setOpen(false);\r\n    }\r\n  }, [formik, serviceRequest]);\r\n\r\n  const [open, setOpen] = React.useState(false);\r\n\r\n  const title = React.useMemo(() => {\r\n    return submitEnabled\r\n      ? t(translations.ServiceRequestSubmitButtonTooltip_Enabled)\r\n      : t(translations.ServiceRequestSubmitButtonTooltip_Disabled);\r\n  }, [submitEnabled, t]);\r\n  const handleClick = React.useCallback(async () => {\r\n    // TODO: move to the page level into formik submit handler\r\n    const x = await formik.validateForm();\r\n    const isValid = Object.keys(x).length === 0;\r\n    if (isValid) {\r\n      setOpen(true);\r\n    } else {\r\n      if (!!getRowsErrors) {\r\n        getRowsErrors(Object.entries(x).some(f => f[0] === 'Rows'));\r\n      }\r\n    }\r\n  }, [formik, getRowsErrors]);\r\n  return (\r\n    <>\r\n      <Button\r\n        onClick={handleClick}\r\n        title={title}\r\n        size=\"small\"\r\n        startIcon={<Icon icon={'save'} />}\r\n        disabled={!submitEnabled || props.disabled}\r\n        aria-label={t(translations.Submit)}\r\n      >\r\n        {t(translations.Submit)}\r\n      </Button>\r\n      <DialogConfirm\r\n        isOpen={open}\r\n        title={title}\r\n        body={t(translations.ServiceRequest_SubmitStepAlert)}\r\n        onCancel={() => setOpen(false)}\r\n        onConfirm={handleSubmit}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useRequestSamplesSlice } from '../../slice';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { selectServiceRequestStatusesByInternalId } from '../../slice/selectors';\r\n\r\nexport interface ICancelServiceRequestButtonProps {\r\n  serviceRequestId?: number;\r\n}\r\nexport function CancelServiceRequestButton(\r\n  props: ICancelServiceRequestButtonProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const dispatch = useDispatch();\r\n  const statuses = useSelector(state =>\r\n    selectServiceRequestStatusesByInternalId(state, 'Cancelled'),\r\n  );\r\n  const handleClick = () => {\r\n    const status = statuses?.[0];\r\n    if (props.serviceRequestId !== undefined && status !== undefined) {\r\n      dispatch(\r\n        actions.cancelServiceRequest({\r\n          Id: props.serviceRequestId,\r\n          Status: status,\r\n          Reason: 'Canceled',\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  return (\r\n    <ButtonConfirm\r\n      size=\"small\"\r\n      startIcon={<Icon icon=\"times\" />}\r\n      aria-label=\"history\"\r\n      onClick={handleClick}\r\n      variant=\"white\"\r\n      title={t(translations.CancelRequest)}\r\n      confirmationDialogBody={t(translations.AreYouSure)}\r\n    >\r\n      {t(translations.CancelRequest)}\r\n    </ButtonConfirm>\r\n  );\r\n}\r\n","/**\r\n *\r\n * ServiceRequestAddons\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport DateRenderer from 'app/components/BasicTable/CellRenderers/DateRenderer';\r\nimport { IConsumableServiceDto } from 'api/odata/generated/entities/IConsumableServiceDto';\r\nimport { ControlledTable } from 'app/components/BasicTable/ControlledTable';\r\nimport { useDispatch } from 'react-redux';\r\nimport { CellProps } from 'react-table';\r\nimport { IUserBaseDto } from 'api/odata/generated/entities/IUserBaseDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport {\r\n  ServiceRequestMilestoneChargeDetailsProps,\r\n  ServiceRequestMilestoneChargeType,\r\n} from '../ServiceRequestMilestoneChargeDetails';\r\nimport { showAddonCharge, showManualCharge } from './utils';\r\nimport { RowActionsMenu } from 'app/components/BasicTable/RowActions';\r\nimport { DescriptionCell } from 'app/components/BasicTable/components/DescriptionCell';\r\nimport { ColumnWithStrictAccessor } from 'react-table';\r\nimport { IUnitTypeDto } from 'api/odata/generated/entities/IUnitTypeDto';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { InvoiceDetailsSidePanelLink } from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { Entity } from 'types/common';\r\nimport { roundTwoPlacesAfterDecimalPoint } from 'utils/number-utils';\r\n\r\nexport interface ServiceRequestAddonsProps {\r\n  charges: IServiceRequestMilestoneChargeDto[];\r\n  milestone?: IServiceRequestMilestoneDto;\r\n  isAdmin: boolean;\r\n  AddonType: AddonTypesUnion;\r\n  InternalStatus: InternalServiceRequestStatusesUnion;\r\n  pageName?: string;\r\n  tableContainerSyles?: React.CSSProperties;\r\n  // indicates if this component is opened through side panel\r\n  printing?: Printing;\r\n  useSidePanel: boolean;\r\n  UnitType?: Entity<number>;\r\n}\r\n\r\nexport function ServiceRequestAddons(props: ServiceRequestAddonsProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const columns: Array<ColumnWithStrictAccessor<\r\n    IServiceRequestMilestoneChargeDto\r\n  >> = React.useMemo(\r\n    () => [\r\n      { Header: 'Id', accessor: 'Id' },\r\n      {\r\n        Header: t(translations.Date) as string,\r\n        accessor: 'Date',\r\n\r\n        Cell: DateRenderer,\r\n      },\r\n      {\r\n        Header: t(translations.ServiceOrCharge) as string,\r\n        accessor: 'Service',\r\n        Cell: ({\r\n          value,\r\n          row,\r\n        }: CellProps<\r\n          IServiceRequestMilestoneChargeDto,\r\n          IConsumableServiceDto\r\n        >) => value?.Name ?? row.original.Name ?? t(translations.NA),\r\n      },\r\n      { Header: t(translations.Quantity) as string, accessor: 'Quantity' },\r\n      {\r\n        Header: t(translations.Unit) as string,\r\n        accessor: 'UnitType',\r\n        Cell: ({\r\n          value,\r\n          row,\r\n        }: CellProps<IServiceRequestMilestoneChargeDto, IUnitTypeDto>) =>\r\n          (value ?? row.original.Service?.UnitType)?.Name ?? t(translations.NA),\r\n      },\r\n      {\r\n        Header: t(translations.Rate) as string,\r\n        accessor: 'Rate',\r\n        Cell: ({ value, row }) => {\r\n          return (\r\n            <>\r\n              {roundTwoPlacesAfterDecimalPoint(\r\n                value ?? row.original.Service?.Rate,\r\n              )}\r\n            </>\r\n          );\r\n        },\r\n      },\r\n      {\r\n        Header: t(translations.Amount) as string,\r\n        accessor: 'Amount',\r\n        Cell: ({ value }) => {\r\n          return <>{roundTwoPlacesAfterDecimalPoint(value)}</>;\r\n        },\r\n      },\r\n      {\r\n        Header: t(translations.InvoiceId) as string,\r\n        accessor: 'InvoiceId',\r\n        Cell: ({ value, row }) =>\r\n          value !== null && value !== undefined && typeof value === 'number' ? (\r\n            <InvoiceDetailsSidePanelLink\r\n              id={value}\r\n              useSidePanel={props.useSidePanel}\r\n            >\r\n              {value}\r\n            </InvoiceDetailsSidePanelLink>\r\n          ) : (\r\n            <>{value}</>\r\n          ),\r\n      },\r\n      {\r\n        Header: t(translations.Remarks) as string,\r\n        accessor: 'Remarks',\r\n        Cell: DescriptionCell({ width: 'medium' }),\r\n      },\r\n      {\r\n        Header: t(translations.UpdatedBy) as string,\r\n        accessor: 'UpdatedBy',\r\n        Cell: ({\r\n          value,\r\n        }: CellProps<IServiceRequestMilestoneChargeDto, IUserBaseDto>) =>\r\n          value?.Name ?? t(translations.NA),\r\n      },\r\n    ],\r\n    [props.useSidePanel, t],\r\n  );\r\n\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n\r\n  const show_newAddonCharge = React.useMemo(() => {\r\n    const result = showAddonCharge({\r\n      Charged: props.milestone?.Charged,\r\n      isAdmin: props.isAdmin,\r\n      ServiceRequestAddonTypes: props.AddonType,\r\n      ServiceRequestInternalStatus: props.InternalStatus,\r\n    });\r\n    return result;\r\n  }, [\r\n    props.AddonType,\r\n    props.InternalStatus,\r\n    props.isAdmin,\r\n    props.milestone?.Charged,\r\n  ]);\r\n\r\n  const show_newManualCharge = React.useMemo(() => {\r\n    const result = showManualCharge({\r\n      Charged: props.milestone?.Charged,\r\n      isAdmin: props.isAdmin,\r\n      ServiceRequestAddonTypes: props.AddonType,\r\n      ServiceRequestInternalStatus: props.InternalStatus,\r\n    });\r\n    return result;\r\n  }, [\r\n    props.AddonType,\r\n    props.InternalStatus,\r\n    props.isAdmin,\r\n    props.milestone?.Charged,\r\n  ]);\r\n  const handleAddServiceClick = React.useCallback(() => {\r\n    if (props.milestone === undefined) {\r\n      return;\r\n    }\r\n    const payload: ServiceRequestMilestoneChargeDetailsProps = {\r\n      serviceRequestId: props.milestone?.ServiceRequestId,\r\n      serviceRequestMilestoneId: props.milestone.Id,\r\n      type: 'service',\r\n      enableAddonCharge: show_newAddonCharge,\r\n      enableManualCharge: show_newManualCharge,\r\n    };\r\n    dispatch(\r\n      actions.openSidePanel({\r\n        type: RenderPageType.ServiceRequestMilestoneCharge,\r\n        props: payload,\r\n      }),\r\n    );\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    props.milestone,\r\n    show_newAddonCharge,\r\n    show_newManualCharge,\r\n  ]);\r\n  const handleAddChargeClick = React.useCallback(() => {\r\n    if (props.milestone === undefined) {\r\n      return;\r\n    }\r\n    const payload: ServiceRequestMilestoneChargeDetailsProps = {\r\n      serviceRequestId: props.milestone?.ServiceRequestId,\r\n      serviceRequestMilestoneId: props.milestone.Id,\r\n      type: 'charge',\r\n      enableAddonCharge: show_newAddonCharge,\r\n      enableManualCharge: show_newManualCharge,\r\n      unitType: props.UnitType,\r\n    };\r\n    dispatch(\r\n      actions.openSidePanel({\r\n        type: RenderPageType.ServiceRequestMilestoneCharge,\r\n        props: payload,\r\n      }),\r\n    );\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    props.UnitType,\r\n    props.milestone,\r\n    show_newAddonCharge,\r\n    show_newManualCharge,\r\n  ]);\r\n\r\n  const handleEditClick = React.useCallback(\r\n    (value: IServiceRequestMilestoneChargeDto) => {\r\n      if (props.milestone === undefined) {\r\n        return;\r\n      }\r\n      const type: ServiceRequestMilestoneChargeType =\r\n        value.OfflineServiceTypeId === null ? 'charge' : 'service';\r\n      const payload: ServiceRequestMilestoneChargeDetailsProps = {\r\n        serviceRequestId: props.milestone?.ServiceRequestId,\r\n        serviceRequestMilestoneId: props.milestone.Id,\r\n        type: type,\r\n        enableAddonCharge: show_newAddonCharge,\r\n        enableManualCharge: show_newManualCharge,\r\n        value: value,\r\n      };\r\n      dispatch(\r\n        actions.openSidePanel({\r\n          type: RenderPageType.ServiceRequestMilestoneCharge,\r\n          props: payload,\r\n        }),\r\n      );\r\n    },\r\n    [\r\n      actions,\r\n      dispatch,\r\n      props.milestone,\r\n      show_newAddonCharge,\r\n      show_newManualCharge,\r\n    ],\r\n  );\r\n\r\n  const handleDeleteClick = React.useCallback(\r\n    (value: IServiceRequestMilestoneChargeDto) => {\r\n      dispatch(actions.deleteMilestoneCharge(value));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const rowActions = React.useMemo(() => {\r\n    if (show_newAddonCharge) {\r\n      return [\r\n        ({ value, row, updateMyData }) =>\r\n          show_newAddonCharge && (\r\n            <RowActionsMenu\r\n              id={`row-actions-menu_${row.original.Id}`}\r\n              items={[\r\n                {\r\n                  icon: 'pencil-alt',\r\n                  text: t(translations.Edit),\r\n                  title: t(translations.Edit),\r\n                  onClick: () => Promise.resolve(handleEditClick(row.original)),\r\n                },\r\n                {\r\n                  icon: 'times',\r\n                  text: t(translations.Delete),\r\n                  title: t(translations.Delete),\r\n                  onClick: () =>\r\n                    Promise.resolve(handleDeleteClick(row.original)),\r\n                },\r\n              ]}\r\n            />\r\n          ),\r\n      ];\r\n    }\r\n  }, [handleDeleteClick, handleEditClick, show_newAddonCharge, t]);\r\n  const pageActions: PageActionRenderer[] = React.useMemo(() => {\r\n    const result: PageActionRenderer[] = [];\r\n    if (show_newManualCharge) {\r\n      result.push(() => (\r\n        <TopActionButton\r\n          size=\"small\"\r\n          variant={show_newAddonCharge ? 'white' : 'main'}\r\n          startIcon=\"circle-dollar-to-slot\"\r\n          icon=\"circle-dollar-to-slot\"\r\n          key={'show_newAddonCharge'}\r\n          onClick={handleAddChargeClick}\r\n          text={t(translations.AddCharge) as string}\r\n        />\r\n      ));\r\n    }\r\n    if (show_newAddonCharge) {\r\n      result.push(() => (\r\n        <TopActionButton\r\n          size=\"small\"\r\n          variant={'main'}\r\n          startIcon=\"plus\"\r\n          icon=\"plus\"\r\n          key={'show_newAddonCharge'}\r\n          onClick={handleAddServiceClick}\r\n          text={t(translations.AddService) as string}\r\n        />\r\n      ));\r\n    }\r\n    return result;\r\n  }, [\r\n    handleAddChargeClick,\r\n    handleAddServiceClick,\r\n    show_newAddonCharge,\r\n    show_newManualCharge,\r\n    t,\r\n  ]);\r\n  return (\r\n    <>\r\n      <ControlledTable<IServiceRequestMilestoneChargeDto>\r\n        columns={columns as Array<Column<IServiceRequestMilestoneChargeDto>>}\r\n        //withToolBar={false}\r\n        data={props.charges ?? []}\r\n        useRowSelect={false}\r\n        hideMenuOnMobile={true}\r\n        screenName={props.pageName ?? t(translations.AddOnServices)}\r\n        useGlobalFilter={false}\r\n        api={'foo'}\r\n        customEmptyTableSettings={{\r\n          headTitle: t(translations.dash_EmptyWidgetTitle),\r\n          title:\r\n            show_newAddonCharge || show_newManualCharge\r\n              ? t(translations.AddonCharges_Empty_AddEnabled)\r\n              : undefined,\r\n        }}\r\n        manualPagination={false}\r\n        manualSorting={false}\r\n        compactTable={false}\r\n        enablePagination={false}\r\n        compact={isMobile}\r\n        screenNameVariant=\"section\"\r\n        dataLength={props.charges?.length ?? 0}\r\n        loading={props.charges === undefined}\r\n        onChangeState={() => void 0}\r\n        onExport={() => Promise.resolve()}\r\n        useExport={false}\r\n        pageCount={123}\r\n        initialPageSize={1000}\r\n        serviceGroups={[]}\r\n        rowActions={rowActions}\r\n        pageActions={pageActions}\r\n        tableContainerSyles={props.tableContainerSyles}\r\n        printing={props.printing}\r\n      />\r\n    </>\r\n  );\r\n}\r\n// const Container = styled(Box)(({ theme }) => ({\r\n//   // margin is needed here to replace the containing cell padding because of a disappearing border there\r\n//   margin: theme.spacing(2),\r\n// }));\r\n// const ButtonsContainer = styled(Box)(({ theme }) => ({\r\n//   display: 'flex',\r\n//   gap: theme.spacing(1),\r\n//   marginTop: theme.spacing(1),\r\n// }));\r\n","import { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport interface showAddonChargeProps {\r\n  ServiceRequestInternalStatus: InternalServiceRequestStatusesUnion;\r\n  Charged?: boolean;\r\n  ServiceRequestAddonTypes: AddonTypesUnion;\r\n  isAdmin: boolean;\r\n}\r\nexport function showAddonCharge(props: showAddonChargeProps) {\r\n  if (props.Charged === true) {\r\n    return false;\r\n  }\r\n  if (props.ServiceRequestInternalStatus === 'Completed') {\r\n    return false;\r\n  }\r\n\r\n  if (!props.isAdmin) {\r\n    const userEditableStatuses: Array<InternalServiceRequestStatusesUnion> = [\r\n      'Draft',\r\n      'ReturnedToUser',\r\n    ];\r\n    if (!userEditableStatuses.includes(props.ServiceRequestInternalStatus)) {\r\n      return false;\r\n    }\r\n  }\r\n\r\n  switch (props.ServiceRequestAddonTypes) {\r\n    case 'Addons':\r\n    case 'Milestones':\r\n      return props.isAdmin;\r\n    case 'UserAddons':\r\n      return true;\r\n    case 'NA':\r\n      return false;\r\n    default:\r\n      assertExhaustive(props.ServiceRequestAddonTypes);\r\n  }\r\n}\r\n\r\nexport function showManualCharge(props: showAddonChargeProps) {\r\n  if (props.ServiceRequestAddonTypes === 'Milestones') {\r\n    return !props.Charged && props.isAdmin;\r\n  } else {\r\n    return false;\r\n  }\r\n}\r\n","/**\r\n *\r\n * PriorityPicker\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  Chip,\r\n  ChipProps,\r\n  Menu,\r\n  MenuItem,\r\n  Theme,\r\n  makeStyles,\r\n} from '@material-ui/core';\r\nimport {\r\n  ServiceRequestMilestoneStatusesUnionArray,\r\n  ServiceRequestMilestoneStatusesUnion,\r\n} from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { TypeColor, getColor } from 'styles/colors/types';\r\n\r\nexport interface ServiceRequestMilestoneStatusMenuPickerProps {\r\n  name?: string;\r\n  value: ServiceRequestMilestoneStatusesUnion;\r\n  onChange: (value: ServiceRequestMilestoneStatusesUnion) => void;\r\n}\r\nexport function ServiceRequestMilestoneStatusMenuPicker({\r\n  onChange,\r\n  ...props\r\n}: ServiceRequestMilestoneStatusMenuPickerProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const [anchorEl, setAnchorEl] = React.useState(null);\r\n  const handleChipClick = event => {\r\n    console.debug(event);\r\n    setAnchorEl(event.currentTarget);\r\n  };\r\n\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n  };\r\n  const getChipColor = (\r\n    status: ServiceRequestMilestoneStatusesUnion,\r\n  ): TypeColor => {\r\n    switch (status) {\r\n      case 'Completed':\r\n        return 'success';\r\n      case 'NotStarted':\r\n        return 'default';\r\n      case 'Started':\r\n        return 'info';\r\n    }\r\n  };\r\n  const handleMenuItemClick = (\r\n    status: ServiceRequestMilestoneStatusesUnion,\r\n  ) => {\r\n    onChange(status);\r\n    handleClose();\r\n  };\r\n  return (\r\n    <>\r\n      <StyledChip\r\n        onClick={handleChipClick}\r\n        label={t(props.value)}\r\n        color={getChipColor(props.value)}\r\n      />\r\n      <Menu\r\n        open={anchorEl !== null}\r\n        keepMounted\r\n        onClose={handleClose}\r\n        anchorEl={anchorEl}\r\n      >\r\n        {ServiceRequestMilestoneStatusesUnionArray.map(status => (\r\n          <MenuItem key={status} onClick={() => handleMenuItemClick(status)}>\r\n            {t(status) ?? status}\r\n          </MenuItem>\r\n        ))}\r\n      </Menu>\r\n    </>\r\n  );\r\n}\r\nconst StyledChip = ({\r\n  color,\r\n  ...props\r\n}: Omit<ChipProps, 'color'> & { color: TypeColor }) => {\r\n  const classes = useStyles({ color: color });\r\n  return <Chip className={classes.root} {...props} />;\r\n};\r\nconst useStyles = makeStyles<Theme, { color: TypeColor }>(theme => ({\r\n  root: {\r\n    backgroundColor: props => getColor(theme, props.color, 'light'),\r\n    color: props => getColor(theme, props.color, 'dark'),\r\n    '&:hover, &:focus': {\r\n      backgroundColor: props => getColor(theme, props.color, 'bgHover'),\r\n      color: props => getColor(theme, props.color, 'textHover'),\r\n    },\r\n  },\r\n}));\r\n","/**\r\n *\r\n * ServiceRequestMilestones\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport {\r\n  Table,\r\n  TableBody,\r\n  TableCell,\r\n  TableHead,\r\n  TableRow,\r\n  makeStyles,\r\n  styled,\r\n  TableContainer,\r\n} from '@material-ui/core';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport produce from 'immer';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ServiceRequestMilestoneDetailsProps } from '../ServiceRequestMilestoneDetails';\r\nimport { RowActionsMenu } from 'app/components/BasicTable/RowActions';\r\nimport { InvoiceDetailsSidePanelLink } from 'app/pages/InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { sum } from 'lodash';\r\nimport { ServiceRequestAddons } from '../ServiceRequestAddons';\r\nimport { ServiceRequestMilestoneStatusesUnion } from 'api/odata/generated/enums/ServiceRequestMilestoneStatuses';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { TruncatedDescriptionText } from 'app/components/Description';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { ServiceRequestMilestoneStatusMenuPicker } from 'app/components/pickers/StaticOptionsPickers/ServiceRequestMilestoneStatusMenuPicker';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport clsx from 'clsx';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { roundTwoPlacesAfterDecimalPoint } from 'utils/number-utils';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ServiceRequestMilestonesProps {\r\n  milestones?: Array<IServiceRequestMilestoneDto>;\r\n  isAdmin: boolean;\r\n  AddonType: AddonTypesUnion;\r\n  InternalStatus: InternalServiceRequestStatusesUnion;\r\n  ServiceRequestId: number;\r\n  pageName?: string;\r\n  tableContainerSyles?: React.CSSProperties;\r\n  // indicates if this component is opened through side panel\r\n  printing?: Printing;\r\n  useSidePanel: boolean;\r\n  UnitType?: Entity<number>;\r\n}\r\n\r\ninterface IState {\r\n  expanded: Record<number, boolean>;\r\n}\r\n\r\nexport function ServiceRequestMilestones({\r\n  milestones,\r\n  pageName,\r\n  tableContainerSyles,\r\n  useSidePanel,\r\n  ...props\r\n}: ServiceRequestMilestonesProps) {\r\n  const { t } = useTranslation();\r\n  const classes = useStyles();\r\n  const [state, , extendState] = useAsyncExtendedState<IState>({\r\n    expanded: {},\r\n  });\r\n  const { checkIsMobile } = useIsMobile();\r\n  const isMobile = checkIsMobile();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const handleToggleClick = (id: number, expand: boolean) => {\r\n    extendState(state => {\r\n      const n = produce(expanded => {\r\n        expanded[id] = expand;\r\n      })(state.expanded);\r\n\r\n      return { expanded: n };\r\n    });\r\n  };\r\n  const handleAddMilestoneClick = React.useCallback(() => {\r\n    const sidePanelProps: ServiceRequestMilestoneDetailsProps = {\r\n      serviceRequestId: props.ServiceRequestId,\r\n      type: 'Insert',\r\n    };\r\n    dispatch(\r\n      actions.openSidePanel({\r\n        type: RenderPageType.ServiceRequestMilestone,\r\n        props: sidePanelProps,\r\n      }),\r\n    );\r\n  }, [actions, dispatch, props.ServiceRequestId]);\r\n\r\n  const handleEditClick = React.useCallback(\r\n    (milestone: IServiceRequestMilestoneDto) => {\r\n      const sidePanelProps: ServiceRequestMilestoneDetailsProps = {\r\n        serviceRequestId: props.ServiceRequestId,\r\n        type: 'Update',\r\n        value: milestone,\r\n      };\r\n      dispatch(\r\n        actions.openSidePanel({\r\n          type: RenderPageType.ServiceRequestMilestone,\r\n          props: sidePanelProps,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch, props.ServiceRequestId],\r\n  );\r\n  const handleDeleteClick = React.useCallback(\r\n    (milestone: IServiceRequestMilestoneDto) => {\r\n      dispatch(actions.deleteMilestone(milestone));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const columnsCount = 9;\r\n  const showActionsColumn =\r\n    props.isAdmin &&\r\n    milestones?.some(milestone => (milestone.InvoiceId ?? 0) === 0);\r\n  const colSpan = columnsCount + (showActionsColumn ? 1 : 0);\r\n  const handleStatusChange = (\r\n    milestone: IServiceRequestMilestoneDto,\r\n    value: ServiceRequestMilestoneStatusesUnion | null,\r\n  ) => {\r\n    if (value !== null) {\r\n      dispatch(\r\n        actions.updateMilestone({\r\n          ...milestone,\r\n          ...{ Status: value },\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  const print = React.useMemo(() => {\r\n    return props.printing !== undefined && props.printing.printing === true;\r\n  }, [props.printing]);\r\n  return (\r\n    <TableContainer key=\"milestone-table-container\" style={tableContainerSyles}>\r\n      <TableToolbar\r\n        screenName={pageName ?? t(translations.Milestones)}\r\n        screenNameVariant={'section'}\r\n        showAlert={undefined}\r\n        alertContent={undefined}\r\n        showMenu={false}\r\n        compact={undefined}\r\n        titleAsColumn={true}\r\n        titleIcon={\r\n          <Body bold size=\"small\">\r\n            {milestones?.length} {t(translations.Records)}\r\n          </Body>\r\n        }\r\n      >\r\n        {print === false ? (\r\n          <>\r\n            {props.isAdmin && (\r\n              <span>\r\n                <TopActionButton\r\n                  variant=\"main\"\r\n                  size=\"small\"\r\n                  startIcon=\"plus\"\r\n                  icon=\"plus\"\r\n                  onClick={handleAddMilestoneClick}\r\n                  text={t(translations.Milestone)}\r\n                />\r\n              </span>\r\n            )}\r\n          </>\r\n        ) : (\r\n          <></>\r\n        )}\r\n        {<></>}\r\n      </TableToolbar>\r\n      <Box\r\n        component=\"div\"\r\n        className={clsx({\r\n          [classes.tableContent]: !isMobile,\r\n          [classes.tableContentShort]: isMobile,\r\n        })}\r\n      >\r\n        <Box component=\"div\" className={classes.tableScrolling}>\r\n          <Table className={classes.table}>\r\n            <TableHead>\r\n              <TableRow>\r\n                <TableCell component=\"th\"></TableCell>\r\n                <TableCell component=\"th\">\r\n                  {t(translations.Milestone)}\r\n                </TableCell>\r\n                <TableCell component=\"th\">\r\n                  {t(translations.TargetDate)}\r\n                </TableCell>\r\n                <TableCell component=\"th\">{t(translations.Total)}</TableCell>\r\n                <TableCell component=\"th\">\r\n                  {t(translations.AssignedTo)}\r\n                </TableCell>\r\n                <TableCell component=\"th\">\r\n                  {t(translations.CompletionDate)}\r\n                </TableCell>\r\n                <TableCell component=\"th\">\r\n                  {t(translations.Description)}\r\n                </TableCell>\r\n                <TableCell component=\"th\">\r\n                  {t(translations.InvoiceId)}\r\n                </TableCell>\r\n                <TableCell component=\"th\">{t(translations.Status)}</TableCell>\r\n                {showActionsColumn && <TableCell component=\"th\"></TableCell>}\r\n              </TableRow>\r\n            </TableHead>\r\n            <TableBody>\r\n              {milestones?.map(milestone => {\r\n                const isExpanded = state.expanded[milestone.Id] === true;\r\n\r\n                return (\r\n                  <React.Fragment key={`milestone-${milestone.Id}`}>\r\n                    <TableRow key={`milestone-${milestone.Id}`}>\r\n                      <TableCell>\r\n                        <IconButton\r\n                          variant=\"ghost\"\r\n                          size=\"small\"\r\n                          onClick={() =>\r\n                            handleToggleClick(milestone.Id, !isExpanded)\r\n                          }\r\n                        >\r\n                          <Icon\r\n                            icon={isExpanded ? 'chevron-up' : 'chevron-right'}\r\n                          />\r\n                        </IconButton>\r\n                      </TableCell>\r\n                      <TableCell>{milestone.Name}</TableCell>\r\n                      <TableCell>\r\n                        {dateUtils.shortDateFormat(milestone.TargetDate)}\r\n                      </TableCell>\r\n                      <TableCell>\r\n                        {roundTwoPlacesAfterDecimalPoint(\r\n                          sum(\r\n                            milestone.ServiceRequestMilestoneCharges.map(\r\n                              f => f.Amount ?? 0,\r\n                            ),\r\n                          ),\r\n                        )}\r\n                      </TableCell>\r\n                      <TableCell>\r\n                        {milestone.Assignees?.map(f => f.Name)?.join(', ')}\r\n                      </TableCell>\r\n                      <TableCell>\r\n                        {dateUtils.shortDateFormat(milestone.CompletionDate)}\r\n                      </TableCell>\r\n                      <TableCell>\r\n                        <TruncatedDescriptionText\r\n                          value={milestone.Description}\r\n                        />\r\n                      </TableCell>\r\n                      <TableCell>\r\n                        {milestone.InvoiceId !== null && (\r\n                          <InvoiceDetailsSidePanelLink\r\n                            id={milestone.InvoiceId}\r\n                            useSidePanel={useSidePanel}\r\n                          >\r\n                            {milestone.InvoiceId}\r\n                          </InvoiceDetailsSidePanelLink>\r\n                        )}\r\n                      </TableCell>\r\n                      <TableCell>\r\n                        {milestone.Status !== null &&\r\n                          (props.isAdmin && milestone.InvoiceId === null ? (\r\n                            <ServiceRequestMilestoneStatusMenuPicker\r\n                              value={milestone.Status}\r\n                              onChange={value =>\r\n                                handleStatusChange(milestone, value)\r\n                              }\r\n                            />\r\n                          ) : (\r\n                            t(milestone.Status)\r\n                          ))}\r\n                      </TableCell>\r\n\r\n                      {showActionsColumn && (\r\n                        <TableCell>\r\n                          {milestone.InvoiceId === null && (\r\n                            <RowActionsMenu\r\n                              id={`row-actions-menu_${milestone.Id}`}\r\n                              items={[\r\n                                {\r\n                                  icon: 'pencil-alt',\r\n                                  text: t(translations.Edit),\r\n                                  title: t(translations.Edit),\r\n                                  onClick: () =>\r\n                                    Promise.resolve(handleEditClick(milestone)),\r\n                                },\r\n                                {\r\n                                  icon: 'times',\r\n                                  text: t(translations.Delete),\r\n                                  title: t(translations.Delete),\r\n                                  onClick: () =>\r\n                                    Promise.resolve(\r\n                                      handleDeleteClick(milestone),\r\n                                    ),\r\n                                },\r\n                              ]}\r\n                            />\r\n                          )}\r\n                        </TableCell>\r\n                      )}\r\n                    </TableRow>\r\n                    {isExpanded && (\r\n                      <TableRow key={`milestone-charges-row-${milestone.Id}`}>\r\n                        <ServicesRow colSpan={colSpan}>\r\n                          <ServiceRequestAddons\r\n                            isAdmin={props.isAdmin}\r\n                            milestone={milestone}\r\n                            AddonType={props.AddonType}\r\n                            InternalStatus={props.InternalStatus}\r\n                            charges={milestone.ServiceRequestMilestoneCharges}\r\n                            useSidePanel={useSidePanel}\r\n                            UnitType={props.UnitType}\r\n                          />\r\n                        </ServicesRow>\r\n                      </TableRow>\r\n                    )}\r\n                  </React.Fragment>\r\n                );\r\n              })}\r\n            </TableBody>\r\n          </Table>\r\n        </Box>\r\n      </Box>\r\n    </TableContainer>\r\n  );\r\n}\r\nconst ServicesRow = styled(TableCell)(({ theme }) => ({\r\n  // setting the background color on the cell causes it's borders to disappear\r\n  backgroundColor: theme.palette.background.default,\r\n  backgroundClip: 'content-box',\r\n  // unsets 56px cell height set on TableCell\r\n  height: 'unset',\r\n  padding: '1px',\r\n}));\r\n\r\nconst useStyles = makeStyles(theme => ({\r\n  table: {\r\n    backgroundColor: theme.palette.background.paper,\r\n    width: '100%',\r\n    whiteSpace: 'pre',\r\n  },\r\n  tableContent: {\r\n    padding: theme.spacing(0, 4, 4),\r\n  },\r\n  tableContentShort: {\r\n    padding: theme.spacing(0, 2),\r\n  },\r\n  tableScrolling: {\r\n    width: '100%',\r\n    overflow: 'auto',\r\n    '&::-webkit-scrollbar': {\r\n      height: '6px',\r\n    },\r\n    '&::-webkit-scrollbar-thumb': {\r\n      boxShadow: `inset 0 0 2px ${theme.palette.common.grayBorders}`,\r\n      borderRadius: '6px',\r\n      backgroundColor: theme.palette.common.grayBorders,\r\n    },\r\n  },\r\n}));\r\n\r\n// interface ToolbarProps {\r\n//   left?: React.ReactNode;\r\n//   right?: React.ReactNode;\r\n// }\r\n\r\n// function Toolbar(props: ToolbarProps) {\r\n//   return (\r\n//     <Container>\r\n//       <Box>{props.left}</Box>\r\n//       <Box>{props.right}</Box>\r\n//     </Container>\r\n//   );\r\n// }\r\n// const Container = styled(Box)(({ theme }) => ({\r\n//   margin: theme.spacing(1),\r\n//   display: 'flex',\r\n//   justifyContent: 'space-between',\r\n//   alignItems: 'center',\r\n// }));\r\n","import * as React from 'react';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { ServiceRequestMilestones } from '../ServiceRequestMilestones';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectServiceRequestMilestones } from '../../RequestSamplesPage/slice/selectors';\r\nimport { ServiceRequestAddons } from '../ServiceRequestAddons';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { IServiceRequestMilestoneDto } from 'api/odata/generated/entities/IServiceRequestMilestoneDto';\r\nimport { IServiceRequestMilestoneChargeDto } from 'api/odata/generated/entities/IServiceRequestMilestoneChargeDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\nimport { TableRowsSkeleton } from 'app/components/BasicTable/components/TableSkeleton';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface ServiceRequestMilestonesSectionProps {\r\n  AddonType: AddonTypesUnion;\r\n  ServiceRequestId: number;\r\n  isAdmin: boolean;\r\n  InternalStatus: InternalServiceRequestStatusesUnion;\r\n  pageName?: string;\r\n  tableContainerStyles?: React.CSSProperties;\r\n  // indicates if this component is opened through side panel\r\n  printing?: Printing;\r\n  useSidePanel: boolean;\r\n  UnitType?: Entity<number>;\r\n}\r\n\r\nexport function ServiceRequestMilestonesSection(\r\n  props: ServiceRequestMilestonesSectionProps,\r\n) {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  React.useEffect(() => {\r\n    dispatch(actions.loadMilestones({ Id: props.ServiceRequestId }));\r\n  }, [actions, dispatch, props.ServiceRequestId]);\r\n  const milestones = useSelector(selectServiceRequestMilestones);\r\n  const data = React.useMemo(() => {\r\n    switch (props.AddonType) {\r\n      case 'Milestones':\r\n        return milestones;\r\n      case 'Addons':\r\n      case 'UserAddons':\r\n        return milestones?.flatMap(f => f.ServiceRequestMilestoneCharges);\r\n      case 'NA':\r\n        return undefined;\r\n      default:\r\n        assertExhaustive(props.AddonType);\r\n    }\r\n  }, [milestones, props.AddonType]);\r\n\r\n  const print = React.useMemo(() => {\r\n    return props.printing !== undefined && props.printing.printing === true;\r\n  }, [props.printing]);\r\n  React.useEffect(() => {\r\n    if (\r\n      props.printing !== undefined &&\r\n      print &&\r\n      props.printing.onLoading !== undefined\r\n    ) {\r\n      props.printing.onLoading(props.printing.id, milestones === undefined);\r\n    }\r\n  }, [milestones, print, props.printing]);\r\n\r\n  if (milestones === undefined) {\r\n    return <TableRowsSkeleton isCards={false} isMobile={false} />;\r\n  }\r\n\r\n  switch (props.AddonType) {\r\n    case 'Milestones':\r\n      return (\r\n        <ServiceRequestMilestones\r\n          milestones={data as IServiceRequestMilestoneDto[]}\r\n          AddonType={props.AddonType}\r\n          InternalStatus={props.InternalStatus}\r\n          isAdmin={props.isAdmin}\r\n          ServiceRequestId={props.ServiceRequestId}\r\n          pageName={props.pageName}\r\n          tableContainerSyles={props.tableContainerStyles}\r\n          printing={props.printing}\r\n          useSidePanel={props.useSidePanel}\r\n          UnitType={props.UnitType}\r\n        />\r\n      );\r\n    case 'Addons':\r\n    case 'UserAddons':\r\n      return (\r\n        <ServiceRequestAddons\r\n          isAdmin={props.isAdmin}\r\n          milestone={milestones?.[0]}\r\n          AddonType={props.AddonType}\r\n          InternalStatus={props.InternalStatus}\r\n          charges={data as IServiceRequestMilestoneChargeDto[]}\r\n          pageName={props.pageName}\r\n          tableContainerSyles={props.tableContainerStyles}\r\n          printing={props.printing}\r\n          useSidePanel={props.useSidePanel}\r\n          UnitType={props.UnitType}\r\n        />\r\n      );\r\n    case 'NA':\r\n      return <>Milestones are disabled for this service</>;\r\n    default:\r\n      assertExhaustive(props.AddonType);\r\n  }\r\n}\r\n","import { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRequestSamplesSlice } from '../../slice';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface CloneServiceRequestButtonProps {\r\n  item?: Identifiable<number>;\r\n}\r\nexport function CloneServiceRequestButton(\r\n  props: CloneServiceRequestButtonProps,\r\n) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n\r\n  const handleCloneButtonClick = React.useCallback(() => {\r\n    if (props.item !== undefined) {\r\n      dispatch(actions.cloneServiceRequest(props.item.Id));\r\n    }\r\n  }, [actions, dispatch, props.item]);\r\n\r\n  if (props.item === undefined) {\r\n    return null;\r\n  }\r\n\r\n  return (\r\n    <TopActionButton\r\n      variant=\"ghost\"\r\n      size=\"small\"\r\n      shape=\"square\"\r\n      startIcon=\"copy\"\r\n      icon=\"copy\"\r\n      aria-label=\"copy\"\r\n      onClick={handleCloneButtonClick}\r\n      noChangeOnMobile\r\n      text={t(translations.Clone)}\r\n      title={t(translations.Clone)}\r\n    />\r\n  );\r\n}\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n  selectServiceRequestCustomFormColumns,\r\n  selectServiceRequestRowInsertStatus,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport {\r\n  IServiceRequestRelated,\r\n  IServiceRequestTableFormComponent,\r\n} from '../..';\r\nimport {\r\n  prepareServiceRequestRowModel,\r\n  serviceRequestModelToDto,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/prepareServiceRequestRowModel';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IServiceRequestTableRowModel } from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { ArrayHelpers } from 'formik';\r\nimport { omit } from 'lodash';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { ServiceRequestTableColumnsCollection } from 'app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\n\r\nexport interface AddServiceRequestRowButtonProps\r\n  extends IServiceRequestTableFormComponent,\r\n    IServiceRequestRelated {\r\n  /**\r\n   * Should be connected to service request's edit-ability state\r\n   */\r\n  disabled: boolean;\r\n}\r\nexport function AddServiceRequestRowButton({\r\n  serviceRequestId,\r\n  ...props\r\n}: AddServiceRequestRowButtonProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const processing = useSelector(selectServiceRequestRowInsertStatus);\r\n  const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n  const handleCreateButtonClick: React.MouseEventHandler<HTMLButtonElement> = React.useCallback(\r\n    async e => {\r\n      if (serviceRequestId === undefined) {\r\n        return;\r\n      }\r\n      if (columns === null) {\r\n        return;\r\n      }\r\n      try {\r\n        await AddNewCustomTableRow({\r\n          index: 0,\r\n          serviceRequestId,\r\n          columns,\r\n          model: {\r\n            ServiceRequestId: serviceRequestId,\r\n          },\r\n          arrayHelpers: props.arrayHelpers,\r\n        });\r\n        dispatch(\r\n          appSettingsActions.addNotification({\r\n            variant: 'success',\r\n            message: t(translations.ServiceRequestRow_InsertSuccess),\r\n          }),\r\n        );\r\n      } catch (error) {\r\n        dispatch(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            message: t(translations.ServiceRequestRow_InsertError),\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [columns, dispatch, props.arrayHelpers, serviceRequestId, t],\r\n  );\r\n\r\n  return (\r\n    <TopActionButton\r\n      variant=\"main\"\r\n      onClick={handleCreateButtonClick}\r\n      icon={'plus'}\r\n      size=\"small\"\r\n      text={t(translations.AddRows)}\r\n      disabled={props.disabled}\r\n      processing={processing === 'pending'}\r\n    />\r\n  );\r\n}\r\nexport async function AddNewCustomTableRow(props: {\r\n  serviceRequestId: number;\r\n  columns: ServiceRequestTableColumnsCollection;\r\n  arrayHelpers: ArrayHelpers;\r\n  model: Partial<IServiceRequestTableRowModel>;\r\n  index: number | undefined;\r\n}) {\r\n  const url = `api/odata/v4/ServiceRequests(${props.serviceRequestId})/Rows`;\r\n  const dto = serviceRequestModelToDto(props.model, props.columns);\r\n  const response: IServiceRequestRowDto = await httpClient.post(\r\n    url,\r\n    omit(dto, '@odata.context'),\r\n    {\r\n      params: { $expand: 'Status' },\r\n    },\r\n  );\r\n  const models = prepareServiceRequestRowModel([response], props.columns);\r\n  models.forEach(item => {\r\n    props.arrayHelpers.insert(props.index ?? 0, item);\r\n  });\r\n}\r\n","import { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport { IServiceRequestRowDto } from 'api/odata/generated/entities/IServiceRequestRowDto';\r\nimport * as React from 'react';\r\nimport {\r\n  EditorProps,\r\n  EditableCellProps,\r\n} from '../../EditableTable/EditableCell/index';\r\nimport { FastFieldProps, getIn } from 'formik';\r\nimport {\r\n  CustomFormColumnTypes,\r\n  IServiceRequestTableRowModel,\r\n} from '../../RequestSamplesPage/slice/types';\r\nimport { Column } from 'react-table';\r\nimport { ServiceRequestTableColumn } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\n/**\r\n * Custom function passed through react-table for updating row values\r\n */\r\nexport type UpdateServiceRequestRowValue<TValue> = (props: {\r\n  serviceRequestRowId: number;\r\n  columnId: number;\r\n  value: TValue;\r\n}) => void;\r\n\r\nexport interface IServiceRequestRowEditableCellProps\r\n  extends EditableCellProps<\r\n    IServiceRequestRowValueDto,\r\n    Column<IServiceRequestTableRowModel>,\r\n    IServiceRequestRowDto\r\n  > {\r\n  fieldProps: FastFieldProps;\r\n}\r\nexport function ServiceRequestRowEditableCell(\r\n  WrappedComponent: React.FunctionComponent<EditorProps<any>>,\r\n  props: {\r\n    column: ServiceRequestTableColumn;\r\n    focused?: boolean;\r\n  },\r\n) {\r\n  return React.memo(function Comp({\r\n    value: initialValue,\r\n    row,\r\n    column,\r\n    updateMyData, // This is a custom function that we supplied to our table instance\r\n    fieldProps,\r\n  }: IServiceRequestRowEditableCellProps) {\r\n    const name = fieldProps?.field.name;\r\n    const handleBlur = event => {\r\n      event.target.name = name;\r\n      fieldProps?.field.onBlur(event);\r\n    };\r\n\r\n    /**\r\n     * debounced handleChange intended to reduce the number of rerenders & http requests in text based fields.\r\n     */\r\n    const { value, handleChange } = useDebounce({\r\n      value: fieldProps.field.value,\r\n      timeout: getDebounceValue(props.column.ColumnType),\r\n      handleChange: value => {\r\n        try {\r\n          // updates form value\r\n          fieldProps?.field.onChange({\r\n            target: { value: value, name },\r\n          });\r\n\r\n          // clear child columns values (connected dropdowns)\r\n          props.column.Children?.forEach(childColumn => {\r\n            fieldProps?.form.setFieldValue(\r\n              getServiceRequestRowFieldName(\r\n                row.index,\r\n                childColumn.getFieldName(),\r\n              ),\r\n              null,\r\n            );\r\n          });\r\n\r\n          // persists data on the server\r\n          updateMyData({\r\n            columnId: props.column.Id,\r\n            value: value,\r\n            serviceRequestRowId: row.original.Id,\r\n          });\r\n        } catch (error) {\r\n          console.error(error);\r\n        }\r\n      },\r\n    });\r\n\r\n    /**\r\n       * after arrayHelpers.insert, the new row gets inserted with null as the validation error on the whole row\r\n       * e.g. formik.errors become (notice null as the first element in the array)\r\n       * {\r\n        \"friends\": [\r\n            null,\r\n            {\r\n              \"Values\": {\r\n                \"column_1006\": \"Positive Decimal must be greater than or equal to 0\",\r\n                \"column_1008\": \"Email must be a valid email\"\r\n              }\r\n            }\r\n          ]\r\n        }\r\n       */\r\n    const hasError = !isNullOrUndefined(fieldProps?.meta?.error);\r\n\r\n    /**\r\n     * parent value - extracted from the current row according to column configuration. used for connected drop downs.\r\n     */\r\n    const parentValue =\r\n      props.column.Parent === null\r\n        ? undefined\r\n        : getIn(\r\n            fieldProps?.form.values,\r\n            getServiceRequestRowFieldName(\r\n              row.index,\r\n              props.column.Parent.getFieldName(),\r\n            ),\r\n          ) ?? undefined;\r\n    return (\r\n      <>\r\n        <WrappedComponent\r\n          {...{\r\n            key: name,\r\n            name: name,\r\n            value: value,\r\n            onChange: handleChange,\r\n            helperText: fieldProps?.meta?.error,\r\n            error: hasError,\r\n            parentValue: parentValue,\r\n            onBlur: handleBlur,\r\n            autoFocus: props.focused && hasError,\r\n            //(value === null || value === undefined || value === ''),\r\n          }}\r\n        />\r\n      </>\r\n    );\r\n  });\r\n}\r\nexport function getServiceRequestRowName(\r\n  rowIndex: number,\r\n  key: keyof IServiceRequestTableRowModel,\r\n) {\r\n  return `Rows[${rowIndex}]${key}`;\r\n}\r\nexport function getServiceRequestRowFieldName(\r\n  rowIndex: number,\r\n  columnFieldName: string,\r\n) {\r\n  return `${getServiceRequestRowName(rowIndex, 'Values')}[${columnFieldName}]`;\r\n}\r\n\r\nfunction getDebounceValue(columnType: CustomFormColumnTypes) {\r\n  switch (columnType) {\r\n    case 'CheckBox':\r\n    case 'Date':\r\n    case 'DropDownList':\r\n    case 'UserSelection':\r\n    case 'Serial':\r\n      return;\r\n    case 'Email':\r\n    case 'Number':\r\n    case 'PositiveDecimal':\r\n    case 'PositiveInteger':\r\n    case 'ShortText':\r\n      return 100;\r\n    default:\r\n      assertExhaustive(columnType);\r\n  }\r\n}\r\n\r\ninterface useDebounceProps {\r\n  value: any;\r\n  handleChange: (value: any) => void;\r\n  timeout?: number;\r\n}\r\nfunction useDebounce(props: useDebounceProps) {\r\n  // tracks inner state in between the debounced updates\r\n  const [innerValue, setInnerValue] = React.useState(props.value);\r\n\r\n  // sync value changes from the outside of current field\r\n  React.useEffect(() => {\r\n    setInnerValue(props.value);\r\n  }, [props.value]);\r\n\r\n  // active timeout tracker\r\n  const timeout = React.useRef<number | undefined>();\r\n\r\n  if (props.timeout === undefined || props.timeout <= 0) {\r\n    return props;\r\n  }\r\n\r\n  return {\r\n    value: innerValue,\r\n    handleChange: value => {\r\n      setInnerValue(value);\r\n      if (timeout.current !== undefined) {\r\n        clearTimeout(timeout.current);\r\n      }\r\n\r\n      timeout.current = setTimeout(() => {\r\n        props.handleChange(value);\r\n        timeout.current = undefined;\r\n      }, props.timeout);\r\n    },\r\n  };\r\n}\r\n","import * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { EditorProps } from '../../EditableCell';\r\nimport { Autocomplete, AutocompleteProps, Value } from '@material-ui/lab';\r\nimport { TextField } from 'app/components/TextField';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { InputAdornment } from '@material-ui/core';\r\nimport { omit } from 'lodash';\r\n\r\n// 'DropDownList':\r\nexport interface IWithOptions<TKey, TEntity extends Entity<TKey>> {\r\n  options: TEntity[];\r\n}\r\nexport interface DropDownListProps<TKey, TEntity extends Entity<TKey>>\r\n  extends Omit<EditorProps<TEntity>, 'value'>,\r\n    IWithOptions<TKey, TEntity> {\r\n  value: EditorProps<TEntity>['value'] | null;\r\n}\r\n\r\n/**\r\n * Injects options into options prop of a component e.g DropDownList above\r\n * @param Component component that accepts options array\r\n * @param options options\r\n * @returns\r\n */\r\nexport function withOptions<TKey, TEntity extends Entity<TKey>, TProps>(\r\n  Component: React.FC<TProps & IWithOptions<TKey, TEntity>>,\r\n  options: IWithOptions<TKey, TEntity>['options'],\r\n): React.FC<TProps> {\r\n  const WithOptionsComponent = (props: TProps) => {\r\n    return <Component options={options} {...props} />;\r\n  };\r\n\r\n  return WithOptionsComponent;\r\n}\r\n\r\nexport interface SRSelectProps<\r\n  TKey,\r\n  T extends Entity<TKey>,\r\n  Multiple extends boolean | undefined\r\n> extends Omit<\r\n      AutocompleteProps<T, Multiple, false, false>,\r\n      | 'onChange'\r\n      | 'getOptionLabel'\r\n      | 'getOptionSelected'\r\n      | 'filterOptions'\r\n      | 'renderInput'\r\n      | 'options'\r\n    >,\r\n    IWithOptions<TKey, T> {\r\n  onChange: (value: Value<T, Multiple, false, false>) => void;\r\n  parentValue?: any;\r\n  error?: boolean;\r\n  helperText?: string;\r\n  info?: string;\r\n  autoFocus?: boolean;\r\n}\r\n\r\nexport function SRSelect<\r\n  TKey,\r\n  T extends Entity<TKey>,\r\n  Multiple extends boolean | undefined\r\n>({\r\n  parentValue,\r\n  onChange,\r\n  error,\r\n  helperText,\r\n  info,\r\n  autoFocus,\r\n  ...props\r\n}: SRSelectProps<TKey, T, Multiple>) {\r\n  return (\r\n    <>\r\n      <Autocomplete\r\n        onChange={(event, value, reason, details) => {\r\n          onChange?.(value);\r\n        }}\r\n        value={props.value ?? undefined}\r\n        getOptionLabel={option => option.Name}\r\n        className=\"atable\"\r\n        getOptionSelected={(a, b) => a?.Id === b?.Id}\r\n        size=\"small\"\r\n        renderInput={params => (\r\n          <TextField\r\n            {...params}\r\n            InputProps={{\r\n              disableUnderline: true,\r\n              autoFocus: autoFocus,\r\n              endAdornment: (\r\n                <React.Fragment>\r\n                  {params.InputProps.endAdornment}\r\n                  {((!!info && info !== '') || (error && !!helperText)) && (\r\n                    <InputAdornment position=\"end\">\r\n                      {!!info && info !== '' && (\r\n                        <InfoIcon title={info} error={error} />\r\n                      )}\r\n                      {error && (\r\n                        <InfoIcon title={helperText || ''} error={error} />\r\n                      )}\r\n                    </InputAdornment>\r\n                  )}\r\n                </React.Fragment>\r\n              ),\r\n\r\n              ...omit(params.InputProps, 'endAdornment'),\r\n            }}\r\n            variant=\"standard\"\r\n            error={error}\r\n          />\r\n        )}\r\n        {...props}\r\n      />\r\n    </>\r\n  );\r\n}\r\n","import { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { getGetUserSelectionsAutocompleteFn } from 'app/components/CustomForm/CustomFormFields/CustomFormUserSelection';\r\nimport * as React from 'react';\r\nimport { Entity } from 'types/common';\r\nimport { IWithOptions, SRSelectProps } from './index';\r\nimport { useAsyncOptions } from './useAsyncOptions';\r\n\r\n/**\r\n * Injects async options into options prop of a component e.g DropDownList above\r\n * @param Component component that accepts options array\r\n * @param options options\r\n * @returns\r\n */\r\nexport function withAsyncOptions<\r\n  TKey,\r\n  TEntity extends Entity<TKey>,\r\n  TMultiple extends boolean | undefined,\r\n  TProps extends SRSelectProps<TKey, TEntity, TMultiple>\r\n>(\r\n  Component: React.FC<TProps & IWithOptions<TKey, TEntity>>,\r\n  hocProps: {\r\n    multiple: TMultiple;\r\n  } & Pick<IFormFieldDto, 'CustomRoles' | 'FixedRoles' | 'UserSelectionType'>,\r\n): React.FC<TProps> {\r\n  const WithOptionsComponent = ({ ...props }: TProps) => {\r\n    const fetchOptionsCallback = React.useCallback(async search => {\r\n      const fn = getGetUserSelectionsAutocompleteFn({\r\n        CustomRoles: hocProps.CustomRoles,\r\n        FixedRoles: hocProps.FixedRoles,\r\n        UserSelectionType: hocProps.UserSelectionType,\r\n      });\r\n      const options = await fn(search);\r\n      return options;\r\n    }, []);\r\n    const asyncOptionProps = useAsyncOptions<Entity<string>>({\r\n      fetchOptions: fetchOptionsCallback,\r\n    });\r\n    return (\r\n      <Component\r\n        multiple={hocProps.multiple}\r\n        {...asyncOptionProps}\r\n        {...props}\r\n      />\r\n    );\r\n  };\r\n\r\n  return WithOptionsComponent;\r\n}\r\n","import * as React from 'react';\r\nimport { usePromise } from 'app/hooks/usePromise';\r\nimport { useAsyncExtendedState } from 'app/hooks/useAsyncAwaitedState';\r\nimport { debounce } from 'lodash';\r\n\r\nexport interface useAsyncOptionsProps<TOption> {\r\n  fetchOptions: (search: string) => Promise<Array<TOption>>;\r\n}\r\n\r\nexport interface IState<TOption> {\r\n  async: boolean;\r\n  options: TOption[];\r\n  open: boolean;\r\n  search: string | null;\r\n}\r\n\r\nexport function useAsyncOptions<TOption>(\r\n  options: useAsyncOptionsProps<TOption>,\r\n) {\r\n  const [state, , extendState] = useAsyncExtendedState<IState<TOption>>({\r\n    search: null,\r\n    async: !Array.isArray(options),\r\n    options: Array.isArray(options) ? options : [],\r\n    open: false,\r\n  });\r\n\r\n  const optionsPromise = React.useCallback(\r\n    async search => {\r\n      if (Array.isArray(options)) {\r\n        return { options: options };\r\n      } else {\r\n        const response = await options.fetchOptions(search);\r\n        return { options: response };\r\n      }\r\n    },\r\n    [options],\r\n  );\r\n  const [promiseState, fetch] = usePromise(optionsPromise);\r\n\r\n  const debounced = React.useMemo(() => {\r\n    //debounced?.cancel();\r\n    return debounce(\r\n      e => {\r\n        console.debug('foo zz');\r\n        extendState(fetch(e.target.value));\r\n      },\r\n      250,\r\n      {\r\n        trailing: true,\r\n        maxWait: 2500,\r\n      },\r\n    );\r\n  }, [extendState, fetch]);\r\n\r\n  const handleInputChange = e => {\r\n    console.debug('handleInputChange', e);\r\n    if (e === null) {\r\n      return;\r\n    }\r\n    extendState({ search: e.target.value });\r\n    promiseState.reset();\r\n    debounced(e);\r\n  };\r\n\r\n  const handleOpen = () => {\r\n    extendState({ open: true });\r\n    extendState(fetch(null));\r\n  };\r\n\r\n  return {\r\n    onOpen: handleOpen,\r\n    onInputChange: handleInputChange,\r\n    options: state.options,\r\n    loading: promiseState.status !== 'resolved',\r\n  };\r\n}\r\n","import * as React from 'react';\r\nimport { EditorProps } from '../EditableCell';\r\nimport { IServiceRequestTableColumnModel } from '../../RequestSamplesPage/slice/types';\r\nimport { DateField } from './DateField';\r\nimport { NumberField, withMinMax } from './NumberField';\r\nimport { TextField } from './TextField';\r\nimport { SRSelect, withOptions } from './DropDownList';\r\nimport { IFormFieldOptionDto } from 'api/odata/generated/entities/IFormFieldOptionDto';\r\nimport { withAsyncOptions } from './DropDownList/IWithAsyncOptions';\r\n\r\nexport function getCellComponent(\r\n  props: IServiceRequestTableColumnModel,\r\n): React.FC<EditorProps<any> & any> | null {\r\n  switch (props.ColumnType) {\r\n    case 'ShortText':\r\n      return TextField;\r\n    /* Drop Down List */\r\n    case 'DropDownList':\r\n      return withOptions<\r\n        string,\r\n        IFormFieldOptionDto,\r\n        EditorProps<IFormFieldOptionDto | Array<IFormFieldOptionDto> | null>\r\n      >(SRSelect, props.Options ?? []);\r\n    case 'UserSelection':\r\n      return withAsyncOptions(SRSelect, {\r\n        CustomRoles: props.CustomRoles,\r\n        FixedRoles: props.FixedRoles,\r\n        UserSelectionType: props.UserSelectionType,\r\n        multiple: props.IsMultiple,\r\n      });\r\n    //return CustomFormDropDown\r\n    /* User Selection */\r\n    // case 'UserSelection':\r\n    // return UserPickerField;\r\n    /* Project Name */\r\n    case 'Number':\r\n      return withMinMax(NumberField, {\r\n        min: -props.SizeLimit,\r\n        max: props.SizeLimit,\r\n        step: 0.01,\r\n      });\r\n    /* Positive Integer */\r\n    case 'PositiveInteger':\r\n      return withMinMax(NumberField, {\r\n        min: 0,\r\n        max: props.SizeLimit,\r\n        step: 1,\r\n      });\r\n    /* Positive Decimal */\r\n    case 'PositiveDecimal':\r\n      return withMinMax(NumberField, {\r\n        min: 0,\r\n        max: props.SizeLimit,\r\n        step: 0.01,\r\n      });\r\n    /* Date */\r\n    case 'Date':\r\n      return DateField;\r\n    /* Email */\r\n    case 'Email':\r\n      return TextField;\r\n    /* Serial */\r\n    case 'Serial':\r\n      return null;\r\n    default:\r\n      return null;\r\n  }\r\n}\r\n","import { CustomFormColumnTypes } from '../../RequestSamplesPage/slice/types';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { Entity } from 'types/common';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\n\r\nexport function getValueRenderer(props: { columnType: CustomFormColumnTypes }) {\r\n  switch (props.columnType) {\r\n    case 'CheckBox':\r\n      return (value: boolean | null) => String(value?.toString());\r\n    case 'Date':\r\n      return (value: Date | null) => String(dateUtils.shortDateFormat(value));\r\n    case 'DropDownList':\r\n    case 'UserSelection':\r\n      return (value: Entity<string> | null) => String(value?.Name);\r\n    case 'ShortText':\r\n      return (value: string | null) => String(value);\r\n    case 'Serial':\r\n      return (value: any) => {\r\n        return String(value);\r\n      };\r\n    case 'Email':\r\n      return (value: string | null) => String(value);\r\n    case 'PositiveInteger':\r\n    case 'Number':\r\n    case 'PositiveDecimal':\r\n      return (value: number | null) => String(value);\r\n    default:\r\n      assertExhaustive(props.columnType);\r\n  }\r\n}\r\n\r\nexport function getReadonlyCell(props: { columnType: CustomFormColumnTypes }) {\r\n  return ({ value }) =>\r\n    value === null || value === undefined ? '' : getValueRenderer(props)(value);\r\n}\r\n","import { Accessor, Column, Renderer, CellProps, Row } from 'react-table';\r\nimport { IServiceRequestRowValueDto } from 'api/odata/generated/entities/IServiceRequestRowValueDto';\r\nimport {\r\n  getServiceRequestRowFieldName,\r\n  ServiceRequestRowEditableCell,\r\n} from '../ServiceRequestRowEditableCell';\r\nimport { IServiceRequestTableRowModel } from '../../RequestSamplesPage/slice/types';\r\nimport { getCellComponent } from '../../EditableTable/Fields/getCellComponent';\r\nimport { getReadonlyCell } from '../../EditableTable/Fields/getReadonlyCell';\r\nimport { ColumnType } from './getTableColumns';\r\nimport {\r\n  ServiceRequestTableColumn,\r\n  ServiceRequestTableColumnsCollection,\r\n} from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\n\r\nexport function getCustomFormTableColumns(props: {\r\n  columns: ServiceRequestTableColumnsCollection;\r\n  isEditable: boolean;\r\n}): Column<IServiceRequestTableRowModel>[] {\r\n  return props.columns.getArray().map((column, index) => {\r\n    const accessor: Accessor<IServiceRequestTableRowModel> = originalRow => {\r\n      const result = originalRow.Values[column.getFieldName()];\r\n      return result;\r\n    };\r\n    const cell = getCell({\r\n      column: column,\r\n      isEditable: props.isEditable,\r\n      isFocused: index === 0 && props.isEditable,\r\n    });\r\n\r\n    const result: ColumnType = {\r\n      id: column.getFieldName(),\r\n      Header: column.Label,\r\n      accessor: accessor,\r\n      Cell: cell,\r\n      enableHide: true,\r\n      // TODO: add min/max/width based on the column type\r\n      // minWidth:\r\n      // maxWidth:\r\n      // width:\r\n      name: (row: Row<IServiceRequestTableRowModel>) =>\r\n        getServiceRequestRowFieldName(row.index, column.getFieldName()),\r\n      column: column,\r\n    };\r\n    return result;\r\n  });\r\n}\r\n\r\nfunction getCell(props: {\r\n  isEditable: boolean;\r\n  column: ServiceRequestTableColumn;\r\n  isFocused?: boolean;\r\n}):\r\n  | Renderer<\r\n      CellProps<IServiceRequestTableRowModel, IServiceRequestRowValueDto>\r\n    >\r\n  | undefined {\r\n  if (props.isEditable) {\r\n    const fieldComponent = getCellComponent(props.column);\r\n    if (fieldComponent !== null) {\r\n      return ServiceRequestRowEditableCell(fieldComponent, {\r\n        column: props.column,\r\n        focused: props.isFocused,\r\n      });\r\n    }\r\n  }\r\n  return getReadonlyCell({ columnType: props.column.ColumnType });\r\n}\r\n","import * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { selectServiceRequestRowStatues } from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { SRSelect } from '../../EditableTable/Fields/DropDownList';\r\nimport { IServiceRequestRowStatusDto } from 'api/odata/generated/entities/IServiceRequestRowStatusDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { CellProps } from 'react-table';\r\nimport { IServiceRequestTableRowModel } from '../../RequestSamplesPage/slice/types';\r\nimport { FastFieldProps } from 'formik';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\n\r\nexport interface ServiceRequestRowStatusPickerProps {\r\n  value: IServiceRequestRowStatusDto | null;\r\n  serviceRequestId: number;\r\n  serviceRequestRowId: number;\r\n  onChange: (value: IServiceRequestRowStatusDto | null) => void;\r\n  error?: boolean;\r\n  helperText?: string;\r\n}\r\n\r\nexport function ServiceRequestRowStatusPicker(\r\n  props: ServiceRequestRowStatusPickerProps,\r\n) {\r\n  const statuses = useSelector(selectServiceRequestRowStatues);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const handleChange = React.useCallback(\r\n    (value: IServiceRequestRowStatusDto | null) => {\r\n      props.onChange?.(value);\r\n      dispatch(\r\n        actions.updateServiceRequestRowStatus({\r\n          serviceRequestId: props.serviceRequestId,\r\n          serviceRequestRowId: props.serviceRequestRowId,\r\n          status: value,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch, props],\r\n  );\r\n  const handleBlur = React.useCallback(e => {}, []);\r\n\r\n  return (\r\n    <SRSelect\r\n      multiple={false}\r\n      value={props.value}\r\n      options={statuses ?? []}\r\n      onChange={handleChange}\r\n      onBlur={handleBlur}\r\n      error={props.error}\r\n      helperText={props.helperText}\r\n    />\r\n  );\r\n}\r\n\r\nexport const ServiceREquestRowStatusCell = React.memo(\r\n  function ServiceREquestRowStatusCell(\r\n    props: Pick<\r\n      CellProps<IServiceRequestTableRowModel, IServiceRequestRowStatusDto>,\r\n      'value'\r\n    > & {\r\n      isEditable: boolean;\r\n      serviceRequestId: number;\r\n      serviceRequestRowId: number;\r\n    } & {\r\n      fieldProps: FastFieldProps;\r\n      onChange?: (value: IServiceRequestRowStatusDto | null) => void;\r\n    },\r\n  ) {\r\n    const handleChange = React.useCallback(\r\n      value => {\r\n        props.fieldProps?.field?.onChange({\r\n          target: { value: value, name: props.fieldProps?.field?.name },\r\n        });\r\n        props.onChange?.(value);\r\n      },\r\n      [props],\r\n    );\r\n\r\n    if (props.isEditable) {\r\n      return (\r\n        <>\r\n          <ServiceRequestRowStatusPicker\r\n            value={props.value}\r\n            serviceRequestId={props.serviceRequestId}\r\n            serviceRequestRowId={props.serviceRequestRowId}\r\n            onChange={handleChange}\r\n            error={!isNullOrUndefined(props.fieldProps?.meta?.error)}\r\n            helperText={props.fieldProps?.meta?.error}\r\n          />\r\n        </>\r\n      );\r\n    } else {\r\n      return <>{props.value.Name}</>;\r\n    }\r\n  },\r\n);\r\n","import * as React from 'react';\r\nimport { translations } from 'locales/translations';\r\nimport { CellProps, Column, Row } from 'react-table';\r\nimport { getCustomFormTableColumns } from './getCustomFormTableColumns';\r\nimport {\r\n  IServiceRequestTableColumnModel,\r\n  IServiceRequestTableRowModel,\r\n} from '../../RequestSamplesPage/slice/types';\r\nimport { ServiceREquestRowStatusCell as ServiceRequestRowStatusCell } from '../ServiceRequestRowStatusPicker';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { ServiceRequestTableColumnsCollection } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport { IServiceRequestTableFormComponent } from '.';\r\nimport { AddNewCustomTableRow } from './components/AddServiceRequestRowButton';\r\nimport { selectServiceRequestCustomFormColumns } from '../../RequestSamplesPage/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { getServiceRequestRowName } from '../ServiceRequestRowEditableCell';\r\nimport { IconButton } from 'app/components/BasicButtons/IconButton';\r\nimport styled from 'styled-components';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { ReservationLink } from 'app/pages/Actions/GlobalSelectedActions/OpenReservation';\r\n\r\nexport interface ColumnTypeExtension {\r\n  name?: (row: Row<IServiceRequestTableRowModel>) => string;\r\n  column?: IServiceRequestTableColumnModel;\r\n  /**\r\n   * Enables show / hide column through columns selection\r\n   */\r\n  enableHide?: boolean;\r\n}\r\nconst RowGap = styled('div')`\r\n  display: flex;\r\n  align-items: center;\r\n  gap: 8px;\r\n`;\r\nexport type ColumnType = Column<IServiceRequestTableRowModel> &\r\n  ColumnTypeExtension;\r\nexport function getTableColumns(\r\n  customFormColumns: ServiceRequestTableColumnsCollection,\r\n  isEditable: boolean,\r\n  t,\r\n  serviceRequestId: number,\r\n  reservationEnabled?: boolean,\r\n  useSidePanel?: boolean,\r\n  openSidePanel?: (state: SidePanelOpenState) => void,\r\n) {\r\n  const dynamicColumns: Array<ColumnType> = getCustomFormTableColumns({\r\n    columns: customFormColumns,\r\n    isEditable,\r\n  });\r\n  var staticColumns: Array<ColumnType> = [\r\n    {\r\n      id: 'Id',\r\n      Header: t(translations.RowId) as string,\r\n      accessor: 'Id',\r\n    },\r\n  ];\r\n  if (reservationEnabled) {\r\n    staticColumns.push({\r\n      id: 'ReservationId',\r\n      Header: t(translations.ReservationId) as string,\r\n      accessor: 'ReservationId',\r\n      Cell: ({ row, value, fieldProps }) => (\r\n        <>\r\n          {value !== null ? (\r\n            <>\r\n              {useSidePanel && openSidePanel ? (\r\n                <ReservationLink\r\n                  id={value}\r\n                  openPanelWithCover={openSidePanel}\r\n                  useSidePanel={useSidePanel}\r\n                >\r\n                  {value}\r\n                </ReservationLink>\r\n              ) : (\r\n                <ReservationLink id={value}>{value}</ReservationLink>\r\n              )}\r\n            </>\r\n          ) : null}\r\n        </>\r\n      ),\r\n    });\r\n  }\r\n  staticColumns.push({\r\n    Header: t(translations.Status) as string,\r\n    accessor: 'Status',\r\n    name: (row: Row<IServiceRequestTableRowModel>) =>\r\n      getServiceRequestRowName(row.index, 'Status'),\r\n    Cell: ({ row, value, fieldProps }) => (\r\n      <>\r\n        <ServiceRequestRowStatusCell\r\n          value={fieldProps?.field?.value ?? null}\r\n          isEditable={isEditable}\r\n          serviceRequestId={serviceRequestId}\r\n          serviceRequestRowId={row.original.Id}\r\n          fieldProps={fieldProps}\r\n        />\r\n      </>\r\n    ),\r\n  });\r\n  var result: Array<ColumnType> = [...staticColumns, ...dynamicColumns];\r\n  result.push({\r\n    Header: t(translations.Comments),\r\n    id: 'comments',\r\n    accessor: 'CommentsCount',\r\n    disableSortBy: true,\r\n    Cell: (props: CellProps<IServiceRequestTableRowModel>) => (\r\n      <RowGap>\r\n        {props.value}\r\n        <IconButton\r\n          size=\"small\"\r\n          variant=\"ghost\"\r\n          icon={props.row.isExpanded ? 'chevron-up' : 'chevron-down'}\r\n          {...props.row.getToggleRowExpandedProps()}\r\n        />\r\n      </RowGap>\r\n    ),\r\n  });\r\n  if (isEditable) {\r\n    result.push(\r\n      ...[\r\n        {\r\n          id: 'actions',\r\n          Cell: (cellProps: CellProps<IServiceRequestTableRowModel>) => (\r\n            <ActionsCell\r\n              arrayHelpers={cellProps.arrayHelpers}\r\n              rowIndex={cellProps.row.index}\r\n              pageSize={cellProps.state.pageSize}\r\n              original={cellProps.row.original}\r\n              setPageSize={cellProps.setPageSize}\r\n              updateMyData={cellProps.updateMyData}\r\n            />\r\n          ),\r\n        },\r\n      ],\r\n    );\r\n  }\r\n  return result;\r\n}\r\n\r\ninterface ActionsCellProps extends IServiceRequestTableFormComponent {\r\n  rowIndex: number;\r\n  original: IServiceRequestTableRowModel;\r\n  pageSize: number;\r\n  setPageSize;\r\n}\r\nconst ActionsCell = React.memo(function ActionsCell(props: ActionsCellProps) {\r\n  return (\r\n    <RowGap key=\"foo\">\r\n      <DeleteButton\r\n        arrayHelpers={props.arrayHelpers}\r\n        rowId={props.original.Id}\r\n        rowIndex={props.rowIndex}\r\n      />\r\n      <CloneButton {...props} />\r\n    </RowGap>\r\n  );\r\n});\r\ninterface DeleteButtonProps\r\n  extends Pick<ActionsCellProps, 'arrayHelpers' | 'rowIndex'> {\r\n  rowId: number;\r\n}\r\nfunction DeleteButton(props: DeleteButtonProps) {\r\n  const handleClick = React.useCallback(() => {\r\n    httpClient.delete(`/api/ServiceRequestRows/${props.rowId}`).then(() => {\r\n      props.arrayHelpers.remove(props.rowIndex);\r\n    });\r\n  }, [props.rowId, props.arrayHelpers, props.rowIndex]);\r\n\r\n  return (\r\n    <IconButton\r\n      variant=\"ghost\"\r\n      key=\"delete\"\r\n      size=\"small\"\r\n      icon=\"trash\"\r\n      onClick={handleClick}\r\n      //autoFocus={true}\r\n    />\r\n  );\r\n}\r\n\r\nfunction CloneButton(props: ActionsCellProps) {\r\n  const { t } = useTranslation();\r\n  const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n  const dispatch = useDispatch();\r\n  const [processing, setProcessing] = React.useState(false);\r\n  const handleCloneClick = React.useCallback(async () => {\r\n    if (columns === null) {\r\n      console.warn('no columns accessible for current user');\r\n      return;\r\n    }\r\n    setProcessing(true);\r\n    try {\r\n      await AddNewCustomTableRow({\r\n        serviceRequestId: props.original.ServiceRequestId,\r\n        columns,\r\n        model: props.original,\r\n        arrayHelpers: props.arrayHelpers,\r\n        index: props.rowIndex + 1,\r\n      });\r\n      dispatch(\r\n        appSettingsActions.addNotification({\r\n          variant: 'success',\r\n          message: t(translations.ServiceRequestRow_InsertSuccess),\r\n        }),\r\n      );\r\n      props.setPageSize(props.pageSize + 1);\r\n      setProcessing(false);\r\n    } catch (error) {\r\n      dispatch(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: t(translations.ServiceRequestRow_InsertError),\r\n        }),\r\n      );\r\n      setProcessing(false);\r\n    }\r\n  }, [columns, dispatch, props, t]);\r\n  return (\r\n    <IconButton\r\n      key=\"clone\"\r\n      variant=\"ghost\"\r\n      size=\"small\"\r\n      onClick={handleCloneClick}\r\n      //autoFocus={true}\r\n    >\r\n      <Icon icon={processing ? 'spinner' : 'plus'} spin={processing} />\r\n    </IconButton>\r\n  );\r\n}\r\n","/**\r\n *\r\n * auto generated interface for Bookit.Data.InternalServiceRequestRowStatus\r\n *\r\n */\r\n\r\nexport enum InternalServiceRequestRowStatus {\r\n  New = 0,\r\n  InWork = 1,\r\n  Done = 2,\r\n  Skip = 3,\r\n}\r\nexport type InternalServiceRequestRowStatusUnion = keyof typeof InternalServiceRequestRowStatus;\r\nexport const InternalServiceRequestRowStatusUnionArray: Array<InternalServiceRequestRowStatusUnion> = [\r\n  'New',\r\n  'InWork',\r\n  'Done',\r\n  'Skip',\r\n];\r\n","import { Comments, CommentsProps } from 'app/components/Comments';\r\nimport {\r\n  selectCommentIsInternal,\r\n  selectIsServiceRequestAdmin,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { GetServiceRequestDetailsPath } from 'app/pages/Samples/RequestSamplesPage/slice/path';\r\nimport { IServiceRequestRelated } from '../..';\r\nimport styled from 'styled-components';\r\nimport { useFormikContext } from 'formik';\r\nimport { IServiceRequestTableRowModel } from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { getServiceRequestRowName } from '../../../ServiceRequestRowEditableCell';\r\nimport { Row } from 'react-table';\r\nimport { useRequestSamplesSlice } from 'app/pages/Samples/RequestSamplesPage/slice';\r\nimport { ServiceRequestsApi } from 'api/ServiceRequestsApi';\r\nimport { useUploadToNewComment } from 'app/components/LargeFilesUpload/Components/useUploadToNewComment';\r\n\r\nexport interface ServiceRequestRowCommentsProps\r\n  extends Pick<\r\n      CommentsProps,\r\n      'referenceId' | 'commentType' | 'disableFileUpload' | 'serviceGroups'\r\n    >,\r\n    IServiceRequestRelated {\r\n  row?: Row<IServiceRequestTableRowModel>;\r\n  canUserEdit?: Boolean;\r\n}\r\nconst CommentsWrap = styled('div')`\r\n  padding: 16px;\r\n`;\r\nexport function ServiceRequestRowComments({\r\n  serviceRequestId,\r\n  canUserEdit,\r\n  disableFileUpload,\r\n  ...props\r\n}: ServiceRequestRowCommentsProps) {\r\n  const { isAdmin } = useSelector(selectIsServiceRequestAdmin);\r\n  const CommentIsInternal = useSelector(selectCommentIsInternal);\r\n  const formik = useFormikContext<IServiceRequestTableRowModel>();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const { onCommentAdded } = useUploadToNewComment();\r\n  const handleCommentAdded = newComment => {\r\n    if (props.row !== undefined) {\r\n      formik.setFieldValue(\r\n        getServiceRequestRowName(props.row.index, 'CommentsCount'),\r\n        props.row.original.CommentsCount + 1,\r\n        false,\r\n      );\r\n    }\r\n    ServiceRequestsApi.updateAdminOnComment(serviceRequestId);\r\n    dispatch(actions.setHasFiles(true));\r\n    onCommentAdded(newComment);\r\n  };\r\n  return (\r\n    <CommentsWrap>\r\n      <Comments\r\n        defaultComment={{\r\n          IsInternal: isAdmin && CommentIsInternal,\r\n        }}\r\n        emailType=\"RequestComment\"\r\n        link={GetServiceRequestDetailsPath(serviceRequestId)}\r\n        isAdmin={isAdmin}\r\n        cannotComment={(!!CommentIsInternal || !canUserEdit) && !isAdmin}\r\n        onCommentAdded={handleCommentAdded}\r\n        disableFileUpload={disableFileUpload}\r\n        {...props}\r\n      />\r\n    </CommentsWrap>\r\n  );\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport { Button, ButtonProps } from 'app/components/BasicButtons/Button';\r\nimport { InternalServiceRequestRowStatus } from 'api/odata/generated/enums/InternalServiceRequestRowStatus';\r\nimport { DialogConfirm } from 'app/components/DialogConfirm';\r\n\r\nimport {\r\n  IServiceRequestTableRowModel,\r\n  IServiceRequestTableRowValueModel,\r\n} from 'app/pages/Samples/RequestSamplesPage/slice/types';\r\nimport { ImportComponent } from 'app/pages/Samples/RunDetailsPage/ImportComponents/ImportComponent';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { useFormikContext } from 'formik';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { translations } from 'locales/translations';\r\nimport { chain, Dictionary } from 'lodash';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { openExportLink } from 'utils/url-utils';\r\nimport {\r\n  IServiceRequestRelated,\r\n  IServiceRequestTableFormComponent,\r\n} from '../..';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { selectServiceRequestCustomFormColumns } from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { ServiceRequestTableColumnsCollection } from 'app/pages/Samples/RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\n\r\nexport interface ServiceRequestRowsImportProps\r\n  extends IServiceRequestRelated,\r\n    IServiceRequestTableFormComponent {}\r\nexport function ServiceRequestRowsImport(props: ServiceRequestRowsImportProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const formik = useFormikContext<any>();\r\n  const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n  const { serviceRequestId } = props;\r\n  const handleFileChange = async (file: File) => {\r\n    const url = `/api/Requests/${serviceRequestId}/tabledata`;\r\n    try {\r\n      const response = await httpClient.uploadFile(url, file, {\r\n        responseType: 'json',\r\n      });\r\n      switch (response.status) {\r\n        case StatusCodes.OK:\r\n          dispatch(\r\n            appSettingsActions.addNotification({\r\n              variant: 'success',\r\n              message: t(translations.ImportSuccessMessage),\r\n            }),\r\n          );\r\n          const model = convertImportResponse(\r\n            response.data,\r\n\r\n            columns,\r\n            serviceRequestId,\r\n          );\r\n          model.forEach(item => {\r\n            const index = formik.values.Rows.findIndex(\r\n              row => row.Id === item.Id,\r\n            );\r\n            if (index === -1) {\r\n              props.arrayHelpers.push(item);\r\n            } else {\r\n              props.arrayHelpers.replace(index, item);\r\n            }\r\n          });\r\n          setOpen(false);\r\n          break;\r\n        default:\r\n          dispatch(\r\n            appSettingsActions.addNotification({\r\n              variant: 'error',\r\n              message:\r\n                response.data.ExceptionMessage ??\r\n                t(translations.ImportErrorMessage),\r\n            }),\r\n          );\r\n          break;\r\n      }\r\n    } catch (error) {\r\n      dispatch(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: t(translations.ImportErrorMessage),\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  const [open, setOpen] = React.useState(false);\r\n  const handleClose = () => {\r\n    setOpen(false);\r\n  };\r\n  return (\r\n    <div>\r\n      <Button\r\n        startIcon={<Icon icon=\"file-arrow-up\" />}\r\n        variant=\"white\"\r\n        size=\"small\"\r\n        onClick={() => setOpen(true)}\r\n      >\r\n        {t(translations.Import)}\r\n      </Button>\r\n      <DialogConfirm\r\n        isOpen={open}\r\n        title={t(translations.UpdateColumnValueAcrossMultipleRows)}\r\n        body={\r\n          <React.Fragment>\r\n            <DownloadImportTemplate\r\n              url={`/api/requests/${serviceRequestId}/importTemplate`}\r\n            >\r\n              {t(translations.ImportTemplate)}\r\n            </DownloadImportTemplate>\r\n            <hr />\r\n            <ImportComponent\r\n              processing={false}\r\n              accept=\".csv\"\r\n              handleFileChange={handleFileChange}\r\n              hideMessage={false}\r\n            />\r\n          </React.Fragment>\r\n        }\r\n        cancelButtonLabel={t(translations.Close)}\r\n        onCancel={handleClose}\r\n        onClose={handleClose}\r\n      />\r\n    </div>\r\n  );\r\n}\r\n\r\ninterface DownloadFileButtonProps extends ButtonProps {\r\n  url: string;\r\n}\r\nfunction DownloadImportTemplate({\r\n  url,\r\n  ...props\r\n}: React.PropsWithChildren<DownloadFileButtonProps>) {\r\n  const handleClick = async () => {\r\n    try {\r\n      await openExportLink(url);\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n  };\r\n  return <Button onClick={handleClick} size=\"small\" {...props}></Button>;\r\n}\r\nexport function ExportRows({\r\n  url,\r\n  ...props\r\n}: React.PropsWithChildren<DownloadFileButtonProps>) {\r\n  const handleClick = async () => {\r\n    try {\r\n      await openExportLink(url);\r\n    } catch (error) {\r\n      console.error(error);\r\n    }\r\n  };\r\n  return (\r\n    <Button\r\n      variant=\"white\"\r\n      onClick={handleClick}\r\n      size=\"small\"\r\n      startIcon={<Icon icon=\"print\" size=\"sm\" />}\r\n      {...props}\r\n    ></Button>\r\n  );\r\n}\r\n/**\r\n * Response example:\r\n *  [\r\n  {\r\n    Id: 0,\r\n    CommentsCount: 0,\r\n    FilesCount: 0,\r\n    Status: { Id: 0, InternalStatusId: 0, Name: 'New' },\r\n    ReservationId: null,\r\n    '1001': null,\r\n    '1002': { id: 'a1', text: 'a1', isValid: true, SourceValueId: null },\r\n    '1011': null,\r\n    '1003': null,\r\n    '1004': '1',\r\n    '1005': null,\r\n    '1006': null,\r\n    '1007': null,\r\n    '1008': null,\r\n    '1010': '1',\r\n  }\r\n  ...\r\n]\r\n * @param importResponse \r\n * @param arrayHelpers \r\n * @param values \r\n * @param serviceRequestId \r\n * @returns \r\n */\r\nfunction convertImportResponse(\r\n  importResponse: Array<\r\n    {\r\n      Id: number;\r\n      Status: any;\r\n      ReservationId: any;\r\n      CommentsCount: any;\r\n      FilesCount: any;\r\n    } & Record<string, any>\r\n  >,\r\n  columns: ServiceRequestTableColumnsCollection | null,\r\n  serviceRequestId: number,\r\n): Array<IServiceRequestTableRowModel> {\r\n  const result = importResponse.map(item => {\r\n    const values =\r\n      columns === null\r\n        ? {}\r\n        : (chain(columns.columnsObj)\r\n            .mapValues(column => {\r\n              const value = item[column.Id.toString()];\r\n              if (value === null) {\r\n                return null;\r\n              } else if (typeof value === 'string') {\r\n                return value;\r\n              } else if (\r\n                typeof value === 'object' &&\r\n                typeof value.id === 'string' &&\r\n                typeof value.text === 'string'\r\n              ) {\r\n                return {\r\n                  Id: value.id,\r\n                  Name: value.text,\r\n                };\r\n              } else {\r\n                return null;\r\n              }\r\n            })\r\n            .value() as Dictionary<IServiceRequestTableRowValueModel>);\r\n    const model: IServiceRequestTableRowModel = {\r\n      Id: item.Id,\r\n      Status: {\r\n        Id: item.Status.Id,\r\n        Name: item.Status.Name,\r\n        InternalStatus:\r\n          InternalServiceRequestRowStatus[item.Status.InternalStatusId],\r\n      },\r\n      Values: values,\r\n      Charged: false,\r\n      CommentsCount: item.CommentsCount,\r\n      Completed: false,\r\n      InsertDate: '',\r\n      ReservationId: null,\r\n      Serial: 0,\r\n      ServiceRequestId: serviceRequestId,\r\n      SourceLinkId: null,\r\n      SourceRowId: null,\r\n      StatusId: item.Status.Id,\r\n      UpdateDate: '',\r\n    };\r\n    return model;\r\n  });\r\n\r\n  return result;\r\n}\r\n","import * as Yup from 'yup';\r\nimport { SRSelect } from 'app/pages/Samples/EditableTable/Fields/DropDownList';\r\nimport { selectServiceRequestCustomFormColumns } from 'app/pages/Samples/RequestSamplesPage/slice/selectors';\r\nimport { useFormikContext, Field, FieldProps } from 'formik';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { getCustomFormColumnSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IServiceRequestRelated, IServiceRequestSelectedRows } from '../..';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { getServiceRequestRowFieldName } from '../../../ServiceRequestRowEditableCell';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { DialogForm } from 'app/components/DialogForm';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { getCellComponent } from 'app/pages/Samples/EditableTable/Fields/getCellComponent';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\n\r\nexport interface BulkUpdateProps\r\n  extends IServiceRequestRelated,\r\n    IServiceRequestSelectedRows {}\r\n\r\nexport function BulkUpdate(props: BulkUpdateProps) {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n\r\n  const columns = useSelector(selectServiceRequestCustomFormColumns);\r\n  const options = React.useMemo(\r\n    () =>\r\n      columns === null\r\n        ? []\r\n        : columns\r\n            .getArray()\r\n            .filter(column => column.ColumnType !== 'Serial')\r\n            .map(column => ({\r\n              Id: column.Id,\r\n              Name: column.Label,\r\n              Column: column,\r\n            })),\r\n    [columns],\r\n  );\r\n\r\n  const schema = React.useMemo(\r\n    () =>\r\n      Yup.object({\r\n        column: Yup.mixed().required(),\r\n        value: Yup.mixed().when(['column'], (column, schema) =>\r\n          column === null || column === undefined\r\n            ? schema\r\n            : getCustomFormColumnSchema(column).required().nullable(),\r\n        ),\r\n      }),\r\n    [],\r\n  );\r\n  const formikContext = useFormikContext();\r\n\r\n  const handleSubmit = React.useCallback(\r\n    async values => {\r\n      const column = values.column;\r\n      if (column === null) {\r\n        return;\r\n      }\r\n      try {\r\n        const rowIdentifiers = props.selectedFlatRows.map(\r\n          row => row.original.Id,\r\n        );\r\n        await httpClient.put(\r\n          `/api/requests/${props.serviceRequestId}/column/${column?.Id}`,\r\n          {\r\n            value: postValue(values.value),\r\n            rowids: rowIdentifiers,\r\n          },\r\n        );\r\n        props.selectedFlatRows.forEach(row =>\r\n          formikContext.setFieldValue(\r\n            getServiceRequestRowFieldName(row.index, column.getFieldName()),\r\n            values.value,\r\n          ),\r\n        );\r\n        setOpen(false);\r\n      } catch (error) {\r\n        dispatch(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            message: t(translations.GenericUpdateErrorMessage),\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [\r\n      dispatch,\r\n      formikContext,\r\n      props.selectedFlatRows,\r\n      props.serviceRequestId,\r\n      t,\r\n    ],\r\n  );\r\n  const [open, setOpen] = React.useState(false);\r\n  return (\r\n    <>\r\n      <TopActionButton\r\n        variant=\"white\"\r\n        size=\"small\"\r\n        disabled={props.selectedFlatRows.length === 0}\r\n        icon={'pencil'}\r\n        onClick={() => setOpen(x => !x)}\r\n        text={t(translations.Update)}\r\n      />\r\n      <DialogForm\r\n        validationSchema={schema}\r\n        initialValues={{ value: null, column: null }}\r\n        onSubmit={handleSubmit}\r\n        onClose={() => setOpen(false)}\r\n        open={open}\r\n        title={t(translations.UpdateColumnValueAcrossMultipleRows)}\r\n      >\r\n        <FormRow fullRow>\r\n          <Field name=\"column\">\r\n            {({\r\n              field, // { name, value, onChange, onBlur }\r\n              meta,\r\n              form,\r\n            }: FieldProps) => (\r\n              <SRSelect\r\n                style={{ width: '100%' }}\r\n                multiple={false}\r\n                options={options}\r\n                //onChange={handleSelectedColumnChange}\r\n                onChange={value => {\r\n                  field.onChange({\r\n                    target: {\r\n                      value: value?.Column,\r\n                      name: 'column',\r\n                    },\r\n                  });\r\n                  form.setFieldValue('value', null, false);\r\n                }}\r\n              />\r\n            )}\r\n          </Field>\r\n        </FormRow>\r\n\r\n        <FormRow fullRow>\r\n          <Field name=\"value\">\r\n            {({\r\n              field, // { name, value, onChange, onBlur }\r\n              form,\r\n              meta,\r\n            }: FieldProps) => {\r\n              if (\r\n                form.values.column !== null &&\r\n                form.values.column !== undefined\r\n              ) {\r\n                const component = getCellComponent(form.values.column);\r\n                if (component !== null) {\r\n                  return component({\r\n                    name: field.name,\r\n                    //error: meta.error !== undefined,\r\n                    onBlur: field.onBlur,\r\n                    onChange: event => {\r\n                      field.onChange({\r\n                        target: {\r\n                          name: field.name,\r\n                          value: event?.target?.value ?? event ?? null,\r\n                        },\r\n                      });\r\n                    },\r\n                    value: field.value,\r\n                    helperText: meta.error,\r\n                  });\r\n                }\r\n              }\r\n              return null;\r\n            }}\r\n          </Field>\r\n        </FormRow>\r\n      </DialogForm>\r\n    </>\r\n  );\r\n}\r\n\r\n/**\r\n * Formats custom form value in the format expected by the v3 api:\r\n * * ddl values are expected to be in {id:\"xxx\", text:\"yyy\"} format,\r\n * * dates - yyyy-MM-dd\r\n * * other primitive values - string\r\n * @param value custom form value\r\n * @returns\r\n */\r\nfunction postValue(value: any) {\r\n  if (value instanceof Date) {\r\n    return dateUtils.formatISO(value, {\r\n      representation: 'date',\r\n      format: 'basic',\r\n    });\r\n  }\r\n  if (value?.Id !== undefined && value?.Name !== undefined) {\r\n    return { id: value.Id, text: value.text };\r\n  } else {\r\n    return value;\r\n  }\r\n}\r\n","import {\r\n  Checkbox,\r\n  List,\r\n  ListItem,\r\n  ListItemIcon,\r\n  ListItemText,\r\n} from '@material-ui/core';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { IRow } from 'app/components/BasicTable';\r\nimport { Popover } from 'app/components/Popover';\r\nimport { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Column, TableState, UseTableInstanceProps } from 'react-table';\r\nimport { ColumnTypeExtension } from '../../getTableColumns';\r\n\r\nexport interface ColumnsSelectProps<T extends IRow>\r\n  extends Pick<UseTableInstanceProps<T>, 'allColumns' | 'toggleHideColumn'>,\r\n    Pick<TableState<T>, 'hiddenColumns'> {}\r\n\r\nexport function ColumnsSelect<T extends IRow>(props: ColumnsSelectProps<T>) {\r\n  const { t } = useTranslation();\r\n\r\n  const [anchorEl, setAnchorEl] = React.useState(undefined);\r\n\r\n  const handleOpen = event => {\r\n    setAnchorEl(event.currentTarget);\r\n  };\r\n\r\n  const handleClose = () => {\r\n    setAnchorEl(undefined);\r\n  };\r\n\r\n  const open = Boolean(anchorEl);\r\n  const id = open ? 'simple-popover' : undefined;\r\n  const handleToggle = (column: Column<T>) => {\r\n    if (column.id !== undefined) {\r\n      props.toggleHideColumn(column.id);\r\n    }\r\n  };\r\n  const columns = React.useMemo(() => getHidableColumns(props.allColumns), [\r\n    props.allColumns,\r\n  ]);\r\n  return (\r\n    <>\r\n      <TopActionButton\r\n        variant=\"white\"\r\n        size=\"small\"\r\n        onClick={handleOpen}\r\n        icon={'table'}\r\n        title={t(translations.colvis_buttontext)}\r\n        text={t(translations.Columns)}\r\n      />\r\n      <Popover\r\n        id={id}\r\n        open={open}\r\n        anchorEl={anchorEl}\r\n        onClose={handleClose}\r\n        title={t(translations.colvis_buttontext)}\r\n      >\r\n        <List>\r\n          {columns.map(column => {\r\n            const labelId = `checkbox-list-label-${column.id}`;\r\n            return (\r\n              column.id !== undefined && (\r\n                <ListItem\r\n                  key={column.id}\r\n                  role={undefined}\r\n                  dense\r\n                  button\r\n                  onClick={() => handleToggle(column)}\r\n                >\r\n                  <ListItemIcon>\r\n                    <Checkbox\r\n                      edge=\"start\"\r\n                      checked={\r\n                        props.hiddenColumns?.includes(column.id) !== true\r\n                      }\r\n                      tabIndex={-1}\r\n                      disableRipple\r\n                      inputProps={{ 'aria-labelledby': labelId }}\r\n                    />\r\n                  </ListItemIcon>\r\n                  <ListItemText id={labelId} primary={column.Header} />\r\n                </ListItem>\r\n              )\r\n            );\r\n          })}\r\n        </List>\r\n      </Popover>\r\n    </>\r\n  );\r\n}\r\nfunction getHidableColumns<T extends IRow>(columns: Array<Column<T>>) {\r\n  return columns\r\n    .filter(column => column.id !== undefined)\r\n    .filter(column => (column as ColumnTypeExtension)?.enableHide === true);\r\n}\r\nfunction getHiddenColumnsKey(serviceId: number) {\r\n  return `hidden_columns_${serviceId}`;\r\n}\r\nexport function getHiddenColumns<T extends IRow>(\r\n  serviceId: number,\r\n  allColumns: Array<Column<T> & ColumnTypeExtension>,\r\n) {\r\n  try {\r\n    const s = localStorage.getItem(getHiddenColumnsKey(serviceId));\r\n    if (s === null) {\r\n      return [];\r\n    }\r\n    const x = JSON.parse(s);\r\n    if (Array.isArray(x) && x.every(item => typeof item === 'string')) {\r\n      const columnIds = getHidableColumns(allColumns).map(column => column.id);\r\n\r\n      return x.filter(id => columnIds.includes(id));\r\n    }\r\n    return [];\r\n  } catch (error) {\r\n    return [];\r\n  }\r\n}\r\nexport function setHiddenColumns(serviceId: number, value?: Array<string>) {\r\n  try {\r\n    const key = getHiddenColumnsKey(serviceId);\r\n    if (value === undefined) {\r\n      localStorage.removeItem(key);\r\n    } else {\r\n      localStorage.setItem(key, JSON.stringify(value));\r\n    }\r\n  } catch (error) {\r\n    //noop\r\n  }\r\n}\r\n","/**\r\n *\r\n * ServiceRequestRowsTable\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useRequestSamplesSlice } from 'app/pages/Samples/RequestSamplesPage/slice';\r\n\r\nimport {\r\n  Column,\r\n  Row,\r\n  useExpanded,\r\n  UsePaginationInstanceProps,\r\n  UsePaginationState,\r\n  useTable,\r\n} from 'react-table';\r\nimport { AddServiceRequestRowButton } from './components/AddServiceRequestRowButton';\r\nimport {\r\n  FieldArray,\r\n  FormikProps,\r\n  ArrayHelpers,\r\n  FastFieldProps,\r\n  FastField,\r\n} from 'formik';\r\nimport {\r\n  IServiceRequestDetailsFormModel,\r\n  IServiceRequestTableRowModel,\r\n  IServiceRequestTableRowValueModel,\r\n} from '../../RequestSamplesPage/slice/types';\r\nimport { ColumnTypeExtension, getTableColumns } from './getTableColumns';\r\nimport { TableToolbar } from 'app/components/BasicTable/BasicFilter/TableToolbar';\r\nimport { UpdateServiceRequestRowValue } from '../ServiceRequestRowEditableCell';\r\nimport { serializeCustomFormRowValue } from 'app/components/CustomForm/CustomFormUtils';\r\nimport styled from 'styled-components';\r\nimport {\r\n  TableBody,\r\n  TableHead,\r\n  TableRow,\r\n  TableCell,\r\n  TableContainer,\r\n  Table,\r\n} from '@material-ui/core/index';\r\nimport TablePagination from '@material-ui/core/TablePagination';\r\nimport { usePagination, PluginHook } from 'react-table';\r\nimport { useStyles } from 'app/components/BasicTable/styles';\r\nimport TablePaginationActions from 'app/components/BasicTable/TablePaginationActions';\r\nimport { tableSectionStyles } from '../../RequestSamplesPage';\r\nimport clsx from 'clsx';\r\nimport { ServiceRequestRowComments } from './components/ServiceRequestComments';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { ServiceRequestTableColumnsCollection } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\nimport {\r\n  ExportRows,\r\n  ServiceRequestRowsImport,\r\n} from './components/ServiceRequestRowsImport';\r\nimport { BulkUpdate } from './components/BulkUpdate';\r\nimport { addRowSelect } from 'app/components/BasicTable/ControlledTable/addRowSelect';\r\nimport {\r\n  ColumnsSelect,\r\n  getHiddenColumns,\r\n  setHiddenColumns,\r\n} from './components/ColumnsSelect';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { Body } from 'app/components/Typography';\r\nimport { isNullOrUndefined } from 'utils/typeUtils';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { AlertContentType } from 'app/components/BasicAlert';\r\nimport { Printing } from 'app/components/PrintToPDF';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { Identifiable } from 'types/common';\r\n\r\nexport interface IServiceRequestRelated {\r\n  serviceRequestId: number;\r\n}\r\nexport interface IServiceRequestTableFormComponent {\r\n  arrayHelpers: ArrayHelpers;\r\n  updateMyData: UpdateServiceRequestRowValue<IServiceRequestTableRowValueModel>;\r\n}\r\n\r\nexport interface IServiceRequestSelectedRows {\r\n  selectedFlatRows: Array<Row<IServiceRequestTableRowModel>>;\r\n}\r\nexport interface ServiceRequestRowsTableProps\r\n  extends IServiceRequestRelated,\r\n    FormikProps<IServiceRequestDetailsFormModel> {\r\n  processing: boolean;\r\n  isEditable: boolean;\r\n  isAdmin: boolean;\r\n  pageSize?: number;\r\n  formFields: ServiceRequestTableColumnsCollection;\r\n  serviceRequestTypeId: number;\r\n  hasErrors?: boolean;\r\n  printing?: Printing;\r\n  reservationEnabled?: boolean;\r\n  openSidePanel: (state: SidePanelOpenState) => void;\r\n  useSidePanel: boolean;\r\n  serviceRequestId: number;\r\n  serviceGroups?: Identifiable<number>[];\r\n  onCreateReservation: (rows: IServiceRequestTableRowModel[]) => void;\r\n}\r\n/**\r\n * \"Custom Form\" based table section\r\n */\r\nexport const ServiceRequestRowsTable = React.memo(\r\n  function ServiceRequestRowsTable({\r\n    serviceRequestId,\r\n    isAdmin,\r\n    isEditable,\r\n    formFields: customFormColumns,\r\n    hasErrors,\r\n    openSidePanel,\r\n    //pageSize,\r\n    ...props\r\n  }: ServiceRequestRowsTableProps) {\r\n    const { actions } = useRequestSamplesSlice();\r\n\r\n    const { t } = useTranslation();\r\n    const dispatch = useDispatch();\r\n\r\n    // TODO: server side pagination\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    const handleChangeState = React.useCallback(\r\n      changeState => {\r\n        dispatch(\r\n          actions.loadServiceRequestRows({\r\n            serviceRequestId: serviceRequestId,\r\n            state: changeState,\r\n          }),\r\n        );\r\n      },\r\n      [actions, dispatch, serviceRequestId],\r\n    );\r\n\r\n    // TODO: server side pagination\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    const handleSelectedRowsChange = React.useCallback(\r\n      rows => {\r\n        dispatch(actions.setSelected(rows));\r\n      },\r\n      [actions, dispatch],\r\n    );\r\n\r\n    // useEffectOnMount(() => {\r\n    //   if (!!serviceRequestId) {\r\n    //     dispatch(\r\n    //       actions.loadServiceRequestRows({\r\n    //         serviceRequestId: serviceRequestId,\r\n    //         state: {\r\n    //           pageIndex: 0,\r\n    //           pageSize: 10,\r\n    //         },\r\n    //       }),\r\n    //     );\r\n    //   }\r\n    // });\r\n\r\n    const openPanel = React.useCallback(\r\n      (state: SidePanelOpenState) => {\r\n        openSidePanel(state);\r\n      },\r\n      [openSidePanel],\r\n    );\r\n\r\n    const tableColumns = React.useMemo<\r\n      Array<Column<IServiceRequestTableRowModel>>\r\n    >(() => {\r\n      return getTableColumns(\r\n        customFormColumns,\r\n        isEditable,\r\n        t,\r\n        serviceRequestId,\r\n        props.reservationEnabled,\r\n        props.useSidePanel,\r\n        openPanel,\r\n      );\r\n    }, [\r\n      customFormColumns,\r\n      isEditable,\r\n      openPanel,\r\n      props.reservationEnabled,\r\n      props.useSidePanel,\r\n      serviceRequestId,\r\n      t,\r\n    ]);\r\n\r\n    const updateMyData = React.useCallback<\r\n      UpdateServiceRequestRowValue<IServiceRequestTableRowValueModel>\r\n    >(\r\n      args => {\r\n        const column = customFormColumns.get(args.columnId);\r\n\r\n        // dispatch(\r\n        //   actions.updateServiceRequestRowValue({\r\n        //     serviceRequestId: serviceRequestId,\r\n        //     serviceRequestValue: {\r\n        //       RowId: args.serviceRequestRowId,\r\n        //       ColumnId: column.Id,\r\n        //       ...serializeCustomFormRowValue(args.value),\r\n        //     },\r\n        //   }),\r\n        // );\r\n\r\n        const value = serializeCustomFormRowValue(args.value);\r\n\r\n        // TODO: migrate value updates to the new api\r\n        // const url = `/api/odata/v4/ServiceRequests(${action.payload.serviceRequestId})/Rows(${action.payload.serviceRequestValue.RowId})/Values`;\r\n        const url = `/api/requests/${serviceRequestId}/tabledata/${args.serviceRequestRowId}/${column.Id}`;\r\n        const payload =\r\n          value.DisplayValue === null\r\n            ? value.Value\r\n            : {\r\n                id: value.Value,\r\n                text: value.DisplayValue,\r\n              };\r\n\r\n        try {\r\n          httpClient.post(url, JSON.stringify(payload), {\r\n            headers: { 'Content-Type': 'application/json' },\r\n          });\r\n        } catch (error) {}\r\n      },\r\n      [customFormColumns, serviceRequestId],\r\n    );\r\n\r\n    const print = React.useMemo(() => {\r\n      return props.printing !== undefined && props.printing.printing === true;\r\n    }, [props.printing]);\r\n    React.useEffect(() => {\r\n      if (\r\n        props.printing !== undefined &&\r\n        print &&\r\n        props.printing.onLoading !== undefined\r\n      ) {\r\n        props.printing.onLoading(\r\n          props.printing.id,\r\n          props.values.Rows === undefined || props.values.Rows === null,\r\n        );\r\n      }\r\n    }, [print, props.printing, props.values.Rows]);\r\n\r\n    if (props.values.Rows === undefined || props.values.Rows === null) {\r\n      return <></>;\r\n    }\r\n    return (\r\n      <>\r\n        <>\r\n          <TableContainer key=\"table-container\" style={tableSectionStyles}>\r\n            <SRFormContent\r\n              {...props}\r\n              tableColumns={tableColumns}\r\n              isEditable={isEditable}\r\n              openSidePanel={openPanel}\r\n              isAdmin={isAdmin}\r\n              updateMyData={updateMyData}\r\n              serviceRequestId={serviceRequestId}\r\n              serviceRequestTypeId={props.serviceRequestTypeId}\r\n              onCreateReservation={props.onCreateReservation}\r\n              hasError={hasErrors}\r\n              onRefresh={state =>\r\n                dispatch(\r\n                  actions.loadServiceRequestRows({\r\n                    serviceRequestId: serviceRequestId,\r\n                    state: state,\r\n                  }),\r\n                )\r\n              }\r\n            />\r\n          </TableContainer>\r\n        </>\r\n      </>\r\n    );\r\n  },\r\n);\r\n\r\ninterface SRFormContentProps\r\n  extends FormikProps<IServiceRequestDetailsFormModel>,\r\n    IServiceRequestRelated {\r\n  tableColumns: Array<Column<IServiceRequestTableRowModel>>;\r\n  updateMyData: UpdateServiceRequestRowValue<IServiceRequestTableRowValueModel>;\r\n  isEditable: boolean;\r\n  isAdmin: boolean;\r\n  serviceRequestTypeId: number;\r\n  hasError?: boolean;\r\n  reservationEnabled?: boolean;\r\n  openSidePanel: (state: SidePanelOpenState) => void;\r\n  useSidePanel: boolean;\r\n  serviceGroups?: Identifiable<number>[];\r\n  onRefresh: (state: any) => void;\r\n  onCreateReservation: (rows: IServiceRequestTableRowModel[]) => void;\r\n}\r\nconst SRFormContent = React.memo(function SRFormContent({\r\n  tableColumns,\r\n  updateMyData,\r\n  onCreateReservation,\r\n  ...props\r\n}: SRFormContentProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  const tablePlugins = React.useMemo(() => {\r\n    const plugins: PluginHook<IServiceRequestTableRowModel>[] = [\r\n      // useSortBy,\r\n      useExpanded,\r\n      usePagination,\r\n    ];\r\n    if (props.isEditable) {\r\n      addRowSelect<IServiceRequestTableRowModel>(plugins);\r\n    }\r\n    return plugins;\r\n  }, [props.isEditable]);\r\n\r\n  const {\r\n    getTableProps,\r\n    getTableBodyProps,\r\n    headerGroups,\r\n    page, // Instead of using 'rows', we'll use page,\r\n    prepareRow,\r\n    //pagination\r\n    gotoPage,\r\n    setPageSize,\r\n    allColumns,\r\n    toggleHideColumn,\r\n    state: { pageIndex, pageSize, hiddenColumns },\r\n    selectedFlatRows,\r\n  } = useTable(\r\n    {\r\n      columns: tableColumns,\r\n      data: props.values.Rows ?? [],\r\n      updateMyData: updateMyData,\r\n      autoResetPage: false,\r\n      autoResetExpanded: false,\r\n      initialState: {\r\n        // sortBy: [{ id: 'Id' }],\r\n        hiddenColumns: getHiddenColumns(\r\n          props.serviceRequestTypeId,\r\n          tableColumns,\r\n        ),\r\n      },\r\n    },\r\n    ...tablePlugins,\r\n  );\r\n  React.useEffect(() => {\r\n    setHiddenColumns(props.serviceRequestTypeId, hiddenColumns);\r\n  }, [hiddenColumns, props.serviceRequestTypeId]);\r\n\r\n  const handleRefresh = () => {\r\n    props.onRefresh({ pageIndex, pageSize });\r\n  };\r\n  const classes = useStyles();\r\n\r\n  return (\r\n    <FieldArray name=\"Rows\" validateOnChange={true}>\r\n      {arrayHelpers => {\r\n        return (\r\n          <>\r\n            <TableToolbar\r\n              screenName={t(translations.ServiceRequestTable)}\r\n              screenNameVariant={'section'}\r\n              showMenu={false}\r\n              titleAsColumn={true}\r\n              onRefresh={handleRefresh}\r\n              titleIcon={\r\n                <Body bold size=\"small\">\r\n                  {props.values.Rows !== undefined && (\r\n                    <>\r\n                      {props.values.Rows.length} {t(translations.Records)}\r\n                    </>\r\n                  )}\r\n                </Body>\r\n              }\r\n              alertContent={\r\n                props.hasError\r\n                  ? ({\r\n                      type: 'error',\r\n                      message: t(translations.RequestRows_error) as string,\r\n                      closable: true,\r\n                    } as AlertContentType)\r\n                  : undefined\r\n              }\r\n              showAlert={props.hasError}\r\n            >\r\n              {props.isAdmin &&\r\n                selectedFlatRows.length > 0 &&\r\n                props.reservationEnabled && (\r\n                  <TopActionButton\r\n                    variant=\"white\"\r\n                    size=\"small\"\r\n                    icon={'plus'}\r\n                    onClick={() =>\r\n                      onCreateReservation(selectedFlatRows.map(f => f.original))\r\n                    }\r\n                    text={t(translations.CreateReservation)}\r\n                  />\r\n                  // <CreateRequestReservation\r\n                  //   openPanel={props.openSidePanel}\r\n                  //   serviceRequestId={props.serviceRequestId}\r\n                  //   gradient={props.gradient}\r\n                  //   serviceGroupId={props.serviceGroupId}\r\n                  //   serviceRequestRelatedEquipments={\r\n                  //     props.serviceRequestRelatedEquipments\r\n                  //   }\r\n                  //   userName={props.userName}\r\n                  //   budgetId={props.budgetId}\r\n                  //   requestOverheadMinutes={props.requestOverheadMinutes}\r\n                  //   useSidePanel={props.useSidePanel}\r\n                  //   rows={selectedFlatRows.map(f => f.original)}\r\n                  // />\r\n                )}\r\n              {props.isEditable && selectedFlatRows.length > 0 && (\r\n                <BulkUpdate\r\n                  serviceRequestId={props.serviceRequestId}\r\n                  selectedFlatRows={selectedFlatRows}\r\n                />\r\n              )}\r\n              {props.isEditable && !isMobile && (\r\n                <ServiceRequestRowsImport\r\n                  serviceRequestId={props.serviceRequestId}\r\n                  arrayHelpers={arrayHelpers}\r\n                  updateMyData={updateMyData}\r\n                />\r\n              )}\r\n              {props.isEditable && !isMobile && (\r\n                <ExportRows\r\n                  url={`/api/requests/${props.serviceRequestId}/exportTable`}\r\n                >\r\n                  {t(translations.Export)}\r\n                </ExportRows>\r\n              )}\r\n              {props.isAdmin && (\r\n                <ColumnsSelect\r\n                  allColumns={allColumns}\r\n                  hiddenColumns={hiddenColumns}\r\n                  toggleHideColumn={toggleHideColumn}\r\n                />\r\n              )}\r\n              {props.isEditable && (\r\n                <AddServiceRequestRowButton\r\n                  serviceRequestId={props.serviceRequestId}\r\n                  disabled={!props.isEditable}\r\n                  arrayHelpers={arrayHelpers}\r\n                  updateMyData={updateMyData}\r\n                />\r\n              )}\r\n            </TableToolbar>\r\n            <div className={classes.tableContent}>\r\n              <div className={classes.tableScrolling}>\r\n                <Table\r\n                  {...getTableProps()}\r\n                  className={clsx(classes.table, { withFooter: true })}\r\n                  size=\"small\"\r\n                >\r\n                  <TableHead>\r\n                    {\r\n                      // Loop over the header rows\r\n                      headerGroups.map(headerGroup => (\r\n                        // Apply the header row props\r\n                        <TableRow {...headerGroup.getHeaderGroupProps()}>\r\n                          {\r\n                            // Loop over the headers in each row\r\n                            headerGroup.headers.map(column => (\r\n                              // Apply the header cell props\r\n\r\n                              <TableCell {...column.getHeaderProps()}>\r\n                                {\r\n                                  // Render the header\r\n                                  <TableHeaderCellLabel>\r\n                                    {column.render('Header')}\r\n                                  </TableHeaderCellLabel>\r\n                                }\r\n                              </TableCell>\r\n                            ))\r\n                          }\r\n                        </TableRow>\r\n                      ))\r\n                    }\r\n                  </TableHead>\r\n                  <TableBody {...getTableBodyProps()}>\r\n                    <SRTableBody\r\n                      page={page}\r\n                      prepareRow={prepareRow}\r\n                      arrayHelpers={arrayHelpers}\r\n                      updateMyData={updateMyData}\r\n                      serviceRequestId={props.serviceRequestId}\r\n                      serviceGroups={props.serviceGroups}\r\n                    />\r\n                  </TableBody>\r\n                </Table>\r\n              </div>\r\n\r\n              {props.values.Rows !== undefined && (\r\n                <div\r\n                  id={`serviceRequest_rows_footer`}\r\n                  className={classes.tableFooterWithBorder}\r\n                >\r\n                  <SRTablePagination\r\n                    isEditable={props.isEditable}\r\n                    dataLength={props.values.Rows.length}\r\n                    pageSize={pageSize}\r\n                    pageIndex={pageIndex}\r\n                    gotoPage={gotoPage}\r\n                    setPageSize={setPageSize}\r\n                  />\r\n                </div>\r\n              )}\r\n            </div>\r\n          </>\r\n        );\r\n      }}\r\n    </FieldArray>\r\n  );\r\n});\r\n\r\ninterface SRTableBodyProps\r\n  extends IServiceRequestRelated,\r\n    IServiceRequestTableFormComponent {\r\n  page: Array<Row<IServiceRequestTableRowModel>>;\r\n  prepareRow: (row: Row<IServiceRequestTableRowModel>) => void;\r\n  serviceGroups?: Identifiable<number>[];\r\n}\r\nconst SRTableBody = React.memo(function SRTableBody({\r\n  page,\r\n  prepareRow,\r\n  arrayHelpers,\r\n  serviceGroups,\r\n  updateMyData,\r\n}: SRTableBodyProps) {\r\n  return (\r\n    <>\r\n      {page.map(row => {\r\n        prepareRow(row);\r\n\r\n        const rowProps = row.getRowProps();\r\n        return (\r\n          <React.Fragment key={`srbody_row_${row.original.Id}`}>\r\n            <TableRow {...rowProps} key={`editable-row-${row.id}`}>\r\n              {row.cells.map((cell, index) => (\r\n                <EditableCellField\r\n                  key={`editable-cell-${row.original.Id}-${index}`}\r\n                  name={(cell.column as ColumnTypeExtension).name?.(cell.row)}\r\n                >\r\n                  {(fieldProps?: FastFieldProps) => {\r\n                    const hasError = !isNullOrUndefined(\r\n                      fieldProps?.meta?.error,\r\n                    );\r\n                    return (\r\n                      <StyledTableCell\r\n                        className={\r\n                          (cell.column as ColumnTypeExtension).name !==\r\n                          undefined\r\n                            ? 'editcell'\r\n                            : undefined\r\n                        }\r\n                        {...cell.getCellProps()}\r\n                        //title={fieldProps?.meta?.error}\r\n                        error={hasError}\r\n                        key={`cell-${row.original.Id}-${index}`}\r\n                      >\r\n                        {cell.render('Cell', {\r\n                          arrayHelpers,\r\n                          updateMyData,\r\n                          fieldProps,\r\n                        })}\r\n                      </StyledTableCell>\r\n                    );\r\n                  }}\r\n                </EditableCellField>\r\n              ))}\r\n            </TableRow>\r\n            {row.isExpanded && (\r\n              <TableRow key={`expand_${rowProps.key}`}>\r\n                <TableCell colSpan={row.cells.length}>\r\n                  <ServiceRequestRowComments\r\n                    commentType={CommentReferenceTypes.ServiceRequestRow}\r\n                    referenceId={row.original.Id}\r\n                    serviceRequestId={row.original.ServiceRequestId}\r\n                    row={row}\r\n                    serviceGroups={serviceGroups}\r\n                  />\r\n                </TableCell>\r\n              </TableRow>\r\n            )}\r\n          </React.Fragment>\r\n        );\r\n      })}\r\n    </>\r\n  );\r\n});\r\n\r\ninterface SRTableCellProps {\r\n  error?: boolean;\r\n  title?: string;\r\n  key?: string;\r\n  className?: string;\r\n  children: React.ReactNode;\r\n}\r\nfunction SRTableCell({\r\n  error,\r\n  children,\r\n  title,\r\n  key,\r\n  className,\r\n  ...other\r\n}: React.PropsWithChildren<SRTableCellProps>) {\r\n  return (\r\n    <TableCell key={`cell_${key}`} className={className} {...other}>\r\n      {children}\r\n    </TableCell>\r\n  );\r\n}\r\nconst StyledTableCell = styled(SRTableCell)`\r\n  background: ${props =>\r\n    props.error ? bookitColors.danger.background : 'transparent'};\r\n\r\n  border-bottom: ${props => (props.error ? '1px solid #F78F8B' : 'unset')};\r\n  &.editcell:hover {\r\n    background: ${props =>\r\n      props.error\r\n        ? bookitColors.danger.bgHover\r\n        : bookitColors.grayscale.grayBackground};\r\n    cursor: pointer;\r\n    & > * {\r\n      cursor: pointer;\r\n      & > * {\r\n        cursor: pointer;\r\n        & > * {\r\n          cursor: pointer;\r\n          & > * {\r\n            cursor: pointer;\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  > .Mui-focused & {\r\n    border: 1px solid ${bookitColors.primary.regular};\r\n    background: ${bookitColors.grayscale.grayBackground};\r\n  }\r\n  &:focus-within {\r\n    border: 1px solid ${bookitColors.primary.regular};\r\n    background: ${bookitColors.grayscale.grayBackground};\r\n  }\r\n`;\r\n// box-shadow: ${props =>\r\n//   props.error\r\n//     ? '-1px 0px 0px #e0e5ec, 0px 1px 0px #C42E52'\r\n//     : '-1px 1px 0px #e0e5ec'};\r\nconst TableHeaderCellLabel = styled('span')`\r\n  white-space: break-spaces;\r\n  word-break: normal;\r\n`;\r\ninterface SRTablePaginationProps\r\n  extends Pick<\r\n      UsePaginationState<IServiceRequestTableRowModel>,\r\n      'pageSize' | 'pageIndex'\r\n    >,\r\n    Pick<\r\n      UsePaginationInstanceProps<IServiceRequestTableRowModel>,\r\n      'gotoPage' | 'setPageSize'\r\n    > {\r\n  isEditable: boolean;\r\n  dataLength: number;\r\n}\r\nconst SRTablePagination = React.memo(function SRTablePagination(\r\n  props: SRTablePaginationProps,\r\n) {\r\n  return (\r\n    <TablePagination\r\n      component=\"div\"\r\n      rowsPerPageOptions={[5, 10, 25]}\r\n      /*colSpan={tableColumns.length + (props.isEditable ? 1 : 0)}*/\r\n      count={props.dataLength}\r\n      rowsPerPage={props.pageSize}\r\n      page={props.pageIndex}\r\n      SelectProps={{\r\n        inputProps: { 'aria-label': 'rows per page' },\r\n        native: true,\r\n      }}\r\n      onChangePage={(event, newPage) => props.gotoPage(newPage)}\r\n      onChangeRowsPerPage={event =>\r\n        props.setPageSize(Number(event.target.value))\r\n      }\r\n      ActionsComponent={TablePaginationActions}\r\n    />\r\n  );\r\n});\r\n\r\ninterface EditableCellProps {\r\n  name?: string;\r\n  children: (fieldProps?: FastFieldProps) => React.ReactElement;\r\n}\r\nfunction EditableCellField({\r\n  name,\r\n  ...props\r\n}: EditableCellProps): React.ReactElement {\r\n  if (name === undefined) {\r\n    return props.children(undefined);\r\n  } else {\r\n    return <FastField name={name} key={name} {...props} />;\r\n  }\r\n}\r\n","import * as React from 'react';\r\nimport { Alert } from '@material-ui/lab';\r\nimport * as Yup from 'yup';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { useServiceRequestStatusUpdate } from 'app/pages/Samples/components/Utils';\r\nimport {\r\n  InternalServiceRequestStatuses,\r\n  InternalServiceRequestStatusesUnion,\r\n} from 'enums/InternalServiceRequestStatuses';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectServiceRequestStatusesByInternalId } from '../../slice/selectors';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport {\r\n  FormRow,\r\n  StyledFormFieldsContainer,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { DialogForm, DialogFormProps } from 'app/components/DialogForm';\r\nimport { FormRichTextField } from 'app/components/Forms/FormRichTextField';\r\nimport { IReason } from '../../slice/types';\r\n\r\nexport interface QuoteSentToUserAlertProps {\r\n  ServiceRequestId: number;\r\n  ServiceRequestInternalStatus: InternalServiceRequestStatusesUnion;\r\n}\r\nexport function QuoteSentToUserAlert(props: QuoteSentToUserAlertProps) {\r\n  const { t } = useTranslation();\r\n\r\n  const { changeStatus } = useServiceRequestStatusUpdate({\r\n    serviceRequestStatusId: props.ServiceRequestId,\r\n  });\r\n  const approvedStatus = {\r\n    Id: InternalServiceRequestStatuses.QuoteApproved as number,\r\n    Name: 'QuoteApproved',\r\n    InternalStatusId: 'QuoteApproved',\r\n  } as IServiceRequestStatusDto;\r\n  // const approvedStatus =  useSelector(\r\n  //   state =>\r\n  //     selectServiceRequestStatusesByInternalId(state, 'QuoteApproved')?.[0],\r\n  // );\r\n  const cancelledStatuses = useSelector(state =>\r\n    selectServiceRequestStatusesByInternalId(state, 'Cancelled'),\r\n  );\r\n  const handleApproveQuoteClick = (value: IServiceRequestStatusDto) =>\r\n    changeStatus({\r\n      status: value,\r\n    });\r\n  const handleRejectClick = (values: IReason) => {\r\n    const firstCancelledStatus = cancelledStatuses?.[0];\r\n    if (firstCancelledStatus !== undefined) {\r\n      changeStatus({\r\n        status: firstCancelledStatus,\r\n        reason: values.Reason,\r\n      });\r\n    }\r\n  };\r\n  if (props.ServiceRequestInternalStatus !== 'QuoteSendToUser') {\r\n    return null;\r\n  }\r\n  return (\r\n    <StyledFormFieldsContainer>\r\n      <Alert color=\"info\">\r\n        <span>\r\n          {t(translations.Request_SendQuoteToUser_PendingMessage)}\r\n          &emsp;\r\n          <Button\r\n            key={`status_${approvedStatus.Id}`}\r\n            size=\"small\"\r\n            onClick={() => handleApproveQuoteClick(approvedStatus)}\r\n          >\r\n            {t(translations.Request_SendQuoteToUser_ApproveQuote)}\r\n          </Button>\r\n          &emsp;\r\n          <Reject onSubmit={handleRejectClick} />\r\n        </span>\r\n      </Alert>\r\n    </StyledFormFieldsContainer>\r\n  );\r\n}\r\n\r\ninterface RejectProps extends Pick<DialogConfirmWithReasonProps, 'onSubmit'> {}\r\nfunction Reject(props: RejectProps) {\r\n  const [dialogOpen, setDialogOpen] = React.useState(false);\r\n  const { t } = useTranslation();\r\n  return (\r\n    <>\r\n      <Button size=\"small\" variant=\"danger\" onClick={() => setDialogOpen(true)}>\r\n        {t(translations.Request_SendQuoteToUser_RejectQuote)}\r\n      </Button>\r\n      <ConfirmRejectDialog\r\n        onClose={() => setDialogOpen(false)}\r\n        onSubmit={props.onSubmit}\r\n        open={dialogOpen}\r\n      />\r\n    </>\r\n  );\r\n}\r\n\r\ninterface DialogConfirmWithReasonProps\r\n  extends Pick<DialogFormProps<IReason>, 'onSubmit' | 'onClose' | 'open'> {}\r\nfunction ConfirmRejectDialog(props: DialogConfirmWithReasonProps) {\r\n  const { t } = useTranslation();\r\n  const validationSchema: Yup.SchemaOf<IReason> = Yup.object({\r\n    Reason: Yup.string().required(t(translations.RejectReasonEmpty_err)),\r\n  });\r\n  return (\r\n    <DialogForm\r\n      {...props}\r\n      validationSchema={validationSchema}\r\n      initialValues={{}}\r\n      title={t(translations.Confirm_RejectQuote_Title)}\r\n    >\r\n      <FormRow fullRow>\r\n        <FormRichTextField\r\n          name=\"Reason\"\r\n          label={t(translations.Confirm_RejectQuote_TextLabel)}\r\n          placeholder={t(translations.Confirm_RejectQuote_TextLabel)}\r\n        />\r\n      </FormRow>\r\n    </DialogForm>\r\n  );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectServiceRequestStatusesByInternalId } from '../../slice/selectors';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { useServiceRequestStatusUpdate } from 'app/pages/Samples/components/Utils';\r\nimport { IRequestDetailsModel } from '../../slice/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\n\r\nexport function canSendQuote(\r\n  isAdmin: boolean,\r\n  serviceRequest?: IRequestDetailsModel,\r\n) {\r\n  return (\r\n    serviceRequest?.Service.SendQuoteToUser === true &&\r\n    isAdmin === true &&\r\n    ['InProcess', 'Draft'].includes(serviceRequest?.Status.InternalStatusId)\r\n  );\r\n}\r\nexport interface ISendQuoteButtonButtonProps {\r\n  serviceRequest: IRequestDetailsModel;\r\n}\r\nexport function SendQuoteButtonButton(props: ISendQuoteButtonButtonProps) {\r\n  const { t } = useTranslation();\r\n  const statuses = useSelector(state =>\r\n    selectServiceRequestStatusesByInternalId(state, 'QuoteSendToUser'),\r\n  );\r\n\r\n  const { changeStatus } = useServiceRequestStatusUpdate({\r\n    serviceRequestStatusId: props.serviceRequest?.Id,\r\n  });\r\n\r\n  // const submitEnabled = React.useMemo(() => canSendQuote(props), [props]);\r\n\r\n  const handleClick = () => {\r\n    const status = statuses?.[0];\r\n    if (status !== undefined) {\r\n      changeStatus({\r\n        status: status,\r\n      });\r\n    }\r\n  };\r\n\r\n  return (\r\n    <Button\r\n      size=\"small\"\r\n      startIcon={<Icon icon={'save'} />}\r\n      variant=\"ghost\"\r\n      aria-label={t(translations.SendQuote)}\r\n      disabled={statuses === undefined || statuses.length === 0}\r\n      onClick={handleClick}\r\n      title={t(translations.SendQuote)}\r\n    >\r\n      {t(translations.SendQuote)}\r\n    </Button>\r\n  );\r\n}\r\n","import { getCustomFormColumnSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { transform } from 'lodash';\r\nimport * as Yup from 'yup';\r\nimport { ServiceRequestTableColumnsCollection } from '../../RequestSamplesPage/slice/utils/ServiceRequestTableColumn';\r\n\r\nexport const getSchema = (props: {\r\n  columns: ServiceRequestTableColumnsCollection;\r\n  isAdmin: boolean;\r\n}) =>\r\n  // TODO: fix custom form schema typings starting from the getFieldSchema. In the end this : Yup.SchemaOf<Array<IServiceRequestTableRowModel>>\r\n  {\r\n    const columnSchema = (result, column, key) =>\r\n      (result[column.getFieldName()] = getCustomFormColumnSchema({\r\n        ColumnType: column.ColumnType,\r\n        Label: column.Label,\r\n        SizeLimit: column.SizeLimit,\r\n        isRequired: column.isRequired,\r\n        Options: column.Options,\r\n      }).nullable());\r\n\r\n    const x = transform(props.columns.columnsObj, columnSchema);\r\n\r\n    const dynamicValuesSchema = Yup.object(x);\r\n\r\n    return Yup.array(\r\n      Yup.object({\r\n        Values: dynamicValuesSchema,\r\n      }),\r\n    );\r\n  };\r\n","import * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { downloadFile } from 'utils/url-utils';\r\n\r\ninterface DownloadAllFilesProps {\r\n  serviceRequestId: number;\r\n}\r\n\r\nexport function DownloadAllFiles(props: DownloadAllFilesProps) {\r\n  const { t } = useTranslation();\r\n  const url = `/api/odata/v4/ServiceRequests(${props.serviceRequestId})/Files`;\r\n  const [busy, setBusy] = React.useState(false);\r\n  const handleClick = React.useCallback(\r\n    async event => {\r\n      event.preventDefault();\r\n      if (busy) {\r\n        return;\r\n      }\r\n      setBusy(true);\r\n      try {\r\n        await downloadFile({ path: url });\r\n        setBusy(false);\r\n      } catch (error) {\r\n        setBusy(false);\r\n      }\r\n\r\n      return false;\r\n    },\r\n    [busy, url],\r\n  );\r\n  return (\r\n    <Button\r\n      component={'a'}\r\n      href={url}\r\n      size=\"small\"\r\n      variant=\"white\"\r\n      onClick={handleClick}\r\n      processing={busy}\r\n      disabled={busy}\r\n    >\r\n      {t(translations.DownloadAllFiles)}\r\n    </Button>\r\n  );\r\n}\r\n","import { IReservationHistoryDto } from 'api/odata/generated/entities/IReservationHistoryDto';\r\nimport { Condition, ODataOperators } from 'api/odata/ODataFilter';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { PrimaryAction } from 'app/components/BasicTable/components/TableCard/PrimaryAction';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { FormSectionTitle } from 'app/components/Forms/FormsLayout/FormSectionTitle';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { getColumns } from 'app/pages/ReservationHistoryPage/Columns';\r\nimport { reservationsPrimaryAction } from 'app/pages/ReservationHistoryPage/PrimaryAction';\r\nimport { ReservationHistoryTable } from 'app/pages/ReservationHistoryPage/ReservationHistoryTable';\r\nimport { useReservationPermissions } from 'app/permissions/Reservations/reservationPermissions';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { Column } from 'react-table';\r\n\r\nexport interface ServiceRequestReservationsProps {\r\n  serviceRequestId: number;\r\n  isMobile?: boolean;\r\n  useSidePanel?: boolean;\r\n  openPanel: (state: SidePanelOpenState) => void;\r\n  tableContainerStyles?: React.CSSProperties;\r\n  onCreateReservation: () => void;\r\n  isAdmin: boolean;\r\n}\r\n\r\nexport const ServiceRequestReservations = React.memo(\r\n  function ServiceRequestReservations(props: ServiceRequestReservationsProps) {\r\n    const { t } = useTranslation();\r\n    const user = useSelector(selectAuthenticatedUser);\r\n    const settings = useSelector(selectglobalSettings);\r\n    const { allowedToView } = useReservationPermissions();\r\n    const {\r\n      serviceRequestId,\r\n      isMobile,\r\n      useSidePanel,\r\n      openPanel,\r\n      onCreateReservation,\r\n      isAdmin,\r\n    } = props;\r\n    const SRReservationColumns = React.useMemo(\r\n      () => [\r\n        'Id',\r\n        'EquipmentName',\r\n        'StartTime',\r\n        'EndTime',\r\n        'Status',\r\n        'DurationH',\r\n        'Remarks',\r\n        'Charges',\r\n      ],\r\n      [],\r\n    );\r\n    const predicates = React.useMemo(() => {\r\n      return [\r\n        `(${new Condition<IReservationHistoryDto>(\r\n          'ServiceRequestIds',\r\n          ODataOperators.In,\r\n          serviceRequestId,\r\n        ).toString()} or ${new Condition<IReservationHistoryDto>(\r\n          'RowsRequestIds',\r\n          ODataOperators.In,\r\n          serviceRequestId,\r\n        ).toString()})`,\r\n      ];\r\n    }, [serviceRequestId]);\r\n    const reservationsColumns: Column<IReservationHistoryDto>[] = React.useMemo(\r\n      () =>\r\n        getColumns(t, user, settings, allowedToView, useSidePanel, openPanel),\r\n      [t, user, settings, allowedToView, useSidePanel, openPanel],\r\n    );\r\n    const columns = React.useMemo(() => {\r\n      let res: Column<IReservationHistoryDto>[] = [];\r\n      for (const c of SRReservationColumns) {\r\n        const column = reservationsColumns.find(f => f.accessor === c);\r\n        if (column !== undefined) {\r\n          res.push(column);\r\n        }\r\n      }\r\n      return res;\r\n    }, [SRReservationColumns, reservationsColumns]);\r\n    const PageActions: PageActionRenderer[] = [\r\n      () => (\r\n        <TopActionButton\r\n          variant=\"main\"\r\n          size=\"small\"\r\n          icon={'plus'}\r\n          onClick={() => onCreateReservation()}\r\n          text={t(translations.CreateReservation)}\r\n        />\r\n      ),\r\n    ];\r\n    // const initialState: IBasicTableState<IReservationHistoryDto> = React.useMemo(\r\n    //   () => ({\r\n    //     sortBy: [{ id: 'Id', desc: true }],\r\n    //   }),\r\n    //   [],\r\n    // );\r\n    const primaryAction: PrimaryAction<any> = React.useCallback(\r\n      (...args) => {\r\n        reservationsPrimaryAction(\r\n          openPanel,\r\n          args[0],\r\n          args[1],\r\n          args[2],\r\n          useSidePanel,\r\n        );\r\n      },\r\n      [openPanel, useSidePanel],\r\n    );\r\n    return (\r\n      <>\r\n        <ReservationHistoryTable\r\n          columns={columns}\r\n          initialState={{\r\n            sortBy: [{ id: 'Id', desc: true }],\r\n          }}\r\n          predicates={predicates}\r\n          useConfigurable={false}\r\n          useCardsByDefault={isMobile}\r\n          allowCards={isMobile}\r\n          pageActions={isAdmin ? PageActions : undefined}\r\n          useExport={true}\r\n          serviceGroups={[]}\r\n          customScreenName={\r\n            <FormSectionTitle title={t(translations.Reservations)} />\r\n          }\r\n          hideMenuOnMobile={true}\r\n          useRowSelect={false}\r\n          screenNameVariant=\"section\"\r\n          //tablePaddingVariant={'dense'}\r\n          compactTable={isMobile}\r\n          primaryAction={primaryAction}\r\n          tableContainerSyles={props.tableContainerStyles}\r\n        />\r\n      </>\r\n    );\r\n  },\r\n);\r\n","/**\r\n *\r\n * GradientsPicker\r\n *\r\n */\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IGradientsDto } from 'api/odata/IGradientsDto';\r\nimport { Condition } from 'api/odata/ODataFilter';\r\nimport {\r\n  AutocompletePicker,\r\n  AutocompletePickerProps,\r\n} from 'app/components/BasicPickers/AutocompletePicker';\r\nimport { getAutoCompleteLoadDataFn } from 'app/components/BasicPickers/Utils/autoCompletePickerUtils';\r\nimport { Entity } from 'types/common';\r\n\r\nexport interface GradientsPickerProps\r\n  extends Omit<AutocompletePickerProps<Entity<number>>, 'loadData'> {}\r\n\r\nconst url = '/api/odata/v4/Gradients';\r\nexport const initGradientsData = (initval: string | undefined) => {\r\n  if (initval === undefined) {\r\n    return new Promise<Entity<number>[]>((resolve, reject) => {\r\n      resolve([] as Entity<number>[]);\r\n    });\r\n  } else {\r\n    const id = parseInt(initval);\r\n    const params: {\r\n      $orderby: string;\r\n      $filter?: string;\r\n      $select: string;\r\n      $top: number;\r\n      $skip: number;\r\n    } = {\r\n      $orderby: 'Name asc',\r\n      $filter: '(Id eq ' + id + ')',\r\n      $select:\r\n        'Id,Name,ServiceGroupId,ServiceGroupName,EstimatedRuntimeMinutes',\r\n      $skip: 0,\r\n      $top: 1,\r\n    };\r\n    return httpClient\r\n      .get(url, params)\r\n      .then(response => response.value as Entity<number>[]);\r\n  }\r\n};\r\nconst loadData = (\r\n  predicates: (string | Condition<IGradientsDto>)[] | undefined,\r\n) => {\r\n  return getAutoCompleteLoadDataFn<IGradientsDto>({\r\n    url: url,\r\n    predicates: predicates,\r\n    // all props of the IAssetDto are listed due to potential use of thes somewhere\r\n    // TODO: narrow down used properties list\r\n    select: [\r\n      'Id',\r\n      'Name',\r\n      'ServiceGroupId',\r\n      'ServiceGroupName',\r\n      'EstimatedRuntimeMinutes',\r\n    ],\r\n    globalServiceGroupFilter: [],\r\n    isOptionalServiceGroup: true,\r\n  });\r\n};\r\nexport function GradientsPicker(props: GradientsPickerProps) {\r\n  const innerLoadData = loadData(props.predicates);\r\n  return (\r\n    <AutocompletePicker\r\n      size={props.size}\r\n      loadData={innerLoadData}\r\n      {...props}\r\n      id={props.id || 'gradientsId'}\r\n    />\r\n  );\r\n}\r\n","import { Dialog } from '@material-ui/core';\r\nimport { toQueryString, toRootedURL } from 'utils/url-utils';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Entity } from 'types/common';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { OnlineServiceSinglePicker } from 'app/components/pickers/MultiSelectPickers/OnlineServicesPicker';\r\nimport { useDispatch } from 'react-redux';\r\nimport { GetSchedulerPagePath } from 'app/pages/CalendarPage/GetCalendarPagePath';\r\nimport { IGradientsDto } from 'api/odata/IGradientsDto';\r\nimport { useRequestSamplesSlice } from '../../RequestSamplesPage/slice';\r\nimport { GradientsPicker } from 'app/components/pickers/AutocompletePickers/GradientsPicker';\r\nimport { TextControlField } from 'app/components/BasicInputs/TextControlField';\r\nimport React from 'react';\r\nimport { IServiceFilterDto } from 'api/odata/generated/entities/IServiceFilterDto';\r\nimport {\r\n  Condition,\r\n  ODataOperators,\r\n  quoteODataValue,\r\n} from 'api/odata/ODataFilter';\r\nimport { SidePanelOpenState } from 'app/hooks/useSidePanelOpen';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { IServiceRequestTableRowModel } from '../../RequestSamplesPage/slice/types';\r\nimport { ReservationQueryStringParameters } from 'app/pages/ReservationDetails/Details/slice/types';\r\nimport { ReservationDetailsProps } from 'app/pages/ReservationDetails/Details';\r\nimport { debounce } from 'lodash';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { BasicDialogTitle } from 'app/components/BasicDialog/BasicDialogTitle';\r\nimport { BasicDialogActions } from 'app/components/BasicDialog/BasicDialogActions';\r\nimport { BasicDialogContent } from 'app/components/BasicDialog/BasicDialogContent';\r\nimport {\r\n  FormFieldsSection,\r\n  FormLeftSection,\r\n  FormRow,\r\n} from 'app/components/Forms/FormsLayout';\r\n\r\nexport interface CreateRequestReservationProps {\r\n  serviceRequestId: number;\r\n  requestOverheadMinutes: number | null;\r\n  gradient: IGradientsDto | null;\r\n  userName: string;\r\n  budgetId?: number;\r\n  serviceGroupId: number;\r\n  serviceRequestRelatedEquipments: number[];\r\n  rows: IServiceRequestTableRowModel[];\r\n  useSidePanel?: boolean;\r\n  openPanel: (state: SidePanelOpenState) => void;\r\n  createOpen: boolean;\r\n  onClose: () => void;\r\n}\r\n\r\nexport const CreateRequestReservation = ({\r\n  serviceRequestId,\r\n  requestOverheadMinutes,\r\n  gradient,\r\n  userName,\r\n  budgetId,\r\n  serviceGroupId,\r\n  serviceRequestRelatedEquipments,\r\n  useSidePanel,\r\n  rows,\r\n  openPanel,\r\n  createOpen,\r\n  onClose,\r\n}: CreateRequestReservationProps) => {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useRequestSamplesSlice();\r\n  const [open, setOpen] = React.useState(createOpen);\r\n  React.useEffect(() => {\r\n    setOpen(createOpen);\r\n  }, [createOpen]);\r\n  const equipmentsPredicates = React.useMemo(() => {\r\n    const predicates: string | Condition<IServiceFilterDto>[] = [];\r\n    predicates.push(\r\n      new Condition<IServiceFilterDto>(\r\n        'ServiceGroupId',\r\n        ODataOperators.Equals,\r\n        serviceGroupId,\r\n      ),\r\n    );\r\n    if (serviceRequestRelatedEquipments.length > 0) {\r\n      predicates.push(\r\n        new Condition<IServiceFilterDto>(\r\n          'Id',\r\n          ODataOperators.Includes,\r\n          serviceRequestRelatedEquipments,\r\n        ),\r\n      );\r\n    }\r\n    return predicates;\r\n  }, [serviceGroupId, serviceRequestRelatedEquipments]);\r\n  const [overheadMinText, setOverheadMinText] = React.useState<string>(\r\n    String(requestOverheadMinutes ?? ''),\r\n  );\r\n  const [\r\n    selectedGradient,\r\n    setSelectedGradient,\r\n  ] = React.useState<IGradientsDto | null>(gradient);\r\n  const [selectedEquipment, setSelectedEquipment] = React.useState<Entity<\r\n    number\r\n  > | null>(null);\r\n  const duration = React.useMemo(() => {\r\n    return rows.length > 0\r\n      ? ((selectedGradient?.EstimatedRuntimeMinutes ?? 0) + +overheadMinText) *\r\n          rows.length\r\n      : +overheadMinText;\r\n  }, [overheadMinText, rows.length, selectedGradient?.EstimatedRuntimeMinutes]);\r\n  const handleOverheadSave = React.useCallback(\r\n    (value?: number) => {\r\n      dispatch(\r\n        actions.patch({\r\n          Id: serviceRequestId,\r\n          OverheadMinutes: value || null,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch, serviceRequestId],\r\n  );\r\n  const debouncedPoChange = React.useMemo(\r\n    () => debounce(handleOverheadSave, 500),\r\n    [handleOverheadSave],\r\n  );\r\n\r\n  const handleOverheadChange = React.useCallback(\r\n    (value: string) => {\r\n      setOverheadMinText(value);\r\n      debouncedPoChange(tryParseInt(value));\r\n    },\r\n    [debouncedPoChange],\r\n  );\r\n  const validToCreate = React.useMemo(() => {\r\n    return selectedEquipment !== null && open;\r\n  }, [open, selectedEquipment]);\r\n  const handleCreateReservationButtonClick = React.useCallback(\r\n    (openIn: 'reservation' | 'calendar') => {\r\n      if (!selectedEquipment) return;\r\n      if (openIn === 'reservation') {\r\n        const params: Record<string, any> = {\r\n          selectedIds: String(selectedEquipment.Id),\r\n          un: userName,\r\n          bid: String(budgetId),\r\n          srid: String(serviceRequestId),\r\n          srrid: String(rows?.map(f => f.Id).join(',')),\r\n          duration: String(duration),\r\n        };\r\n        const openProps = {\r\n          renderPageType: RenderPageType.ReservationDetails,\r\n          renderPageProps: {\r\n            useSidePanel: useSidePanel ?? false,\r\n            queryParams: params as ReservationQueryStringParameters,\r\n          } as ReservationDetailsProps,\r\n          expanded: false,\r\n          useSidePanel: useSidePanel,\r\n          isCover: useSidePanel,\r\n        } as SidePanelOpenState;\r\n        openPanel(openProps);\r\n        onClose();\r\n      } else {\r\n        var p: Record<string, any> = {\r\n          bid: budgetId,\r\n          un: userName,\r\n          srid: serviceRequestId,\r\n          srrid: rows?.map(r => r.Id).join(','),\r\n          eid: selectedEquipment.Id,\r\n          duration: duration,\r\n          openToBook: true,\r\n        };\r\n        window.open(\r\n          toRootedURL(\r\n            `${GetSchedulerPagePath('calendar')}?${toQueryString(p)}`,\r\n          ),\r\n          '_blank',\r\n        );\r\n        // dispatch(\r\n        //   push({\r\n        //     pathname: GetSchedulerPagePath('calendar'),\r\n        //     search: toQueryString(p).toString(),\r\n        //   }),\r\n        // );\r\n        onClose();\r\n      }\r\n    },\r\n    [\r\n      budgetId,\r\n      duration,\r\n      onClose,\r\n      openPanel,\r\n      rows,\r\n      selectedEquipment,\r\n      serviceRequestId,\r\n      useSidePanel,\r\n      userName,\r\n    ],\r\n  );\r\n  return (\r\n    <>\r\n      {/* <Button size=\"small\" onClick={e => setOpen(true)}>\r\n        {t(translations.CreateReservation)}\r\n      </Button> */}\r\n      <Dialog open={open} onClose={() => onClose()}>\r\n        <BasicDialogTitle>\r\n          {t(translations.ServiceRequestCreateRservation)}\r\n        </BasicDialogTitle>\r\n        <BasicDialogContent>\r\n          <FormLeftSection>\r\n            <FormFieldsSection>\r\n              {rows.length > 0 && (\r\n                <FormRow>\r\n                  <GradientsPicker\r\n                    fullWidth\r\n                    name=\"Gradient\"\r\n                    variant=\"filled\"\r\n                    value={selectedGradient}\r\n                    label={t(translations.ServiceRequestGradient)}\r\n                    placeholder={t(translations.ServiceRequestGradient)}\r\n                    info={t(translations.ServiceRequestGradient_info)}\r\n                    onChange={value => {\r\n                      dispatch(\r\n                        actions.updateGradient({\r\n                          Id: serviceRequestId,\r\n                          Gradient: value as IGradientsDto,\r\n                        }),\r\n                      );\r\n                      setSelectedGradient(value as IGradientsDto);\r\n                    }}\r\n                    predicates={[\r\n                      `ServiceGroupId eq ${quoteODataValue(serviceGroupId)}`,\r\n                    ]}\r\n                  />\r\n                </FormRow>\r\n              )}\r\n\r\n              <FormRow>\r\n                <TextControlField\r\n                  variant=\"filled\"\r\n                  fullWidth\r\n                  inputProps={{\r\n                    type: 'number',\r\n                    min: 0,\r\n                  }}\r\n                  info={t(translations.RequestReservationTime_info)}\r\n                  value={overheadMinText}\r\n                  onChange={event => handleOverheadChange(event.target.value)}\r\n                  label={t(\r\n                    rows.length > 0\r\n                      ? translations.RequestReservationOverallOverheadTime\r\n                      : translations.RequestReservationTime,\r\n                  )}\r\n                />\r\n              </FormRow>\r\n              <FormRow>\r\n                <OnlineServiceSinglePicker\r\n                  predicates={equipmentsPredicates}\r\n                  placeholder={t(translations.PleaseSelectAnInstrument)}\r\n                  label={t(translations.Equipment)}\r\n                  onChange={value => {\r\n                    setSelectedEquipment(value[0] ?? null);\r\n                  }}\r\n                  value={\r\n                    selectedEquipment === null\r\n                      ? undefined\r\n                      : [selectedEquipment as IServiceFilterDto]\r\n                  }\r\n                  error={selectedEquipment === null}\r\n                  variant=\"filled\"\r\n                  helperText={\r\n                    selectedEquipment === null\r\n                      ? t(translations.PleaseSelectAnEquipmentAndSamples)\r\n                      : undefined\r\n                  }\r\n                  fullWidth\r\n                  info={t(translations.PleaseSelectAnEquipmentAndSamples)}\r\n                />\r\n              </FormRow>\r\n            </FormFieldsSection>\r\n          </FormLeftSection>\r\n        </BasicDialogContent>\r\n        <BasicDialogActions\r\n          leftActions={[\r\n            () => (\r\n              <Button\r\n                variant=\"main\"\r\n                size=\"small\"\r\n                disabled={!validToCreate}\r\n                onClick={() => {\r\n                  handleCreateReservationButtonClick('reservation');\r\n                }}\r\n              >\r\n                {t(translations.Continue)}\r\n              </Button>\r\n            ),\r\n            () => (\r\n              <Button\r\n                variant=\"white\"\r\n                size=\"small\"\r\n                disabled={!validToCreate}\r\n                onClick={() => {\r\n                  handleCreateReservationButtonClick('calendar');\r\n                }}\r\n              >\r\n                {t(translations.OpenInSchedule)}\r\n              </Button>\r\n            ),\r\n          ]}\r\n          rightActions={[\r\n            () => (\r\n              <Button\r\n                autoFocus\r\n                variant=\"ghost\"\r\n                size=\"small\"\r\n                onClick={() => onClose()}\r\n              >\r\n                {t(translations.Cancel)}\r\n              </Button>\r\n            ),\r\n          ]}\r\n        ></BasicDialogActions>\r\n      </Dialog>\r\n    </>\r\n  );\r\n};\r\n","/**\r\n *\r\n * RequestSamplesPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Redirect, RouteComponentProps, useLocation } from 'react-router-dom';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRequestSamplesSlice } from './slice';\r\nimport {\r\n  selectIsServiceRequestAdmin,\r\n  selectRequestDetails,\r\n  selectRequestDetailsData,\r\n  selectServiceRequestCustomFormColumns,\r\n  selectServiceRequestCustomFormFields,\r\n  selectServiceRequestFormData,\r\n  selectServiceRequestSidePanel,\r\n  selectSubmitting,\r\n} from './slice/selectors';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { SamplesTable } from '../components/SamplesTable';\r\nimport { translations } from 'locales/translations';\r\nimport { ServiceRequestCustomForm } from './components/ServiceRequestCustomForm';\r\nimport { PrintToPDF } from 'app/components/PrintToPDF';\r\nimport { PrintPDFSection } from 'app/components/PrintToPDF/PrintPDFSection';\r\nimport { usePrintPDFSlice } from 'app/components/PrintToPDF/slice';\r\nimport { AxiosError } from 'axios';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { NotFoundPage } from 'app/pages/NotFoundPage';\r\nimport { PageWrapper } from 'app/Layout/FrontendLayout/components/PageWrapper';\r\nimport {\r\n  RenderPageType,\r\n  SidePanelContentProps,\r\n} from 'app/Layout/FrontendLayout/slice/type';\r\nimport { ActionRenderer } from 'app/Layout/FrontendLayout/components/PageWrapper/PageActions/ActionRender';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { GetServiceRequestDetailsPath } from './slice/path';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { push } from 'connected-react-router';\r\nimport { CommentReferenceTypes } from 'enums/commentReferenceTypes';\r\nimport { ServiceRequestSubmissionDetails } from '../components/ServiceRequestSubmissionDetails';\r\nimport { SubmitServiceRequestButton } from './components/SubmitServiceRequestButton';\r\nimport { CancelServiceRequestButton } from './components/CancelServiceRequestButton';\r\nimport { getServiceRequestTitle } from './getServiceRequestTitle';\r\nimport { getPrintPDFSections } from 'app/components/PrintToPDF/getPrintPDFSections';\r\nimport { ServiceRequestMilestonesSection } from '../components/ServiceRequestMilestonesSection';\r\nimport { AddonTypesUnion } from 'api/odata/generated/enums/AddonTypes';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { ServiceRequestMilestoneDetailsProps } from '../components/ServiceRequestMilestoneDetails';\r\nimport { ServiceRequestMilestoneDetails } from '../components/ServiceRequestMilestoneDetails';\r\nimport {\r\n  ServiceRequestMilestoneChargeDetails,\r\n  ServiceRequestMilestoneChargeDetailsProps,\r\n} from '../components/ServiceRequestMilestoneChargeDetails';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { CloneServiceRequestButton } from './components/CloneServiceRequestButton';\r\nimport {\r\n  selectAppSettings,\r\n  selectForbiddenFileExtensions,\r\n  selectglobalSettings,\r\n  selectKnownModule,\r\n  selectUploadFileSizeLimit,\r\n  selectUserProfileSettings,\r\n} from 'app/slice/selectors';\r\nimport { getNotificationsLogPageLocation } from 'app/pages/EmailNotificationsPage/getNotificationsLogPageLocation';\r\nimport { Box } from '@material-ui/core';\r\nimport { ServiceRequestRowsTable } from '../components/ServiceRequestRowsTable';\r\nimport { QuoteSentToUserAlert } from './components/QuoteSentToUserAlert';\r\nimport { SendQuoteButtonButton } from './components/SendQuoteButton';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\nimport { StyledFormFieldsContainer } from 'app/components/Forms/FormsLayout';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ServiceRequestRowComments as ServiceRequestComments } from '../components/ServiceRequestRowsTable/components/ServiceRequestComments';\r\nimport { getRequestDetailsSchema } from './utils/validationSchema';\r\nimport { Formik } from 'formik';\r\nimport {\r\n  IServiceRequestDetailsFormModel,\r\n  IServiceRequestTableRowModel,\r\n} from './slice/types';\r\nimport { InternalServiceRequestStatus } from 'api/odata/generated/enums/InternalServiceRequestStatus';\r\nimport { DownloadAllFiles } from './components/DownloadAllFiles';\r\nimport { Body, H4 } from 'app/components/Typography';\r\nimport {\r\n  ReservationDetails,\r\n  ReservationDetailsProps,\r\n} from 'app/pages/ReservationDetails/Details';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { ServiceRequestReservations } from '../components/ServiceRequestReservations';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { CreateRequestReservation } from '../components/CreateRequestReservation';\r\n\r\nexport interface RequestSamplesPageProps\r\n  extends RouteComponentProps<{ id: string }> {}\r\nexport interface ServiceRequestDetailsProps extends SidePanelContentProps {\r\n  id: number;\r\n}\r\n\r\nexport function RequestSamplesPage(props: RequestSamplesPageProps) {\r\n  const serviceRequestId = parseInt(props.match.params.id);\r\n  if (isNaN(serviceRequestId)) {\r\n    return null;\r\n  }\r\n  return <ServiceRequestDetails id={serviceRequestId} useSidePanel={false} />;\r\n}\r\nexport function RequestDetailsPage() {\r\n  const location = useLocation();\r\n  const id = React.useMemo(\r\n    () => new URLSearchParams(location.search).get('id') ?? '',\r\n    [location.search],\r\n  );\r\n  const serviceRequestId = parseInt(id);\r\n  if (isNaN(serviceRequestId)) {\r\n    return <NotFoundPage />;\r\n  }\r\n  return <Redirect to={'/requests/' + serviceRequestId} />;\r\n}\r\nexport function ServiceRequestDetails({\r\n  id,\r\n  useSidePanel,\r\n}: ServiceRequestDetailsProps) {\r\n  const requestDetails = useSelector(selectRequestDetails);\r\n  const requestDetailsData = useSelector(selectRequestDetailsData);\r\n  const serviceRequestFormData = useSelector(selectServiceRequestFormData);\r\n  const userProfileSettings = useSelector(selectUserProfileSettings);\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const settings = useSelector(selectglobalSettings);\r\n  const samplesAutomationEnabled = appSettings?.Modules.includes(\r\n    KnownModules.SamplesAutomation,\r\n  );\r\n  const submittingRequest = useSelector(selectSubmitting);\r\n  /**\r\n   * custom form table section enabled/disabled\r\n   */\r\n  const SampleManagementTablesEnabled = useSelector(state =>\r\n    selectKnownModule(state, KnownModules.SampleManagementTables),\r\n  );\r\n  const requestReservationEnabled = React.useMemo(() => {\r\n    return (\r\n      settings.GetBoolean(\r\n        AllowedSettings[AllowedSettings.ServiceRequestReservations],\r\n      ) && (requestDetailsData?.ServiceRequestRelatedEquipments.length ?? 0) > 0\r\n    );\r\n  }, [requestDetailsData?.ServiceRequestRelatedEquipments.length, settings]);\r\n  const { actions } = useRequestSamplesSlice();\r\n  const { actions: printActions } = usePrintPDFSlice();\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const isMobile = DetectIsMobile();\r\n  //todo\r\n  const { isAdmin, isOwner, isEditable } = useSelector(\r\n    selectIsServiceRequestAdmin,\r\n  );\r\n  const sidePanel = useSelector(selectServiceRequestSidePanel);\r\n\r\n  React.useEffect(() => {\r\n    dispatch(actions.loadRequestDetails(id));\r\n  }, [actions, dispatch, id]);\r\n\r\n  const [print, setPrint] = React.useState(false);\r\n  const [reservationOpen, setReservationOpen] = React.useState<boolean>(false);\r\n  const [selectedRows, setSelectedRows] = React.useState<\r\n    IServiceRequestTableRowModel[]\r\n  >([]);\r\n  const showCancelRequest = React.useMemo(() => {\r\n    return (\r\n      !!requestDetailsData &&\r\n      requestDetailsData.Status.InternalStatusId !== 'Cancelled' &&\r\n      (isAdmin ||\r\n        (isOwner &&\r\n          ['Draft', 'ReturnedToUser', 'Pending', 'QuoteSendToUser'].includes(\r\n            requestDetailsData.Status.InternalStatusId,\r\n          )))\r\n    );\r\n  }, [isAdmin, isOwner, requestDetailsData]);\r\n  const handleCreateResClose = React.useCallback(() => {\r\n    setReservationOpen(false);\r\n    setSelectedRows([]);\r\n  }, []);\r\n  const handleCreateRowReservation = React.useCallback(\r\n    (rows: IServiceRequestTableRowModel[]) => {\r\n      setReservationOpen(true);\r\n      setSelectedRows(rows);\r\n    },\r\n    [],\r\n  );\r\n  React.useEffect(() => {\r\n    if (!print) {\r\n      const printSections = getPrintPDFSections(\r\n        t,\r\n        userProfileSettings.GetSettingByKey('/RequestSamples.pdf')?.Value ?? '',\r\n      );\r\n      dispatch(printActions.setUseSections(true));\r\n      dispatch(printActions.updateSections(printSections));\r\n    }\r\n  }, [dispatch, print, printActions, t, userProfileSettings]);\r\n\r\n  const customFormFields = useSelector(selectServiceRequestCustomFormFields);\r\n  const customFormColumns = useSelector(selectServiceRequestCustomFormColumns);\r\n  const handlePrintToPDF = React.useCallback(() => {\r\n    setPrint(true);\r\n  }, []);\r\n\r\n  const ForbiddenFileExtensions = useSelector(selectForbiddenFileExtensions);\r\n  const UploadFileSizeLimit = useSelector(selectUploadFileSizeLimit);\r\n  const schema = React.useMemo(\r\n    () =>\r\n      getRequestDetailsSchema({\r\n        columns: customFormColumns,\r\n        fields: customFormFields,\r\n        isAdmin,\r\n        SampleManagementTablesEnabled,\r\n        ForbiddenFileExtensions,\r\n        UploadFileSizeLimit,\r\n      }),\r\n    [\r\n      ForbiddenFileExtensions,\r\n      SampleManagementTablesEnabled,\r\n      UploadFileSizeLimit,\r\n      customFormColumns,\r\n      customFormFields,\r\n      isAdmin,\r\n    ],\r\n  );\r\n  const [hasRowsErrors, setHasRowsErrors] = React.useState<boolean | undefined>(\r\n    undefined,\r\n  );\r\n\r\n  // const submitAction = React.useMemo(() => {\r\n  //   const x = () => (\r\n  //     <SubmitServiceRequestButton\r\n  //       serviceRequest={requestDetails?.value}\r\n  //       editable={isEditable}\r\n  //       getErrors={(errors: FormikErrors<IRequestDetailsModel>) =>\r\n  //         setErrors(errors)\r\n  //       }\r\n  //     />\r\n  //   );\r\n  //   return x;\r\n  // }, [isEditable, requestDetails?.value]);\r\n  // const cancelAction = React.useMemo(\r\n  //   () => () => (\r\n  //     <CancelServiceRequestButton\r\n  //       serviceRequestId={requestDetailsData?.Id}\r\n  //       isAdmin={isAdmin}\r\n  //     />\r\n  //   ),\r\n  //   [isAdmin, requestDetailsData?.Id],\r\n  // );\r\n  // const sendQuoteAction = React.useMemo(() => {\r\n  //   const serviceRequest = requestDetailsData;\r\n  //   if (serviceRequest === undefined) {\r\n  //     return undefined;\r\n  //   } else if (\r\n  //     !canSendQuote({ isAdmin: isAdmin, serviceRequest: serviceRequest })\r\n  //   ) {\r\n  //     return undefined;\r\n  //   } else {\r\n  //     return () => (\r\n  //       <SendQuoteButtonButton\r\n  //         isAdmin={isAdmin}\r\n  //         serviceRequest={serviceRequest}\r\n  //       />\r\n  //     );\r\n  //   }\r\n  // }, [isAdmin, requestDetailsData]);\r\n\r\n  const rightTopActions: ActionRenderer[] = React.useMemo(\r\n    () => [\r\n      () => (\r\n        <TopActionButton\r\n          variant=\"white\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          startIcon=\"print\"\r\n          icon=\"print\"\r\n          aria-label=\"history\"\r\n          onClick={handlePrintToPDF}\r\n          noChangeOnMobile\r\n          text={t(translations.PrintPdf)}\r\n          title={\r\n            requestDetailsData?.Status.InternalStatusId === 'Draft'\r\n              ? t(translations.PleaseSubmitRequestFirstInOrderToPrint)\r\n              : t(translations.PrintPdf)\r\n          }\r\n          disabled={requestDetailsData?.Status.InternalStatusId === 'Draft'}\r\n        />\r\n      ),\r\n      () => (\r\n        <TopActionButton\r\n          variant=\"ghost\"\r\n          size=\"small\"\r\n          shape=\"square\"\r\n          startIcon=\"history\"\r\n          icon=\"history\"\r\n          aria-label=\"history\"\r\n          href={buildURL(`/ServiceRequestAuditTrailHistory.aspx`, {\r\n            requestId: requestDetailsData?.Id,\r\n          })}\r\n          target=\"_blank\"\r\n          noChangeOnMobile\r\n          text={t(translations.ModificationsHistory)}\r\n          title={t(translations.ModificationsHistory)}\r\n        />\r\n      ),\r\n      () =>\r\n        requestDetailsData?.Id !== undefined && (\r\n          <TopActionButton\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            shape=\"square\"\r\n            startIcon=\"history\"\r\n            icon=\"history\"\r\n            aria-label=\"history\"\r\n            href={getNotificationsLogPageLocation({\r\n              NotificationTypeId: 'Request',\r\n              ReferenceId: requestDetailsData?.Id,\r\n            })}\r\n            noChangeOnMobile\r\n            text={t(translations.menu_EmailNotifications)}\r\n            title={t(translations.menu_EmailNotifications)}\r\n          />\r\n        ),\r\n      () => <CloneServiceRequestButton item={requestDetailsData} />,\r\n    ],\r\n    [handlePrintToPDF, requestDetailsData, t],\r\n  );\r\n  const leftActions = React.useMemo(() => {\r\n    let actions = [] as ActionRenderer[];\r\n    if (!!requestDetailsData) {\r\n      if (isEditable) {\r\n        actions.push(() => (\r\n          <React.Fragment>\r\n            <SubmitServiceRequestButton\r\n              serviceRequest={requestDetailsData}\r\n              getRowsErrors={(hasErrors: boolean) =>\r\n                setHasRowsErrors(hasErrors)\r\n              }\r\n              disabled={\r\n                requestDetails.status === 'pending' || submittingRequest\r\n              }\r\n            />\r\n          </React.Fragment>\r\n        ));\r\n      }\r\n      if (showCancelRequest) {\r\n        actions.push(() => (\r\n          <React.Fragment>\r\n            <CancelServiceRequestButton\r\n              serviceRequestId={requestDetailsData?.Id}\r\n            />\r\n          </React.Fragment>\r\n        ));\r\n      }\r\n      if (\r\n        requestDetailsData.Service.SendQuoteToUser === true &&\r\n        isAdmin === true &&\r\n        ['InProcess', 'Draft'].includes(\r\n          requestDetailsData.Status.InternalStatusId,\r\n        )\r\n      ) {\r\n        actions.push(() => (\r\n          <React.Fragment>\r\n            <SendQuoteButtonButton serviceRequest={requestDetailsData} />\r\n          </React.Fragment>\r\n        ));\r\n      }\r\n      if (\r\n        isAdmin &&\r\n        requestDetailsData !== undefined &&\r\n        requestDetailsData?.HasFiles === true\r\n      ) {\r\n        actions.push(() => (\r\n          <DownloadAllFiles serviceRequestId={requestDetailsData.Id} />\r\n        ));\r\n      }\r\n    }\r\n    return [...actions, ...rightTopActions];\r\n  }, [\r\n    isAdmin,\r\n    isEditable,\r\n    requestDetails.status,\r\n    requestDetailsData,\r\n    rightTopActions,\r\n    showCancelRequest,\r\n    submittingRequest,\r\n  ]);\r\n  const handleClosePrintToPDF = React.useCallback(() => {\r\n    setPrint(false);\r\n  }, []);\r\n\r\n  const handleCloseClick = React.useCallback(() => {\r\n    if (useSidePanel) {\r\n      dispatch(layoutActions.resetSidePanel());\r\n      dispatch(layoutActions.setRefreshTable(true));\r\n    } else {\r\n      dispatch(push('/ServiceRequests'));\r\n    }\r\n    dispatch(actions.resetRequestDetails());\r\n  }, [actions, dispatch, useSidePanel]);\r\n\r\n  const handleSubmit = React.useCallback(\r\n    async (values: IServiceRequestDetailsFormModel) => {\r\n      if (requestDetailsData === undefined) {\r\n        return;\r\n      }\r\n      dispatch(actions.submitStep({ ...requestDetailsData, ...values }));\r\n    },\r\n    [actions, dispatch, requestDetailsData],\r\n  );\r\n\r\n  const closeCover = () => dispatch(actions.setCover(undefined));\r\n  const rightActions = React.useMemo(() => {\r\n    return [\r\n      () => (\r\n        <React.Fragment>\r\n          <Button\r\n            variant=\"ghost\"\r\n            size=\"small\"\r\n            startIcon={<Icon icon=\"times\" />}\r\n            onClick={handleCloseClick}\r\n          >\r\n            {t(translations.Close)}\r\n          </Button>\r\n        </React.Fragment>\r\n      ),\r\n    ] as ActionRenderer[];\r\n  }, [handleCloseClick, t]);\r\n\r\n  const openRowsSidePanel = React.useCallback(\r\n    state => {\r\n      dispatch(\r\n        actions.openSidePanel({\r\n          type: state.renderPageType,\r\n          props: state.renderPageProps,\r\n        }),\r\n      );\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n\r\n  if (requestDetails.status !== 'pending') {\r\n    if (requestDetails.error !== undefined) {\r\n      const statusCode = (requestDetails.error as AxiosError)?.response?.status;\r\n      switch (statusCode) {\r\n        case StatusCodes.NOT_FOUND:\r\n          return <NotFoundPage />;\r\n      }\r\n    }\r\n  }\r\n  const getTitle = (addonType?: AddonTypesUnion) => {\r\n    if (addonType === undefined) {\r\n      return undefined;\r\n    }\r\n    switch (addonType) {\r\n      case 'Milestones':\r\n        return t(translations.Milestones);\r\n      case 'Addons':\r\n      case 'UserAddons':\r\n        return t(translations.AddonCharges);\r\n      case 'NA':\r\n        return undefined;\r\n\r\n      default:\r\n        assertExhaustive(addonType);\r\n    }\r\n  };\r\n  const sectionStyles = {\r\n    background: bookitColors.base.white,\r\n    border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n    borderRadius: 12,\r\n    padding: '20px 24px 24px 24px',\r\n    width: '100%',\r\n  };\r\n\r\n  if (requestDetailsData === undefined) {\r\n    // nothing to show if the request details are empty but it's neither processing nor errored but the data for whatever reason is still not there\r\n    return null;\r\n  }\r\n  const title = getServiceRequestTitle(requestDetailsData);\r\n  const loading = requestDetails.status === 'pending';\r\n  const cover =\r\n    useSidePanel === false ? undefined : sidePanel?.type ===\r\n      RenderPageType.ServiceRequestMilestone ? (\r\n      <ServiceRequestMilestoneDetails\r\n        {...(sidePanel.props as ServiceRequestMilestoneDetailsProps)}\r\n      />\r\n    ) : sidePanel?.type === RenderPageType.ServiceRequestMilestoneCharge ? (\r\n      <ServiceRequestMilestoneChargeDetails\r\n        {...(sidePanel.props as ServiceRequestMilestoneChargeDetailsProps)}\r\n      />\r\n    ) : sidePanel?.type === RenderPageType.ReservationDetails ? (\r\n      <ReservationDetails\r\n        {...({\r\n          closeCover: () => {\r\n            closeCover();\r\n            dispatch(\r\n              actions.loadServiceRequestRows({\r\n                serviceRequestId: id,\r\n                state: {\r\n                  pageIndex: 0,\r\n                  pageSize: 10,\r\n                },\r\n              }),\r\n            );\r\n          },\r\n          onCloseReservation: () => {\r\n            closeCover();\r\n            dispatch(\r\n              actions.loadServiceRequestRows({\r\n                serviceRequestId: id,\r\n                state: {\r\n                  pageIndex: 0,\r\n                  pageSize: 10,\r\n                },\r\n              }),\r\n            );\r\n          },\r\n          ...sidePanel.props,\r\n        } as ReservationDetailsProps)}\r\n      />\r\n    ) : undefined;\r\n\r\n  return (\r\n    <>\r\n      <Formik\r\n        validateOnChange={true}\r\n        validationSchema={schema}\r\n        validateOnMount={false}\r\n        enableReinitialize\r\n        initialValues={serviceRequestFormData}\r\n        onSubmit={handleSubmit}\r\n      >\r\n        {formik => (\r\n          <PageWrapper\r\n            topProcessing={\r\n              requestDetails.status === 'pending' || submittingRequest\r\n            }\r\n            loading={loading}\r\n            pageName={t(translations.ServiceRequest)}\r\n            titlePage={title}\r\n            pageLink={GetServiceRequestDetailsPath(requestDetailsData?.Id)}\r\n            toPageLink={GetServiceRequestDetailsPath(requestDetailsData?.Id)}\r\n            closable\r\n            disableExpandToggle\r\n            hideTitleBar={false}\r\n            useSidePanel={useSidePanel}\r\n            rightTopActions={rightTopActions}\r\n            leftActions={leftActions}\r\n            leftActionsMaxLength={2}\r\n            rightActions={rightActions}\r\n            closeSidePanel={handleCloseClick}\r\n            cover={cover}\r\n            closeCover={closeCover}\r\n          >\r\n            <PrintToPDF\r\n              title={''}\r\n              print={print}\r\n              printTitle={title}\r\n              useSections={true}\r\n              close={handleClosePrintToPDF}\r\n              saveMarkedSections={true}\r\n            >\r\n              <Box\r\n                style={{\r\n                  display: 'flex',\r\n                  flexDirection: 'column',\r\n                  padding: '32px 0px',\r\n                  gap: '32px',\r\n                }}\r\n              >\r\n                {print ? (\r\n                  <Box style={{ paddingLeft: '32px' }}>\r\n                    <Body bold={true} color=\"secondary\">\r\n                      {t(translations.ServiceRequest)}\r\n                    </Body>\r\n                    <H4>{title}</H4>\r\n                  </Box>\r\n                ) : (\r\n                  <></>\r\n                )}\r\n                {isEditable && (\r\n                  <QuoteSentToUserAlert\r\n                    ServiceRequestId={requestDetailsData.Id}\r\n                    ServiceRequestInternalStatus={\r\n                      requestDetailsData.Status.InternalStatusId\r\n                    }\r\n                  />\r\n                )}\r\n\r\n                {/* <ErrorsSummuryAlert errors={formik.errors} /> */}\r\n                {requestDetailsData !== undefined && (\r\n                  <PrintPDFSection print={print} id=\"SubmissionsDetails\">\r\n                    <ServiceRequestSubmissionDetails\r\n                      requestDetails={requestDetailsData}\r\n                      isOwner={isOwner}\r\n                      isAdmin={isAdmin}\r\n                      sectionStyles={sectionStyles}\r\n                    />\r\n                  </PrintPDFSection>\r\n                )}\r\n\r\n                {customFormFields.length > 0 && (\r\n                  <PrintPDFSection print={print} id=\"RequestForm_Table\">\r\n                    <StyledFormFieldsContainer>\r\n                      <ServiceRequestCustomForm\r\n                        serviceRequestId={requestDetailsData?.Id}\r\n                        customForm={requestDetailsData?.Service.CustomForm}\r\n                        isAdmin={isAdmin}\r\n                        sectionStyles={sectionStyles}\r\n                        disabled={!isEditable}\r\n                        allowUserUpload={requestDetailsData?.AllowUserUpload}\r\n                        {...formik}\r\n                      />\r\n                    </StyledFormFieldsContainer>\r\n                  </PrintPDFSection>\r\n                )}\r\n\r\n                {requestDetailsData?.Id !== undefined &&\r\n                  customFormColumns?.getArray()?.length > 0 &&\r\n                  (requestDetailsData.Service?.CustomForm\r\n                    ?.VisibleToAdminOnly !== true ||\r\n                    isAdmin === true) && (\r\n                    <PrintPDFSection print={print} id=\"RequestRows_Table\">\r\n                      <StyledFormFieldsContainer>\r\n                        <ServiceRequestRowsTable\r\n                          {...formik}\r\n                          serviceRequestId={requestDetailsData.Id}\r\n                          serviceGroups={\r\n                            !!requestDetailsData.Service.ServiceGroup\r\n                              ? [requestDetailsData.Service.ServiceGroup]\r\n                              : undefined\r\n                          }\r\n                          openSidePanel={openRowsSidePanel}\r\n                          onCreateReservation={handleCreateRowReservation}\r\n                          reservationEnabled={requestReservationEnabled}\r\n                          useSidePanel={useSidePanel}\r\n                          serviceRequestTypeId={requestDetailsData.Service.Id}\r\n                          formFields={customFormColumns}\r\n                          isEditable={isEditable}\r\n                          processing={false}\r\n                          isAdmin={isAdmin}\r\n                          hasErrors={hasRowsErrors}\r\n                          printing={{\r\n                            id: '3',\r\n                            onLoading: (id: string, loading: boolean) => {\r\n                              dispatch(\r\n                                printActions.setLoading({\r\n                                  id: id,\r\n                                  loading: loading,\r\n                                }),\r\n                              );\r\n                            },\r\n                            printing: print,\r\n                          }}\r\n                        />\r\n                      </StyledFormFieldsContainer>\r\n                    </PrintPDFSection>\r\n                  )}\r\n                {requestReservationEnabled && (\r\n                  <StyledFormFieldsContainer>\r\n                    <ServiceRequestReservations\r\n                      serviceRequestId={requestDetailsData.Id}\r\n                      tableContainerStyles={tableSectionStyles}\r\n                      openPanel={openRowsSidePanel}\r\n                      isMobile={isMobile}\r\n                      useSidePanel={useSidePanel}\r\n                      onCreateReservation={() => setReservationOpen(true)}\r\n                      isAdmin={isAdmin}\r\n                    />\r\n                  </StyledFormFieldsContainer>\r\n                )}\r\n                {samplesAutomationEnabled && (\r\n                  <StyledFormFieldsContainer>\r\n                    <SamplesTable\r\n                      isAdmin={isAdmin}\r\n                      isEditable={isEditable}\r\n                      serviceRequestId={requestDetailsData?.Id}\r\n                      // processing skeleton is shown independently above\r\n                      processing={false}\r\n                      printing={{\r\n                        id: '1',\r\n                        onLoading: (id: string, loading: boolean) => {\r\n                          dispatch(\r\n                            printActions.setLoading({\r\n                              id: id,\r\n                              loading: loading,\r\n                            }),\r\n                          );\r\n                        },\r\n                        printing: print,\r\n                      }}\r\n                      sectionStyles={tableSectionStyles}\r\n                    />\r\n                  </StyledFormFieldsContainer>\r\n                )}\r\n\r\n                {requestDetailsData !== undefined && (\r\n                  <PrintPDFSection print={print} id=\"Milestones_Services\">\r\n                    <StyledFormFieldsContainer>\r\n                      <ServiceRequestMilestonesSection\r\n                        ServiceRequestId={requestDetailsData?.Id}\r\n                        AddonType={\r\n                          requestDetailsData.Service.MilestonesAddonsType\r\n                        }\r\n                        isAdmin={isAdmin}\r\n                        InternalStatus={\r\n                          requestDetailsData.Status.InternalStatusId\r\n                        }\r\n                        pageName={getTitle(\r\n                          requestDetailsData.Service.MilestonesAddonsType,\r\n                        )}\r\n                        tableContainerStyles={tableSectionStyles}\r\n                        printing={{\r\n                          id: '2',\r\n                          onLoading: (id: string, loading: boolean) => {\r\n                            dispatch(\r\n                              printActions.setLoading({\r\n                                id: id,\r\n                                loading: loading,\r\n                              }),\r\n                            );\r\n                          },\r\n                          printing: print,\r\n                        }}\r\n                        useSidePanel={useSidePanel}\r\n                        UnitType={requestDetailsData.UnitType}\r\n                      />\r\n                    </StyledFormFieldsContainer>\r\n                  </PrintPDFSection>\r\n                )}\r\n                {requestDetailsData?.Id !== undefined && (\r\n                  <PrintPDFSection print={print} id=\"Comments\">\r\n                    <StyledFormFieldsContainer>\r\n                      <Box style={sectionStyles}>\r\n                        <ServiceRequestComments\r\n                          commentType={CommentReferenceTypes.ServiceRequest}\r\n                          referenceId={requestDetailsData?.Id}\r\n                          serviceRequestId={requestDetailsData?.Id}\r\n                          serviceGroups={\r\n                            !!requestDetailsData.Service.ServiceGroup\r\n                              ? [requestDetailsData.Service.ServiceGroup]\r\n                              : undefined\r\n                          }\r\n                          canUserEdit={\r\n                            !requestDetailsData.CommentOnEditOnly ||\r\n                            [\r\n                              InternalServiceRequestStatus[\r\n                                InternalServiceRequestStatus.Draft\r\n                              ],\r\n                              InternalServiceRequestStatus[\r\n                                InternalServiceRequestStatus.ReturnedToUser\r\n                              ],\r\n                            ].includes(\r\n                              requestDetailsData.Status.InternalStatusId,\r\n                            )\r\n                          }\r\n                          disableFileUpload={\r\n                            !requestDetailsData.AllowUserUpload\r\n                          }\r\n                        />\r\n                      </Box>\r\n                    </StyledFormFieldsContainer>\r\n                  </PrintPDFSection>\r\n                )}\r\n                {requestReservationEnabled && !!requestDetailsData && isAdmin && (\r\n                  <CreateRequestReservation\r\n                    createOpen={reservationOpen}\r\n                    onClose={handleCreateResClose}\r\n                    serviceRequestId={requestDetailsData.Id}\r\n                    gradient={requestDetailsData.Gradient}\r\n                    serviceGroupId={requestDetailsData.Service.ServiceGroup.Id}\r\n                    serviceRequestRelatedEquipments={\r\n                      requestDetailsData.ServiceRequestRelatedEquipments\r\n                    }\r\n                    userName={\r\n                      (\r\n                        requestDetailsData.CreatedFor ??\r\n                        requestDetailsData.CreatedBy\r\n                      ).Id\r\n                    }\r\n                    budgetId={\r\n                      requestDetailsData.Budget.Id === 0\r\n                        ? undefined\r\n                        : requestDetailsData.Budget.Id\r\n                    }\r\n                    requestOverheadMinutes={requestDetailsData.OverheadMinutes}\r\n                    openPanel={state => {\r\n                      dispatch(\r\n                        actions.openSidePanel({\r\n                          type: state.renderPageType,\r\n                          props: state.renderPageProps,\r\n                        }),\r\n                      );\r\n                    }}\r\n                    useSidePanel={useSidePanel}\r\n                    rows={selectedRows}\r\n                  />\r\n                )}\r\n              </Box>\r\n            </PrintToPDF>\r\n          </PageWrapper>\r\n        )}\r\n      </Formik>\r\n    </>\r\n  );\r\n}\r\nexport const tableSectionStyles = {\r\n  background: bookitColors.base.white,\r\n  border: `1px solid ${bookitColors.grayscale.grayBorders}`,\r\n  borderRadius: 12,\r\n  paddingBottom: 24,\r\n};\r\n","import { translations } from 'locales/translations';\r\nimport { TFunction } from 'i18next';\r\nimport { PrintPDFItem } from './slice/types';\r\n\r\nexport function getPrintPDFSections(\r\n  t: TFunction,\r\n  userProfileSettingsSections: string,\r\n): PrintPDFItem[] {\r\n  let sections = [\r\n    {\r\n      id: 'SubmissionsDetails',\r\n      label: t(translations.ExportPDF_SubmissionsDetails),\r\n      checked: true,\r\n    },\r\n    {\r\n      id: 'RequestForm_Table',\r\n      label: t(translations.ExportPDF_RequestForm_Table),\r\n      checked: true,\r\n    },\r\n    {\r\n      id: 'Comments',\r\n      label: t(translations.ExportPDF_Comments),\r\n      checked: true,\r\n    },\r\n    {\r\n      id: 'RequestRows_Table',\r\n      label: t(translations.ExportPDF_RequestRows_Table),\r\n      checked: true,\r\n    },\r\n    {\r\n      id: 'Milestones_Services',\r\n      label: t(translations.ExportPDF_Milestones_Services),\r\n      checked: true,\r\n    },\r\n    {\r\n      id: 'ModificationHistory',\r\n      label: t(translations.ExportPDF_ModificationHistory),\r\n      checked: false,\r\n    },\r\n  ];\r\n  if (userProfileSettingsSections.trim() !== '') {\r\n    const selected = userProfileSettingsSections.split(',');\r\n    if (selected.length > 0) {\r\n      for (const s of sections) {\r\n        const found = selected.find(f => f === s.id);\r\n        s.checked = found !== undefined;\r\n      }\r\n    }\r\n  }\r\n  return sections;\r\n}\r\n","import * as Yup from 'yup';\r\nimport { ServiceRequestTableColumnsCollection } from '../slice/utils/ServiceRequestTableColumn';\r\nimport { getSchema } from 'app/pages/Samples/components/ServiceRequestRowsTable/getServiceRequestRowSchema';\r\nimport { IFormFieldDto } from 'api/odata/generated/entities/IFormFieldDto';\r\nimport { getFieldSchema } from 'app/components/CustomForm/CustomFormUtils';\r\nimport { chain } from 'lodash';\r\n\r\nexport const getRequestDetailsSchema = (props: {\r\n  columns: ServiceRequestTableColumnsCollection | null;\r\n  fields: IFormFieldDto[];\r\n  isAdmin: boolean;\r\n  SampleManagementTablesEnabled: boolean;\r\n  ForbiddenFileExtensions: string[];\r\n  UploadFileSizeLimit: number;\r\n}) => {\r\n  const customFormSchema = Yup.object(\r\n    chain(\r\n      props.fields\r\n        .concat(({\r\n          Id: 'NA',\r\n          Active: true,\r\n          Label: 'NA',\r\n        } as unknown) as IFormFieldDto)\r\n        .filter(f => f.Active),\r\n    )\r\n      .keyBy(f => f.Id)\r\n      .mapValues(field =>\r\n        getFieldSchema(\r\n          field,\r\n          props.isAdmin,\r\n          props.UploadFileSizeLimit,\r\n          props.ForbiddenFileExtensions,\r\n        ),\r\n      )\r\n      .value(),\r\n  );\r\n  customFormSchema.omit(['NA']);\r\n  let result = Yup.object({\r\n    Rows:\r\n      props.columns === null\r\n        ? Yup.mixed()\r\n        : getSchema({\r\n            columns: props.columns,\r\n            isAdmin: props.isAdmin,\r\n          }).nullable(),\r\n    FormValues: customFormSchema,\r\n  });\r\n\r\n  return result;\r\n};\r\n","import { EmailTypeUnion } from 'api/odata/generated/enums/EmailType';\r\nimport { buildURL } from 'utils/url-utils';\r\nimport { NOTIFICATIONS_LOG_PAGE_PATH } from '.';\r\n\r\nexport const getNotificationsLogPageLocation = (props: {\r\n  NotificationTypeId: EmailTypeUnion;\r\n  ReferenceId: number;\r\n}): string => {\r\n  return buildURL(NOTIFICATIONS_LOG_PAGE_PATH, {\r\n    NotificationTypeId: props.NotificationTypeId,\r\n    ReferenceId: props.ReferenceId,\r\n  });\r\n};\r\n","import { IRequestDetailsModel } from './slice/types';\r\n\r\nexport function getServiceRequestTitle(\r\n  requestDetails: Partial<IRequestDetailsModel>,\r\n) {\r\n  return `#${requestDetails.Id} - ${requestDetails.Service?.Name}`;\r\n}\r\n","import {\r\n  Card,\r\n  CardActions,\r\n  CardContent,\r\n  CardHeader,\r\n  Grid,\r\n  styled,\r\n} from '@material-ui/core';\r\nimport { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';\r\nimport { ServiceRequestKanbanItemType } from '../..';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { PrioritiesUnion } from 'api/odata/generated/enums/Priorities';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { assertExhaustive } from 'utils/assertExhaustive';\r\nimport { TypeColor } from 'styles/colors/types';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { Avatar } from 'app/components/Avatar';\r\nimport { useServiceRequestsKanbanSlice } from '../../slice';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { getServiceRequestTicketTitle } from '../getServiceRequestTicketTitle';\r\nimport { ParentTicketDetailsButton } from '../ParentTicketDetailsButton';\r\nimport { selectKnownModule } from 'app/slice/selectors';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { IconName } from 'app/AllIcons';\r\n\r\nexport interface IServiceRequestCardProps {\r\n  item: ServiceRequestKanbanItemType;\r\n  dragHandleProps?: DraggableProvidedDragHandleProps;\r\n}\r\nexport function ServiceRequestCard({\r\n  item,\r\n  ...props\r\n}: IServiceRequestCardProps) {\r\n  const { t } = useTranslation();\r\n  const title = getServiceRequestTicketTitle(item);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useServiceRequestsKanbanSlice();\r\n  const handleDetailsClick = () => {\r\n    dispatch(actions.showEdit(item));\r\n  };\r\n  const samplesAutomationEnabled = useSelector(state =>\r\n    selectKnownModule(state, KnownModules.SamplesAutomation),\r\n  );\r\n\r\n  return (\r\n    <Card>\r\n      <CardHeader\r\n        title={\r\n          <>\r\n            {item.ParentTicketId !== null && (\r\n              <>\r\n                <Icon icon=\"code-branch\" />\r\n                &emsp;\r\n              </>\r\n            )}\r\n            {title}\r\n          </>\r\n        }\r\n        {...props.dragHandleProps}\r\n      />\r\n      <CardContent>\r\n        <Grid container>\r\n          <Grid item xs={6}>\r\n            <StyledCardContentRow>\r\n              {item.ServiceRequest.Service?.Name}\r\n            </StyledCardContentRow>\r\n            <StyledCardContentRow>\r\n              {item.ServiceRequest.Budget?.Name}\r\n            </StyledCardContentRow>\r\n            {samplesAutomationEnabled && (\r\n              <StyledCardContentRow>\r\n                {item.SamplesCount}\r\n                {' / '}\r\n                {item.TotalSamplesCount}\r\n              </StyledCardContentRow>\r\n            )}\r\n          </Grid>\r\n          <StyledFoo item xs={6}>\r\n            <PriorityIcon priority={item.Priority} />\r\n            <Avatar user={item.AssignedTo} />\r\n          </StyledFoo>\r\n        </Grid>\r\n      </CardContent>\r\n      <CardActions>\r\n        <Button variant=\"white\" onClick={handleDetailsClick}>\r\n          {t(translations.Details)}\r\n        </Button>\r\n        <ParentTicketDetailsButton item={item} />\r\n      </CardActions>\r\n    </Card>\r\n  );\r\n}\r\n\r\nfunction PriorityIcon({ priority = 'Medium' }: { priority?: PrioritiesUnion }) {\r\n  const getIcon = (priority: PrioritiesUnion): IconName => {\r\n    switch (priority) {\r\n      case 'Highest':\r\n        return 'chevrons-up';\r\n      case 'High':\r\n        return 'chevron-up';\r\n      case 'Low':\r\n        return 'chevron-down';\r\n      case 'Lowest':\r\n        return 'chevrons-down';\r\n      case 'Medium':\r\n        return 'equals';\r\n      default:\r\n        assertExhaustive(priority);\r\n    }\r\n  };\r\n  const getIconColor = (priority: PrioritiesUnion): TypeColor => {\r\n    switch (priority) {\r\n      case 'Highest':\r\n      case 'High':\r\n        return 'danger';\r\n\r\n      case 'Low':\r\n      case 'Lowest':\r\n        return 'primary';\r\n      case 'Medium':\r\n        return 'primary';\r\n      default:\r\n        assertExhaustive(priority);\r\n    }\r\n  };\r\n  return <Icon icon={getIcon(priority)} color={getIconColor(priority)} />;\r\n}\r\n\r\nconst StyledCardContentRow = styled('div')(({ theme }) => ({\r\n  width: '100%',\r\n  overflow: 'hidden',\r\n  whiteSpace: 'nowrap',\r\n  textOverflow: 'ellipsis',\r\n}));\r\n\r\nconst StyledFoo = styled(Grid)(({ theme }) => ({\r\n  display: 'flex',\r\n  justifyContent: 'center',\r\n  gap: theme.spacing(1),\r\n  alignItems: 'center',\r\n}));\r\n","import { Box, Paper, styled } from '@material-ui/core';\r\nimport {\r\n  DragDropContext,\r\n  Draggable,\r\n  DraggableProvidedDragHandleProps,\r\n  DropResult,\r\n  Droppable,\r\n  ResponderProvided,\r\n} from 'react-beautiful-dnd';\r\nimport { Identifiable } from 'types/common';\r\nimport { ISection } from '../../slice/types';\r\nimport { ValueChangeHandler } from 'types/ValueChangeHandler';\r\nimport { tryParseInt } from 'utils/string-utils';\r\nimport { InfiniteScroll } from 'app/components/InfiniteScroll';\r\n\r\nexport type KanbanChangeEvent = {\r\n  Id: number;\r\n  sourceIndex: number;\r\n  destinationIndex: number;\r\n  sourceSectionId: number;\r\n  destinationSectionId: number;\r\n};\r\n\r\nexport interface IKanbanProps<\r\n  TSection extends Identifiable<number>,\r\n  TItem extends Identifiable<number>\r\n> {\r\n  data: Array<ISection<TSection, TItem>>;\r\n  renderTitle: (section: ISection<TSection, TItem>) => React.ReactNode;\r\n  renderItem: (\r\n    item: TItem,\r\n    section: ISection<TSection, TItem>,\r\n\r\n    dragHandleProps?: DraggableProvidedDragHandleProps,\r\n  ) => React.ReactNode;\r\n  onChange: ValueChangeHandler<KanbanChangeEvent>;\r\n  onLoadMore: (sectionId: number) => void;\r\n}\r\nexport function Kanban<\r\n  TSection extends Identifiable<number>,\r\n  TItem extends Identifiable<number>\r\n>(props: IKanbanProps<TSection, TItem>) {\r\n  const handleDragEnd = (result: DropResult, provided: ResponderProvided) => {\r\n    console.debug(result, provided);\r\n    if (result.destination === undefined) {\r\n      return;\r\n    }\r\n    const itemId = tryParseInt(result.draggableId);\r\n    if (itemId === undefined) {\r\n      return;\r\n    }\r\n    const sourceSectionId = tryParseInt(result.source.droppableId);\r\n    if (sourceSectionId === undefined) {\r\n      return;\r\n    }\r\n    const destinationSectionId = tryParseInt(result.destination.droppableId);\r\n    if (destinationSectionId === undefined) {\r\n      return;\r\n    }\r\n    const sourceIndex = result.source.index;\r\n    if (sourceIndex === undefined) {\r\n      return;\r\n    }\r\n    const destinationIndex = result.destination.index;\r\n    if (destinationIndex === undefined) {\r\n      return;\r\n    }\r\n\r\n    props.onChange({\r\n      Id: itemId,\r\n      sourceIndex,\r\n      destinationIndex: destinationIndex,\r\n      sourceSectionId,\r\n      destinationSectionId: destinationSectionId,\r\n    });\r\n  };\r\n\r\n  const next = (sectionId: number) => {\r\n    props.onLoadMore(sectionId);\r\n  };\r\n  return (\r\n    <DragDropContext onDragEnd={handleDragEnd}>\r\n      <StyledGridContainer>\r\n        {props.data.map(section => (\r\n          <StyledColumn key={`column-${section.id}`}>\r\n            <Droppable droppableId={section.section.Id.toString()} {...props}>\r\n              {(droppableProvided, droppableSnapshot) => (\r\n                <InfiniteScroll\r\n                  hasMore={section.data?.more === true}\r\n                  scrollThreshold={0.1}\r\n                  dataLength={section.data?.items.length ?? 0}\r\n                  next={() => next(section.id)}\r\n                >\r\n                  <CardsContainer\r\n                    ref={droppableProvided.innerRef}\r\n                    id={`container_${section.section.Id}`}\r\n                    key={`container_${section.section.Id}`}\r\n                    //   isDraggingOver={droppableSnapshot.isDraggingOver}\r\n                  >\r\n                    {props.renderTitle(section)}\r\n                    {section.data !== undefined &&\r\n                      section.data.items.map((item, index) => {\r\n                        return (\r\n                          <Draggable\r\n                            key={item.Id}\r\n                            draggableId={item.Id.toString()}\r\n                            index={index}\r\n                          >\r\n                            {(\r\n                              draggableProvided,\r\n                              draggableSnapshot,\r\n                              draggableRubric,\r\n                            ) => (\r\n                              <div\r\n                                ref={draggableProvided.innerRef}\r\n                                // onMouseEnter={handleMouseEnter}\r\n                                // onMouseLeave={handleMouseLeave}\r\n                                {...draggableProvided.draggableProps}\r\n                              >\r\n                                {props.renderItem(\r\n                                  item,\r\n                                  section,\r\n                                  draggableProvided.dragHandleProps,\r\n                                )}\r\n                              </div>\r\n                            )}\r\n                          </Draggable>\r\n                        );\r\n                      })}\r\n                    {droppableProvided.placeholder}\r\n                  </CardsContainer>\r\n                </InfiniteScroll>\r\n              )}\r\n            </Droppable>\r\n          </StyledColumn>\r\n        ))}\r\n      </StyledGridContainer>\r\n    </DragDropContext>\r\n  );\r\n}\r\nconst StyledGridContainer = styled(Box)(({ theme }) => ({\r\n  marginTop: theme.spacing(2),\r\n  display: 'flex',\r\n  flexDirection: 'row',\r\n  gap: theme.spacing(2),\r\n  width: '100%',\r\n  overflowX: 'scroll',\r\n}));\r\nconst StyledColumn = styled(Box)(({ theme }) => ({\r\n  width: 323,\r\n}));\r\nconst CardsContainer = styled(Paper)(({ theme }) => ({\r\n  backgroundColor: theme.palette.background.default,\r\n  padding: theme.spacing(2),\r\n  display: 'flex',\r\n  gap: theme.spacing(2),\r\n  flexDirection: 'column',\r\n  margin: '3px',\r\n}));\r\n","/**\r\n *\r\n * ContentBox\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  createStyles,\r\n  makeStyles,\r\n  Theme,\r\n  Box,\r\n  BoxProps,\r\n} from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport clsx from 'clsx';\r\nimport { isMobile } from 'react-device-detect';\r\n\r\n/**\r\n * Provides standard spacing for direct children of FrontendLayout\r\n */\r\nexport function FrontendLayoutContentBox({ className, ...props }: BoxProps) {\r\n  const isMobile = DetectIsMobile();\r\n  const classes = useStyles({ isMobile: isMobile });\r\n  return <Box className={clsx(classes.root, className)} {...props}></Box>;\r\n}\r\n\r\nconst useStyles = makeStyles<Theme, { isMobile: boolean }>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      margin: isMobile ? theme.spacing(2, 2, 0) : theme.spacing(4, 4, 0),\r\n    },\r\n  }),\r\n);\r\n","/**\r\n *\r\n * ServiceRequestsKanbanPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport {\r\n  Box,\r\n  Chip,\r\n  createStyles,\r\n  Grid,\r\n  makeStyles,\r\n  styled,\r\n  Theme,\r\n} from '@material-ui/core';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport {\r\n  DragDropContext,\r\n  DropResult,\r\n  ResponderProvided,\r\n} from 'react-beautiful-dnd';\r\nimport { IServiceRequestStatusDto } from 'api/odata/generated/entities/IServiceRequestStatusDto';\r\nimport { ServiceRequestStatusMultiPicker } from 'app/components/pickers/AutocompletePickers/ServiceRequestStatusMultiPicker';\r\nimport { ServiceRequestCard } from './components/ServiceRequestCard';\r\nimport { TitlePage } from 'app/Layout/FrontendLayout/components/PageWrapper/components/TitlePage';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { useFilters } from 'app/components/BasicTable/withSavedHistory';\r\nimport { GetFilters, StatusFilterId } from './Filter';\r\nimport { FilterValueType } from 'app/components/BasicTable/BasicFilter/FilterValueType';\r\nimport { IServiceRequestTicketDto } from 'api/odata/generated/entities/IServiceRequestTicketDto';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useServiceRequestsKanbanSlice } from './slice';\r\nimport { selectServiceRequestsKanbanData } from './slice/selectors';\r\nimport { Kanban, KanbanChangeEvent } from './components/Kanban';\r\nimport { FrontendLayoutContentBox } from 'app/Layout/FrontendLayout/components/ContentBox';\r\nimport { InternalServiceRequestStatusesUnion } from 'enums/InternalServiceRequestStatuses';\r\n\r\nexport interface ServiceRequestsKanbanPageProps extends IBasePageProps {}\r\n\r\nexport type ServiceRequestKanbanItemType = IServiceRequestTicketDto;\r\n\r\ninterface IState {\r\n  statuses?: IServiceRequestStatusDto[];\r\n  selectedStatuses: IServiceRequestStatusDto[];\r\n  tickets: Array<ServiceRequestKanbanItemType>;\r\n}\r\nexport const ServiceRequestsKanbanPagePath = '/serviceRequests/kanban';\r\nexport interface ServiceRequestsKanbanProps extends IState {\r\n  onDragEnd: (result: DropResult, provided: ResponderProvided) => void;\r\n}\r\nexport function ServiceRequestsKanban(props: ServiceRequestsKanbanProps) {\r\n  return (\r\n    <div>\r\n      <DragDropContext onDragEnd={props.onDragEnd}>\r\n        <Grid container spacing={2}>\r\n          <Grid item xs={6}></Grid>\r\n        </Grid>\r\n      </DragDropContext>\r\n    </div>\r\n  );\r\n}\r\n\r\nconst SERVICE_REQUEST_KANBAN_IGNORED_STATUSES: Array<InternalServiceRequestStatusesUnion> = [\r\n  'Draft',\r\n  'Pending',\r\n  'ReturnedToUser',\r\n  'Cancelled',\r\n  'Completed',\r\n];\r\nexport function ServiceRequestsKanbanPage(\r\n  props: ServiceRequestsKanbanPageProps,\r\n) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const classes = useStyles({ isMobile: isMobile });\r\n  const dispatch = useDispatch();\r\n  const { actions } = useServiceRequestsKanbanSlice();\r\n  // const [state, , extendState] = useAsyncExtendedState<IState>({\r\n  //   selectedStatuses: [],\r\n  //   tickets: [],\r\n  // });\r\n\r\n  useEffectOnMount(() => {\r\n    //todo\r\n  });\r\n\r\n  const { appliedFilters, setFilterValue } = useFilters(\r\n    ServiceRequestsKanbanPagePath,\r\n    GetFilters,\r\n    undefined,\r\n    undefined,\r\n    undefined,\r\n    undefined,\r\n    undefined,\r\n    undefined,\r\n    undefined,\r\n    true,\r\n  );\r\n\r\n  const handleSelectedStatusesChange = (value: FilterValueType) => {\r\n    setFilterValue(StatusFilterId, value as FilterValueType);\r\n  };\r\n\r\n  const selectedStatuses = (appliedFilters?.find(f => f.id === StatusFilterId)\r\n    ?.value as IServiceRequestStatusDto[] | undefined)?.filter(\r\n    status =>\r\n      !SERVICE_REQUEST_KANBAN_IGNORED_STATUSES.includes(\r\n        status.InternalStatusId,\r\n      ),\r\n  );\r\n\r\n  React.useEffect(() => {\r\n    const selectedStatuses = appliedFilters?.find(f => f.id === StatusFilterId)\r\n      ?.value as IServiceRequestStatusDto[] | undefined;\r\n    dispatch(actions.setSelectedStatuses(selectedStatuses));\r\n  }, [actions, appliedFilters, dispatch]);\r\n\r\n  const kanban = useSelector(selectServiceRequestsKanbanData);\r\n  const handleChange = React.useCallback(\r\n    (value: KanbanChangeEvent) => {\r\n      dispatch(actions.reorder(value));\r\n    },\r\n    [actions, dispatch],\r\n  );\r\n  const handleMore = (sectionId: number) => {\r\n    dispatch(actions.getMoreItems(sectionId));\r\n  };\r\n\r\n  return (\r\n    <div>\r\n      <FrontendLayoutContentBox>\r\n        <TitlePage title=\"Kanban\" buttonsLenth={0} />\r\n\r\n        <StyledServiceRequestStatusMultiPicker\r\n          value={selectedStatuses}\r\n          fullWidth\r\n          onChange={handleSelectedStatusesChange}\r\n          exclude={SERVICE_REQUEST_KANBAN_IGNORED_STATUSES}\r\n        />\r\n\r\n        {kanban !== undefined && (\r\n          <Kanban\r\n            data={kanban}\r\n            renderItem={(item, section, dragHandleProps) => (\r\n              <ServiceRequestCard\r\n                item={item}\r\n                dragHandleProps={dragHandleProps}\r\n              />\r\n            )}\r\n            renderTitle={section => (\r\n              <Box>\r\n                <Chip label={section.section.Name} />\r\n              </Box>\r\n            )}\r\n            onChange={handleChange}\r\n            onLoadMore={handleMore}\r\n          />\r\n        )}\r\n      </FrontendLayoutContentBox>\r\n    </div>\r\n  );\r\n}\r\n\r\nconst useStyles = makeStyles<Theme, { isMobile: boolean }>((theme: Theme) =>\r\n  createStyles({\r\n    root: {\r\n      // root css\r\n    },\r\n  }),\r\n);\r\n\r\nconst StyledServiceRequestStatusMultiPicker = styled(\r\n  ServiceRequestStatusMultiPicker,\r\n)(({ theme }) => ({\r\n  marginTop: theme.spacing(2),\r\n}));\r\n","import { createGlobalStyle } from 'styled-components';\r\n\r\nexport const GlobalStyle = createGlobalStyle`\r\n  \r\n/* heebo-300 - latin_hebrew */\r\n@font-face {\r\n  font-family: 'Heebo';\r\n  font-style: normal;\r\n  font-weight: 300;\r\n  src: local(''),\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n/* heebo-regular - latin_hebrew */\r\n@font-face {\r\n  font-family: 'Heebo';\r\n  font-style: normal;\r\n  font-weight: 400;\r\n  src: local(''),\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n/* heebo-500 - latin_hebrew */\r\n@font-face {\r\n  font-family: 'Heebo';\r\n  font-style: normal;\r\n  font-weight: 500;\r\n  src: local(''),\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n/* heebo-700 - latin_hebrew */\r\n@font-face {\r\n  font-family: 'Heebo';\r\n  font-style: normal;\r\n  font-weight: 700;\r\n  src: local(''),\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n       url('${process.env.PUBLIC_URL}/fonts/heebo-v10-latin_hebrew-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n}\r\n\r\n   /* open-sans-regular - latin */\r\n   @font-face {\r\n    font-family: 'Open Sans';\r\n    font-style: normal;\r\n    font-weight: 400;\r\n    src: local(''),\r\n        url('${process.env.PUBLIC_URL}/fonts/open-sans-v20-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */\r\n        url('${process.env.PUBLIC_URL}/fonts/open-sans-v20-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */\r\n  }\r\n/* open-sans-hebrew */\r\n  @font-face {\r\n    font-family: 'Open Sans Hebrew', serif;\r\n    font-style: normal;\r\n    font-weight: 400;\r\n    src: local(''),\r\n        url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Regular.woff') format('woff'),\r\n        url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Regular-1.woff') format('woff'), \r\n        url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Bold.woff') format('woff'),\r\n        url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-ExtraBold.woff') format('woff'),\r\n        url('${process.env.PUBLIC_URL}/fonts/OpenSansHebrew-Light.woff') format('woff');\r\n  }\r\n`;\r\nexport const LatoStyle = createGlobalStyle`\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BoldItalic.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BoldItalic.woff') format('woff');\r\n  font-weight: bold;\r\n  font-style: italic;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BlackItalic.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-BlackItalic.woff') format('woff');\r\n  font-weight: 900;\r\n  font-style: italic;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Black.woff') format('woff');\r\n  font-weight: 900;\r\n  font-style: normal;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Bold.woff') format('woff');\r\n  font-weight: bold;\r\n  font-style: normal;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Light.woff') format('woff');\r\n  font-weight: 300;\r\n  font-style: normal;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Regular.woff') format('woff');\r\n  font-weight: normal;\r\n  font-style: normal;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-LightItalic.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-LightItalic.woff') format('woff');\r\n  font-weight: 300;\r\n  font-style: italic;\r\n  font-display: swap;\r\n}\r\n\r\n@font-face {\r\n  font-family: 'Lato', sans-serif;\r\n  src: url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Italic.woff2') format('woff2'),\r\n      url('${process.env.PUBLIC_URL}/fonts/Lato/Lato-Italic.woff') format('woff');\r\n  font-weight: normal;\r\n  font-style: italic;\r\n  font-display: swap;\r\n}\r\n`;\r\nexport const CustomStyle = createGlobalStyle`\r\n  body {\r\n    margin-bottom: env(safe-area-inset-bottom);\r\n  }\r\n  #root {\r\n    @media (max-width: 960px) {\r\n      margin-bottom: env(safe-area-inset-bottom, 50px);\r\n    }\r\n  }\r\n  :root {\r\n    --box-shadow-xs: 0px 1px 2px 0px rgba(16, 24, 40, 0.10), 0px 1px 3px 0px rgba(16, 24, 40, 0.10);\r\n    --box-shadow-s: 0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(16, 24, 40, 0.10);\r\n    --box-shadow-m: 0px 4px 4px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08);\r\n    --box-shadow-l: 0px 8px 8px -4px rgba(16, 24, 40, 0.03), 0px 20px 24px -4px rgba(16, 24, 40, 0.08);\r\n    --box-shadow-xl: 0px 24px 48px -12px rgba(16, 24, 40, 0.18);\r\n    --box-shadow-border-top: 0px 1px 0px 0px #E3E8EF inset;\r\n  }\r\n\r\n  body {\r\n    margin-bottom: env(safe-area-inset-bottom);\r\n  }\r\n\r\n  #root {\r\n    @media (max-width: 960px) {\r\n      margin-bottom: env(safe-area-inset-bottom, 50px);\r\n    }\r\n  }\r\n`;\r\n","/**\r\n * Asynchronously loads the component for NotFoundPage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NotFoundPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.NotFoundPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const FrontendLayout = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.FrontendLayout,\r\n);\r\n","import i18next from 'i18next';\r\nimport { initReactI18next } from 'react-i18next';\r\n// import LanguageDetector from 'i18next-browser-languagedetector';\r\nimport Backend from 'i18next-http-backend';\r\n\r\nimport en from './en/GRes.json';\r\nimport { convertLanguageJsonToObject } from './translations';\r\n\r\nexport const translationsJson = {\r\n  en: {\r\n    translation: en,\r\n  },\r\n};\r\n\r\n// Create the 'translations' object to provide full intellisense support for the static json files.\r\nconvertLanguageJsonToObject(en);\r\n\r\n// https://github.com/i18next/i18next-http-backend\r\nconst backendOptions = {\r\n  // path where resources get loaded from, or a function\r\n  // '/api/locales/{{lng}}/{{ns}}.json',\r\n  // returning a path:\r\n  // function(lngs, namespaces) { return customPath; }\r\n  // the returned path will interpolate lng, ns if provided like giving a static path\r\n  //\r\n  // If allowMultiLoading is false, lngs and namespaces will have only one element each,\r\n  // If allowMultiLoading is true, lngs and namespaces can have multiple elements\r\n  loadPath: function (lngs, namespaces) {\r\n    console.log('i18next-httpBackend', lngs, namespaces);\r\n    return process.env.PUBLIC_URL + '/api/locales?lng={{lng}}&ns={{ns}}';\r\n  },\r\n};\r\n\r\nexport const i18n = i18next\r\n  // use i18next-http-backend to fetch localization files from the server\r\n  .use(Backend)\r\n  // pass the i18n instance to react-i18next.\r\n  .use(initReactI18next)\r\n  // detect user language\r\n  // learn more: https://github.com/i18next/i18next-browser-languageDetector\r\n  // .use(LanguageDetector)\r\n  // init i18next\r\n  // for all options read: https://www.i18next.com/overview/configuration-options\r\n  .init({\r\n    // The whole Animals Kiosk must be localized to he\r\n    // TODO: use the system/app setting to set initial locale here\r\n    lng: 'en',\r\n    fallbackLng: 'en',\r\n    // defaultNS: 'GRes',\r\n    // fallbackNS: 'GRes',\r\n    debug:\r\n      process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test',\r\n\r\n    // defaultNS: 'tran',\r\n    appendNamespaceToMissingKey: true,\r\n    interpolation: {\r\n      escapeValue: false, // not needed for react as it escapes by default\r\n    },\r\n    backend: backendOptions,\r\n  });\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalTypes\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalTypesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalTypesPage,\r\n);\r\n","/**\r\n * This file is only need if you want to extract messages into JSON files in locales folder\r\n * AND if you are also using the object syntax instead of string syntax. \\\r\n * Check the documentation section i18n for details\r\n */\r\nimport { translations } from 'locales/translations';\r\nimport { _t } from 'utils/messages';\r\n\r\nexport const messages = {\r\n  alert: () => _t(translations.Alert, 'Alert'),\r\n  ok: () => _t(translations.OK, 'OK'),\r\n};\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.dialogAlert || initialState;\r\n\r\nexport const selectDialogAlert = createSelector([selectSlice], state => state);\r\n","/**\r\n *\r\n * Alert\r\n *\r\n */\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n  Dialog,\r\n  DialogTitle,\r\n  DialogContent,\r\n  DialogContentText,\r\n  DialogActions,\r\n  useTheme,\r\n  useMediaQuery,\r\n} from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { messages } from './messages';\r\nimport { useDialogAlertSlice } from './slice';\r\nimport { selectDialogAlert } from './slice/selectors';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nexport const DialogAlert = () => {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useDialogAlertSlice();\r\n  const { open, content } = useSelector(selectDialogAlert);\r\n  const handleClose = () => {\r\n    dispatch(actions.hideAlert());\r\n  };\r\n  const theme = useTheme();\r\n  const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\r\n\r\n  return (\r\n    <Dialog\r\n      open={open}\r\n      fullScreen={fullScreen}\r\n      onClose={handleClose}\r\n      aria-labelledby=\"alert-dialog-title\"\r\n      aria-describedby=\"alert-dialog-description\"\r\n    >\r\n      <DialogTitle id=\"alert-dialog-title\">{t(messages.alert())}</DialogTitle>\r\n      <DialogContent>\r\n        <DialogContentText id=\"alert-dialog-description\">\r\n          {content}\r\n        </DialogContentText>\r\n      </DialogContent>\r\n      <DialogActions>\r\n        <Button onClick={handleClose} color=\"primary\">\r\n          {t(messages.ok())}\r\n        </Button>\r\n      </DialogActions>\r\n    </Dialog>\r\n  );\r\n};\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SnackbarManager = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.default,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for InternalIdLoginPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InternalIdLoginPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.InternalIdLoginPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalsListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalsListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalsListPage,\r\n);\r\n","/**\r\n *\r\n * PosLayout\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nexport interface PosLayoutProps {\r\n  children: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Empty Layout optimized for touch enabled devices - medium screen size\r\n * Originally developed for a POS (large anminals - technion anm)\r\n */\r\nexport function PosLayout({ children }: PosLayoutProps) {\r\n  return (\r\n    <PosWrapper className={'pos-root'}>\r\n      <main className={'pos-content'}>{children}</main>\r\n    </PosWrapper>\r\n  );\r\n}\r\nconst PosWrapper = styled.div`\r\n  &.pos-root {\r\n    display: flex;\r\n    & .pos-content {\r\n      display: flex;\r\n      flex-direction: column;\r\n      flex-grow: 1;\r\n      height: 100dvh;\r\n      overflow: auto;\r\n    }\r\n  }\r\n`;\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalCaseConsumablesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalCaseConsumablesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalCaseConsumablesPage,\r\n);\r\n","import styled from 'styled-components/macro';\r\n\r\nexport const FlexColumnDiv = styled.div`\r\n  display: flex;\r\n  flex-direction: column;\r\n  align-items: center;\r\n  justify-content: center;\r\n`;\r\n","/**\r\n *\r\n * LoginLayout\r\n *\r\n */\r\nimport { Copyright } from 'app/components/Copyright';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { makeStyles, Theme, useTheme } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport {\r\n  AppBar,\r\n  Box,\r\n  ListItemIcon,\r\n  ListItemText,\r\n  MenuItem,\r\n  Toolbar,\r\n} from '@material-ui/core';\r\nimport { BookitlabLogo } from 'app/components/BookitlabLogo';\r\nimport { FlexColumnDiv } from '../../components/basic/Wrappers/FlexWrappers/flexColumn';\r\nimport { StyledUserMenu } from '../FrontendLayout/components/TopBar/styled';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { translations } from 'locales/translations';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\n\r\nexport interface LoginLayoutProps {\r\n  children: React.ReactNode;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n  root: {\r\n    flexGrow: 1,\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    minHeight: '100dvh',\r\n  },\r\n  main: {\r\n    //marginTop: theme.spacing(3),\r\n    flexGrow: 1,\r\n  },\r\n  mainWrapper: {\r\n    height: '80dvh',\r\n  },\r\n  footer: {},\r\n  paper: {\r\n    //marginTop: theme.spacing(8),\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    alignItems: 'center',\r\n    minWidth: '40%',\r\n    '& p,h1': {\r\n      padding: theme.spacing(1),\r\n    },\r\n  },\r\n  avatar: {\r\n    margin: theme.spacing(1),\r\n    backgroundColor: theme.palette.secondary.main,\r\n  },\r\n  form: {\r\n    width: '100%', // Fix IE 11 issue.\r\n    marginTop: theme.spacing(1),\r\n  },\r\n  submit: {\r\n    margin: theme.spacing(3, 0, 2),\r\n  },\r\n}));\r\n\r\nexport function LoginLayout({ children }: LoginLayoutProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\r\n  const theme = useTheme();\r\n  const handleClick = (event: React.MouseEvent<HTMLElement>) => {\r\n    setAnchorEl(event.currentTarget);\r\n  };\r\n  const handleClose = () => {\r\n    setAnchorEl(null);\r\n  };\r\n  const classes = useStyles();\r\n  return (\r\n    <div className={classes.root}>\r\n      <AppBar color=\"default\" elevation={0} position=\"relative\">\r\n        <Toolbar>\r\n          <Box onClick={event => handleClick(event)}>\r\n            <BookitlabLogo />\r\n          </Box>\r\n          <LogoMenu\r\n            anchorEl={anchorEl}\r\n            handleClose={handleClose}\r\n            theme={theme}\r\n          />\r\n        </Toolbar>\r\n      </AppBar>\r\n      <Container component=\"main\" className={classes.main}>\r\n        <FlexColumnDiv className={classes.mainWrapper}>\r\n          <Box className={classes.paper}>{children}</Box>\r\n          {/* <Paper variant='outlined' ></Paper> */}\r\n        </FlexColumnDiv>\r\n      </Container>\r\n      <Container component=\"footer\" className={classes.footer}>\r\n        <Copyright />\r\n      </Container>\r\n    </div>\r\n  );\r\n}\r\n\r\nexport interface LogoMenuProps {\r\n  anchorEl: HTMLElement | null;\r\n  handleClose: () => void;\r\n  theme: Theme;\r\n}\r\nconst LogoMenu = React.memo(function LogoMenuFunc(props: LogoMenuProps) {\r\n  const { t } = useTranslation();\r\n  const isMobile = DetectIsMobile();\r\n  return (\r\n    <>\r\n      <StyledUserMenu\r\n        theme={props.theme}\r\n        marginThreshold={1}\r\n        id=\"user-profile-menu\"\r\n        anchorEl={props.anchorEl}\r\n        getContentAnchorEl={null}\r\n        anchorOrigin={{\r\n          vertical: 'bottom',\r\n          horizontal: 'left',\r\n        }}\r\n        open={Boolean(props.anchorEl)}\r\n        PaperProps={\r\n          isMobile\r\n            ? {\r\n                style: {\r\n                  width: '100%',\r\n                  height: '100%',\r\n                  maxHeight: 'calc(100% - 32px)',\r\n                  maxWidth: 'calc(100% - 0px)',\r\n                },\r\n              }\r\n            : undefined\r\n        }\r\n        onClose={() => props.handleClose()}\r\n      >\r\n        <MenuItem\r\n          onClick={() => props.handleClose()}\r\n          component={'a'}\r\n          href={toRootedURL('/account/signout')}\r\n        >\r\n          <ListItemIcon>\r\n            <Icon icon=\"sign-out-alt\" color=\"default\" colorExtend=\"textHover\" />\r\n          </ListItemIcon>\r\n          <ListItemText>\r\n            {t(translations.main_master_LogOutLinkText)}\r\n          </ListItemText>\r\n        </MenuItem>\r\n      </StyledUserMenu>\r\n    </>\r\n  );\r\n});\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalsHomePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalsHomePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalsHomePage,\r\n);\r\n","/**\r\n *\r\n * PrivateAnimalRoute\r\n *\r\n */\r\nimport { selectInternalIdLogin } from 'app/pages/Animals/InternalIdLoginPage/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { Redirect, Route, RouteProps, useLocation } from 'react-router';\r\nimport { useInternalIdLoginSlice } from '../InternalIdLoginPage/slice';\r\n\r\nexport interface PrivateAnimalRouteProps extends RouteProps {}\r\n\r\nexport function PrivateAnimalRoute(props: PrivateAnimalRouteProps) {\r\n  const login = useSelector(selectInternalIdLogin);\r\n  const location = useLocation();\r\n  const isAuthenticated = login.identity?.Id !== undefined;\r\n  const isInitialized = login.initialized;\r\n  const dispatch = useDispatch();\r\n  const { actions } = useInternalIdLoginSlice();\r\n  React.useEffect(() => {\r\n    if (!isInitialized) {\r\n      dispatch(actions.init({ isLargeAnimals: true }));\r\n    }\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, []);\r\n  if (!isInitialized) {\r\n    return <>Inintializing...</>;\r\n  }\r\n  if (isAuthenticated) {\r\n    return <Route {...props} />;\r\n  } else {\r\n    return (\r\n      <Route {...props}>\r\n        <Redirect\r\n          to={`/internalidlogin?return=${encodeURIComponent(\r\n            location.pathname,\r\n          )}`}\r\n        />\r\n      </Route>\r\n    );\r\n  }\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for CreateNewCasePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CreateNewCasePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CreateNewCasePage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SamplesListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SamplesListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SamplesListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for RunPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RunDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.RunDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for RequestSamplesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RequestSamplesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.RequestSamplesPage,\r\n);\r\n\r\nexport const RequestDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.RequestDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for TrainingSessionsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const TrainingSessionsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.TrainingSessionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Buildings Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BuildingsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BuildingsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Reservations History Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const History = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.HistoryPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AddNewReportPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AddNewReportPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for WaitingListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const TrainingWaitingListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.TrainingWaitingListPage,\r\n);\r\n","import { createBrowserHistory } from 'history';\r\n\r\nexport const history = createBrowserHistory({\r\n  basename: process.env.PUBLIC_URL,\r\n});\r\n","/**\r\n *\r\n * Asynchronously loads the component for EmailNotifications\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const EmailNotificationsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.EmailNotificationsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ExperimentTemplates\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ExperimentTemplatesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ExperimentTemplatesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UsersHistory\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UsersHistoryPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.UsersHistory,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UserTrainingPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserTrainingPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.UserTrainingPage,\r\n);\r\n","/*\r\n * Asynchronously loads the component for NotAvailable\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NotAvailable = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.NotAvailable,\r\n);\r\n","/**\r\n *\r\n * RestrictedRoute\r\n *\r\n */\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectSiteMapProvider,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router';\r\nimport { RouteProps, Redirect, Route } from 'react-router-dom';\r\n\r\nexport function RestrictedRoute(props: RouteProps): React.ReactElement {\r\n  const User = useSelector(selectAuthenticatedUser);\r\n  const { pathname } = useLocation();\r\n  const siteMapProvider = useSelector(selectSiteMapProvider);\r\n\r\n  const { component: Component, ...rest } = props;\r\n\r\n  const render = propss => {\r\n    let allowedNode = siteMapProvider.accesibleByRole(pathname, User);\r\n    if (allowedNode === false) {\r\n      return <Redirect to={'/notavailable'} />;\r\n    } else if (allowedNode === true) {\r\n      return <Route component={props.component} {...props} />;\r\n    } else {\r\n      return undefined;\r\n    }\r\n  };\r\n  return <Route {...rest} render={render} />;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for Users Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Users = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.UsersPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalExtendedBillingReportPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalExtendedBillingReportPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalExtendedBillingReportPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for User Training (Modification) History Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserTrainingHistoryPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.UserTrainingHistory,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for OtherService Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const OtherServicesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.OtherServicesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BudgetsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BudgetsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BudgetsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Reservations History Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ServiceRequestPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ServiceRequestListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for WorkOrders Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const WorkOrdersPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.WorkOrders,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const DocumentsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.DocumentsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for QuizPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const QuizPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.QuizPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for QuizDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const QuizDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.QuizDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CreateUserTrainingPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserTrainingDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.TrainingDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SampleModificationsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SampleModificationsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SampleModificationsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UsageHistory Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UsageHistory = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.UsageHistoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for RunsListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RunsListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.RunsListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalCasesHistoryPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalCasesHistoryPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalCasesHistoryPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SendEmailToUsersPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SendEmailToUsers,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Charges Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Charges = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ChargesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for MyAssetsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const MyAssetsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.MyAssetsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Locations Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Locations = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LocationsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Building Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BuildingPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BuildingPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Campuses Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CampusesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CampusesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Areas Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AreasPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AreasPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationList Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LocationListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LocationListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationList Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubLocationListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SubLocationListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for InvoiceBatches Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InvoiceBatches = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.InvoiceBatchesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CategoriesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CategoriesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CategoriesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CategoryGroupsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CategoryGroupsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CategoryGroupsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingPreviewPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BillingPreviewPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BillingPreviewPage,\r\n);\r\n","import { createSelector } from '@reduxjs/toolkit';\r\n\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) =>\r\n  state.onlineBudgetsStatus || initialState;\r\n\r\nexport const selectOnlineBudgetsStatus = createSelector(\r\n  [selectSlice],\r\n  state => state,\r\n);\r\n\r\nexport const selectOnlineBudgetsStatusTableState = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.tableState,\r\n);\r\nexport const selectOnlineBudgetsStatusSelected = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.selected,\r\n);\r\nexport const selectPayState = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.pay,\r\n);\r\n\r\nexport const selectGenerateInvoicesState = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.generateInvoicesState,\r\n);\r\nexport const selectChargeOnlineBudgetsState = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.charge,\r\n);\r\nexport const selectEndDate = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.endDate,\r\n);\r\n\r\nexport const selectIGenerateInvoicesAndSendToSapState = createSelector(\r\n  [selectOnlineBudgetsStatus],\r\n  state => state.generateInvoicesAndSendToSap,\r\n);\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, select, takeLatest, takeLeading } from 'redux-saga/effects';\r\nimport { onlineBudgetsStatusActions as actions } from '.';\r\nimport { appSettingsActions } from 'app/slice';\r\nimport { translations } from 'locales/translations';\r\nimport i18next from 'i18next';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { IODataQueryResponse } from 'api/odata/IODataQueryResponse';\r\nimport { AxiosError } from 'axios';\r\nimport { selectEndDate } from './selectors';\r\nimport { SnackBarActionType } from 'app/Layout/FrontendLayout/components/Snackbar/types';\r\nimport { IPaymentPayload, PaymentApi } from 'api/PaymentApi';\r\nimport {\r\n  ChargeOnlineBudgetResponse,\r\n  IPayActionPayload,\r\n  PaymentMethods,\r\n} from './types';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport {\r\n  BillingPreviewApi,\r\n  UpdateModel,\r\n} from 'app/pages/BillingPreviewPage/Actions/Apis';\r\nimport { getPeriodTypesEntity } from 'app/components/DatePeriods';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { layoutActions } from 'app/Layout/FrontendLayout/slice';\r\nimport { ExportToExcel } from 'utils/ExportToExcel';\r\n\r\nfunction* doGetTableData(action: PayloadAction<{ endDate: Date }>) {\r\n  try {\r\n    const response: IODataQueryResponse<IInvoiceBudgetBalanceDto> = yield call(\r\n      httpClient.get,\r\n      '/api/odata/v4/InvoiceBudgetBalances',\r\n      {\r\n        endDate: action.payload.endDate,\r\n      },\r\n    );\r\n    yield put(actions.getTableData_Success(response.value));\r\n  } catch (error: unknown) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        message: i18next.t(translations.errormessage),\r\n        variant: 'error',\r\n      }),\r\n    );\r\n    yield put(actions.getTableData_Error(Error));\r\n  }\r\n}\r\n\r\nfunction* doGenerateInvoices(action: PayloadAction<{ endDate: Date }>) {\r\n  try {\r\n    const api = new BillingPreviewApi();\r\n    const payload: UpdateModel = {\r\n      Item: {\r\n        ServiceGroupsCsv: '',\r\n        UserGroupsCsv: '',\r\n        PeriodType: getPeriodTypesEntity('CustomDate')?.Id,\r\n        Start: new Date(\r\n          dateUtils.addYears(action.payload.endDate, -2),\r\n        ).toISOString(),\r\n        End: new Date(action.payload.endDate).toISOString(),\r\n        Remarks: '',\r\n        BudgetIds: [],\r\n        BudgetIncluded: true,\r\n        invoiceBy: undefined,\r\n        CoreInvoiceBy: '',\r\n        InvoiceCreatedBy: '',\r\n        InvoiceVat: '',\r\n        FundingTypeId: undefined,\r\n        CoreBy: 0,\r\n        ShowZeroAmountInvoices: false,\r\n        ShowInvoicePartialEvents: false,\r\n      },\r\n      Async: false,\r\n      Recalculate: false,\r\n    };\r\n\r\n    const result: IResponseType = yield call(api.FormView1_UpdateItem, payload);\r\n    for (const message of result.SuccessMessages) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'success',\r\n          message: message,\r\n        }),\r\n      );\r\n    }\r\n    for (const message of result.WarningMessages) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'warning',\r\n          message: message,\r\n        }),\r\n      );\r\n    }\r\n    for (const message of result.ErrorMessages) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: message,\r\n        }),\r\n      );\r\n    }\r\n\r\n    yield put(actions.generateInvoices_Success());\r\n    yield put(actions.getTableData({ endDate: action.payload.endDate }));\r\n  } catch {\r\n    yield put(actions.generateInvoices_Error());\r\n  }\r\n}\r\n\r\nfunction* doChargeOnlineBudgets(\r\n  action: PayloadAction<IInvoiceBudgetBalanceDto[]>,\r\n) {\r\n  const endDate = yield select(selectEndDate);\r\n  if (endDate == null) {\r\n    return;\r\n  }\r\n  const url = '/api/odata/v4/InvoiceBudgetBalances';\r\n  const processed: IInvoiceBudgetBalanceDto[] = [];\r\n  const errorMessages: string[] = [];\r\n  const messageKey = 'chargeOnlineBudgets';\r\n  for (let index = 0; index < action.payload.length; index++) {\r\n    const charge = action.payload[index];\r\n    yield put(actions.chargeOnlineBudgets_SetCurrentRecord(charge));\r\n    yield put(\r\n      actions.chargeOnlineBudgets_SetStatus(\r\n        (100 * (index + 1)) / action.payload.length,\r\n      ),\r\n    );\r\n    try {\r\n      const response: ChargeOnlineBudgetResponse = yield call(\r\n        httpClient.post,\r\n        url,\r\n        charge,\r\n        { params: { endDate: endDate } },\r\n      );\r\n      let success = response.SuccessTransactionsCount === 1;\r\n      if (success) {\r\n        processed.push(charge);\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'success',\r\n            key: messageKey,\r\n            //todo: add to gres\r\n\r\n            message: `Successfully processed ${charge.HostBudgetNumber} ${charge.ServiceGroup}`,\r\n          }),\r\n        );\r\n      }\r\n\r\n      for (const message of response.Messages) {\r\n        errorMessages.push(\r\n          `${charge.UserGroup} ${charge.Budget} ${charge.ServiceGroup}: ${message}`,\r\n        );\r\n        yield put(\r\n          appSettingsActions.addNotification({\r\n            variant: 'error',\r\n            key: messageKey,\r\n            message: message,\r\n          }),\r\n        );\r\n      }\r\n    } catch (error) {\r\n      //todo: extract error message from error response\r\n      const errorMessage = (error as AxiosError)?.response?.data?.error.message;\r\n      yield put(actions.chargeOnlineBudgets_Error([errorMessage]));\r\n      return;\r\n    }\r\n  }\r\n  yield put(actions.chargeOnlineBudgets_SetCurrentRecord(undefined));\r\n  yield put(actions.chargeOnlineBudgets_Success(processed));\r\n  yield put(\r\n    appSettingsActions.addNotification({\r\n      key: messageKey,\r\n      variant:\r\n        processed.length === action.payload.length\r\n          ? 'success'\r\n          : processed.length === 0\r\n          ? 'error'\r\n          : 'warning',\r\n      message: `Processed successfully ${processed.length} out of ${action.payload.length}`,\r\n    }),\r\n  );\r\n  if (errorMessages.length === 0) {\r\n    yield put(actions.chargeOnlineBudgets_SetDialogOpen(false));\r\n  }\r\n  if (errorMessages.length > 0) {\r\n    yield put(actions.chargeOnlineBudgets_Error(errorMessages));\r\n  }\r\n  // refresh table only if any of the rows were processed successfully\r\n  if (processed.length > 0) {\r\n    // yield put(actions.getTableData({ endDate: endDate }));\r\n\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        key: 'updatedSuccess',\r\n        message: i18next.t(translations.ProcessingFinished),\r\n        variant: 'success',\r\n      }),\r\n    );\r\n    yield put(layoutActions.setRefreshTable(true));\r\n  }\r\n}\r\nfunction* doDownloadChargeOnlineBudgetsErrors(\r\n  action: PayloadAction<string[] | undefined>,\r\n) {\r\n  if (action.payload !== undefined) {\r\n    var fields = ['Errors'];\r\n    const x = new ExportToExcel('Errors');\r\n    x.AddWorkSheetHeader(fields);\r\n    x.AddWorkSheetData(action.payload.map(err => ({ errors: err })));\r\n    yield call(x.ExportToExcel, 'errors', x.book);\r\n  }\r\n}\r\nfunction* doPay(action: PayloadAction<IPayActionPayload>) {\r\n  const paymentDate = new Date();\r\n  const payments = action.payload.Rows.map(balanceRow =>\r\n    JSON.parse(balanceRow.Invoices ?? '[]').map(invoice => {\r\n      const payment: IPaymentPayload = {\r\n        InvoiceId: invoice.Id ?? undefined,\r\n        Method: {\r\n          Id: action.payload.PaymentMethod,\r\n          Name: PaymentMethods[action.payload.PaymentMethod],\r\n        },\r\n        Amount: invoice.Charges - invoice.Payments,\r\n        Budget: toEntity(balanceRow.BudgetId, balanceRow.Budget),\r\n        Date: paymentDate,\r\n        ServiceGroup: toEntity(\r\n          balanceRow.ServiceGroupId,\r\n          balanceRow.ServiceGroup,\r\n        ),\r\n        ShouldCloseInvoice: true,\r\n      };\r\n      return payment;\r\n    }),\r\n  )\r\n    .reduce((accumulator, value) => accumulator?.concat(value ?? []), [])\r\n    ?.filter(payment => payment.Amount !== undefined && payment.Amount > 0);\r\n  if (payments === undefined) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: i18next.t(translations.AnErrorOccurred),\r\n        actionType: SnackBarActionType.refreshTable,\r\n      }),\r\n    );\r\n    return;\r\n  }\r\n\r\n  const messages: IResponseType[] = [];\r\n  for (const [index, payment] of payments.entries()) {\r\n    try {\r\n      const result: IResponseType = yield call(PaymentApi.AddPayment, payment);\r\n      yield put(actions.pay_setStatus((100 * (index + 1)) / payments.length));\r\n      messages.push(result);\r\n    } catch (error) {\r\n      yield put(\r\n        appSettingsActions.addNotification({\r\n          variant: 'error',\r\n          message: (error as AxiosError).response?.data?.error?.message,\r\n          actionType: SnackBarActionType.refreshTable,\r\n        }),\r\n      );\r\n      yield put(actions.pay_Finish([]));\r\n      return;\r\n    }\r\n  }\r\n  yield put(actions.pay_Finish(messages));\r\n  const success =\r\n    messages.filter(\r\n      message =>\r\n        message.SuccessMessages.length > 0 &&\r\n        message.ErrorMessages.length === 0,\r\n    ).length === payments.length;\r\n  if (success) {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'success',\r\n        message: i18next.t(translations.PaymentCreatedSuccess),\r\n      }),\r\n    );\r\n    yield put(layoutActions.setRefreshTable(true));\r\n  }\r\n}\r\n\r\nfunction* doGenerateSelectedInvoices(\r\n  action: PayloadAction<{\r\n    endDate: Date;\r\n    selected: IInvoiceBudgetBalanceDto[];\r\n    chargeOnlineBudgets: boolean;\r\n  }>,\r\n) {\r\n  const result: IResponseType = {\r\n    SuccessMessages: [],\r\n    ErrorMessages: [],\r\n    WarningMessages: [],\r\n  };\r\n  try {\r\n    for (const [index, item] of action.payload.selected.entries()) {\r\n      yield put(\r\n        actions.GenerateInvoicesAndChargeOnlineBudgets_SetCurrentRecord(item),\r\n      );\r\n      yield put(\r\n        actions.GenerateInvoicesAndChargeOnlineBudgets_SetProgress(\r\n          Math.floor((100 * index) / action.payload.selected.length),\r\n        ),\r\n      );\r\n      const api = new BillingPreviewApi();\r\n      const payload: UpdateModel = {\r\n        Item: {\r\n          ServiceGroupsCsv: item.ServiceGroupId.toString(),\r\n          PeriodType: getPeriodTypesEntity('CustomDate')?.Id,\r\n          Start: new Date(\r\n            dateUtils.addYears(action.payload.endDate, -2),\r\n          ).toISOString(),\r\n          End: new Date(action.payload.endDate).toISOString(),\r\n          Remarks: '',\r\n          BudgetIds: [item.BudgetId],\r\n          BudgetIncluded: true,\r\n          invoiceBy: undefined,\r\n          CoreInvoiceBy: '',\r\n          InvoiceCreatedBy: '',\r\n          InvoiceVat: '',\r\n          FundingTypeId: undefined,\r\n          CoreBy: 0,\r\n          ShowZeroAmountInvoices: false,\r\n          ShowInvoicePartialEvents: false,\r\n        },\r\n        Async: false,\r\n        Recalculate: false,\r\n      };\r\n\r\n      const response: IResponseType = yield call(\r\n        api.FormView1_UpdateItem,\r\n        payload,\r\n      );\r\n      Object.keys(result).forEach(key =>\r\n        response[key].forEach(message => result[key].push(message)),\r\n      );\r\n    }\r\n  } catch {\r\n    yield put(\r\n      appSettingsActions.addNotification({\r\n        variant: 'error',\r\n        message: 'An error occurred',\r\n      }),\r\n    );\r\n    yield put(actions.GenerateSelectedInvoices_Error());\r\n    return;\r\n  }\r\n  yield put(actions.GenerateSelectedInvoices_Success());\r\n  if (action.payload.chargeOnlineBudgets) {\r\n    yield put(actions.chargeOnlineBudgets(action.payload.selected));\r\n  }\r\n}\r\n\r\nexport function* onlineBudgetsStatusSaga() {\r\n  yield takeLatest(actions.getTableData.type, doGetTableData);\r\n  yield takeLeading(actions.generateInvoices.type, doGenerateInvoices);\r\n  yield takeLeading(actions.chargeOnlineBudgets.type, doChargeOnlineBudgets);\r\n  yield takeLeading(actions.pay.type, doPay);\r\n  yield takeLeading(\r\n    actions.chargeOnlineBudgets_DownloadErrors,\r\n    doDownloadChargeOnlineBudgetsErrors,\r\n  );\r\n  yield takeLeading(\r\n    actions.GenerateInvoicesAndChargeOnlineBudgets.type,\r\n    doGenerateSelectedInvoices,\r\n  );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { IResponseType } from 'types/ResponseType';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';\r\nimport { onlineBudgetsStatusSaga } from './saga';\r\nimport { IPayActionPayload, OnlineBudgetsStatusState } from './types';\r\n\r\nexport const initialState: OnlineBudgetsStatusState = {\r\n  endDate: null,\r\n  needTableRefresh: false,\r\n  tableState: {\r\n    processing: false,\r\n  },\r\n  selected: [],\r\n  generateInvoicesState: {\r\n    processing: false,\r\n  },\r\n  charge: {\r\n    processing: false,\r\n  },\r\n  pay: {},\r\n  generateInvoicesAndSendToSap: {},\r\n};\r\n\r\nconst slice = createSlice({\r\n  name: 'onlineBudgetsStatus',\r\n  initialState,\r\n  reducers: {\r\n    setEndDate(state, action: PayloadAction<string | null>) {\r\n      state.endDate = action.payload;\r\n    },\r\n    setneedTableRefresh(state, action: PayloadAction<boolean>) {\r\n      state.needTableRefresh = action.payload;\r\n    },\r\n    getTableData(state, action: PayloadAction<{ endDate: Date }>) {\r\n      state.tableState.processing = true;\r\n      state.tableState.error = undefined;\r\n    },\r\n    getTableData_Success(\r\n      state,\r\n      action: PayloadAction<Array<IInvoiceBudgetBalanceDto>>,\r\n    ) {\r\n      state.tableState.processing = false;\r\n      state.tableState.error = undefined;\r\n      state.tableState.data = action.payload;\r\n    },\r\n    getTableData_Error(state, action: PayloadAction<any>) {\r\n      state.tableState.processing = false;\r\n      state.tableState.error = 'ERROR';\r\n    },\r\n\r\n    setSelected(state, action: PayloadAction<Array<IInvoiceBudgetBalanceDto>>) {\r\n      state.selected = action.payload;\r\n    },\r\n\r\n    generateInvoices(\r\n      state,\r\n      action: PayloadAction<{\r\n        endDate: Date;\r\n      }>,\r\n    ) {\r\n      state.generateInvoicesState.processing = true;\r\n    },\r\n    generateInvoices_Success(state, action: PayloadAction) {\r\n      state.generateInvoicesState.processing = false;\r\n    },\r\n    generateInvoices_Error(state, action: PayloadAction) {\r\n      state.generateInvoicesState.processing = false;\r\n    },\r\n\r\n    chargeOnlineBudgets(\r\n      state,\r\n      action: PayloadAction<IInvoiceBudgetBalanceDto[]>,\r\n    ) {\r\n      state.charge = {\r\n        data: action.payload,\r\n        processing: true,\r\n        dialogOpen: true,\r\n      };\r\n    },\r\n\r\n    chargeOnlineBudgets_SetCurrentRecord(\r\n      state,\r\n      action: PayloadAction<IInvoiceBudgetBalanceDto | undefined>,\r\n    ) {\r\n      state.charge.currentRecord = action.payload;\r\n    },\r\n    chargeOnlineBudgets_SetStatus(state, action: PayloadAction<number>) {\r\n      state.charge.progress = action.payload;\r\n    },\r\n    chargeOnlineBudgets_SetDialogOpen(state, action: PayloadAction<boolean>) {\r\n      state.charge.dialogOpen = action.payload;\r\n    },\r\n\r\n    chargeOnlineBudgets_Success(\r\n      state,\r\n      action: PayloadAction<IInvoiceBudgetBalanceDto[]>,\r\n    ) {\r\n      state.charge.processing = false;\r\n    },\r\n    chargeOnlineBudgets_Error(\r\n      state,\r\n      action: PayloadAction<string[] | undefined>,\r\n    ) {\r\n      state.charge.processing = false;\r\n      state.charge.errors = action.payload;\r\n    },\r\n    chargeOnlineBudgets_DownloadErrors(\r\n      state,\r\n      action: PayloadAction<string[] | undefined>,\r\n    ) {},\r\n\r\n    pay(state, action: PayloadAction<IPayActionPayload>) {\r\n      state.pay.data = action.payload;\r\n      state.pay.dialogOpen = true;\r\n      state.pay.status = 'pending';\r\n    },\r\n    pay_setStatus(state, action: PayloadAction<number>) {\r\n      state.pay.progress = action.payload;\r\n    },\r\n    pay_Open(state, action: PayloadAction<IInvoiceBudgetBalanceDto[]>) {\r\n      state.pay = {\r\n        dialogOpen: true,\r\n        selected: action.payload,\r\n      };\r\n    },\r\n    pay_SetSelected(state, action: PayloadAction<IInvoiceBudgetBalanceDto[]>) {\r\n      state.pay.selected = action.payload;\r\n    },\r\n\r\n    pay_Finish(state, action: PayloadAction<IResponseType[]>) {\r\n      state.pay.status = 'resolved';\r\n      state.pay.messages = action.payload;\r\n      // action.payload.reduce((acc, val) => ({\r\n      //   SuccessMessages: acc.SuccessMessages.concat(val.SuccessMessages),\r\n      //   ErrorMessages: acc.ErrorMessages.concat(val.ErrorMessages),\r\n      //   WarningMessages: acc.WarningMessages.concat(val.WarningMessages),\r\n      // }));\r\n    },\r\n    pay_Close(state, action: PayloadAction) {\r\n      state.pay = {\r\n        dialogOpen: false,\r\n      };\r\n    },\r\n\r\n    GenerateInvoicesAndChargeOnlineBudgets(\r\n      state,\r\n      action: PayloadAction<{\r\n        endDate: Date;\r\n        selected: IInvoiceBudgetBalanceDto[];\r\n        chargeOnlineBudgets: boolean;\r\n      }>,\r\n    ) {\r\n      state.generateInvoicesAndSendToSap = {\r\n        dialogOpen: true,\r\n        progress: 0,\r\n        processing: true,\r\n        selected: action.payload.selected,\r\n        endDate: action.payload.endDate,\r\n      };\r\n    },\r\n    GenerateSelectedInvoices_Success(state, action: PayloadAction) {\r\n      state.generateInvoicesAndSendToSap = {};\r\n      state.charge = {};\r\n    },\r\n    GenerateSelectedInvoices_Error(state, action: PayloadAction) {\r\n      state.generateInvoicesAndSendToSap = {};\r\n      state.charge = {};\r\n    },\r\n    GenerateInvoicesAndChargeOnlineBudgets_SetCurrentRecord(\r\n      state,\r\n      action: PayloadAction<IInvoiceBudgetBalanceDto>,\r\n    ) {\r\n      state.generateInvoicesAndSendToSap.currentRecord = action.payload;\r\n    },\r\n    GenerateInvoicesAndChargeOnlineBudgets_SetProgress(\r\n      state,\r\n      action: PayloadAction<number>,\r\n    ) {\r\n      state.generateInvoicesAndSendToSap.progress = action.payload;\r\n    },\r\n    GenerateSelectedInvoices_SetDialogOpen(\r\n      state,\r\n      action: PayloadAction<boolean>,\r\n    ) {\r\n      state.generateInvoicesAndSendToSap.dialogOpen = action.payload;\r\n    },\r\n  },\r\n});\r\n\r\nexport const { actions: onlineBudgetsStatusActions } = slice;\r\n\r\nexport const useOnlineBudgetsStatusSlice = () => {\r\n  useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n  useInjectSaga({ key: slice.name, saga: onlineBudgetsStatusSaga });\r\n  return { actions: slice.actions };\r\n};\r\n\r\n/**\r\n * Example Usage:\r\n *\r\n * export function MyComponentNeedingThisSlice() {\r\n *  const { actions } = useOnlineBudgetsStatusSlice();\r\n *\r\n *  const onButtonClick = (evt) => {\r\n *    dispatch(actions.getTableData());\r\n *   };\r\n * }\r\n */\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport {\r\n  selectChargeOnlineBudgetsState,\r\n  selectOnlineBudgetsStatusSelected,\r\n} from '../slice/selectors';\r\nimport {\r\n  Dialog,\r\n  DialogActions,\r\n  DialogContent,\r\n  DialogTitle,\r\n  LinearProgress,\r\n  List,\r\n  ListItem,\r\n} from '@material-ui/core';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nconst maxErrorsToShow = 5;\r\nexport interface ChargeOnlineBudgetsButtonProps {\r\n  disabled?: boolean;\r\n  disabledTitle?: string;\r\n}\r\nexport const ChargeOnlineBudgetsButton = ({\r\n  disabled,\r\n  disabledTitle,\r\n  ...props\r\n}: ChargeOnlineBudgetsButtonProps) => {\r\n  const { t } = useTranslation();\r\n  const selected = useSelector(selectOnlineBudgetsStatusSelected);\r\n  const state = useSelector(selectChargeOnlineBudgetsState);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOnlineBudgetsStatusSlice();\r\n\r\n  const handleChargeOnlineBudgetsButtonClick = () => {\r\n    dispatch(actions.chargeOnlineBudgets(selected));\r\n  };\r\n  const handleDialogClose = () => {\r\n    if (state.processing) {\r\n      return;\r\n    }\r\n    dispatch(actions.chargeOnlineBudgets_SetDialogOpen(false));\r\n  };\r\n  const confirmationMessage = `${\r\n    selected.length\r\n  } records will be processed. ${t(translations.AreYouSure)}`;\r\n  return (\r\n    <>\r\n      <Tooltip title={disabledTitle}>\r\n        <span>\r\n          <ButtonConfirm\r\n            disabled={disabled === true || selected.length === 0}\r\n            onClick={handleChargeOnlineBudgetsButtonClick}\r\n            confirmationDialogTitle={t(translations.SendBalanceToSap)}\r\n            confirmationDialogBody={confirmationMessage}\r\n            processing={state.processing}\r\n          >\r\n            {t(translations.ChargeBalanceOnline)}\r\n            {selected.length > 0 && <> - {selected.length}</>}\r\n          </ButtonConfirm>\r\n        </span>\r\n      </Tooltip>\r\n      <Dialog open={state.dialogOpen ?? false} onClose={handleDialogClose}>\r\n        {state.processing && (\r\n          <LinearProgress variant=\"determinate\" value={state.progress} />\r\n        )}\r\n        <DialogTitle>{t(translations.ChargeBalanceOnline)}</DialogTitle>\r\n        <DialogContent>\r\n          {state.currentRecord !== undefined && (\r\n            <BasicTypography>{`Processing ${state.currentRecord?.ServiceGroup} ${state.currentRecord?.Budget}`}</BasicTypography>\r\n          )}\r\n          <>\r\n            {state.errors !== undefined && (\r\n              <List>\r\n                {state?.errors\r\n                  ?.slice(0, maxErrorsToShow)\r\n                  ?.map((message, index) => (\r\n                    <ListItem key={`msg-${index}`}>{message}</ListItem>\r\n                  ))}\r\n              </List>\r\n            )}\r\n            {(state?.errors?.length ?? 0) > maxErrorsToShow && (\r\n              <Button\r\n                onClick={() =>\r\n                  dispatch(\r\n                    actions.chargeOnlineBudgets_DownloadErrors(state.errors),\r\n                  )\r\n                }\r\n              >\r\n                {t(translations.DownloadErrors)}\r\n              </Button>\r\n            )}\r\n          </>\r\n        </DialogContent>\r\n        <DialogActions>\r\n          <Button\r\n            type=\"reset\"\r\n            onClick={handleDialogClose}\r\n            disabled={state.processing}\r\n            processing={state.processing}\r\n          >\r\n            {t(translations.Close)}\r\n          </Button>\r\n        </DialogActions>\r\n      </Dialog>\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport { selectGenerateInvoicesState } from '../slice/selectors';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\n\r\nexport interface GenerateInvoicesButtonProps {\r\n  endDate: Date;\r\n  selected: IInvoiceBudgetBalanceDto[];\r\n  disabled?: boolean;\r\n  disabledTitle?: string;\r\n}\r\nexport const GenerateInvoicesButton = ({\r\n  endDate,\r\n  selected,\r\n  disabled,\r\n  disabledTitle,\r\n}: GenerateInvoicesButtonProps) => {\r\n  const { t } = useTranslation();\r\n  const generateInvoicesState = useSelector(selectGenerateInvoicesState);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOnlineBudgetsStatusSlice();\r\n  return (\r\n    <>\r\n      <Tooltip title={disabledTitle}>\r\n        <span>\r\n          <Button\r\n            onClick={() =>\r\n              dispatch(\r\n                selected.length > 0\r\n                  ? actions.GenerateInvoicesAndChargeOnlineBudgets({\r\n                      endDate: endDate,\r\n                      selected: selected,\r\n                      chargeOnlineBudgets: false,\r\n                    })\r\n                  : actions.generateInvoices({ endDate: endDate }),\r\n              )\r\n            }\r\n            processing={generateInvoicesState.processing}\r\n            disabled={disabled === true || selected.length === 0}\r\n          >\r\n            {t(translations.GenerateInvoiceForEstimatedCharges)}\r\n          </Button>\r\n        </span>\r\n      </Tooltip>\r\n    </>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport * as Yup from 'yup';\r\nimport { selectPayState } from '../slice/selectors';\r\nimport {\r\n  Dialog,\r\n  DialogActions,\r\n  DialogContent,\r\n  DialogTitle,\r\n  LinearProgress,\r\n} from '@material-ui/core';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { PaymentMethodEntitySchema } from 'app/components/Forms/Schemas';\r\nimport { Form, Formik } from 'formik';\r\nimport { FormPaymentMethodPicker } from 'app/components/Forms/FormPaymentMethodPicker';\r\nimport { FormRow } from 'app/components/Forms/FormsLayout';\r\nimport { Entity } from 'types/common';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Box } from 'app/components/basic/Wrappers/Box';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { sum } from 'lodash';\r\nimport { Alert } from '@material-ui/lab';\r\n\r\nexport interface PayButtonProps {\r\n  endDate: Date;\r\n  selected: IInvoiceBudgetBalanceDto[];\r\n  disabled?: boolean;\r\n  disabledTitle?: string;\r\n}\r\nexport const PayButton = ({\r\n  selected,\r\n  disabled,\r\n  disabledTitle,\r\n  ...props\r\n}: PayButtonProps) => {\r\n  const { t } = useTranslation();\r\n  const state = useSelector(selectPayState);\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOnlineBudgetsStatusSlice();\r\n\r\n  const handlePayButtonClick = () => {\r\n    if (selected.length > 0) {\r\n      dispatch(actions.pay_Open(selected));\r\n    }\r\n  };\r\n  const handleDialogClose = () => {\r\n    if (state.status === 'pending') {\r\n      return;\r\n    }\r\n    dispatch(actions.pay_Close());\r\n  };\r\n  const totalUpaidBalance = sum(state.selected?.map(row => row.UnpaidBalance));\r\n\r\n  const confirmationMessage = `${state.selected?.length} records will be processed.`;\r\n\r\n  const handleSubmit = (values: IValues, formikHelpers) => {\r\n    const paymentMethod = values?.PaymentMethod?.Id;\r\n    if (paymentMethod !== undefined && state.selected !== undefined) {\r\n      dispatch(\r\n        actions.pay({\r\n          EndDate: props.endDate,\r\n          PaymentMethod: paymentMethod,\r\n          Rows: state.selected,\r\n        }),\r\n      );\r\n    }\r\n  };\r\n  const initialValues: IValues = {\r\n    PaymentMethod: null,\r\n  };\r\n  const title = disabled ? disabledTitle : t(translations.PayDescription);\r\n  return (\r\n    <>\r\n      <Tooltip title={title}>\r\n        <span>\r\n          <Button\r\n            disabled={disabled === true || selected.length === 0}\r\n            onClick={handlePayButtonClick}\r\n            processing={state.status === 'pending'}\r\n          >\r\n            {t(translations.Pay)}\r\n          </Button>\r\n        </span>\r\n      </Tooltip>\r\n\r\n      <Dialog open={state.dialogOpen ?? false} onClose={handleDialogClose}>\r\n        {state.status === 'pending' && (\r\n          <LinearProgress variant=\"determinate\" value={state.progress ?? 1} />\r\n        )}\r\n        <Formik<IValues>\r\n          initialValues={initialValues}\r\n          validationSchema={validationSchema}\r\n          onSubmit={handleSubmit}\r\n        >\r\n          {formik => (\r\n            <Form>\r\n              <DialogTitle>{t(translations.ChargeBalanceOnline)}</DialogTitle>\r\n              <DialogContent>\r\n                <BasicTypography>{confirmationMessage}</BasicTypography>\r\n\r\n                <Box>\r\n                  <FormRow fullRow>\r\n                    {[\r\n                      <React.Fragment key=\"PaymentMethod\">\r\n                        <FormPaymentMethodPicker\r\n                          fullWidth\r\n                          name=\"PaymentMethod\"\r\n                          placeholder={t(translations.PaymentMethod)}\r\n                          label={t(translations.PaymentMethod)}\r\n                          disabled={state.status !== undefined}\r\n                        />\r\n                      </React.Fragment>,\r\n                    ]}\r\n                  </FormRow>\r\n                  <FormRow fullRow>\r\n                    {[\r\n                      <BasicTypography>\r\n                        {t(translations.TotalPayments)}:{' '}\r\n                        {totalUpaidBalance.toFixed(2)}\r\n                      </BasicTypography>,\r\n                    ]}\r\n                  </FormRow>\r\n                </Box>\r\n                {state.messages?.map((responseType, index) => (\r\n                  <>\r\n                    {responseType.SuccessMessages.map(message => (\r\n                      <Alert key={`success_${index}`} color=\"success\">\r\n                        {message}\r\n                      </Alert>\r\n                    ))}\r\n                    {responseType.ErrorMessages.map(message => (\r\n                      <Alert key={`error_${index}`} color=\"error\">\r\n                        {message}\r\n                      </Alert>\r\n                    ))}\r\n                    {responseType.WarningMessages.map(message => (\r\n                      <Alert key={`warning_${index}`} color=\"warning\">\r\n                        {message}\r\n                      </Alert>\r\n                    ))}\r\n                  </>\r\n                ))}\r\n              </DialogContent>\r\n              <DialogActions>\r\n                <Button\r\n                  type=\"submit\"\r\n                  processing={state.status === 'pending'}\r\n                  disabled={state.status !== undefined}\r\n                >\r\n                  {t(translations.PaySelected)}\r\n                </Button>\r\n                {state.status === 'resolved' ? (\r\n                  <Button\r\n                    type=\"reset\"\r\n                    onClick={() => dispatch(actions.pay_Close())}\r\n                  >\r\n                    {t(translations.Close)}\r\n                  </Button>\r\n                ) : (\r\n                  <Button\r\n                    type=\"reset\"\r\n                    onClick={() => dispatch(actions.pay_Close())}\r\n                    disabled={state.status === 'pending'}\r\n                  >\r\n                    {t(translations.Cancel)}\r\n                  </Button>\r\n                )}\r\n              </DialogActions>\r\n            </Form>\r\n          )}\r\n        </Formik>\r\n      </Dialog>\r\n    </>\r\n  );\r\n};\r\ninterface IValues {\r\n  PaymentMethod?: Entity<number> | null;\r\n}\r\nconst validationSchema: Yup.SchemaOf<IValues> = Yup.object({\r\n  PaymentMethod: PaymentMethodEntitySchema.required(),\r\n});\r\n","/**\r\n *\r\n * GenerateInvoicesAndSendToSap\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\n\r\nimport {\r\n  Dialog,\r\n  DialogActions,\r\n  DialogContent,\r\n  DialogTitle,\r\n  LinearProgress,\r\n} from '@material-ui/core';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\n\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { ButtonConfirm } from 'app/components/ButtonConfirm';\r\nimport { useOnlineBudgetsStatusSlice } from '../slice';\r\nimport { selectIGenerateInvoicesAndSendToSapState } from '../slice/selectors';\r\n\r\nexport interface GenerateInvoicesAndSendToSapProps {\r\n  selected: IInvoiceBudgetBalanceDto[];\r\n  endDate: Date;\r\n  disabled?: boolean;\r\n  disabledTitle?: string;\r\n}\r\n\r\nexport function GenerateInvoicesAndSendToSap({\r\n  disabled,\r\n  disabledTitle,\r\n  ...props\r\n}: GenerateInvoicesAndSendToSapProps) {\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  const { t, i18n } = useTranslation();\r\n  const state = useSelector(selectIGenerateInvoicesAndSendToSapState);\r\n  const { actions } = useOnlineBudgetsStatusSlice();\r\n  const dispatch = useDispatch();\r\n  const handleButtonClick = () => {\r\n    dispatch(\r\n      actions.GenerateInvoicesAndChargeOnlineBudgets({\r\n        endDate: props.endDate,\r\n        selected: props.selected,\r\n        chargeOnlineBudgets: true,\r\n      }),\r\n    );\r\n  };\r\n  const handleDialogClose = () => {\r\n    //todo\r\n  };\r\n  const title = disabled ? disabledTitle : t(translations.PayDescription);\r\n\r\n  return (\r\n    <>\r\n      <Tooltip title={title}>\r\n        <span>\r\n          <ButtonConfirm\r\n            disabled={disabled === true || props.selected?.length === 0}\r\n            onClick={handleButtonClick}\r\n            processing={state.processing === true}\r\n          >\r\n            {t(translations.GenerateInvoicesAndSendToSap)}\r\n          </ButtonConfirm>\r\n        </span>\r\n      </Tooltip>\r\n      <Dialog open={state.dialogOpen ?? false} onClose={handleDialogClose}>\r\n        {state.progress !== undefined && (\r\n          <LinearProgress variant=\"determinate\" value={state.progress ?? 0} />\r\n        )}\r\n        <DialogTitle>{t(translations.GenerateInvoices)}</DialogTitle>\r\n        <DialogContent>\r\n          {state.currentRecord !== undefined && (\r\n            <BasicTypography>{`Processing ${state.currentRecord?.ServiceGroup} ${state.currentRecord?.Budget}`}</BasicTypography>\r\n          )}\r\n        </DialogContent>\r\n        <DialogActions>\r\n          <Button\r\n            disabled={state.processing === true}\r\n            onClick={() =>\r\n              dispatch(actions.GenerateSelectedInvoices_SetDialogOpen(false))\r\n            }\r\n          >\r\n            {t(translations.Close)}\r\n          </Button>\r\n        </DialogActions>\r\n      </Dialog>\r\n    </>\r\n  );\r\n}\r\n","import { Link } from '@material-ui/core';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { translations } from 'locales/translations';\r\nimport React, { ReactNode } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { PaymentProps } from './index';\r\n\r\nexport const AddPaymentButton = ({\r\n  children,\r\n  ...props\r\n}: { children?: ReactNode } & PaymentProps) => {\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  const singleAdminServiceGroup =\r\n    authenticatedUser?.Roles?.includes(Roles.ServiceGroupBudgetsAdmin) &&\r\n    authenticatedUser.AdminServiceGroups.length === 1\r\n      ? authenticatedUser.AdminServiceGroups[0]\r\n      : null;\r\n  props.serviceGroup = props.serviceGroup ?? singleAdminServiceGroup ?? null;\r\n  return (\r\n    <Tooltip title={t(translations.AddPayment)} arrow>\r\n      <Link\r\n        onClick={() => {\r\n          dispatch(actions.toggleSidePanel(true));\r\n          dispatch(actions.setPageType(RenderPageType.AddPayment));\r\n          dispatch(actions.setPageProps(props));\r\n        }}\r\n      >\r\n        {children ?? t(translations.AddPaymentInvoice)}\r\n      </Link>\r\n    </Tooltip>\r\n  );\r\n};\r\n","import * as React from 'react';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { uniqueId } from 'lodash';\r\nimport { InvoiceDetailsSidePanelLink } from '../InvoiceDetails/InvoiceDetailsSidePanel';\r\nimport { toEntity } from 'utils/entity-utils';\r\nimport { AddChargeButton } from '../AddChargePage/AddChargeButton';\r\nimport { AddPaymentButton } from '../AddPaymentPage/AddPaymentButton';\r\nimport { IInvoiceBalanceDto } from 'api/odata/generated/complexTypes/IInvoiceBalanceDto';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectglobalSettings } from 'app/slice/selectors';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { Icon } from 'app/components/BasicIcons/FontAwesome';\r\nimport { Box } from '@material-ui/core';\r\n\r\nconst tryParseInvoicesData = (s: string | null): IInvoiceBalanceDto[] => {\r\n  try {\r\n    const invoices = JSON.parse(s ?? '[]') as IInvoiceBalanceDto[];\r\n    return invoices;\r\n  } catch {\r\n    return [] as IInvoiceBalanceDto[];\r\n  }\r\n};\r\nexport const useRowActions = () => {\r\n  const { t } = useTranslation();\r\n  const settings = useSelector(selectglobalSettings);\r\n  const allowedFees = settings.GetString(AllowedSettings.AllowedFeeTypes);\r\n  const accumulateInvoices = settings.GetBoolean(\r\n    AllowedSettings[AllowedSettings.AccumulateNewChargesToExistingInvoice],\r\n  );\r\n  const isChargesAllowed = allowedFees && allowedFees.trim() !== '';\r\n  const rowActions = React.useMemo<CellRenderer<IInvoiceBudgetBalanceDto>[]>(\r\n    () => [\r\n      ({ row }) => {\r\n        const invoices = tryParseInvoicesData(row.original.Invoices);\r\n        const actions: JSX.Element[] = [];\r\n        if (invoices.length === 0) {\r\n          // add charge/payment by service group & budget\r\n          if (isChargesAllowed && accumulateInvoices) {\r\n            actions.push(\r\n              <AddChargeButton\r\n                budget={getBudget(row.original)}\r\n                serviceGroup={getServiceGroup(row.original)}\r\n              >\r\n                <Box\r\n                  style={{\r\n                    display: 'flex',\r\n                    alignItems: 'center',\r\n                    justifyContent: 'center',\r\n                    fontSize: 14,\r\n                    gap: 16,\r\n                  }}\r\n                >\r\n                  <Icon icon=\"plus\" />\r\n                  {t(translations.AddACharge)}\r\n                </Box>\r\n              </AddChargeButton>,\r\n            );\r\n          }\r\n          if (accumulateInvoices) {\r\n            actions.push(\r\n              <AddPaymentButton\r\n                budget={getBudget(row.original)}\r\n                serviceGroup={getServiceGroup(row.original)}\r\n              >\r\n                <Box\r\n                  style={{\r\n                    display: 'flex',\r\n                    alignItems: 'center',\r\n                    justifyContent: 'center',\r\n                    fontSize: 14,\r\n                    gap: 16,\r\n                  }}\r\n                >\r\n                  <Icon icon=\"plus\" />\r\n                  {t(translations.AddPayment)}\r\n                </Box>\r\n              </AddPaymentButton>,\r\n            );\r\n          }\r\n        } else if (invoices.length === 1) {\r\n          // combine all differnet actions into single list for single invoice row\r\n          actions.push(<InvoiceDetailsLink invoiceId={invoices[0].Id} />);\r\n          if (isChargesAllowed && accumulateInvoices) {\r\n            actions.push(\r\n              <AddChargeButton\r\n                invoiceId={invoices[0].Id ?? undefined}\r\n                budget={getBudget(row.original)}\r\n                serviceGroup={getServiceGroup(row.original)}\r\n              >\r\n                <Box\r\n                  style={{\r\n                    display: 'flex',\r\n                    alignItems: 'center',\r\n                    justifyContent: 'center',\r\n                    fontSize: 14,\r\n                    gap: 16,\r\n                  }}\r\n                >\r\n                  <Icon icon=\"plus\" />\r\n                  {t(translations.AddACharge)}\r\n                </Box>\r\n              </AddChargeButton>,\r\n            );\r\n          }\r\n          if (accumulateInvoices) {\r\n            actions.push(\r\n              <AddPaymentButton\r\n                amount={getPaymentAmount(invoices[0])}\r\n                invoiceId={invoices[0].Id ?? undefined}\r\n                budget={getBudget(row.original)}\r\n                serviceGroup={getServiceGroup(row.original)}\r\n              >\r\n                <Box\r\n                  style={{\r\n                    display: 'flex',\r\n                    alignItems: 'center',\r\n                    justifyContent: 'center',\r\n                    fontSize: 14,\r\n                    gap: 16,\r\n                  }}\r\n                >\r\n                  <Icon icon=\"plus\" />\r\n                  {t(translations.AddPayment)}\r\n                </Box>\r\n              </AddPaymentButton>,\r\n            );\r\n          }\r\n        } else if (invoices?.length ?? 0 > 1) {\r\n          // show nested actions per each invoice row:\r\n          // invoice label + all actions behind the \"ReactActions\"\r\n\r\n          invoices.forEach(invoice => {\r\n            let subActions: JSX.Element[] = [];\r\n            subActions.push(<InvoiceDetailsLink invoiceId={invoice.Id} />);\r\n            if (isChargesAllowed && accumulateInvoices) {\r\n              subActions.push(\r\n                <AddChargeButton\r\n                  invoiceId={invoice.Id ?? undefined}\r\n                  budget={getBudget(row.original)}\r\n                  serviceGroup={getServiceGroup(row.original)}\r\n                >\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      alignItems: 'center',\r\n                      justifyContent: 'center',\r\n                      fontSize: 14,\r\n                      gap: 16,\r\n                    }}\r\n                  >\r\n                    <Icon icon=\"plus\" />\r\n                    {t(translations.AddACharge)}\r\n                  </Box>\r\n                </AddChargeButton>,\r\n              );\r\n            }\r\n            if (accumulateInvoices) {\r\n              subActions.push(\r\n                <AddPaymentButton\r\n                  amount={getPaymentAmount(invoice)}\r\n                  invoiceId={invoice.Id ?? undefined}\r\n                  budget={getBudget(row.original)}\r\n                  serviceGroup={getServiceGroup(row.original)}\r\n                >\r\n                  <Box\r\n                    style={{\r\n                      display: 'flex',\r\n                      alignItems: 'center',\r\n                      justifyContent: 'center',\r\n                      fontSize: 14,\r\n                      gap: 16,\r\n                    }}\r\n                  >\r\n                    <Icon icon=\"plus\" />\r\n                    {t(translations.AddPayment)}\r\n                  </Box>\r\n                </AddPaymentButton>,\r\n              );\r\n            }\r\n            actions.push(\r\n              <>\r\n                <Box\r\n                  style={{\r\n                    display: 'flex',\r\n                    alignItems: 'center',\r\n                    justifyContent: 'center',\r\n                    fontSize: 14,\r\n                    gap: 16,\r\n                  }}\r\n                >\r\n                  {`#${invoice.Id} ${dateUtils.shortDateFormat(\r\n                    invoice.InvoiceStart,\r\n                  )} - ${dateUtils.shortDateFormat(invoice.InvoiceEnd)}`}\r\n                </Box>\r\n                <ReactActions\r\n                  id=\"addCharge_addPayment\"\r\n                  hoverMenu={true}\r\n                  size=\"small\"\r\n                  items={subActions}\r\n                />\r\n              </>,\r\n            );\r\n          });\r\n        }\r\n        if (actions.length === 0) return <></>;\r\n        return <ReactActions id={uniqueId()} items={actions} size=\"small\" />;\r\n      },\r\n    ],\r\n    [accumulateInvoices, isChargesAllowed, t],\r\n  );\r\n  return rowActions;\r\n};\r\n\r\ninterface InvoiceDetailsLinkProps {\r\n  invoiceId: number | null;\r\n}\r\nconst InvoiceDetailsLink = ({ invoiceId }: InvoiceDetailsLinkProps) => {\r\n  const { t } = useTranslation();\r\n  if (invoiceId == null) {\r\n    return invoiceId;\r\n  }\r\n  return (\r\n    <InvoiceDetailsSidePanelLink id={invoiceId} useSidePanel={false}>\r\n      <Tooltip\r\n        title={t(\r\n          translations.SeeFullDetailsOfBalanceAndTransferChargesToAnotherBudget,\r\n        )}\r\n        arrow\r\n      >\r\n        <Box\r\n          style={{\r\n            display: 'flex',\r\n            alignItems: 'center',\r\n            justifyContent: 'center',\r\n            fontSize: 14,\r\n            gap: 16,\r\n          }}\r\n        >\r\n          <Icon icon=\"file-alt\" />\r\n          {t(translations.BudgetDetailsBudgetTransfer)}\r\n        </Box>\r\n      </Tooltip>\r\n    </InvoiceDetailsSidePanelLink>\r\n    // </Link>\r\n  );\r\n};\r\nfunction getPaymentAmount(invoice: IInvoiceBalanceDto) {\r\n  const balance = invoice.Charges - invoice.Payments;\r\n  if (balance > 0) {\r\n    return balance;\r\n  } else {\r\n    return undefined;\r\n  }\r\n}\r\n\r\ninterface IRowWithFlatBudget {\r\n  BudgetId: number | null;\r\n  Budget: string | null;\r\n}\r\nconst getBudget = (row: IRowWithFlatBudget) => {\r\n  return toEntity(row.BudgetId, row.Budget);\r\n};\r\ninterface IRowWithFlatServiceGroup {\r\n  ServiceGroupId: number | null;\r\n  ServiceGroup: string | null;\r\n}\r\nconst getServiceGroup = (row: IRowWithFlatServiceGroup) => {\r\n  return toEntity(row.ServiceGroupId, row.ServiceGroup);\r\n};\r\n","/**\r\n *\r\n * OnlineBudgetsStatusPage\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { translations } from 'locales/translations';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useOnlineBudgetsStatusSlice } from './slice';\r\nimport { useLocation } from 'react-router';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useColumns } from './columns';\r\nimport { usePageActions } from './pageActions';\r\nimport { InfoIcon } from 'app/components/BasicIcons/InfoIcon';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { useRowActions } from './useRowActions';\r\nimport { BasicTable } from 'app/components/BasicTable';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { withSavedHistoryT } from 'app/components/BasicTable/withSavedHistory';\r\nimport { GetFilters } from './Filter';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { getDefaultFilter } from './getDefaultFitlers';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\n\r\nimport { push } from 'connected-react-router';\r\nimport { defaults } from 'lodash';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport { BookitDatePicker } from 'app/components/BookitDatePicker';\r\n\r\nexport interface OnlineBudgetsStatusPageParams {\r\n  endDate: string;\r\n}\r\nexport interface OnlineBudgetsStatusPageProps\r\n  extends IBasePageProps<OnlineBudgetsStatusPageParams> {}\r\n\r\nexport const InvoiceBudgetBalanceKeyAccessor = (\r\n  row: IInvoiceBudgetBalanceDto,\r\n) => {\r\n  return JSON.stringify({\r\n    serviceGroupId: row.ServiceGroupId,\r\n    budgetId: row.BudgetId,\r\n  });\r\n};\r\nexport function OnlineBudgetsStatusPage(props: OnlineBudgetsStatusPageProps) {\r\n  const { t } = useTranslation();\r\n  const params = defaults(props.match.params, {\r\n    endDate: dateUtils.formatISO(new Date(), {\r\n      format: 'basic',\r\n      representation: 'date',\r\n    }),\r\n  });\r\n  const location = useLocation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useOnlineBudgetsStatusSlice();\r\n\r\n  const endDate = React.useMemo(() => dateUtils.parseISO(params.endDate), [\r\n    params.endDate,\r\n  ]);\r\n  const columns = useColumns(endDate);\r\n  const rowActions = useRowActions();\r\n  const endDateString =\r\n    endDate == null\r\n      ? null\r\n      : dateUtils.formatISO(endDate, {\r\n          format: 'basic',\r\n          representation: 'date',\r\n        });\r\n  const memoedColumns = React.useMemo(() => columns, [columns]);\r\n  const isMobile = DetectIsMobile();\r\n  const pageActions = usePageActions({\r\n    endDate: endDate as Date | null,\r\n    isMobile,\r\n  });\r\n\r\n  React.useEffect(() => {\r\n    dispatch(actions.setEndDate(endDateString));\r\n  }, [actions, dispatch, endDateString]);\r\n\r\n  const handleEndDateChange = React.useCallback(\r\n    (value: MaterialUiPickersDate) => {\r\n      if (value != null) {\r\n        dispatch(\r\n          push({\r\n            pathname:\r\n              '/OnlineBudgetsStatus/' +\r\n              dateUtils.formatISO(value, {\r\n                format: 'basic',\r\n                representation: 'date',\r\n              }),\r\n            search: location.search,\r\n          }),\r\n        );\r\n      }\r\n    },\r\n    [dispatch, location.search],\r\n  );\r\n  const subHeader = (\r\n    <>\r\n      <BookitDatePicker\r\n        value={endDate}\r\n        onChange={handleEndDateChange}\r\n        label={t(translations.EndDate)}\r\n        id=\"billingDateId\"\r\n        ariaLabel=\"End Date\"\r\n      />\r\n      <BasicTypography>\r\n        {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark0)}\r\n      </BasicTypography>\r\n      <ExternalLink href=\"/usagehistory.aspx?isUsageOpen=true\">\r\n        {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark1)}\r\n      </ExternalLink>\r\n      <ExternalLink href=\"/EventsRaw.aspx?unfinishedUsages=true&charged=false\">\r\n        {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark2)}\r\n      </ExternalLink>\r\n      <InfoIcon\r\n        title={\r\n          t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark4) as string\r\n        }\r\n      />\r\n      <BasicTypography>\r\n        {t(translations.OnlineBudgetsBillingUnfinishedUsagesRemark3)}\r\n      </BasicTypography>\r\n    </>\r\n  );\r\n  const rowAccessor = React.useCallback(InvoiceBudgetBalanceKeyAccessor, []);\r\n  if (endDate == null) {\r\n    return null;\r\n  }\r\n  const apiURL = '/api/odata/v4/InvoiceBudgetBalances';\r\n  return (\r\n    <>\r\n      <OnlineBudgetsStatusTable\r\n        api={{\r\n          path: apiURL,\r\n          search: {\r\n            endDate: dateUtils.formatISO(endDate, {\r\n              format: 'basic',\r\n              representation: 'date',\r\n            }),\r\n          },\r\n        }}\r\n        columns={memoedColumns}\r\n        getRowId={rowAccessor}\r\n        screenName={t(translations.BillingByProjectsOrCores)}\r\n        screenId={ScreensId.OnlineBudgetsStatus}\r\n        serviceGroups={props.serviceGroups}\r\n        useRowSelect={true}\r\n        pageActions={pageActions}\r\n        rowActions={rowActions}\r\n        subHeader={subHeader}\r\n        onSelectedRowsChange={selected =>\r\n          dispatch(actions.setSelected(selected))\r\n        }\r\n        additionalColumns={[\r\n          'UserGroupId',\r\n          'ServiceGroupId',\r\n          'BudgetId',\r\n          'Invoices',\r\n        ]}\r\n        searchColumns={[\r\n          'ServiceGroup',\r\n          'UserGroup',\r\n          'UserGroupId',\r\n          'UsergroupIDNO',\r\n          'Budget',\r\n          'HostBudgetNumber',\r\n          'Department',\r\n          'Institute',\r\n          'InstituteType',\r\n        ]}\r\n      />\r\n    </>\r\n  );\r\n}\r\n\r\nconst OnlineBudgetsStatusTable = withSavedHistoryT<IInvoiceBudgetBalanceDto>(\r\n  BasicTable,\r\n  '/OnlineBudgetStatus',\r\n  GetFilters,\r\n  getDefaultFilter,\r\n  ['endDate'],\r\n);\r\n","import { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\nimport { Tooltip } from 'app/components/BasicTooltips/Tooltip';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Column } from 'react-table';\r\nimport htmlParse from 'html-react-parser';\r\nimport { Link } from 'react-router-dom';\r\nimport { toQueryString } from 'utils/url-utils';\r\nimport { ExternalLink } from 'app/components/ExternalLink';\r\nimport { AlignRight } from '../../components/BasicTable/CellRenderers/AlignRight';\r\nimport PercentageRenderer from 'app/components/BasicTable/CellRenderers/PercentageRenderer';\r\n\r\nexport const useColumns = (endDate: Date) => {\r\n  const { t } = useTranslation();\r\n  const columns: Column<IInvoiceBudgetBalanceDto>[] = [\r\n    {\r\n      accessor: 'ServiceGroup',\r\n      Header: t<string>(translations.ServiceGroup),\r\n    },\r\n    {\r\n      accessor: 'HostBudgetNumber',\r\n      Header: t<string>(translations.HostBudgetNumber),\r\n    },\r\n    {\r\n      accessor: 'UserGroup',\r\n      Header: t<string>(translations.UserGroup),\r\n    },\r\n    //     Institute- tool tip “By Project User Group”\r\n    {\r\n      accessor: 'Institute',\r\n      Header: (\r\n        <Tooltip title={htmlParse(t(translations.ByProjectUserGroup))}>\r\n          <span>{t(translations.Institute)}</span>\r\n        </Tooltip>\r\n      ),\r\n      Cell: ({ row, value }) => (\r\n        <AlignRight>\r\n          <Tooltip title={htmlParse(t(translations.ByProjectUserGroup))}>\r\n            <span>{value}</span>\r\n          </Tooltip>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    // Department- tool tip “By Project User Group”\r\n    {\r\n      accessor: 'Department',\r\n      Header: (\r\n        <Tooltip title={htmlParse(t(translations.ByProjectUserGroup))}>\r\n          <span>{t(translations.Department)}</span>\r\n        </Tooltip>\r\n      ),\r\n      Cell: ({ row, value }) => (\r\n        <AlignRight>\r\n          <Tooltip title={htmlParse(t(translations.ByProjectUserGroup))}>\r\n            <span>{value}</span>\r\n          </Tooltip>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    // User Group- tool tip “Project User Group”\r\n    {\r\n      accessor: 'UsergroupIDNO',\r\n      Header: t<string>(translations.IDNo),\r\n    },\r\n    {\r\n      accessor: 'Budget',\r\n      Header: t<string>(translations.BudgetNumber),\r\n      Cell: ({ value, row }) => (\r\n        <ExternalLink\r\n          href={{ path: '/Budget.aspx', search: { id: row.original.BudgetId } }}\r\n        >\r\n          {value}\r\n        </ExternalLink>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'BudgetAmount',\r\n      Header: t<string>(translations.BudgetAmount),\r\n      Cell: ({ value }) => (\r\n        <AlignRight>\r\n          <span>{value?.toFixed(2)}</span>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'BudgetAmount',\r\n      Header: t<string>(translations.BudgetAmount),\r\n      Cell: ({ value }) => (\r\n        <AlignRight>\r\n          <span>{value?.toFixed(2)}</span>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'BudgetHardLimit',\r\n      Header: t<string>(translations.BudgetHardLimit),\r\n      Cell: PercentageRenderer,\r\n    },\r\n    {\r\n      accessor: 'BudgetSoftLimit',\r\n      Header: t<string>(translations.BudgetSoftLimit),\r\n      Cell: PercentageRenderer,\r\n    },\r\n    {\r\n      accessor: 'InvoicedAmount',\r\n      Header: t<string>(translations.TotalInvoiced),\r\n      Cell: ({ value, row }) => (\r\n        <AlignRight>\r\n          <Link\r\n            to={{\r\n              pathname: '/Charges',\r\n              search: toQueryString({\r\n                ugid: row.original.UserGroupId,\r\n                BudgetId: row.original.BudgetId,\r\n                showEstimated: false,\r\n              }).toString(),\r\n            }}\r\n          >\r\n            {value?.toFixed(2)}\r\n          </Link>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'PaidAmount',\r\n      Header: t<string>(translations.TotlaPaid),\r\n      Cell: ({ value }) => (\r\n        <AlignRight>\r\n          <span>{value?.toFixed(2)}</span>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'UnpaidBalance',\r\n      Header: (\r\n        <>\r\n          <Tooltip\r\n            title={htmlParse(t(translations.OnlineBudgetStatusBalanceTooltip))}\r\n          >\r\n            <span>{t(translations.UnpaidBalance)}</span>\r\n          </Tooltip>\r\n        </>\r\n      ),\r\n      Cell: ({ row, value }) => (\r\n        <AlignRight>\r\n          <Tooltip\r\n            title={htmlParse(t(translations.OnlineBudgetStatusBalanceTooltip))}\r\n          >\r\n            <span>{value?.toFixed(2)}</span>\r\n          </Tooltip>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'OverallEstimatedBalance',\r\n      Header: (\r\n        <Tooltip\r\n          title={htmlParse(t(translations.OverallEstimatedBalanceTooltip))}\r\n        >\r\n          <span>{t(translations.OverallEstimatedBalance)}</span>\r\n        </Tooltip>\r\n      ),\r\n      Cell: ({ value }) => (\r\n        <AlignRight>\r\n          <Tooltip title={t(translations.OverallEstimatedBalanceTooltip)}>\r\n            <span>{String(value.toFixed(2))}</span>\r\n          </Tooltip>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n    {\r\n      accessor: 'EstimatedCharges',\r\n      Header: (\r\n        <Tooltip\r\n          title={htmlParse(\r\n            t(translations.OnlineBudgetStatusEstimatedChargesTooltip),\r\n          )}\r\n        >\r\n          <span>{t(translations.EstimatedCharges)}</span>\r\n        </Tooltip>\r\n      ),\r\n      Cell: ({ value, row }) => (\r\n        <AlignRight>\r\n          <Tooltip\r\n            title={htmlParse(\r\n              t(translations.OnlineBudgetStatusEstimatedChargesTooltip),\r\n            )}\r\n          >\r\n            <span>\r\n              <Link\r\n                to={{\r\n                  pathname: '/Charges',\r\n                  search: toQueryString({\r\n                    //ServiceGroupId: row.original.ServiceGroupId,\r\n                    ugid: row.original.UserGroupId,\r\n                    //bid: row.original.BudgetId,\r\n                    BudgetId: row.original.BudgetId,\r\n                    //Estimated: true,\r\n                    showEstimated: true,\r\n                  }).toString(),\r\n                }}\r\n              >\r\n                {value?.toFixed(2)}\r\n              </Link>\r\n            </span>\r\n          </Tooltip>\r\n        </AlignRight>\r\n      ),\r\n    },\r\n  ];\r\n  return columns;\r\n};\r\n","import * as React from 'react';\r\nimport { selectAppSettings, selectglobalSettings } from 'app/slice/selectors';\r\nimport { useSelector } from 'react-redux';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { ChargeOnlineBudgetsButton } from './ChargeOnlineBudgetsButton';\r\nimport { GenerateInvoicesButton } from './GenerateInvoicesButton';\r\nimport { PayButton } from './PayButton';\r\nimport { GenerateInvoicesAndSendToSap } from './GenerateInvoicesAndSendToSap';\r\nimport { dateUtils } from 'utils/date-utils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { ReactActions } from 'app/components/ReactActions';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { useSystemDate } from 'app/hooks/useSystemDate';\r\nimport { PageActionRenderer2 } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { IInvoiceBudgetBalanceDto } from 'api/odata/generated/entities/IInvoiceBudgetBalanceDto';\r\n\r\nexport interface usePageActionsProps {\r\n  endDate: Date | null;\r\n  isMobile: boolean;\r\n}\r\nexport const usePageActions = ({ endDate, isMobile }: usePageActionsProps) => {\r\n  const { t } = useTranslation();\r\n  const appSettings = useSelector(selectAppSettings);\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const { newDate } = useSystemDate();\r\n  const disableActionButtons =\r\n    endDate === null ||\r\n    dateUtils.truncateTime(endDate) > dateUtils.truncateTime(newDate())\r\n      ? true\r\n      : undefined;\r\n  const disabledTitle = disableActionButtons\r\n    ? t(translations.EndDateMustBeSetToTodayOrEarlier)\r\n    : undefined;\r\n  const pageActions = React.useMemo(() => {\r\n    if (endDate == null) {\r\n      return [];\r\n    }\r\n    const accumulateInvoices = globalSettings.GetBoolean(\r\n      AllowedSettings[AllowedSettings.AccumulateNewChargesToExistingInvoice],\r\n    );\r\n    // TODO: provide properly typed actions: PageActionRenderer\r\n    const actions: PageActionRenderer2<IInvoiceBudgetBalanceDto>[] = [];\r\n\r\n    if (accumulateInvoices) {\r\n      actions.unshift((dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n        <GenerateInvoicesButton\r\n          disabled={disableActionButtons}\r\n          disabledTitle={disabledTitle}\r\n          endDate={endDate}\r\n          selected={selectedRows ?? []}\r\n        />\r\n      ));\r\n    }\r\n    if (IsModuleEnabled(appSettings, KnownModules.WS_Billing)) {\r\n      actions.unshift(() => (\r\n        <ChargeOnlineBudgetsButton\r\n          disabled={disableActionButtons}\r\n          disabledTitle={disabledTitle}\r\n        />\r\n      ));\r\n      actions.unshift((dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n        <GenerateInvoicesAndSendToSap\r\n          endDate={endDate}\r\n          selected={selectedRows ?? []}\r\n          disabled={disableActionButtons}\r\n          disabledTitle={disabledTitle}\r\n        />\r\n      ));\r\n    }\r\n    if (accumulateInvoices) {\r\n      actions.push((dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n        <PayButton\r\n          endDate={endDate}\r\n          selected={selectedRows ?? []}\r\n          disabled={disableActionButtons}\r\n          disabledTitle={disabledTitle}\r\n        />\r\n      ));\r\n    }\r\n    if (isMobile) {\r\n      return [\r\n        (dataCount, onRefresh, appliedFilters, selectedRows) => (\r\n          <ReactActions\r\n            id=\"foobar\"\r\n            items={actions.map((item, index) => (\r\n              <span key={index}>\r\n                {item(dataCount, onRefresh, appliedFilters, selectedRows)}\r\n              </span>\r\n            ))}\r\n          />\r\n        ),\r\n      ];\r\n    }\r\n    return actions;\r\n  }, [\r\n    appSettings,\r\n    disableActionButtons,\r\n    disabledTitle,\r\n    endDate,\r\n    globalSettings,\r\n    isMobile,\r\n  ]);\r\n  return pageActions;\r\n};\r\n","import { IAuthenticatedUser } from 'types/AuthenticatedUser';\r\n\r\nimport { toQueryString } from 'utils/url-utils';\r\n\r\nexport function getDefaultFilter(user: IAuthenticatedUser) {\r\n  const result = toQueryString({\r\n    HasBalanceOrEstimatedCharges: true,\r\n    BudgetIsOnline: true,\r\n  });\r\n  return result;\r\n}\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InvoiceDetailsPage = lazyLoad(\r\n  () => import('./InvoiceDetailsPage/index'),\r\n  module => module.InvoiceDetailsPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const WorkOrderDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.WorkOrderDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Billing Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Billing = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BillingPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingActions Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BillingActions = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BillingActionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingActionsDetails Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BillingActionsDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BillingActionsDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LocationTypesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LocationTypesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LocationTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubLocationTypesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SubLocationTypesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\nimport { withoutGlobalServiceGroupFilter } from 'app/components/BasicTable/withoutGlobalServiceGroupFilter';\r\n\r\nexport const SavedViewDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => withoutGlobalServiceGroupFilter(module.SavedViewDetailsPage),\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for BillingActions Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\nimport { withoutGlobalServiceGroupFilter } from 'app/components/BasicTable/withoutGlobalServiceGroupFilter';\r\n\r\nexport const SavedViews = lazyLoad(\r\n  () => import('./index'),\r\n  module => withoutGlobalServiceGroupFilter(module.SavedViewsPage),\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LabelTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelTypesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LabelTypesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AssetDetailsPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelPrintDialog = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LabelPrintDialog,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for KioskProjectsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const KioskProjectsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.KioskProjectsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for KioskProjectConsumablesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const KioskProjectConsumablesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.KioskProjectConsumablesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for KioskProjectsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PrivateKioskProjectsRoute = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.PrivateKioskProjectsRoute,\r\n);\r\n","import { httpClient } from 'api/HttpClient';\r\n\r\nconst SESSIONTIMEOUT_ASHX_CACHE_BUST = new Date().getTime();\r\n\r\nfunction GetData(\r\n  url: string,\r\n  Fulfilled: (value: string) => void,\r\n  Rejected: () => null,\r\n) {\r\n  httpClient\r\n    .get(url, { _: SESSIONTIMEOUT_ASHX_CACHE_BUST })\r\n    .then(response => Fulfilled(response as string), Rejected);\r\n}\r\n\r\nvar checkFailCount: number = 0;\r\nexport const CheckSessionTimeout = function (\r\n  loginUrl: string,\r\n  appRoot: string,\r\n  showWarning: () => void,\r\n  /*, hideWarning*/\r\n) {\r\n  var checkInterval: number = 60000;\r\n  var redirectAction = function () {\r\n    window.onbeforeunload = null;\r\n    var currentUrl = window.location.pathname + window.location.search;\r\n    var redirUrl = loginUrl + '?ReturnUrl=' + encodeURIComponent(currentUrl);\r\n    console.log('redirecting to login page');\r\n    window.location.href = redirUrl;\r\n  };\r\n  var check = function () {\r\n    GetData(\r\n      appRoot,\r\n      (data: string) => {\r\n        checkFailCount = 0;\r\n        switch (data) {\r\n          case 'ok':\r\n            //showWarning(); //for test\r\n            break;\r\n          case 'logout':\r\n            redirectAction();\r\n            break;\r\n          case 'alert':\r\n            showWarning();\r\n            break;\r\n          default:\r\n            redirectAction();\r\n            break;\r\n        }\r\n        setTimeout(check, checkInterval);\r\n      },\r\n      () => {\r\n        checkFailCount++;\r\n        console.error(\r\n          'Failed to check active session on the server x' + checkFailCount,\r\n        );\r\n        if (checkFailCount > 2) {\r\n          redirectAction();\r\n        }\r\n        return null;\r\n      },\r\n    );\r\n  };\r\n  setTimeout(check, checkInterval);\r\n};\r\n\r\nexport function ExtendSessionTimeout(Fulfilled: (value: string) => void) {\r\n  httpClient\r\n    .post('/svc/Script/AjaxService.svc/ExtendSessionTimeout', {\r\n      dataType: 'json',\r\n      contentType: 'application/json; charset=utf-8',\r\n    })\r\n    .then(response => Fulfilled(response as string));\r\n}\r\n","/**\r\n *\r\n * DialogAlert\r\n *\r\n */\r\nimport React from 'react';\r\nimport {\r\n  Dialog,\r\n  DialogTitle,\r\n  DialogContent,\r\n  DialogContentText,\r\n  DialogActions,\r\n  useTheme,\r\n  useMediaQuery,\r\n} from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\n\r\nexport interface DialogAlertProps {\r\n  title: string;\r\n  value: string | undefined;\r\n  buttonText: string;\r\n  show: boolean;\r\n  onButtonClick: () => void;\r\n  onClose: () => void;\r\n}\r\n\r\nexport const DialogAlert = ({\r\n  title,\r\n  value,\r\n  buttonText,\r\n  show,\r\n  onButtonClick,\r\n  onClose,\r\n}: DialogAlertProps) => {\r\n  const handleClose = () => {\r\n    onClose();\r\n  };\r\n  const handleButtonClick = () => {\r\n    onButtonClick();\r\n  };\r\n  const theme = useTheme();\r\n  const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\r\n\r\n  if (show) {\r\n    return (\r\n      <Dialog\r\n        open={true}\r\n        fullScreen={fullScreen}\r\n        onClose={handleClose}\r\n        aria-labelledby=\"alert-dialog-title\"\r\n        aria-describedby=\"alert-dialog-description\"\r\n      >\r\n        <DialogTitle id=\"alert-dialog-title\">{title}</DialogTitle>\r\n        <DialogContent>\r\n          <DialogContentText id=\"alert-dialog-description\">\r\n            {value}\r\n          </DialogContentText>\r\n        </DialogContent>\r\n        <DialogActions>\r\n          <Button onClick={handleButtonClick} color=\"primary\">\r\n            {buttonText}\r\n          </Button>\r\n        </DialogActions>\r\n      </Dialog>\r\n    );\r\n  } else {\r\n    return <> </>;\r\n  }\r\n};\r\n","/**\r\n *\r\n * SessionTimeout\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { useState } from 'react';\r\nimport { CheckSessionTimeout, ExtendSessionTimeout } from './SessionTimeout';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAuthenticatedUser } from 'app/slice/selectors';\r\nimport { DialogAlert } from './DialogAlert';\r\nimport { Roles } from 'app/slice/types';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface SessionTimeoutProps {}\r\n\r\nexport function SessionTimeout() {\r\n  const { t } = useTranslation();\r\n  const authenticatedUser = useSelector(selectAuthenticatedUser);\r\n  var loginUrl = toRootedURL('/login.aspx');\r\n  // math.random is needed to bust the cache for clients with cached result\r\n  var checkUrl = `/sessionTimeout.ashx`;\r\n  var ignoreSession = React.useMemo(() => {\r\n    return (\r\n      authenticatedUser !== undefined &&\r\n      (authenticatedUser.Roles.indexOf(Roles.CalendarOnly) >= 0 ||\r\n        authenticatedUser.Roles.indexOf(Roles.RoomOnly) >= 0 ||\r\n        authenticatedUser.Roles.indexOf(Roles.KioskAdmin) >= 0)\r\n    );\r\n  }, [authenticatedUser]);\r\n  const [show, setShow] = useState(false);\r\n  React.useEffect(() => {\r\n    CheckSessionTimeout(loginUrl, checkUrl, () => {\r\n      setShow(true);\r\n    });\r\n    if (ignoreSession) {\r\n      ExtendSessionTimeout((value: string) => {});\r\n    }\r\n  }, [checkUrl, ignoreSession, loginUrl]);\r\n\r\n  function onClose() {\r\n    setShow(false);\r\n  }\r\n\r\n  function onButtonClick() {\r\n    ExtendSessionTimeout((value: string) => {});\r\n    setShow(false);\r\n  }\r\n  return ignoreSession ? (\r\n    <React.Fragment></React.Fragment>\r\n  ) : (\r\n    <DialogAlert\r\n      title={t(translations.Warning) as string}\r\n      value={t(translations.SessionExpirationWarning) as string}\r\n      buttonText={t(translations.OK) as string}\r\n      show={show}\r\n      onButtonClick={() => onButtonClick()}\r\n      onClose={() => onClose()}\r\n    />\r\n  );\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for SubmissionsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubmissionsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SubmissionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for QuizzesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const QuizzesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.QuizzesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AdHocReportListPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AdHocReportListPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AdHocReportListPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Rooms Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Rooms = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.Rooms,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CalendarMessages Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CalendarMessages = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CalendarMessagesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CoresDirectoryPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoresDirectoryPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CoresDirectoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SamplePlatesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SamplePlatesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SamplePlatesPage,\r\n);\r\n","import {\r\n  //selectAppSettings,\r\n  selectglobalSettings,\r\n  selectIsAuthenticated,\r\n  selectLoading,\r\n  selectSiteMapProvider,\r\n  selectSiteMapSettings,\r\n} from 'app/slice/selectors';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport { useLocation } from 'react-router-dom';\r\n//import { AppSettings } from 'types/AppSettings';\r\nimport { NoAuthNodes } from 'types/SiteMapSettings';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { toLowerCaseSafely } from 'utils/typeUtils';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface TabTitleProps {\r\n  isDispatcherLoading: boolean;\r\n  i18Language: string;\r\n}\r\n\r\nexport const useTabTitle = (): [\r\n  string | undefined, //pageTitle:\r\n  string | undefined, //pageIcon:\r\n  (string) => void, //setPageTitle:\r\n  (string) => void, //setPageIcon:\r\n  boolean,\r\n] => {\r\n  const location = useLocation();\r\n  const [loaded, setLoaded] = React.useState<boolean>(false);\r\n  const selectorLoading = useSelector(selectLoading);\r\n  const { t } = useTranslation();\r\n  //const appSettings: AppSettings | null = useSelector(selectAppSettings);\r\n  const siteMapSettings = useSelector(selectSiteMapSettings);\r\n  const siteMapProvider = useSelector(selectSiteMapProvider);\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const [title, setTitle] = React.useState<string | undefined>(undefined);\r\n  //const favIconImg: string | undefined = appSettings?.FavIconImg;\r\n  //const favIconTitle: string | undefined = appSettings?.FavIconTitle;\r\n  const globalSettings = useSelector(selectglobalSettings);\r\n  const favIconImg: string | undefined = globalSettings.GetString(\r\n    AllowedSettings.FavIconImg,\r\n  );\r\n  const favIconTitle: string | undefined = globalSettings.GetString(\r\n    AllowedSettings.FavIconTitle,\r\n  );\r\n  const getFavIconLink = () =>\r\n    document.getElementById('tabFavIcon') as HTMLLinkElement;\r\n\r\n  const handleFavIconChange = (favIcon: string | undefined) => {\r\n    let favLink = getFavIconLink();\r\n    if (favLink !== null) {\r\n      if (favIcon !== undefined && favIcon !== '') {\r\n        favLink.href = toRootedURL('/uploads/Branding/' + favIcon);\r\n      } else {\r\n        favLink.href = process.env.PUBLIC_URL + '/favicon.png';\r\n      }\r\n    }\r\n  };\r\n  const handleTitleChange = (title: string | undefined) => {\r\n    if (title !== undefined && title !== '') {\r\n      document.title = title;\r\n    } else {\r\n      document.title = 'BookitLab!';\r\n    }\r\n  };\r\n  React.useEffect(() => {\r\n    let active = !selectorLoading && !loaded;\r\n    if (active) {\r\n      if (isAuthenticated === true) {\r\n        if (!!siteMapSettings && siteMapSettings !== null) {\r\n          let node = siteMapProvider.findNode(location.pathname);\r\n          if (node !== undefined && !!favIconImg && !!favIconTitle) {\r\n            setTitle(\r\n              () => `${favIconTitle} - ${node === undefined ? '' : node.Title}`,\r\n            );\r\n            setLoaded(true);\r\n          }\r\n        }\r\n      } else {\r\n        let node = NoAuthNodes(t).find(element => {\r\n          if (element !== undefined) {\r\n            const reactUrl = toLowerCaseSafely(element.reactUrl);\r\n            if (reactUrl !== null) {\r\n              let rpath = reactUrl.split('?')[0] ?? reactUrl;\r\n              return location.pathname.toLowerCase().indexOf(rpath) > -1;\r\n            } else {\r\n              return (\r\n                element.Url.toLowerCase().indexOf(\r\n                  location.pathname.toLowerCase(),\r\n                ) > -1\r\n              );\r\n            }\r\n          }\r\n          return undefined;\r\n        });\r\n        if (node !== undefined && !!favIconImg && !!favIconTitle) {\r\n          setTitle(\r\n            () => `${favIconTitle} - ${node === undefined ? '' : node.Title}`,\r\n          );\r\n          setLoaded(true);\r\n        }\r\n      }\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    favIconImg,\r\n    favIconTitle,\r\n    isAuthenticated,\r\n    loaded,\r\n    location.pathname,\r\n    selectorLoading,\r\n    siteMapProvider,\r\n    siteMapSettings,\r\n    t,\r\n  ]);\r\n  return [favIconImg, title, handleFavIconChange, handleTitleChange, loaded];\r\n};\r\n","import * as React from 'react';\r\nimport { useEffect } from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport { selectLoading } from 'app/slice/selectors';\r\n\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useTabTitle } from './useTabTitle';\r\n\r\nexport interface HeadTitleProps {\r\n  isDispatcherLoading: boolean;\r\n  i18Language: string;\r\n}\r\n\r\nexport function HeadTitle() {\r\n  const { i18n } = useTranslation();\r\n  const isDispatcherLoading = useSelector(selectLoading);\r\n\r\n  const [\r\n    favIcon,\r\n    title,\r\n    handleFavIconChange,\r\n    handleTitleChange,\r\n    loaded,\r\n  ] = useTabTitle();\r\n  useEffect(() => {\r\n    let active = !isDispatcherLoading && loaded;\r\n\r\n    if (active) {\r\n      handleFavIconChange(favIcon);\r\n      handleTitleChange(title);\r\n    }\r\n    return () => {\r\n      active = false;\r\n    };\r\n  }, [\r\n    favIcon,\r\n    handleFavIconChange,\r\n    handleTitleChange,\r\n    isDispatcherLoading,\r\n    loaded,\r\n    title,\r\n  ]);\r\n\r\n  // const globalSettings = useSelector(selectglobalSettings);\r\n  // const siteMapProvider = useSelector(selectSiteMapProvider);\r\n  // const [currentNode, setCurrentNode] = React.useState<SiteMapNode | undefined>(\r\n  //   undefined,\r\n  // );\r\n  // const [favIcon, setFavIcon] = React.useState<string | undefined>(undefined);\r\n  // const [favIconTitle, setFavIconTitle] = React.useState<string | undefined>(\r\n  //   undefined,\r\n  // );\r\n  // const [, setLink] = React.useState<HTMLLinkElement | null>(null);\r\n  // const createLink = React.useMemo(() => {\r\n  //   let link: HTMLLinkElement | null = document.querySelector(\r\n  //     \"link[rel~='icon']\",\r\n  //   );\r\n  //   if (link === null) {\r\n  //     link = document.createElement('link');\r\n  //     link.rel = 'icon';\r\n  //     document.getElementsByTagName('head')[0].appendChild(link);\r\n  //   }\r\n  //   if (favIcon !== undefined && favIcon !== '') {\r\n  //     link.href = toRootedURL('/uploads/Branding/' + favIcon);\r\n  //   } else {\r\n  //     link.href = process.env.PUBLIC_URL + '/favicon.png';\r\n  //   }\r\n  //   return link;\r\n  // }, [favIcon]);\r\n  //  React.useMemo(() => {\r\n  //   return siteMapProvider.findNode(location.pathname);\r\n  // }, [siteMapProvider, location.pathname]);\r\n  // const [pageTitle, setPageTitle] = useState<string | undefined>(undefined);\r\n  // useEffect(() => {\r\n  //   let active = !isDispatcherLoading;\r\n  //   if (active) {\r\n  //     setCurrentNode(() => siteMapProvider.findNode(location.pathname));\r\n  //     setFavIcon(() => globalSettings.GetString(AllowedSettings.FavIconImg));\r\n  //     setFavIconTitle(() =>\r\n  //       globalSettings.GetString(AllowedSettings.FavIconTitle),\r\n  //     );\r\n  //     setPageTitle(\r\n  //       () =>\r\n  //         `${favIconTitle} - ${\r\n  //           currentNode === undefined ? '' : currentNode?.Title\r\n  //         }`,\r\n  //     );\r\n  //     setLink(() => createLink);\r\n  //   }\r\n  //   return () => {\r\n  //     active = false;\r\n  //   };\r\n  //   // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  // }, [\r\n  //   currentNode,\r\n  //   favIcon,\r\n  //   favIconTitle,\r\n  //   globalSettings,\r\n  //   isDispatcherLoading,\r\n  //   location.pathname,\r\n  // ]);\r\n  //RENDER\r\n  return (\r\n    <Helmet\r\n      titleTemplate=\"%s - BookitLab!\"\r\n      defaultTitle={title || 'BookitLab!'}\r\n      htmlAttributes={{ lang: i18n.language }}\r\n    >\r\n      <meta name=\"description\" content=\"{process.env.PUBLIC_URL}\" />\r\n    </Helmet>\r\n  );\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InstrumentRestrictionsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.InstrumentRestrictionsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for LabelTypeDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LabelTypeDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LabelTypeDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ConfigurableColumnExportImport Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ConfigurableColumnExportImportPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ConfigurableColumnExportImportPage,\r\n);\r\n","/**\r\n *\r\n * ShortURLRoute\r\n *\r\n */\r\nimport React from 'react';\r\nimport { RouteComponentProps, useHistory, useLocation } from 'react-router';\r\nimport { RouteProps, Route } from 'react-router-dom';\r\nimport { toRootedURL } from 'utils/url-utils';\r\n\r\nexport interface ShortURLRouteProps extends Omit<RouteProps, 'render'> {}\r\n/**\r\n * Forces url reload for external pages after navigation from react router (push/Redirect/etc.) and the page needs server side reload\r\n * @param props route props\r\n * @returns redirect\r\n */\r\nexport function ShortURLRoute(props: ShortURLRouteProps): React.ReactElement {\r\n  const location = useLocation();\r\n  const render = (propss: RouteComponentProps) => {\r\n    const path =\r\n      propss.location.pathname + propss.location.search + propss.location.hash;\r\n    const rooted = toRootedURL(path);\r\n    console.info(`Reloading external url ${path}`);\r\n    if (\r\n      propss.location.pathname.toLowerCase() === location.pathname.toLowerCase()\r\n    ) {\r\n      return null;\r\n    }\r\n    window.location.href = rooted;\r\n    return null;\r\n  };\r\n\r\n  return <Route {...props} render={render} />;\r\n}\r\n\r\nexport const DebugRouter = ({ children }: { children: any }) => {\r\n  const { location } = useHistory();\r\n  if (process.env.NODE_ENV === 'development') {\r\n    console.log(\r\n      `Route: ${location.pathname}${location.search}, State: ${JSON.stringify(\r\n        location.state,\r\n      )}`,\r\n    );\r\n  }\r\n\r\n  return children;\r\n};\r\n","/**\r\n *\r\n * ServerBarcodeRoute\r\n *\r\n */\r\nimport React from 'react';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { ShortURLRoute } from '../ShortURLRoute';\r\n\r\nexport interface ServerBarcodeRouteProps {\r\n  appSettings: AppSettings | null;\r\n}\r\n\r\n/**\r\n * Forces url reload for external pages after navigation from react router (push/Redirect/etc.) and the page needs server side reload\r\n * @param props route props\r\n * @returns redirect\r\n */\r\nexport function ServerBarcodeRoute({\r\n  appSettings,\r\n}: ServerBarcodeRouteProps): React.ReactElement {\r\n  // collect short url templates from system settings\r\n  const templates: Array<string> = [\r\n    appSettings?.AssetBarcodeRelativeUrlTemplate,\r\n    appSettings?.RoomBarcodeRelativeUrlTemplate,\r\n    appSettings?.LocationBarcodeRelativeUrlTemplate,\r\n    appSettings?.SubLocationBarcodeRelativeUrlTemplate,\r\n  ]\r\n    .map(p => p ?? '')\r\n    .filter(p => p !== '');\r\n\r\n  // replace handlebars based templates to react format\r\n  // e.g. /location/{{RoomId}}/{{LocationId}} => /location/:param1?/:param2?\r\n  const replaceHandlebarTokens = function (s) {\r\n    let index = 0;\r\n    const result = s.replace(/({{[^}]+}})/g, function () {\r\n      return `:param${index++}?`;\r\n    });\r\n    return result;\r\n  };\r\n  if (appSettings == null) {\r\n    return <></>;\r\n  }\r\n\r\n  const paths = templates\r\n    .map(p =>\r\n      // react router path should start with /\r\n      replaceHandlebarTokens(p),\r\n    )\r\n    .map(p => (p.startsWith('/') ? p : '/' + p));\r\n\r\n  // use the paths matching the shorturltemplates and use the dedicated route for all\r\n  return <ShortURLRoute exact path={paths} />;\r\n}\r\n","/**\r\n * Asynchronously loads the component for NewMessagePage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NewMessagePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.NewMessagePage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for OtherServiceDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const OtherServiceDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.OtherServiceDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for InvoiceTemplates Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const InvoiceTemplates = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.InvoiceTemplatesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Expenses Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Expenses = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ExpensesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for PricePeriods Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PricePeriodsPagePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.PricePeriods,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for PriceSheetPeriodDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PriceSheetPeriodDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.PriceSheetPeriodDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ArticlesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ArticlesPagePath = '/articles';\r\nexport const ArticlesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ArticlesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AccountLayout = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AccountLayout,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const RegisterPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.RegisterPage,\r\n);\r\n","/**\r\n * Asynchronously loads the component for CalendarPage\r\n */\r\nimport { withGlobalServiceGroupFilter } from 'app/components/BasicTable/withGlobalServiceGroupFilter';\r\nimport { lazyLoad } from 'utils/loadable';\r\nimport { withSaveAsLastVisitedPage } from '../../hocs/withSaveAsLastVisitedPage';\r\n\r\nexport const CalendarPage = lazyLoad(\r\n  () => import('./index'),\r\n  module =>\r\n    withSaveAsLastVisitedPage(\r\n      withGlobalServiceGroupFilter(module.CalendarPage, true),\r\n    ),\r\n);\r\n\r\nexport const CalendarPageDefaultRedir = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CalendarPageDefaultRedir,\r\n);\r\n","import * as React from 'react';\r\nimport { useProfileSetting } from 'app/components/BasicTable/useProfileSetting';\r\nimport { IBasePageProps } from '../pages/IBasePageProps';\r\nimport { getLogger } from 'utils/logLevel';\r\n\r\n/**\r\n * Enables wrapped page to be saved as the Last Visited Page. This is used to redirect users after login to the last visited page\r\n * @param Component Page component\r\n * @returns\r\n */\r\n\r\nexport function withSaveAsLastVisitedPage<TProps extends IBasePageProps>(\r\n  Component: React.FC<TProps>,\r\n) {\r\n  const log = getLogger('withSaveAsLastVisitedPage');\r\n  return (props: TProps) => {\r\n    const LAST_SAVED_PAGE_PROFILE_KEY = 'LastVisitedPage';\r\n    // reconstruct back the location in the aspnet compatible relative path e.g. ~/schedule/calendar?id=1#foobar\r\n    const location = [\r\n      '~',\r\n      props.location.pathname,\r\n      props.location.search,\r\n      props.location.hash,\r\n    ].join('');\r\n\r\n    // warning: updateY might mutate after the \"savedValue\" change inside the useProfileSetting\r\n    // this might lead to useEffect firing 2 times for each location change -\r\n    // first time when location changes, and then once again on update function change\r\n    const { updateValue: updateY } = useProfileSetting({\r\n      profileSettingKey: LAST_SAVED_PAGE_PROFILE_KEY,\r\n    });\r\n\r\n    // update the profile setting on each location change on current page\r\n    React.useEffect(() => {\r\n      updateY(location);\r\n      log.info('LastVisitedPage', location);\r\n    }, [location, updateY]);\r\n\r\n    // wrapped component render\r\n    return <Component {...props} />;\r\n  };\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for ReservationDetailsPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ReservationDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ReservationDetailsPage,\r\n);\r\n","/**\r\n * Asynchronously loads the component for HomePage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const HomePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.HomePage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SystemPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SystemPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const DashboardPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.DefaultDashboardPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CoreSelectionPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoreSelectionPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CoreSelectionPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoreHomePage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CoreHomeByRoutePage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CoreStatsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CoreStatsPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ReportingPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ReportingPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BookitLabDashboadPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BookitLabDashboadPage,\r\n);\r\n","/**\r\n *\r\n * RedirectWithSearch\r\n *\r\n */\r\nimport * as React from 'react';\r\nimport { Redirect, RedirectProps, useLocation } from 'react-router';\r\n\r\nexport interface RedirectWithSearchProps extends RedirectProps {\r\n  preserveSearch?: boolean;\r\n}\r\n\r\nexport function RedirectWithSearch({\r\n  preserveSearch = true,\r\n\r\n  to,\r\n  ...props\r\n}: RedirectWithSearchProps) {\r\n  const location = useLocation();\r\n  to.search = location.search;\r\n  return <Redirect to={to} {...props} />;\r\n}\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetSelectionPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetSelectionPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AssetSelectionPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const TermsOfUseAgreementPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.TermsOfUseAgreementPage,\r\n);\r\n","import { makeStyles, Theme } from '@material-ui/core';\r\nimport Box, { BoxProps } from '@material-ui/core/Box';\r\nimport { createStyles } from '@material-ui/styles';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectSnackBarIndex } from '../../slice/selectors';\r\nimport clsx from 'clsx';\r\n\r\nexport interface SnackWrapperProps extends BoxProps {\r\n  children: React.ReactNode;\r\n}\r\n\r\nexport function SnackWrapper(props: SnackWrapperProps) {\r\n  const upSnackbarIndex = useSelector(selectSnackBarIndex);\r\n  const classes = useStyles();\r\n  return (\r\n    <Box className={clsx({ [classes.zindex301]: upSnackbarIndex })}>\r\n      {props.children}\r\n    </Box>\r\n  );\r\n}\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n  createStyles({\r\n    zindex301: {\r\n      '& > div': {\r\n        zIndex: 1301,\r\n      },\r\n    },\r\n  }),\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ActiveUserGroupPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ActiveUserGroupPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CannedReportsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CannedReports,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UserAttributes Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const UserAttributes = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.UserAttributesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ReportConsumablesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ReportConsumablesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ReportConsumablesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const LoginPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.LoginPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for CalendarMessagesDetails\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const CalendarMessagesDetailsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.CalendarMessagesDetailsPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for ServiceRequestsKanbanPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ServiceRequestsKanbanPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ServiceRequestsKanbanPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for OfflineServiceTypes Page\r\n *\r\n */\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const OfflineServiceTypesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.OfflineServiceTypesPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AnimalCasePage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AnimalCaseEditPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AnimalCaseEditPage,\r\n);\r\n","import {\r\n  IconLookup,\r\n  IconPrefix,\r\n  library,\r\n} from '@fortawesome/fontawesome-svg-core';\r\n/*\r\nIt is important to declare icons in the following way:\r\nimport { faName } from '@fortawesome/pro-solid-svg-icons/faName';\r\nThis prevents the entire icon pack from loading and only loads one specific icon.\r\n*/\r\nimport { faUserCircle } from '@fortawesome/pro-solid-svg-icons/faUserCircle';\r\nimport { faChevronUp } from '@fortawesome/pro-solid-svg-icons/faChevronUp';\r\nimport { faPencil } from '@fortawesome/pro-solid-svg-icons/faPencil';\r\nimport { faLock } from '@fortawesome/pro-solid-svg-icons/faLock';\r\nimport { faUsers } from '@fortawesome/pro-solid-svg-icons/faUsers';\r\nimport { faBell } from '@fortawesome/pro-solid-svg-icons/faBell';\r\nimport { faQuestionCircle } from '@fortawesome/pro-solid-svg-icons/faQuestionCircle';\r\nimport { faSignOutAlt } from '@fortawesome/pro-solid-svg-icons/faSignOutAlt';\r\nimport { faHome } from '@fortawesome/pro-solid-svg-icons/faHome';\r\nimport { faLayerGroup } from '@fortawesome/pro-solid-svg-icons/faLayerGroup';\r\nimport { faBookmark } from '@fortawesome/pro-solid-svg-icons/faBookmark';\r\nimport { faCalendarAlt } from '@fortawesome/pro-solid-svg-icons/faCalendarAlt';\r\nimport { faDumbbell } from '@fortawesome/pro-solid-svg-icons/faDumbbell';\r\nimport { faCommentAltDots } from '@fortawesome/pro-solid-svg-icons/faCommentAltDots';\r\nimport { faBolt } from '@fortawesome/pro-solid-svg-icons/faBolt';\r\nimport { faListUl } from '@fortawesome/pro-solid-svg-icons/faListUl';\r\nimport { faChartBar } from '@fortawesome/pro-solid-svg-icons/faChartBar';\r\nimport { faChartColumn } from '@fortawesome/pro-solid-svg-icons/faChartColumn';\r\nimport { faChartLine } from '@fortawesome/pro-solid-svg-icons/faChartLine';\r\nimport { faChartPie } from '@fortawesome/pro-solid-svg-icons/faChartPie';\r\nimport { faChartPieAlt } from '@fortawesome/pro-solid-svg-icons/faChartPieAlt';\r\nimport { faMegaphone } from '@fortawesome/pro-solid-svg-icons/faMegaphone';\r\nimport { faFileInvoiceDollar } from '@fortawesome/pro-solid-svg-icons/faFileInvoiceDollar';\r\nimport { faCog } from '@fortawesome/pro-solid-svg-icons/faCog';\r\nimport { faTimes } from '@fortawesome/pro-solid-svg-icons/faTimes';\r\nimport { faCircle } from '@fortawesome/pro-solid-svg-icons/faCircle';\r\nimport { faCircleSmall } from '@fortawesome/pro-solid-svg-icons/faCircleSmall';\r\nimport { faCircleCheck } from '@fortawesome/pro-solid-svg-icons/faCircleCheck';\r\nimport { faPrint } from '@fortawesome/pro-solid-svg-icons/faPrint';\r\nimport { faSearch } from '@fortawesome/pro-solid-svg-icons/faSearch';\r\nimport { faChevronDoubleUp } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleUp';\r\nimport { faChevronDoubleDown } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleDown';\r\nimport { faCheck } from '@fortawesome/pro-solid-svg-icons/faCheck';\r\nimport { faCheckDouble } from '@fortawesome/pro-solid-svg-icons/faCheckDouble';\r\nimport { faInfo } from '@fortawesome/pro-solid-svg-icons/faInfo';\r\nimport { faTriangleExclamation } from '@fortawesome/pro-solid-svg-icons/faTriangleExclamation';\r\nimport { faXmark } from '@fortawesome/pro-solid-svg-icons/faXmark';\r\nimport { faChevronDown } from '@fortawesome/pro-solid-svg-icons/faChevronDown';\r\nimport { faCircleXmark } from '@fortawesome/pro-solid-svg-icons/faCircleXmark';\r\nimport { faEllipsisV } from '@fortawesome/pro-solid-svg-icons/faEllipsisV';\r\nimport { faPlus } from '@fortawesome/pro-solid-svg-icons/faPlus';\r\nimport { faFilter } from '@fortawesome/pro-solid-svg-icons/faFilter';\r\nimport { faTable } from '@fortawesome/pro-solid-svg-icons/faTable';\r\nimport { faMinus } from '@fortawesome/pro-solid-svg-icons/faMinus';\r\nimport { faFileImport } from '@fortawesome/pro-solid-svg-icons/faFileImport';\r\nimport { faGlobe } from '@fortawesome/pro-solid-svg-icons/faGlobe';\r\nimport { faLockOpen } from '@fortawesome/pro-solid-svg-icons/faLockOpen';\r\nimport { faEdit } from '@fortawesome/pro-solid-svg-icons/faEdit';\r\nimport { faTrash } from '@fortawesome/pro-solid-svg-icons/faTrash';\r\nimport { faInfoCircle } from '@fortawesome/pro-solid-svg-icons/faInfoCircle';\r\nimport { faGripVertical } from '@fortawesome/pro-solid-svg-icons/faGripVertical';\r\nimport { faBellSlash } from '@fortawesome/pro-solid-svg-icons/faBellSlash';\r\nimport { faExclamationCircle } from '@fortawesome/pro-solid-svg-icons/faExclamationCircle';\r\nimport { faTimesCircle } from '@fortawesome/pro-solid-svg-icons/faTimesCircle';\r\nimport { faArrowLeft } from '@fortawesome/pro-solid-svg-icons/faArrowLeft';\r\nimport { faTools } from '@fortawesome/pro-solid-svg-icons/faTools';\r\nimport { faPlay } from '@fortawesome/pro-solid-svg-icons/faPlay';\r\nimport { faHistory } from '@fortawesome/pro-solid-svg-icons/faHistory';\r\nimport { faAdd } from '@fortawesome/pro-solid-svg-icons/faAdd';\r\nimport { faStream } from '@fortawesome/pro-solid-svg-icons/faStream';\r\nimport { faRulerTriangle } from '@fortawesome/pro-solid-svg-icons/faRulerTriangle';\r\nimport { faThList } from '@fortawesome/pro-solid-svg-icons/faThList';\r\nimport { faPencilAlt } from '@fortawesome/pro-solid-svg-icons/faPencilAlt';\r\nimport { faCalendarPlus } from '@fortawesome/pro-solid-svg-icons/faCalendarPlus';\r\nimport { faPause } from '@fortawesome/pro-solid-svg-icons/faPause';\r\nimport { faSave } from '@fortawesome/pro-solid-svg-icons/faSave';\r\nimport { faCalendars } from '@fortawesome/pro-solid-svg-icons/faCalendars';\r\nimport { faListTimeline } from '@fortawesome/pro-solid-svg-icons/faListTimeline';\r\nimport { faCode } from '@fortawesome/pro-solid-svg-icons/faCode';\r\nimport { faBan } from '@fortawesome/pro-solid-svg-icons/faBan';\r\nimport { faFloppyDiskCircleArrowRight } from '@fortawesome/pro-solid-svg-icons/faFloppyDiskCircleArrowRight';\r\nimport { faCalculator } from '@fortawesome/pro-solid-svg-icons/faCalculator';\r\nimport { faRefresh } from '@fortawesome/pro-solid-svg-icons/faRefresh';\r\nimport { faSquare } from '@fortawesome/pro-solid-svg-icons/faSquare';\r\nimport { faClone } from '@fortawesome/pro-solid-svg-icons/faClone';\r\nimport { faClock } from '@fortawesome/pro-solid-svg-icons/faClock';\r\nimport { faChevronRight } from '@fortawesome/pro-solid-svg-icons/faChevronRight';\r\nimport { faClipboardList } from '@fortawesome/pro-solid-svg-icons/faClipboardList';\r\nimport { faEnvelope } from '@fortawesome/pro-solid-svg-icons/faEnvelope';\r\nimport { faCalendar } from '@fortawesome/pro-solid-svg-icons/faCalendar';\r\nimport { faCheckCircle } from '@fortawesome/pro-solid-svg-icons/faCheckCircle';\r\nimport { faLink } from '@fortawesome/pro-solid-svg-icons/faLink';\r\nimport { faChevronDoubleRight } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleRight';\r\nimport { faChevronDoubleLeft } from '@fortawesome/pro-solid-svg-icons/faChevronDoubleLeft';\r\nimport { faChevronLeft } from '@fortawesome/pro-solid-svg-icons/faChevronLeft';\r\nimport { faChevronsLeft } from '@fortawesome/pro-solid-svg-icons/faChevronsLeft';\r\nimport { faChevronsRight } from '@fortawesome/pro-solid-svg-icons/faChevronsRight';\r\nimport { faList } from '@fortawesome/pro-solid-svg-icons/faList';\r\nimport { faUser } from '@fortawesome/pro-solid-svg-icons/faUser';\r\nimport { faGripHorizontal } from '@fortawesome/pro-solid-svg-icons/faGripHorizontal';\r\nimport { faArrowFromLeft } from '@fortawesome/pro-solid-svg-icons/faArrowFromLeft';\r\nimport { faVial } from '@fortawesome/pro-solid-svg-icons/faVial';\r\nimport { faStopwatch } from '@fortawesome/pro-solid-svg-icons/faStopwatch';\r\nimport { faWrench } from '@fortawesome/pro-solid-svg-icons/faWrench';\r\nimport { faArrowUpRightFromSquare } from '@fortawesome/pro-solid-svg-icons/faArrowUpRightFromSquare';\r\nimport { faExternalLink } from '@fortawesome/pro-solid-svg-icons/faExternalLink';\r\nimport { faExternalLinkAlt } from '@fortawesome/pro-solid-svg-icons/faExternalLinkAlt';\r\nimport { faClose } from '@fortawesome/pro-solid-svg-icons/faClose';\r\nimport { faDownload } from '@fortawesome/pro-solid-svg-icons/faDownload';\r\nimport { faBold } from '@fortawesome/pro-solid-svg-icons/faBold';\r\nimport { faItalic } from '@fortawesome/pro-solid-svg-icons/faItalic';\r\nimport { faUnderline } from '@fortawesome/pro-solid-svg-icons/faUnderline';\r\nimport { faH1 } from '@fortawesome/pro-solid-svg-icons/faH1';\r\nimport { faH2 } from '@fortawesome/pro-solid-svg-icons/faH2';\r\nimport { faQuoteRight } from '@fortawesome/pro-solid-svg-icons/faQuoteRight';\r\nimport { faListOl } from '@fortawesome/pro-solid-svg-icons/faListOl';\r\nimport { faFileAlt } from '@fortawesome/pro-solid-svg-icons/faFileAlt';\r\nimport { faAt } from '@fortawesome/pro-solid-svg-icons/faAt';\r\nimport { faBarcode } from '@fortawesome/pro-solid-svg-icons/faBarcode';\r\nimport { faChain } from '@fortawesome/pro-solid-svg-icons/faChain';\r\nimport { faPowerOff } from '@fortawesome/pro-solid-svg-icons/faPowerOff';\r\nimport { faPlug } from '@fortawesome/pro-solid-svg-icons/faPlug';\r\nimport { faMicroscope } from '@fortawesome/pro-solid-svg-icons/faMicroscope';\r\nimport { faCalendarCheck } from '@fortawesome/pro-solid-svg-icons/faCalendarCheck';\r\nimport { faCalendarExclamation } from '@fortawesome/pro-solid-svg-icons/faCalendarExclamation';\r\nimport { faCalendarTimes } from '@fortawesome/pro-solid-svg-icons/faCalendarTimes';\r\nimport { faFileUpload } from '@fortawesome/pro-solid-svg-icons/faFileUpload';\r\nimport { faSpinner } from '@fortawesome/pro-solid-svg-icons/faSpinner';\r\nimport { faMoneyCheckEdit } from '@fortawesome/pro-solid-svg-icons/faMoneyCheckEdit';\r\nimport { faLevelUpAlt } from '@fortawesome/pro-solid-svg-icons/faLevelUpAlt';\r\nimport { faPaperclip } from '@fortawesome/pro-solid-svg-icons/faPaperclip';\r\nimport { faAbacus } from '@fortawesome/pro-solid-svg-icons/faAbacus';\r\nimport { faAlbum } from '@fortawesome/pro-solid-svg-icons/faAlbum';\r\nimport { faFile } from '@fortawesome/pro-solid-svg-icons/faFile';\r\nimport { faSync } from '@fortawesome/pro-solid-svg-icons/faSync';\r\nimport { faRectangleVerticalHistory } from '@fortawesome/pro-solid-svg-icons/faRectangleVerticalHistory';\r\nimport { faUniversity } from '@fortawesome/pro-solid-svg-icons/faUniversity';\r\nimport { faShopSlash } from '@fortawesome/pro-solid-svg-icons/faShopSlash';\r\nimport { faDollarSign } from '@fortawesome/pro-solid-svg-icons/faDollarSign';\r\nimport { faExchange } from '@fortawesome/pro-solid-svg-icons/faExchange';\r\nimport { faClipboardListCheck } from '@fortawesome/pro-solid-svg-icons/faClipboardListCheck';\r\nimport { faSms } from '@fortawesome/pro-solid-svg-icons/faSms';\r\nimport { faUserPlus } from '@fortawesome/pro-solid-svg-icons/faUserPlus';\r\nimport { faUserShield } from '@fortawesome/pro-solid-svg-icons/faUserShield';\r\nimport { faWarning } from '@fortawesome/pro-solid-svg-icons/faWarning';\r\nimport { faLocationCrosshairs } from '@fortawesome/pro-solid-svg-icons/faLocationCrosshairs';\r\nimport { faCircleDollarToSlot } from '@fortawesome/pro-solid-svg-icons/faCircleDollarToSlot';\r\nimport { faCopy } from '@fortawesome/pro-solid-svg-icons/faCopy';\r\nimport { faCodeBranch } from '@fortawesome/pro-solid-svg-icons/faCodeBranch';\r\nimport { faChevronsUp } from '@fortawesome/pro-solid-svg-icons/faChevronsUp';\r\nimport { faChevronsDown } from '@fortawesome/pro-solid-svg-icons/faChevronsDown';\r\nimport { faEquals } from '@fortawesome/pro-solid-svg-icons/faEquals';\r\nimport { faFileSpreadsheet } from '@fortawesome/pro-solid-svg-icons/faFileSpreadsheet';\r\nimport { faFilePdf } from '@fortawesome/pro-solid-svg-icons/faFilePdf';\r\nimport { faFileImage } from '@fortawesome/pro-solid-svg-icons/faFileImage';\r\n\r\nimport { faCircleCheck as falCircleCheck } from '@fortawesome/pro-light-svg-icons/faCircleCheck';\r\nimport { faTriangleExclamation as falTriangleExclamation } from '@fortawesome/pro-light-svg-icons/faTriangleExclamation';\r\nimport { faCircleQuarters as falCircleQuarters } from '@fortawesome/pro-light-svg-icons/faCircleQuarters';\r\nimport { faCircleExclamation as falCircleExclamation } from '@fortawesome/pro-light-svg-icons/faCircleExclamation';\r\nimport { faMinimize as falMinimize } from '@fortawesome/pro-light-svg-icons/faMinimize';\r\nimport { faMaximize as falMaximize } from '@fortawesome/pro-light-svg-icons/faMaximize';\r\nimport { faTable as falTable } from '@fortawesome/pro-light-svg-icons/faTable';\r\nimport { faCalendars as falCalendars } from '@fortawesome/pro-light-svg-icons/faCalendars';\r\n\r\nimport { faTelescope as fadTelescope } from '@fortawesome/pro-duotone-svg-icons/faTelescope';\r\nimport { faInfinity as fadInfinity } from '@fortawesome/pro-duotone-svg-icons/faInfinity';\r\n\r\nimport { faCalendarCheck as fadCalendarCheck } from '@fortawesome/pro-duotone-svg-icons/faCalendarCheck';\r\nimport { faCalendarExclamation as fadCalendarExclamation } from '@fortawesome/pro-duotone-svg-icons/faCalendarExclamation';\r\nimport { faCalendarTimes as fadCalendarTimes } from '@fortawesome/pro-duotone-svg-icons/faCalendarTimes';\r\nimport { faCalendarPlus as fadCalendarPlus } from '@fortawesome/pro-duotone-svg-icons/faCalendarPlus';\r\n\r\nimport { faMaximize as farMaximize } from '@fortawesome/pro-regular-svg-icons/faMaximize';\r\nimport { faCommentQuestion as farCommentQuestion } from '@fortawesome/pro-regular-svg-icons/faCommentQuestion';\r\nimport { faCircleExclamation as farcircleExclamation } from '@fortawesome/pro-regular-svg-icons/faCircleExclamation';\r\nimport { faCircleCheck as farCircleCheck } from '@fortawesome/pro-regular-svg-icons/faCircleCheck';\r\n\r\nimport { faGoogle as fabGoogle } from '@fortawesome/free-brands-svg-icons/faGoogle';\r\nimport { faWindows as fabWindows } from '@fortawesome/free-brands-svg-icons/faWindows';\r\nimport { faNewspaper } from '@fortawesome/pro-solid-svg-icons/faNewspaper';\r\nimport { faFlag } from '@fortawesome/pro-solid-svg-icons/faFlag';\r\nimport { faBarcodeScan } from '@fortawesome/pro-solid-svg-icons/faBarcodeScan';\r\nimport { faMap } from '@fortawesome/pro-solid-svg-icons/faMap';\r\nimport { faBars } from '@fortawesome/pro-solid-svg-icons/faBars';\r\nimport { faMagnifyingGlass } from '@fortawesome/pro-solid-svg-icons/faMagnifyingGlass';\r\nimport { faGrid2 } from '@fortawesome/pro-solid-svg-icons/faGrid2';\r\nimport { faScrewdriver } from '@fortawesome/pro-solid-svg-icons/faScrewdriver';\r\nimport { faBullhorn } from '@fortawesome/pro-solid-svg-icons/faBullhorn';\r\nimport { faMoneyBill } from '@fortawesome/pro-solid-svg-icons/faMoneyBill';\r\nimport { faFileArrowUp } from '@fortawesome/pro-solid-svg-icons/faFileArrowUp';\r\nimport { faEarthEurope } from '@fortawesome/pro-solid-svg-icons/faEarthEurope';\r\nimport { faShare } from '@fortawesome/pro-solid-svg-icons/faShare';\r\nimport { faScannerKeyboard } from '@fortawesome/pro-solid-svg-icons/faScannerKeyboard';\r\nimport { faCircleNotch } from '@fortawesome/pro-solid-svg-icons/faCircleNotch';\r\nimport { faMapLocation } from '@fortawesome/pro-solid-svg-icons/faMapLocation';\r\nimport { faScrewdriverWrench } from '@fortawesome/pro-solid-svg-icons/faScrewdriverWrench';\r\nimport { faBandage } from '@fortawesome/pro-solid-svg-icons/faBandage';\r\nimport { faHourglassHalf } from '@fortawesome/pro-solid-svg-icons/faHourglassHalf';\r\nimport { faInfinity as fasInfinity } from '@fortawesome/pro-solid-svg-icons/faInfinity';\r\n\r\nimport { Entity } from 'types/common';\r\n\r\nexport type IconName =\r\n  | 'circle-user'\r\n  | 'user-circle'\r\n  | 'chevron-up'\r\n  | 'pencil'\r\n  | 'lock'\r\n  | 'users'\r\n  | 'bell'\r\n  | 'question-circle'\r\n  | 'sign-out-alt'\r\n  | 'home'\r\n  | 'layer-group'\r\n  | 'bookmark'\r\n  | 'calendar-alt'\r\n  | 'dumbbell'\r\n  | 'comment-alt-dots'\r\n  | 'bolt'\r\n  | 'list-ul'\r\n  | 'chart-bar'\r\n  | 'chart-column'\r\n  | 'chart-line'\r\n  | 'chart-pie'\r\n  | 'chart-pie-alt'\r\n  | 'megaphone'\r\n  | 'file-invoice-dollar'\r\n  | 'cog'\r\n  | 'times'\r\n  | 'circle'\r\n  | 'circle-small'\r\n  | 'circle-check'\r\n  | 'print'\r\n  | 'search'\r\n  | 'chevron-double-up'\r\n  | 'chevron-double-down'\r\n  | 'check'\r\n  | 'check-double'\r\n  | 'info'\r\n  | 'triangle-exclamation'\r\n  | 'xmark'\r\n  | 'chevron-down'\r\n  | 'circle-xmark'\r\n  | 'ellipsis-v'\r\n  | 'plus'\r\n  | 'filter'\r\n  | 'table'\r\n  | 'minus'\r\n  | 'file-import'\r\n  | 'globe'\r\n  | 'lock-open'\r\n  | 'edit'\r\n  | 'trash'\r\n  | 'info-circle'\r\n  | 'grip-vertical'\r\n  | 'bell-slash'\r\n  | 'exclamation-circle'\r\n  | 'times-circle'\r\n  | 'arrow-left'\r\n  | 'tools'\r\n  | 'play'\r\n  | 'history'\r\n  | 'add'\r\n  | 'stream'\r\n  | 'ruler-triangle'\r\n  | 'th-list'\r\n  | 'clipboard-list-check'\r\n  | 'pencil-alt'\r\n  | 'calendar-plus'\r\n  | 'pause'\r\n  | 'save'\r\n  | 'calendars'\r\n  | 'list-timeline'\r\n  | 'code'\r\n  | 'ban'\r\n  | 'floppy-disk-circle-arrow-right'\r\n  | 'calculator'\r\n  | 'refresh'\r\n  | 'square'\r\n  | 'clone'\r\n  | 'clock'\r\n  | 'chevron-right'\r\n  | 'clipboard-list'\r\n  | 'envelope'\r\n  | 'calendar'\r\n  | 'check-circle'\r\n  | 'link'\r\n  | 'chevron-double-right'\r\n  | 'chevron-double-left'\r\n  | 'chevron-left'\r\n  | 'chevrons-left'\r\n  | 'chevrons-right'\r\n  | 'list'\r\n  | 'user'\r\n  | 'grip-horizontal'\r\n  | 'arrow-from-left'\r\n  | 'vial'\r\n  | 'stopwatch'\r\n  | 'wrench'\r\n  | 'arrow-up-right-from-square'\r\n  | 'external-link'\r\n  | 'external-link-alt'\r\n  | 'close'\r\n  | 'download'\r\n  | 'bold'\r\n  | 'italic'\r\n  | 'underline'\r\n  | 'h1'\r\n  | 'h2'\r\n  | 'quote-right'\r\n  | 'list-ol'\r\n  | 'file-alt'\r\n  | 'at'\r\n  | 'barcode'\r\n  | 'chain'\r\n  | 'power-off'\r\n  | 'plug'\r\n  | 'microscope'\r\n  | 'calendar-check'\r\n  | 'calendar-exclamation'\r\n  | 'calendar-times'\r\n  | 'file-upload'\r\n  | 'spinner'\r\n  | 'money-check-edit'\r\n  | 'level-up-alt'\r\n  | 'paperclip'\r\n  | 'abacus'\r\n  | 'album'\r\n  | 'file'\r\n  | 'sync'\r\n  | 'rectangle-vertical-history'\r\n  | 'university'\r\n  | 'shop-slash'\r\n  | 'dollar-sign'\r\n  | 'exchange'\r\n  | 'sms'\r\n  | 'circle-check'\r\n  | 'triangle-exclamation'\r\n  | 'circle-quarters'\r\n  | 'circle-exclamation'\r\n  | 'minimize'\r\n  | 'maximize'\r\n  | 'table'\r\n  | 'calendars'\r\n  | 'telescope'\r\n  | 'infinity'\r\n  | 'calendar-check'\r\n  | 'calendar-exclamation'\r\n  | 'calendar-times'\r\n  | 'calendar-plus'\r\n  | 'maximize'\r\n  | 'comment-question'\r\n  | 'circle-exclamation'\r\n  | 'circle-check'\r\n  | 'google'\r\n  | 'user-plus'\r\n  | 'user-shield'\r\n  | 'warning'\r\n  | 'windows'\r\n  | 'location-crosshairs'\r\n  | 'circle-dollar-to-slot'\r\n  | 'code-branch'\r\n  | 'copy'\r\n  | 'chevrons-up'\r\n  | 'chevrons-down'\r\n  | 'equals'\r\n  | 'file-spreadsheet'\r\n  | 'file-pdf'\r\n  | 'newspaper'\r\n  | 'file-image'\r\n  | 'flag'\r\n  | 'barcode-scan'\r\n  | 'map'\r\n  | 'bars'\r\n  | 'magnifying-glass'\r\n  | 'grid-2'\r\n  | 'screwdriver'\r\n  | 'bullhorn'\r\n  | 'money-bill'\r\n  | 'file-arrow-up'\r\n  | 'earth-europe'\r\n  | 'share'\r\n  | 'scanner-keyboard'\r\n  | 'circle-notch'\r\n  | 'map-location'\r\n  | 'screwdriver-wrench'\r\n  | 'bandage'\r\n  | 'hourglass-half';\r\n\r\n//library.add(fas, fad, far, fal, faGoogle, faWindows);\r\nlibrary.add(\r\n  //fas\r\n  faUserCircle,\r\n  faChevronUp,\r\n  faPencil,\r\n  faLock,\r\n  faUsers,\r\n  faBell,\r\n  faQuestionCircle,\r\n  faSignOutAlt,\r\n  faHome,\r\n  faLayerGroup,\r\n  faBookmark,\r\n  faCalendarAlt,\r\n  faDumbbell,\r\n  faCommentAltDots,\r\n  faBolt,\r\n  faListUl,\r\n  faChartBar,\r\n  faChartColumn,\r\n  faChartLine,\r\n  faChartPie,\r\n  faChartPieAlt,\r\n  faMegaphone,\r\n  faFileInvoiceDollar,\r\n  faCog,\r\n  faTimes,\r\n  faCircle,\r\n  faCircleSmall,\r\n  faCircleCheck,\r\n  faPrint,\r\n  faSearch,\r\n  faChevronDoubleUp,\r\n  faChevronDoubleDown,\r\n  faCheck,\r\n  faCheckDouble,\r\n  faInfo,\r\n  faTriangleExclamation,\r\n  faXmark,\r\n  faChevronDown,\r\n  faCircleXmark,\r\n  faEllipsisV,\r\n  faPlus,\r\n  faFilter,\r\n  faTable,\r\n  faMinus,\r\n  faFileImport,\r\n  faGlobe,\r\n  faLockOpen,\r\n  faEdit,\r\n  faTrash,\r\n  faInfoCircle,\r\n  faGripVertical,\r\n  faBellSlash,\r\n  faExclamationCircle,\r\n  faTimesCircle,\r\n  faArrowLeft,\r\n  faTools,\r\n  faPlay,\r\n  faHistory,\r\n  faAdd,\r\n  faStream,\r\n  faRulerTriangle,\r\n  faThList,\r\n  faClipboardListCheck,\r\n  faPencilAlt,\r\n  faCalendarPlus,\r\n  faPause,\r\n  faSave,\r\n  faCalendars,\r\n  faListTimeline,\r\n  faCode,\r\n  faBan,\r\n  faFloppyDiskCircleArrowRight,\r\n  faCalculator,\r\n  faRefresh,\r\n  faSquare,\r\n  faClone,\r\n  faClock,\r\n  faChevronRight,\r\n  faClipboardList,\r\n  faEnvelope,\r\n  faCalendar,\r\n  faCheckCircle,\r\n  faLink,\r\n  faChevronDoubleRight,\r\n  faChevronDoubleLeft,\r\n  faChevronLeft,\r\n  faList,\r\n  faUser,\r\n  faGripHorizontal,\r\n  faArrowFromLeft,\r\n  faVial,\r\n  faStopwatch,\r\n  faWrench,\r\n  faArrowUpRightFromSquare,\r\n  faExternalLink,\r\n  faExternalLinkAlt,\r\n  faClose,\r\n  faDownload,\r\n  faBold,\r\n  faItalic,\r\n  faUnderline,\r\n  faH1,\r\n  faH2,\r\n  faQuoteRight,\r\n  faListOl,\r\n  faFileAlt,\r\n  faAt,\r\n  faBarcode,\r\n  faChain,\r\n  faPowerOff,\r\n  faPlug,\r\n  faMicroscope,\r\n  faCalendarCheck,\r\n  faCalendarExclamation,\r\n  faCalendarTimes,\r\n  faFileUpload,\r\n  faSpinner,\r\n  faMoneyCheckEdit,\r\n  faLevelUpAlt,\r\n  faPaperclip,\r\n  faAbacus,\r\n  faAlbum,\r\n  faFile,\r\n  faSync,\r\n  faRectangleVerticalHistory,\r\n  faUniversity,\r\n  faShopSlash,\r\n  faDollarSign,\r\n  faExchange,\r\n  faSms,\r\n  faUserPlus,\r\n  faUserShield,\r\n  faWarning,\r\n  faLocationCrosshairs,\r\n  faCircleDollarToSlot,\r\n  faCopy,\r\n  faCodeBranch,\r\n  faChevronsUp,\r\n  faChevronsDown,\r\n  faEquals,\r\n  faFileSpreadsheet,\r\n  faFilePdf,\r\n  faNewspaper,\r\n  faFileImage,\r\n  faFlag,\r\n  faBarcodeScan,\r\n  faMap,\r\n  faBars,\r\n  faMagnifyingGlass,\r\n  faGrid2,\r\n  faScrewdriver,\r\n  faBullhorn,\r\n  faMoneyBill,\r\n  faFileArrowUp,\r\n  faEarthEurope,\r\n  faScannerKeyboard,\r\n  faChevronsLeft,\r\n  faChevronsRight,\r\n  faCircleNotch,\r\n  faMapLocation,\r\n  faScrewdriverWrench,\r\n  faBandage,\r\n  faHourglassHalf,\r\n  fasInfinity,\r\n  //fal\r\n  falCircleCheck,\r\n  falTriangleExclamation,\r\n  falCircleQuarters,\r\n  falCircleExclamation,\r\n  falMinimize,\r\n  falMaximize,\r\n  falTable,\r\n  falCalendars,\r\n  //fad\r\n  fadTelescope,\r\n  fadInfinity,\r\n  fadCalendarCheck,\r\n  fadCalendarExclamation,\r\n  fadCalendarTimes,\r\n  fadCalendarPlus,\r\n  //far\r\n  farMaximize,\r\n  farCommentQuestion,\r\n  farcircleExclamation,\r\n  farCircleCheck,\r\n  //fab\r\n  fabGoogle,\r\n  fabWindows,\r\n  faShare,\r\n);\r\nexport type IconProp = IconName | [IconPrefix, IconName] | IconLookup;\r\n\r\nexport const IconNames: string[] = [\r\n  'circle-user',\r\n  'user-circle',\r\n  'chevron-up',\r\n  'pencil',\r\n  'lock',\r\n  'users',\r\n  'bell',\r\n  'question-circle',\r\n  'sign-out-alt',\r\n  'home',\r\n  'layer-group',\r\n  'bookmark',\r\n  'calendar-alt',\r\n  'dumbbell',\r\n  'comment-alt-dots',\r\n  'bolt',\r\n  'list-ul',\r\n  'chart-bar',\r\n  'chart-column',\r\n  'chart-line',\r\n  'chart-pie',\r\n  'chart-pie-alt',\r\n  'megaphone',\r\n  'file-invoice-dollar',\r\n  'cog',\r\n  'times',\r\n  'circle',\r\n  'circle-small',\r\n  'circle-check',\r\n  'print',\r\n  'search',\r\n  'chevron-double-up',\r\n  'chevron-double-down',\r\n  'check',\r\n  'check-double',\r\n  'info',\r\n  'triangle-exclamation',\r\n  'xmark',\r\n  'chevron-down',\r\n  'circle-xmark',\r\n  'ellipsis-v',\r\n  'plus',\r\n  'filter',\r\n  'table',\r\n  'minus',\r\n  'file-import',\r\n  'globe',\r\n  'lock-open',\r\n  'edit',\r\n  'trash',\r\n  'info-circle',\r\n  'grip-vertical',\r\n  'bell-slash',\r\n  'exclamation-circle',\r\n  'times-circle',\r\n  'arrow-left',\r\n  'tools',\r\n  'play',\r\n  'history',\r\n  'add',\r\n  'stream',\r\n  'ruler-triangle',\r\n  'th-list',\r\n  'clipboard-list-check',\r\n  'pencil-alt',\r\n  'calendar-plus',\r\n  'pause',\r\n  'save',\r\n  'calendars',\r\n  'list-timeline',\r\n  'code',\r\n  'ban',\r\n  'floppy-disk-circle-arrow-right',\r\n  'calculator',\r\n  'refresh',\r\n  'square',\r\n  'clone',\r\n  'clock',\r\n  'chevron-right',\r\n  'chevrons-right',\r\n  'clipboard-list',\r\n  'envelope',\r\n  'calendar',\r\n  'check-circle',\r\n  'link',\r\n  'chevron-double-right',\r\n  'chevron-double-left',\r\n  'chevron-left',\r\n  'chevrons-left',\r\n  'list',\r\n  'user',\r\n  'grip-horizontal',\r\n  'arrow-from-left',\r\n  'vial',\r\n  'stopwatch',\r\n  'wrench',\r\n  'arrow-up-right-from-square',\r\n  'external-link',\r\n  'external-link-alt',\r\n  'close',\r\n  'download',\r\n  'bold',\r\n  'italic',\r\n  'underline',\r\n  'h1',\r\n  'h2',\r\n  'quote-right',\r\n  'list-ol',\r\n  'file-alt',\r\n  'at',\r\n  'barcode',\r\n  'chain',\r\n  'power-off',\r\n  'plug',\r\n  'microscope',\r\n  'calendar-check',\r\n  'calendar-exclamation',\r\n  'calendar-times',\r\n  'file-upload',\r\n  'spinner',\r\n  'money-check-edit',\r\n  'level-up-alt',\r\n  'paperclip',\r\n  'abacus',\r\n  'album',\r\n  'file',\r\n  'sync',\r\n  'rectangle-vertical-history',\r\n  'university',\r\n  'shop-slash',\r\n  'dollar-sign',\r\n  'exchange',\r\n  'sms',\r\n  'circle-check',\r\n  'triangle-exclamation',\r\n  'circle-quarters',\r\n  'circle-exclamation',\r\n  'minimize',\r\n  'maximize',\r\n  'table',\r\n  'calendars',\r\n  'telescope',\r\n  'infinity',\r\n  'calendar-check',\r\n  'calendar-exclamation',\r\n  'calendar-times',\r\n  'calendar-plus',\r\n  'maximize',\r\n  'comment-question',\r\n  'circle-exclamation',\r\n  'circle-check',\r\n  'google',\r\n  'user-plus',\r\n  'user-shield',\r\n  'warning',\r\n  'windows',\r\n  'location-crosshairs',\r\n  'circle-dollar-to-slot',\r\n  'code-branch',\r\n  'copy',\r\n  'chevrons-up',\r\n  'chevrons-down',\r\n  'equals',\r\n  'file-spreadsheet',\r\n  'file-pdf',\r\n  'newspaper',\r\n  'flag',\r\n  'barcode-scan',\r\n  'map',\r\n  'bars',\r\n  'magnifying-glass',\r\n  'grid-2',\r\n  'screwdriver',\r\n  'bullhorn',\r\n  'money-bill',\r\n  'file-arrow-up',\r\n  'earth-europe',\r\n  'share',\r\n  'scanner-keyboard',\r\n  'circle-notch',\r\n  'map-location',\r\n  'screwdriver-wrench',\r\n  'bandage',\r\n  'hourglass-half',\r\n];\r\nexport const getIconNames = (): Entity<string>[] => {\r\n  const iconst = IconNames.map(icon => {\r\n    return {\r\n      Id: icon\r\n        .split('-')\r\n        .map((item, i) => {\r\n          if (i === 0) {\r\n            return item.toLowerCase();\r\n          }\r\n          return item.charAt(0).toUpperCase() + item.slice(1).toLowerCase();\r\n        })\r\n        .join(''),\r\n      Name: icon,\r\n    };\r\n  });\r\n  return iconst;\r\n};\r\nexport const getIconNamesObject = () => {\r\n  const iconst = IconNames.map(icon => {\r\n    return {\r\n      [icon\r\n        .split('-')\r\n        .map((item, i) => {\r\n          if (i === 0) {\r\n            return item.toLowerCase();\r\n          }\r\n          return item.charAt(0).toUpperCase() + item.slice(1).toLowerCase();\r\n        })\r\n        .join('')]: icon,\r\n    };\r\n  });\r\n  return iconst;\r\n};\r\n","/**\r\n *\r\n * PublicAssetsLayout\r\n *\r\n */\r\n// import { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport * as React from 'react';\r\n\r\nexport interface PublicAssetsLayoutProps {\r\n  children: React.ReactNode;\r\n}\r\n\r\nexport function PublicAssetsLayout(props: PublicAssetsLayoutProps) {\r\n  const { children } = props;\r\n  // const { checkIsMobile } = useIsMobile();\r\n  // const isMobile = checkIsMobile();\r\n  return (\r\n    <div\r\n      style={{\r\n        display: 'flex',\r\n        boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.25)',\r\n        width: '100%',\r\n        height: '100dvh',\r\n      }}\r\n    >\r\n      {children}\r\n    </div>\r\n  );\r\n}\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PublicAssetsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.PublicAssetsPage,\r\n);\r\n","/*\r\n * Asynchronously loads the component for NotAllowedPage\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const NotAllowedPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.NotAllowed,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for PlayGroundPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const PlayGroundPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.PlayGroundPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetsInventoryPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetsInventoryPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AssetsInventoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for AssetsInventoryLogPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const AssetsInventoryLogPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.AssetsInventoryLogPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for UserTrainingPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const ServiceRequestAuditTrailHistoryPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.ServiceRequestAuditTrailHistoryPage,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for Floors Page\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const Floors = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.Floors,\r\n);\r\n","/**\r\n *\r\n * Asynchronously loads the component for SubscriptionTypesPage\r\n *\r\n */\r\n\r\nimport { lazyLoad } from 'utils/loadable';\r\n\r\nexport const SubscriptionTypesPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.SubscriptionTypesPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const BudgetExperimentsPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.BudgetExperiments,\r\n);\r\n","/**\r\n *\r\n * AddPricePeriod\r\n *\r\n */\r\n\r\nimport React from 'react';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { RenderPageType } from 'app/Layout/FrontendLayout/slice/type';\r\nimport { useDispatch } from 'react-redux';\r\nimport { useLayoutSlice } from 'app/Layout/FrontendLayout/slice';\r\nimport { RegionDetailsProps } from 'app/pages/Regions/RegionsDetailsPage/Details';\r\n\r\ninterface AddRegionProps {}\r\n\r\nexport function AddRegion(props: AddRegionProps): JSX.Element {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions } = useLayoutSlice();\r\n\r\n  //RENDER\r\n  return (\r\n    <React.Fragment>\r\n      <TopActionButton\r\n        text={t(translations.AddRegion) as string}\r\n        icon=\"plus\"\r\n        startIcon=\"plus\"\r\n        onClick={() => {\r\n          let params = {\r\n            useSidePanel: true,\r\n          } as RegionDetailsProps;\r\n          dispatch(\r\n            actions.openSidePanel({\r\n              type: RenderPageType.RegionDetails,\r\n              props: params,\r\n            }),\r\n          );\r\n        }}\r\n      />\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * Regions - Page\r\n *\r\n */\r\n\r\nimport { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport * as React from 'react';\r\nimport { withSavedHistoryT } from 'app/components/BasicTable/withSavedHistory';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { intersection } from 'lodash';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { getColumns } from './Columns';\r\nimport {\r\n  RowActionsMenu,\r\n  RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { AxiosError } from 'axios';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { IRegionDto } from '../IRegionDto';\r\nimport { IBasePageProps, IListPageProps } from 'app/pages/IBasePageProps';\r\nimport { GePageActions } from './Actions/GetPageActions';\r\n\r\n// IBasePageProps is for Routing\r\n// IListPageProps is for filtering has appliedFiler?: IFilterSettings<T>;\r\nexport interface RegionsProps\r\n  extends IBasePageProps,\r\n    IListPageProps<IRegionDto> {}\r\n\r\nexport function Regions(props: RegionsProps): JSX.Element {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions: notifyActions } = useAppSettingsSlice();\r\n  //USER AUTHENTICATION\r\n  const User: AuthenticatedUser | undefined = useSelector(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const roles: number[] | undefined = User?.Roles;\r\n  const allowedroles: Roles[] = [Roles.Administrators];\r\n  const IsAdmin: boolean = intersection(roles, allowedroles).length > 0;\r\n  const settings = useSelector(selectglobalSettings);\r\n  //COLUMNS\r\n  const columns = useMemo(() => {\r\n    return getColumns(t, settings);\r\n  }, [settings, t]);\r\n\r\n  //PAGE ACTIONS\r\n  const PageActions: PageActionRenderer[] = GePageActions({\r\n    isAdmin: IsAdmin,\r\n  });\r\n\r\n  //TABLE-INITIAL-STATE\r\n  const initialState: IBasicTableState<IRegionDto> = useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Id', desc: false }],\r\n    }),\r\n    [],\r\n  );\r\n  //SELECTED ROWS ACTIONS\r\n  const rowActions = React.useMemo<CellRenderer<IRegionDto>[]>(() => {\r\n    const result = IsAdmin\r\n      ? [\r\n          ({ row, onRefresh, ...rest }) => {\r\n            const items: RowActionsProps[] = [];\r\n            const handleDeleteClick = async () => {\r\n              const url = `/api/odata/v4/Regions(${row.original.Id})`;\r\n              try {\r\n                await httpClient.delete(url).then(response => {\r\n                  if ((response as any).ErrorMessages.length > 0) {\r\n                    (response as any).ErrorMessages.forEach(errmsg =>\r\n                      dispatch(\r\n                        notifyActions.addNotification({\r\n                          variant: 'error',\r\n                          message: errmsg,\r\n                        }),\r\n                      ),\r\n                    );\r\n                  } else {\r\n                    dispatch(\r\n                      notifyActions.addNotification({\r\n                        message: t(translations.Success),\r\n                        variant: 'success',\r\n                      }),\r\n                    );\r\n                  }\r\n                });\r\n                onRefresh();\r\n              } catch (error: unknown) {\r\n                const responsemessage = (error as AxiosError)?.response?.data\r\n                  ?.error?.innererror?.message as string;\r\n                const message =\r\n                  responsemessage === undefined\r\n                    ? t(translations.err_ErrorOccured)\r\n                    : responsemessage;\r\n                dispatch(\r\n                  notifyActions.addNotification({\r\n                    message: message,\r\n                    variant: 'error',\r\n                  }),\r\n                );\r\n              }\r\n            };\r\n            items.push({\r\n              onClick: handleDeleteClick,\r\n              text: t(translations.Delete) as string,\r\n              icon: 'trash',\r\n            });\r\n\r\n            return (\r\n              <RowActionsMenu id={`regions_${row.original.Id}`} items={items} />\r\n            );\r\n          },\r\n        ]\r\n      : [];\r\n    return result;\r\n  }, [IsAdmin, dispatch, notifyActions, t]);\r\n\r\n  const url = '/api/odata/v4/Regions';\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <TTable\r\n        screenId={ScreensId.Regions}\r\n        screenName={t(translations.menu_Regions)}\r\n        api={url}\r\n        columns={columns}\r\n        initialState={initialState}\r\n        searchColumns={['Name']}\r\n        rowActions={rowActions}\r\n        pageActions={PageActions}\r\n        serviceGroups={[]}\r\n      />\r\n    </>\r\n  );\r\n}\r\n\r\nconst TTable = withSavedHistoryT<IRegionDto>(\r\n  BasicTable,\r\n  '/Regions',\r\n  (t, appSettings, user, settings) => search => [],\r\n);\r\n","import RegionRenderer from 'app/components/BasicTable/CellRenderers/RegionRenderer';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { IRegionDto } from '../IRegionDto';\r\n\r\nexport const getColumns = (t: TFunction, settings: GlobalSettings) => {\r\n  const cols: Column<IRegionDto>[] = [\r\n    {\r\n      Header: t(translations.Id) as string,\r\n      accessor: 'Id',\r\n      Cell: RegionRenderer,\r\n    },\r\n    {\r\n      Header: t(translations.RegionName) as string,\r\n      accessor: 'Name',\r\n    },\r\n  ];\r\n  return cols;\r\n};\r\n","import { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { AddRegion } from './AddRegion';\r\n\r\ninterface GetPageActionsProps {\r\n  isAdmin: boolean;\r\n}\r\n\r\nexport function GePageActions(\r\n  props: GetPageActionsProps,\r\n): PageActionRenderer[] {\r\n  const PageActions = props.isAdmin\r\n    ? [(dataCount, refresh) => <AddRegion />]\r\n    : [];\r\n  return PageActions;\r\n}\r\n","/**\r\n *\r\n * RegionDetailsPage\r\n *\r\n */\r\nimport { GetRawValue } from 'app/components/BasicTable/types/FilterParam';\r\nimport { RouteComponentProps, useLocation } from 'react-router-dom';\r\nimport { RegionDetails } from './Details';\r\n\r\nexport interface RegionDetailsPageProps\r\n  extends RouteComponentProps<{ id: string }> {}\r\nexport function RegionDetailsPage(props: RegionDetailsPageProps) {\r\n  const location = useLocation();\r\n  const params = new URLSearchParams(location.search);\r\n\r\n  const regionId =\r\n    props.match.params['id'] || (GetRawValue(params, 'id') ?? undefined);\r\n  return <RegionDetails id={regionId} useSidePanel={false} />;\r\n}\r\n","/**\r\n *\r\n * AddSuperGroup\r\n *\r\n */\r\n\r\nimport React from 'react';\r\nimport { TopActionButton } from 'app/components/BasicButtons/TopActionButton';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\ninterface AddSuperGroupProps {}\r\n\r\nexport function AddSuperGroup(props: AddSuperGroupProps): JSX.Element {\r\n  const { t } = useTranslation();\r\n\r\n  //RENDER\r\n  return (\r\n    <React.Fragment>\r\n      <TopActionButton\r\n        target=\"_blank\"\r\n        variant=\"white\"\r\n        startIcon=\"plus\"\r\n        icon=\"plus\"\r\n        key={'newsupergroup'}\r\n        text={t(translations.CreateNew)}\r\n        href={{ search: {}, path: '/NewSuperGroup.aspx' }}\r\n      />\r\n      ,\r\n    </React.Fragment>\r\n  );\r\n}\r\n","/**\r\n *\r\n * Regions - Page\r\n *\r\n */\r\n\r\nimport { BasicTable, IBasicTableState } from 'app/components/BasicTable';\r\nimport * as React from 'react';\r\nimport { withSavedHistoryT } from 'app/components/BasicTable/withSavedHistory';\r\nimport {\r\n  selectAuthenticatedUser,\r\n  selectglobalSettings,\r\n} from 'app/slice/selectors';\r\nimport { Roles } from 'app/slice/types';\r\nimport { ScreensId } from 'enums/ConfigurableTypes';\r\nimport { translations } from 'locales/translations';\r\nimport { intersection } from 'lodash';\r\nimport { useMemo } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AuthenticatedUser } from 'types/AuthenticatedUser';\r\nimport { getColumns } from './Columns';\r\nimport {\r\n  RowActionsMenu,\r\n  RowActionsProps,\r\n} from 'app/components/BasicTable/RowActions';\r\nimport { CellRenderer } from 'app/components/BasicTable/BasicTableProps';\r\nimport { AxiosError } from 'axios';\r\nimport { httpClient } from 'api/HttpClient';\r\nimport { useAppSettingsSlice } from 'app/slice';\r\nimport { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { IBasePageProps, IListPageProps } from 'app/pages/IBasePageProps';\r\nimport { GePageActions } from './Actions/GetPageActions';\r\nimport { ISuperGroupDto } from '../ISuperGroupDto';\r\nimport { GetFilters } from './Filters';\r\n\r\n// IBasePageProps is for Routing\r\n// IListPageProps is for filtering has appliedFiler?: IFilterSettings<T>;\r\nexport interface SuperGroupsPageProps\r\n  extends IBasePageProps,\r\n    IListPageProps<ISuperGroupDto> {}\r\n\r\nexport function SuperGroupsPage(props: SuperGroupsPageProps): JSX.Element {\r\n  const { t } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const { actions: notifyActions } = useAppSettingsSlice();\r\n  //USER AUTHENTICATION\r\n  const User: AuthenticatedUser | undefined = useSelector(\r\n    selectAuthenticatedUser,\r\n  );\r\n  const roles: number[] | undefined = User?.Roles;\r\n  const allowedroles: Roles[] = [Roles.Administrators];\r\n  const IsAdmin: boolean = intersection(roles, allowedroles).length > 0;\r\n  const settings = useSelector(selectglobalSettings);\r\n  //COLUMNS\r\n  const columns = useMemo(() => {\r\n    return getColumns(t, settings, IsAdmin);\r\n  }, [IsAdmin, settings, t]);\r\n\r\n  //PAGE ACTIONS\r\n  const PageActions: PageActionRenderer[] = GePageActions({\r\n    isAdmin: IsAdmin,\r\n  });\r\n\r\n  //TABLE-INITIAL-STATE\r\n  const initialState: IBasicTableState<ISuperGroupDto> = useMemo(\r\n    () => ({\r\n      sortBy: [{ id: 'Id', desc: false }],\r\n    }),\r\n    [],\r\n  );\r\n  //SELECTED ROWS ACTIONS\r\n  const rowActions = React.useMemo<CellRenderer<ISuperGroupDto>[]>(() => {\r\n    const result = IsAdmin\r\n      ? [\r\n          ({ row, onRefresh, ...rest }) => {\r\n            const items: RowActionsProps[] = [];\r\n            const handleDeleteClick = async () => {\r\n              const url = `/api/odata/v4/SuperGroup(${row.original.Id})`;\r\n              try {\r\n                await httpClient.delete(url).then(response => {\r\n                  if ((response as any).ErrorMessages.length > 0) {\r\n                    (response as any).ErrorMessages.forEach(errmsg =>\r\n                      dispatch(\r\n                        notifyActions.addNotification({\r\n                          variant: 'error',\r\n                          message: errmsg,\r\n                        }),\r\n                      ),\r\n                    );\r\n                  } else {\r\n                    dispatch(\r\n                      notifyActions.addNotification({\r\n                        message: t(translations.Success),\r\n                        variant: 'success',\r\n                      }),\r\n                    );\r\n                  }\r\n                });\r\n                onRefresh();\r\n              } catch (error: unknown) {\r\n                const responsemessage = (error as AxiosError)?.response?.data\r\n                  ?.error?.innererror?.message as string;\r\n                const message =\r\n                  responsemessage === undefined\r\n                    ? t(translations.err_ErrorOccured)\r\n                    : responsemessage;\r\n                dispatch(\r\n                  notifyActions.addNotification({\r\n                    message: message,\r\n                    variant: 'error',\r\n                  }),\r\n                );\r\n              }\r\n            };\r\n            items.push({\r\n              onClick: handleDeleteClick,\r\n              text: t(translations.Delete) as string,\r\n              icon: 'trash',\r\n            });\r\n\r\n            return (\r\n              <RowActionsMenu id={`sgroup_${row.original.Id}`} items={items} />\r\n            );\r\n          },\r\n        ]\r\n      : [];\r\n    return result;\r\n  }, [IsAdmin, dispatch, notifyActions, t]);\r\n\r\n  const url = '/api/odata/v4/SuperGroup';\r\n  //RENDER\r\n  return (\r\n    <>\r\n      <TTable\r\n        screenId={ScreensId.SuperGroup}\r\n        screenName={t(translations.menu_Divisions)}\r\n        api={url}\r\n        columns={columns}\r\n        initialState={initialState}\r\n        searchColumns={['Name', 'Description', 'RegionName']}\r\n        additionalColumns={['RegionId', 'AssetId']}\r\n        rowActions={rowActions}\r\n        pageActions={PageActions}\r\n        serviceGroups={[]}\r\n      />\r\n    </>\r\n  );\r\n}\r\n\r\nconst TTable = withSavedHistoryT<ISuperGroupDto>(\r\n  BasicTable,\r\n  '/SuperGroups',\r\n  GetFilters,\r\n);\r\n","import { Link } from 'app/components/ExternalLink';\r\nimport { RegionLink } from 'app/pages/Regions/RegionLink';\r\nimport { TFunction } from 'i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Column } from 'react-table';\r\nimport { GlobalSettings } from 'utils/globalSettings';\r\nimport { ISuperGroupDto } from '../ISuperGroupDto';\r\n\r\nexport const getColumns = (\r\n  t: TFunction,\r\n  settings: GlobalSettings,\r\n  isAdmin: boolean,\r\n) => {\r\n  const cols: Column<ISuperGroupDto>[] = [\r\n    {\r\n      Header: t(translations.Id) as string,\r\n      accessor: 'Id',\r\n      Cell: ({ value, row }) => {\r\n        if (isAdmin) {\r\n          return (\r\n            <>\r\n              <Link\r\n                href={`/newsupergroup.aspx?edit=${row.original.Id}`}\r\n                target={'_blank'}\r\n              >\r\n                {value}\r\n              </Link>\r\n            </>\r\n          );\r\n        } else {\r\n          return <>{value}</>;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Name) as string,\r\n      accessor: 'Name',\r\n    },\r\n    {\r\n      Header: t(translations.RegionName) as string,\r\n      accessor: 'RegionName',\r\n      Cell: ({ value, row }) => {\r\n        if (\r\n          row.original.RegionId !== null &&\r\n          row.original.RegionId !== undefined\r\n        ) {\r\n          return (\r\n            <>\r\n              {isAdmin ? (\r\n                <RegionLink\r\n                  id={row.original.RegionId}\r\n                  initialModel={{\r\n                    Id: row.original.RegionId,\r\n                    Name: row.original.RegionName,\r\n                  }}\r\n                  useSidePanel={true}\r\n                >\r\n                  {value}\r\n                </RegionLink>\r\n              ) : (\r\n                <>{value}</>\r\n              )}\r\n            </>\r\n          );\r\n        } else {\r\n          return <>{'N/A'}</>;\r\n        }\r\n      },\r\n    },\r\n    {\r\n      Header: t(translations.Description) as string,\r\n      accessor: 'Description',\r\n    },\r\n  ];\r\n  return cols;\r\n};\r\n","import { PageActionRenderer } from 'app/components/BasicTable/PageActions/PageActionsRenderer';\r\nimport { AddSuperGroup } from './AddSuperGroup';\r\n\r\ninterface GetPageActionsProps {\r\n  isAdmin: boolean;\r\n}\r\n\r\nexport function GePageActions(\r\n  props: GetPageActionsProps,\r\n): PageActionRenderer[] {\r\n  const PageActions = props.isAdmin\r\n    ? [(dataCount, refresh) => <AddSuperGroup />]\r\n    : [];\r\n  return PageActions;\r\n}\r\n","/**\r\n *\r\n * supergroups - Filters\r\n *\r\n */\r\nimport { ODataOperators } from 'api/odata/ODataFilter';\r\nimport { GetPageFilters } from 'app/components/BasicTable/BasicFilter/GetPageFilters';\r\nimport { IFilterSettings } from 'app/components/BasicTable/BasicFilter/IFilterSettings';\r\n\r\nimport RegionFilter from 'app/components/BasicTable/Filters/RegionFilter';\r\nimport {\r\n  URLSearchParamsCI,\r\n  GetPartialEntity,\r\n  GetRawValue,\r\n  GetNumberOrUndefined,\r\n  initExPickerValue,\r\n} from 'app/components/BasicTable/types/FilterParam';\r\nimport { initRegionData } from 'app/components/pickers/AutocompletePickers/RegionPicker';\r\nimport { translations } from 'locales/translations';\r\nimport { ISuperGroupDto } from '../ISuperGroupDto';\r\n\r\nexport const GetFilters: GetPageFilters<ISuperGroupDto> = (\r\n  t,\r\n  appSettings,\r\n  user,\r\n  settings,\r\n) => search => {\r\n  const params = new URLSearchParamsCI(search);\r\n  var result: IFilterSettings<ISuperGroupDto>[] = [\r\n    {\r\n      fieldName: 'RegionId',\r\n      displayName: t(translations.Region),\r\n      operator: ODataOperators.Equals,\r\n      queryStringSerializer: 'regionid',\r\n      initData: initExPickerValue(initRegionData, undefined, 'base'),\r\n      value: GetPartialEntity(\r\n        GetNumberOrUndefined(GetRawValue(params, 'regionid')),\r\n      ),\r\n      component: RegionFilter,\r\n      urlType: 'base',\r\n    },\r\n  ];\r\n  return result;\r\n};\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const JoinAdGroupPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.JoinAdGroupPage,\r\n);\r\n","import { lazyLoad } from 'utils/loadable';\r\n\r\nexport const JoinConfirmPage = lazyLoad(\r\n  () => import('./index'),\r\n  module => module.JoinConfirmPage,\r\n);\r\n","/**\r\n *\r\n * App\r\n *\r\n * This component is the skeleton around the actual pages, and should only\r\n * contain code that should be seen on all pages. (e.g. navigation bar)\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Switch, Route } from 'react-router-dom';\r\n\r\nimport { GlobalStyle, CustomStyle } from 'styles/global-styles';\r\n\r\nimport { NotFoundPage } from './pages/NotFoundPage/Loadable';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { FrontendLayout } from 'app/Layout/FrontendLayout/Loadable';\r\n\r\nimport {\r\n  ThemeProvider as MuiThemeProvider,\r\n  StylesProvider,\r\n  jssPreset,\r\n} from '@material-ui/core/styles';\r\nimport { create } from 'jss';\r\nimport rtl from 'jss-rtl';\r\n\r\nimport { CreateTheme } from 'styles/theme';\r\nimport { SnackbarProvider } from 'notistack';\r\n\r\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\r\n\r\n// pick a date util library\r\nimport DateFnsUtils from '@date-io/date-fns';\r\nimport * as dateFnsLocales from 'date-fns/locale';\r\n\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport {\r\n  selectAppSettings,\r\n  selectDateFnsLocale,\r\n  selectIsAuthenticated,\r\n  selectLoading,\r\n  selectLoadingUser,\r\n} from 'app/slice/selectors';\r\nimport { useAppSettingsSlice } from './slice';\r\nimport { useEffect } from 'react';\r\n\r\n// import i18n (needs to be bundled ;))\r\nimport '../locales/i18n';\r\nimport { AnimalTypesPage } from './pages/AnimalTypesPage/Loadable';\r\n\r\nimport { DialogAlert } from './components/DialogAlert';\r\nimport { ErrorBoundary } from './components/ErrorBoundary';\r\nimport { SnackbarManager } from './Layout/FrontendLayout/components/Snackbar/Loadable';\r\nimport { InternalIdLoginPage } from './pages/Animals/InternalIdLoginPage/Loadable';\r\nimport { AnimalsListPage } from './pages/AnimalsListPage/Loadable';\r\nimport { PosLayout } from './Layout/PosLayout';\r\nimport { AnimalCaseConsumablesPage } from './pages/Animals/AnimalCaseConsumablesPage/Loadable';\r\nimport { LoginLayout } from './Layout/LoginLayout';\r\nimport { AnimalsHomePage } from './pages/Animals/AnimalsHomePage/Loadable';\r\nimport { ConnectedRouter } from 'connected-react-router';\r\n\r\nimport { PrivateAnimalRoute } from './pages/Animals/PrivateAnimalRoute';\r\nimport Grow from '@material-ui/core/Grow';\r\nimport { TransitionProps } from '@material-ui/core/transitions/transition';\r\nimport { CssBaseline } from '@material-ui/core';\r\nimport { CreateNewCasePage } from './pages/Animals/CreateNewCasePage/Loadable';\r\nimport { SamplesListPage } from './pages/Samples/SamplesListPage/Loadable';\r\nimport { RunDetailsPage } from './pages/Samples/RunDetailsPage/Loadable';\r\nimport {\r\n  RequestDetailsPage,\r\n  RequestSamplesPage,\r\n} from './pages/Samples/RequestSamplesPage/Loadable';\r\nimport { TrainingSessionsPage } from './pages/TrainingSessionsPage/Loadable';\r\nimport { BuildingsPage } from './pages/Buildings/Loadable';\r\nimport { History } from './pages/ReservationHistoryPage/Loadable';\r\nimport { AddNewReportPage } from './pages/AddNewReportPage/Loadable';\r\nimport { Progress } from './components/LoadingIndicator';\r\nimport { TrainingWaitingListPage } from './pages/TrainingWaitingListPage/Loadable';\r\nimport { history } from 'store/history';\r\nimport { EmailNotificationsPage } from './pages/EmailNotificationsPage/Loadable';\r\nimport { ExperimentTemplatesPage } from './pages/ExperimentTemplates/Loadable';\r\nimport { UsersHistoryPage } from './pages/UsersHistoryPage/Loadable';\r\nimport { UserTrainingPage } from './pages/UserTrainingsPage/Loadable';\r\nimport { NotAvailable } from './pages/NotAvailablePage/Loadable';\r\nimport { RestrictedRoute } from './components/Routers/RestrictedRoute';\r\nimport { Users } from './pages/UsersPage/loadable';\r\nimport { AnimalExtendedBillingReportPage } from './pages/Animals/AnimalExtendedBillingReportPage/Loadable';\r\nimport { UserTrainingHistoryPage } from './pages/UserTrainingHistoryPage/Loadable';\r\nimport { OtherServicesPage } from './pages/OtherServicesPage/Loadable';\r\nimport { BudgetsPage } from './pages/BudgetsPage/Loadable';\r\nimport { ServiceRequestPage } from './pages/ServiceRequestListPage/Loadable';\r\nimport { WorkOrdersPage } from './pages/WorkOrdersPage/Loadable';\r\nimport { DocumentsPage } from './pages/Documents/Loadable';\r\nimport { QuizPage } from './pages/QuizPage/Loadable';\r\nimport { QuizDetailsPage } from './pages/QuizDetailsPage/Loadable';\r\nimport { UserTrainingDetailsPage } from './pages/UserTrainings/TrainingDetailsPage/Loadable';\r\nimport { SampleModificationsPage } from './pages/Samples/SampleModificationsPage/Loadable';\r\nimport { UsageHistory } from './pages/UsageHistoryPage/Loadable';\r\nimport { RunsListPage } from './pages/Samples/RunsListPage/Loadable';\r\nimport { AnimalCasesHistoryPage } from './pages/Animals/AnimalCaseEditPage/AnimalCasesHistory/Loadable';\r\nimport { SendEmailToUsersPage } from './pages/SendEmailToUsers/Loadable';\r\nimport { Charges } from './pages/ChargesPage/Loadable';\r\nimport { MyAssetsPage } from './pages/MyAssetsPage/Loadable';\r\nimport { Locations } from './pages/LocationsPage/loadable';\r\nimport { BuildingPage } from './pages/LocationsPage/BuildingPage/loadable';\r\nimport { CampusesPage } from './pages/LocationsPage/CampusesPage/loadable';\r\nimport { AreasPage } from './pages/LocationsPage/AreasPage/loadable';\r\nimport { LocationListPage } from './pages/LocationsPage/LocationListPage/loadable';\r\nimport { SubLocationListPage } from './pages/LocationsPage/SubLocationListPage/loadable';\r\nimport { InvoiceBatches } from './pages/InvoiceBatches/Loadable';\r\nimport { CategoriesPage } from './pages/CategoriesPage/Loadable';\r\nimport { CategoryGroupsPage } from './pages/CategoryGroupsPage/Loadable';\r\nimport { BillingPreviewPage } from './pages/BillingPreviewPage/Loadable';\r\nimport { OnlineBudgetsStatusPage } from './pages/OnlineBudgetsStatusPage';\r\nimport { InvoiceDetailsPage } from './pages/InvoiceDetails/Loadable';\r\nimport { WorkOrderDetailsPage } from './pages/WorkOrders/WorkOrderDetailsPage/Loadable';\r\nimport { Billing } from './pages/InvoiceBillingPage/Loadable';\r\nimport { BillingActions } from './pages/BillingActions/BillingActionsPage/Loadable';\r\nimport { BillingActionsDetailsPage } from './pages/BillingActions/BillingActionsDetailsPage/Loadable';\r\nimport { LocationTypesPage } from './pages/LocationsPage/LocationTypesPage/loadable';\r\nimport { SubLocationTypesPage } from './pages/LocationsPage/SubLocationTypesPage/loadable';\r\nimport { GetBrowserInfo } from 'utils/mobileDetect';\r\nimport { SavedViewDetailsPage } from './pages/SavedViewsPage/SavedViewPage/Loadable';\r\nimport { SavedViews } from './pages/SavedViewsPage/SavedViewsPage/Loadable';\r\nimport { LabelTypesPage } from './pages/LabelTypesPage/Loadable';\r\nimport { AssetDetailsPage } from './pages/AssetDetailsPage/Loadable';\r\nimport { LabelPrintDialog } from './components/LabelPrint/LabelPrintDialog/Loadable';\r\nimport { KioskProjectsPage } from './pages/KioskProjects/Loadable';\r\nimport { KioskProjectConsumablesPage } from './pages/KioskProjects/KioskProjectConsumablesPage/Loadable';\r\nimport { PrivateKioskProjectsRoute } from './pages/KioskProjects/PrivateKioskProjectsRoute/Loadable';\r\nimport { SessionTimeout } from './components/SessionTimeout';\r\nimport { SubmissionsPage } from './pages/QuizSubmissionsPage/Loadable';\r\nimport { QuizzesPage } from './pages/QuizzesPage/Loadable';\r\nimport { AdHocReportListPage } from './pages/AdHocReportListPage/Loadable';\r\nimport { Rooms } from './pages/RoomsPage/Loadable';\r\nimport { CalendarMessages } from './pages/CalendarMessages/CalendarMessagesPage/Loadable';\r\nimport { CoresDirectoryPage } from './pages/CoresDirectoryPage/Loadable';\r\nimport { SamplePlatesPage } from './pages/Samples/SamplePlatesPage/Loadable';\r\nimport { HeadTitle } from './Layout/FrontendLayout/components/HeadTitle';\r\nimport { InstrumentRestrictionsPage } from './pages/InstrumentRestrictionsPage/Loadable';\r\nimport { LabelTypeDetailsPage } from './pages/LabelTypeDetailsPage/Loadable';\r\nimport { ConfigurableColumnExportImportPage } from './pages/ConfigurableColumnExportImport/Loadable';\r\nimport { AppSettings } from 'types/AppSettings';\r\nimport { ServerBarcodeRoute } from './components/Routers/ServerBarcodesRoute';\r\nimport { useLayoutSlice } from './Layout/FrontendLayout/slice';\r\nimport { NewMessagePage } from './pages/NewMessagePage/Loadable';\r\nimport { OtherServiceDetailsPage } from './pages/OtherServiceDetails/OtherServiceDetailsPage/Loadable';\r\nimport { InvoiceTemplates } from './pages/InvoiceTemplates/InvoiceTemplatesPage/Loadable';\r\nimport { Expenses } from './pages/ExpensesPage/Loadable';\r\nimport { PricePeriodsPagePage } from './pages/PriceSheetPeriodsPage/Loadable';\r\nimport { PriceSheetPeriodDetailsPage } from './pages/PriceSheetPeriodDetails/PriceSheetPeriodDetailsPage/Loadable';\r\nimport { ArticlesPagePath, ArticlesPage } from './pages/ArticlesPage/Loadable';\r\nimport {\r\n  ArticlesExternalSearchPagePath,\r\n  ArticlesExternalSearchPage,\r\n} from './pages/ArticlesExternalSearchPage/Loadable';\r\nimport { AccountLayout } from './Layout/AccountLayout/Loadable';\r\nimport { RegisterPage } from './pages/Account/Register/Loadable';\r\nimport { anonimusUrls } from './slice/types';\r\nimport {\r\n  CalendarPage,\r\n  CalendarPageDefaultRedir,\r\n} from './pages/CalendarPage/Loadable';\r\nimport {\r\n  calendarPageDefaultPath,\r\n  calendarPageFullPath,\r\n  CalendarPagePaths,\r\n} from './pages/CalendarPage';\r\nimport { ReservationDetailsPage } from './pages/ReservationDetails/ReservationDetailsPage/Loadable';\r\nimport { HomePage } from './pages/HomePage/Loadable';\r\nimport { SystemPage } from './pages/SystemPage/Loadable';\r\nimport { DashboardPage } from './pages/DashboardPage/Loadable';\r\nimport { CoreSelectionPage } from './pages/CoreSelectionPage/Loadable';\r\nimport { CoreHomePage } from './pages/CoreHomePage/Loadable';\r\nimport { CoreStatsPage } from './pages/CoreStatsPage/Loadable';\r\nimport { ReportingPage } from './pages/ReportingPage/Loadable';\r\nimport { BookitLabDashboadPage } from './pages/BookitLabDashboardPage/Loadable';\r\nimport { RedirectWithSearch } from './components/RedirectWithSearch';\r\nimport { AssetSelectionPage } from './pages/MyAssetsPage/AssetsSelection/Loadable';\r\nimport { TermsOfUseAgreementPage } from './pages/TermsOfUseAgreementPage/Loadable';\r\nimport { SnackWrapper } from './Layout/FrontendLayout/components/Snackbar/SnackWrapper';\r\nimport { ActiveUserGroupPage } from './pages/ActiveUserGroupPage/Loadable';\r\nimport { CannedReportsPage } from './pages/CannedReports/Loadable';\r\nimport { ServiceRequestDetailsPath } from './pages/Samples/RequestSamplesPage/slice/path';\r\nimport { UserAttributes } from './pages/UserAttributes/UserAttributesPage/Loadable';\r\nimport { ReportConsumablesPage } from './pages/OtherServiceDetails/ReportConsumables/ReportConsumablesPage/Loadable';\r\nimport { LoginPage } from './pages/LoginPage/Loadable';\r\nimport { CalendarMessagesDetailsPage } from './pages/CalendarMessages/CalendarMessagesDetails/Loadable';\r\nimport { ServiceRequestsKanbanPage } from './pages/ServiceRequestsKanbanPage/Loadable';\r\nimport { OfflineServiceTypesPage } from './pages/OfflineServiceTypesPage/Loadable';\r\nimport { RUN_DETAILS_PAGE_PATH } from './pages/Samples/RunDetailsPage';\r\nimport { NOTIFICATIONS_LOG_PAGE_PATH } from './pages/EmailNotificationsPage';\r\nimport { AnimalCaseEditPage } from './pages/Animals/AnimalCaseEditPage/Loadable';\r\nimport { ServiceRequestsKanbanPagePath } from './pages/ServiceRequestsKanbanPage';\r\nimport './AllIcons';\r\nimport { PublicAssetsLayout } from './Layout/PublicAssetsLayout';\r\nimport { PublicAssetsPage } from './pages/PublicAssets/Loadable';\r\nimport { NotAllowedPage } from './pages/NotAllowedPage/Loadable';\r\nimport { PlayGroundPage } from './pages/PlayGround/Loadable';\r\nimport { AssetsInventoryPage } from './pages/AssetsInventory/Loadable';\r\nimport { AssetsInventoryLogPage } from './pages/AssetsInventoryLog/Loadable';\r\nimport { ServiceRequestAuditTrailHistoryPage } from './pages/ServiceRequestAuditTrailHistoryPage/Loadable';\r\nimport { Floors } from './pages/FloorsPage/Loadable';\r\nimport { SubscriptionTypesPage } from './pages/SubscriptionTypesPage/Loadable';\r\nimport { BudgetExperimentsPage } from './pages/BudgetExperimentsPage/Loadable';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { Regions } from './pages/Regions/RegionsPage';\r\nimport { RegionDetailsPage } from './pages/Regions/RegionsDetailsPage';\r\nimport { SuperGroupsPage } from './pages/SuperGroups/SuperGroupsPage';\r\nimport { JoinAdGroupPage } from './pages/JoinAdGroup/Loadable';\r\nimport { JoinConfirmPage } from './pages/JoinAdGroup/JoinConfirmPage/Loadable';\r\n\r\nconst jss = create({ plugins: [...jssPreset().plugins, rtl()] });\r\n\r\nexport function App() {\r\n  const { i18n } = useTranslation();\r\n  const dispatch = useDispatch();\r\n  const isAuthenticated = useSelector(selectIsAuthenticated);\r\n  const userLoading = useSelector(selectLoadingUser);\r\n  const isLoading = useSelector(selectLoading);\r\n  const isLoginPage = React.useMemo(() => {\r\n    return window.location.pathname.toLowerCase().indexOf('login') > -1;\r\n  }, []);\r\n  const isPublicPage = React.useMemo(() => {\r\n    return anonimusUrls.some(\r\n      f => window.location.pathname.toLowerCase().indexOf(f) > -1,\r\n    );\r\n  }, []);\r\n  //const [noValidLocation, setNoValidLocation] = React.useState<boolean>(false);\r\n  const useEffectOnMount = (effect: React.EffectCallback) => {\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n    useEffect(effect, []);\r\n  };\r\n  const { actions } = useAppSettingsSlice();\r\n  // run the layout slice ahead of time so that it will process global actions like openSidePanel, etc.\r\n  useLayoutSlice();\r\n  useEffectOnMount(() => {\r\n    if (!isLoginPage) {\r\n      dispatch(actions.getAuthenticatedUser(isPublicPage));\r\n      window.scrollTo(0, 1);\r\n    } else {\r\n      dispatch(actions.loadLoginSystemSettings());\r\n    }\r\n  });\r\n  React.useEffect(() => {\r\n    if (!isLoginPage) {\r\n      if (!userLoading && isAuthenticated !== undefined) {\r\n        if (isAuthenticated) {\r\n          // if (noValidLocation) {\r\n          //   window.location.href = toRootedURL('/Divisions.aspx');\r\n          // }\r\n          dispatch(actions.loadAppSettings(true));\r\n          dispatch(actions.loadSiteMapSettings());\r\n          dispatch(actions.loadUserProfileSettings());\r\n          dispatch(actions.loadGlobalServiceGroupFilter());\r\n          dispatch(actions.loadSystemSettings());\r\n          setTimeout(() => dispatch(actions.loadEventsCount()), 0);\r\n\r\n          GetBrowserInfo();\r\n        } else {\r\n          if (isPublicPage) {\r\n            dispatch(actions.loadAppSettings(false));\r\n          } else {\r\n            window.location.replace(toRootedURL('/login'));\r\n            //dispatch(actions.navigate('/login'));\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }, [\r\n    actions,\r\n    dispatch,\r\n    isAuthenticated,\r\n    isLoginPage,\r\n    isPublicPage,\r\n    userLoading,\r\n  ]);\r\n  // React.useEffect(() => {\r\n  //   setNoValidLocation(window.location.pathname.endsWith('index.html'));\r\n  // }, []);\r\n\r\n  const dir = i18n.dir();\r\n  const bookitTheme = CreateTheme('ltr', 'bookit');\r\n  const defaultTheme = CreateTheme(dir, 'default');\r\n  const animalTheme = CreateTheme(dir, 'animals');\r\n  const kioskTheme = CreateTheme('ltr', 'bookit');\r\n\r\n  document.body.dir = dir;\r\n  const dateFnsLocale = useSelector(selectDateFnsLocale);\r\n  const locale = React.useMemo(\r\n    () =>\r\n      dateFnsLocale === undefined ? undefined : dateFnsLocales[dateFnsLocale],\r\n    [dateFnsLocale],\r\n  );\r\n  const appSettings: AppSettings | null = useSelector(selectAppSettings);\r\n\r\n  return (\r\n    <MuiPickersUtilsProvider locale={locale} utils={DateFnsUtils}>\r\n      <StylesProvider jss={jss}>\r\n        <MuiThemeProvider theme={defaultTheme}>\r\n          <CustomStyle />\r\n          <CssBaseline />\r\n          {/* basename is required to properly route addresses when app is served from a non-root location like https://host/application/ */}\r\n          <ConnectedRouter history={history}>\r\n            {isLoading === false &&\r\n              //!noValidLocation &&\r\n              isAuthenticated === true && (\r\n                <ServerBarcodeRoute appSettings={appSettings} />\r\n              )}\r\n            {isLoading === false && <HeadTitle />}\r\n            {isLoading === false &&\r\n            //!noValidLocation &&\r\n            (isAuthenticated !== undefined || isLoginPage) ? (\r\n              <React.Fragment>\r\n                {isAuthenticated === true ? (\r\n                  <Switch>\r\n                    <Route\r\n                      key=\"route-defaultTheme\"\r\n                      exact\r\n                      path={[\r\n                        '/dashboards/home/',\r\n                        '/dashboards/core/:serviceGroupId?',\r\n                        '/dashboards/coreStats',\r\n                        '/dashboards/reporting',\r\n                        '/dashboards',\r\n                        '/systemdash',\r\n                        '/coreselection',\r\n                        '/BookitLabSupportDashboard',\r\n                        ...CalendarPagePaths,\r\n                        '/reservations',\r\n                        '/animaltypes',\r\n                        '/animals',\r\n                        '/samples',\r\n                        ServiceRequestDetailsPath,\r\n                        '/requests/:id/samples',\r\n                        '/requests',\r\n                        RUN_DETAILS_PAGE_PATH,\r\n                        '/samples/plates',\r\n                        '/samples/modifications',\r\n                        '/coresdirectory',\r\n                        '/trainingsessions',\r\n                        '/trainingwaitinglist',\r\n                        NOTIFICATIONS_LOG_PAGE_PATH,\r\n                        '/usertraining',\r\n                        '/usertraining/details/',\r\n                        '/usertraining/details/:id',\r\n                        '/CalendarMessages',\r\n                        '/CalendarMessages/details/',\r\n                        '/CalendarMessages/details/:id',\r\n                        '/Maps/Buildings',\r\n                        '/Maps/Rooms',\r\n                        '/Documents',\r\n                        '/AdHocReports',\r\n                        '/myassets',\r\n                        '/assets/details',\r\n                        '/AddNewReportPage',\r\n                        '/History',\r\n                        '/Users',\r\n                        '/Experiments/experimenttemplates',\r\n                        '/UsersHistory',\r\n                        '/quizzes',\r\n                        '/quizzes/create/:id',\r\n                        '/quizzes/details/:id',\r\n                        '/submissions',\r\n                        '/animals/cases/AnimalExtendedBillingReport',\r\n                        '/notavailable',\r\n                        '/notallowed',\r\n                        '/UserTrainingHistory',\r\n                        '/OtherServices',\r\n                        '/OtherServices/details/',\r\n                        '/OtherServices/details/:id',\r\n                        '/reportConsumables',\r\n                        '/Budgets/BudgetType/:id',\r\n                        '/WorkOrders',\r\n                        '/WorkOrders/details/',\r\n                        '/WorkOrders/details/:id',\r\n                        '/UsageHistory',\r\n                        '/Charges',\r\n                        '/serviceRequests',\r\n                        '/serviceRequests/kanban',\r\n                        // ServiceRequestTicketDetailsPagePath,\r\n                        '/samples/runs',\r\n                        '/animals/cases/AnimalCasesHistory/:id',\r\n                        '/SendEmailToUsers',\r\n                        '/Locations',\r\n                        '/Building',\r\n                        '/Campuses',\r\n                        '/Areas',\r\n                        '/LocationList',\r\n                        '/SubLocationList',\r\n                        '/InvoiceBatches',\r\n                        '/Categories',\r\n                        '/CategoryGroups',\r\n                        '/BillingPreview',\r\n                        '/OnlineBudgetsStatus',\r\n                        '/OnlineBudgetsStatus/:endDate',\r\n                        '/Invoices/Details',\r\n                        '/Invoices/Details/:id',\r\n                        '/Billing',\r\n                        '/BillingActions',\r\n                        '/BillingActions/details/',\r\n                        '/BillingActions/details/:id',\r\n                        '/LocationTypes',\r\n                        '/SubLocationTypes',\r\n                        '/mylists/details:id',\r\n                        '/mylists/details',\r\n                        '/mylists',\r\n                        '/labeltypes',\r\n                        '/labeltypes/details/',\r\n                        '/labeltypes/details/:id',\r\n                        '/instrumentRestrictions',\r\n                        '/NewMessage/:id',\r\n                        '/InvoiceTemplates',\r\n                        '/Expenses',\r\n                        '/ConfigurableColumnExportImport',\r\n                        '/reservation.aspx',\r\n                        '/reservations/details:id',\r\n                        '/reservations/details',\r\n                        '/PricePeriods',\r\n                        '/PricePeriods/details:id',\r\n                        '/PricePeriods/details',\r\n                        '/AssetSearch',\r\n                        '/TermsOfUseAgreement',\r\n                        '/ActiveUserGroup/:shrink',\r\n                        '/CannedReports',\r\n                        ArticlesExternalSearchPagePath,\r\n                        ArticlesPagePath,\r\n                        '/UserAttributes',\r\n                        '/OfflineServiceTypes',\r\n                        // '/Assets',\r\n                        '/Assets/Public',\r\n                        '/Assets/Inventory',\r\n                        '/Assets/Inventory/Log',\r\n                        '/PlayGround',\r\n                        '/ServiceRequestAuditTrailHistory',\r\n                        '/Maps/Floors',\r\n                        '/SubscriptionTypes',\r\n                        '/BudgetExperiments',\r\n                        '/supergroups',\r\n                        '/regions',\r\n                        '/regions/details:id',\r\n                        '/regions/details',\r\n                        '/Join/:shrink',\r\n                        '/JoinConfirm/:shrink',\r\n                      ]}\r\n                    >\r\n                      <MuiThemeProvider theme={bookitTheme}>\r\n                        {/* todo: fix the LatoStyle - after initial load, first dialog open results in a glitch: text elements are switched from lato to default and immediately back. this results in elements on the page jumping back and forth  */}\r\n                        {/* <LatoStyle /> */}\r\n                        <FrontendLayout>\r\n                          {/* todo : prepend public url like so to support virtual applications hosted at {process.env.PUBLIC_URL + '/Calendar'} */}\r\n                          <Switch key=\"switch-bookit-theme\">\r\n                            <Route\r\n                              path={'/dashboards/home'}\r\n                              component={HomePage}\r\n                            />\r\n                            <Route\r\n                              path={['/dashboards/core/:serviceGroupId?)']}\r\n                              component={CoreHomePage}\r\n                            />\r\n                            <Route\r\n                              path={'/dashboards/coreStats'}\r\n                              component={CoreStatsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/dashboards/reporting'}\r\n                              component={ReportingPage}\r\n                            />\r\n                            <Route\r\n                              path={'/dashboards'}\r\n                              component={DashboardPage}\r\n                            />\r\n                            <Route\r\n                              path={'/coreselection'}\r\n                              component={CoreSelectionPage}\r\n                            />\r\n                            <Route\r\n                              path={'/systemdash'}\r\n                              component={SystemPage}\r\n                            />\r\n                            <Route\r\n                              path={'/BookitLabSupportDashboard'}\r\n                              component={BookitLabDashboadPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={calendarPageFullPath}\r\n                              component={CalendarPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={calendarPageDefaultPath}\r\n                              component={CalendarPageDefaultRedir}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/animaltypes'}\r\n                              component={AnimalTypesPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/animals'}\r\n                              component={AnimalsListPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/serviceRequests'}\r\n                              component={ServiceRequestPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={ServiceRequestsKanbanPagePath}\r\n                              component={ServiceRequestsKanbanPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/requests/:id/samples'}\r\n                              component={RequestSamplesPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={ServiceRequestDetailsPath}\r\n                              component={RequestSamplesPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/requests'}\r\n                              component={RequestDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/samples'}\r\n                              component={SamplesListPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={RUN_DETAILS_PAGE_PATH}\r\n                              component={RunDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path=\"/samples/plates\"\r\n                              component={SamplePlatesPage}\r\n                            />\r\n\r\n                            <Route\r\n                              exact\r\n                              path={'/samples/runs'}\r\n                              component={RunsListPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path=\"/samples/modifications\"\r\n                              component={SampleModificationsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/coresdirectory'}\r\n                              component={CoresDirectoryPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/trainingsessions'}\r\n                              component={TrainingSessionsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/trainingwaitinglist'}\r\n                              component={TrainingWaitingListPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={NOTIFICATIONS_LOG_PAGE_PATH}\r\n                              component={EmailNotificationsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/Experiments/experimenttemplates'}\r\n                              component={ExperimentTemplatesPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/usertraining'}\r\n                              component={UserTrainingPage}\r\n                            />\r\n                            <Route\r\n                              path={'/usertraining/details/:id'}\r\n                              component={UserTrainingDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/usertraining/details/'}\r\n                              component={UserTrainingDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/Maps/Buildings'}\r\n                              component={BuildingsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/Documents'}\r\n                              component={DocumentsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/CalendarMessages'}\r\n                              component={CalendarMessages}\r\n                            />\r\n                            <Route\r\n                              path={'/CalendarMessages/details/:id'}\r\n                              component={CalendarMessagesDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/CalendarMessages/details'}\r\n                              component={CalendarMessagesDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/adhocreportlist'}\r\n                              component={AdHocReportListPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/Maps/Rooms'}\r\n                              component={Rooms}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/AdHocReports'}\r\n                              component={AdHocReportListPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/myassets'}\r\n                              component={MyAssetsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path=\"/assets/details\"\r\n                              component={AssetDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/AddNewReportPage'}\r\n                              component={AddNewReportPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/reservations'}\r\n                              component={History}\r\n                            />\r\n                            <RestrictedRoute\r\n                              exact\r\n                              path={'/Users'}\r\n                              component={Users}\r\n                            />\r\n                            <RestrictedRoute\r\n                              exact\r\n                              path={'/UsersHistory'}\r\n                              component={UsersHistoryPage}\r\n                            />\r\n\r\n                            <Route\r\n                              path={'/quizzes/create/:id'}\r\n                              component={QuizPage}\r\n                            />\r\n                            <Route\r\n                              path={'/quizzes/details/:id'}\r\n                              component={QuizDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/quizzes'}\r\n                              component={QuizzesPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/submissions'}\r\n                              component={SubmissionsPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              exact\r\n                              path={'/UserTrainingHistory'}\r\n                              component={UserTrainingHistoryPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/OtherServices'}\r\n                              component={OtherServicesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/OtherServices/details/:id'}\r\n                              component={OtherServiceDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/OtherServices/details/'}\r\n                              component={OtherServiceDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/reportConsumables'}\r\n                              component={ReportConsumablesPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/WorkOrders'}\r\n                              component={WorkOrdersPage}\r\n                            />\r\n                            <Route\r\n                              path={'/WorkOrders/details/:id'}\r\n                              component={WorkOrderDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/WorkOrders/details/'}\r\n                              component={WorkOrderDetailsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/UsageHistory'}\r\n                              component={UsageHistory}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/Charges'}\r\n                              component={Charges}\r\n                            />\r\n                            <Route\r\n                              path=\"/OnlineBudgetsStatus/:endDate?\"\r\n                              component={OnlineBudgetsStatusPage}\r\n                            />\r\n                            <Route\r\n                              component={NotAvailable}\r\n                              path={'/notavailable'}\r\n                            />\r\n                            <Route\r\n                              component={NotAllowedPage}\r\n                              path={'/notallowed'}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={\r\n                                '/animals/cases/AnimalExtendedBillingReport'\r\n                              }\r\n                              component={AnimalExtendedBillingReportPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/Budgets/BudgetType/:id'}\r\n                              component={BudgetsPage}\r\n                            />\r\n                            <Route\r\n                              exact\r\n                              path={'/animals/cases/AnimalCasesHistory/:id'}\r\n                              component={AnimalCasesHistoryPage}\r\n                            />\r\n\r\n                            <Route\r\n                              exact\r\n                              path={'/SendEmailToUsers'}\r\n                              component={SendEmailToUsersPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              exact\r\n                              path={'/Locations'}\r\n                              component={Locations}\r\n                            />\r\n                            <Route\r\n                              path={'/Building'}\r\n                              component={BuildingPage}\r\n                            />\r\n                            <Route\r\n                              path={'/Campuses'}\r\n                              component={CampusesPage}\r\n                            />\r\n                            <Route path={'/Areas'} component={AreasPage} />\r\n                            <Route\r\n                              path={'/SubLocationList'}\r\n                              component={SubLocationListPage}\r\n                            />\r\n                            <Route\r\n                              path={'/LocationList'}\r\n                              component={LocationListPage}\r\n                            />\r\n                            <Route\r\n                              path={'/LocationTypes'}\r\n                              component={LocationTypesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/SubLocationTypes'}\r\n                              component={SubLocationTypesPage}\r\n                            />\r\n                            <Route\r\n                              //exact\r\n                              path={'/InvoiceBatches'}\r\n                              component={InvoiceBatches}\r\n                            />\r\n                            <Route\r\n                              path={'/Categories'}\r\n                              component={CategoriesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/CategoryGroups'}\r\n                              component={CategoryGroupsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/BillingPreview'}\r\n                              component={BillingPreviewPage}\r\n                            />\r\n                            <Route\r\n                              path={'/Invoices/Details/:id'}\r\n                              component={InvoiceDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/Invoices/Details/'}\r\n                              component={InvoiceDetailsPage}\r\n                            />\r\n                            <Route path={'/Billing'} component={Billing} />\r\n                            <RestrictedRoute\r\n                              path={'/BillingActions'}\r\n                              component={BillingActions}\r\n                            />\r\n                            <Route\r\n                              path={'/BillingActions/details/:id'}\r\n                              component={BillingActionsDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/BillingActions/details'}\r\n                              component={BillingActionsDetailsPage}\r\n                            />\r\n                            <Route path={'/mylists'} component={SavedViews} />\r\n                            <Route\r\n                              path={'/mylists/details'}\r\n                              component={SavedViewDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/mylists/details/:id'}\r\n                              component={SavedViewDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/labeltypes'}\r\n                              exact\r\n                              component={LabelTypesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/labeltypes/details/:id'}\r\n                              component={LabelTypeDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/labeltypes/details'}\r\n                              component={LabelTypeDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/instrumentRestrictions'}\r\n                              component={InstrumentRestrictionsPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/InvoiceTemplates'}\r\n                              component={InvoiceTemplates}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/Expenses'}\r\n                              component={Expenses}\r\n                            />\r\n                            <Route\r\n                              path={'/ConfigurableColumnExportImport'}\r\n                              component={ConfigurableColumnExportImportPage}\r\n                            />\r\n                            <Route\r\n                              path={'/PlayGround'}\r\n                              component={PlayGroundPage}\r\n                            />\r\n                            {/* \r\n                              direct navigation/aspx links are redirected on the server side,\r\n                              so reservation details should get the /reservation/details here\r\n                              reservation.aspx link might be added by mistake somewhere in react, so these cases are handled here\r\n                            */}\r\n                            <RedirectWithSearch\r\n                              from=\"/reservation.aspx\"\r\n                              to=\"/reservations/details\"\r\n                            />\r\n                            <Route\r\n                              path={'/reservations/details:id'}\r\n                              component={ReservationDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/reservations/details/'}\r\n                              component={ReservationDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/PricePeriods'}\r\n                              component={PricePeriodsPagePage}\r\n                            />\r\n                            <Route\r\n                              path={'/PricePeriods/details:id'}\r\n                              component={PriceSheetPeriodDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/PricePeriods/details'}\r\n                              component={PriceSheetPeriodDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={ArticlesExternalSearchPagePath}\r\n                              component={ArticlesExternalSearchPage}\r\n                            />\r\n                            <Route\r\n                              path={'/AssetSearch'}\r\n                              component={AssetSelectionPage}\r\n                            />\r\n                            <Route\r\n                              path={ArticlesPagePath}\r\n                              component={ArticlesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/TermsOfUseAgreement'}\r\n                              component={TermsOfUseAgreementPage}\r\n                            />\r\n                            <Route\r\n                              path={'/ActiveUserGroup/:shrink'}\r\n                              component={ActiveUserGroupPage}\r\n                            />\r\n                            <Route\r\n                              path={'/CannedReports'}\r\n                              component={CannedReportsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/UserAttributes'}\r\n                              component={UserAttributes}\r\n                            />\r\n                            {/* <Route\r\n                              path={'/Assets'}\r\n                              component={PublicAssetsPage}\r\n                            /> */}\r\n                            <Route\r\n                              path={'/Assets/Public'}\r\n                              component={PublicAssetsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/Assets/Inventory'}\r\n                              component={AssetsInventoryPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/Assets/Inventory/Log'}\r\n                              component={AssetsInventoryLogPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/OfflineServiceTypes'}\r\n                              component={OfflineServiceTypesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/SubscriptionTypes'}\r\n                              component={SubscriptionTypesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/ServiceRequestAuditTrailHistory'}\r\n                              component={ServiceRequestAuditTrailHistoryPage}\r\n                            />\r\n                            <Route path={'/Maps/Floors'} component={Floors} />\r\n                            <Route\r\n                              path={'/SubscriptionTypes'}\r\n                              component={SubscriptionTypesPage}\r\n                            />\r\n                            <Route\r\n                              path={'/BudgetExperiments'}\r\n                              component={BudgetExperimentsPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/supergroups'}\r\n                              component={SuperGroupsPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/regions'}\r\n                              component={Regions}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/regions/details:id'}\r\n                              component={RegionDetailsPage}\r\n                            />\r\n                            <RestrictedRoute\r\n                              path={'/regions/details'}\r\n                              component={RegionDetailsPage}\r\n                            />\r\n                            <Route\r\n                              path={'/Join/:shrink'}\r\n                              component={ActiveUserGroupPage}\r\n                            />\r\n                            <Route\r\n                              path={'/JoinConfirm/:shrink'}\r\n                              component={ActiveUserGroupPage}\r\n                            />\r\n                            <Route component={NotFoundPage} />\r\n                          </Switch>\r\n                        </FrontendLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n\r\n                    <Route\r\n                      key=\"route-postLogin\"\r\n                      path={[\r\n                        '/TermsOfUseAgreement/:exp',\r\n                        '/ActiveUserGroup',\r\n                        '/Join',\r\n                        '/JoinConfirm',\r\n                      ]}\r\n                    >\r\n                      <MuiThemeProvider theme={bookitTheme}>\r\n                        <GlobalStyle />\r\n                        <PosLayout>\r\n                          <Route\r\n                            path={'/TermsOfUseAgreement/:exp'}\r\n                            component={TermsOfUseAgreementPage}\r\n                          />\r\n                          <Route\r\n                            path={'/ActiveUserGroup'}\r\n                            component={ActiveUserGroupPage}\r\n                          />\r\n                          <Route path={'/Join'} component={JoinAdGroupPage} />\r\n                          <Route\r\n                            path={'/JoinConfirm'}\r\n                            component={JoinConfirmPage}\r\n                          />\r\n                        </PosLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n\r\n                    <Route exact path={'/InternalIdLogin'}>\r\n                      <MuiThemeProvider theme={animalTheme}>\r\n                        <GlobalStyle />\r\n                        <LoginLayout>\r\n                          <Route\r\n                            exact\r\n                            path={'/InternalIdLogin'}\r\n                            component={InternalIdLoginPage}\r\n                          />\r\n                        </LoginLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n\r\n                    <Route exact path={'/KioskInternalIdLogin'}>\r\n                      <MuiThemeProvider theme={kioskTheme}>\r\n                        <GlobalStyle />\r\n                        <LoginLayout>\r\n                          <Route\r\n                            exact\r\n                            path={'/KioskInternalIdLogin'}\r\n                            component={InternalIdLoginPage}\r\n                          />\r\n                        </LoginLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n\r\n                    <PrivateAnimalRoute\r\n                      exact\r\n                      path={[\r\n                        '/animals/home',\r\n                        '/animals/cases/create',\r\n                        '/animals/cases/details/:id',\r\n                        '/animals/cases/consumables/:id',\r\n                      ]}\r\n                    >\r\n                      <MuiThemeProvider theme={animalTheme}>\r\n                        <PosLayout>\r\n                          <Route\r\n                            exact\r\n                            path={'/animals/cases/create'}\r\n                            component={CreateNewCasePage}\r\n                          />\r\n                          <Route\r\n                            exact\r\n                            path={'/animals/home'}\r\n                            component={AnimalsHomePage}\r\n                          />\r\n\r\n                          <Route\r\n                            exact\r\n                            path={'/animals/cases/consumables/:id'}\r\n                            component={AnimalCaseConsumablesPage}\r\n                          />\r\n                          <Route\r\n                            exact\r\n                            path={'/animals/cases/details/:id'}\r\n                            component={AnimalCaseEditPage}\r\n                          />\r\n                          <Route\r\n                            path={'/NewMessage/:id'}\r\n                            component={NewMessagePage}\r\n                          />\r\n                        </PosLayout>\r\n                      </MuiThemeProvider>\r\n                    </PrivateAnimalRoute>\r\n                    <PrivateKioskProjectsRoute\r\n                      exact\r\n                      path={[\r\n                        '/kiosk/projects',\r\n                        '/kiosk/projects/consumables',\r\n                        '/kiosk/projects/consumables/:id',\r\n                      ]}\r\n                    >\r\n                      <MuiThemeProvider theme={kioskTheme}>\r\n                        <PosLayout>\r\n                          <Route\r\n                            exact\r\n                            path={'/kiosk/projects'}\r\n                            component={KioskProjectsPage}\r\n                          />\r\n                          <Route\r\n                            exact\r\n                            path={'/kiosk/projects/consumables'}\r\n                            component={KioskProjectConsumablesPage}\r\n                          />\r\n                          <Route\r\n                            exact\r\n                            path={'/kiosk/projects/consumables/:id'}\r\n                            component={KioskProjectConsumablesPage}\r\n                          />\r\n                        </PosLayout>\r\n                      </MuiThemeProvider>\r\n                    </PrivateKioskProjectsRoute>\r\n                    <Route exact path={['/RegisterAccount', '/Login']}>\r\n                      <MuiThemeProvider theme={bookitTheme}>\r\n                        <AccountLayout>\r\n                          <Route\r\n                            exact\r\n                            path={'/RegisterAccount'}\r\n                            component={RegisterPage}\r\n                          />\r\n                          <Route exact path={'/login'} component={LoginPage} />\r\n                        </AccountLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n                    {/* <Route exact path={'/Login'}>\r\n                      <MuiThemeProvider theme={bookitTheme}>\r\n                        <AccountLayout>\r\n                          <Route exact path={'/login'} component={LoginPage} />\r\n                        </AccountLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route> */}\r\n\r\n                    <Route component={NotFoundPage} />\r\n                    <Route component={NotAvailable} path={'/notavailable'} />\r\n                    <Route component={NotAllowedPage} path={'/notallowed'} />\r\n                  </Switch>\r\n                ) : (\r\n                  <Switch>\r\n                    <Route exact path={['/RegisterAccount', '/Login']}>\r\n                      <MuiThemeProvider theme={bookitTheme}>\r\n                        <AccountLayout>\r\n                          <Route\r\n                            exact\r\n                            path={'/RegisterAccount'}\r\n                            component={RegisterPage}\r\n                          />\r\n                          <Route exact path={'/login'} component={LoginPage} />\r\n                        </AccountLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n                    <Route exact path={['/Assets/Public', '/Assets/Details']}>\r\n                      <MuiThemeProvider theme={bookitTheme}>\r\n                        <PublicAssetsLayout>\r\n                          {/* <Route\r\n                            exact\r\n                            path={'/Assets'}\r\n                            component={PublicAssetsPage}\r\n                          /> */}\r\n                          <Route\r\n                            exact\r\n                            path={'/Assets/Public'}\r\n                            component={PublicAssetsPage}\r\n                          />\r\n                          <Route\r\n                            exact\r\n                            path=\"/Assets/Details\"\r\n                            component={AssetDetailsPage}\r\n                          />\r\n                        </PublicAssetsLayout>\r\n                      </MuiThemeProvider>\r\n                    </Route>\r\n                  </Switch>\r\n                )}\r\n              </React.Fragment>\r\n            ) : (\r\n              <div>\r\n                <Progress inProgress={isLoading} size={80} />\r\n              </div>\r\n            )}\r\n            {/* <GlobalStyle /> */}\r\n\r\n            <MuiThemeProvider theme={bookitTheme}>\r\n              {isLoading === false &&\r\n                //!noValidLocation &&\r\n                isAuthenticated === true && <SessionTimeout />}\r\n\r\n              <ErrorBoundary>\r\n                <DialogAlert />\r\n              </ErrorBoundary>\r\n              <ErrorBoundary>\r\n                <SnackWrapper>\r\n                  <SnackbarProvider\r\n                    maxSnack={3}\r\n                    anchorOrigin={{\r\n                      vertical: 'bottom',\r\n                      horizontal: 'right',\r\n                    }}\r\n                    TransitionComponent={\r\n                      Grow as React.ComponentType<TransitionProps>\r\n                    }\r\n                  >\r\n                    <SnackbarManager />\r\n                  </SnackbarProvider>\r\n                </SnackWrapper>\r\n              </ErrorBoundary>\r\n              {isLoading === false &&\r\n                //!noValidLocation &&\r\n                isAuthenticated === true && (\r\n                  <ErrorBoundary>\r\n                    <LabelPrintDialog />\r\n                  </ErrorBoundary>\r\n                )}\r\n            </MuiThemeProvider>\r\n          </ConnectedRouter>\r\n        </MuiThemeProvider>\r\n      </StylesProvider>\r\n    </MuiPickersUtilsProvider>\r\n  );\r\n}\r\n","import { BARCODE_SCANNED, BARCODE_SCANNING } from 'react-usb-barcode-scanner';\r\n\r\nexport const barcodeScannerMiddleware = store => next => action => {\r\n  // processing barcode need to be here\r\n  if (action.type === BARCODE_SCANNED) {\r\n    console.debug(action);\r\n  }\r\n  if (action.type === BARCODE_SCANNING) {\r\n  }\r\n  return next(action);\r\n};\r\n","import { ReportHandler } from 'web-vitals';\r\n\r\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\r\n  if (onPerfEntry && onPerfEntry instanceof Function) {\r\n    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n      getCLS(onPerfEntry);\r\n      getFID(onPerfEntry);\r\n      getFCP(onPerfEntry);\r\n      getLCP(onPerfEntry);\r\n      getTTFB(onPerfEntry);\r\n    });\r\n  }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","/**\r\n *\r\n * MobileBarcodeScanner\r\n *\r\n */\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport React from 'react';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nimport { BARCODE_SCANNED } from 'react-usb-barcode-scanner';\r\nexport interface MobileBarcodeScannerProps {}\r\n\r\nexport const MobileBarcodeScanner = React.memo(function MobileBarcodeScanner(\r\n  props: MobileBarcodeScannerProps,\r\n) {\r\n  const dispatch = useDispatch();\r\n  const handleBarcodeScanned = (barcode: string) => {\r\n    dispatch({\r\n      type: BARCODE_SCANNED,\r\n      payload: {\r\n        data: barcode,\r\n      },\r\n    });\r\n  };\r\n  // sets the mobile barcode callback that will be called directly from the mobile app\r\n  useEffectOnMount(() => {\r\n    (window as any).mobileBarcodeScanCallback = handleBarcodeScanned;\r\n    return () => ((window as any).mobileBarcodeScanCallback = undefined);\r\n  });\r\n  return <div></div>;\r\n});\r\n","/**\r\n * index.tsx\r\n *\r\n * This is the entry file for the application, only setup and boilerplate\r\n * code.\r\n */\r\n\r\nimport 'react-app-polyfill/ie11';\r\nimport 'react-app-polyfill/stable';\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\n\r\n// Use consistent styling\r\nimport 'sanitize.css/sanitize.css';\r\n\r\n// Import root app\r\nimport { App } from 'app';\r\n\r\nimport { HelmetProvider } from 'react-helmet-async';\r\n\r\nimport { configureAppStore } from 'store/configureStore';\r\nimport { BarcodeScanner } from 'react-usb-barcode-scanner';\r\n\r\nimport reportWebVitals from 'reportWebVitals';\r\n\r\nimport WebfontLoader from '@dr-kobros/react-webfont-loader';\r\n// Initialize languages\r\nimport './locales/i18n';\r\nimport { MobileBarcodeScanner } from 'app/components/MobileBarcodeScanner';\r\n\r\nconst fontsConfig = {\r\n  // custom: {\r\n  //   families: ['Lato:wght@300;400;700;900&display=swap'],\r\n  //   urls: [`${process.env.PUBLIC_URL}/fonts/Lato/lato.css`],\r\n  // },\r\n  google: {\r\n    families: ['Lato:wght@300;400;700;900&display=swap'],\r\n  },\r\n};\r\nconst store = configureAppStore();\r\nconst MOUNT_NODE = document.getElementById('root') as HTMLElement;\r\n\r\nReactDOM.render(\r\n  <React.StrictMode>\r\n    <React.Suspense fallback={null}>\r\n      <Provider store={store}>\r\n        <HelmetProvider>\r\n          <WebfontLoader config={fontsConfig}>\r\n            <App />\r\n          </WebfontLoader>\r\n        </HelmetProvider>\r\n        <BarcodeScanner\r\n          config={{\r\n            intervalBetweenKeyPress: 50,\r\n            scanningEndTimeout: 200,\r\n            debug: process.env.NODE_ENV === 'development',\r\n            ignoreOnInput: false,\r\n            historyLength: 0,\r\n          }}\r\n        />\r\n        <MobileBarcodeScanner />\r\n      </Provider>\r\n    </React.Suspense>\r\n  </React.StrictMode>,\r\n  MOUNT_NODE,\r\n);\r\n\r\n// Hot reloadable translation json files\r\nif (module.hot) {\r\n  module.hot.accept(['./locales/i18n'], () => {\r\n    // No need to render the App again because i18next works with the hooks\r\n  });\r\n}\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n","/**\r\n * Create the store with dynamic reducers\r\n */\r\n\r\nimport { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';\r\nimport { createInjectorsEnhancer } from 'redux-injectors';\r\nimport createSagaMiddleware from 'redux-saga';\r\nimport { routerMiddleware as createRouterMiddleware } from 'connected-react-router';\r\n\r\nimport { createReducer as createReducerWithRouter } from './reducers';\r\nimport { history } from './history';\r\nimport { barcodeScannerMiddleware } from './BarcodeScanner';\r\n\r\nexport function configureAppStore() {\r\n  const reduxSagaMonitorOptions = {};\r\n  const sagaMiddleware = createSagaMiddleware(reduxSagaMonitorOptions);\r\n\r\n  const { run: runSaga } = sagaMiddleware;\r\n\r\n  // List middlewares here\r\n  const middlewares = [\r\n    // Create the store with saga middleware\r\n    sagaMiddleware,\r\n    // routerMiddleware is needed to to dispatch history actions (e.g. to change URL with push('/path/to/somewhere')).\r\n    createRouterMiddleware(history),\r\n    barcodeScannerMiddleware,\r\n  ];\r\n\r\n  // dev logging\r\n  // Log only in development\r\n  if (process.env.NODE_ENV === `development`) {\r\n    const { createLogger } = require(`redux-logger`);\r\n    middlewares.push(\r\n      createLogger({\r\n        collapsed: true,\r\n      }),\r\n    );\r\n  }\r\n\r\n  // Provide the created history to the root reducer creator.\r\n  const createReducer = createReducerWithRouter(history);\r\n\r\n  const enhancers = [\r\n    createInjectorsEnhancer({\r\n      createReducer,\r\n      runSaga,\r\n    }),\r\n  ];\r\n\r\n  const store = configureStore({\r\n    reducer: createReducer(),\r\n    middleware: [\r\n      ...middlewares,\r\n      ...getDefaultMiddleware({\r\n        serializableCheck: {\r\n          ignoredPaths: [\r\n            'workOrder.createState.data.StaffFormFiles',\r\n            'workOrder.createState.data.SubmissionFormFiles',\r\n          ],\r\n          ignoredActionPaths: [\r\n            'payload.workOrderDetails.SubmissionFormFiles',\r\n            'payload.workOrderDetails.StaffFormFiles',\r\n            'payload.current.SubmissionFormFiles',\r\n            'payload.current.StaffFormFiles',\r\n            'payload.customFormFiles',\r\n            'payload.currentCustomFormFiles',\r\n            'payload.originalCustomFormFiles',\r\n            'payload.state.customFormFiles',\r\n          ],\r\n        },\r\n      }),\r\n    ],\r\n    devTools: process.env.NODE_ENV !== 'production',\r\n    enhancers,\r\n  });\r\n\r\n  return store;\r\n}\r\n","/**\r\n * Combine all reducers in this file and export the combined reducers.\r\n */\r\n\r\nimport { combineReducers } from '@reduxjs/toolkit';\r\nimport { connectRouter } from 'connected-react-router';\r\nimport { barcodeScannerReducer } from 'react-usb-barcode-scanner';\r\nimport { InjectedReducersType } from 'utils/types/injector-typings';\r\n\r\n/**\r\n * Merges the main reducer with the router state and dynamically injected reducers\r\n */\r\nexport const createReducer = history => (\r\n  injectedReducers: InjectedReducersType = {},\r\n) => {\r\n  // Create a function that takes history as an argument and returns the root reducer.\r\n  // Add router reducer into root reducer by passing history to connectRouter.\r\n  // Note: The key MUST be router.\r\n\r\n  return combineReducers({\r\n    router: connectRouter(history),\r\n    barcodeScanner: barcodeScannerReducer,\r\n    ...injectedReducers,\r\n  });\r\n};\r\n"],"sourceRoot":""}